fix(release): use openrc for alpine (#1016)

This commit is contained in:
kolaente
2025-06-25 12:40:11 +02:00
committed by GitHub
parent 159961b5e0
commit 58ebd52520
5 changed files with 35 additions and 1 deletions

8
build/after-install-openrc.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/sh
rc-update add vikunja default
# Fix the config to contain proper values
NEW_SECRET=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
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

View File

@@ -6,4 +6,4 @@ systemctl enable vikunja.service
NEW_SECRET=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
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/path: \"\.\/vikunja.db\"/path: \"\\/opt\/vikunja\/vikunja.db\"/g" /etc/vikunja/config.yml

View File

@@ -12,6 +12,7 @@ in {
git-cliff
actionlint
crowdin-cli
nfpm
# API tools
golangci-lint mage
# Desktop

View File

@@ -10,6 +10,12 @@ priority: "extra"
license: "AGPLv3"
depends:
- systemd
overrides:
apk:
depends:
- openrc
scripts:
postinstall: ./build/after-install-openrc.sh
contents:
- src: <binlocation>
dst: /opt/vikunja/vikunja
@@ -21,5 +27,9 @@ contents:
type: "symlink"
- src: vikunja.service
dst: /usr/lib/systemd/system/vikunja.service
- src: vikunja.initd
dst: /etc/init.d/vikunja
type: "config"
packager: apk
scripts:
postinstall: ./build/after-install.sh

15
vikunja.initd Executable file
View File

@@ -0,0 +1,15 @@
#!/sbin/openrc-run
command="/usr/local/bin/vikunja"
command_background=true
pidfile="/run/vikunja.pid"
directory="/opt/vikunja"
description="Vikunja service"
depend() {
need net
}
start_pre() {
checkpath --directory /run
}