docker-code-server icon indicating copy to clipboard operation
docker-code-server copied to clipboard

listen on both ipv4 and ipv6

Open aptalca opened this issue 1 year ago • 31 comments

closes #178

aptalca avatar Apr 21 '24 14:04 aptalca

I am a bot, here are the test results for this PR: https://ci-tests.linuxserver.io/lspipepr/code-server/4.23.1-pkg-4284c89d-dev-79293112331036168cc4031bfe7c961af30d0498-pr-179/index.html https://ci-tests.linuxserver.io/lspipepr/code-server/4.23.1-pkg-4284c89d-dev-79293112331036168cc4031bfe7c961af30d0498-pr-179/shellcheck-result.xml

Tag Passed
amd64-4.23.1-pkg-4284c89d-dev-79293112331036168cc4031bfe7c961af30d0498-pr-179
arm64v8-4.23.1-pkg-4284c89d-dev-79293112331036168cc4031bfe7c961af30d0498-pr-179

LinuxServer-CI avatar Apr 21 '24 14:04 LinuxServer-CI

No idea. It needs to be tested.

I'm surprised that even though we're telling it to listen on ipv6, it also listens on ipv4 but I couldn't find any documentation. Just github issue discussions.

aptalca avatar Apr 21 '24 14:04 aptalca

Well that's just weird:

# netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp6       0      0 :::8443                 :::*                    LISTEN      -   
$  docker ps | grep code
30ff101cac53   lspipepr/code-server:4.23.1-pkg-4284c89d-dev-79293112331036168cc4031bfe7c961af30d0498-pr-179   "/init"                  3 seconds ago   Up 3 seconds           0.0.0.0:8123->8443/tcp, :::8123->8443/tcp   

And both

curl -4 -sL http://localhost:8123

And

curl -6 -sL http://localhost:8123

Work. They also work inside the container so it's not just the docker NAT layer doing something odd.

thespad avatar Apr 21 '24 15:04 thespad

TIL https://www.rfc-editor.org/rfc/rfc3493#section-3.7

Applications may use AF_INET6 sockets to open TCP connections to IPv4 nodes, or send UDP packets to IPv4 nodes, by simply encoding the destination's IPv4 address as an IPv4-mapped IPv6 address, and passing that address, within a sockaddr_in6 structure, in the connect() or sendto() call. When applications use AF_INET6 sockets to accept TCP connections from IPv4 nodes, or receive UDP packets from IPv4 nodes, the system returns the peer's address to the application in the accept(), recvfrom(), or getpeername() call using a sockaddr_in6 structure encoded this way.

Also https://www.rfc-editor.org/rfc/rfc3493#section-5.3

As stated in section <3.7 Compatibility with IPv4 Nodes>, AF_INET6 sockets may be used for both IPv4 and IPv6 communications. Some applications may want to restrict their use of an AF_INET6 socket to IPv6 communications only. For these applications the IPV6_V6ONLY socket option is defined.

But that will still break with IPv4-only network stacks for obvious reasons.

thespad avatar Apr 21 '24 15:04 thespad

@thespad It will break on users who have disabled IPv6 on the kernel level, others will have no issues. Those who have will aware of the issues with messing with the default kernel values.

As IPv6 only servers are becoming common, having a middle ground is the better option.

It will be better to have a DISABLE IPv6 option for such users, as it done on the kasmvnc image.

https://github.com/linuxserver/docker-baseimage-kasmvnc/blob/master/root/etc/s6-overlay/s6-rc.d/init-nginx/run#L29

miyurusankalpa avatar Apr 23 '24 10:04 miyurusankalpa

Is this going to suddenly break a bunch of users who've explicitly disabled IPv6?

hopefully, maybe it'll teach them to stop doing silly things left over from 2004

drizuid avatar Apr 23 '24 11:04 drizuid

I am a bot, here are the test results for this PR: https://ci-tests.linuxserver.io/lspipepr/code-server/4.89.1-pkg-2e2dbd2e-dev-43762e8d1a1bb73155a207732b808ca9c656e210-pr-179/index.html https://ci-tests.linuxserver.io/lspipepr/code-server/4.89.1-pkg-2e2dbd2e-dev-43762e8d1a1bb73155a207732b808ca9c656e210-pr-179/shellcheck-result.xml

Tag Passed
amd64-4.89.1-pkg-2e2dbd2e-dev-43762e8d1a1bb73155a207732b808ca9c656e210-pr-179
arm64v8-4.89.1-pkg-2e2dbd2e-dev-43762e8d1a1bb73155a207732b808ca9c656e210-pr-179

LinuxServer-CI avatar May 22 '24 23:05 LinuxServer-CI

I am a bot, here are the test results for this PR: https://ci-tests.linuxserver.io/lspipepr/code-server/4.90.2-pkg-ec2f2738-dev-6c3977dd4e90cacbac808c7c46de0104cdf7ea5f-pr-179/index.html https://ci-tests.linuxserver.io/lspipepr/code-server/4.90.2-pkg-ec2f2738-dev-6c3977dd4e90cacbac808c7c46de0104cdf7ea5f-pr-179/shellcheck-result.xml

Tag Passed
amd64-4.90.2-pkg-ec2f2738-dev-6c3977dd4e90cacbac808c7c46de0104cdf7ea5f-pr-179
arm64v8-4.90.2-pkg-ec2f2738-dev-6c3977dd4e90cacbac808c7c46de0104cdf7ea5f-pr-179

LinuxServer-CI avatar Jun 18 '24 23:06 LinuxServer-CI

I am a bot, here are the test results for this PR: https://ci-tests.linuxserver.io/lspipepr/code-server/4.91.0-pkg-a6b2b800-dev-17b95b0ba62f66e6b818a6d5f7d4e1f17a6312a9-pr-179/index.html https://ci-tests.linuxserver.io/lspipepr/code-server/4.91.0-pkg-a6b2b800-dev-17b95b0ba62f66e6b818a6d5f7d4e1f17a6312a9-pr-179/shellcheck-result.xml

Tag Passed
amd64-4.91.0-pkg-a6b2b800-dev-17b95b0ba62f66e6b818a6d5f7d4e1f17a6312a9-pr-179
arm64v8-4.91.0-pkg-a6b2b800-dev-17b95b0ba62f66e6b818a6d5f7d4e1f17a6312a9-pr-179

LinuxServer-CI avatar Jul 15 '24 23:07 LinuxServer-CI

I am a bot, here are the test results for this PR: https://ci-tests.linuxserver.io/lspipepr/code-server/4.91.1-pkg-ab8f4cb9-dev-7655e6e780d64c3c870568720211f53b4cb5814c-pr-179/index.html https://ci-tests.linuxserver.io/lspipepr/code-server/4.91.1-pkg-ab8f4cb9-dev-7655e6e780d64c3c870568720211f53b4cb5814c-pr-179/shellcheck-result.xml

Tag Passed
amd64-4.91.1-pkg-ab8f4cb9-dev-7655e6e780d64c3c870568720211f53b4cb5814c-pr-179
arm64v8-4.91.1-pkg-ab8f4cb9-dev-7655e6e780d64c3c870568720211f53b4cb5814c-pr-179

LinuxServer-CI avatar Aug 11 '24 23:08 LinuxServer-CI

This pull request has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

LinuxServer-CI avatar Sep 13 '24 02:09 LinuxServer-CI

This feature would help me. I'm embracing v6 everywhere on my network and would love to have Code Server along for the ride.

EricSeastrand avatar Sep 27 '24 05:09 EricSeastrand

Sorry for the dumb question, but how can I help test this updated image? Do I just point my docker compose file to this version? amd64-4.91.1-pkg-ab8f4cb9-dev-7655e6e780d64c3c870568720211f53b4cb5814c-pr-179

I still have a few v4-only hosts in my network. Curious to see what breaks.

EricSeastrand avatar Sep 27 '24 15:09 EricSeastrand

amd64-4.91.1-pkg-ab8f4cb9-dev-7655e6e780d64c3c870568720211f53b4cb5814c-pr-179

Yes, that's the image tag for the PR build

thespad avatar Sep 29 '24 23:09 thespad