mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-03-03 14:55:54 +00:00
Tinyauth: v5 Support & add Debian Version (#12501)
This commit is contained in:
committed by
GitHub
parent
a7699361c1
commit
14a7ac2618
@@ -35,6 +35,20 @@ function update_script() {
|
|||||||
$STD service tinyauth stop
|
$STD service tinyauth stop
|
||||||
msg_ok "Service Stopped"
|
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"
|
msg_info "Updating Tinyauth"
|
||||||
rm -f /opt/tinyauth/tinyauth
|
rm -f /opt/tinyauth/tinyauth
|
||||||
curl -fsSL "https://github.com/steveiliop56/tinyauth/releases/download/v${RELEASE}/tinyauth-amd64" -o /opt/tinyauth/tinyauth
|
curl -fsSL "https://github.com/steveiliop56/tinyauth/releases/download/v${RELEASE}/tinyauth-amd64" -o /opt/tinyauth/tinyauth
|
||||||
|
|||||||
53
ct/tinyauth.sh
Normal file
53
ct/tinyauth.sh
Normal file
@@ -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}"
|
||||||
@@ -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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
51
frontend/public/json/tinyauth.json
Normal file
51
frontend/public/json/tinyauth.json
Normal file
@@ -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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -36,9 +36,9 @@ msg_ok "Installed Tinyauth"
|
|||||||
read -r -p "${TAB3}Enter your Tinyauth subdomain (e.g. https://tinyauth.example.com): " app_url
|
read -r -p "${TAB3}Enter your Tinyauth subdomain (e.g. https://tinyauth.example.com): " app_url
|
||||||
|
|
||||||
cat <<EOF >/opt/tinyauth/.env
|
cat <<EOF >/opt/tinyauth/.env
|
||||||
DATABASE_PATH=/opt/tinyauth/database.db
|
TINYAUTH_DATABASE_PATH=/opt/tinyauth/database.db
|
||||||
USERS='${USER}'
|
TINYAUTH_AUTH_USERS='${USER}'
|
||||||
APP_URL=${app_url}
|
TINYAUTH_APPURL=${app_url}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
msg_info "Creating Service"
|
msg_info "Creating Service"
|
||||||
|
|||||||
62
install/tinyauth-install.sh
Normal file
62
install/tinyauth-install.sh
Normal file
@@ -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 <<EOF >/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 <<EOF >/opt/tinyauth/.env
|
||||||
|
TINYAUTH_DATABASE_PATH=/opt/tinyauth/database.db
|
||||||
|
TINYAUTH_AUTH_USERS='${USER}'
|
||||||
|
TINYAUTH_APPURL=${app_url}
|
||||||
|
EOF
|
||||||
|
cat <<EOF >/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
|
||||||
Reference in New Issue
Block a user