Fix tinyauth (#8225)

This commit is contained in:
Slaviša Arežina 2025-10-09 19:19:03 +02:00 committed by GitHub
parent 1045d75f3e
commit 0f11893fd2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -42,6 +42,7 @@ msg_info "Creating Tinyauth Service"
SECRET=$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | head -c 32)
cat <<EOF >/opt/tinyauth/.env
DATABASE_PATH=/opt/tinyauth/database.db
SECRET=${SECRET}
USERS=${USER}
APP_URL=${app_url}
@ -53,26 +54,17 @@ cat <<'EOF' >/etc/init.d/tinyauth
#!/sbin/openrc-run
description="Tinyauth Service"
set -a
ENV_FILE="/opt/tinyauth/.env"
[ -f "$ENV_FILE" ] && . "$ENV_FILE"
set +a
command="/opt/tinyauth/tinyauth"
directory="/opt/tinyauth"
command_user="root"
command_background="true"
pidfile="/var/run/tinyauth.pid"
start_pre() {
if [ -f "/opt/tinyauth/.env" ]; then
while IFS= read -r line || [ -n "$line" ]; do
[ -z "$line" ] && continue
case "$line" in
'#'*)
continue
;;
esac
export "$line"
done < "/opt/tinyauth/.env"
fi
}
depend() {
use net
}