mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-12-07 08:12:32 -05:00
fix --require-auth flag
Apparently with docopt, --require-auth=false doesn't work, so booleans with a default value of true can't be turned off. Toggle the default to false to deal with this, for now. I'd prefer the default be true, but I also would prefer to not use a negative --no-require-auth or --allow-unauthenticated flag. I think I'll switch from docopt to clap in the near future; it seems to be what the cool kids use.
This commit is contained in:
@@ -84,8 +84,7 @@ Moonfire NVR can be run as a systemd service. Create
|
||||
[Service]
|
||||
ExecStart=/usr/local/bin/moonfire-nvr run \
|
||||
--db-dir=/var/lib/moonfire-nvr/db \
|
||||
--http-addr=0.0.0.0:8080 \
|
||||
--require-auth=false
|
||||
--http-addr=0.0.0.0:8080
|
||||
Environment=TZ=:/etc/localtime
|
||||
Environment=MOONFIRE_FORMAT=google-systemd
|
||||
Environment=MOONFIRE_LOG=info
|
||||
|
||||
@@ -153,15 +153,13 @@ In your `/etc/systemd/system/moonfire-nvr.service` file, look for these lines:
|
||||
|
||||
```
|
||||
ExecStart=/usr/local/bin/moonfire-nvr run \
|
||||
...
|
||||
--http-addr=0.0.0.0:8080 \
|
||||
--require-auth=false
|
||||
--db-dir=/var/lib/moonfire-nvr/db \
|
||||
--http-addr=0.0.0.0:8080
|
||||
```
|
||||
|
||||
Change `--require-auth=false` to `--require-auth=true --trust-forward-hdrs`.
|
||||
This change has two effects:
|
||||
Add `--require-auth --trust-forward-hdrs`. This change has two effects:
|
||||
|
||||
* `--require-auth=true` means that web users must authenticate.
|
||||
* `--require-auth` means that web users must authenticate.
|
||||
* `--trust-forward-hdrs` means that Moonfire NVR will look for `X-Real-IP`
|
||||
and `X-Forwarded-Proto` headers as added by the webserver configuration
|
||||
in the next section.
|
||||
|
||||
Reference in New Issue
Block a user