Tools for twtxt that don't suck
twt-tools is a set of 3 scripts covering the use of twtxt:
- twtsrv: script run by your webserver used to update your twtxt file through a REST API
- twtpub: publishing script (twtssrv client)
- twtsub: subscription script (you can follow people with it)
This script can be run with FastCGI using for example fcgiwrap.
Here is an exemple of nginx config:
server {
listen 80;
listen [::]:80;
server_name exemple.com;
root /var/www/twtxt;
location ~ \.sh {
fastcgi_pass unix:/var/run/fcgiwrap.socket;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
Don't forget to edit the script and set secret
variable to a strong secret.
Copy and adapt twtpub.ini
in ~/.config/twtxt/twtpub.ini
. You can have multiple feeds there if you want.
Copy and adapt twtsub.txt
in ~/.config/twtxt/twtpub.txt
. Each subscription is on a separate line, the first item of the line is the name os the subscription, then a tab, then the URL to the twtxt.txt file.