From 14a7ac2618b19f4031e9581a5c26ad931cbae96a Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Tue, 3 Mar 2026 11:02:38 +0100 Subject: [PATCH] Tinyauth: v5 Support & add Debian Version (#12501) --- ct/alpine-tinyauth.sh | 14 +++++ ct/tinyauth.sh | 53 +++++++++++++++++++ frontend/public/json/alpine-tinyauth.json | 51 ------------------- frontend/public/json/tinyauth.json | 51 +++++++++++++++++++ install/alpine-tinyauth-install.sh | 6 +-- install/tinyauth-install.sh | 62 +++++++++++++++++++++++ 6 files changed, 183 insertions(+), 54 deletions(-) create mode 100644 ct/tinyauth.sh delete mode 100644 frontend/public/json/alpine-tinyauth.json create mode 100644 frontend/public/json/tinyauth.json create mode 100644 install/tinyauth-install.sh diff --git a/ct/alpine-tinyauth.sh b/ct/alpine-tinyauth.sh index 993c21d9a..fce08a2b6 100644 --- a/ct/alpine-tinyauth.sh +++ b/ct/alpine-tinyauth.sh @@ -35,6 +35,20 @@ function update_script() { $STD service tinyauth stop msg_ok "Service Stopped" + if [[ -f /opt/tinyauth/.env ]] && ! grep -q "^TINYAUTH_" /opt/tinyauth/.env; then + msg_info "Migrating .env to v5 format" + sed -i \ + -e 's/^DATABASE_PATH=/TINYAUTH_DATABASE_PATH=/' \ + -e 's/^USERS=/TINYAUTH_AUTH_USERS=/' \ + -e "s/^USERS='/TINYAUTH_AUTH_USERS='/" \ + -e 's/^APP_URL=/TINYAUTH_APPURL=/' \ + -e 's/^SECRET=/TINYAUTH_AUTH_SECRET=/' \ + -e 's/^PORT=/TINYAUTH_SERVER_PORT=/' \ + -e 's/^ADDRESS=/TINYAUTH_SERVER_ADDRESS=/' \ + /opt/tinyauth/.env + msg_ok "Migrated .env to v5 format" + fi + 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 diff --git a/ct/tinyauth.sh b/ct/tinyauth.sh new file mode 100644 index 000000000..cb9070007 --- /dev/null +++ b/ct/tinyauth.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2026 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/steveiliop56/tinyauth + +APP="Tinyauth" +var_tags="${var_tags:-auth}" +var_cpu="${var_cpu:-1}" +var_ram="${var_ram:-512}" +var_disk="${var_disk:-4}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/tinyauth ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + if check_for_gh_release "tinyauth" "steveiliop56/tinyauth"; then + msg_info "Stopping Service" + systemctl stop tinyauth + msg_ok "Stopped Service" + + fetch_and_deploy_gh_release "tinyauth" "steveiliop56/tinyauth" "singlefile" "latest" "/opt/tinyauth" "tinyauth-amd64" + + msg_info "Starting Service" + systemctl start tinyauth + msg_ok "Started Service" + msg_ok "Updated successfully!" + fi + exit +} + +start +build_container +description + +msg_ok "Completed successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}" diff --git a/frontend/public/json/alpine-tinyauth.json b/frontend/public/json/alpine-tinyauth.json deleted file mode 100644 index 7bb8eea27..000000000 --- a/frontend/public/json/alpine-tinyauth.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "Alpine-Tinyauth", - "slug": "alpine-tinyauth", - "categories": [ - 6 - ], - "date_created": "2025-05-06", - "type": "ct", - "updateable": true, - "privileged": false, - "interface_port": 3000, - "documentation": "https://tinyauth.app", - "config_path": "/opt/tinyauth/.env", - "website": "https://tinyauth.app", - "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/tinyauth.webp", - "description": "Tinyauth is a simple authentication middleware that adds simple username/password login or OAuth with Google, Github and any generic provider to all of your docker apps.", - "install_methods": [ - { - "type": "default", - "script": "ct/alpine-tinyauth.sh", - "resources": { - "cpu": 1, - "ram": 256, - "hdd": 2, - "os": "alpine", - "version": "3.23" - } - }, - { - "type": "alpine", - "script": "ct/alpine-tinyauth.sh", - "resources": { - "cpu": 1, - "ram": 256, - "hdd": 2, - "os": "alpine", - "version": "3.23" - } - } - ], - "default_credentials": { - "username": null, - "password": null - }, - "notes": [ - { - "text": "The default credentials are located in `/opt/tinyauth/credentials.txt`.", - "type": "info" - } - ] -} diff --git a/frontend/public/json/tinyauth.json b/frontend/public/json/tinyauth.json new file mode 100644 index 000000000..a93dabee7 --- /dev/null +++ b/frontend/public/json/tinyauth.json @@ -0,0 +1,51 @@ +{ + "name": "Tinyauth", + "slug": "tinyauth", + "categories": [ + 6 + ], + "date_created": "2025-05-06", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 3000, + "documentation": "https://tinyauth.app", + "config_path": "/opt/tinyauth/.env", + "website": "https://tinyauth.app", + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/tinyauth.webp", + "description": "Tinyauth is a simple authentication middleware that adds simple username/password login or OAuth with Google, Github and any generic provider to all of your docker apps.", + "install_methods": [ + { + "type": "default", + "script": "ct/tinyauth.sh", + "resources": { + "cpu": 1, + "ram": 512, + "hdd": 4, + "os": "debian", + "version": "13" + } + }, + { + "type": "alpine", + "script": "ct/alpine-tinyauth.sh", + "resources": { + "cpu": 1, + "ram": 256, + "hdd": 2, + "os": "alpine", + "version": "3.23" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [ + { + "text": "The default credentials are located in `/opt/tinyauth/credentials.txt`.", + "type": "info" + } + ] +} diff --git a/install/alpine-tinyauth-install.sh b/install/alpine-tinyauth-install.sh index 72143e4e1..5630b41a5 100644 --- a/install/alpine-tinyauth-install.sh +++ b/install/alpine-tinyauth-install.sh @@ -36,9 +36,9 @@ msg_ok "Installed Tinyauth" 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 -USERS='${USER}' -APP_URL=${app_url} +TINYAUTH_DATABASE_PATH=/opt/tinyauth/database.db +TINYAUTH_AUTH_USERS='${USER}' +TINYAUTH_APPURL=${app_url} EOF msg_info "Creating Service" diff --git a/install/tinyauth-install.sh b/install/tinyauth-install.sh new file mode 100644 index 000000000..de5981e67 --- /dev/null +++ b/install/tinyauth-install.sh @@ -0,0 +1,62 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/steveiliop56/tinyauth + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt install -y \ + openssl \ + apache2-utils +msg_ok "Installed Dependencies" + +fetch_and_deploy_gh_release "tinyauth" "steveiliop56/tinyauth" "singlefile" "latest" "/opt/tinyauth" "tinyauth-amd64" + +msg_info "Setting up Tinyauth" +PASS=$(openssl rand -base64 8 | tr -dc 'a-zA-Z0-9' | head -c 8) +USER=$(htpasswd -Bbn "tinyauth" "${PASS}") +cat </opt/tinyauth/credentials.txt +Tinyauth Credentials +Username: tinyauth +Password: ${PASS} +EOF +msg_ok "Set up Tinyauth" + +read -r -p "${TAB3}Enter your Tinyauth subdomain (e.g. https://tinyauth.example.com): " app_url + +msg_info "Creating Service" +cat </opt/tinyauth/.env +TINYAUTH_DATABASE_PATH=/opt/tinyauth/database.db +TINYAUTH_AUTH_USERS='${USER}' +TINYAUTH_APPURL=${app_url} +EOF +cat </etc/systemd/system/tinyauth.service +[Unit] +Description=Tinyauth Service +After=network.target + +[Service] +Type=simple +EnvironmentFile=/opt/tinyauth/.env +ExecStart=/opt/tinyauth/tinyauth +WorkingDirectory=/opt/tinyauth +Restart=on-failure + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now tinyauth +msg_ok "Created Service" + +motd_ssh +customize +cleanup_lxc