Skip to content

Instantly share code, notes, and snippets.

@graymouser
Created November 12, 2016 12:47
Show Gist options
  • Save graymouser/8771fdcf0d7715929073b4f8b6143b40 to your computer and use it in GitHub Desktop.
Save graymouser/8771fdcf0d7715929073b4f8b6143b40 to your computer and use it in GitHub Desktop.
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 (0.0.0.0/0)
#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 http://taskwarrior.org/download/taskd-latest.tar.gz
tar xzf taskd-latest.tar.gz
cd taskd-1.1.0
cmake -DCMAKE_BUILD_TYPE=release .
make
sudo make install
#SETUP
sudo groupadd tasker
sudo usermod -a -G tasker ec2-user
exit
#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 ec2-35-163-127-155.us-west-2.compute.amazonaws.com in the below with your own ec2 instance public dns
taskd init
taskd config server ec2-35-163-127-155.us-west-2.compute.amazonaws.com:53589
cd ~/taskd-1.1.0/pki/
vi vars (edit CN and others as necessary)
./generate
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
cd $TASKDDATA/..
taskd config --force log $PWD/taskd.log
taskd config --force pid.file $PWD/taskd.pid
taskd config --force server ec2-35-163-127-155.us-west-2.compute.amazonaws.com:53589
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 taskd.ca -- ~/.task/ca.cert.pem
task config taskd.server -- ec2-35-163-127-155.us-west-2.compute.amazonaws.com:53589
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