fix: handle special characters in passwords during setup
- Logto entrypoint builds DB_URL from PG_USER/PG_PASSWORD/PG_HOST with URL-encoding via node's encodeURIComponent, instead of embedding the raw password in the connection string - Installer submodule updated: passwords single-quoted in .env/.conf Fixes SMTP and DB auth failures when passwords contain $, &, ;, [, etc. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# Build DB_URL from individual env vars so passwords with special characters
|
||||
# are properly URL-encoded (Logto only accepts a connection string)
|
||||
if [ -z "$DB_URL" ]; then
|
||||
ENCODED_PW=$(node -e "process.stdout.write(encodeURIComponent(process.env.PG_PASSWORD || ''))")
|
||||
export DB_URL="postgres://${PG_USER:-cameleer}:${ENCODED_PW}@${PG_HOST:-localhost}:5432/logto"
|
||||
echo "[entrypoint] Built DB_URL from PG_USER/PG_PASSWORD/PG_HOST"
|
||||
fi
|
||||
|
||||
# Save the real public endpoints for after bootstrap
|
||||
REAL_ENDPOINT="$ENDPOINT"
|
||||
REAL_ADMIN_ENDPOINT="$ADMIN_ENDPOINT"
|
||||
|
||||
Reference in New Issue
Block a user