diff --git a/README.md b/README.md index 0c4787f..3b92f2f 100644 --- a/README.md +++ b/README.md @@ -255,7 +255,7 @@ Files are read from `BOOKS_ROOT` (default `/books` when it exists, otherwise `~/ - `BOOKS_ROOT/library/` for book files (written by `scripts/books-ingest.py`) - `BOOKS_ROOT/covers/` for downloaded covers -In production, `scripts/deploy-remote.sh` writes `/opt/personal-website/compose.books.yml`, which +In production, `scripts/deploy-remote.sh` writes `~deploy/compose.books.yml` (the deploy account may only sudo-tee `/opt/personal-website/.env`), which bind-mounts the host's `BOOKS_HOST_DIR` (default `/home/stan/books`) read-only at `/books` and sets `BOOKS_ROOT=/books`. Without a `library` directory there the deploy still succeeds, but files can't be opened. diff --git a/scripts/deploy-remote.sh b/scripts/deploy-remote.sh index ee6a73a..0a8d8bd 100644 --- a/scripts/deploy-remote.sh +++ b/scripts/deploy-remote.sh @@ -32,14 +32,18 @@ fi # Book files (ebooks + covers) live on the host and are bind-mounted read-only at /books; # the app streams them only to the owner via /trackers/books/files/ (no static path). # Layout: $books_host_dir/library/ and $books_host_dir/covers/. -# compose.prod.yml is host-managed, so the mount goes in a generated override file. +# compose.prod.yml is host-managed, so the mount goes in a generated override file (~deploy). books_host_dir=${BOOKS_HOST_DIR:-/home/stan/books} case "$books_host_dir" in /*) ;; *) echo 'BOOKS_HOST_DIR must be absolute' >&2; exit 2 ;; esac # The deploy account can't traverse /home/stan (0750); check from a root container instead. if sudo docker run --rm --entrypoint sh \ --mount "type=bind,source=$books_host_dir,target=/books,readonly" "$image" \ -c 'test -d /books/library' 2>/dev/null; then - sudo tee "$directory/compose.books.yml" >/dev/null <"$books_override" <&2 fi