summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2021-03-07 19:30:33 -0800
committerZac Medico <zmedico@gentoo.org>2021-03-08 00:23:20 -0800
commit0b955a09e6f02104e20f3bfa78fabcc377f1ba60 (patch)
treedf62c23ad95a6c3eedf0090f6a7ee0ea7868229a /net-vpn/fp-multiuser/files
parentmedia-sound/qjackctl: removed obsolete 0.9.0 (diff)
downloadgentoo-0b955a09e6f02104e20f3bfa78fabcc377f1ba60.tar.gz
gentoo-0b955a09e6f02104e20f3bfa78fabcc377f1ba60.tar.bz2
gentoo-0b955a09e6f02104e20f3bfa78fabcc377f1ba60.zip
net-vpn/fp-multiuser: intial import
Package-Manager: Portage-3.0.17, Repoman-3.0.2 Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'net-vpn/fp-multiuser/files')
-rw-r--r--net-vpn/fp-multiuser/files/confd1
-rw-r--r--net-vpn/fp-multiuser/files/fp-multiuser.service14
-rw-r--r--net-vpn/fp-multiuser/files/initd26
-rw-r--r--net-vpn/fp-multiuser/files/logrotated3
4 files changed, 44 insertions, 0 deletions
diff --git a/net-vpn/fp-multiuser/files/confd b/net-vpn/fp-multiuser/files/confd
new file mode 100644
index 000000000000..edcc4a45239d
--- /dev/null
+++ b/net-vpn/fp-multiuser/files/confd
@@ -0,0 +1 @@
+FP_MULTIUSER_OPTS="-f /etc/fp-multiuser/tokens -l 127.0.0.1:7200"
diff --git a/net-vpn/fp-multiuser/files/fp-multiuser.service b/net-vpn/fp-multiuser/files/fp-multiuser.service
new file mode 100644
index 000000000000..8f56b148c9b6
--- /dev/null
+++ b/net-vpn/fp-multiuser/files/fp-multiuser.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=A frp server plugin to support multiple users for frp
+After=network.target
+
+[Service]
+User=fp-multiuser
+Group=fp-multiuser
+Environment=FP_MULTIUSER_OPTS="-f /etc/fp-multiuser/tokens -l 127.0.0.1:7200"
+Restart=on-failure
+RestartSec=5s
+ExecStart=/usr/bin/fp-multiuser $FP_MULTIUSER_OPTS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-vpn/fp-multiuser/files/initd b/net-vpn/fp-multiuser/files/initd
new file mode 100644
index 000000000000..bd3d6343f940
--- /dev/null
+++ b/net-vpn/fp-multiuser/files/initd
@@ -0,0 +1,26 @@
+#!/sbin/openrc-run
+
+description="frp server"
+pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"}
+command="/usr/bin/fp-multiuser"
+command_user="fp-multiuser:fp-multiuser"
+command_args="${FP_MULTIUSER_OPTS:-"-f /etc/fp-multiuser/tokens -l 127.0.0.1:7200"}"
+command_background="true"
+logfile=/var/log/fp-multiuser/${RC_SVCNAME}.log
+start_stop_daemon_args="--user ${command_user%:*} --group ${command_user#*:}
+ --stdout ${logfile} --stderr ${logfile}"
+
+: "${supervisor:=supervise-daemon}"
+: "${respawn_delay:=1}"
+: "${respawn_max:=10}"
+: "${respawn_period:=60}"
+
+depend() {
+ need net
+}
+
+start() {
+ checkpath --directory --mode 755 --owner root "${pidfile%/*}"
+ checkpath --directory --mode 755 --owner "${command_user}" "${logfile%/*}"
+ default_start
+}
diff --git a/net-vpn/fp-multiuser/files/logrotated b/net-vpn/fp-multiuser/files/logrotated
new file mode 100644
index 000000000000..5a880584d820
--- /dev/null
+++ b/net-vpn/fp-multiuser/files/logrotated
@@ -0,0 +1,3 @@
+/var/log/fp-multiuser/*.log {
+ copytruncate
+}