Add gotosocial-bin ebuild

Signed-off-by: Stefan Knoblich <stkn@bitplumber.de>
This commit is contained in:
2022-11-11 16:25:19 +01:00
parent 5cea3c62bb
commit 416f2d8a12
7 changed files with 108 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
#!/sbin/openrc-run
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
GOTOSOCIAL_USER="${GOTOSOCIAL_USER:-gotosocial}"
GOTOSOCIAL_GROUP="${GOTOSOCIAL_GROUP:-gotosocial}"
GOTOSOCIAL_CONFIG="${GOTOSOCIAL_CONFIG:-/etc/gotosocial/config.yml}"
GOTOSOCIAL_DATA_DIR="${GOTOSOCIAL_DATA_DIR:-/var/lib/gotosocial}"
GOTOSOCIAL_LOG_DIR="${GOTOSOCIAL_LOG_DIR:-/var/log/gotosocial}"
command="/usr/bin/gotosocial"
command_args="--config ${GOTOSOCIAL_CONFIG}"
pidfile="/run/${RC_SVCNAME}.pid"
command_background="true"
start_stop_daemon_args="--user=\"${GOTOSOCIAL_USER}\" --group=\"${GOTOSOCIAL_GROUP}\" --stdout ${GOTOSOCIAL_LOG_DIR}/gotosocial.log --stderr ${GOTOSOCIAL_LOG_DIR}/gotosocial.err server start"
start_pre() {
checkpath -d -o "${GOTOSOCIAL_USER}" -m750 "${GOTOSOCIAL_DATA_DIR}"
checkpath -d -o "${GOTOSOCIAL_USER}" -m750 "${GOTOSOCIAL_LOG_DIR}"
}

View File

@@ -0,0 +1,18 @@
[Unit]
Description=gotosocial Web Application
After=network.target
[Service]
WorkingDirectory=/var/lib/gotosocial
StateDirectory=gotosocial
StateDirectoryMode=0750
CacheDirectory=gotosocial
CacheDirectoryMode=0750
User=gotosocial
Group=gotosocial
ExecStart=/usr/bin/gotosocial --config /etc/gotosocial/config.yml server start
[Install]
WantedBy=multi-user.target