File tree Expand file tree Collapse file tree 1 file changed +6
-14
lines changed
Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ msg_info "Creating Tinyauth Service"
4242SECRET=$( openssl rand -base64 32 | tr -dc ' a-zA-Z0-9' | head -c 32)
4343
4444cat << EOF >/opt/tinyauth/.env
45+ DATABASE_PATH=/opt/tinyauth/database.db
4546SECRET=${SECRET}
4647USERS=${USER}
4748APP_URL=${app_url}
@@ -53,26 +54,17 @@ cat <<'EOF' >/etc/init.d/tinyauth
5354#!/sbin/openrc-run
5455description="Tinyauth Service"
5556
57+ set -a
58+ ENV_FILE="/opt/tinyauth/.env"
59+ [ -f "$ENV_FILE" ] && . "$ENV_FILE"
60+ set +a
61+
5662command="/opt/tinyauth/tinyauth"
5763directory="/opt/tinyauth"
5864command_user="root"
5965command_background="true"
6066pidfile="/var/run/tinyauth.pid"
6167
62- start_pre() {
63- if [ -f "/opt/tinyauth/.env" ]; then
64- while IFS= read -r line || [ -n "$line" ]; do
65- [ -z "$line" ] && continue
66- case "$line" in
67- '#'*)
68- continue
69- ;;
70- esac
71- export "$line"
72- done < "/opt/tinyauth/.env"
73- fi
74- }
75-
7668depend() {
7769 use net
7870}
You can’t perform that action at this time.
0 commit comments