diff --git a/netbird-server/DOCS.md b/netbird-server/DOCS.md index 704ebcf24..c29e6b1dd 100644 --- a/netbird-server/DOCS.md +++ b/netbird-server/DOCS.md @@ -27,7 +27,6 @@ The Dashboard container requires the `NETBIRD_MGMT_API_ENDPOINT` environment var - `disable_dashboard`: Disable the dashboard service entirely. - `enable_relay`: Enable the NetBird relay service (requires `relay_exposed_address` and `relay_auth_secret`). - `turn_external_ip`: Public IP to advertise when Coturn is behind NAT. -- `allow_legacy_ports`: Keep legacy port exposure for pre-v0.29 agents (see NetBird docs). ### Generated configuration On first start, the add-on creates: diff --git a/netbird-server/config.yaml b/netbird-server/config.yaml index f0c9bfa60..efb454930 100644 --- a/netbird-server/config.yaml +++ b/netbird-server/config.yaml @@ -41,7 +41,6 @@ options: enable_relay: false relay_exposed_address: "" relay_auth_secret: "" - allow_legacy_ports: false schema: data_dir: str domain: str? @@ -75,7 +74,6 @@ schema: enable_relay: bool relay_exposed_address: str? relay_auth_secret: str? - allow_legacy_ports: bool slug: netbird-server ports: 33073/tcp: 33073 diff --git a/netbird-server/rootfs/etc/cont-init.d/00-config.sh b/netbird-server/rootfs/etc/cont-init.d/00-config.sh index 06b9760e5..1a393f269 100644 --- a/netbird-server/rootfs/etc/cont-init.d/00-config.sh +++ b/netbird-server/rootfs/etc/cont-init.d/00-config.sh @@ -187,14 +187,15 @@ else bashio::log.info "Using existing management config at ${MANAGEMENT_CONFIG}." fi -# Generate Coturn config +# Generate Coturn config if missing TURN_CONFIG="$DATA_DIR/turn/turnserver.conf" -TURN_EXTERNAL_IP_LINE="" -if [[ -n "$TURN_EXTERNAL_IP" ]]; then - TURN_EXTERNAL_IP_LINE="external-ip=${TURN_EXTERNAL_IP}" -fi +if [[ ! -f "$TURN_CONFIG" ]]; then + TURN_EXTERNAL_IP_LINE="" + if [[ -n "$TURN_EXTERNAL_IP" ]]; then + TURN_EXTERNAL_IP_LINE="external-ip=${TURN_EXTERNAL_IP}" + fi -cat < "$TURN_CONFIG" + cat < "$TURN_CONFIG" listening-port=${TURN_LISTEN_PORT} realm=${TURN_REALM} fingerprint @@ -204,6 +205,9 @@ ${TURN_EXTERNAL_IP_LINE} min-port=${TURN_MIN_PORT} max-port=${TURN_MAX_PORT} CONFIG +else + bashio::log.info "Using existing Coturn config at ${TURN_CONFIG}." +fi # Generate dashboard nginx config sed "s/__DASHBOARD_PORT__/${DASHBOARD_PORT}/g" \