For ctzn servers behind reverse proxies using the remote address from the ws client socket does not usually reflect the actual ip of the host but rather the loopback address (and so it's considered a private ip and disallowed).
Fix
For those ctzn servers behind a reverse proxy we can workaround this by:
ensuring the reverse proxy is properly configured to send along the x-forwarded-for header
saving the header in the ws request on the ws client
using the header as the client remote address within the the reverseDns function.
Test
Configure x-forwarded-for header on your reverse proxy (nginx example in PR) and restart
Temporary patch ctzn & ctznry to ignore ssl (https => http, wss => wss)
Should maybe have used debug mode but seems coupled to loopback and wanted to avoid special behaviour associated with loopback)
Setup TOS & privacy policy txt files (maybe some default ones could be setup)
In two separate shells, start 2 instances of ctzn:
Why?
For ctzn servers behind reverse proxies using the remote address from the ws client socket does not usually reflect the actual ip of the host but rather the loopback address (and so it's considered a private ip and disallowed).
Fix
For those ctzn servers behind a reverse proxy we can workaround this by:
reverseDns
function.Test
fun fact: "politis" means citizen in greek :) so ctzn.politis.network sounds very redundant but I like it.
Setting up local testing
This is the procedure I followed to allow testing remote joining to communities between two ctzn instances, in case it's useful for someone:
~ /etc/hosts
~ /etc/nginx/sites-enabled/default
Temporary patch ctzn & ctznry to ignore ssl (https => http, wss => wss) Should maybe have used debug mode but seems coupled to loopback and wanted to avoid special behaviour associated with loopback)
Setup TOS & privacy policy txt files (maybe some default ones could be setup)
In two separate shells, start 2 instances of ctzn:
~ node bin.js --domain ctzn1.test.network --port 3000 --configDir ./tmp/config/ctzn1 start
~ node bin.js --domain ctzn2.test.network --port 3001 --configDir ./tmp/config/ctzn2 start
node bin.js start