mirror of
https://github.com/fosrl/pangolin.git
synced 2026-07-26 11:33:52 -05:00
Closed
opened 2026-04-16 07:53:42 -05:00 by GiteaMirror
·
9 comments
No Branch/Tag Specified
main
dependabot/npm_and_yarn/fast-uri-3.1.4
refactor/batch-status-requests
dependabot/docker/docker-dependencies-6cbd4d48e0
dependabot/npm_and_yarn/npm-dependencies-8b2d4a9f3a
dependabot/go_modules/install/go-install-dependencies-3804ca7238
dev
dependabot/npm_and_yarn/body-parser-2.3.0
dependabot/npm_and_yarn/axios-1.18.0
crowdin_dev
fix/labels-dropdown-flicker
dependabot/github_actions/github-actions-dependencies-2ee11778c9
feat/remember-last-idp-on-smart-login-form
dependabot/npm_and_yarn/multi-5f1280885e
fix/non-semver-version-error
private-resource-page
resource-launcher
backhaul
exit-node-reconnect
feat/command-palette
ssh
delete-account
msg-delivery
org-only-idp
cicd
patch
site-targets-auto-login
1.21.0
1.21.0-rc.0
1.20.0
1.20.0-rc.0
1.19.4
1.19.3
1.19.2
1.19.1
1.19.0
1.19.0-rc.1
1.19.0-rc.0
1.18.4
1.18.3
1.18.2
1.18.1
1.18.0
1.18.0-rc.0
1.17.1
1.17.0
1.17.0-rc.0
1.16.2
1.16.1
1.16.0
1.16.0-rc.0
1.15.4
1.15.3
1.15.2
1.15.1
1.15.0
1.15.0-rc.0
1.14.1
1.14.0
1.14.0-rc.0
1.13.1
1.13.0
1.13.0-rc.0
1.12.3
1.12.2
1.12.1
1.12.0
1.12.0-rc.0
1.11.1
1.11.0
1.10.3
1.10.2
1.10.1
1.10.0
1.9.4
1.9.3
1.9.2
1.9.1
1.9.0
1.8.0
1.7.3
1.7.2
1.7.1
1.7.0
1.6.2
1.6.1
1.6.0
1.5.1
1.5.0
1.4.0
1.3.2
1.3.1
1.3.0
1.2.0
1.1.0
1.0.1
1.0.0
1.0.0-beta.15
1.0.0-beta.14
1.0.0-beta.13
1.0.0-beta.12
1.0.0-beta.11
1.0.0-beta.10
1.0.0-beta.9
1.0.0-beta.8
1.0.0-beta.7
1.0.0-beta.6
1.0.0-beta.5
1.0.0-beta.4
1.0.0-beta.3
1.0.0-beta.2
1.0.0-beta.1
Labels
Clear labels
api
authentication
bug
config
dependencies
docker
documentation
enhancement
good first issue
help wanted
Improvement
Look Into
needs investigating
networking
new feature
non-critical bug
potential bug
pull-request
question
reverse proxy
Security
stale
ui
wontfix
Mirrored from GitHub Pull Request
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/pangolin#1261
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @sequence711 on GitHub (Jan 9, 2025).
Original GitHub issue: https://github.com/fosrl/pangolin/issues/18
Hello,
I opened an issue 12 hours or so ago but it doesn't seem to be visible to anyone except my own account (not this one). I'll repost the issue here so it's actually visible while I'm trying to fix my account :)
I'm trying to set up Pangolin on a Raspberry Pi on the same network as a few other servers (and my workstation).
I'm encountering a problem when trying to connect via the subdomain I set, but only when connected to the same network as Pangolin. If I turn on a VPN or connect from my phone (on mobile data) it works fine.
I've tried to troubleshoot it, but I'm still unsure exactly what causes this problem. It's not impossible there's something in my network acting up.
However, I'm able to spin up Caddy and reverse proxy to the same subdomain with another service on the Raspberry Pi and other servers with no problem what so ever.
I have no experience with Traefik so I tried looking through the configuration and modifying it but it made no difference.
Any idea what could be going wrong? I would send logs if I could but I haven't seen any log reacting at all to my connection attempts (successful and unsuccessful).
@oschwartz10612 commented on GitHub (Jan 9, 2025):
Hi!
If I understand correctly you are saying:
Is this right?
If so I would suspect that your DNS is resolving the WAN (public) IP of your network - which would make sense and is how it should work - but your internal router is not doing "hairpin NAT" to loop back your request. I think this is simply a routing problem that Caddy might handle better than Traefik.
I would try to look into hairpin NAT on your router. What is your router model? Or maybe split DNS? Take a look at this Reddit post as well and see if it can help at all: https://www.reddit.com/r/selfhosted/comments/ozound/traefik_2_lets_encrypt_hairpin_internal_lan_not/
@sequence711 commented on GitHub (Jan 9, 2025):
Hello!
Correct, I can reach the interface via IP and port but I'm not able to login, it redirects me to the interface again.
I also thought it was NAT hairpinning at first but it is enabled and working for everything except Pangolin. I also tried split DNS through Adguard Home but when I try to connect it loads forever. Also tried a combination of those but it does not work.
My router is a EdgeRouter 4! I've tried searching for solutions both for Traefik and the router but I've come up empty handed :/.
I do find it a little odd that it would work flawlessly with Caddy with hairpinning enabled, and if I disable hairpinning it stops working, so I think hairpinning is working as intended.
I see a comment about Traefik and SSL, perhaps that is the issue? Usually I get an error message saying there's something wrong with the certs though.
@sequence711 commented on GitHub (Jan 9, 2025):
I'm pretty sure this isn't solely a networking issue but I'm not entirely sure what else to check.
So far I've tried the following:
I also created a separate Traefik instance to see if I could reverse proxy to other services - which worked with no problems. The services are hosted on the same host in another Docker container.
This worked with and without the automatic HTTPS.
And while writing this I came up with other things to try that just might work and I just found it.
I had used the default configuration generated from the installer (checking through the compose.yml and the other configuration files) and nothing looked odd except Traefik using
network_mode: service:gerbilwhich I hadn't seen yet, but assumed this was necessary for some reason.I only had to move the ports 80 and 443 from Gerbil to Traefik and now it's working locally as well.
But that makes me wonder, does Gerbil need to have access to the ports as well? Will it work with the ports on Traefik instead of Gerbil?
@sequence711 commented on GitHub (Jan 10, 2025):
Alright I figured out that it does not work if you move 80 and 443 to Traefik.
I also found out everything was caused by overlapping subnets (Wireguard 10.0.0.0/8 overlapped with my internal network). I have no idea why it worked after moving the ports but I've moved everything back and it's working now.
I can't believe it took me days to figure this out, I've never even opened an issue before..
Anyhow, thanks for the product, I'm sure this will grow big in no time. It looks very polished already 😄
This is exacly what I've been looking for!
@miloschwartz commented on GitHub (Jan 10, 2025):
Glad you got it working! We're going to document this in the docs in case anyone else has this issue. Thanks
@polarathene commented on GitHub (Mar 17, 2025):
Was the usage of
network_mode: service:gerbildocumented? I didn't seem to have luck finding anything in the docs about it andgit blameprovides no context on the repo compose example that introduced it.It appears to share the same bridge network IP assigned to the referenced service. Was that necessary or beneficial for anything in particular? (EDIT: It also shares the same loopback address)
The above query can be done multiple times and you'll find the response alternates between both containers (recognizable via the
CADDY_HOSTenv distinction) listening on the same shared interfaces (default bind is0.0.0.0), since Caddy supports that.The Pangolin Docker DNS docs mention that
localhostwould only refer to the container itself, which is generally true, but this is perhaps something to be mindful of.I haven't seen
network_modeused like this before, so I'm curious if it was intentional or just what worked well at the time (possibly without knowing about other alternatives).@polarathene commented on GitHub (Mar 17, 2025):
An additional heads-up regarding the docs here:
That's the default
docker0bridge network gateway and it'll vary based on the subnet address pools used when letting compose create a bridged network.The above snippet adds that
172.17.0.1IP (or equivalent) to the containers/etc/hostsas a convenience (DNS tools won't resolve it as a result):There can be caveats as the 2nd link notes when you rely on
host-gateway(or slightly worse172.17.0.1) vs setting theextra_hostsmapping to the appropriate gateway IP (_which you can control with static assignment in thenetworksconfig (like the 2nd link details, although you shouldn't need to setip_range+gatewayattributes, just thesubnetif keeping it simple).For the actual use-case described in the docs (to reach sites running within the same compose container network)... you could leverage the internal DNS docker manages within containers (
127.0.0.11:53).It'll be the default DNS configured in a container, and you can query the service name, container name, hostname, or network aliases configured. Just set the container
hostnameto the public domain name if it doesn't need to go through the proxy layer.In my earlier Caddy example, if
network_mode: service:gerbilwasn't set, you could usewget -qO - worldto get the expected response in a deterministic manner, just like you would then get within thehellocontainer instance. You could use the example query above, but run it from within theworldcontainer to queryhelloand it'll resolve that to the private network IP the container got from the default bridge network compose created.The only other scenario when you do need some indirection, such as reaching the reverse proxy instead of the container directly, you can do that via network aliases:
Any container in that compose network can then use the alias to connect to the reverse proxy instead of a direct connection, similar to public access. The aliases could match the public domains provided there's no concerns with that.
Another option instead of aliases is to change the DNS default to intercept your domains and set the IP to the container one instead of the public IP via a conditional rewrite (blocky does that well).
Also be mindful of Docker defaulting to
userland-proxy: truewhich can be set tofalsein/etc/docker/daemon.json. That handles NAT hairpinning on the Docker host IIRC, you'll find a notable performance improvement if benching network throughput (I recall the proxy halved the iperf3 performance last I checked), it's mostly there for localhost routing convenience (but I don't think it's necessary for that either today, [I have a table to compare routing differences, although it may be a bit outdated by now).@oschwartz10612 commented on GitHub (Mar 17, 2025):
Thanks for all of the great information. We will try to update the docs - or feel free to contribute if you have time. https://github.com/fosrl/docs
network_mode: service:gerbilis used to put the Traefik container in to the Gerbil container's network namespace. This is so it can traverse over the wireguard interface inside of the Gerbil network namespace easily. This is documented from docker here: https://docs.docker.com/reference/compose-file/services/#network_mode@polarathene commented on GitHub (Mar 17, 2025):
Yeah I saw those docs and it didn't help me understand what it was doing that well hence my reproduction above.
At first I thought it was establishing a network that was isolated between the two containers, rather than sharing the same network(s).
I'm not too familiar with what's going on under the hood, but I'm assuming the difference is you can just refer to ports or
localhost:1234instead ofgerbil:1234/traefik:1234? Probably a little more efficient on network routing too that way, but I've no idea if there's a meaningful amount of overhead avoided 😅Sometimes for more niche and technical topics it's simpler to keep it brief on the docs and just link to related discussions like here where more detailed info can be found. I do this when updating docs for topics users have brought up but the concerns aren't directly related to what the project itself manages/does, as is the case here I think with Docker / Compose specific networking features and caveats.