dashy
dashy copied to clipboard
[BUG] does not listen on IPv6
Environment
Self-Hosted (Docker)
System
any
Version
2.1.1
Describe the problem
dashy's web server only listens on IPv4, even if the Docker container has IPv6 enabled, making it unusable in IPv6-only setups. It can be run in dual-stack containers, of course.
Example (actual global IPv6 obscured):
[0 root@durnik ~] docker container inspect dashy | rg 'IPAddress|GlobalIPv6Address' | tail -n 2
"IPAddress": "172.18.3.2",
"GlobalIPv6Address": "2a01:4f8:262:xxxx::x:y:z",
[0 root@durnik ~] telnet 172.18.3.2 80
Trying 172.18.3.2...
Connected to 172.18.3.2.
Escape character is '^]'.
HTTP/1.1 400 Bad Request
Connection: close
Connection closed by foreign host.
[1 root@durnik ~] telnet 2a01:4f8:262:xxxx::x:y:z 80
Trying 2a01:4f8:262:xxxx::x:y:z...
telnet: Unable to connect to remote host: Connection refused
Additional info
No response
Please tick the boxes
- [X] You have explained the issue clearly, and included all relevant info
- [X] You are using a supported version of Dashy
- [X] You've checked that this issue hasn't already been raised
- [X] You've checked the docs and troubleshooting guide
- [X] You agree to the code of conduct
If you're enjoying Dashy, consider dropping us a ⭐
🤖 I'm a bot, and this message was automated
This issue has gone 6 weeks without an update. To keep the ticket open, please indicate that it is still relevant in a comment below. Otherwise it will be closed in 5 working days.
The issue is very much still there.
This issue has gone 6 weeks without an update. To keep the ticket open, please indicate that it is still relevant in a comment below. Otherwise it will be closed in 5 working days.
Still relevant
This issue has gone 6 weeks without an update. To keep the ticket open, please indicate that it is still relevant in a comment below. Otherwise it will be closed in 5 working days.
Still relevant
This issue has gone 6 weeks without an update. To keep the ticket open, please indicate that it is still relevant in a comment below. Otherwise it will be closed in 5 working days.
Still relevant
Same here
I sovled this by set the environment HOST with "HOST=::".
Now, It works!
Heya @mbunkus Does @GuodongQi's solution work for you? If not, I can look into making some changes to the container - if you've got suggestions about what would need to be modified to get this working, that'd also be helpful :)
Yes, that works. Thanks.
if you've got suggestions about what would need to be modified to get this working, that'd also be helpful :)
Well, you could make the behavior triggered by HOST=:: the default. I would very much welcome such a change as I'm a firm believer in having the most useful default settings (as in, it's nice that this is configurable, but users shouldn't have to configure it in the first place).
On Linux listening on the IPv6 wildcard address :: will also listen on the corresponding IPv4 wildcard address, 0.0.0.0:
[0 root@durnik ~] docker exec -ti dashy-dashy-1 /bin/sh
/app # apk add curl
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/community/x86_64/APKINDEX.tar.gz
(1/5) Installing ca-certificates (20220614-r0)
(2/5) Installing brotli-libs (1.0.9-r5)
(3/5) Installing nghttp2-libs (1.46.0-r0)
(4/5) Installing libcurl (8.0.1-r0)
(5/5) Installing curl (8.0.1-r0)
Executing busybox-1.34.1-r3.trigger
Executing ca-certificates-20220614-r0.trigger
OK: 13 MiB in 23 packages
/app # curl -s http://127.0.0.1/ | head -c 20 <!DOCTYPE html><html/app # /app # curl -s 'http://[::]/' | head -c 20 <!DOCTYPE html><html/app # /app #
I cannot really tell you how to do that as I have no experience whatsoever with node.js.
Here's a more expansive answer I wrote in a similar bug report I filed on a different project (Yacht):
Anyway, in the case of Yacht "proper IPv6" support would probably mean nothing more than making the daemon listen on IPv6, too. In terms of sockets this means listening on :: instead of 0.0.0.0, or if the port number is part of the listen spec, on [::]:8000 instead of 0.0.0.0:8000. The reason is that at least on Linux listening on the IPv6 wildcard address will automatically listen on IPv4, too.
If you're worried about that, you can also try listening on both [::]:8000 and 0.0.0.0:8000, in that order, and ignore failures if exactly one of those fails:
- if listening on
[::]:8000succeeds & turns on listening on IPv4 as well, then0.0.0.0:8000will fail; the daemon will now listen on both IPv6 & IPv4 - if listening on
[::]:8000succeeds & but doesn't turn on listening on IPv4 as well, then0.0.0.0:8000will also succeed, and the daemon will now listen on both IPv6 & IPv4 - if listening on
[::]:8000fails due to IPv6 being completely turned off on the host but listening on0.0.0.0:8000succeeds, then the daemon will only listen on IPv4, and that'd be OK for those hosts
As a last resort one might make the address/port number to listen on configurable via environment variables. Other images go that route.
As an example for Docker images that support listening on IPv6 out of the box (or where I could configure it via an environment variable): Authentik; Wekan; PowerDNS Admin; Docker Registry; Portainer.
Thanks @mbunkus - that's really helpful! I've set this ticket to 'keep open', and will update you here once complete, or within an update
I too would like to see this work with IPV6. Running this in a pure IPV6 environment causes failures to start.