Oh boy I went down this same rabbit hole awhile ago. Here is a git repository that will explain why this happens and also offers a fix on how to modify your IP tables to ensure that docker respects the UFW.
It shouldn’t mess with your current routing but if you’re running other VPNs you may run into issues.
After you join the machines to the tailnet, each machine gets a new IP address ( only visible to other machines in the tailnet), by default it’s a 100.x.y.z you can check the tailnet for the device IP.
Now you can keep the port closed on your router and it will still be accessible over the usual lan ip and port. But when you want to access remotely, turn on tailscale and connect using the tailnet IP.
Another cool thing you can do with this setup is turn your home server into an exit node. By default it will only route things that are in the tailnet (100.x.y.z subnet). But if you turn your home server into an exit node you can funnel all your traffic back through the exit node. Instant free VPN back home!
Here you go friend, enjoy! 😁
Unencrypted HTTP can mean that anyone can see your traffic as it passes through their network. Your ISP will see that traffic. If you’re streaming pirated music and you’re in a country that cares about those things, might not go very well. From a security stand point though, you still wouldn’t want to trust the authentication on the open port. A vulnerability may exist that you don’t know about. It’s always better to keep them closed and add another layer or two between your home computer and the public.
Tailscale let’s you tunnel into your home network without opening any ports, and it encrypts the traffic. Much safer way of doing it.
Another tip, please be very careful when exposing ports to the public. With docker you’re already mitigating your attack surfaces but an open port allows anyone to make a connection and there are lots of bots out there looking for open ports and vulnerabilities. A good alternative would be to setup wireguard and instead then connect through that or if you like simplicity check out Tailscale.
Good news, they support OIDC! Haven’t tested it myself so your mileage may vary.
I can create tools for my company that launches right out of ConfigMgr Software Center and other technicians can contribute without needing a programming background.
Now this is a bit of magic I would like to learn. I read through PowerShell in a month of lunches a couple of years ago and it’s saved my butt a couple of times. I’m due for a re-read though. Would you have a source on where I could go to learn more about creating GUI applications in PowerShell?
Check out this guide to get started with exposing your services via proxy. I started with v1 and migrated to v2. Until I dug this link out for you, I had no idea about v3; but if it’s as good as the first two I can only imagine how good it is now.
https://www.smarthomebeginner.com/traefik-v3-docker-compose-guide-2024/
I ran into this same situation, this repo helped me solve it.
https://github.com/chaifeng/ufw-docker#solving-ufw-and-docker-issues
https://www.linuxserver.io/blog/advanced-wireguard-container-routing
I think what you’re looking to do is route using IPTables. I’ve achieved a similar setup with this guide, just not using a mail server. With this setup the DNS can actually be taken care of by docker. With my phone on wireguard I can resolve by the container name on my VPS, internal server docker container, internal lan, and everything else goes out to Mullvad (direct too thanks to split tunneling). Very slick setup.
Lol how funny. I was also very into modding the PSP growing up. I had a couple of Pandora batteries. The only reason I caught onto it was because my name is also Alex haha hello fellow Alex!