Skip to content

fix: allow docker listen address to be configured (6.x)#5503

Merged
juanpicado merged 2 commits intoverdaccio:6.xfrom
markormesher:mormesher/configure-address-6.x
Dec 1, 2025
Merged

fix: allow docker listen address to be configured (6.x)#5503
juanpicado merged 2 commits intoverdaccio:6.xfrom
markormesher:mormesher/configure-address-6.x

Conversation

@markormesher
Copy link
Copy Markdown
Contributor

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 docs and versioned_docs directories because I'll PR this to the main branch and to 6.x, but let me know if you want something else.

Comment thread Dockerfile Outdated
VERDACCIO_PORT=4873 \
VERDACCIO_PROTOCOL=http
VERDACCIO_PROTOCOL=http \
VERDACCIO_ADDRESS=[::]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the 0.0.0.0 default is breaking. It's as simple as that. 😉

Copy link
Copy Markdown
Member

@juanpicado juanpicado Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 👍🏼

@juanpicado juanpicado merged commit 12a19ac into verdaccio:6.x Dec 1, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants