@apocaliss92/nodelink-js 0.1.17 → 0.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -71,74 +71,6 @@ npm install
71
71
  npm run dev
72
72
  ```
73
73
 
74
- ## Trusted Proxy Authentication (NGINX + Authentik)
75
-
76
- If you want to hide the UI behind SSO (e.g. Authentik), you can delegate authentication to a reverse proxy and let this app **trust** specific headers **only** when requests come from an allowlisted proxy IP.
77
-
78
- ### Server configuration
79
-
80
- Set these env vars for the app:
81
-
82
- - `AUTH_ENABLED=1`
83
- - `TRUST_PROXY_AUTH=1`
84
- - `TRUST_PROXY_IPS=127.0.0.1,::1` (comma-separated allowlist; use the _real_ proxy/container IPs)
85
- - `TRUST_PROXY_USERNAME_HEADER=x-authentik-username`
86
- - `TRUST_PROXY_GROUPS_HEADER=x-authentik-groups`
87
- - `TRUST_PROXY_ADMIN_GROUP=admin` (if present in groups header → user becomes `admin`)
88
-
89
- Security notes:
90
-
91
- - **Never expose the app directly to the Internet** when `TRUST_PROXY_AUTH=1`.
92
- - Always put it behind your reverse proxy and restrict inbound traffic to the proxy only.
93
- - The app will ignore trusted headers unless the TCP peer IP matches `TRUST_PROXY_IPS`.
94
-
95
- ### NGINX example (Authentik outpost)
96
-
97
- This example assumes:
98
-
99
- - Authentik outpost is available at `http://authentik-outpost:9000`.
100
- - The app is at `http://nodelink-manager:3000`.
101
-
102
- ```nginx
103
- # Authentik integration (auth_request)
104
- location = /outpost.goauthentik.io/auth/nginx {
105
- internal;
106
- proxy_pass http://authentik-outpost:9000/outpost.goauthentik.io/auth/nginx;
107
- proxy_pass_request_body off;
108
- proxy_set_header Content-Length "";
109
- proxy_set_header X-Original-URL $scheme://$http_host$request_uri;
110
- proxy_set_header X-Original-Method $request_method;
111
- proxy_set_header X-Original-Host $http_host;
112
- }
113
-
114
- location / {
115
- auth_request /outpost.goauthentik.io/auth/nginx;
116
- error_page 401 = @ak_unauthorized;
117
-
118
- # Pull identity from Authentik response
119
- auth_request_set $ak_username $upstream_http_x_authentik_username;
120
- auth_request_set $ak_groups $upstream_http_x_authentik_groups;
121
-
122
- proxy_pass http://nodelink-manager:3000;
123
-
124
- # Forward identity headers to the app
125
- proxy_set_header X-Authentik-Username $ak_username;
126
- proxy_set_header X-Authentik-Groups $ak_groups;
127
-
128
- # Good hygiene
129
- proxy_set_header Host $host;
130
- proxy_set_header X-Real-IP $remote_addr;
131
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
132
- proxy_set_header X-Forwarded-Proto $scheme;
133
- }
134
-
135
- location @ak_unauthorized {
136
- return 302 /outpost.goauthentik.io/start?rd=$scheme://$http_host$request_uri;
137
- }
138
- ```
139
-
140
- If you run NGINX and the app on the same Docker network, set `TRUST_PROXY_IPS` to the **NGINX container IP** (or keep it `127.0.0.1,::1` only if NGINX is on the same host network namespace).
141
-
142
74
  ### Production Build
143
75
 
144
76
  ```bash
@@ -149,6 +81,10 @@ npm start
149
81
 
150
82
  Open http://localhost:3000 in your browser.
151
83
 
84
+ ### SSO (Authentik) via Trusted Proxy
85
+
86
+ See [documentation/authentik-nginx.md](documentation/authentik-nginx.md) for a step-by-step Authentik + NGINX setup and the required environment variables.
87
+
152
88
  ### Docker Deployment (Recommended)
153
89
 
154
90
  The easiest way to run the Manager UI is with Docker:
@@ -170,6 +106,38 @@ Or with Docker Compose:
170
106
  docker-compose up -d
171
107
  ```
172
108
 
109
+ #### WebRTC in Docker (bridge network)
110
+
111
+ If you run the container in **bridge** mode (i.e. with `ports:` mappings), WebRTC needs two things to work reliably:
112
+
113
+ 1. **A fixed UDP port range** exposed from container → host.
114
+ 2. ICE candidates that contain an address the browser can reach (usually your **host LAN IP**) — configured in **Settings → WebRTC (ICE)**.
115
+
116
+ Otherwise WebRTC may get stuck and you may see warnings like:
117
+
118
+ ```text
119
+ Video data channel not open for session ...: connecting
120
+ ```
121
+
122
+ Recommended example:
123
+
124
+ ```yaml
125
+ services:
126
+ nodelink-manager:
127
+ ports:
128
+ - "3000:3000" # Web UI and API
129
+ - "8554:8554" # RTSP proxy
130
+ - "50000-50100:50000-50100/udp" # WebRTC / ICE UDP
131
+ # Then configure Settings → WebRTC (ICE):
132
+ # - ICE UDP port range: 50000-50100
133
+ # - Additional host addresses: 192.168.1.123
134
+ ```
135
+
136
+ Notes:
137
+
138
+ - The **Additional host addresses** setting should be an IP address that your browser can reach (typically the host machine IP on your LAN).
139
+ - If you use `network_mode: host`, you usually **don’t need** any of the above (no port mapping).
140
+
173
141
  **Environment Variables:**
174
142
 
175
143
  | Variable | Default | Description |
@@ -178,6 +146,11 @@ docker-compose up -d
178
146
  | `RTSP_PORT` | `8554` | RTSP proxy port |
179
147
  | `DATA_PATH` | `/data` | Directory for settings.json and logs |
180
148
 
149
+ **WebRTC / ICE (Docker bridge mode):**
150
+
151
+ - Configure the UDP port mapping in Docker.
152
+ - Configure ICE options in **Settings → WebRTC (ICE)**.
153
+
181
154
  **Dashboard authentication (optional):**
182
155
 
183
156
  | Variable | Default | Description |
package/dist/index.cjs CHANGED
@@ -32241,6 +32241,9 @@ Error: ${err}`
32241
32241
  }
32242
32242
  const peerConnection = new RTCPeerConnection({
32243
32243
  iceServers,
32244
+ icePortRange: this.options.icePortRange,
32245
+ iceAdditionalHostAddresses: this.options.iceAdditionalHostAddresses,
32246
+ iceTransportPolicy: this.options.iceTransportPolicy,
32244
32247
  codecs: {
32245
32248
  video: [
32246
32249
  new RTCRtpCodecParameters({