Skip to content

Commit b6b0572

Browse files
JHmaxhelias
authored andcommitted
build(compose.yaml): introduce TRUSTED_HOSTS and CADDY_MERCURE_PUBLIC_URL variables
Fix issue with invalid TRUSTED_HOSTS and MERCURE_PUBLIC_URL when using http://localhost or :80 as SERVER_NAME
1 parent 7f6c142 commit b6b0572

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ services:
77
MERCURE_PUBLISHER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
88
MERCURE_SUBSCRIBER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
99
TRUSTED_PROXIES: ${TRUSTED_PROXIES:-127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16}
10-
TRUSTED_HOSTS: ^${SERVER_NAME:-example\.com|localhost}|php$$
10+
TRUSTED_HOSTS: ${TRUSTED_HOSTS:-^${SERVER_NAME:-example\.com|localhost}|php$$}
1111
# Run "composer require symfony/orm-pack" to install and configure Doctrine ORM
1212
DATABASE_URL: postgresql://${POSTGRES_USER:-app}:${POSTGRES_PASSWORD:-!ChangeMe!}@database:5432/${POSTGRES_DB:-app}?serverVersion=${POSTGRES_VERSION:-15}&charset=${POSTGRES_CHARSET:-utf8}
1313
# Run "composer require symfony/mercure-bundle" to install and configure the Mercure integration
1414
MERCURE_URL: ${CADDY_MERCURE_URL:-http://php/.well-known/mercure}
15-
MERCURE_PUBLIC_URL: https://${SERVER_NAME:-localhost}/.well-known/mercure
15+
MERCURE_PUBLIC_URL: ${CADDY_MERCURE_PUBLIC_URL:-https://${SERVER_NAME:-localhost}/.well-known/mercure}
1616
MERCURE_JWT_SECRET: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
1717
# The two next lines can be removed after initial installation
1818
SYMFONY_VERSION: ${SYMFONY_VERSION:-}

0 commit comments

Comments
 (0)