mirror of
https://github.com/productiveops/dokemon.git
synced 2026-04-26 08:15:49 +03:00
[GH-ISSUE #2] Dokemon Node IP Address Issue #3
Labels
No labels
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/dokemon#3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dnburgess on GitHub (Dec 12, 2023).
Original GitHub issue: https://github.com/productiveops/dokemon/issues/2
I noticed that any of the nodes that I'm able to add after your last update are linking to the main host IP address when going to the container page.
Basically I have 2 servers:
When I go to the containers on the Dockge server, I see all the containers and ports and all that as expected, but the ports for the containers on the Dockge node at 192.168.0.7 link to the localhost IP of 192.168.0.27.
So Whoogle is deployed on 192.168.0.7:5000, but if I click it in the list of containers on my Dockge server, it takes me to 192.168.0.27:5000 instead.
Here's a video that shows it that might also help:
https://www.youtube.com/watch?v=cLRhcoTzeBQ
@salilponde commented on GitHub (Dec 13, 2023):
Thank you for reporting this, and great explanation video! I will take a look at this today.
@salilponde commented on GitHub (Dec 13, 2023):
This is challenging for the reasons mentioned here: https://stackoverflow.com/a/56486428/22850013. It it not wise for containers to know the IP address of the host and the Dokemon Agent runs as a container. There are a few answers in the same link but I tried them and their either return docker0 interface IP which is not the VM IP or they just don't work. So there will be compatibility issues even if I try to use one of the methods.
I checked Portainer CE and I see it opens http://0.0.0.0:PORTNUMBER which is not correct. I checked Yacht and Dockge and they currently do not support managing multiple servers so they do not have this challenge yet. What they (and Dokemon) do currently is use the protocol and host from the current URL in the browser and append the port of the container to it. So they will face the same challenges if they implement support for multiple servers in future.
If you know of any other tool which does this correctly then let me know.
So as a workaround what one can do now is to bind the containers to the IP address instead of binding to all IP addresses. For example.
However, I know people would not want to restart their working containers as mentioned above. So I will add a button to set the Base URL for the Node where you can set the URL to http://192.168.0.5 (or whatever URL you want). And the generated links will use this as the base URL.
This will work for simple scenarios. But won't work for all cases. For example, I run multiple web apps on my server on different ports and I have a reverse proxy (Traefik) which maps different DNS to different web apps. So I have subdomain1.example.com pointing to 1st app and subdomain2.example.com pointing to second app. So if I se the Base URL to subdomain1.example.com it will use this base url for both the containers which is not correct for the 2nd one. I thought of storing the base URL per container but that will get complex if people remove and create the container, its ID will change. So at the moment I will keep the Base URL at the Node level and not container level.
@salilponde commented on GitHub (Dec 13, 2023):
Released 1.1.2 which has the above feature.
@dnburgess commented on GitHub (Dec 13, 2023):
Looks good. Can verify that adding the node's IP addres in the port line as you described fixes this issue on the front end.
@salilponde commented on GitHub (Dec 13, 2023):
Thank you, closing.