This commit is contained in:
legop3
2025-11-14 22:45:18 -05:00
parent 6cfdde30ea
commit d524c312cf
5 changed files with 15 additions and 22 deletions
+1 -1
View File
@@ -79,7 +79,7 @@ The script must be executed via `sudo` from the user that owns the repo. It will
Publishing rovers lives on a trusted network, so the shipped config (tracked at `server/mediamtx/mediamtx.yml`) skips HTTP auth for SRT ingest and whitelists any path that matches `rover-*`. The installer overwrites `/etc/mediamtx/mediamtx.yml` every time you run it—if you need to tweak ports or add TURN servers, edit the template in the repo and rerun `install_server.sh` so every box stays in sync automatically.
Once finished, update `server/config.yaml` with your admin passwords and `media.whepBaseUrl` (`http://192.168.0.86:8889/whep`). The UI appends the rover ID to whatever you provide; if you prefer a different layout, include `{roverId}` or `{id}` in the URL (for example `http://192.168.0.86:8889/{id}/whep`). Restart `multirover.service` whenever you edit the config. To pull updates later, just `git pull`, re-run `npm install --production` inside `server/`, and restart the service—no need to rerun the installer.
Once finished, update `server/config.yaml` with your admin passwords and `media.whepBaseUrl` (`http://192.168.0.86:8889`). The client automatically requests `http://<base>/<rover-id>/whep`, so you never have to embed IDs or path templates. Restart `multirover.service` whenever you edit the config. To pull updates later, just `git pull`, re-run `npm install --production` inside `server/`, and restart the service—no need to rerun the installer.
### Video handshake + diagnostics
+2 -2
View File
@@ -23,8 +23,8 @@
3. **Web clients**
- Tiny helper (React hook or vanilla class) that:
1. Requests a viewer JWT for rover `<id>`.
2. Issues a `POST` to `/whep/rover-<id>` with `Authorization: Basic base64(token:token)` (token issued by the server when the client calls `video:request`).
1. Requests a viewer token for rover `<id>`.
2. Issues a `POST` to `<mediamtx-host>/<rover-id>/whep` with `Authorization: Basic base64(token:token)` (token issued by the server when the client calls `video:request`).
3. Maintains auto-reconnect timers on ICE failure so dashboard widgets can come/go without reloading the page.
- Operator dashboard mounts one player tied to the assigned rover. The spectator view instantiates one player per tile, muting + pausing hidden elements to keep CPU usage sane even when every rover is shown simultaneously.
+3 -5
View File
@@ -8,8 +8,6 @@ admins:
discord_id: "0987654321"
lockdown: true
media:
# Base URL for mediaMTX WHEP publishes. Append the rover ID automatically, or embed {roverId}/{id}.
# Examples:
# http://192.168.0.86:8889/whep -> becomes http://192.168.0.86:8889/whep/<roverId>
# http://192.168.0.86:8889/{id}/whep -> becomes http://192.168.0.86:8889/Freaky/whep
whepBaseUrl: "http://192.168.0.86:8889/whep"
# Base address for mediaMTX (scheme + host + optional port). The UI will always request
# http://<base>/<roverId>/whep
whepBaseUrl: "http://192.168.0.86:8889"
+7 -7
View File
@@ -21,13 +21,13 @@ webrtcICEServers2: []
srt: yes
srtAddress: :9000
# authMethod: http
# authHTTPAddress: http://127.0.0.1:8080/mediamtx/auth
# authHTTPExclude:
# - action: publish
# - action: api
# - action: metrics
# - action: pprof
authMethod: http
authHTTPAddress: http://127.0.0.1:8080/mediamtx/auth
authHTTPExclude:
- action: publish
- action: api
- action: metrics
- action: pprof
paths:
all:
+2 -7
View File
@@ -14,14 +14,9 @@ function buildWhepUrl(roverId) {
if (!base) {
return '';
}
const cleanBase = base.replace(/\/$/, '');
const encodedId = encodeURIComponent(roverId);
if (base.includes('{roverId}')) {
return base.replace(/\{roverId\}/g, encodedId);
}
if (base.includes('{id}')) {
return base.replace(/\{id\}/g, encodedId);
}
return `${base.replace(/\/$/, '')}/${encodedId}`;
return `${cleanBase}/${encodedId}/whep`;
}
function canView(socket, roverId) {