feat(packages)!: store data in /var/lib/vikunja

The os packages previously stored the sqlite database and all other
runtime data in /opt/vikunja, next to the binary. Fresh installs now
default to /var/lib/vikunja, which is the correct FHS location for
variable state data. The package creates the directory and the service
units use it as their working directory.

BREAKING CHANGE: New installations store their data in /var/lib/vikunja
instead of /opt/vikunja. Existing installations keep their current
config and are unaffected, but setups relying on the old default path
for new machines need to move their data or adjust the config.
This commit is contained in:
kolaente
2026-08-05 19:22:42 +02:00
parent 10cfb6ae8d
commit cbd33ef8cb
5 changed files with 8 additions and 6 deletions
+2 -2
View File
@@ -4,8 +4,8 @@
# manager keeps the existing config, so the placeholders are already gone.
NEW_SECRET=$(head -c 512 /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c 32)
sed -i "s/<jwt-secret>/$NEW_SECRET/g" /etc/vikunja/config.yml
sed -i "s/<rootpath>/\/opt\/vikunja\//g" /etc/vikunja/config.yml
sed -i "s/path: \"\.\/vikunja.db\"/path: \"\\/opt\/vikunja\/vikunja.db\"/g" /etc/vikunja/config.yml
sed -i "s/<rootpath>/\/var\/lib\/vikunja\//g" /etc/vikunja/config.yml
sed -i "s/path: \"\.\/vikunja.db\"/path: \"\\/var\/lib\/vikunja\/vikunja.db\"/g" /etc/vikunja/config.yml
rc-update add vikunja default
+2 -2
View File
@@ -4,8 +4,8 @@
# manager keeps the existing config, so the placeholders are already gone.
NEW_SECRET=$(head -c 512 /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c 32)
sed -i "s/<jwt-secret>/$NEW_SECRET/g" /etc/vikunja/config.yml
sed -i "s/<rootpath>/\/opt\/vikunja\//g" /etc/vikunja/config.yml
sed -i "s/path: \"\.\/vikunja.db\"/path: \"\\/opt\/vikunja\/vikunja.db\"/g" /etc/vikunja/config.yml
sed -i "s/<rootpath>/\/var\/lib\/vikunja\//g" /etc/vikunja/config.yml
sed -i "s/path: \"\.\/vikunja.db\"/path: \"\\/var\/lib\/vikunja\/vikunja.db\"/g" /etc/vikunja/config.yml
systemctl enable vikunja.service
+2
View File
@@ -38,6 +38,8 @@ contents:
- src: /opt/vikunja/vikunja
dst: /usr/local/bin/vikunja
type: "symlink"
- dst: /var/lib/vikunja
type: dir
- src: vikunja.service
dst: /usr/lib/systemd/system/vikunja.service
- src: vikunja.initd
+1 -1
View File
@@ -3,7 +3,7 @@
command="/usr/local/bin/vikunja"
command_background=true
pidfile="/run/vikunja.pid"
directory="/opt/vikunja"
directory="/var/lib/vikunja"
description="Vikunja service"
depend() {
+1 -1
View File
@@ -11,7 +11,7 @@ After=network.target
[Service]
RestartSec=2s
Type=simple
WorkingDirectory=/opt/vikunja
WorkingDirectory=/var/lib/vikunja
ExecStart=/usr/local/bin/vikunja
Restart=always