Skip to content

Commit

Permalink
Allow overriding TRUSTED_HOSTS and MERCURE_PUBLIC_URL variables (api-…
Browse files Browse the repository at this point in the history
…platform#2666)

* build(compose.yaml): allow overriding TRUSTED_HOSTS and MERCURE_PUBLIC_URL variables

Fix issue with invalid TRUSTED_HOSTS and MERCURE_PUBLIC_URL when using http://localhost or :80 as SERVER_NAME

* Apply suggestions from code review

---------

Co-authored-by: JH <[email protected]>
Co-authored-by: Vincent <[email protected]>
  • Loading branch information
3 people authored and mfernandes80 committed Aug 13, 2024
1 parent 70cdca3 commit bb3a669
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ services:
MERCURE_PUBLISHER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
MERCURE_SUBSCRIBER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
TRUSTED_PROXIES: ${TRUSTED_PROXIES:-127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16}
TRUSTED_HOSTS: ^${SERVER_NAME:-example\.com|localhost}|php$$
TRUSTED_HOSTS: ${TRUSTED_HOSTS:-^${SERVER_NAME:-example\.com|localhost}|php$$}
DATABASE_URL: postgresql://${POSTGRES_USER:-app}:${POSTGRES_PASSWORD:-!ChangeMe!}@database:5432/${POSTGRES_DB:-app}?serverVersion=${POSTGRES_VERSION:-16}&charset=${POSTGRES_CHARSET:-utf8}
MERCURE_URL: ${CADDY_MERCURE_URL:-http://php/.well-known/mercure}
MERCURE_PUBLIC_URL: https://${SERVER_NAME:-localhost}/.well-known/mercure
MERCURE_PUBLIC_URL: ${CADDY_MERCURE_PUBLIC_URL:-https://${SERVER_NAME:-localhost}/.well-known/mercure}
MERCURE_JWT_SECRET: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
MERCURE_EXTRA_DIRECTIVES: demo
# See https://xdebug.org/docs/all_settings#mode
Expand Down

0 comments on commit bb3a669

Please sign in to comment.