Skip to content
Snippets Groups Projects
Commit 77b3405d authored by Simon Döring's avatar Simon Döring
Browse files

Add support for Janus admin key

parent 31af8f07
No related branches found
No related tags found
No related merge requests found
......@@ -88,6 +88,22 @@ Below is a description of the config file's properties:
* `janusBitrate`: The default bitrate with which a camera feed is transmitted by Janus.
Defaults to `128000`.
* `janusAdminKey`: Admin key for the Janus API, which is required to create new rooms.
It is recommended to use this feature becuase it reduces attack possibilities.
Defaults to an empty string.
**Important**: This key needs to match the admin key in the config file for the
Janus videoroom plugin. In the used development environment it is located at
`/opt/janus/etc/janus/janus.plugin.videoroom.jcfg`. The admin key can be set
in the `general: { ... }` block of the janus config using the `admin_key` directive.
Example:
```
general: {
admin_key = "MySafeAdminKey"
}
```
## Stdin-Interface
The camera server is controlled by PULT via its stdin. One could also implement the interface in any other program to manage the CVH-Camera.
......
......@@ -6,5 +6,6 @@
"janusRoom": 1000,
"janusRoomSecret": "changeit",
"janusRoomPin": "abc123",
"janusBitrate": 128000
"janusBitrate": 128000,
"janusAdminKey": "changeit"
}
......@@ -10,6 +10,7 @@ interface Config {
janusRoomSecret: string;
janusRoomPin: string;
janusBitrate: number;
janusAdminKey: string;
}
// Required to access config with config[key]
......@@ -44,7 +45,8 @@ const indexableConfig: IndexableConfig = {
janusRoom: 1000,
janusRoomSecret: 'default',
janusRoomPin: '',
janusBitrate: 128000
janusBitrate: 128000,
janusAdminKey: ''
};
if (fileContent) {
......
......@@ -14,6 +14,7 @@ interface RoomConfig {
secret?: string;
pin?: string;
description?: string;
admin_key?: string;
}
export const api = axios.create({
......
......@@ -128,7 +128,8 @@ class JanusRoom {
bitrate: config.janusBitrate,
publishers: config.cameraSlots,
pin: config.janusRoomPin,
secret: config.janusRoomSecret
secret: config.janusRoomSecret,
admin_key: config.janusAdminKey
}
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment