Forked from graymouser/gist:8771fdcf0d7715929073b4f8b6143b40
Last active
April 13, 2022 02:35
-
-
Save biancapower/1af232a6f2ae4cf390c1fc24189cbf85 to your computer and use it in GitHub Desktop.
Setup taskwarrior taskserver on ec2 amazon linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#A sequence for installing a taskwarrior server on an ec2 amazon linux instance | |
#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 | |
# install needed things | |
sudo yum install git gcc-c++ gnutls-devel gnutls-utils libuuid-devel | |
# cmake installs the wrong version if yum installed, so do it like this instead: | |
wget https://cmake.org/files/v3.10/cmake-3.10.0.tar.gz | |
tar -xvzf cmake-3.10.0.tar.gz | |
cd cmake-3.10.0 | |
sudo ./bootstrap | |
sudo make | |
sudo make install | |
# download TaskServer unzip it, cd into it | |
curl -LO https://taskwarrior.org/download/taskd-1.1.0.tar.gz # check for latest version here https://taskwarrior.org/download/ | |
tar xzf taskd-1.1.0.tar.gz | |
cd taskd-1.1.0/ | |
# build it | |
cmake -DCMAKE_BUILD_TYPE=release . | |
make | |
make install | |
# check installation | |
taskd | |
#SETUP | |
export TASKDDATA=/var/taskd | |
sudo mkdir -p $TASKDDATA | |
sudo chmod 7777 $TASKDDATA | |
#NOTE replace ec2-3-84-141-197.compute-1.amazonaws.com in the below with your own ec2 instance public dns | |
taskd init | |
taskd config server ec2-3-84-141-197.compute-1.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-3-84-141-197.compute-1.amazonaws.com:53589 | |
taskdctl start | |
#In below replace PowerOrg with your organisation name & replace Bianca with your user name | |
taskd add org PowerOrg | |
taskd add user 'PowerOrg' 'Bianca' | |
#Note new user key | |
cd ~/taskd-1.1.0/pki | |
./generate.client bianca | |
# ON LOCAL CLIENT (taskwarrior, NOT server) | |
#copy the ca.cert & the generated user cert & key files to your taskwarrior client box/device | |
scp -i ~/[LOCATION OF KEY NAME] [email protected]:taskd-1.1.0/pki/\*.pem ~/.task/ | |
#on your local client box/device run | |
task config taskd.certificate -- ~/.task/bianca.cert.pem | |
task config taskd.key -- ~/.task/bianca.key.pem | |
task config taskd.ca -- ~/.task/ca.cert.pem | |
task config taskd.server -- ec2-3-84-141-197.compute-1.amazonaws.com:53589 | |
task config taskd.credentials -- PowerOrg/Bianca/<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" | |
# MOBILE APP | |
#https://bitbucket.org/kvorobyev/taskwarriorandroid/wiki/Configuration | |
#Copy the certs to <External Storage>/Android/data/kvj.taskw/files/<profile uuid>, then place the following in the .taskrc.android file | |
taskd.certificate=bianca.cert.pem | |
taskd.key=bianca.key.pem | |
taskd.ca=ca.cert.pem | |
taskd.server=ec2-3-84-141-197.compute-1.amazonaws.com:53589 | |
taskd.credentials=PowerOrg/Bianca/<new-user-key-from-earlier> | |
android.sync.periodical=60 | |
android.sync.onchange=3 | |
android.sync.onerror=10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment