Detect if `trusted_proxies` and `client_ip_headers` are on, and do other header manupulation
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 25/100
Direção de pesquisa
The request concerns how FrankenPHP's Caddy integration handles trusted_proxies and client_ip_headers when setting $_SERVER values in the PHP SAPI, likely in the Go side where request environment variables are built. Start by locating where REMOTE_ADDR and HTTPS are populated for PHP requests and how Caddy's client IP settings reach it. Done means a design decision on a client_proto_headers-style option and tests showing X-Forwarded-Proto yields HTTPS only when trusted.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Describe your feature request
Is your feature request related to a problem? Please describe.
This previous discussion suggests that "FrankenPHP is not supposed to tell php the connection is https when it's not. Your application must handle the HTTP_X_FORWARDED_PROTO header, it's not the webservers job to lie to the application."
That is generally true -- when configuring following the Running being a reverse proxy instructions, FrankenPHP passes the request unmodified and application has to choose how to process it.
However, Caddy has trusted_proxies and client_ip_headers options which replace the REMOTE_ADDR value with the value provided by the proxy headers. This is convenient because the {client_ip} and other IP-based configuration can be used.
Using this option results in a situation where the application/framework's Trusted Proxies code doesn't see that the request came from a proxy -- which is exactly as desired, except that some other X-Forwarded-* values are not handled. Primarily, the X-Forwarded-Proto value is not translated to the HTTPS value in the $_SERVER superglobal, so the application/framework does not think the request came via a secure channel even though it did.
Describe the solution you'd like
It would be nice if we can detect that trusted_proxies and client_ip_headers are enabled and also process X-Forwarded-Proto. Alternatively, we may want this to be configurable and add another option - perhaps client_proto_headers - that can say which header(s) to look at, if present. (Unlike the base client_ip_headers, I do not think this can be added to Caddy itself, because the handling needs to be PHP-specific.)
Describe alternatives you've considered
There are two alternatives, which each have drawbacks:
- Tell the framework/application to "trust all proxies", so it will process the headers no matter what IP address is in
REMOTE_ADDR. This only works if traffic from non-proxy origins is completely blocked, which is not always practical. - Turn off
trusted_proxiesin Caddy/FrankenPHP, and only use the framework/application. This prevents Caddy's configuration from being able to use the real origin IP. Also, if multiple applications are used, they all need to be configured to handle proxy headers, instead of Caddy/FrankenPHP being able to do it all at once.
- Linguagem predominante
- Go
- Estrelas
- 11.5k
- Forks
- 510
- Merge médio
- 1d 10h
- PRs com merge (30d)
- 64
Preparar o ambiente
- Inclui um Dockerfile ou arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de php/frankenphp
-
enhancement
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 78/100
php/frankenphp#2806 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
php/frankenphp#2671 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Include frankenphp version in logsTalvez livre de novo Um pull request para esta issue foi fechado sem ser mesclado. Abertaenhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
php/frankenphp#2483 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
suggestion about compile.mdTalvez livre de novo Um pull request para esta issue foi fechado sem ser mesclado. Abertaenhancement
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 68/100
php/frankenphp#601 · 5 comentários ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 45/100
php/frankenphp#2771 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
Todas as issues de php/frankenphp
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
CycloneDX/cyclonedx-go#304 ·
-
[Bug]: snowflake_share fails to read a share attached to a listing with target accounts ('TARGETED ACCOUNTS' in the "to" column)Talvez já em andamento @akhil9tiet assumiu hoje. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
snowflakedb/terraform-provider-snowflake#5366 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
txn2/mcp-data-platform#2493 ·
Mantenedores costumam responder em até 1 dia
-
fix(doctor): format MongoDB URI and UNIX socket addresses correctly in doctor diagnostic outputAbertabug good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
oscarbol09/branchbase#178 ·
Mantenedores costumam responder em até 4 dias