[INFRA] configure.sh regression on rels:// relay URI in case of reverse proxy (should be 443, not 33080)
Describe the problem
A PR was made to ease the reverse proxy setup with configure.sh.
Unfortunately a regression was made a few days later which now breaks the relay URI if we use a reverse proxy. rels://FQDN:33080 is incorrect, rels://FQDN:443 is correct in a reverse proxy scenario.
My comment on line #173 in the diff is probably easier to understand in context.
To Reproduce Steps to reproduce the behavior:
- Set up as a reverse proxy setup your
setup.env(no letsencrypt, port set to 443 for 33073 and 10000) - Run ./configure.sh
- Grep for rels:// and look at the output. You'll find something like:
rels://netbird.domain.tld:33080/relay
Expected behavior
It should be set to rels://netbird.domain.tld:443/relay
"Workaround" Use port 443 instead of 33080 in the rels:// URI in a reverse proxy scenario. However I didn't deep dive to study the logic and why the change was reverted. What is clear though is that in a reverse proxy scenario port 33080 is not exposed on the traefik side so there isn't any port open to accept any connection other than 443, and the coturn ports.
docker-compose.yml
# Relay
relay:
image: netbirdio/relay:0.49.0
restart: unless-stopped
environment:
- NB_LOG_LEVEL=info
- NB_LISTEN_ADDRESS=:33080
- NB_EXPOSED_ADDRESS=rels://netbird.domain.tld:443/relay
- NB_AUTH_SECRET=......
...
management.json
"Relay": {
"Addresses": [
"rels://netbird.domain.tld:443/relay"
],
"CredentialsTTL": "24h",
"Secret": "...."
},
Are you using NetBird Cloud? No. I use Netbird Selfhosted with traefik as reverse proxy
NetBird version 0.49.0 management suite selfhosted
Additional context
A netbird client status like: netbird status --detail would highlight the issue and when it does work
BEFORE
OS: darwin/amd64
Daemon version: 0.49.0
CLI version: 0.49.0
Management: Connected to https://netbird.domain.tld:443
Signal: Connected to https://netbird.domain.tld:443
Relays:
[rels://netbird.domain.tld:33080/relay] is Unavailable, reason: relay client not connected
AFTER: with port 443
OS: darwin/amd64
Daemon version: 0.49.0
CLI version: 0.49.0
Management: Connected to https://netbird.domain.tld:443
Signal: Connected to https://netbird.domain.tld:443
Relays:
[stun:netbird.domain.tld:3478] is Available
[turn:netbird.domain.tld:3478?transport=udp] is Available
[rels://netbird.domain.tld:443/relay] is Available
Have you tried these troubleshooting steps?
- [ ] Reviewed client troubleshooting (if applicable)
- [x] Checked for newer NetBird versions
- [x] Searched for similar issues on GitHub (including closed ones)
- [ ] Restarted the NetBird client
- [ ] Disabled other VPN software
- [ ] Checked firewall settings
Tom is right, that PR has an error.
this works suprisingly
I've found this to be true, even after recent updates. I've changed port from 33080 in rels:// in management.json and it started working again, whether before that it didn't anymore (especially the sheer VPN feature and the ability to connect from outside the LAN. Hope they can fix it. More love for the reverse proxy/Traefik files and configs, pls 🥹