mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-05-05 12:26:52 +02:00
testing/headscale: new aport
An open source, self-hosted implementation of the Tailscale control server https://github.com/juanfont/headscale
This commit is contained in:
parent
d58dcfb059
commit
c625cfabcf
44
testing/headscale/APKBUILD
Normal file
44
testing/headscale/APKBUILD
Normal file
@ -0,0 +1,44 @@
|
||||
# Contributor: Patrycja Rosa <alpine@ptrcnull.me>
|
||||
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
|
||||
pkgname=headscale
|
||||
pkgver=0.14.0
|
||||
pkgrel=0
|
||||
pkgdesc="An open source, self-hosted implementation of the Tailscale control server"
|
||||
url="https://github.com/juanfont/headscale"
|
||||
arch="all !ppc64le" # go build fails
|
||||
license="BSD-3-Clause"
|
||||
pkgusers="headscale"
|
||||
pkggroups="headscale"
|
||||
makedepends="go"
|
||||
subpackages="$pkgname-openrc"
|
||||
install="$pkgname.pre-install"
|
||||
source="https://github.com/juanfont/headscale/archive/v$pkgver/headscale-$pkgver.tar.gz
|
||||
headscale.initd
|
||||
"
|
||||
|
||||
prepare() {
|
||||
default_prepare
|
||||
|
||||
# move socket to a subdirectory to allow running as non-root
|
||||
sed -i 's|/var/run/headscale.sock|/var/run/headscale/headscale.sock|' config-example.yaml
|
||||
}
|
||||
|
||||
build() {
|
||||
make build
|
||||
}
|
||||
|
||||
check() {
|
||||
make test
|
||||
}
|
||||
|
||||
package() {
|
||||
install -Dm755 headscale "$pkgdir"/usr/bin/headscale
|
||||
|
||||
install -Dm755 "$srcdir"/headscale.initd "$pkgdir"/etc/init.d/headscale
|
||||
install -Dm644 config-example.yaml "$pkgdir"/etc/headscale/config.yaml
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
d2f047adc9ce561fef7dabcb1992a910f7ebdfab16a03ffd4c785c579b00b948b0c5d0557ff2c8cd6e0aa2052d8642daeaa2ccb4b1a775572e67c015c7a0cd8f headscale-0.14.0.tar.gz
|
||||
0800829bfc087af283afc117406324a0129b30b587c8cc5df85e147ac09fc879d726fc2d0b62ed545fb0190ed887641f07256745da9dea56932dd2d90aa41625 headscale.initd
|
||||
"
|
||||
25
testing/headscale/headscale.initd
Normal file
25
testing/headscale/headscale.initd
Normal file
@ -0,0 +1,25 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
supervisor=supervise-daemon
|
||||
|
||||
command="/usr/bin/headscale"
|
||||
command_args="serve"
|
||||
command_user="headscale:headscale"
|
||||
directory="/var/lib/headscale"
|
||||
|
||||
output_log="/var/log/headscale.log"
|
||||
error_log="/var/log/headscale.log"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
after firewall
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
checkpath -d -m 755 -o "headscale:headscale" /var/run/headscale
|
||||
checkpath -d -m 755 -o "headscale:headscale" /var/lib/headscale
|
||||
|
||||
checkpath -f -m 644 -o "headscale:headscale" /var/lib/headscale/db.sqlite
|
||||
checkpath -f -m 644 -o "headscale:headscale" /etc/headscale/config.yaml
|
||||
checkpath -f -m 644 -o "headscale:headscale" /var/log/headscale.log
|
||||
}
|
||||
6
testing/headscale/headscale.pre-install
Normal file
6
testing/headscale/headscale.pre-install
Normal file
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
addgroup -S headscale 2>/dev/null
|
||||
adduser -S -D -H -h /var/lib/headscale -s /sbin/nologin -G headscale -g headscale headscale 2>/dev/null
|
||||
|
||||
exit 0
|
||||
Loading…
x
Reference in New Issue
Block a user