[Feature]: Switch for local network (auto) #480

Closed
opened 2026-02-04 20:44:20 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @PeterBasista on GitHub (Dec 12, 2022).

Feature detail

Settings for the home network.

Description:
The specified url (http://immich.example.com) will be accessed if no local network is available (192.168.x.x:2283; e.g. based on the wifi name). If a home network is available, the application will connect via the local network.

Benefits:
Faster data transfer (internet transfer is dependent on the program from isp)

Why?
My current library is 2Tb. The files are hosted on a home server, moving this data and the subsequent fees would be costly.

Platform

Mobile App

Originally created by @PeterBasista on GitHub (Dec 12, 2022). ### Feature detail Settings for the home network. **Description:** The specified url (http://immich.example.com) will be accessed if no local network is available (192.168.x.x:2283; e.g. based on the wifi name). If a home network is available, the application will connect via the local network. **Benefits:** Faster data transfer (internet transfer is dependent on the program from isp) **Why?** My current library is 2Tb. The files are hosted on a home server, moving this data and the subsequent fees would be costly. ### Platform Mobile App
Author
Owner

@bo0tzz commented on GitHub (Dec 12, 2022):

Duplicate of #308

@bo0tzz commented on GitHub (Dec 12, 2022): Duplicate of #308
Author
Owner

@jpmiller25 commented on GitHub (Dec 12, 2022):

For the benefit of @PeterBasista and others looking into this, I ran into this same issue and have solved it with a number of steps. For the record, I use cloudflared with an Argo tunnel to expose my instance publicly, and wanted a route to easily reach the local server via the app. This is how I set up split DNS:
Your public facing domain should be served securely on https: So the first thing we need to do is run immich with https on the local network:

  • Run a caddy container (or reverse proxy of your choice) to serve immich on ports 80 and 443 of your local machine. Caddy will also handle certs, but this introduces a problem since I'm not using caddy for the public facing instance. I worked around this by setting up the dns.providers.cloudflare module in caddy, meaning I had to build my own docker container (First time I've ever had to do that, fun!) This allows caddy to integrate the dns challenge with my domain on cloudflare to verify the certs to the issuers, even though the caddy output is not served to the internet.
  • Run a two pihole instances on separate machines. I don't know why more people don't caution about this when talking about pihole, but if the network is properly configured with pihole as the dns, when it goes down at all your entire network is shot. (I learned this the hard way, and cost me points against the wife approval factor). I now have 2 pihole instances running on separate machines with the config and whitelists synchronized with OrbitalSync, and my router dhcp serves both machines ip addresses to the clients for dns resolving. So far so good.
  • BTW The dns redirect works whether or not filtering is on so you don't necessarily need to use the filter. But I've liked it so far since I added the anudeepND whitelist, before that it can be kind of a nuisance sometimes. I did add pihole to home assistant to give my wife a kill switch for the filter in case she's trying to do something that's blocked - I don't need those calls while I'm at work :).
  • Finally, add a custom dns record in pihole to reroute the immich domain to your local machine ip address.
  • Test your setup using 'dig https://immichdomain.com' when connected to your Wi-Fi, then tethered to your phone. It will tell you which IP the site is resolving to.

It's been a bit of an ordeal to set this up, and adds a not insignificant amount of work and maintenance for the user. I wonder if the decision not to add this feature might be worth reconsidering for the benefit of the typical selfhoster who is not necessarily a network architect. Though I'll admit I'm not a developer so I don't know what it would take to add this in the app. For what it's worth, Home Assistant provides this in app as such:
image
image
On the other hand, it appears NextCloud has decided not to implement this feature, and they recommend split DNS.
Hope this helps some folks.

@jpmiller25 commented on GitHub (Dec 12, 2022): For the benefit of @PeterBasista and others looking into this, I ran into this same issue and have solved it with a number of steps. For the record, I use cloudflared with an Argo tunnel to expose my instance publicly, and wanted a route to easily reach the local server via the app. This is how I set up split DNS: Your public facing domain should be served securely on https: So the first thing we need to do is run immich with https on the local network: - Run a caddy container (or reverse proxy of your choice) to serve immich on ports 80 and 443 of your local machine. Caddy will also handle certs, but this introduces a problem since I'm not using caddy for the public facing instance. I worked around this by setting up the dns.providers.cloudflare module in caddy, meaning I had to build my own docker container (First time I've ever had to do that, fun!) This allows caddy to integrate the dns challenge with my domain on cloudflare to verify the certs to the issuers, even though the caddy output is not served to the internet. - Run a two pihole instances on separate machines. I don't know why more people don't caution about this when talking about pihole, but if the network is properly configured with pihole as the dns, when it goes down at all your entire network is shot. (I learned this the hard way, and cost me points against the wife approval factor). I now have 2 pihole instances running on separate machines with the config and whitelists synchronized with OrbitalSync, and my router dhcp serves both machines ip addresses to the clients for dns resolving. So far so good. - BTW The dns redirect works whether or not filtering is on so you don't necessarily need to use the filter. But I've liked it so far since I added the anudeepND whitelist, before that it can be kind of a nuisance sometimes. I did add pihole to home assistant to give my wife a kill switch for the filter in case she's trying to do something that's blocked - I don't need those calls while I'm at work :). - Finally, add a custom dns record in pihole to reroute the immich domain to your local machine ip address. - Test your setup using 'dig https://immichdomain.com' when connected to your Wi-Fi, then tethered to your phone. It will tell you which IP the site is resolving to. It's been a bit of an ordeal to set this up, and adds a not insignificant amount of work and maintenance for the user. I wonder if the decision not to add this feature might be worth reconsidering for the benefit of the typical selfhoster who is not necessarily a network architect. Though I'll admit I'm not a developer so I don't know what it would take to add this in the app. For what it's worth, Home Assistant provides this in app as such: ![image](https://user-images.githubusercontent.com/5355449/207082420-af519cf0-115c-446b-9a7f-4c2ac6bc57f7.png) ![image](https://user-images.githubusercontent.com/5355449/207082446-ce00e7ee-48eb-43cf-8604-4918f55406a2.png) On the other hand, it appears NextCloud has decided not to implement this feature, and they recommend split DNS. Hope this helps some folks.
Author
Owner

@Betoniara commented on GitHub (Feb 10, 2024):

This should be natively supported

@Betoniara commented on GitHub (Feb 10, 2024): This should be natively supported
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#480