10 Commits
Author SHA1 Message Date
micbar 4e7ebd4f8c fix: only trust forwarding headers from trusted reverse proxies
chi's ClientIPFrom* header middlewares trust the header from anyone who can
  reach us. Pick the middleware per request instead: headers are only read
  when the peer is a trusted proxy, everyone else gets their network address.

  - PROXY_TRUSTED_PROXIES, defaults to loopback and private ranges
  - PROXY_CLIENT_IP_HEADER, defaults to X-Forwarded-For, e.g. CF-Connecting-IP
  - drop the strategy setting and xff_trusted_hops
  - pass the client address to the services in X-Forwarded-For instead of
    X-Client-Ip, reva reads it e.g. for OCM
  - same check in collaboration, traefik routes to it directly
  - OC_TRUSTED_PROXIES and OC_CLIENT_IP_HEADER set both services
  - the other services only drop RealIP, none of them reads the address

  Taken from #3864 and https://github.com/opencloud-eu/opencloud/pull/3464#issuecomment-6494799883

# Conflicts:
#	services/proxy/README.md
2026-10-30 15:15:22 +01:00
Alex Ababii cf0f06e060 select correct chi middleware to get real IP based on config values 2026-10-30 15:13:55 +01:00
Alex Ababii 850f1714a1 upd deprecated chi RealIP middelware 2026-10-30 15:13:54 +01:00
Dominik Schmidt 0ad6112dd2 chore(debug): remove leftover commented-out probeHandler 2026-05-19 11:13:59 +02:00
Dominik Schmidt 46a8dee126 fix(debug): drop duplicate service field from probe fallback log
The base logger created by log.Configure already attaches a "service"
field via its context. handleProbe added it a second time, producing
JSON log entries with two "service" keys. Remove the redundant
Str("service", name) and the now-unused name parameter.
2026-05-19 11:04:23 +02:00
Florian Schade 288e67cc39 chore: replace interface with any 2026-04-23 09:31:11 +02:00
Jörn Friedrich Dreyer b19307f1be allow http2 connections to proxy
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2025-12-16 12:03:55 +01:00
Christian Richter 0372869b8b refactor remaining code from urfave/cli
Signed-off-by: Christian Richter <c.richter@opencloud.eu>
2025-12-15 16:40:27 +01:00
Ralf Haferkamp e07f0154bb Rebrand pkg 2025-01-20 10:59:08 +01:00
Jörn Friedrich Dreyer b07b5a1149 use plain pkg module
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2025-01-13 16:42:19 +01:00