Mathilde Appreciate the reply.
Btw done some further investigation. I'm pretty sure the issue has nothing to do with SSH incorrectly forwarding the port because I ran curl http://localhost:3001/install/#tokenhere
from the server itself (i.e. not from my machine with the port forwarded, or through a VPN, or anything, just on the server directly) and got
curl: (56) Recv failure: Connection reset by peer
so it does appear to be Cryptpad's own node server.
config.js:
module.exports = {
httpUnsafeOrigin: 'http://127.0.0.1:3001',
httpPort: 3001,
adminKeys: [
],
filePath: './datastore/',
archivePath: './data/archive',
pinPath: './data/pins',
taskPath: './data/tasks',
blockPath: './block',
blobPath: './blob',
blobStagingPath: './data/blobstage',
decreePath: './data/decrees',
logPath: './data/logs',
logToStdout: false,
logLevel: 'info',
logFeedback: false,
verbose: false,
installMethod: 'unspecified',
};
nginx should not be relevant I don't think, as I'm mostly trying to access it without nginx, but accessing behind nginx doesn't change the behaviour. I've also tried modifying my config.js to have httpUnsafeOrigin
set to https://cryptpad.domain.tld
and httpSafeOrigin
set to my sandbox domain, and then putting it behind nginx with:
server {
server_name cryptpad.domain sandbox.domain;
# speed things up when resuming a session
ssl_session_cache shared:MozSSL:10m;
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains" always;
location / {
proxy_pass http://localhost:3001;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 150m;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
}
location ^~ /cryptpad_websocket {
proxy_pass http://localhost:3003;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/domain/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/domain/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
http2 on;
}
server {
if ($host = cryptpad.domain) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = sandbox.domain) {
return 301 https://$host$request_uri;
} # managed by Certbot
server_name cryptpad.domain sandbox.domain;
listen 80;
return 404; # managed by Certbot
}
Edit: Just tried setting log level to silly and verbose to true, and nothing outputted in the logs when I curled the setup token url?