-
Notifications
You must be signed in to change notification settings - Fork 1
[codex] Prioritize web port output #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -214,15 +214,17 @@ calculate_ports() { | |
| POSTGRES_URL="postgresql://app:app@127.0.0.1:${POSTGRES_HOST_PORT}/app" | ||
| DATABASE_URL="$POSTGRES_URL" | ||
| REDIS_URL="redis://127.0.0.1:${REDIS_HOST_PORT}/0" | ||
| WEB_URL="http://127.0.0.1:${WEB_PORT}" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When using the documented Useful? React with 👍 / 👎. |
||
| WEB_API_BASE_URL="http://127.0.0.1:${API_PORT}" | ||
| OTEL_EXPORTER_OTLP_ENDPOINT="http://127.0.0.1:${OTEL_HTTP_PORT}" | ||
| } | ||
|
|
||
| print_env() { | ||
| prefix="$1" | ||
| calculate_ports | ||
| printf '%sAPI_PORT=%s\n' "$prefix" "$API_PORT" | ||
| printf '%sWEB_URL=%s\n' "$prefix" "$WEB_URL" | ||
| printf '%sWEB_PORT=%s\n' "$prefix" "$WEB_PORT" | ||
| printf '%sAPI_PORT=%s\n' "$prefix" "$API_PORT" | ||
| printf '%sWORKER_HEALTH_PORT=%s\n' "$prefix" "$WORKER_HEALTH_PORT" | ||
| printf '%sPOSTGRES_HOST_PORT=%s\n' "$prefix" "$POSTGRES_HOST_PORT" | ||
| printf '%sREDIS_HOST_PORT=%s\n' "$prefix" "$REDIS_HOST_PORT" | ||
|
|
@@ -239,7 +241,42 @@ export_env() { | |
| export API_PORT WEB_PORT WORKER_HEALTH_PORT | ||
| export POSTGRES_HOST_PORT REDIS_HOST_PORT | ||
| export OTEL_HTTP_PORT POSTGRES_URL DATABASE_URL REDIS_URL | ||
| export WEB_API_BASE_URL OTEL_EXPORTER_OTLP_ENDPOINT | ||
| export WEB_URL WEB_API_BASE_URL OTEL_EXPORTER_OTLP_ENDPOINT | ||
| } | ||
|
|
||
| has_override() { | ||
| key="$1" | ||
| while IFS= read -r assignment; do | ||
| case "$assignment" in | ||
| "$key="*) return 0 ;; | ||
| esac | ||
| done <<EOF | ||
| $overrides | ||
| EOF | ||
| return 1 | ||
| } | ||
|
|
||
| refresh_derived_env_after_overrides() { | ||
| if ! has_override POSTGRES_URL; then | ||
| POSTGRES_URL="postgresql://app:app@127.0.0.1:${POSTGRES_HOST_PORT}/app" | ||
| fi | ||
| if ! has_override DATABASE_URL; then | ||
| DATABASE_URL="$POSTGRES_URL" | ||
| fi | ||
| if ! has_override REDIS_URL; then | ||
| REDIS_URL="redis://127.0.0.1:${REDIS_HOST_PORT}/0" | ||
| fi | ||
| if ! has_override WEB_URL; then | ||
| WEB_URL="http://127.0.0.1:${WEB_PORT}" | ||
| fi | ||
| if ! has_override WEB_API_BASE_URL; then | ||
| WEB_API_BASE_URL="http://127.0.0.1:${API_PORT}" | ||
| fi | ||
| if ! has_override OTEL_EXPORTER_OTLP_ENDPOINT; then | ||
| OTEL_EXPORTER_OTLP_ENDPOINT="http://127.0.0.1:${OTEL_HTTP_PORT}" | ||
| fi | ||
| export POSTGRES_URL DATABASE_URL REDIS_URL | ||
| export WEB_URL WEB_API_BASE_URL OTEL_EXPORTER_OTLP_ENDPOINT | ||
| } | ||
|
|
||
| run_with_env() { | ||
|
|
@@ -284,6 +321,8 @@ $1" | |
| $overrides | ||
| EOF | ||
|
|
||
| refresh_derived_env_after_overrides | ||
|
|
||
| exec "$@" | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.