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

IPv6 only #1440

Open
telmich opened this issue Mar 23, 2024 · 0 comments
Open

IPv6 only #1440

telmich opened this issue Mar 23, 2024 · 0 comments
Labels
Bug There is a problem in our source code Configuration Something wrong with the setup

Comments

@telmich
Copy link

telmich commented Mar 23, 2024

Hello,

I am trying to run cryptpad 5.7.0 on IPv6 only hosts. The default configuration contains the following statement:

/*  httpAddress specifies the address on which the nodejs server
 *  should be accessible. By default it will listen on localhost
 *  (IPv4 & IPv6 if enabled). If you want it to listen on
 *  a specific address, specify it here. e.g '192.168.0.1'
 *
 */
    //httpAddress: 'localhost',

However when trying to access [::1]:3000 I get:

cryptpad@cp-cryptpad-58446f5484-85lnx:~$ wget http://[::1]:3000
--2024-03-23 08:48:20--  http://[::1]:3000/
Connecting to [::1]:3000... failed: Connection refused.
cryptpad@cp-cryptpad-58446f5484-85lnx:~$

When changing the httpAddress to '[::1]' I get a getaddrinfo error:

> cryptpad@5.7.0 start
> node server.js

["INFO","2024-03-23T08:59:39.618Z","WEBSERVER_LISTENING",{"origin":"http://localhost:3000/"}]
["INFO","2024-03-23T08:59:39.621Z","NO_ADMIN_CONFIGURED",{"message":"Your instance is not correctly configured for production usage. Review its checkup page for more information.","details":"http://localhost:3000/checkup/"}]
node:events:496
      throw er; // Unhandled 'error' event
      ^

Error: getaddrinfo ENOTFOUND [::1]
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
Emitted 'error' event on Server instance at:
    at GetAddrInfoReqWrap.doListen [as callback] (node:net:2072:12)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:17) {
  errno: -3008,
  code: 'ENOTFOUND',
  syscall: 'getaddrinfo',
  hostname: '[::1]'
}

And when trying to specify without brackets I get:

Node.js v20.11.0
["ERROR","2024-03-23T09:01:12.043Z","HTTP_WORKER_EXIT",{"signal":null,"code":1}]
["ERROR","2024-03-23T09:01:12.053Z","HTTP_WORKER_EXIT",{"signal":null,"code":1}]
["ERROR","2024-03-23T09:01:12.060Z","HTTP_WORKER_EXIT",{"signal":null,"code":1}]
node:internal/url:775
    this.#updateContext(bindingUrl.parse(input, base));
                                   ^

TypeError: Invalid URL
    at new URL (node:internal/url:775:36)
    at Object.<anonymous> (/cryptpad/lib/http-worker.js:194:19)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
    at node:internal/main/run_main_module:28:49 {
  code: 'ERR_INVALID_URL',
  input: '',
  base: 'ws:::1'
}

Node.js v20.11.0
["ERROR","2024-03-23T09:01:12.065Z","HTTP_WORKER_EXIT",{"signal":null,"code":1}]
["ERROR","2024-03-23T09:01:12.075Z","HTTP_WORKER_EXIT",{"signal":null,"code":1}]
["ERROR","2024-03-23T09:01:12.084Z","HTTP_WORKER_EXIT",{"signal":null,"code":1}]
["ERROR","2024-03-23T09:01:12.091Z","HTTP_WORKER_EXIT",{"signal":null,"code":1}]
["ERROR","2024-03-23T09:01:12.096Z","HTTP_WORKER_EXIT",{"signal":null,"code":1}]
["ERROR","2024-03-23T09:01:12.104Z","HTTP_WORKER_EXIT",{"signal":null,"code":1}]
["ERROR","2024-03-23T09:01:12.109Z","HTTP_WORKER_EXIT",{"signal":null,"code":1}]
node:internal/url:775
    this.#updateContext(bindingUrl.parse(input, base));
                                   ^

TypeError: Invalid URL
    at new URL (node:internal/url:775:36)
    at Object.<anonymous> (/cryptpad/lib/http-worker.js:194:19)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
    at node:internal/main/run_main_module:28:49 {
  code: 'ERR_INVALID_URL',
  input: '',
  base: 'ws:::1'
}

How does one run cryptpad on IPv6?

Context is IPv6 only kubernetes clusters, however the problem will occurs in any IPv6 only environment.

@mathilde-cryptpad mathilde-cryptpad changed the title cryptpad cannot be configured to listen on IPv6 IPv6 only Mar 26, 2024
@mathilde-cryptpad mathilde-cryptpad added Bug There is a problem in our source code Configuration Something wrong with the setup labels Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug There is a problem in our source code Configuration Something wrong with the setup
Projects
None yet
Development

No branches or pull requests

2 participants