fix: enhance validation for HASHED_PASSWORD in production environment script

add: production/production.yaml to gitignore
This commit is contained in:
duthink 2025-10-18 14:24:56 +05:30
parent d4d99afdfa
commit 8f278e6a13
2 changed files with 8 additions and 0 deletions

1
.gitignore vendored
View file

@ -34,3 +34,4 @@ production/*.env
production/generated-compose.yaml
production/logs/
production/backups/
production/production.yaml

View file

@ -176,6 +176,13 @@ EOF
echo " Generate with: openssl passwd -apr1 yourpassword"
fi
# Check if HASHED_PASSWORD has username prefix (it shouldn't)
if [[ -n "$hashed_password" ]] && echo "$hashed_password" | grep -q "^admin:"; then
echo_error "HASHED_PASSWORD should NOT include 'admin:' prefix"
echo_warn "Remove 'admin:' from the hash in traefik.env"
echo_warn "The compose file adds it automatically"
fi
# Check domain format
local traefik_domain
traefik_domain=$(get_env_value "traefik.env" "TRAEFIK_DOMAIN")