From cbd33ef8cb4585c8bd36e4b1c446efa2bee81253 Mon Sep 17 00:00:00 2001 From: kolaente Date: Wed, 5 Aug 2026 19:22:42 +0200 Subject: [PATCH] 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. --- build/after-install-openrc.sh | 4 ++-- build/after-install.sh | 4 ++-- nfpm.yaml | 2 ++ vikunja.initd | 2 +- vikunja.service | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/build/after-install-openrc.sh b/build/after-install-openrc.sh index f6a1081be..296dfea3c 100755 --- a/build/after-install-openrc.sh +++ b/build/after-install-openrc.sh @@ -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//$NEW_SECRET/g" /etc/vikunja/config.yml -sed -i "s//\/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//\/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 diff --git a/build/after-install.sh b/build/after-install.sh index beed81fe6..80f9480e4 100644 --- a/build/after-install.sh +++ b/build/after-install.sh @@ -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//$NEW_SECRET/g" /etc/vikunja/config.yml -sed -i "s//\/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//\/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 diff --git a/nfpm.yaml b/nfpm.yaml index 618c1b9e8..b644f0d57 100644 --- a/nfpm.yaml +++ b/nfpm.yaml @@ -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 diff --git a/vikunja.initd b/vikunja.initd index 61b8c45ef..5268b0cc9 100755 --- a/vikunja.initd +++ b/vikunja.initd @@ -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() { diff --git a/vikunja.service b/vikunja.service index a898fc0d5..453e967bb 100644 --- a/vikunja.service +++ b/vikunja.service @@ -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