fix(deploy): preserve credentials across installer retries

This commit is contained in:
root committed 2026-09-05 14:39:09 +00:00
1 parent 053e199be0
commit 22366380c6
1 file changed
+7
+7
View File
@@ -236,6 +236,13 @@ S_POSTGRES_PASSWORD=$(secret); S_VALKEY_PASSWORD=$(secret)
S_INTERNAL_SHARED_SECRET=$(secret); S_ACCESS_TOKEN_SECRET=$(secret); S_SETUP_TOKEN=$(secret)
E_POSTGRES_PASSWORD=$(secret); E_PLAYBACK_TICKET_SECRET=$(secret); E_PLAYBACK_LEASE_KEY=$(secret)
E_STORAGE_CREDENTIAL_KEY=$(secret); E_PLUGIN_SECRET_KEY=$(secret)
# Re-runs must reuse credentials that initialized existing database volumes.
if [ -f "$ENV_FILE" ]; then
for name in S_POSTGRES_PASSWORD S_VALKEY_PASSWORD S_INTERNAL_SHARED_SECRET S_ACCESS_TOKEN_SECRET S_SETUP_TOKEN E_POSTGRES_PASSWORD E_PLAYBACK_TICKET_SECRET E_PLAYBACK_LEASE_KEY E_STORAGE_CREDENTIAL_KEY E_PLUGIN_SECRET_KEY; do
value=$(sed -n "s/^${name}=//p" "$ENV_FILE" | head -n 1)
[ -n "$value" ] && eval "$name=\"$value\""
done
fi
INSTANCE_SUFFIX=$(hostname 2>/dev/null | tr -cd '[:alnum:]' | cut -c1-24); [ -n "$INSTANCE_SUFFIX" ] || INSTANCE_SUFFIX=customer
cat > "$ENV_FILE" <<EOF