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

Allow IPv6 serve, default base_url to listen interface instead of 127.0.0.1 #2395

Merged
merged 2 commits into from
Jan 7, 2024

Conversation

clarfonthey
Copy link
Contributor

@clarfonthey clarfonthey commented Dec 30, 2023

  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Are you doing the PR on the next branch?

This could work fine if you just replaced SocketAddrV4 with SocketAddr, but I decided to tidy things up a bit more while I was looking at it. The main changes:

  1. Instead of defaulting to 127.0.0.1, zola serve will make the base_url equal to the interface it's listening on by default (prevents you from doing zola serve -i (thing) -u (same thing))
  2. Parses interface explicitly as an IP address instead of just parsing (interface):port as a socket address. This means that you should provide IPv6 addresses without the brackets and that base_url will automatically add the brackets as needed.

@clarfonthey clarfonthey changed the title SocketAddrV4 => SocketAddr Allow IPv6 serve, default base_url to listen interface instead of 127.0.0.1 Dec 30, 2023
Copy link
Collaborator

@Keats Keats left a comment

Choose a reason for hiding this comment

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

Seems ok, i'll try it a bit

@Keats Keats merged commit 8b602b2 into getzola:next Jan 7, 2024
5 checks passed
@clarfonthey clarfonthey deleted the socket-addr branch January 7, 2024 20:23
veluca93 pushed a commit to veluca93/zola that referenced this pull request May 14, 2024
…27.0.0.1 (getzola#2395)

* Parse interface as IpAddr, allow IPv6.

* Default base_url to socket address, instead of 127.0.0.1
Keats pushed a commit that referenced this pull request Jun 20, 2024
…27.0.0.1 (#2395)

* Parse interface as IpAddr, allow IPv6.

* Default base_url to socket address, instead of 127.0.0.1
berdandy pushed a commit to berdandy/azola that referenced this pull request Sep 17, 2024
…27.0.0.1 (getzola#2395)

* Parse interface as IpAddr, allow IPv6.

* Default base_url to socket address, instead of 127.0.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants