rmountjoy92 / DashMachine

Another web application bookmark dashboard, with fun features.
GNU General Public License v3.0
1.24k stars 121 forks source link

[BUG] localhost and 127.0.0.1 do not get resolved to what IP DashMachine is hosted on #132

Closed thatpix3l closed 4 years ago

thatpix3l commented 4 years ago

I do not know if I explained myself clearly in the title, so I'll expand here. Basically, I have other web services running on my machine that also hosts DashMachine. In the DashMachine config, I access those web services by inputting "127.0.0.1:SOME_PORT" to the URL locations. It works fine if I open DashMachine on the computer that's also hosting those services, but does not work on something like my laptop or phone. Those devices instead try to access "127.0.0.1", which means they're trying to access themselves. And all of this happens as well when I instead use "localhost" as the URL.

rxmii4269 commented 4 years ago

I don't think this is a bug. Accessing the localhost from the machine that is hosting the web services is expected, what DashMachine does is create a link so you accessing these web services using that link with localhost or "127.0.0.1" is expected. To access the web services outside of the host machine please use the actual IP of the machine not localhost.

thatpix3l commented 4 years ago

I do use the actual IP of the machine from my laptop and phone. I guess I didn't explain myself well after all, but here's a picture that summarizes my dilemma 2020-04-15 17_46_31 Screenshot_LI

marcjmiller commented 4 years ago

Could you provide the sample of the config that produces the error? It sounds like intended behavior, but perhaps there is something we're misunderstanding.

thatpix3l commented 4 years ago

[Settings] theme = dark accent = blue background = None roles = admin,user,public_user home_access_groups = admin_only settings_access_groups = admin_only custom_app_title = DashMachine sidebar_default = open

[admin] role = admin password = confirm_password =

[SABnzbd] prefix = http:// url = localhost:5001 icon = static/images/icons/SABnzbd Logo.png sidebar_icon = static/images/icons/SABnzbd Logo.png description = Usenet downloader open_in = iframe

[NZBHydra2] prefix = http:// url = localhost:5002 icon = static/images/icons/NZBHydra2 Logo.png sidebar_icon = static/images/icons/NZBHydra2 Logo.png description = Usenet meta search open_in = iframe

[Sonarr] prefix = http:// url = localhost:5003 icon = static/images/icons/Sonarr Logo.png sidebar_icon = static/images/icons/Sonarr Logo.png description = Internet PVR for TV open_in = iframe

[Radarr] prefix = http:// url = localhost:5004 icon = static/images/icons/Radarr Logo.png sidebar_icon = static/images/icons/Radarr Logo.png description = Internet PVR for Movies open_in = iframe

rxmii4269 commented 4 years ago

Okay, so from looking at your config this won't be resolved on another device since it will try and find that device's localhost. I would suggest you to change the "localhost" to whatever IP the device that is hosting DashMachine is. Tell us how it goes.

thatpix3l commented 4 years ago

I actually have been using that workaround since I found out about this bug, and it does work. I replaced "localhost" in the DashMachine config to whatever IP I used from my client devices to access DashMachine. So it's not an issue with accessing my services through DashMachine specifically, but instead that DashMachine does not have some rule to auto-resolve the "localhost" to whatever IP it's being hosted on.

rxmii4269 commented 4 years ago

I see, no DashMachine doesn't have that feature. I don't think that's an intended feature to be added either 😅 for now use the IP address.. hopefully it's a static IP so you don't have to edit the config file ever so often the IP the address changes 😅

thatpix3l commented 4 years ago

That's fine. I could could try in the future to create a PR for a fix, or something.

rmountjoy92 commented 4 years ago

This was added in 0.6 :+1: