Fix tinyauth (#8225)
This commit is contained in:
parent
1045d75f3e
commit
0f11893fd2
|
|
@ -42,6 +42,7 @@ msg_info "Creating Tinyauth Service"
|
||||||
SECRET=$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | head -c 32)
|
SECRET=$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | head -c 32)
|
||||||
|
|
||||||
cat <<EOF >/opt/tinyauth/.env
|
cat <<EOF >/opt/tinyauth/.env
|
||||||
|
DATABASE_PATH=/opt/tinyauth/database.db
|
||||||
SECRET=${SECRET}
|
SECRET=${SECRET}
|
||||||
USERS=${USER}
|
USERS=${USER}
|
||||||
APP_URL=${app_url}
|
APP_URL=${app_url}
|
||||||
|
|
@ -53,26 +54,17 @@ cat <<'EOF' >/etc/init.d/tinyauth
|
||||||
#!/sbin/openrc-run
|
#!/sbin/openrc-run
|
||||||
description="Tinyauth Service"
|
description="Tinyauth Service"
|
||||||
|
|
||||||
|
set -a
|
||||||
|
ENV_FILE="/opt/tinyauth/.env"
|
||||||
|
[ -f "$ENV_FILE" ] && . "$ENV_FILE"
|
||||||
|
set +a
|
||||||
|
|
||||||
command="/opt/tinyauth/tinyauth"
|
command="/opt/tinyauth/tinyauth"
|
||||||
directory="/opt/tinyauth"
|
directory="/opt/tinyauth"
|
||||||
command_user="root"
|
command_user="root"
|
||||||
command_background="true"
|
command_background="true"
|
||||||
pidfile="/var/run/tinyauth.pid"
|
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() {
|
depend() {
|
||||||
use net
|
use net
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user