fix: update entrypoint and config to bind to 0.0.0.0 for Cloud Run

This commit is contained in:
Haitao Pan 2026-01-23 18:38:32 +08:00
parent 3c5a018b63
commit 315517c047
2 changed files with 3 additions and 3 deletions

View File

@ -14,7 +14,7 @@ auth:
refreshExpiry: "168h"
server:
addr: ":8080"
addr: "0.0.0.0:8080"
readTimeout: 15s
writeTimeout: 15s
publicUrl: "https://accounts.svc.plus"

View File

@ -100,13 +100,13 @@ if [ -n "${PORT:-}" ]; then
tmp_cfg=$(mktemp)
awk -v port="$PORT" '
/^server:/ {print; in_server=1; addr_written=0; next}
in_server && /^ addr:/ {print " addr: \":" port "\""; addr_written=1; next}
in_server && /^ addr:/ {print " addr: \"0.0.0.0:" port "\""; addr_written=1; next}
in_server && /^ [^ ]/ {in_server=0}
{print}
END {
if (port != "" && in_server == 0 && addr_written == 0) {
print "server:";
print " addr: \":" port "\"";
print " addr: \"0.0.0.0:" port "\"";
}
}
' "${CONFIG_FILE}" > "${tmp_cfg}"