Nils Freydank
9b8de7a4c3
This ebuild is based on net-vpn/headscale-0.22.3::gentoo. Changes to the ebuild beside the bump itself: - src_compile: Switch to ego - src_compile: strip away debug informations (-s -w) - src_compile: Disable cgo, link statically - pkg_postinstall: change style from early-return to if-then-fi - pkg_postinstall: drop custom compression from mentioned example file - pkg_postinstall: update the old 0.19.x ewarn from 2022-Feb to a new 0.23.0 ewarn - SRC_URI: change style from dict to appended string (shorter here) - add archiving and compression instructions for future maintenance and for improved reproducability - fix copyright line (first submission was in 2022, see commit 5aa57d09a9ad9c907b69afc2c9cc340663980c18) Signed-off-by: Nils Freydank <nils.freydank@posteo.de>
36 lines
955 B
Plaintext
36 lines
955 B
Plaintext
#!/sbin/openrc-run
|
|
# Copyright 2022 Gentoo Authors
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
description="Headscale Server daemon"
|
|
command="/usr/bin/headscale"
|
|
user="${HEADSCALE_USER}:${HEADSCALE_GROUP}"
|
|
directory="/var/lib/headscale"
|
|
output_log="/var/log/headscale.log"
|
|
error_log="/var/log/headscale.log"
|
|
private_key="/var/lib/headscale/private.key"
|
|
|
|
start_stop_daemon_args="--user \"${user}\" ${HEADSCALE_OPTIONS} --background"
|
|
|
|
depend() {
|
|
need net
|
|
}
|
|
|
|
start_pre() {
|
|
if [ ! -s /etc/headscale/config.yaml ] ; then
|
|
eerror "Missing headscale configuration file"
|
|
eerror "Please check the documentation directory for an example"
|
|
return 1
|
|
fi
|
|
|
|
checkpath -d -m 700 -o "${user}" /run/headscale /var/lib/headscale
|
|
checkpath -f -m 600 -o "${user}" \
|
|
/var/lib/headscale/db.sqlite \
|
|
/var/log/headscale.log \
|
|
/etc/headscale/config.yaml
|
|
|
|
if [ -f ${private_key} ]; then
|
|
checkpath -f -m 600 -o "${user}" ${private_key}
|
|
fi
|
|
}
|