Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
4e68475
fix(backup): check the client major against the server before dump an…
MBombeck Nov 26, 2026
36880ca
fix(insights): read every day value of a ranked metric from one source
MBombeck Nov 26, 2026
1fce458
fix(insights): take the status snapshots and the resting proxy from o…
MBombeck Nov 26, 2026
eec4db7
Merge pull request #1591 from MBombeck/fix/pg-client-server-major-pre…
MBombeck Nov 27, 2026
ca65610
test(insights): list main's own readers in the day-value guard
MBombeck Nov 27, 2026
02198c4
fix(backup): tell a refused off-host copy by where it failed, not Ope…
MBombeck Nov 27, 2026
314087f
fix(auth): bound the password strength estimator
MBombeck Nov 27, 2026
ab5c5ea
test(sleep): seed the per-night summary's nights before the run's day
MBombeck Nov 27, 2026
5422050
Merge pull request #1594 from MBombeck/fix/day-value-one-source
MBombeck Nov 27, 2026
bb4bdac
Merge remote-tracking branch 'origin/main' into fix/dump-core-stable-…
MBombeck Nov 27, 2026
f0daa42
test(sleep): seed the per-night summary's nights a day back
MBombeck Nov 27, 2026
725a34a
Merge pull request #1595 from MBombeck/fix/dump-core-stable-assertion
MBombeck Nov 27, 2026
442504e
Merge pull request #1596 from MBombeck/fix/password-estimate-bound
MBombeck Nov 27, 2026
90b0591
Merge origin/main into release/v1.50.0
MBombeck Nov 27, 2026
23f579b
test: keep cold chart imports and PDF rendering off the 5 s test budget
MBombeck Nov 27, 2026
ed8c5a3
Merge remote-tracking branch 'origin/release/v1.50.0' into sync/main-…
MBombeck Nov 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
- A damaged Gadgetbridge or Health Connect database is refused as a broken file, also when the damage sits behind a sound header and only shows once a table is read. The import used to fail with SQLite's own message as an internal error.
- A FHIR Bundle, or a health record inside an Apple Health export, that nests deeper than 64 levels is refused as an unreadable file. A few hundred kilobytes nested deep enough made the import fail with an internal error instead.
- An Apple Health export no longer stops as a whole at one cycle sample with a date that does not read. That sample is skipped and counted, and the rest of the export is imported.
- Restoring an off-host database copy that was renamed or altered says so on any Node and OpenSSL version. The restore recognised a failed integrity check by the wording of OpenSSL's error, which Node 22 gives as "unable to authenticate data" and Node 26 on OpenSSL 4 as "bad decrypt", so a restore run on a newer Node showed the raw OpenSSL error instead of the explanation. The check now goes by where the failure arose, not by its text.
- A measurement CSV or a dose-history CSV with more than 100 000 rows, or a row wider than 1000 columns, is refused straight away. Blank lines are no longer held as rows while the file is read. Sixteen megabytes of line breaks used to hold several gigabytes of server memory for most of a minute, and a file of short junk lines answered with a status line for each of millions of rows.
- The sleep page's night timeline is drawn only for a night whose stages were recorded in order. A Garmin night arrives as one total per stage, all stamped on the wake time, and the page drew those totals as a timeline of bars stacked against the morning. Whether a night holds an order is now decided once on the server, from the shape of its stages rather than from a list of services, so Garmin, Oura's stage totals and any later service that sends totals get the same note WHOOP and Polar already had, and the iPhone app reads the same answer. Such a night no longer counts awakenings it cannot know. When two services describe the same night, the copy with a recorded order wins: a Garmin night that also reaches HealthLog through Apple Health shows the Apple Health timeline, and so now does a WHOOP or Polar night, which used to win on the source order and hide the recorded one. Thanks to @kruemelro for the report and the side-by-side screenshots. (Refs [#1419](https://github.com/MBombeck/HealthLog/issues/1419))
- A PDF read by an AI provider that takes page images is now rendered sharp enough for small print. Pages were rendered at 72 dpi, so an A4 lab report reached the model 842 px tall and decimal commas or units like `mmol/l` could get lost. Pages now render at 200 dpi, held to 2000 px on the long edge so every provider reads them without downscaling them first; an A4 page arrives at about 171 dpi. Document reads, lab scans, supplement labels and previews all render through this one path.
Expand Down Expand Up @@ -144,6 +145,7 @@
- A snooze stays with the dose it was set on. It was dated by the medication's last change, so a later write to the medication, such as the low-stock notice or an edit, carried a morning snooze over to the afternoon dose: the today list showed it snoozed and its reminder stayed silent. The snooze now keeps its own time.
- Readiness counts a reading on the day it was taken in the time zone of the person's profile. The dashboard, the score pages, the API, the iPhone app, the Coach and the nightly scores grouped the day in Berlin time, so for someone in another zone a late-evening resting pulse or HRV landed in the next day's readiness.
- A high stress or strain score reads as high. A stress of 80 was described as "on the low side" in the score's assessment and labelled "low" under its ring, and the ring on the score page announced it as good. Stress and strain now read low, moderate or high, the way their bands already run.
- A database server on a newer PostgreSQL major than the client tools in the image is now named as the problem, with both version numbers and the way out. Before, the dump the app takes before migrating failed with a one-line version mismatch, the boot stopped there and the container restarted into the same error every few seconds, while the nightly dumps failed with the same line and `db-restore` would have too. Every path that dumps or restores now compares the two majors first. At boot the app still refuses to migrate without its dump, but says why once and waits ten minutes before it exits; with nothing to migrate it starts and logs a warning. A nightly dump that fails this way shows as failing on the backups page from the first night and reaches admins as a backup alert, and `db-restore` refuses before it writes anything. The upgrade guide now states the ceiling: the highest server major HealthLog supports is the client major in the image, 19 today. Thanks to @aw23edfr4 for tracing it. (Refs [#1431](https://github.com/MBombeck/HealthLog/issues/1431))

### Security

Expand Down Expand Up @@ -187,6 +189,11 @@
- @Gen-X-Jim for the report with the database counts that showed what the card was missing, and for asking for a day-total form. ([#1459](https://github.com/MBombeck/HealthLog/issues/1459))
- @camiracode for counting the pairs that stayed after the 1.48.3 cleanup. ([#1414](https://github.com/MBombeck/HealthLog/issues/1414))

### Updating

- A new password longer than 1024 characters is refused when you register, claim a profile or change your password. A password you already have keeps working whatever its length: signing in and confirming your current password are not capped.
- If you run HealthLog against your own PostgreSQL server, keep its major at or below the client major in the image (`docker run --rm --entrypoint pg_dump ghcr.io/mbombeck/healthlog:latest --version`). See `docs/ops/postgres-major-upgrade.md`.

## [1.49.0] — 2026-11-23

### Added
Expand Down
20 changes: 19 additions & 1 deletion docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,25 @@ node scripts/pending-migrations.mjs || true
# without the backups volume): a warning, and the boot goes on. A kept
# directory and a failed dump: the boot stops here, before anything is
# migrated.
if ! node scripts/db-dump.mjs pre-migration; then
#
# Exit 3 is the dump that cannot be taken at all: the database server's major
# is newer than this image's pg_dump (#1431). A restart does not change that,
# and with `restart: unless-stopped` an immediate exit came straight back into
# the same error every few seconds. So the reason is said once, and the
# entrypoint waits ten minutes (inside the healthcheck's start period) before
# it exits; `docker stop` ends the wait at once.
dump_status=0
node scripts/db-dump.mjs pre-migration || dump_status=$?
if [ "$dump_status" -eq 3 ]; then
echo "HealthLog: ERROR — not migrating: this image's PostgreSQL client cannot dump this database server (see above). Nothing was changed." >&2
echo "HealthLog: to migrate without a dump this once, set DB_BACKUP_BEFORE_MIGRATE=false; the nightly dumps fail until the client and the server match." >&2
echo "HealthLog: waiting 10 minutes before exiting, so a restart policy does not restart into the same error. docker stop ends the wait." >&2
trap 'kill "$wait_pid" 2>/dev/null; exit 1' TERM INT
sleep 600 &
wait_pid=$!
wait "$wait_pid" || true
exit 1
elif [ "$dump_status" -ne 0 ]; then
echo "HealthLog: ERROR — not migrating without the dump. Free disk space or fix the error above and start again." >&2
echo "HealthLog: to migrate without a dump this once, set DB_BACKUP_BEFORE_MIGRATE=false." >&2
exit 1
Expand Down
45 changes: 36 additions & 9 deletions docs/ops/postgres-major-upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,48 @@ on the first start after the update. Nothing needs doing by hand on a stack
that runs the project's `docker-compose.yml`.

Installs that bring their own Postgres (Unraid, an existing database server)
are not touched: HealthLog runs on 16, 18 and 19 alike, and the move there is
yours to schedule with the steps under [By hand](#by-hand).
are not touched, and the move there is yours to schedule with the steps under
[By hand](#by-hand), within one ceiling.

One limit holds in the other direction, though. The image carries `pg_dump`
and `pg_restore` of major 19, and a PostgreSQL client reads servers of its own
major and older but refuses a newer one. A server above the client's major
fails the dump the app takes before every migration, and the app then stops
rather than migrate without one — by which time its nightly dumps have been
failing for as long as the server has been newer. So keep your own server at
or below the major the image carries; this names it for the release you run:
## The highest server major this image supports

The image carries `pg_dump` and `pg_restore` of one major, and a PostgreSQL
client works with servers of its own major and older, never a newer one. So
**the highest server major HealthLog supports is the client major in the
image you run**: 19 for the current releases, with 16, 18 and 19 all
supported. Check it for the release you run:

```bash
docker run --rm --entrypoint pg_dump ghcr.io/mbombeck/healthlog:latest --version
```

and the server's major with `SHOW server_version;` in `psql`. Keep the server
at or below the client's major; move it past only once a HealthLog release
ships the newer client.

Every path that runs one of the tools checks the pair first: the dump before
migrating, the nightly dump, and `db-restore`. A server newer than the client
is refused before anything is written, with one line that names both majors:

```
HealthLog: ERROR — This image's PostgreSQL client (pg_dump) is 19; your server is 20. ...
```

- **At boot, with migrations pending**, the app does not migrate without the
dump. It says why once, waits ten minutes and then exits, so a restart
policy does not restart it into the same error every few seconds;
`docker stop` ends the wait. Bring the server back to the client's major
(restore a dump into a server of that major), or migrate this once without
a dump with `DB_BACKUP_BEFORE_MIGRATE=false`, knowing the nightly dumps
keep failing until the two match.
- **At boot, with nothing to migrate**, the app starts and logs the same line
as a warning.
- **The nightly dump** fails the run with that line. The recovery readiness
check under Admin, Backups calls it failing from the first run, and every
admin gets it as a backup alert on the channels they enabled.
- **`db-restore`** refuses before `pg_restore` runs. Restore into a server of
the client's major or older.

## What happens on the first start

`db-upgrade` is a short-lived container next to `db`. It starts after the new
Expand Down
4 changes: 4 additions & 0 deletions docs/self-hosting/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ Compose starts two services and one short-lived step:
- `db-upgrade` — moves a Postgres 16 database from v1.45 or earlier into
the new one, once, and exits; on a new install it has nothing to do. See
[Moving to a newer Postgres major](../ops/postgres-major-upgrade.md).
Pointing `DATABASE_URL` at your own server instead works for any major up
to the PostgreSQL client major in the image (19 today); the app refuses a
newer one, see
[the highest supported major](../ops/postgres-major-upgrade.md#the-highest-server-major-this-image-supports).
- `app` — HealthLog itself, listening on `localhost:3000`. The image
runs `prisma migrate deploy` on boot so the schema lands
automatically; subsequent restarts no-op when the database is
Expand Down
18 changes: 9 additions & 9 deletions docs/self-hosting/truenas.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,15 @@ before you touch it.
Until the catalog app is listed, install HealthLog with Apps, Discover Apps,
the menu next to Custom App, Install via YAML, using these values:

| Setting | Value |
| ------------ | -------------------------------------------------------------------------------------- |
| Image | `ghcr.io/mbombeck/healthlog`, tag `X.Y.Z` (amd64 and arm64) |
| Port | `3000` (HTTP) |
| User | runs as uid `1001` by default; no extra capabilities, `no-new-privileges` is fine |
| Health check | `GET /api/health`, `200` when ready |
| Start period | 10 min, like the image: migrations run at every boot and wait out a held lock |
| Database | PostgreSQL 18 (16 works too), no extensions, in its own container with its own dataset |
| Volumes | `/var/lib/healthlog/backups` for the database dumps (uid `1001`); the database its own |
| Setting | Value |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Image | `ghcr.io/mbombeck/healthlog`, tag `X.Y.Z` (amd64 and arm64) |
| Port | `3000` (HTTP) |
| User | runs as uid `1001` by default; no extra capabilities, `no-new-privileges` is fine |
| Health check | `GET /api/health`, `200` when ready |
| Start period | 10 min, like the image: migrations run at every boot and wait out a held lock |
| Database | PostgreSQL 18 (16 and 19 work too, nothing newer than the image's client major, see `docs/ops/postgres-major-upgrade.md`), no extensions, in its own container with its own dataset |
| Volumes | `/var/lib/healthlog/backups` for the database dumps (uid `1001`); the database its own |

| Variable | Required | Notes |
| ----------------------- | -------- | ---------------------------------------------------------------------------------------- |
Expand Down
6 changes: 4 additions & 2 deletions docs/self-hosting/unraid.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ then add HealthLog pointed at it.

1. In **Apps** (Community Applications), search for a **PostgreSQL** container
(for example jj9987's `postgresql`). Install version 18; an existing 16
works too. Moving a 16 to 18 later is a dump and restore, see
[Moving to a newer Postgres major](../ops/postgres-major-upgrade.md#by-hand).
works too, and so does 19. Do not go past the PostgreSQL client major in
the HealthLog image (19 today): the app cannot dump a newer server, and
then refuses to migrate. Moving a 16 to 18 later is a dump and restore, see
[Moving to a newer Postgres major](../ops/postgres-major-upgrade.md#the-highest-server-major-this-image-supports).
2. Set:
- `POSTGRES_USER` = `healthlog`
- `POSTGRES_PASSWORD` = your generated password
Expand Down
1 change: 1 addition & 0 deletions messages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -9617,6 +9617,7 @@
"first_pending": "Der erste Datenbank-Dump ist noch nicht gelaufen.",
"stale": "Der neueste Datenbank-Dump ist {hours, plural, one {# Stunde} other {# Stunden}} alt.",
"last_failed": "Der letzte Datenbank-Dump ist fehlgeschlagen. Der davor ist noch aktuell.",
"client_too_old": "Der PostgreSQL-Client dieses Images hat Version {client}, der Datenbankserver läuft aber auf {server}, daher kann kein Datenbank-Dump erstellt werden. Nutze ein HealthLog-Image mit Client {server} oder neuer, oder lass den Server auf {client} oder älter.",
"fresh": "Der neueste Datenbank-Dump ist aktuell.",
"nowhere_to_write": "Das Dump-Verzeichnis {directory} ist nicht beschreibbar und es ist kein externer Bucket eingerichtet, daher kann kein Dump aufbewahrt werden.",
"not_persistent": "Das Dump-Verzeichnis {directory} liegt nicht auf dauerhaftem Speicher, und es ist kein externer Bucket eingerichtet. Jeder Dump wäre beim nächsten Update verloren. Binde das Backup-Volume ein.",
Expand Down
1 change: 1 addition & 0 deletions messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -9617,6 +9617,7 @@
"first_pending": "The first database dump has not run yet.",
"stale": "The newest database dump is {hours, plural, one {# hour} other {# hours}} old.",
"last_failed": "The last database dump failed. The one before it is still recent.",
"client_too_old": "This image's PostgreSQL client is {client}, but the database server runs {server}, so no database dump can be taken. Use a HealthLog image whose client is {server} or newer, or keep the server on {client} or older.",
"fresh": "The newest database dump is recent.",
"nowhere_to_write": "The dump directory {directory} cannot be written to and no off-host bucket is set up, so no dump can be kept.",
"not_persistent": "The dump directory {directory} is not on persistent storage and no off-host bucket is set up, so every dump would be lost at the next update. Mount the backups volume.",
Expand Down
1 change: 1 addition & 0 deletions messages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -9617,6 +9617,7 @@
"first_pending": "El primer volcado de la base de datos aún no se ha ejecutado.",
"stale": "El volcado de la base de datos más reciente tiene {hours, plural, one {# hora} other {# horas}}.",
"last_failed": "El último volcado de la base de datos falló. El anterior sigue siendo reciente.",
"client_too_old": "El cliente de PostgreSQL de esta imagen es la versión {client}, pero el servidor de base de datos usa la {server}, así que no se puede hacer ningún volcado. Usa una imagen de HealthLog cuyo cliente sea {server} o posterior, o mantén el servidor en {client} o anterior.",
"fresh": "El último volcado de la base de datos es reciente.",
"nowhere_to_write": "No se puede escribir en el directorio de volcados {directory} y no hay ningún bucket externo configurado, así que no se puede guardar ningún volcado.",
"not_persistent": "El directorio de volcados {directory} no está en almacenamiento persistente y no hay un bucket externo configurado, así que cada volcado se perdería en la próxima actualización. Monta el volumen de copias.",
Expand Down
1 change: 1 addition & 0 deletions messages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -9617,6 +9617,7 @@
"first_pending": "Le premier dump de la base de données n'a pas encore été lancé.",
"stale": "Le dump de la base de données le plus récent date de {hours, plural, one {# heure} other {# heures}}.",
"last_failed": "Le dernier dump de la base de données a échoué. Le précédent est encore récent.",
"client_too_old": "Le client PostgreSQL de cette image est en version {client}, mais le serveur de base de données est en {server} : aucun dump ne peut être réalisé. Utilisez une image HealthLog dont le client est en {server} ou plus récent, ou gardez le serveur en {client} ou plus ancien.",
"fresh": "Le dernier dump de la base de données est récent.",
"nowhere_to_write": "Le dossier des dumps {directory} n'est pas accessible en écriture et aucun bucket externe n'est configuré, donc aucun dump ne peut être conservé.",
"not_persistent": "Le répertoire des dumps {directory} n'est pas sur un stockage persistant et aucun bucket hors site n'est configuré : chaque dump serait perdu à la prochaine mise à jour. Montez le volume de sauvegarde.",
Expand Down
Loading
Loading