feat: add support for reading configuration from YAML file

This commit is contained in:
zarazaex69
2026-05-13 17:17:31 +03:00
parent 359a2d94df
commit cf6490b5e0
6 changed files with 119 additions and 355 deletions
-1
View File
@@ -5,7 +5,6 @@
mode: cnc
link: direct
carrier: ""
auth:
provider: wbstream # must match the server
+24 -38
View File
@@ -1,17 +1,10 @@
# Configuration
olcrtc accepts the same settings via CLI flags or a YAML file. Use whichever
fits your deployment:
olcrtc reads its entire runtime configuration from a single YAML file.
There are no other CLI flags.
```bash
# CLI flags (existing behaviour)
olcrtc -mode srv -auth wbstream -id room123 -key $(openssl rand -hex 32) ...
# YAML file
olcrtc -config /etc/olcrtc/server.yaml
# YAML file plus CLI overrides — any flag wins over the corresponding YAML field
olcrtc -config /etc/olcrtc/server.yaml -id room999
olcrtc /etc/olcrtc/server.yaml
```
Examples:
@@ -21,31 +14,24 @@ Examples:
## Schema
| YAML path | CLI flag | Notes |
|----------------------------|----------------------|-----------------------------------------------|
| `mode` | `-mode` | `srv`, `cnc`, or `gen` |
| `link` | `-link` | `direct` |
| `auth.provider` | `-auth` | `telemost`, `jazz`, `wbstream`, `none` |
| `room.id` | `-id` | conference room id |
| `room.client_id` | `-client-id` | deprecated, will be removed |
| `crypto.key` | `-key` | 64-char hex (32 bytes) |
| `net.transport` | `-transport` | `datachannel`, `videochannel`, `seichannel`, `vp8channel` |
| `net.dns` | `-dns` | resolver `host:port` |
| `socks.host` / `.port` | `-socks-host` / `-socks-port` | client-side listener |
| `socks.user` / `.pass` | `-socks-user` / `-socks-pass` | optional client-side auth |
| `socks.proxy_addr` / `.proxy_port` | `-socks-proxy` / `-socks-proxy-port` | server-side egress proxy |
| `engine.name` / `.url` / `.token` | `-engine` / `-url` / `-token` | only when `auth.provider: none` |
| `video.*` | `-video-*` | videochannel tuning |
| `vp8.*` | `-vp8-*` | vp8channel tuning |
| `sei.fps` / `.batch_size` / `.fragment_size` / `.ack_timeout_ms` | `-fps` / `-batch` / `-frag` / `-ack-ms` | seichannel tuning |
| `gen.amount` | `-amount` | gen mode: number of rooms to create |
| `data` | `-data` | path to data directory |
| `debug` | `-debug` | verbose logging |
| `ffmpeg` | `-ffmpeg` | path to ffmpeg binary |
## Precedence
`CLI flag (non-zero) > YAML value > zero value`.
A CLI flag with its zero value (e.g. `-socks-port 0`) does NOT override a YAML
value — pass an explicit non-zero value to override.
| YAML path | Notes |
|------------------------------------------------------------------|-----------------------------------------------------------|
| `mode` | `srv`, `cnc`, or `gen` |
| `link` | `direct` |
| `auth.provider` | `telemost`, `jazz`, `wbstream`, `none` |
| `room.id` | conference room id |
| `room.client_id` | deprecated, will be removed |
| `crypto.key` | 64-char hex (32 bytes) |
| `net.transport` | `datachannel`, `videochannel`, `seichannel`, `vp8channel` |
| `net.dns` | resolver `host:port` |
| `socks.host` / `.port` | client-side listener |
| `socks.user` / `.pass` | optional client-side auth |
| `socks.proxy_addr` / `.proxy_port` | server-side egress proxy |
| `engine.name` / `.url` / `.token` | only when `auth.provider: none` |
| `video.*` | videochannel tuning |
| `vp8.*` | vp8channel tuning |
| `sei.fps` / `.batch_size` / `.fragment_size` / `.ack_timeout_ms` | seichannel tuning |
| `gen.amount` | gen mode: number of rooms to create |
| `data` | path to data directory |
| `debug` | verbose logging |
| `ffmpeg` | path to ffmpeg binary |
-1
View File
@@ -6,7 +6,6 @@ mode: srv
# Connection topology
link: direct # p2p link type
carrier: "" # leave empty for default selection from auth provider
auth:
provider: wbstream # telemost | jazz | wbstream | none