| Post Reply | RetroFed Forum Forum Index » Tailscale |
| Author | Message | ||
|---|---|---|---|
|
sudo
programming.dev
sudo@programming.dev Joined: 2023-08-23 |
The goal is to share an http service privately on my tailnet but with an HTTPs connection. It seems others have spent lots of time figuring out and never sharing their solutions. I just got a setup to work satisfactorily so I'll share it. Criticism is welcome. First a few notes:
I also have deliberately avoided the "Private CA" because installing the cert of every client on my tailnet sounds like a nightmare. If someone can prove me wrong there, please share. The context
Restart caddy and that's it. The solutionFirst, I used sub domains of the public domain instead of headscales base domain. eg Use Second, I restrict caddy to only accept tailscale connections by using the
The IP addresses come from the output of Now The last step is to configure headscale's DNS to route private services to the headscale server on its its tailscale IP instead of the public IP.
You can have I tried using wildcard DNS records in headscale and it didn't work. It felt like it completely broke DNS without any clear warnings or errors. Idk if that's a bug or what. DNS just timed out internally LimitationsAll internal HTTPS traffic is routed through my VPS instead of directly peer to peer, which is a real bummer for internal latency. I think the only way around that is to give each internal host their own caddy server, have the DNS records point directly to them, but then use a private CA and all the hassle that's worth. Maybe DNS01 challenges will work... Also while I have no public records indicating what private subdomains I have beyond |
||
| 7 Original | |||
|
sandwichsaregood
lemmy.world
sandwichsaregood@lemmy.world Joined: 2024-08-04 |
It's usually preferable to use a firewall rather than telling Caddy to bind to a specific address. Or do both. What I mean though is, you shouldn't neglect also configuring a firewall if this machine is public. |
||
| 2 | |||
|
sudo
programming.dev
sudo@programming.dev Joined: 2023-08-23 |
It's usually preferable to use a firewall rather than telling Caddy to bind to a specific address. Or do both. What I mean though is, you shouldn't neglect also configuring a firewall if this machine is public.
Some of my services (eg headscale) are public and a firewall would block those since it doesn't know what a domain name is, just IPs and ports. I do have a firewall fwiw but it keeps 443 open. Otherwise a remote device wouldn't be able to connect to the headscale node and get onto my tailnet. |
||
| 1 | |||
| Post Reply |
Back to top |