From e4194da3161600a2e60211239bab41f24026794f Mon Sep 17 00:00:00 2001 From: Stavros Date: Wed, 21 May 2025 19:01:19 +0300 Subject: [PATCH 01/13] refactor: use tinyauth binary instead of building --- ct/{alpine-tinyauth.sh => tinyauth.sh} | 39 +++++------ frontend/public/json/alpine-tinyauth.json | 51 --------------- frontend/public/json/tinyauth.json | 40 ++++++++++++ ...inyauth-install.sh => tinyauth-install.sh} | 64 +++++++++---------- misc/build.func | 20 +++--- misc/install.func | 6 +- 6 files changed, 97 insertions(+), 123 deletions(-) rename ct/{alpine-tinyauth.sh => tinyauth.sh} (58%) delete mode 100644 frontend/public/json/alpine-tinyauth.json create mode 100644 frontend/public/json/tinyauth.json rename install/{alpine-tinyauth-install.sh => tinyauth-install.sh} (52%) diff --git a/ct/alpine-tinyauth.sh b/ct/tinyauth.sh similarity index 58% rename from ct/alpine-tinyauth.sh rename to ct/tinyauth.sh index f36a7be7f..a2b1404bc 100644 --- a/ct/alpine-tinyauth.sh +++ b/ct/tinyauth.sh @@ -1,15 +1,16 @@ #!/usr/bin/env bash -source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -s https://raw.githubusercontent.com/steveiliop56/ProxmoxVE/main/misc/build.func) # Copyright (c) 2021-2025 community-scripts ORG # Author: Slaviša Arežina (tremor021) +# Modified by: Stavros (steveiliop56) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # Source: https://github.com/steveiliop56/tinyauth -APP="Alpine-tinyauth" +APP="Tinyauth" var_tags="${var_tags:-alpine;auth}" var_cpu="${var_cpu:-1}" var_ram="${var_ram:-512}" -var_disk="${var_disk:-3}" +var_disk="${var_disk:2}" var_os="${var_os:-alpine}" var_version="${var_version:-3.21}" var_unprivileged="${var_unprivileged:-1}" @@ -25,34 +26,24 @@ function update_script() { exit 1 fi - msg_info "Updating Alpine Packages" + msg_info "Updating packages" $STD apk -U upgrade - msg_ok "Updated Alpine Packages" + msg_ok "Updated packages" - msg_info "Updating tinyauth" + 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 $STD service tinyauth stop - temp_file=$(mktemp) - cp /opt/tinyauth/.env /opt - rm -rf /opt/tinyauth - mkdir -p /opt/tinyauth - curl -fsSL "https://github.com/steveiliop56/tinyauth/archive/refs/tags/v${RELEASE}.tar.gz" -o "$temp_file" - tar -xzf "$temp_file" -C /opt/tinyauth --strip-components=1 - cd /opt/tinyauth/frontend - $STD bun install - $STD bun run build - mv dist /opt/tinyauth/internal/assets/ cd /opt/tinyauth - $STD go mod download - CGO_ENABLED=0 go build -ldflags "-s -w" - cp /opt/.env /opt/tinyauth - echo "${RELEASE}" >/opt/tinyauth_version.txt - rm -f "$temp_file" - msg_info "Restarting tinyauth" + rm -f tinyauth + curl -fsSL "https://github.com/steveiliop56/tinyauth/releases/download/${RELEASE}/tinyauth-amd64" -o tinyauth + chmod +x tinyauth + echo "${RELEASE}" > /opt/tinyauth_version.txt + msg_info "Restarting Tinyauth" $STD service tinyauth start - msg_ok "Restarted tinyauth" - msg_ok "Updated tinyauth" + msg_ok "Restarted Tinyauth" + msg_ok "Updated Tinyauth" else msg_ok "No update required. ${APP} is already at ${RELEASE}" fi diff --git a/frontend/public/json/alpine-tinyauth.json b/frontend/public/json/alpine-tinyauth.json deleted file mode 100644 index 0e9e0cf8a..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/docs/getting-started.html", - "website": "https://tinyauth.app/", - "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/tinyauth.webp", - "config_path": "/opt/tinyauth/.env", - "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. It is designed for traefik but it can be extended to work with all reverse proxies like caddy and nginx.", - "install_methods": [ - { - "type": "default", - "script": "ct/alpine-tinyauth.sh", - "resources": { - "cpu": 1, - "ram": 256, - "hdd": 3, - "os": "alpine", - "version": "3.21" - } - }, - { - "type": "alpine", - "script": "ct/alpine-tinyauth.sh", - "resources": { - "cpu": 1, - "ram": 256, - "hdd": 3, - "os": "alpine", - "version": "3.21" - } - } - ], - "default_credentials": { - "username": null, - "password": null - }, - "notes": [ - { - "type": "info", - "text": "`cat ~/tinyauth.creds` to view login credentials" - } - ] -} diff --git a/frontend/public/json/tinyauth.json b/frontend/public/json/tinyauth.json new file mode 100644 index 000000000..7b3b4a5c1 --- /dev/null +++ b/frontend/public/json/tinyauth.json @@ -0,0 +1,40 @@ +{ + "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/png/tinyauth.png", + "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": 256, + "hdd": 2, + "os": null, + "version": null + } + } + ], + "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/tinyauth-install.sh similarity index 52% rename from install/alpine-tinyauth-install.sh rename to install/tinyauth-install.sh index 5692be0a8..48f01cc95 100644 --- a/install/alpine-tinyauth-install.sh +++ b/install/tinyauth-install.sh @@ -2,6 +2,7 @@ # Copyright (c) 2021-2025 community-scripts ORG # Author: Slaviša Arežina (tremor021) +# Modified by: Stavros (steveiliop56) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # Source: https://github.com/steveiliop56/tinyauth @@ -14,45 +15,38 @@ network_check update_os msg_info "Installing Dependencies" -$STD apk add --no-cache \ - npm \ - curl \ - go +$STD apk add --no-cache curl openssl msg_ok "Installed Dependencies" -msg_info "Installing tinyauth" -temp_file=$(mktemp) -$STD npm install -g bun +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/archive/refs/tags/v${RELEASE}.tar.gz" -o "$temp_file" -tar -xzf "$temp_file" -C /opt/tinyauth --strip-components=1 -cd /opt/tinyauth/frontend -$STD bun install -$STD bun run build -mv dist /opt/tinyauth/internal/assets/ -cd /opt/tinyauth -$STD go mod download -CGO_ENABLED=0 go build -ldflags "-s -w" -{ - echo "tinyauth Credentials" - echo "Username: admin@example.com" - echo "Password: admin" -} >>~/tinyauth.creds -echo "${RELEASE}" >/opt/tinyauth_version.txt -msg_ok "Installed tinyauth" -msg_info "Enabling tinyauth Service" -SECRET=$(head -c 16 /dev/urandom | xxd -p -c 16 | tr -d '\n') -{ - echo "SECRET=${SECRET}" - echo "USERS=admin@example.com:\$2a\$10\$CrTK.W7WXSClo3ZY1yJUFupg5UdV8WNcynEhZhJFNjhGQB.Ga0ZDm" - echo "APP_URL=http://localhost:3000" -} >>/opt/tinyauth/.env +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/${RELEASE}/tinyauth-amd64" -o tinyauth +chmod +x tinyauth + +cat < /opt/tinyauth/credentials.txt +echo "Tinyauth Credentials" +echo "Username: user" +echo "Password: password" +EOF + +echo "${RELEASE}" >/opt/tinyauth_version.txt +msg_ok "Installed Tinyauth" + +msg_info "Creating Tinyauth Service" +SECRET=$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | head -c 32) +read -p "${TAB3}Enter your Tinyauth subdomain (e.g. https://tinyauth.example.com): " app_url + +cat </opt/tinyauth/.env +SECRET=${SECRET} +USERS=user:\$2a\$10\$tfjwMcNIFAUewa9ts4hK4e9qP4rdG4L5qAwWmgtG54KnP9U.0tMxy +APP_URL=${app_url} +EOF cat </etc/init.d/tinyauth #!/sbin/openrc-run -description="tinyauth Service" +description="Tinyauth Service" command="/opt/tinyauth/tinyauth" directory="/opt/tinyauth" @@ -73,11 +67,11 @@ EOF chmod +x /etc/init.d/tinyauth $STD rc-update add tinyauth default -msg_ok "Enabled tinyauth Service" +msg_ok "Enabled Tinyauth Service" -msg_info "Starting tinyauth" +msg_info "Starting Tinyauth" $STD service tinyauth start -msg_ok "Started tinyauth" +msg_ok "Started Tinyauth" motd_ssh customize diff --git a/misc/build.func b/misc/build.func index 1ea66b264..7ce0de499 100644 --- a/misc/build.func +++ b/misc/build.func @@ -14,7 +14,7 @@ variables() { RANDOM_UUID="$(cat /proc/sys/kernel/random/uuid)" # generates a random UUID and sets it to the RANDOM_UUID variable. } -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) +source <(curl -fsSL https://raw.githubusercontent.com/steveiliop56/ProxmoxVE/main/misc/api.func) # This function sets various color variables using ANSI escape codes for formatting text in the terminal. color() { @@ -69,7 +69,7 @@ catch_errors() { # This function is called when an error occurs. It receives the exit code, line number, and command that caused the error, and displays an error message. error_handler() { - source /dev/stdin <<<$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) + source /dev/stdin <<<$(curl -fsSL https://raw.githubusercontent.com/steveiliop56/ProxmoxVE/main/misc/api.func) if [ -n "$SPINNER_PID" ] && ps -p "$SPINNER_PID" >/dev/null; then kill "$SPINNER_PID" >/dev/null; fi printf "\e[?25h" local exit_code="$?" @@ -275,7 +275,7 @@ update_motd_ip() { # Function to download & save header files get_header() { local app_name=$(echo "${APP,,}" | tr -d ' ') - local header_url="https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/headers/${app_name}" + local header_url="https://raw.githubusercontent.com/steveiliop56/ProxmoxVE/main/ct/headers/${app_name}" local local_header_path="/usr/local/community-scripts/headers/${app_name}" mkdir -p "$(dirname "$local_header_path")" @@ -941,7 +941,7 @@ install_script() { header_info echo -e "${INFO}${HOLD} ${GN}Using Config File on node $PVEHOST_NAME${CL}" METHOD="config_file" - source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/config-file.func) + source <(curl -fsSL https://raw.githubusercontent.com/steveiliop56/ProxmoxVE/main/misc/config-file.func) config_file break ;; @@ -1014,7 +1014,7 @@ check_container_storage() { } start() { - source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func) + source <(curl -fsSL https://raw.githubusercontent.com/steveiliop56/ProxmoxVE/main/misc/tools.func) if command -v pveversion >/dev/null 2>&1; then if ! (whiptail --backtitle "Proxmox VE Helper Scripts" --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then clear @@ -1071,9 +1071,9 @@ build_container() { TEMP_DIR=$(mktemp -d) pushd "$TEMP_DIR" >/dev/null if [ "$var_os" == "alpine" ]; then - export FUNCTIONS_FILE_PATH="$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/alpine-install.func)" + export FUNCTIONS_FILE_PATH="$(curl -fsSL https://raw.githubusercontent.com/steveiliop56/ProxmoxVE/main/misc/alpine-install.func)" else - export FUNCTIONS_FILE_PATH="$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/install.func)" + export FUNCTIONS_FILE_PATH="$(curl -fsSL https://raw.githubusercontent.com/steveiliop56/ProxmoxVE/main/misc/install.func)" fi export RANDOM_UUID="$RANDOM_UUID" export CACHER="$APT_CACHER" @@ -1105,7 +1105,7 @@ build_container() { $PW " # This executes create_lxc.sh and creates the container and .conf file - bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/create_lxc.sh)" $? + bash -c "$(curl -fsSL https://raw.githubusercontent.com/steveiliop56/ProxmoxVE/main/ct/create_lxc.sh)" $? LXC_CONFIG=/etc/pve/lxc/${CTID}.conf if [ "$CT_TYPE" == "0" ]; then @@ -1167,7 +1167,7 @@ http://dl-cdn.alpinelinux.org/alpine/latest-stable/community EOF' pct exec "$CTID" -- ash -c "apk add bash >/dev/null" fi - lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/install/"$var_install".sh)" $? + lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/steveiliop56/ProxmoxVE/main/install/"$var_install".sh)" $? } @@ -1180,7 +1180,7 @@ description() { cat < - Logo + Logo

${APP} LXC

diff --git a/misc/install.func b/misc/install.func index 842ed4a97..67db3bfea 100644 --- a/misc/install.func +++ b/misc/install.func @@ -69,7 +69,7 @@ catch_errors() { # This function handles errors error_handler() { - source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) + source <(curl -fsSL https://raw.githubusercontent.com/steveiliop56/ProxmoxVE/main/misc/api.func) if [ -n "$SPINNER_PID" ] && ps -p "$SPINNER_PID" >/dev/null; then kill "$SPINNER_PID" >/dev/null; fi printf "\e[?25h" local exit_code="$?" @@ -216,7 +216,7 @@ EOF msg_info "Installing core dependencies" $STD apt-get update $STD apt-get install -y sudo curl mc gnupg2 - source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func) + source <(curl -fsSL https://raw.githubusercontent.com/steveiliop56/ProxmoxVE/main/misc/tools.func) msg_ok "Core dependencies installed" } @@ -267,7 +267,7 @@ EOF systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//') msg_ok "Customized Container" fi - echo "bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/${app}.sh)\"" >/usr/bin/update + echo "bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/steveiliop56/ProxmoxVE/main/ct/${app}.sh)\"" >/usr/bin/update chmod +x /usr/bin/update if [[ -n "${SSH_AUTHORIZED_KEY}" ]]; then From 75dd7b6fb9c321366e03f9ba3c641075a342ef4d Mon Sep 17 00:00:00 2001 From: Stavros Date: Wed, 21 May 2025 19:12:34 +0300 Subject: [PATCH 02/13] refactor: refactor header --- ct/headers/alpine-tinyauth | 6 ------ ct/headers/tinyauth | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) delete mode 100644 ct/headers/alpine-tinyauth create mode 100644 ct/headers/tinyauth diff --git a/ct/headers/alpine-tinyauth b/ct/headers/alpine-tinyauth deleted file mode 100644 index 207a09037..000000000 --- a/ct/headers/alpine-tinyauth +++ /dev/null @@ -1,6 +0,0 @@ - ___ __ _ __ _ __ __ - / | / /___ (_)___ ___ / /_(_)___ __ ______ ___ __/ /_/ /_ - / /| | / / __ \/ / __ \/ _ \______/ __/ / __ \/ / / / __ `/ / / / __/ __ \ - / ___ |/ / /_/ / / / / / __/_____/ /_/ / / / / /_/ / /_/ / /_/ / /_/ / / / -/_/ |_/_/ .___/_/_/ /_/\___/ \__/_/_/ /_/\__, /\__,_/\__,_/\__/_/ /_/ - /_/ /____/ diff --git a/ct/headers/tinyauth b/ct/headers/tinyauth new file mode 100644 index 000000000..3959b07dd --- /dev/null +++ b/ct/headers/tinyauth @@ -0,0 +1,6 @@ + _______ __ __ + /_ __(_)___ __ ______ ___ __/ /_/ /_ + / / / / __ \/ / / / __ `/ / / / __/ __ \ + / / / / / / / /_/ / /_/ / /_/ / /_/ / / / +/_/ /_/_/ /_/\__, /\__,_/\__,_/\__/_/ /_/ + /____/ From 5ef95099ef787decd1cdb0e65dbae6371d414412 Mon Sep 17 00:00:00 2001 From: Stavros Date: Wed, 21 May 2025 19:16:48 +0300 Subject: [PATCH 03/13] fix: use v prefix in download --- ct/tinyauth.sh | 2 +- install/tinyauth-install.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ct/tinyauth.sh b/ct/tinyauth.sh index a2b1404bc..f24328204 100644 --- a/ct/tinyauth.sh +++ b/ct/tinyauth.sh @@ -37,7 +37,7 @@ function update_script() { $STD service tinyauth stop cd /opt/tinyauth rm -f tinyauth - curl -fsSL "https://github.com/steveiliop56/tinyauth/releases/download/${RELEASE}/tinyauth-amd64" -o tinyauth + curl -fsSL "https://github.com/steveiliop56/tinyauth/releases/download/v${RELEASE}/tinyauth-amd64" -o tinyauth chmod +x tinyauth echo "${RELEASE}" > /opt/tinyauth_version.txt msg_info "Restarting Tinyauth" diff --git a/install/tinyauth-install.sh b/install/tinyauth-install.sh index 48f01cc95..133a83011 100644 --- a/install/tinyauth-install.sh +++ b/install/tinyauth-install.sh @@ -22,7 +22,7 @@ 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/${RELEASE}/tinyauth-amd64" -o tinyauth +curl -fsSL "https://github.com/steveiliop56/tinyauth/releases/download/v${RELEASE}/tinyauth-amd64" -o tinyauth chmod +x tinyauth cat < /opt/tinyauth/credentials.txt From e2cf12b8b0ca5917cfd8f2b310f38081779221ed Mon Sep 17 00:00:00 2001 From: Stavros Date: Wed, 21 May 2025 19:19:16 +0300 Subject: [PATCH 04/13] refactor: change required ram --- ct/tinyauth.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/tinyauth.sh b/ct/tinyauth.sh index f24328204..a77018a59 100644 --- a/ct/tinyauth.sh +++ b/ct/tinyauth.sh @@ -9,7 +9,7 @@ source <(curl -s https://raw.githubusercontent.com/steveiliop56/ProxmoxVE/main/m APP="Tinyauth" var_tags="${var_tags:-alpine;auth}" var_cpu="${var_cpu:-1}" -var_ram="${var_ram:-512}" +var_ram="${var_ram:-256}" var_disk="${var_disk:2}" var_os="${var_os:-alpine}" var_version="${var_version:-3.21}" From b02d748e37b7ab47ac45b43a62c465d676af59b8 Mon Sep 17 00:00:00 2001 From: Stavros Date: Wed, 21 May 2025 19:22:10 +0300 Subject: [PATCH 05/13] fix: get tinyauth subdomain before spinner --- install/tinyauth-install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install/tinyauth-install.sh b/install/tinyauth-install.sh index 133a83011..fa32c9cd1 100644 --- a/install/tinyauth-install.sh +++ b/install/tinyauth-install.sh @@ -34,9 +34,10 @@ EOF echo "${RELEASE}" >/opt/tinyauth_version.txt 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 -p "${TAB3}Enter your Tinyauth subdomain (e.g. https://tinyauth.example.com): " app_url cat </opt/tinyauth/.env SECRET=${SECRET} From 554ea415fcb7f94f3ff2d7c9a890d7e34499a788 Mon Sep 17 00:00:00 2001 From: Stavros Date: Wed, 21 May 2025 19:30:23 +0300 Subject: [PATCH 06/13] fix: download cli in correct path --- ct/tinyauth.sh | 7 +++---- install/tinyauth-install.sh | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ct/tinyauth.sh b/ct/tinyauth.sh index a77018a59..1b87a4d71 100644 --- a/ct/tinyauth.sh +++ b/ct/tinyauth.sh @@ -35,10 +35,9 @@ function update_script() { if [ "${RELEASE}" != "$(cat /opt/tinyauth_version.txt)" ] || [ ! -f /opt/tinyauth_version.txt ]; then $STD service tinyauth stop - cd /opt/tinyauth - rm -f tinyauth - curl -fsSL "https://github.com/steveiliop56/tinyauth/releases/download/v${RELEASE}/tinyauth-amd64" -o tinyauth - chmod +x 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 msg_info "Restarting Tinyauth" $STD service tinyauth start diff --git a/install/tinyauth-install.sh b/install/tinyauth-install.sh index fa32c9cd1..be3ef87dc 100644 --- a/install/tinyauth-install.sh +++ b/install/tinyauth-install.sh @@ -22,8 +22,8 @@ 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 tinyauth -chmod +x tinyauth +curl -fsSL "https://github.com/steveiliop56/tinyauth/releases/download/v${RELEASE}/tinyauth-amd64" -o /opt/tinyauth/tinyauth +chmod +x /opt/tinyauth/tinyauth cat < /opt/tinyauth/credentials.txt echo "Tinyauth Credentials" From ccd29b329229448b575713e739f880cd5365360a Mon Sep 17 00:00:00 2001 From: Stavros Date: Wed, 21 May 2025 19:42:40 +0300 Subject: [PATCH 07/13] feat: use secure password --- install/tinyauth-install.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/install/tinyauth-install.sh b/install/tinyauth-install.sh index be3ef87dc..0818630f3 100644 --- a/install/tinyauth-install.sh +++ b/install/tinyauth-install.sh @@ -15,7 +15,7 @@ network_check update_os msg_info "Installing Dependencies" -$STD apk add --no-cache curl openssl +$STD apk add --no-cache curl openssl apache2-utils msg_ok "Installed Dependencies" msg_info "Installing Tinyauth" @@ -25,10 +25,13 @@ RELEASE=$(curl -s https://api.github.com/repos/steveiliop56/tinyauth/releases/la curl -fsSL "https://github.com/steveiliop56/tinyauth/releases/download/v${RELEASE}/tinyauth-amd64" -o /opt/tinyauth/tinyauth chmod +x /opt/tinyauth/tinyauth +PASSWORD=$(openssl rand -base64 8 | tr -dc 'a-zA-Z0-9' | head -c 8) +USER=$(htpasswd -Bbn "tinyauth" "${PASSWORD}") + cat < /opt/tinyauth/credentials.txt -echo "Tinyauth Credentials" -echo "Username: user" -echo "Password: password" +Tinyauth Credentials +Username: tinyauth +Password: ${PASSWORD} EOF echo "${RELEASE}" >/opt/tinyauth_version.txt @@ -41,10 +44,12 @@ SECRET=$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | head -c 32) cat </opt/tinyauth/.env SECRET=${SECRET} -USERS=user:\$2a\$10\$tfjwMcNIFAUewa9ts4hK4e9qP4rdG4L5qAwWmgtG54KnP9U.0tMxy +USERS=${USER} APP_URL=${app_url} EOF +sed -i -e 's/\$/\$\$/g' /opt/tinyauth/.env + cat </etc/init.d/tinyauth #!/sbin/openrc-run description="Tinyauth Service" From 39a8499ff7c1725dfe751f703fe92a0542cd87aa Mon Sep 17 00:00:00 2001 From: Stavros Date: Wed, 21 May 2025 19:50:22 +0300 Subject: [PATCH 08/13] chore: use community scripts username --- ct/tinyauth.sh | 2 +- misc/build.func | 20 ++++++++++---------- misc/install.func | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ct/tinyauth.sh b/ct/tinyauth.sh index 1b87a4d71..d281b5514 100644 --- a/ct/tinyauth.sh +++ b/ct/tinyauth.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -s https://raw.githubusercontent.com/steveiliop56/ProxmoxVE/main/misc/build.func) +source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) # Copyright (c) 2021-2025 community-scripts ORG # Author: Slaviša Arežina (tremor021) # Modified by: Stavros (steveiliop56) diff --git a/misc/build.func b/misc/build.func index 7ce0de499..1ea66b264 100644 --- a/misc/build.func +++ b/misc/build.func @@ -14,7 +14,7 @@ variables() { RANDOM_UUID="$(cat /proc/sys/kernel/random/uuid)" # generates a random UUID and sets it to the RANDOM_UUID variable. } -source <(curl -fsSL https://raw.githubusercontent.com/steveiliop56/ProxmoxVE/main/misc/api.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) # This function sets various color variables using ANSI escape codes for formatting text in the terminal. color() { @@ -69,7 +69,7 @@ catch_errors() { # This function is called when an error occurs. It receives the exit code, line number, and command that caused the error, and displays an error message. error_handler() { - source /dev/stdin <<<$(curl -fsSL https://raw.githubusercontent.com/steveiliop56/ProxmoxVE/main/misc/api.func) + source /dev/stdin <<<$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) if [ -n "$SPINNER_PID" ] && ps -p "$SPINNER_PID" >/dev/null; then kill "$SPINNER_PID" >/dev/null; fi printf "\e[?25h" local exit_code="$?" @@ -275,7 +275,7 @@ update_motd_ip() { # Function to download & save header files get_header() { local app_name=$(echo "${APP,,}" | tr -d ' ') - local header_url="https://raw.githubusercontent.com/steveiliop56/ProxmoxVE/main/ct/headers/${app_name}" + local header_url="https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/headers/${app_name}" local local_header_path="/usr/local/community-scripts/headers/${app_name}" mkdir -p "$(dirname "$local_header_path")" @@ -941,7 +941,7 @@ install_script() { header_info echo -e "${INFO}${HOLD} ${GN}Using Config File on node $PVEHOST_NAME${CL}" METHOD="config_file" - source <(curl -fsSL https://raw.githubusercontent.com/steveiliop56/ProxmoxVE/main/misc/config-file.func) + source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/config-file.func) config_file break ;; @@ -1014,7 +1014,7 @@ check_container_storage() { } start() { - source <(curl -fsSL https://raw.githubusercontent.com/steveiliop56/ProxmoxVE/main/misc/tools.func) + source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func) if command -v pveversion >/dev/null 2>&1; then if ! (whiptail --backtitle "Proxmox VE Helper Scripts" --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then clear @@ -1071,9 +1071,9 @@ build_container() { TEMP_DIR=$(mktemp -d) pushd "$TEMP_DIR" >/dev/null if [ "$var_os" == "alpine" ]; then - export FUNCTIONS_FILE_PATH="$(curl -fsSL https://raw.githubusercontent.com/steveiliop56/ProxmoxVE/main/misc/alpine-install.func)" + export FUNCTIONS_FILE_PATH="$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/alpine-install.func)" else - export FUNCTIONS_FILE_PATH="$(curl -fsSL https://raw.githubusercontent.com/steveiliop56/ProxmoxVE/main/misc/install.func)" + export FUNCTIONS_FILE_PATH="$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/install.func)" fi export RANDOM_UUID="$RANDOM_UUID" export CACHER="$APT_CACHER" @@ -1105,7 +1105,7 @@ build_container() { $PW " # This executes create_lxc.sh and creates the container and .conf file - bash -c "$(curl -fsSL https://raw.githubusercontent.com/steveiliop56/ProxmoxVE/main/ct/create_lxc.sh)" $? + bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/create_lxc.sh)" $? LXC_CONFIG=/etc/pve/lxc/${CTID}.conf if [ "$CT_TYPE" == "0" ]; then @@ -1167,7 +1167,7 @@ http://dl-cdn.alpinelinux.org/alpine/latest-stable/community EOF' pct exec "$CTID" -- ash -c "apk add bash >/dev/null" fi - lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/steveiliop56/ProxmoxVE/main/install/"$var_install".sh)" $? + lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/install/"$var_install".sh)" $? } @@ -1180,7 +1180,7 @@ description() { cat < - Logo + Logo

${APP} LXC

diff --git a/misc/install.func b/misc/install.func index 67db3bfea..842ed4a97 100644 --- a/misc/install.func +++ b/misc/install.func @@ -69,7 +69,7 @@ catch_errors() { # This function handles errors error_handler() { - source <(curl -fsSL https://raw.githubusercontent.com/steveiliop56/ProxmoxVE/main/misc/api.func) + source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) if [ -n "$SPINNER_PID" ] && ps -p "$SPINNER_PID" >/dev/null; then kill "$SPINNER_PID" >/dev/null; fi printf "\e[?25h" local exit_code="$?" @@ -216,7 +216,7 @@ EOF msg_info "Installing core dependencies" $STD apt-get update $STD apt-get install -y sudo curl mc gnupg2 - source <(curl -fsSL https://raw.githubusercontent.com/steveiliop56/ProxmoxVE/main/misc/tools.func) + source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func) msg_ok "Core dependencies installed" } @@ -267,7 +267,7 @@ EOF systemctl restart $(basename $(dirname $GETTY_OVERRIDE) | sed 's/\.d//') msg_ok "Customized Container" fi - echo "bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/steveiliop56/ProxmoxVE/main/ct/${app}.sh)\"" >/usr/bin/update + echo "bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/${app}.sh)\"" >/usr/bin/update chmod +x /usr/bin/update if [[ -n "${SSH_AUTHORIZED_KEY}" ]]; then From 8276eebf363381b2d2e3192dade304d694403c97 Mon Sep 17 00:00:00 2001 From: Stavros Date: Wed, 21 May 2025 19:51:32 +0300 Subject: [PATCH 09/13] fix: fix disk space var --- ct/tinyauth.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/tinyauth.sh b/ct/tinyauth.sh index d281b5514..7ee94d2cd 100644 --- a/ct/tinyauth.sh +++ b/ct/tinyauth.sh @@ -10,7 +10,7 @@ APP="Tinyauth" var_tags="${var_tags:-alpine;auth}" var_cpu="${var_cpu:-1}" var_ram="${var_ram:-256}" -var_disk="${var_disk:2}" +var_disk="${var_disk:-2}" var_os="${var_os:-alpine}" var_version="${var_version:-3.21}" var_unprivileged="${var_unprivileged:-1}" From 49aacc32dd7c470923ed8195670011cdd5558964 Mon Sep 17 00:00:00 2001 From: Stavros Date: Wed, 21 May 2025 20:16:52 +0300 Subject: [PATCH 10/13] chore: revert name change --- ct/{tinyauth.sh => alpine-tinyauth.sh} | 2 +- ct/headers/alpine-tinyauth | 6 ++++++ ct/headers/tinyauth | 6 ------ .../{tinyauth.json => alpine-tinyauth.json} | 21 ++++++++++++++----- ...-install.sh => alpine-tinyauth-install.sh} | 0 5 files changed, 23 insertions(+), 12 deletions(-) rename ct/{tinyauth.sh => alpine-tinyauth.sh} (98%) create mode 100644 ct/headers/alpine-tinyauth delete mode 100644 ct/headers/tinyauth rename frontend/public/json/{tinyauth.json => alpine-tinyauth.json} (71%) rename install/{tinyauth-install.sh => alpine-tinyauth-install.sh} (100%) diff --git a/ct/tinyauth.sh b/ct/alpine-tinyauth.sh similarity index 98% rename from ct/tinyauth.sh rename to ct/alpine-tinyauth.sh index 7ee94d2cd..fd77f111c 100644 --- a/ct/tinyauth.sh +++ b/ct/alpine-tinyauth.sh @@ -6,7 +6,7 @@ source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/m # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # Source: https://github.com/steveiliop56/tinyauth -APP="Tinyauth" +APP="Alpine-Tinyauth" var_tags="${var_tags:-alpine;auth}" var_cpu="${var_cpu:-1}" var_ram="${var_ram:-256}" diff --git a/ct/headers/alpine-tinyauth b/ct/headers/alpine-tinyauth new file mode 100644 index 000000000..9fff055f8 --- /dev/null +++ b/ct/headers/alpine-tinyauth @@ -0,0 +1,6 @@ + ___ __ _ _______ __ __ + / | / /___ (_)___ ___ /_ __(_)___ __ ______ ___ __/ /_/ /_ + / /| | / / __ \/ / __ \/ _ \______/ / / / __ \/ / / / __ `/ / / / __/ __ \ + / ___ |/ / /_/ / / / / / __/_____/ / / / / / / /_/ / /_/ / /_/ / /_/ / / / +/_/ |_/_/ .___/_/_/ /_/\___/ /_/ /_/_/ /_/\__, /\__,_/\__,_/\__/_/ /_/ + /_/ /____/ diff --git a/ct/headers/tinyauth b/ct/headers/tinyauth deleted file mode 100644 index 3959b07dd..000000000 --- a/ct/headers/tinyauth +++ /dev/null @@ -1,6 +0,0 @@ - _______ __ __ - /_ __(_)___ __ ______ ___ __/ /_/ /_ - / / / / __ \/ / / / __ `/ / / / __/ __ \ - / / / / / / / /_/ / /_/ / /_/ / /_/ / / / -/_/ /_/_/ /_/\__, /\__,_/\__,_/\__/_/ /_/ - /____/ diff --git a/frontend/public/json/tinyauth.json b/frontend/public/json/alpine-tinyauth.json similarity index 71% rename from frontend/public/json/tinyauth.json rename to frontend/public/json/alpine-tinyauth.json index 7b3b4a5c1..10cd6b109 100644 --- a/frontend/public/json/tinyauth.json +++ b/frontend/public/json/alpine-tinyauth.json @@ -1,6 +1,6 @@ { - "name": "Tinyauth", - "slug": "tinyauth", + "name": "Alpine-Tinyauth", + "slug": "alpine-tinyauth", "categories": [ 6 ], @@ -17,13 +17,24 @@ "install_methods": [ { "type": "default", - "script": "ct/tinyauth.sh", + "script": "ct/alpine-tinyauth.sh", "resources": { "cpu": 1, "ram": 256, "hdd": 2, - "os": null, - "version": null + "os": "alpine", + "version": "3.21" + } + }, + { + "type": "alpine", + "script": "ct/alpine-tinyauth.sh", + "resources": { + "cpu": 1, + "ram": 256, + "hdd": 2, + "os": "alpine", + "version": "3.21" } } ], diff --git a/install/tinyauth-install.sh b/install/alpine-tinyauth-install.sh similarity index 100% rename from install/tinyauth-install.sh rename to install/alpine-tinyauth-install.sh From 772f6861a2c9508fa02a41457a83675cd147a535 Mon Sep 17 00:00:00 2001 From: Stavros Date: Wed, 21 May 2025 22:01:02 +0300 Subject: [PATCH 11/13] chore: apply review requests --- ct/alpine-tinyauth.sh | 2 +- ct/headers/alpine-tinyauth | 10 +++++----- install/alpine-tinyauth-install.sh | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ct/alpine-tinyauth.sh b/ct/alpine-tinyauth.sh index fd77f111c..8ef1201db 100644 --- a/ct/alpine-tinyauth.sh +++ b/ct/alpine-tinyauth.sh @@ -2,7 +2,7 @@ source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) # Copyright (c) 2021-2025 community-scripts ORG # Author: Slaviša Arežina (tremor021) -# Modified by: Stavros (steveiliop56) +# Co-Author: Stavros (steveiliop56) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # Source: https://github.com/steveiliop56/tinyauth diff --git a/ct/headers/alpine-tinyauth b/ct/headers/alpine-tinyauth index 9fff055f8..207a09037 100644 --- a/ct/headers/alpine-tinyauth +++ b/ct/headers/alpine-tinyauth @@ -1,6 +1,6 @@ - ___ __ _ _______ __ __ - / | / /___ (_)___ ___ /_ __(_)___ __ ______ ___ __/ /_/ /_ - / /| | / / __ \/ / __ \/ _ \______/ / / / __ \/ / / / __ `/ / / / __/ __ \ - / ___ |/ / /_/ / / / / / __/_____/ / / / / / / /_/ / /_/ / /_/ / /_/ / / / -/_/ |_/_/ .___/_/_/ /_/\___/ /_/ /_/_/ /_/\__, /\__,_/\__,_/\__/_/ /_/ + ___ __ _ __ _ __ __ + / | / /___ (_)___ ___ / /_(_)___ __ ______ ___ __/ /_/ /_ + / /| | / / __ \/ / __ \/ _ \______/ __/ / __ \/ / / / __ `/ / / / __/ __ \ + / ___ |/ / /_/ / / / / / __/_____/ /_/ / / / / /_/ / /_/ / /_/ / /_/ / / / +/_/ |_/_/ .___/_/_/ /_/\___/ \__/_/_/ /_/\__, /\__,_/\__,_/\__/_/ /_/ /_/ /____/ diff --git a/install/alpine-tinyauth-install.sh b/install/alpine-tinyauth-install.sh index 0818630f3..61e403fb9 100644 --- a/install/alpine-tinyauth-install.sh +++ b/install/alpine-tinyauth-install.sh @@ -2,7 +2,7 @@ # Copyright (c) 2021-2025 community-scripts ORG # Author: Slaviša Arežina (tremor021) -# Modified by: Stavros (steveiliop56) +# Co-Author: Stavros (steveiliop56) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # Source: https://github.com/steveiliop56/tinyauth From 5491488addb26127aa821d2c9baf29e77618ca16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Slavi=C5=A1a=20Are=C5=BEina?= <58952836+tremor021@users.noreply.github.com> Date: Wed, 21 May 2025 21:07:34 +0200 Subject: [PATCH 12/13] Update ct/alpine-tinyauth.sh --- ct/alpine-tinyauth.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ct/alpine-tinyauth.sh b/ct/alpine-tinyauth.sh index 8ef1201db..c483a2bc0 100644 --- a/ct/alpine-tinyauth.sh +++ b/ct/alpine-tinyauth.sh @@ -1,8 +1,7 @@ #!/usr/bin/env bash source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) # Copyright (c) 2021-2025 community-scripts ORG -# Author: Slaviša Arežina (tremor021) -# Co-Author: Stavros (steveiliop56) +# Author: Slaviša Arežina (tremor021) | Co-Author: Stavros (steveiliop56) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # Source: https://github.com/steveiliop56/tinyauth From a600abac40c39ed5796f72fcee75f0af401cda3b Mon Sep 17 00:00:00 2001 From: Tobias <96661824+CrazyWolf13@users.noreply.github.com> Date: Wed, 21 May 2025 21:14:36 +0200 Subject: [PATCH 13/13] Update alpine-tinyauth-install.sh --- install/alpine-tinyauth-install.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/install/alpine-tinyauth-install.sh b/install/alpine-tinyauth-install.sh index 61e403fb9..a96bac541 100644 --- a/install/alpine-tinyauth-install.sh +++ b/install/alpine-tinyauth-install.sh @@ -1,8 +1,7 @@ #!/usr/bin/env bash # Copyright (c) 2021-2025 community-scripts ORG -# Author: Slaviša Arežina (tremor021) -# Co-Author: Stavros (steveiliop56) +# Author: Slaviša Arežina (tremor021) | Co-Author: Stavros (steveiliop56) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # Source: https://github.com/steveiliop56/tinyauth