FAQ - gdamjan/tt-rss-service GitHub Wiki

Session are too short

By default, tt-rss has sessions of 1 day. You can make them last longer by runnint systemctl edit tt-rss to create a service drop-in, and adding this:

[Service]
Environment=UWSGI_PHP_CONSTANT=SESSION_COOKIE_LIFETIME=7776000

How to run the database schema update script

systemd-run \
  --pty -M .host \
  --uid=tt-rss \
  --property=DynamicUser=yes \
  --property=RootImage=/var/lib/portables/tt-rss.raw \
  --property=EnvironmentFile=/etc/tt-rss/config.env \
  --property=ConfigurationDirectory=tt-rss \
  --property=StateDirectory=tt-rss \
  /usr/bin/php /srv/tt-rss/update.php --update-schema

Why a portable service, why Nix

A portable service, similar to a container/docker image, allows you to pack your whole application, its dependencies, the application server and its (opinionated) configuration in a single image, without needing to change your host Linux OS, and avoiding conflicts. The portable service image is also immutable and easily interchangeable.

Compared to docker and other container systems, a systemd portable service has less runtime overhead, no docker runtime or daemon. It's a quite normal system service with some limitations (immutable image, DynamicUser=yes).

I used Nix to build the released images, since:

  • I had to learn Nix.
  • the uwsgi-plugin-php package in Ubuntu 20.04 has an unpatched bug that crashes the PHP interpreter.
  • Nix allows me to deterministically express the whole image in its expression language, directly customize many details of php and uwsgi, and efficiently build from source only the customized packages.

This was further discussed at the KIKA workshop.

Local testing

Add a drop-in for the tt-rss.socket unit, to listen on TCP port 8800:

[Socket]
ListenStream=8800

Add a drop-in for the tt-rss.service unit, to use http on the socket:

[Service]
Environment=UWSGI_SOCKET_PROTOCOL=http

Now attach and run the service with no installation: portablectl attach --runtime --now ./tt-rss_dev.raw, the service should be available on localhost:8800.

The drop-ins are not needed for production use, since nginx will use the uwsgi protocol over /run/tt-rss.sock.