fix: allow docker listen address to be configured (6.x)#5503
fix: allow docker listen address to be configured (6.x)#5503juanpicado merged 2 commits intoverdaccio:6.xfrom
Conversation
| VERDACCIO_PORT=4873 \ | ||
| VERDACCIO_PROTOCOL=http | ||
| VERDACCIO_PROTOCOL=http \ | ||
| VERDACCIO_ADDRESS=[::] |
There was a problem hiding this comment.
Thinking of maybe the previous one 0.0.0.0 should be default and this one by demand instead at least until next major release.
Thoughts?
There was a problem hiding this comment.
I'd agree with that, I only did it this way to avoid having it switch back and forth for other users. I can update the default to 0.0.0.0 and add a note in the docs to show how to set the dual-stack option.
There was a problem hiding this comment.
The default value in most implementations of other tools and libraries I've seen out there is :: as it will cover most cases. I'm inclined to call environments with a disabled IPv6 stack an edge case. But it's definitely worth a lot to have this as a configurable value.
One additional argument against 0.0.0.0 is for the common cases in which the user connects to verdaccio using the localhost hostname. localhost resolves to both the IPv6 and IPv4 loopback address on most OSes. But the default behaviour of any modern OS is to always try any IPv6 address first (if applicable). Connecting to the IPv6 loopback address will in this case fail, because verdaccio is not listening, so the OS will fallback to the IPv4 address (see RFC 8305, also known as "Happy Eyeballs"). So if you configure 0.0.0.0 and connect via localhost you fully rely on this fallback mechanism and also add a short time penalty, because the OS tries IPv6 first.
There was a problem hiding this comment.
IPv6 by default is definitely good for all the reasons you mention, but switching the default outside of a major version is less so. That said, this is not my project and either option unblocks everyone, so I'm happy to go either way.
There was a problem hiding this comment.
Changing the 0.0.0.0 default is breaking. It's as simple as that. 😉
There was a problem hiding this comment.
As I agree with all your points of view it is indeed a breaking change (I was not aware when I approved #5498) so I guess we should leave 0.0.0.0 on this PR as default and #5502 [::] for master as default for next major release.
The 7.x major release most probably will became latest (with only Node.js versions and PR #5498 as breaking change, so no major breaking changes for anybody) in April 2026 as soon Node.js 20 ends maintenance, but I was planning starting releasing few months before in Docker and npmjs in advance (January 2026). So @A1bi won't take long until your contribution becomes default.
@markormesher would you mind adapting https://github.com/verdaccio/verdaccio/pull/5502/files#diff-220cd97a8003c86bf9d4f9684de16596248ae60012ae8e9db71bf922695c0416R19 documentation for 6.x? you did already 👍🏼
Closes #5500.
This preserves the new default behaviour introduced in #5498 but makes it configurable to support non-dual-stack environments.
I added docs in the
docsandversioned_docsdirectories because I'll PR this to the main branch and to 6.x, but let me know if you want something else.