release: repair the catalog 404 and stop the page jumping (#3)
Showstopper. Adding, editing or deleting a dish redirected to /ruoat, which stopped existing when the tab was renamed to Ruuat — every one of those actions ended on a 404. Live in v20260905-4. The tests missed it because they asserted only a 303; a redirect to a dead URL is still a 303. They now assert the target. The page no longer jumps. Deleting a dish partway down the catalog, or opening a day in Kirjaa, sent the browser to the top. Both now patch in place via Datastar — bin, pencil, day rows, dish pills, save, delete, cancel and Näytä lisää. Links stay links and forms stay forms, so it works without JavaScript. Non-production tabs are labelled. ENV=dev gives dev · Foodster. Contributing guide added, and commits now take Conventional Commit types. ⚠️ Breaking: rewrite the server's .env in this deploy. Environment variables lost the FOODSTER_ prefix; the app refuses to start on an unset PASSWORD. REPO=… TAG=latest PASSWORD=… HOST=foodster.kessinen.com ENV=prod PUID=1000 PGID=1000 TZ=Europe/Helsinki PUID/PGID rather than UID/GID — UID is read-only in bash and would be silently overwritten. Co-authored-by: Esa Kataja <[email protected]> Reviewed-on: #3
This commit was merged in pull request #3.
This commit is contained in:
@@ -58,6 +58,9 @@ One static Go binary. No Node.js, no bundler, no separate database server.
|
||||
| Auth | HTTP Basic, one shared household password |
|
||||
| Runtime image | `FROM scratch` |
|
||||
|
||||
Working on it: [CONTRIBUTING.md](CONTRIBUTING.md) — branches, commit messages,
|
||||
and the conventions that are easy to miss.
|
||||
|
||||
## Branches
|
||||
|
||||
`main` holds released versions only. Every release tag points at a commit on
|
||||
@@ -173,13 +176,19 @@ Everything is environment variables. `.env` is gitignored; start from
|
||||
|
||||
| Variable | Default | Purpose |
|
||||
|---|---|---|
|
||||
| `FOODSTER_PASSWORD` | *required* | Shared password. The app will not start without it. |
|
||||
| `FOODSTER_DB` | `./data/foodster.db` | SQLite file path; the directory is created if missing. |
|
||||
| `FOODSTER_UID` / `FOODSTER_GID` | `1000` | Host owner of `./data`, for the bind mount. |
|
||||
| `PASSWORD` | *required* | Shared password. The app will not start without it. |
|
||||
| `DB` | `./data/foodster.db` | SQLite file path; the directory is created if missing. |
|
||||
| `ENV` | `prod` | Anything else is prefixed to the tab title (`dev · Foodster`). |
|
||||
| `ADDR` | `:8080` | Listen address. Only useful for a second local instance. |
|
||||
| `PUID` / `PGID` | `1000` | Host owner of `./data`, for the bind mount. |
|
||||
| `TZ` | `Europe/Helsinki` | Used for every calendar-day calculation. |
|
||||
| `FOODSTER_REPO` | *required to build* | Image repository, no tag. |
|
||||
| `FOODSTER_TAG` | `latest` | Tag to run under compose. |
|
||||
| `FOODSTER_PORT` | `8080` | Host port to publish. |
|
||||
|
||||
Names carry no prefix: the container gives them their own namespace already.
|
||||
`PUID`/`PGID` are the exception — `UID` is read-only in bash, so a value set
|
||||
in `.env` would be silently replaced by the invoking shell's own.
|
||||
| `REPO` | *required to build* | Image repository, no tag. |
|
||||
| `TAG` | `latest` | Tag to run under compose. |
|
||||
| `HOST` | *required to run* | Hostname Traefik routes to. |
|
||||
|
||||
Set `TZ` in development too. Under UTC the date rolls over three hours late,
|
||||
which is exactly when dinner gets logged.
|
||||
@@ -204,7 +213,7 @@ the container, so a backup is `cp -r data` and you can inspect the file with
|
||||
any sqlite client without going through the engine.
|
||||
|
||||
That directory must exist and be owned by the user compose runs as — `make up`
|
||||
creates it, and `FOODSTER_UID`/`FOODSTER_GID` in `.env` tell the container who
|
||||
creates it, and `PUID`/`PGID` in `.env` tell the container who
|
||||
that is. Get them from `id -u` and `id -g`.
|
||||
|
||||
If the app exits with `cannot open /data/foodster.db ... unable to open
|
||||
@@ -213,7 +222,7 @@ bind-mount directory as root, and the container is not root:
|
||||
|
||||
```sh
|
||||
ls -ldn data # whose is it?
|
||||
sudo chown -R 1000:1000 data # match FOODSTER_UID / FOODSTER_GID
|
||||
sudo chown -R 1000:1000 data # match PUID / PGID
|
||||
docker compose restart
|
||||
```
|
||||
|
||||
@@ -235,7 +244,7 @@ counting it would lock the household out for simply opening the app.
|
||||
address, meaning it arrived through the proxy. A client connecting directly
|
||||
could otherwise forge a new address per attempt and skip the limiter.
|
||||
|
||||
**None of this replaces a strong `FOODSTER_PASSWORD`.** Rate limiting removes
|
||||
**None of this replaces a strong `PASSWORD`.** Rate limiting removes
|
||||
brute force as a practical route; it does not make a guessable password safe.
|
||||
|
||||
## Mockups
|
||||
|
||||
Reference in New Issue
Block a user