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

Apache IP Binding with IPv6 #3441

Closed
PlayerSchark opened this issue Sep 28, 2023 · 11 comments · Fixed by #3457
Closed

Apache IP Binding with IPv6 #3441

PlayerSchark opened this issue Sep 28, 2023 · 11 comments · Fixed by #3457
Labels
1. to develop Accepted and waiting to be taken care of enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@PlayerSchark
Copy link

PlayerSchark commented Sep 28, 2023

Steps to reproduce

  1. Setup a reverse Proxy by following the steps on https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md
  2. in docker set the environment variable APACHE_IP_BINDING=[::]
  3. Start the AIO

Expected behavior

Apache should bind to [::]

Actual behavior

Error message:
You provided an ip-address for the apache container's ip-binding but it was not a valid ip-address.
It is set to '[::]'.

Host OS

Alpine Linux v3.13

Nextcloud AIO version

nextcloud/all-in-one:latest

Current channel

You are running the latest channel

Other valuable info

The host runs behind a reverse proxy

@PlayerSchark PlayerSchark added 0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working labels Sep 28, 2023
@szaimen
Copy link
Collaborator

szaimen commented Sep 29, 2023

Hi, may I ask why 127.0.0.1 is not sufficient for you?

@szaimen szaimen added the needs info Not enough information provided label Sep 29, 2023
@PlayerSchark
Copy link
Author

Thanks for your reply.

Well, there are two main reasons for that.

  1. it's Ipv4 and I think [::1] won't work either. This is the main reason. Since multiple years Ipv4 should be replaced with Ipv6. And this topic becomes more important these days.

This is only recommended to be set if you use localhost in your reverse proxy config to connect to your AIO instance. If you use an ip-address instead of localhost, you should set it to 0.0.0.0.
https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md

As per documentation, if you run behind a reverse proxy and nextcloud is being targeted by an IP you should use 0.0.0.0

Nextcloud AIO in general seems to support IPv6 https://github.com/nextcloud/all-in-one/blob/main/docker-ipv6-support.md

@szaimen szaimen added 1. to develop Accepted and waiting to be taken care of help wanted Extra attention is needed enhancement New feature or request and removed 0. Needs triage Pending approval or rejection. This issue is pending approval. needs info Not enough information provided bug Something isn't working labels Sep 29, 2023
@Zoey2936
Copy link
Collaborator

if ! echo "$APACHE_IP_BINDING" | grep -q '^[0-9.]\+$'; then
would changing this regex not be enough to fix it?

@szaimen
Copy link
Collaborator

szaimen commented Sep 29, 2023

would changing this regex not be enough to fix it?

We would need to make sure that the [] are not given to docker because it will bug out IIRC...

@Zoey2936
Copy link
Collaborator

compose supports [], so you mean that they need to be escaped?

    ports:
      - "127.0.0.1:53:53/tcp"
      - "127.0.0.1:53:53/udp"
      - "[::1]:53:53/tcp"
      - "[::1]:53:53/udp"
      - "192.168.168.3:53:53/tcp"
      - "192.168.168.3:53:53/udp"

@szaimen
Copy link
Collaborator

szaimen commented Sep 29, 2023

# docker run --name test -p [::]:81:80 alpine
# docker inspect test
...
            "PortBindings": {
                "80/tcp": [
                    {
                        "HostIp": "::",
                        "HostPort": "81"
                    }
                ]
            },
...

@PlayerSchark
Copy link
Author

As per RFC-5952 (update of RFC-4291)It seems to be enough without [] as long as you don't use a Port. So what about rejection of the [] format?

@Zoey2936
Copy link
Collaborator

if ! echo "$APACHE_IP_BINDING" | grep -q '^[0-9.]\+$'; then

would changing this regex not be enough to fix it?

I've added : to the regex, and set "APACHE_IP_BINDING=::1", restarted the containers and:
grafik

@szaimen
Copy link
Collaborator

szaimen commented Sep 29, 2023

if ! echo "$APACHE_IP_BINDING" | grep -q '^[0-9.]\+$'; then

would changing this regex not be enough to fix it?

I've added : to the regex, and set "APACHE_IP_BINDING=::1", restarted the containers and: grafik

All right! Would someone be able to adjust the regex then? :)
PRs are welcome!

@szaimen szaimen added this to the next milestone Sep 29, 2023
@szaimen
Copy link
Collaborator

szaimen commented Oct 5, 2023

This is now released with v7.4.0 Beta. Testing and feedback is welcome! See https://github.com/nextcloud/all-in-one#how-to-switch-the-channel

@PlayerSchark
Copy link
Author

PlayerSchark commented Oct 5, 2023

Currently I use the beta channel and everything seems to work fine.

image

I may mention that it wasn't enough to set APACHE_IP_BINDING to IPv6 to fully support IPv6.
I also had to follow the steps on https://github.com/nextcloud/all-in-one/blob/main/docker-ipv6-support.md because i ran into the following error. But because of good documentation it was easy to solve the problem.

NOTICE: PHP message: Could not get digest of container nextcloud/aio-postgresql:beta cURL error 6: Could not resolve host: auth.docker.io (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://auth.docker.io/token?service=registry.docker.io&scope=repository:nextcloud/aio-postgresql:pull

I looking forward to see it on the latest channel.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1. to develop Accepted and waiting to be taken care of enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants