LemmyNet / lemmy

🐀 A link aggregator and forum for the fediverse
https://join-lemmy.org
GNU Affero General Public License v3.0
13.21k stars 876 forks source link

Lemmy cannot bind to an ipv6 address #3013

Closed Veraticus closed 1 year ago

Veraticus commented 1 year ago

Issue Summary

Lemmy cannot bind to an ipv6 address. Attempts to do so cause the app to fail with:

thread 'main' panicked at 'Failed to load settings file: LemmyError { message: None, inner: "invalid IP address syntax" near 3:24, context: "SpanTrace" }', crates/utils/src/settings/mod.rs:18:33

Steps to Reproduce

  1. Set any ipv6 address (for example, ::/0) as bind in config.hjson
frebib commented 1 year ago
frebib@Poseidon C:\s\social> grep bind lemmy.hjson
  bind: "::"

or

frebib@Poseidon C:\s\social> grep bind lemmy.hjson
  bind: "2a02:<snip>:9::15"
frebib@frebib-PC ~> curl -v 'http://[2a02:<snip>:9::15]:8536'
*   Trying [2a02:<snip>:9::15]:8536...
* Connected to 2a02:<snip>:9::15 (2a02:<snip>:9::15) port 8536 (#0)
> GET / HTTP/1.1
> Host: [2a02:<snip>:9::15]:8536
> User-Agent: curl/8.1.2
> Accept: */*
>
< HTTP/1.1 200 OK
< content-length: 1471
< content-type: application/activity+json
< date: Sun, 11 Jun 2023 10:11:27 GMT
<
{"@context":["https://www.w3.org/ns/activitystreams", ...

Works for me with both :: and a specific address. Try to drop the netmask

Veraticus commented 1 year ago

You're right, my mistake!