1
Fork 0
mirror of https://github.com/thegeneralist01/archivr synced 2026-07-22 03:05:32 +02:00

fix: address code review issues with Docker setup

- .gitignore: whitelist Dockerfile, docker-compose.yml, docker/ so they
  are actually tracked (the * catch-all was silently dropping them)
- Dockerfile: build and ship the archivr CLI alongside archivr-server so
  users can run `archivr init` inside the container on first setup
- docker/config.example.toml: fix archive_path to point at the .archivr
  subdirectory that archivr init creates (not the parent directory), which
  is what read_archive_paths expects
- docs/README.md: replace the bare mkdir quickstart step with
  `archivr init`, explain why mkdir is insufficient; add a callout that
  auth_db_path must be set explicitly to a writable path when the config
  mount is read-only
This commit is contained in:
TheGeneralist 2026-06-30 11:20:55 +02:00
parent 2ba832ad59
commit 38d3066ee4
Signed by: thegeneralist01
SSH key fingerprint: SHA256:pp9qddbCNmVNoSjevdvQvM5z0DHN7LTa8qBMbcMq/R4
5 changed files with 170 additions and 3 deletions

View file

@ -205,12 +205,17 @@ A `Dockerfile` and `docker-compose.yml` are provided for self-hosting without Ni
# edit config/archivr-server.toml — set archive id, label, and archive_path
```
2. Create the archive directory on the persistent data volume before the first start:
2. Initialize each archive on the persistent data volume before the first start.
The image includes the `archivr` CLI for this purpose:
```sh
docker compose run --rm archivr mkdir -p /data/archives/main
docker compose run --rm archivr archivr init /data/archives/main --name "Main Archive"
```
This creates `/data/archives/main/.archivr/` with the metadata the server requires.
A bare `mkdir` is not enough — the server reads `name` and `store_path` files that
only `archivr init` writes.
3. Start the server:
```sh
@ -224,7 +229,12 @@ A `Dockerfile` and `docker-compose.yml` are provided for self-hosting without Ni
| Mount | Purpose |
|-------|---------|
| `./config` (read-only) | Directory containing `archivr-server.toml` |
| `archivr-data` named volume | Auth database and archive directories |
| `archivr-data` named volume | Auth database (`/data/archivr-auth.sqlite`) and archive directories |
> **Important:** `auth_db_path` must be set explicitly in `archivr-server.toml` to a
> path on the writable data volume (e.g. `/data/archivr-auth.sqlite`). If left unset,
> the server defaults to writing the auth database next to the config file — which is
> on the read-only `/config` mount and will fail. The example config sets this correctly.
**Twitter/X archiving**