From 5033aa3a5ead9924855a2e41db8be0674148b998 Mon Sep 17 00:00:00 2001 From: Jems <5523410+J3m5@users.noreply.github.com> Date: Wed, 3 Apr 2024 17:29:26 +0200 Subject: [PATCH] Allow overriding TRUSTED_HOSTS and MERCURE_PUBLIC_URL variables (#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 Co-authored-by: Vincent <407859+vincentchalamon@users.noreply.github.com> --- compose.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compose.yaml b/compose.yaml index 9d9b569bc0..306a327fd0 100644 --- a/compose.yaml +++ b/compose.yaml @@ -10,10 +10,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!} volumes: - caddy_data:/data