.
Some checks failed
Test / test (push) Has been cancelled

This commit is contained in:
2026-01-17 14:56:31 +00:00
parent b9b3f89910
commit 17253479a6
10 changed files with 1113 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
#!/usr/bin/env bash
set -euo pipefail
# Generates a Traefik BasicAuth users string using Apache MD5 (apr1).
# Output format matches Traefik label: basicauth.users="user:hash"
#
# Usage:
# ./generate-traefik-basicauth.sh <username> <password>
#
# Recommended to paste output into:
# /etc/runtipi/app-data/runtipi/rego-tunnel/app.env
# as:
# NOVNC_BASIC_AUTH_USERS='<output>'
user="${1:-}"
pass="${2:-}"
if [[ -z "$user" || -z "$pass" ]]; then
echo "Usage: $0 <username> <password>" >&2
exit 2
fi
if ! command -v openssl >/dev/null 2>&1; then
echo "openssl not found; cannot generate apr1 hash" >&2
exit 1
fi
hash="$(openssl passwd -apr1 "$pass")"
printf "%s:%s\n" "$user" "$hash"