make GET /api/ return current permissions

This is useful for e.g. deciding whether or not to present the user
admin UI in navigation.

As part of this change, I adjusted the casing in Permissions, and then
all the toml stuff for consistency. Noted in changelog.
This commit is contained in:
Scott Lamb
2022-12-31 12:08:26 -05:00
parent a6bdf0bd80
commit 42fe054d46
12 changed files with 103 additions and 47 deletions

View File

@@ -295,11 +295,11 @@ You'll also need a `/etc/moonfire-nvr.toml`:
```toml
[[binds]]
ipv4 = "0.0.0.0:8080"
allow_unauthenticated_permissions = { view_video = true }
allowUnauthenticatedPermissions = { viewVideo = true }
[[binds]]
unix = "/var/lib/moonfire-nvr/sock"
own_uid_is_privileged = true
ownUidIsPrivileged = true
```
Note this configuration is insecure. You can change that via replacing the

View File

@@ -71,11 +71,11 @@ $ sudo chmod a+rx /usr/local/bin/nvr
```toml
[[binds]]
ipv4 = "0.0.0.0:8080"
allow_unauthenticated_permissions = { view_video = true }
allowUnauthenticatedPermissions = { viewVideo = true }
[[binds]]
unix = "/var/lib/moonfire-nvr/sock"
own_uid_is_privileged = true
ownUidIsPrivileged = true
```
`/usr/local/bin/nvr`:

View File

@@ -165,13 +165,13 @@ If you follow the recommended Docker setup, your `/etc/moonfire-nvr.json`
will contain this line:
```toml
allow_unauthenticated_permissions = { view_video = true }
allowUnauthenticatedPermissions = { viewVideo = true }
```
Replace it with the following:
```toml
trust_forward_headers = true
trustForwardHeaders = true
```
This change has two effects: