-
Notifications
You must be signed in to change notification settings - Fork 9
Running Taskserver locally
There are some helper methods so that you can connect a locally running app to a locally running Taskserver.
- dependencies:
- dart
- make
- taskd
- taskwarrior
Open a terminal and navigate to your clone of taskw-dart.
cd fixture
make install # Installs an executable from ../taskc named taskd-setup
make setup # Configures taskd with TASKDDATA=./var/taskd and adds .taskrc and .task/*.pem files to ../task/assets
make # Starts taskd process with verbose output to terminal
This should work as described on Linux and macOS.
You can check taskd diagnostics with the following:
cd fixture
TASKDDATA=./var/taskd taskd diagnostics
If you'd like to verify the server is working for clients, try opening a second terminal, navigate again to your clone of taskw-dart, and try the following:
cd task/assets
HOME=$(pwd)
task diagnostics
task sync
Run the same commands as described above, but we use a GNU/Linux guest
to satisfy the dependencies, most importantly taskd
. I've had recent
success with Debian on WSL 2. I find Debian to be a somewhat familiar
distro, and easy enough to install taskd
stable via the package
manager.
Ensure that the Linux guest does not use the host dart
executable. Follow Dart project's documentation to install on Linux,
and ensure that readlink -f $(which dart)
resolves to an address
that does not start with /mnt/c/
. Otherwise, inadvertently calling
the dart
executable on the C:
drive, from within the VM, seemed to
break later usage of the flutter
executable when run in PowerShell.
To navigate to taskw-dart
, I had success with something like the
following:
cd /mnt/c/Users/$username/path/to/taskw-dart/
Then cd fixture
, etc, should work.
You might be able to replace the above with cd docker
and make
,
but this is currently broken on Windows.
Navigate in a second terminal to your clone of taskw-dart, and run the following:
cd task
flutter run
In the app, select an appropriate profile, or create a new one, and
navigate to Taskserver Configuration screen. Then click the debug
button. The debug button conveniently adds the files from
../task/assets
mentioned above, but if you ran make setup
after
the app was already running, you'll instead have to use the usual file
picking methods to select from /path/to/taskw-dart/task/assets
.
Now you should be able to connect to the locally running taskd process with the statistics or synchronize buttons.
You can run client from host PowerShell, rather than the guest Linux session described in the hosts section above.
With the PEM files generated via taskd project's pki scripts, when you
click statistics
or synchronize
buttons, the server.cert
can't
be verified with the taskd.ca
on iOS and macOS clients. You'll have
to press the Trust button to continue.
I'm guessing it's something to do with the Dart Socket implementation and the Apple APIs used. I think Dart has unit tests that seem to succeed here, so researching those may help find a solution, but I have not set aside time to research.
Replace make setup
and make
with make setup-android
and make android
.
This essentially changes addresses. Usually, it suffices to use
localhost
for both binding address and address for client to connect
to. But for Android, we set binding address to 127.0.0.1
and address
for client to 10.0.2.2
.