Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Setup taskwarrior taskserver on ec2 amazon linux
#A sequence for installing a taskwarrior server on an ec2 amazon linux instance
#hopefully this can save someone a bunch of time
#FIRST go to the ec2 instance management panel,
#edit the security group for the instance and add an inbound rule, custom tcp, port 53589, source anywhere (
#THEN ssh to the box as ec2-user and run the following
#build taskserver
sudo yum install gcc cmake gnutls-devel gnutls-utils libuuid-devel clang
curl -O
tar xzf taskd-latest.tar.gz
cd taskd-1.1.0
cmake -DCMAKE_BUILD_TYPE=release .
sudo make install
sudo groupadd tasker
sudo usermod -a -G tasker ec2-user
#reconnect ssh ec2-user
export TASKDDATA=/var/taskd
sudo mkdir -p $TASKDDATA
sudo chown -R root:tasker $TASKDDATA
sudo chmod 2775 $TASKDDATA
find $TASKDDATA -type d -exec sudo chmod 2775 {} \;
find $TASKDDATA -type f -exec sudo chmod 0664 {} \;
#NOTE replace in the below with your own ec2 instance public dns
taskd init
taskd config server
cd ~/taskd-1.1.0/pki/
vi vars (edit CN and others as necessary)
cp *.pem $TASKDDATA
taskd config --force client.cert $TASKDDATA/client.cert.pem
taskd config --force client.key $TASKDDATA/client.key.pem
taskd config --force server.cert $TASKDDATA/server.cert.pem
taskd config --force server.key $TASKDDATA/server.key.pem
taskd config --force server.crl $TASKDDATA/server.crl.pem
taskd config --force ca.cert $TASKDDATA/ca.cert.pem
taskd config --force log $PWD/taskd.log
taskd config --force pid.file $PWD/
taskd config --force server
taskdctl start
#In below replace Warriors with your organisation name & replace Graymouser with your user name
taskd add org Warriors
taskd add user 'Warriors' 'Graymouser'
#Note new user key
cd ~/taskd-1.1.0/pki
./generate.client graymouser
#copy the ca.cert & the generated user cert & key files to your taskwarrior client box/device
#on your local client box/device run
task config taskd.certificate -- ~/.task/graymouser.cert.pem
task config taskd.key -- ~/.task/graymouser.key.pem
task config -- ~/.task/ca.cert.pem
task config taskd.server --
task config taskd.credentials -- Warriors/Graymouser/<new-user-key-from-earlier>
#To run on startup you can edit rc.local and add the following line
su ec2-user -c "/usr/local/bin/taskd server --data /var/taskd --daemon"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment