Commit Graph

188 Commits

Author SHA1 Message Date
Scott Lamb
9592fe24e8 small tweaks to docker instructions
* strongly encourage the single-binary approach and say why.
* fix a broken link in troubleshooting guide (and regenerate toc).
* add a couple more comments to the docker compose snippet
2024-01-31 20:15:11 -08:00
Scott Lamb
6f472256ab mention ui development proxy too 2024-01-31 17:12:44 -08:00
Scott Lamb
d1c033b46d fix docs to mention UI bundling
see #305
2024-01-31 17:07:11 -08:00
Scott Lamb
2da459dae2 address SQLITE_IOERR_GETTEMPPATH from docker 2023-12-29 16:23:38 -08:00
Scott Lamb
cca430b701 prep 0.7.11 2023-12-29 15:37:58 -08:00
Scott Lamb
24880a5c2d switch from create-react-app to vite
create-react-app is apparently deprecated, so the cool kids use vite,
I guess.
2023-12-18 17:08:09 -08:00
Scott Lamb
f493ad94eb typo fix 2023-12-05 09:11:41 -08:00
Scott Lamb
672647730d typo fix 2023-12-05 09:08:30 -08:00
Scott Lamb
1013c35791 adjust table layout
The wide command reference caused the whole table around the `<details>`
to have a scroll bar, which was confusing.
2023-12-05 09:03:56 -08:00
Scott Lamb
c5f5bd39ee improve docs a bit
* use a more recent screenshot for selecting tag on github UI, and
  put in a `<details>` because it's annoyingly large.
* put a border around `<details>` so it's easy to see where it
  starts/ends
* add troubleshooting info for docker setup, to help with e.g. #296.
2023-12-05 08:55:38 -08:00
Scott Lamb
882596c7f6 prep v0.7.10 2023-11-28 10:37:23 -08:00
Scott Lamb
8efea4526d build docker images again 2023-11-28 10:32:10 -08:00
Leandro Silva
5e00217784 Fix TimeoutStartSec invalid parsing in moonfire-nvr.service Systemd config
Systemd syntax expects comment in a single line, hence the parsing failure
https://www.freedesktop.org/software/systemd/man/latest/systemd.syntax.html

Before;
```
[leandro@nuc ~]$ sudo systemd-analyze verify /etc/systemd/system/moonfire-nvr.service
/etc/systemd/system/moonfire-nvr.service:16: Failed to parse TimeoutStartSec= parameter, ignoring: 300 # large installations take a while to scan the sample file dirs
[leandro@nuc ~]$
```

After;
```
[leandro@nuc ~]$ sudo systemd-analyze verify /etc/systemd/system/moonfire-nvr.service
[leandro@nuc ~]$
```
2023-10-23 20:18:50 -07:00
Scott Lamb
89ee2d0269 systemd Ready/Stopping notification 2023-10-20 11:51:55 -07:00
Scott Lamb
ee98bf5236 no more Docker!
* use `termion` rather than `ncurses` to limit runtime deps
* cross-compile with `cross` instead of our own dockerfiles/scripts
* update instructions
* update release procedure and GitHub actions to match
* prep changelog for `v0.7.8`

Fixes #160
Closes #265
2023-10-18 21:55:47 -07:00
Scott Lamb
a76483a912 stop using cargo pkg version
One fewer thing to manage at release time.
2023-10-17 09:44:30 -07:00
Scott Lamb
ef62ebfc6c Merge remote-tracking branch 'origin/release-0.7.7' 2023-10-16 22:05:54 -07:00
Scott Lamb
9820bf8883 tweak ui dev server's websocket situation
* fix the automatic reload
* document that live view doesn't work with `PROXY_TARGET`;
  link to fresh issue
2023-09-30 16:02:52 -07:00
Scott Lamb
cff832e646 prep v0.7.7 2023-08-03 14:03:48 -07:00
Leandro Silva
ed7ab5dddf Add hyperink to the latest release in installation instructions 2023-07-08 17:18:59 -07:00
Scott Lamb
4ad627b997 prep 0.7.6 release 2023-07-08 10:22:04 -07:00
Scott Lamb
ebcdd76084 switch from log to tracing
I think this is a big improvement in readability.

I removed the `lnav` config, which is a little sad, but I don't think it
supports this structured logging format well. Still seems worthwhile on
balance.
2023-07-04 16:51:22 -07:00
Skye
db2e0f1d39 Bump minimum Rust version to 1.65 2023-07-04 16:37:36 -07:00
Scott Lamb
438de38202
rework WebSocket error return protocol
This gives much better information to the UI layer, getting rid of a
whole troubleshooting guide entry. See #119 #132 #218 #219

I also restructured the code in anticipation of a new WebSocket event
stream (#40).
2023-02-15 17:26:40 -08:00
Tim Small
ad48cf2e10 Fix chown in build instructions.
The build instructions currently fail if the user doesn't have a group
matching their user name (not a universally adopted convention).  Update
the command to use the following functionality of the `chown` command:

"If a colon but no group name follows the user name, that user is made
the owner of the files and the group of the files is changed to that
user's login group."
2023-02-15 08:03:02 -08:00
Scott Lamb
9060dbfe14
adjust supported node versions 2023-01-11 19:38:47 -08:00
Scott Lamb
50fa5ce6fe
update moonfire-nvr.toml desc in build.md 2023-01-11 19:35:37 -08:00
Scott Lamb
6ed23e90e8
improve docker cross-compilation
* support cross-compiling an x86-64 target on an arm64 host. This
  it turns out is a matter of *removing* an unnecessary dependency.
  (aarch64-linux-gnu-pkg-config exists but x86_64-linux-gnu-pkg-config
  doesn't. Turns out neither is necessary.) Added a comment explaining
  where ${gcc_target}-pkg-config comes from now.
* documentation tweaks
* improve debug output a bit
2023-01-11 19:35:37 -08:00
Scott Lamb
2667dd68cb
CI/build improvements
- use cache restore keys so that there's some caching even after deps
  change
- don't install ffmpeg stuff that hasn't been needed in a while
2023-01-08 04:08:08 -06:00
Scott Lamb
a4bc7f5218
config file reference and doc reorganization 2023-01-06 14:25:13 -06:00
Scott Lamb
abcb26b281
update some config file refs in secure.md 2023-01-06 06:49:11 -06:00
Scott Lamb
689765ea97
upgrade Rust deps 2023-01-05 17:43:45 -06:00
Scott Lamb
42fe054d46
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.
2022-12-31 12:43:13 -05:00
Dima S
2b92f06152 [docs] Fix broken nginx link. 2022-05-18 22:51:59 -07:00
Scott Lamb
8e8b48b906 prepare 0.7.5 with Retina 0.3.10
Fixes #224
2022-05-09 13:17:18 -07:00
Scott Lamb
841e06e354 update a few deps 2022-05-02 11:23:03 -07:00
Scott Lamb
2e49a1a0c8 bump minimum Rust to 1.57
Addresses a breakage with cdfb61f. the `named-profile` feature
wasn't available in 1.56.
2022-04-14 10:58:23 -07:00
Scott Lamb
13bfb76855 prepare v0.7.4 2022-04-13 15:08:15 -07:00
Scott Lamb
7b0a489541 rework stream threading model
Fixes #206. 307a388 switched to creating a single-threaded runtime for
each stream, then destroying prior to waiting for TEARDOWN on shutdown.
This meant that the shutdown process could panic with this error:

```
panic at '/home/slamb/git/retina/src/client/mod.rs:219:22': teardown Sender shouldn't be dropped: RecvError(())
```

Let's switch back to expecting a multithreaded runtime context.
Create one for the config subcommand, too.

Don't go all the way back to the old code with its channels, though.
That had the downside that the underlying retina::Session might outlive
the caller, so there could still be an active session when we start
the next one. I haven't seen this cause problems in practice but it
still doesn't seem right.
2022-04-13 11:39:38 -07:00
Scott Lamb
307a3884a0 drop ffmpeg support
* switch the config interface over to use Retina and make the test
  button honor rtsp_transport = udp.

* adjust the threading model of the Retina streaming code.

  Before, it spawned a background future that read from the runtime and
  wrote to a channel. Other calls read from this channel.

  After, it does work directly from within the block_on calls (no
  channels).

  The immediate motivation was that the config interface didn't have
  another runtime handy. And passing in a current thread runtime
  deadlocked. I later learned this is a difference between
  Runtime::block_on and Handle::block_on. The former will drive IO and
  timers; the latter will not.

  But this is also more efficient to avoid so many thread hand-offs.
  Both the context switches and the extra spinning that
  tokio appears to do as mentioned here:
  https://github.com/scottlamb/retina/issues/5#issuecomment-871971550

  This may not be the final word on the threading model. Eventually
  I may not have per-stream writing threads at all. But I think it will
  be easier to look at this after getting rid of the separate
  `moonfire-nvr config` subcommand in favor of a web interface.

* in tests, read `.mp4` files via the `mp4` crate rather than ffmpeg.
  The annoying part is that this doesn't parse edit lists; oh well.

* simplify the `Opener` interface. Formerly, it'd take either a RTSP
  URL or a path to a `.mp4` file, and they'd share some code because
  they both sometimes used ffmpeg. Now, they're totally different
  libraries (`retina` vs `mp4`). Pull the latter out to a `testutil`
  module with a different interface that exposes more of the `mp4`
  stuff. Now `Opener` is just for RTSP.

* simplify the h264 module. It had a lot of logic to deal with Annex B.
  Retina doesn't use this encoding.

Fixes #36
Fixes #126
2022-03-18 13:22:47 -07:00
Scott Lamb
be3a5b200e prepare v0.7.2 2022-03-16 18:31:12 -07:00
Scott Lamb
319d7c3e1d move perms to proper spot in config 2022-03-16 18:31:07 -07:00
Scott Lamb
f4d5784176 fix config file syntax in guide (#133) 2022-03-16 15:43:23 -07:00
Scott Lamb
f18b58613c improve the guide's docker script
This addresses the `"docker run" requires at least 1 argument.` error
described in #205 and clarifies some comments.
2022-03-16 12:47:00 -07:00
Scott Lamb
ae8fbaff83 add screenshot for selecting guide ver 2022-03-16 12:35:57 -07:00
Scott Lamb
892427592e tweak config format (#133)
* switch from json to toml.
  I think this will be more user-friendly. It allows comments and has
  less punctuation. Fewer surprises than yaml (which has e.g. the
  "Norway problem"). I might have stayed with JSON if I could see a
  good serde json library that allows comments, but hson is unmaintained
  and serde-json strictly follows the spec.

* switch from camelCase to snake_case. Seems more idiomatic for TOML
  and matches the Rust source.

* forbid unknown keys. Better to spot errors sooner.

* rename "trust_forward_hdrs" to "trust_forward_headers". Nothing else
  is abbreviated.
2022-03-16 12:34:39 -07:00
Scott Lamb
de28f6eed3 point to correct version of install instructions
This is particularly important right now. The master branch describes
a config file that doesn't exist in the latest release (0.7.1).

Fixes #204
2022-03-11 15:38:52 -08:00
Scott Lamb
0a9ec04a4e install instructions updates
Fixes #204

* The docker container won't start if a bind refers to a path that
  doesn't exist yet, so move the /etc/moonfire-nvr.json creation up
* Remove redundant command in the dedicated hard drive setup, and
  improve its clarity
2022-03-11 15:02:29 -08:00
Scott Lamb
7467b382dc make Unix sockets bind reliably and add to config 2022-03-11 11:52:00 -08:00
Scott Lamb
ceaef46ea9 introduce /etc/moonfire-nvr.json (#133) 2022-03-09 13:18:33 -08:00