You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+39Lines changed: 39 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -176,6 +176,8 @@ The server can be forced to use a single, fixed resolution for all connecting cl
176
176
|`SELKIES_USE_BROWSER_CURSORS`|`False`| Use browser CSS cursors instead of rendering to canvas. |
177
177
|`SELKIES_USE_CSS_SCALING`|`False`| HiDPI when false, iftrue a lower resolution is sent from the client and the canvas is stretched. |
178
178
|`SELKIES_PORT` (or `CUSTOM_WS_PORT`) |`8082`| Port for the data websocket server. |
179
+
|`SELKIES_CONTROL_PORT`|`8083`| Port forthe internal control plane API, used for managing access tokens whenin secure mode. |
180
+
|`SELKIES_MASTER_TOKEN`|`''`| Master token to enable secure mode. If set, clients must authenticate using tokens provided via the control plane API. |
179
181
|`SELKIES_DRI_NODE` (or `DRI_NODE`) |`''`| Path to the DRI render node for VA-API. |
180
182
|`SELKIES_AUDIO_DEVICE_NAME`|`'output.monitor'`| Audio device name for pcmflux capture. |
181
183
|`SELKIES_WATERMARK_PATH` (or `WATERMARK_PNG`) |`''`| Absolute path to the watermark PNG file. |
@@ -209,6 +211,43 @@ All base images are built for x86_64 and aarch64 platforms.
209
211
| Kali | kali |
210
212
| Ubuntu | ubuntunoble |
211
213
214
+
### Control Plane API for Token Management
215
+
216
+
When secure mode is enabled (`SELKIES_MASTER_TOKEN` is set), the server runs a control plane API on the `control_port` (default: 8083). This API is used to dynamically set and update the access tokens that clients can use to connect. This control plane port is meant forintegrators that want to wrap the baseimagein their own platforms and handle authentication, this port should never be exposed publically.
217
+
218
+
**Endpoint:**`POST /tokens`
219
+
220
+
**Authentication:** The request must include an `Authorization` header with the master token: `Authorization: Bearer <your-master-token>`
221
+
222
+
**Request Body:** A JSON object where each key is a unique access token string you create, and the value is a permissions object defining that token's capabilities.
223
+
224
+
**Permissions Object Fields:**
225
+
* `"role"`: (String, required) Can be one of the following:
226
+
* `"controller"`: Full access. Can send keyboard, mouse, and all other input events.
227
+
* `"viewer"`: Restricted access. Primarily for viewing the stream. Can be granted specific input rights via the `slot` property.
228
+
* `"slot"`: (Integer or `null`, required) Assigns an input slot, for gamepads.
229
+
* `null`: No specific input slot. A viewer with a `null` slot has no input capabilities.
230
+
* `1`: Grants the `viewer` control over the **Player 1** gamepad *only*.
231
+
* `2`: Grants the `viewer` control over the **Player 2** gamepad *only*.
232
+
* `3`: Grants the `viewer` control over the **Player 3** gamepad *only*.
233
+
* `4`: Grants the `viewer` control over the **Player 4** gamepad *only*.
234
+
235
+
**Behavior:** When a valid request is received, the server replaces its entire set of active tokens with the new set provided in the payload. It then runs a reconciliation process: any connected client whose token is now invalid or has changed permissions will be disconnected and users input capabilities will be modified live.
Copy file name to clipboardExpand all lines: readme-vars.yml
+39Lines changed: 39 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -180,6 +180,8 @@ full_custom_readme: |
180
180
| `SELKIES_USE_BROWSER_CURSORS` | `False` | Use browser CSS cursors instead of rendering to canvas. |
181
181
| `SELKIES_USE_CSS_SCALING` | `False` | HiDPI when false, if true a lower resolution is sent from the client and the canvas is stretched. |
182
182
| `SELKIES_PORT` (or `CUSTOM_WS_PORT`) | `8082` | Port for the data websocket server. |
183
+
| `SELKIES_CONTROL_PORT` | `8083` | Port for the internal control plane API, used for managing access tokens when in secure mode. |
184
+
| `SELKIES_MASTER_TOKEN` | `''` | Master token to enable secure mode. If set, clients must authenticate using tokens provided via the control plane API. |
183
185
| `SELKIES_DRI_NODE` (or `DRI_NODE`) | `''` | Path to the DRI render node for VA-API. |
184
186
| `SELKIES_AUDIO_DEVICE_NAME` | `'output.monitor'` | Audio device name for pcmflux capture. |
185
187
| `SELKIES_WATERMARK_PATH` (or `WATERMARK_PNG`) | `''` | Absolute path to the watermark PNG file. |
@@ -213,6 +215,43 @@ full_custom_readme: |
213
215
| Kali | kali |
214
216
| Ubuntu | ubuntunoble |
215
217
218
+
### Control Plane API for Token Management
219
+
220
+
When secure mode is enabled (`SELKIES_MASTER_TOKEN` is set), the server runs a control plane API on the `control_port` (default: 8083). This API is used to dynamically set and update the access tokens that clients can use to connect. This control plane port is meant for integrators that want to wrap the baseimage in their own platforms and handle authentication, this port should never be exposed publically.
221
+
222
+
**Endpoint:** `POST /tokens`
223
+
224
+
**Authentication:** The request must include an `Authorization` header with the master token: `Authorization: Bearer <your-master-token>`
225
+
226
+
**Request Body:** A JSON object where each key is a unique access token string you create, and the value is a permissions object defining that token's capabilities.
227
+
228
+
**Permissions Object Fields:**
229
+
* `"role"`: (String, required) Can be one of the following:
230
+
* `"controller"`: Full access. Can send keyboard, mouse, and all other input events.
231
+
* `"viewer"`: Restricted access. Primarily for viewing the stream. Can be granted specific input rights via the `slot` property.
232
+
* `"slot"`: (Integer or `null`, required) Assigns an input slot, for gamepads.
233
+
* `null`: No specific input slot. A viewer with a `null` slot has no input capabilities.
234
+
* `1`: Grants the `viewer` control over the **Player 1** gamepad *only*.
235
+
* `2`: Grants the `viewer` control over the **Player 2** gamepad *only*.
236
+
* `3`: Grants the `viewer` control over the **Player 3** gamepad *only*.
237
+
* `4`: Grants the `viewer` control over the **Player 4** gamepad *only*.
238
+
239
+
**Behavior:** When a valid request is received, the server replaces its entire set of active tokens with the new set provided in the payload. It then runs a reconciliation process: any connected client whose token is now invalid or has changed permissions will be disconnected and users input capabilities will be modified live.
0 commit comments