🔧 fix (compose): APP_BASE_URL follows HTTP_PORT override#76
Merged
Conversation
When operators overrode HTTP_PORT, login redirects still pointed at :8000 because APP_BASE_URL's default was hardcoded. Nest HTTP_PORT into the default so the two stay in sync. Verified with HTTP_PORT=9998: Keycloak redirect_uri and the backend env both resolve to :9998. Co-Authored-By: Yakueline (Claude) <noreply@anthropic.com>
mrdavidlaing
pushed a commit
that referenced
this pull request
Apr 20, 2026
Same nested-default shape as PR #76 (APP_BASE_URL). When operators overrode KEYCLOAK_PORT, the container bound the new port but KC_HOSTNAME still defaulted to :8180, so browsers were sent to the wrong port. Nest KEYCLOAK_PORT into the default so the two stay in sync. Verified via `docker compose config`: default resolves to :8180, KEYCLOAK_PORT=9180 resolves to :9180, explicit KC_HOSTNAME override still wins. Co-Authored-By: Bob (Claude) <noreply@anthropic.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
HTTP_PORTinto theAPP_BASE_URLdefault inapps/sbomify/deployments/compose/docker-compose.yml(lines 8 and 200) so an operator-suppliedHTTP_PORTflows through to login redirects instead of being stranded at:8000.Why
When operators override
HTTP_PORT, Caddy correctly binds the new port, butAPP_BASE_URLstill defaulted tohttp://127.0.0.1:8000. That fed the wrong port into the Keycloakredirect_uri, so login flows sent users back to:8000and broke the quickstart for anyone not on the default port.Test plan
docker compose configwith no env →APP_BASE_URL: http://127.0.0.1:8000(unchanged)HTTP_PORT=9000 docker compose config→APP_BASE_URL: http://127.0.0.1:9000APP_BASE_URL=http://example.com docker compose config→ explicit override still winsHTTP_PORT=9998 docker compose up --wait: backend env showsAPP_BASE_URL=http://127.0.0.1:9998;/login/redirects to.../accounts/oidc/keycloak/login/; OIDC hop carriesredirect_uri=http%3A%2F%2F127.0.0.1%3A9998%2F...; Keycloak returns HTTP 200 (accepts the redirect URI).Notes
HTTP_PORT=9000as an example, but that collides with MinIO's default:9000binding. Tested with9998instead; the fix itself is port-agnostic. Worth a separate yak if the README should change.KC_HOSTNAMEon line 35 has the same hardcoded-port shape againstKEYCLOAK_PORT. Out of scope here, but a candidate for a follow-up.🤖 Generated with Claude Code