[Feature Request] Way to choose between internal or external IP-address in href or use IP from browser in links #1208
Replies: 13 comments 2 replies
-
Have you thought about or looked at tailscale? Tailscale it's free and based on wireguard, I use it with pc running Syncthing at my son's house, so I can do simple remote backups. |
Beta Was this translation helpful? Give feedback.
-
No I have not, was not aware of it. Thanks a lot, looking into it now. Headless seems to be a nice addition. I guess that's easier and especially more secure than always punching holes into my router when I add a new service. |
Beta Was this translation helpful? Give feedback.
-
I've been running PiHole internally and have it serve up the internal IP address for the dynamic DNS name when I'm inside my network. |
Beta Was this translation helpful? Give feedback.
-
As @JazzFisch mentioned (I run the same setup) splitting DNS is the easier solution. If/when I have local-only containers, I can still access them outside the network with wireguard. |
Beta Was this translation helpful? Give feedback.
-
@C8opmBM great link! The only change I would make is that PiHole now allows you to create DNS Records and CNAMEs via the UI. |
Beta Was this translation helpful? Give feedback.
-
Hmm interesting ideas, thanks. Do you have a link or something so I could read up on that PiHole solution? Sounds intriguing. I also have PiHole running but only as a adblocker, am I missing it's full potential? Unfortunately Tailscale is not really what I'm looking for. Sure, an easy VPN is good. But what if I want to access something on my server on a new device where I don't have the rights to install additional software? That is rather unlikely but not impossible. I could only open the RDP port and then always use a browser on that RDP-Desktop so I'm always in the local network. But just opening a page in the normal browser is way cooler. Even if I have to have a perforated firewall for that... Still not entirely sold but I'll keep trying new stuff. |
Beta Was this translation helpful? Give feedback.
-
The idea was to setup a reverse proxy for your domain and subdomains you use for your containers (read up on SWAG or example, create cnames for your subdomains with cloudflare) and access them using subdomain domain both for lan and outside with split DNS. |
Beta Was this translation helpful? Give feedback.
-
Is this still going on? For me this would be nice as well. I have the dashboard done now. All have href with local IP of my Synology NAS and their ports. But on my work I can access the dashboard also (behind a Cloudflare worker. So I have to login first) but then it will be very easy to have a second href or an icon in a corner that have the external link to open some services. Like Radarr, Sonarr and some other tools that I use When you use labels in docker compose:
When you use the config files:
The box itself is the HREF and left next to the Status green icon a symbol for HREF.EXTERNAL : |
Beta Was this translation helpful? Give feedback.
-
Something like this is really needed, as I usually access this internally but when I am away from home I access it via Tailscale, which means all services would have a different IP address. On top of that, services like Krusader also require the IP a second time in the URL (super weird), and so having as a variable would be super helpful.
|
Beta Was this translation helpful? Give feedback.
-
I'd really love if this feature gets added. I'm using cloudflare tunnel and have my own domain name. I don't want to create two different homepage containers. |
Beta Was this translation helpful? Give feedback.
-
I think this is exactly what you are looking for: I coded a slider in the footer which allows you to change the local domain of your services (e.g. This and can be used by just pasting the code into your |
Beta Was this translation helpful? Give feedback.
-
I think you want to achieve "same host but different port" relative links instead of hardcoding internal/external links in config. I have this solution in my custom js, which also rewrites certain deeplinks on devices that don't support multitouch (i.e.: on my PC): const supportsDeeplink = navigator.maxTouchPoints > 1
const all = document.getElementsByTagName('a')
let hostname = window.location.hostname
if (hostname.endsWith('/')) {
hostname = hostname.slice(0, -1)
}
const prefix = window.location.protocol + '//' + hostname
for (let i=0, max=all.length; i < max; i++) {
if (all[i].href.startsWith('http://192.168.1.6')) {
all[i].href = prefix + all[i].href.slice('http://192.168.1.6'.length)
} else if (!supportsDeeplink) {
if (all[i].href.startsWith('homeassistant://navigate')) {
all[i].href = prefix + ':8123' + all[i].href.slice('homeassistant://navigate'.length)
} else if (all[i].href.startsWith('org.jellyfin.expo://')) {
all[i].href = prefix + ':8096/' + all[i].href.slice('org.jellyfin.expo://'.length)
}
}
} |
Beta Was this translation helpful? Give feedback.
-
Here's an further pared down version of the script (taken and modified from the awesome toggle make by @Criomby The idea is to set up services with a sentinel url ( My usecase is that I access the server locally via mDNS (as /**
* Updates the sentinel hrefs on the page.
*
* This method iterates through all sentinel elements and sets their href
* attributes to the current URL.
*/
const updateSentinelHrefs = () => {
// Define the sentinel host URL
const SENTINEL_HOST = "http://homepage_host";
// Get all elements with the class "service-title-text"
// These are all hrefs defined in services.yaml
// (I think, not exhaustively verified)
const serviceWidgetsLink = document.getElementsByClassName("service-title-text");
// Get the current browser address
let browserAddr = window.location.protocol + "//" + window.location.hostname;
// Loop through each sentinel element
for (let i = 0; i < serviceWidgetsLink.length; i++) {
// Get the current href attribute of the sentinel element
let href = serviceWidgetsLink[i].href;
// Check if the href contains the sentinel host URL
if (href.includes(SENTINEL_HOST)) {
// Replace the sentinel host URL with the current browser domain
serviceWidgetsLink[i].href = href.replace(SENTINEL_HOST, browserAddr);
}
}
};
updateSentinelHrefs(); It would be amazing if this was natively a part of homepage! |
Beta Was this translation helpful? Give feedback.
-
How it's set up right now
In all the "href"-links I use the local IP of my server to link to the services and pages. The IP-address is always the same, only the port differs. This all is fine when I'm inside of my local network.
However I do have an external IP and opened all corresponding ports in my router so I can access all the control panels from outside of my local network. I use a Dyncamic DNS Service (https://www.changeip.com/), so I don't have changing external IPs, since I'm not paying my ISP a monthly fee for a fixed IP address.
But that means I can not use my Homepage, because all my links point to my local IP address within my local network. Or I would have to also use the external IP address when I'm in my local network, generating unnecessary outbound traffic.
How I would like it to be
$browser-address$
and I just use that and add my port.An example for both approaches could look like this, either the variable is defined somewhere else or it reads its value from the URL:
or
Or maybe one would define two addresses (one with numbers [internal] and one alphanumeric [external]) and Homepage would automatically choose a link based on what is in the URL right now.
So Plex might be on port
32400
in my local network, but in my router I'm forwarding40000
from remote to32400
internal.Again, Homepage would choose which port to link to based on what is in the URL after
://
and beforethe port-number
or first slash/
Example:
or this may be easier to read
I hope all is clear. If not please don't hesitate to ask for clarification.
This is my first issue ever, so please bare with me.
I could imagine some other service already doing somehting like this. But I have no idea how I would find it or how they went about this.
Beta Was this translation helpful? Give feedback.
All reactions