It took me a while to figure out how to setup this thing because there is almost no documentation on how to do it and the configuration options are very misleading to say the least, so here is a little tutorial on how to task syncing on taskwarrior 3.0.
There are many ways to sync your tasks but the only one that didn't
seem to be horrible was taskchampion. If you want to learn more
about other ways to do this you can read the manual page with the
command man task-sync
.
I'm using NixOS so this was pretty trivial for me. I made the
service accessible through a reverse proxy with nginx.
If you don't know what NixOS is you can just ignore this part and
find a wiki page on how to setup taskchampion on your distro.
allowedClientIds
means later.
Once we have the sync server up and running we need to configure the clients that will connect to it. For example I had to configure my laptop and desktop.
By default taskwarrior will be an asshole and create the taskrc at
~/.taskrc
, cluttering your home and giving you another
problem to deal with in your life, which you never should have had
to deal with in the first place.
Thankfully you can move it to ~/.config/task/taskrc
without the usual 1-2 combo follow up problem of having to export
global vars like
TASK_CONFIG_HOME="$XDG_CONFIG_HOME/task/taskrc"
and
TASK_DATA_HOME="$XDG_DATA HOME/task"
.
Instead it goes for the unconventional approach of defining those
dreaded global vars in the config file directly like so:
Next you have to configure the sync settings. Let me explain the non obvious settings.
client_id
, unlike it's name would lead you to believe,
is not a unique id for your device at all. It's a unique id for the
task database you are syncing to the server, a better name for it
would be database_id
.
This means you should set
this to the same id on all the devices you intend to sync the
database too. You can use the uuidgen
command for
this.
encryption_secret
is the key used to encrypt the
database when sending it over the network. Don't share this with
anyone. You can generate it with whatever you want, I just used
bitwarden. I don't know what kind of encryption it's using so I
went with a long key just in case.
Once you have setup your taskrc with the same sync settings on all
your devices you can sync the database by running task
sync
on your devices.
If you are successfully syncing your database with no error
messages but the tasks aren't syncing, you've probably already
synced your database with bad settings previously. I made the same
mistake because I thought that client_id
was a unique
id to identify your devices and so I synced my db on multiple
devices with different client ids. To fix this I suggest backing up
your database and then running task export > test && task
import test
to clear the sync metadata. After this,
syncing should work correctly again.