From 8743b6d1fbdfd2d5d6d408e721adca9981a17987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Thu, 8 Aug 2024 09:06:13 +0200 Subject: [PATCH] chore: remove useless trusted proxies environement variables (#651) --- compose.yaml | 2 -- docs/tls.md | 1 - docs/troubleshooting.md | 11 ----------- 3 files changed, 14 deletions(-) diff --git a/compose.yaml b/compose.yaml index cbb4f51..96db15e 100644 --- a/compose.yaml +++ b/compose.yaml @@ -6,8 +6,6 @@ services: SERVER_NAME: ${SERVER_NAME:-localhost}, php:80 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: ${TRUSTED_HOSTS:-^${SERVER_NAME:-example\.com|localhost}|php$$} # Run "composer require symfony/orm-pack" to install and configure Doctrine ORM DATABASE_URL: postgresql://${POSTGRES_USER:-app}:${POSTGRES_PASSWORD:-!ChangeMe!}@database:5432/${POSTGRES_DB:-app}?serverVersion=${POSTGRES_VERSION:-15}&charset=${POSTGRES_CHARSET:-utf8} # Run "composer require symfony/mercure-bundle" to install and configure the Mercure integration diff --git a/docs/tls.md b/docs/tls.md index 8411607..c3b64f6 100644 --- a/docs/tls.md +++ b/docs/tls.md @@ -45,7 +45,6 @@ To disable HTTPS, configure your environment to use HTTP by setting the followin ```bash SERVER_NAME=http://localhost \ MERCURE_PUBLIC_URL=http://localhost/.well-known/mercure \ -TRUSTED_HOSTS='^localhost|php$' \ docker compose up --pull always -d --wait ``` diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 3ecb3f4..88ae99c 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -4,17 +4,6 @@ If you work on linux and cannot edit some of the project files right after the first installation, you can run `docker compose run --rm php chown -R $(id -u):$(id -g) .` to set yourself as owner of the project files that were created by the docker container. -## HTTPs and Redirects - -If Symfony is generating an internal redirect for an `https://` url, but the resulting url is `http://`, you have to uncomment the `TRUSTED_PROXIES` setting in your `.env` file and add this line in `config/packages/framework.yaml`: -``` -# config/packages/framework.yaml -framework: - trusted_proxies: '%env(TRUSTED_PROXIES)%' -``` - -For more details see the [Symfony internal redirect documentation](https://symfony.com/doc/current/routing.html#redirecting-to-urls-and-routes-directly-from-a-route). - ## TLS/HTTPS Issues See more in the [TLS section](tls.md)