Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] does not listen on IPv6 #979

Open
5 tasks done
mbunkus opened this issue Nov 20, 2022 · 15 comments
Open
5 tasks done

[BUG] does not listen on IPv6 #979

mbunkus opened this issue Nov 20, 2022 · 15 comments
Assignees
Labels
🐛 Bug [ISSUE] Ticket describing something that isn't working 📌 Keep Open [ISSUE][PR] Prevent auto-closing

Comments

@mbunkus
Copy link

mbunkus commented Nov 20, 2022

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

@mbunkus mbunkus added the 🐛 Bug [ISSUE] Ticket describing something that isn't working label Nov 20, 2022
@liss-bot

This comment was marked as spam.

@liss-bot

This comment was marked as spam.

@liss-bot liss-bot added the ⚰️ Stale [ISSUE] [PR] No activity for over 1 month label Dec 20, 2022
@mbunkus

This comment was marked as spam.

@liss-bot liss-bot added 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending and removed ⚰️ Stale [ISSUE] [PR] No activity for over 1 month labels Dec 20, 2022
@liss-bot

This comment was marked as spam.

@liss-bot liss-bot added ⚰️ Stale [ISSUE] [PR] No activity for over 1 month and removed 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending labels Jan 20, 2023
@mbunkus

This comment was marked as spam.

@liss-bot liss-bot added 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending and removed ⚰️ Stale [ISSUE] [PR] No activity for over 1 month labels Jan 20, 2023
@liss-bot

This comment was marked as spam.

@liss-bot liss-bot added the ⚰️ Stale [ISSUE] [PR] No activity for over 1 month label Feb 20, 2023
@mbunkus

This comment was marked as spam.

@liss-bot liss-bot removed the ⚰️ Stale [ISSUE] [PR] No activity for over 1 month label Feb 20, 2023
@liss-bot liss-bot removed the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label Mar 6, 2023
@liss-bot

This comment was marked as spam.

@liss-bot liss-bot added the ⚰️ Stale [ISSUE] [PR] No activity for over 1 month label Apr 6, 2023
@mbunkus

This comment was marked as spam.

@liss-bot liss-bot added 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending and removed ⚰️ Stale [ISSUE] [PR] No activity for over 1 month labels Apr 6, 2023
@GuodongQi

This comment was marked as spam.

@GuodongQi
Copy link

I sovled this by set the environment HOST with "HOST=::".

Now, It works!

@liss-bot liss-bot removed the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label Apr 28, 2023
@Lissy93 Lissy93 added the 📌 Keep Open [ISSUE][PR] Prevent auto-closing label Apr 28, 2023
@Lissy93
Copy link
Owner

Lissy93 commented Apr 28, 2023

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 :)

@mbunkus
Copy link
Author

mbunkus commented Apr 28, 2023

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 [::]:8000 succeeds & turns on listening on IPv4 as well, then 0.0.0.0:8000 will fail; the daemon will now listen on both IPv6 & IPv4
  • if listening on [::]:8000 succeeds & but doesn't turn on listening on IPv4 as well, then 0.0.0.0:8000 will also succeed, and the daemon will now listen on both IPv6 & IPv4
  • if listening on [::]:8000 fails due to IPv6 being completely turned off on the host but listening on 0.0.0.0:8000 succeeds, 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.

@liss-bot liss-bot added the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label Apr 28, 2023
@Lissy93
Copy link
Owner

Lissy93 commented Apr 28, 2023

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

@liss-bot liss-bot removed the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label Apr 28, 2023
@pshempel
Copy link

I too would like to see this work with IPV6. Running this in a pure IPV6 environment causes failures to start.

@liss-bot liss-bot added the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label Nov 16, 2023
@liss-bot liss-bot removed the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug [ISSUE] Ticket describing something that isn't working 📌 Keep Open [ISSUE][PR] Prevent auto-closing
Projects
Status: Awaiting Triage
Development

No branches or pull requests

5 participants