this post was submitted on 28 Apr 2024
3 points (100.0% liked)

Selfhosted

44306 readers
1 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

I spent all day today trying to get the routing to work correctly between Tailscale, Nginx and Adguard.

Basically I wanted to be able to be able to use **http://immich.network ** to route to 192.168.1.2:9000

I wanted to share the steps I took so people don't have to go through what I did.

First a few things Local Server IP: 192.168.1.2

  1. I installed Ngnix and Adguard, in a Docker Containers, and gave Adguard IPs 3000, 3001 instead of 80 and 443 because Ngnix took it.
  2. I went to my router and made it use the DNS: 192.168.1.2
  3. I configured Proxy Host in Ngnix ..... immich.network => 192.168.1.2:9000
  4. I configured DNS rewrite in Adguard .... *.network => 192.168.1.2

At this point I was able to use http://immich.network finally. I installed Tailscale to be able to access when I'm outside but http://immich.network didn't work.

These helped me https://tailscale.com/kb/1019/subnets + https://tailscale.com/kb/1054/dns?q=global+nameserver

  1. I created a subnet..... tailscale up --advertise-routes=192.168.1.0/24
  2. I approved it on Tailscale login

At this point I was able to access home server using its local IP 192.168.1.2 but I couldn't get http://immich.network to work.

  1. I created a nameserver dns with split DNS but I used my local ip.. 192.168.1.2 => network

Finally everything is working.. I have a feeling that I'm doing it wrong but I'm too tired and it's finally working.

top 13 comments
sorted by: hot top controversial new old
[–] [email protected] 4 points 11 months ago (1 children)

Congrats on getting everything working - it looks great!

One piece of (unprovoked, potentially unwanted) advice is to setup SSL. I know you're running your services behind Wireguard so there isn't too much of a security concern running your services on HTTP. However, as the number of your services or users (family, friends, etc.) increases, you're more likely to run into issues with services not running on HTTPS.

The creation and renewal of SSL certificates can be done for free (assuming you have a domain name already) and automatically with certain reverse proxy services like NGINXProxyManager or Traefik, which can both be run in Docker. If you set everything up with a wildcard certificate via DNS challenge, you can still keep the services you run hidden from people scanning DNS records on your domain (ie people won't know that an SSL certificate was issued for immich.your.domain). How you set up the DNS challenge will vary by the DNS provider and reverse proxy service, but the only additional thing that you will likely need to set up a wildcard challenge, regardless of which services you use, is an email address (again, assuming you have a domain name).

[–] [email protected] 1 points 11 months ago* (last edited 11 months ago)

Thank you for the* so much wanted advice, it's one of the reasons I actually posted this, to get advices on how to do things better.

I've been trying to do that for a specific service running (firefly) but I can't figure out what to do exactly, about the domain name, Is there a way to do that without one?

[–] [email protected] 1 points 11 months ago

If you only access your local domain name inside your LAN and via VPN you can also use Caddy to have local SSL certificates https://caddyserver.com/docs/automatic-https#local-https Have not tried this myself yet but I like the idea of not getting any warnings in browser, and this is safe as long as the Caddy CA root certificate is safe.

[–] [email protected] 1 points 11 months ago* (last edited 8 months ago)

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:

Fewer Letters More Letters
CA (SSL) Certificate Authority
DNS Domain Name Service/System
HTTP Hypertext Transfer Protocol, the Web
HTTPS HTTP over SSL
IP Internet Protocol
SSL Secure Sockets Layer, for transparent encryption
VPN Virtual Private Network
VPS Virtual Private Server (opposed to shared hosting)
XMPP Extensible Messaging and Presence Protocol ('Jabber') for open instant messaging
nginx Popular HTTP server

10 acronyms in this thread; the most compressed thread commented on today has 6 acronyms.

[Thread #719 for this sub, first seen 28th Apr 2024, 06:25] [FAQ] [Full list] [Contact] [Source code]

[–] [email protected] 0 points 11 months ago (1 children)

Hello again.

I've gone through your steps outlined in this post now for LAN. I've made my own network name .crypt and added *.crypt to Adguard and pointed it at the IP address of Nginx.

I've then gone and mapped my local services in Nginx. So radarr.crypt sonarr.crypt plex.crypt etc and mapped them to ports.

Now what I enjoyed was that I had to map Adguard to forward to Nginx, but in Nginx I can use the IP address of anything on my network, not just on the host.

So it's map Adguard in DNS rewrites to Nginx IP, then map the IP:ports in Proxy Hosts in Nginx.

Now when I use my Tailscale exit node (that I have from Home Assistant) I can use those addresses outside the house.

I have noticed it only works for the .crypt domains, and not .local despite being set up as well. I guess because .local is a special address it is harder to map to Tailscale.

Anyway, it's working for me after following what you've done, I just did less in Tailscale because of the exit node

[–] [email protected] 2 points 1 month ago (1 children)

I'm glad that the steps helped you, sorry I only saw your comment now because I wasn't very active here for a while.

I came back because I was moving from Windows to Linux so I had to redo some stuff, I'm glad I wrote the steps, by helping other I ended up helping myself

[–] [email protected] 1 points 1 month ago* (last edited 1 month ago)

What's amusing is I'm long time stoner. As such, I have a shit memory. I do not remember writing this comment. Nor do I remember even struggling with this. I do know that I had a bunch of .crypt domains for a while.

So your comment is hilarious because I frequently find my own comments when I'm struggling through that thing I once did that I don't remember, documenting what I did.

I do it to help others, I call it "leaving breadcrumbs for those further back on the path" but those breadcrumbs are great when a server dies and you have to re set it up.

Kudos for being a great guy and leaving breadcrumbs. Karma likes to remind you that you're a wonderful person sometimes, so just enjoy it, and don't let the bastards grind you down.

Rereading my own comment, I do this, I thank people hoping they're still active at some point. I really do believe in thanking those that help me, even if they may not see it until 10 months later, if at all. You must have been the post that slotted it all into place.

[–] [email protected] -1 points 11 months ago (1 children)

I used chatgpt to create the exact steps, commands and configurations I needed for my setup and achieved this the seemingly cheatful way. I used nginx and certbot. Worked like a charm. Congrats!

[–] [email protected] 1 points 11 months ago (1 children)

I used chatgpt to create the exact steps, commands and configurations I needed for my setup and achieved this the seemingly cheatful way. I used nginx and certbot. Worked like a charm. Congrats!

It's impressive that you was able to get it to help you correctly. It usually just spew things i need to fix that's why I didn't ask him, thank you for the tip.

Btw did you use a custom local domain name or did you use an actual domain ?

[–] [email protected] 0 points 11 months ago (1 children)

Thanks, it took some prompts but it worked in the end! I used a few subdomains of an actual domain I use for email...

[–] [email protected] 0 points 11 months ago (1 children)

I just finished the SSL today, but have you gotten Syncthing GUI to work though? I can't seem to get it to work with the domain for some reason.

[–] [email protected] 1 points 8 months ago (1 children)

Don't mean to necrobump. But I have Syncthing GUI working over a very similar setup. Let me know if you still need help setting it up.

[–] [email protected] 1 points 8 months ago

It took me a week suffering to get syncthing to work but it finally did. Thank you