mirror of
https://github.com/fosrl/pangolin.git
synced 2026-07-16 22:55:14 -05:00
[GH-ISSUE #2357] Add trustip config option for Badger middleware (needed for Cloudflare Tunnel / local proxies) #12955
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @uwuceo on GitHub (Jan 28, 2026).
Original GitHub issue: https://github.com/fosrl/pangolin/issues/2357
Describe the Bug
I'm running Pangolin behind a cloudflared container (Cloudflare Tunnel). Badger is not correctly extracting the real client IP — it uses the cloudflared container's Docker IP instead of the value in
CF-Connecting-IP.Root cause:
Pangolin generates the Badger middleware config in
TraefikConfigManager.tswithout atrustipoption. This means only the default Cloudflare edge IPs are trusted. When using Cloudflare Tunnel, requests arrive from cloudflared's local Docker IP (e.g.,172.20.0.11), which isn't in the Cloudflare IP ranges — soCF-Connecting-IPis ignored.My
dynamic_config.ymlhas a separate Badger middleware withtrustip: ["172.16.0.0/12"], but routes generated by Pangolin usebadger@http(from the HTTP provider), notbadger@file.Debug output showing the issue (I added some debug logging):
The 22 trusted IPs are the default Cloudflare ranges from
ips/ips.go, not my custom config.Suggested fix:
Add a
badger.trustipoption toconfig.ymlthat gets passed through to the generated middleware inTraefikConfigManager.ts.Environment
To Reproduce
Expected Behavior
Badger should trust the cloudflared container's IP and extract the real client IP from CF-Connecting-IP.
Adding a custom Badger middleware with trustip: ["172.16.0.0/12"] in dynamic_config.yml doesn't help because Pangolin-generated routes use badger@http, not badger@file.
@github-actions[bot] commented on GitHub (Feb 12, 2026):
This issue has been automatically marked as stale due to 14 days of inactivity. It will be closed in 14 days if no further activity occurs.
@uwuceo commented on GitHub (Feb 12, 2026):
Not stale
@r4tze commented on GitHub (Feb 17, 2026):
Same for me.
But I am using a NGINX proxy in front of pangolin.
@oschwartz10612 commented on GitHub (Feb 25, 2026):
This is not supported, sorry!