@@ -14,16 +14,14 @@ network_check
1414update_os
1515
1616msg_info " Installing Dependencies"
17- $STD apk add --no-cache curl openssl apache2-utils
17+ $STD apk add --no-cache openssl apache2-utils
1818msg_ok " Installed Dependencies"
1919
2020msg_info " Installing Tinyauth"
2121mkdir -p /opt/tinyauth
22-
2322RELEASE=$( curl -s https://api.github.com/repos/steveiliop56/tinyauth/releases/latest | grep " tag_name" | awk ' {print substr($2, 3, length($2)-4) }' )
2423curl -fsSL " https://github.com/steveiliop56/tinyauth/releases/download/v${RELEASE} /tinyauth-amd64" -o /opt/tinyauth/tinyauth
2524chmod +x /opt/tinyauth/tinyauth
26-
2725PASS=$( openssl rand -base64 8 | tr -dc ' a-zA-Z0-9' | head -c 8)
2826USER=$( htpasswd -Bbn " tinyauth" " ${PASS} " )
2927
@@ -32,24 +30,18 @@ Tinyauth Credentials
3230Username: tinyauth
3331Password: ${PASS}
3432EOF
35-
36- echo " ${RELEASE} " > /opt/tinyauth_version.txt
33+ echo " ${RELEASE} " > ~/.tinyauth
3734msg_ok " Installed Tinyauth"
3835
39- read -p " ${TAB3} Enter your Tinyauth subdomain (e.g. https://tinyauth.example.com): " app_url
40-
41- msg_info " Creating Tinyauth Service"
42- SECRET=$( openssl rand -base64 32 | tr -dc ' a-zA-Z0-9' | head -c 32)
36+ read -r -p " ${TAB3} Enter your Tinyauth subdomain (e.g. https://tinyauth.example.com): " app_url
4337
4438cat << EOF >/opt/tinyauth/.env
4539DATABASE_PATH=/opt/tinyauth/database.db
46- SECRET=${SECRET}
47- USERS=${USER}
40+ USERS='${USER} '
4841APP_URL=${app_url}
4942EOF
5043
51- sed -i -e ' s/\$/\$\$/g' /opt/tinyauth/.env
52-
44+ msg_info " Creating Service"
5345cat << 'EOF ' >/etc/init.d/tinyauth
5446#!/sbin/openrc-run
5547description="Tinyauth Service"
@@ -69,7 +61,6 @@ depend() {
6961 use net
7062}
7163EOF
72-
7364chmod +x /etc/init.d/tinyauth
7465$STD rc-update add tinyauth default
7566msg_ok " Enabled Tinyauth Service"
0 commit comments