Skip to content

Commit 0f11893

Browse files
authored
Fix tinyauth (#8225)
1 parent 1045d75 commit 0f11893

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

install/alpine-tinyauth-install.sh

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ msg_info "Creating Tinyauth Service"
4242
SECRET=$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | head -c 32)
4343

4444
cat <<EOF >/opt/tinyauth/.env
45+
DATABASE_PATH=/opt/tinyauth/database.db
4546
SECRET=${SECRET}
4647
USERS=${USER}
4748
APP_URL=${app_url}
@@ -53,26 +54,17 @@ cat <<'EOF' >/etc/init.d/tinyauth
5354
#!/sbin/openrc-run
5455
description="Tinyauth Service"
5556
57+
set -a
58+
ENV_FILE="/opt/tinyauth/.env"
59+
[ -f "$ENV_FILE" ] && . "$ENV_FILE"
60+
set +a
61+
5662
command="/opt/tinyauth/tinyauth"
5763
directory="/opt/tinyauth"
5864
command_user="root"
5965
command_background="true"
6066
pidfile="/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-
7668
depend() {
7769
use net
7870
}

0 commit comments

Comments
 (0)