From fce7c8a10046c1c913f0b70c405c08ceaea5db36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Slavi=C5=A1a=20Are=C5=BEina?= <58952836+tremor021@users.noreply.github.com> Date: Sun, 12 Oct 2025 20:00:29 +0200 Subject: [PATCH] Tinyauth: Fix install issues for v4 (#8309) * Fix Tinyauth * Update --- ct/alpine-tinyauth.sh | 12 ++++++++---- install/alpine-tinyauth-install.sh | 19 +++++-------------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/ct/alpine-tinyauth.sh b/ct/alpine-tinyauth.sh index cffc4693a..b3e341732 100644 --- a/ct/alpine-tinyauth.sh +++ b/ct/alpine-tinyauth.sh @@ -29,15 +29,19 @@ function update_script() { $STD apk -U upgrade msg_ok "Updated packages" - msg_info "Updating Tinyauth" RELEASE=$(curl -s https://api.github.com/repos/steveiliop56/tinyauth/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') - - if [ "${RELEASE}" != "$(cat /opt/tinyauth_version.txt)" ] || [ ! -f /opt/tinyauth_version.txt ]; then + if [ "${RELEASE}" != "$(cat ~/.tinyauth 2>/dev/null)" ] || [ ! -f ~/.tinyauth ]; then + msg_info "Stopping Service" $STD service tinyauth stop + msg_ok "Service Stopped" + + msg_info "Updating Tinyauth" rm -f /opt/tinyauth/tinyauth curl -fsSL "https://github.com/steveiliop56/tinyauth/releases/download/v${RELEASE}/tinyauth-amd64" -o /opt/tinyauth/tinyauth chmod +x /opt/tinyauth/tinyauth - echo "${RELEASE}" >/opt/tinyauth_version.txt + echo "${RELEASE}" >~/.tinyauth + msg_ok "Updated Tinyauth" + msg_info "Restarting Tinyauth" $STD service tinyauth start msg_ok "Restarted Tinyauth" diff --git a/install/alpine-tinyauth-install.sh b/install/alpine-tinyauth-install.sh index 945205062..ef88e57c4 100644 --- a/install/alpine-tinyauth-install.sh +++ b/install/alpine-tinyauth-install.sh @@ -14,16 +14,14 @@ network_check update_os msg_info "Installing Dependencies" -$STD apk add --no-cache curl openssl apache2-utils +$STD apk add --no-cache openssl apache2-utils msg_ok "Installed Dependencies" msg_info "Installing Tinyauth" mkdir -p /opt/tinyauth - RELEASE=$(curl -s https://api.github.com/repos/steveiliop56/tinyauth/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') curl -fsSL "https://github.com/steveiliop56/tinyauth/releases/download/v${RELEASE}/tinyauth-amd64" -o /opt/tinyauth/tinyauth chmod +x /opt/tinyauth/tinyauth - PASS=$(openssl rand -base64 8 | tr -dc 'a-zA-Z0-9' | head -c 8) USER=$(htpasswd -Bbn "tinyauth" "${PASS}") @@ -32,24 +30,18 @@ Tinyauth Credentials Username: tinyauth Password: ${PASS} EOF - -echo "${RELEASE}" >/opt/tinyauth_version.txt +echo "${RELEASE}" >~/.tinyauth msg_ok "Installed Tinyauth" -read -p "${TAB3}Enter your Tinyauth subdomain (e.g. https://tinyauth.example.com): " app_url - -msg_info "Creating Tinyauth Service" -SECRET=$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | head -c 32) +read -r -p "${TAB3}Enter your Tinyauth subdomain (e.g. https://tinyauth.example.com): " app_url cat </opt/tinyauth/.env DATABASE_PATH=/opt/tinyauth/database.db -SECRET=${SECRET} -USERS=${USER} +USERS='${USER}' APP_URL=${app_url} EOF -sed -i -e 's/\$/\$\$/g' /opt/tinyauth/.env - +msg_info "Creating Service" cat <<'EOF' >/etc/init.d/tinyauth #!/sbin/openrc-run description="Tinyauth Service" @@ -69,7 +61,6 @@ depend() { use net } EOF - chmod +x /etc/init.d/tinyauth $STD rc-update add tinyauth default msg_ok "Enabled Tinyauth Service"