mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-06 13:10:37 -04:00
fix(upgrade): ignore whitespace around root user values before quoting
phpdotenv trims whitespace around an unquoted value, including the \r of CRLF line endings. The repair quoted such values, which broke valid lines in CRLF files and kept spaces that phpdotenv drops. Trim the value first and quote it only when a space is still inside it. Closes #12375 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
43933ee6cc
commit
7faa46bbd4
@@ -228,6 +228,9 @@ quote_root_user_env_values() {
|
||||
local key value
|
||||
for key in ROOT_USERNAME ROOT_USER_EMAIL ROOT_USER_PASSWORD; do
|
||||
value=$(grep -m1 "^${key}=" "$ENV_FILE" | cut -d '=' -f2-) || continue
|
||||
# phpdotenv ignores whitespace around an unquoted value (also the \r of CRLF line endings)
|
||||
value="${value#"${value%%[![:space:]]*}"}"
|
||||
value="${value%"${value##*[![:space:]]}"}"
|
||||
case "$value" in
|
||||
\"* | \'* | *[[:space:]]\#*) continue ;;
|
||||
*[[:space:]]*) ;;
|
||||
|
||||
Reference in New Issue
Block a user