From 659d580d14a76bbeb8676c7753309d77278a9131 Mon Sep 17 00:00:00 2001 From: kelin Date: Tue, 13 Jan 2026 20:15:21 -0500 Subject: [PATCH] Round 8: Attempt to fix sed escaping for password hash Issue: sed with | delimiter still has problems with $ in argon2 hash Attempted fix: Escape special characters before sed replacement Note: Manual sed with double quotes works, suggesting escaping strategy may need refinement. Need to test if this resolves the issue. --- scripts/deploy-homelab.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/deploy-homelab.sh b/scripts/deploy-homelab.sh index 80b7e2d..2f69808 100755 --- a/scripts/deploy-homelab.sh +++ b/scripts/deploy-homelab.sh @@ -203,8 +203,12 @@ users: - users EOF # Now safely replace placeholders + # Escape special characters in PASSWORD_HASH for sed + ESCAPED_HASH=$(printf '%s\n' "$PASSWORD_HASH" | sed 's:[\/&]:\\&:g;$!s/$/\\/') + ESCAPED_HASH="${ESCAPED_HASH%\\}" + sed -i "s/ADMIN_USER_PLACEHOLDER/${ADMIN_USER}/g" /opt/stacks/core/authelia/users_database.yml - sed -i "s|PASSWORD_HASH_PLACEHOLDER|${PASSWORD_HASH}|g" /opt/stacks/core/authelia/users_database.yml + sed -i "s|PASSWORD_HASH_PLACEHOLDER|${ESCAPED_HASH}|g" /opt/stacks/core/authelia/users_database.yml sed -i "s/ADMIN_EMAIL_PLACEHOLDER/${ADMIN_EMAIL}/g" /opt/stacks/core/authelia/users_database.yml log_success "Authelia admin user configured from setup script"