Skip to content

Commit

Permalink
improve docs a bit
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
scottlamb committed Dec 5, 2023
1 parent 882596c commit c5f5bd3
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 11 deletions.
Binary file modified guide/install-version.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 20 additions & 11 deletions guide/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,17 @@ via the prebuilt Linux binaries available for x86-64, arm64, and arm. If you
instead want to build Moonfire NVR yourself, see the [Build
instructions](build.md).

First, make sure you are viewing instructions that match the release you intend
<table><tr><td><details>
<summary>Go to the instructions for your exact Moonfire version</summary>

Make sure you are viewing instructions that match the release you intend
to install. When viewing this page on Github, look for a pull-down in the upper
left, and pick the [latest tagged version](https://github.com/scottlamb/moonfire-nvr/releases/latest):

![Selecting a version of install instructions](install-version.png)
<img src="install-version.png" height=367 alt="Selecting a version of install instructions">

</details></td></tr></table>


Download the binary for your platform from the matching GitHub release.
Install it as `/usr/local/bin/moonfire-nvr` and ensure it is executable, e.g.
Expand All @@ -29,7 +35,7 @@ $ curl -OL "https://github.com/scottlamb/moonfire-nvr/releases/download/$VERSION
$ sudo install -m 755 "moonfire-nvr-$VERSION-$ARCH" /usr/local/bin/moonfire-nvr
```

<details>
<table><tr><td><details>
<summary>Docker</summary>

If you are a Docker fan, you can install the `ghcr.io/scottlamb/moonfire-nvr`
Expand All @@ -44,11 +50,12 @@ services:
command: run

volumes:
# Mount a Docker volume called `moonfire-db` to Moonfire's default
# database path.
# Pass through `/var/lib/moonfire-nvr` from the host.
- "/var/lib/moonfire-nvr:/var/lib/moonfire-nvr"

# Pass through `/etc/moonfire-nvr.toml` from the host.
# Be sure to create `/etc/moonfire-nvr.toml` first (see below).
# Docker will "helpfully" create a directory by this name otherwise.
- "/etc/moonfire-nvr.toml:/etc/moonfire-nvr.toml:ro"

# Add additional mount lines here for each sample file directory
Expand All @@ -59,8 +66,10 @@ services:
# it from the host for Moonfire to support local time.
- "/usr/share/zoneinfo:/usr/share/zoneinfo:ro"

# Edit this to match your `moonfire-nvr` user (see `useradd` command in
# install instructions).
# Edit this to match your `moonfire-nvr` user.
# - Be sure to run the `useradd` command below first.
# - Then run `echo $(id -u moonfire-nvr):$(id -u moonfire-nvr`) to see
# what should be filled in here.
user: UID:GID

# Uncomment this if Moonfire fails with `clock_gettime failed` (likely on
Expand Down Expand Up @@ -96,7 +105,7 @@ Command reference:
| Run interactive configuration | `sudo -u moonfire-nvr moonfire-nvr config 2>debug-log` | `sudo docker compose run --rm moonfire-nvr config 2>debug-log` |
| Enable and start the server | `sudo systemctl enable --now moonfire-nvr` | `sudo docker compose up --detach moonfire-nvr` |

</details>
</details></td></tr></table>

Next, you'll need to set up your filesystem and the Moonfire NVR user.

Expand Down Expand Up @@ -188,15 +197,15 @@ by using the `moonfire-nvr` binary's text-based configuration tool.
$ sudo -u moonfire-nvr moonfire-nvr config 2>debug-log
```

<details>
<summary>Did it return without doing anything?</summary>
<table><tr><td><details>
<summary>Did it return without doing anything?</summary>

If `moonfire-nvr config` returns you to the console prompt right away, look in
the `debug-log` file for why. One common reason is that you have Moonfire NVR
running; you'll need to shut it down first. If you are running a systemd
service as described below, try `sudo systemctl stop moonfire-nvr` before
editing the config and `sudo systemctl start moonfire-nvr` after.
</details>
</details></td></tr></table>

In the user interface,

Expand Down
43 changes: 43 additions & 0 deletions guide/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ need more help.
* [Slow operations](#slow-operations)
* [Camera stream errors](#camera-stream-errors)
* [Problems](#problems)
* [Docker setup](#docker-setup)
* [`"/etc/moonfire-nvr.toml" is a directory`](#etcmoonfire-nvrtoml-is-a-directory)
* [`Error response from daemon: unable to find user UID: no matching entries in passwd file`](#error-response-from-daemon-unable-to-find-user-uid-no-matching-entries-in-passwd-file)
* [`clock_gettime failed: EPERM: Operation not permitted`](#clock_gettime-failed-eperm-operation-not-permitted)
* [Server errors](#server-errors)
* [`Error: pts not monotonically increasing; got 26615520 then 26539470`](#error-pts-not-monotonically-increasing-got-26615520-then-26539470)
* [Out of disk space](#out-of-disk-space)
Expand Down Expand Up @@ -185,6 +189,45 @@ quickly enough. In the latter case, you'll likely see a
## Problems
### Docker setup
If you are using the Docker compose snippet mentioned in the
[install.md](install instructions), you might run into a few unique problems.
#### `"/etc/moonfire-nvr.toml" is a directory`
If you try running the Docker container with its
`/etc/moonfire-nvr.toml:/etc/moonfire-nvr.toml:ro` mount before creating the
config file, Docker will "helpfully" create it as a directory. Shut down
the Docker container, remove the directory, and try again.
#### `Error response from daemon: unable to find user UID: no matching entries in passwd file`
If Docker produces this error, look at this section of the docker compose setup:
```yaml
# Edit this to match your `moonfire-nvr` user.
# - Be sure to run the `useradd` command below first.
# - Then run `echo $(id -u moonfire-nvr):$(id -u moonfire-nvr`) to see
# what should be filled in here.
user: UID:GID
```

#### `clock_gettime failed: EPERM: Operation not permitted`

If commands fail with an error like the following, you're likely running
Docker with an overly restrictive `seccomp` setup. [This stackoverflow
answer](https://askubuntu.com/questions/1263284/apt-update-throws-signature-error-in-ubuntu-20-04-container-on-arm/1264921#1264921) describes the
problem in more detail. The simplest solution is to uncomment
the `- seccomp: unconfined` line in your Docker compose file.

```console
$ sudo docker compose run --rm moonfire-nvr --version
clock_gettime failed: EPERM: Operation not permitted

This indicates a broken environment. See the troubleshooting guide.
```

### Server errors

#### `Error: pts not monotonically increasing; got 26615520 then 26539470`
Expand Down

0 comments on commit c5f5bd3

Please sign in to comment.