Readme and comment updates

This commit is contained in:
QuantumEntangledAndy committed 2020-07-03 14:23:09 +07:00
1 parent 80e416d01d
commit f6ab54a09c
2 files changed
+13 -3

No files matched your search

+10 -1
View File
@@ -75,7 +75,16 @@ You can modify this by changing the `bind` and the `bind_port` parameter.
Use can enable `rtsps` (TLS) by adding a `certificate = "/path/to/pem"` to the config. This pem should contain by the certificate and the key used for the server. If TLS is enabled all connections must use `rtsps`. You can also control client side TLS with the config option `tls_client_auth = "none|request|require"`, in this case the client should present a certificate signed by the server's CA, this is disabled by default.
Use can enable basic authentication by adding the configuration option `username = "someone"` and `password = "somepass"`. Both username and password must be set for this to work.
Use can enable basic authentication by adding users to the configuration file as:
```
[[users]]
name: someone
pass: somepass
```
you also need to add the allowed users into each camera by adding the following to `[[cameras]]`.
```
permitted_users = ["someone", "someoneelse"]
```
You can change the Neolink log level by setting the `RUST_LOG` environment variable (not in the configuration file) to one of `error`, `warn`, `info`, `debug`, or `trace`:
+3 -2
View File
@@ -162,8 +162,8 @@ fn set_up_users(users: &Vec<UserConfig>, rtsp: &RtspServer) {
fn get_permitted_users(users: &Vec<UserConfig>, current_permitted_users: &Vec<String>) -> Vec<String> {
// This is required to handle the special case of "anyone"
// Special set up of "anyone"
// If in the camera config there is the user anyone
// ===Special set up of "anyone"===
// If in the camera config there is the user "anyone"
// Then we add all users to the cameras config. including unauth
let mut new_permitted_users = vec![];
if current_permitted_users.contains(&"anyone".to_string()) {
@@ -176,6 +176,7 @@ fn get_permitted_users(users: &Vec<UserConfig>, current_permitted_users: &Vec<St
} else {
new_permitted_users.append(&mut current_permitted_users.clone());
}
// We also drop duplicated user names
new_permitted_users.sort();
new_permitted_users.dedup();