initial commit

This commit is contained in:
Malin Freeborn
2020-01-02 01:04:35 +01:00
commit 6befc5d3c1
162 changed files with 19086 additions and 0 deletions

30
data/taskwarrior/.no Normal file
View File

@@ -0,0 +1,30 @@
setting up with:
- data at /var/taskd
- user: root
- host=localhost
- port=53589
- Organization=Andonome
- Name="Malin Freeborn"
## Next
Copy files to ~/.task
/usr/share/doc/taskd/pki/{ca.cert.pem,Malin_Freeborn.cert.pem,Malin_Freeborn.key.pem}
And run these commands:
```
Malin Freeborn must run these commands:
task config taskd.server localhost:53589
task config taskd.credentials 'Andonome/Malin Freeborn/36faa2a9-de12-4410-99d5-0bcaa5a4887a'
task config taskd.certificate ~/.task/Malin_Freeborn.cert.pem
task config taskd.key ~/.task/Malin_Freeborn.key.pem
task config taskd.ca ~/.task/ca.cert.pem
task config taskd.trust strict
task config taskd.ciphers NORMAL
```

View File

@@ -0,0 +1,57 @@
#!/bin/bash
export TASKDDATA=/var/lib/taskd
echo Change CN to hostname
sleep 2
sudo vim /usr/share/doc/taskd/pki/vars
cd /usr/share/doc/taskd/pki/
sudo ./generate
mkdir -p $TASKDDATA
cp *.pem $TASKDDATA
chown -R root /var/lib/taskd
sudo cp *pem $TASKDDATA
chown -R taskd:taskd $TASKDDATA
taskd config "$user".cert=/var/lib/taskd/client.cert.pem
taskd config "$user".key=/var/lib/taskd/client.key.pem
taskd config "$(hostname)".cert=/var/lib/taskd/server.cert.pem
taskd config "$(hostname)".key=/var/lib/taskd/server.key.pem
taskd config "$(hostname)".crl=/var/lib/taskd/server.crl.pem
taskd config ca.cert=/var/lib/taskd/ca.cert.pem
taskd config --force server $(hostname):53589
systemctl start taskd
echo name a group
read group
echo name user
read user
taskd add org $group
taskd add user $group $user
./generate.client $user
echo "
taskd.server=alfred:port
taskd.credentials=$group/$user/key
taskd.certificate=~/.task/'$user'.cert.pem
taskd.key=~/.task/'$user'.key.pem
taskd.ca=~/.task/ca.cert.pem" >> /var/lib/taskd/config
tar cf $user.tar "$user"* ca.cert.pem

34
data/taskwarrior/task.md Normal file
View File

@@ -0,0 +1,34 @@
# Contexts
Set three contexts by their tags:
> task context define work +sa or +hr
> task context define study +ed or +void or +rat
> task context define home -sa -hr -ed -void -rat
Change to the first context.
> task context work
Then stop.
> task context none
# Review
View list of tasks completed in the last week:
> task end.after:today-1wk completed
# Timewarrior
> timew start ed 'learn timewarrior'
> timew stop
> timew summary
> timew tags

178
data/taskwarrior/taskd.md Normal file
View File

@@ -0,0 +1,178 @@
Switch to root to make things easier.
> yay -S
> export TASKDDATA=/var/lib/taskd
Edit `/usr/share/doc/taskd/pki/vars` so that ``CN'' = the hostname (IP is fine).
> cd /usr/share/doc/taskd/pki
Execute the `generate` file to generate a selfsigned certificate for the server. These will be \*.pem-files. Copy all \*.pem-files to /var/lib/taskd.
Make sure a copy of ca.cert.pem remains to generate user-certificates later.
# Taskd Configurations
> 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
# Change Taskd Log Location
The default is /tmp/log, which obviously you don't want.
> touch /var/log/taskd.log
> chown taskd:taskd /var/log/taskd.log
> taskd config --force log /var/log/taskd.log
Finally, set up the servername - the same one as in the certificates. Mine is ``testarch''.
> taskd config --force server testarch:9001
# Adding users
Let's add the group ``home'', then the user ``ghost'', will go in that group.
> taskd add org home
> taskd add user home ghost
`3f9e6154-25cb-4e45-88bb-45e98feef904`
> taskd add user home alfred
`4fbb319c-c493-437a-ab7a-028f5b75e522`
The user then gets a key.
Finally, make sure that taskd can read its own data>
> chown -R taskd:taskd /var/lib/taskd/orgs
... or perhaps the entire directory of /var/lib/taskd/.
Then it's back to /usr/share/doc/taskd/pki
Generate some userfiles:
> ./generate.client ghost
> ./generate.client alfred
The bob and ghost \*pem files have to be added to the given users' home directories.
# Setting up Users
> sudo apt-get install taskwarrior taskd
> task
Then move the \*pem files into the .task directory of the user.
Don't forget to add the ca.key.pem from `/usr/share/doc/taskd/pki`!
# Attempt 2
Well, none of that worked.
New info from [taskwarrior](https://gitpitch.com/GothenburgBitFactory/taskserver-setup#/1/4)
Default port = 53589
starting with
> taskd init
> taskd config server localhost:53589
View supported settings with `taskdrc`.
!!! Start with taskdctl start
Do a non-daemon version with
> taskd server --data $TASKDDATA --daemon
# Systemd Unit file
This needs to be edited for "$TASKDDATA", "$TASKDUSER", and "$TASKDGROUP".
---
Unit]
Description=Secure server providing multi-user, multi-client access to Taskwarrior data
Requires=network.target
After=network.target
Documentation=http://taskwarrior.org/docs/#taskd
[Service]
ExecStart=/usr/local/bin/taskd server --data $TASKDDATA
Type=simple
User=$TASKDUSER
Group=$TASKDGROUP
WorkingDirectory=$TASKDDATA
PrivateTmp=true
InaccessibleDirectories=/home /root /boot /opt /mnt /media
ReadOnlyDirectories=/etc /usr
[Install]
WantedBy=multi-user.target
---
Enable all this by copying the file to `/etc/systemd/system`, reload daemon, then start it.
Key for ghost:
29bd8a06-2cc0-4163-905d-6216257a3031
e29bffe0-72d8-45f2-b1f9-f29397cfab16
# Different:
$ task config taskd.certificate -- ~/.task/first_last.cert.pem
$ task config taskd.key -- ~/.task/first_last.key.pem
$ task config taskd.ca -- ~/.task/ca.cert.pem
# Trust
For troubleshooting we can set:
> taskd.trust=ignore [hostname]
> taskd.trust=allow all
> taskd.trust=strict
# User Defines Attributes - UDA
Each UDA has two to four attributes: type (numeric or string) and label are necessary:
> task config uda.THING.type {numeric,string}
> task config uda.THING.label Thg
Constrain these attributes to a comma-delineated set with:
> task config uda.THING.values brown,orange,green
You can also show how important the Attribute makes something:
> urgency.uda.THING.coefficient=2.8
# Aliases
Alias `delete' to `rm' with:
task config alias.rm delete

41
data/taskwarrior/taskd.sh Normal file
View File

@@ -0,0 +1,41 @@
#!/bin/bash
export TASKDDATA=/var/lib/taskd
sudo mkdir -p $TASKDDATA
sudo chown taskd:$(whoami) $TASKDDATA
sudo chmod 775 $TASKDDATA
cp -r /usr/share/doc/taskd/pki/ $TASKDDATA
cd $TASKDDATA/pki
sed -i s/localhost/$(hostname -f)/ vars
./generate
cp client.cert.pem $TASKDDATA
cp client.key.pem $TASKDDATA
cp server.cert.pem $TASKDDATA
cp server.key.pem $TASKDDATA
cp server.crl.pem $TASKDDATA
cp ca.cert.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 $(hostname -f):53589
taskd add org public
# 1515de89-cc81-4af6-a6a4-41c1430620b0
journalctl -u taskd

156
data/taskwarrior/timew.md Normal file
View File

@@ -0,0 +1,156 @@
# Setup
Below commands mostly deal with timew alone. With taskwarrior installed as well, `locate on-modify-time`, then add it to ~/.task/hooks and make it executable.
#Summaries
Try:
> timew summary :yesterday
You can also use :week, :lastweek, :month, :quarter, :year, or a range such as:
> timew summary today to tomorrow
> timew today - tomorrow
> 2018-10-15T06:00 - 2018-10-17T06:00
Each of these can gain with the :ids tag.
# Basics
> timew start
> timew stop
> timew continue
> timew summary
> timew tags
And add ids with:
> timew summary :ids
> timew track 10am - 1pm timewarrior
> timew track 1pm for 2h walk
# Adjusting Timewarrior
First get ids.
> timew summary :ids
Then if we're looking at task @2:
> timew move @2 12:00
> timew lengthen @2 3mins
> time shorten @2 40mins
# Forgetting
> timew start 1h ago @4
Or if your action actually had a break:
> timew split @8
Or maybe not?
> timew join @4 @8
> timew @8 delete
Start at previous time
> timew start 3pm 'Read chapter 12'
> timew start 90mins ago 'Read chapter 12'
Cancel currently tracked time.
> timew cancel
# Backdated tracking
> timew untag @3
# Hints
* :quit - for automation
* :yes
* :color
* :fill - expand the time to fill out available time
* :adjust - automatically correct overlaps
* :ids - show id numbers
# Times
* :yesterday
* :day
* :week
* :month
* :quarter
* :lastweek
* :lastmonth
* :lastquarter
* :lastyear
# Mistakes
task end.after:2015-05-01 and end.before:2015-05-31 completed
task end.after:today-1wk completed
# Errors with Python3
Replace
`os.system('timew start ' + combined + ' :yes')`
with:
`os.system('timew start ' + combined.decode() + ' :yes')`
and
`os.system('timew stop ' + combined + ' :yes')`
with:
`os.system('timew stop ' + combined.decode() + ' :yes')`
# Fixing Errors
> curl -O https://taskwarrior.org/download/timew-dbcorrection.py
> python timew-dbcorrections.py