mirror of
https://anongit.gentoo.org/git/repo/gentoo.git
synced 2025-07-25 08:28:12 +02:00
Add DERP (Designated Encrypted Relay for Packets) server for tailnet devices, which quite useful if connecting to official one is either slow or unstable. Link: https://tailscale.com/kb/1232/derp-servers Closes: https://bugs.gentoo.org/951451 Closes: https://github.com/gentoo/gentoo/pull/41165 Signed-off-by: Yixun Lan <dlan@gentoo.org>
34 lines
767 B
Text
34 lines
767 B
Text
#!/sbin/openrc-run
|
|
# Copyright 2022 Gentoo Authors
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
. /etc/default/derper
|
|
|
|
name="derper"
|
|
description="Tailscale DERP server"
|
|
command="/usr/bin/derper"
|
|
command_args=" \
|
|
-certdir ${CERTDIR} \
|
|
-certmode ${CERTMODE} \
|
|
-hostname ${HOSTNAME} \
|
|
-a ${ADDR} \
|
|
-http-port ${HTTP_PORT} \
|
|
-c '${HOMEDIR}'/derper.key \
|
|
${FLAGS}
|
|
"
|
|
command_user="${DERPER_USER}:${DERPER_GROUP}"
|
|
command_background=true
|
|
pidfile="/run/derper.pid"
|
|
directory="${HOMEDIR}"
|
|
output_log="/var/log/derper/derper.log"
|
|
error_log="/var/log/derper/derper.error"
|
|
|
|
depend() {
|
|
need net
|
|
}
|
|
|
|
start_pre() {
|
|
checkpath -d -m 700 -o ${command_user} /var/log/derper
|
|
checkpath -d -m 750 -o ${command_user} ${HOMEDIR}
|
|
/usr/libexec/derper-pre.sh
|
|
}
|