mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-18 08:02:12 +00:00
feat(cycle): predicted-period notifications + reproductive-data privacy docs
Add two cycle reminders through the existing notification cascade and the honest self-hosting privacy framing for reproductive-health data. Notifications: - New event types CYCLE_PERIOD_SOON (fires ~2 days before the predicted next-period start, from the cached prediction) and CYCLE_PERIOD_CONFIRM (a gentle "did your period start?" on/after the predicted start while no period is logged, within a short grace window). Both default OFF and are gated again on cycleTrackingEnabled — opt in twice for a sensitive surface. - A 15-minute pg-boss cron mirrors the mood-reminder worker: it scans users with cycle tracking enabled + predictionEnabled, computes who is in-window from the cached forecast, and dispatches one push per event per local day. Idempotency anchors on the push_attempts ledger (no new table). The queue is declared, registered in allQueues, scheduled, and wired to a boss.work handler, with a source-grep guard so it cannot ship unregistered. - Honours notificationPrefs.cycle.clientManaged (skip the server push when the device owns local reminders, with a suppressed annotation, mirroring the medication path) and CycleProfile.discreetNotifications (generic "HealthLog reminder" body so no cycle event is named on the lock screen). - Every attempt is recorded in push_attempts via the unchanged dispatcher. Privacy / disclaimer: - docs/self-hosting/reproductive-health-data.md — the "no cloud vendor to subpoena" framing with the honest residual-threat caveat (your own host, provider, backups, and devices remain part of the surface), citing the 2021 FTC settlement and 2025 verdict as public record only. - docs/security/cycle-data-threat-model.md — a compact "protects against / does not protect against" note, plus README pointers. - CyclePredictionDisclaimer component (reusing the GLP-1 estimate-disclaimer pattern) for every fertility/prediction surface: descriptive, not a contraceptive method, not medical advice, never a safe-to-have-unprotected -sex claim. 6-locale copy under cycle.disclaimer. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
77a652a47c
commit
6fdbb8d889
18 files changed
+1372
-8
No files matched your search
@@ -0,0 +1,52 @@
|
||||
# Cycle-data threat model
|
||||
|
||||
A compact statement of what self-hosting HealthLog's cycle tracking
|
||||
protects against and what it does not. Pair this with the operator
|
||||
guidance in
|
||||
[`self-hosting/reproductive-health-data.md`](../self-hosting/reproductive-health-data.md).
|
||||
|
||||
The scope here is reproductive-health data specifically (menstrual,
|
||||
fertility, pregnancy, contraception, sexual-activity fields), because
|
||||
that is the category where the "who can reach my data" question carries
|
||||
the highest stakes.
|
||||
|
||||
## What self-hosting + encryption-at-rest protects against
|
||||
|
||||
- **A cloud vendor holding your data.** There is no SaaS account and no
|
||||
vendor key escrow. No third party can be served process for data it
|
||||
does not have.
|
||||
- **A stolen disk or a leaked backup, while the key is held separately.**
|
||||
The intent-revealing fields are AES-256-GCM encrypted at rest; a disk
|
||||
image without the `ENCRYPTION_KEYS` value does not yield them.
|
||||
- **Casual lock-screen disclosure.** Discreet notifications collapse
|
||||
every cycle reminder to a generic "HealthLog reminder" so the event is
|
||||
never named on a lock screen.
|
||||
- **Third-party analytics / ad-tech leakage.** HealthLog ships no
|
||||
telemetry and no third-party trackers; cycle data is never sent to an
|
||||
analytics or advertising endpoint.
|
||||
|
||||
## What it does NOT protect against
|
||||
|
||||
- **Seizure or compulsion of your own host.** If the running machine is
|
||||
seized, imaged, or compelled, the data is on it. Encryption at rest
|
||||
does not help against a live host or a key stored beside the data.
|
||||
- **Your hosting provider.** A VPS provider can snapshot the disk and
|
||||
can be served process. Self-hosting on rented infrastructure narrows
|
||||
the set of parties that hold the data; it does not eliminate them.
|
||||
- **Your own backups.** Any `pg_dump` or off-host export carries the
|
||||
same data and must be protected as part of the same surface.
|
||||
- **A compromised or unlocked client device.** A phone or laptop with a
|
||||
live session or cached client holds data locally. Server-side
|
||||
protection does nothing for an unlocked device.
|
||||
- **Re-identification from "plaintext" fields.** Flow, basal body
|
||||
temperature, ovulation tests, cervical mucus, and cycle dates stay in
|
||||
plaintext so the engines can read them. They are health observations,
|
||||
not the disclosure-sensitive intent fields — but they are still
|
||||
health data on your host.
|
||||
|
||||
## The one-line version
|
||||
|
||||
Self-hosting means **no cloud vendor to subpoena**. It does **not** mean
|
||||
the data is beyond reach: your own infrastructure, your provider, your
|
||||
backups, and your devices are all still part of the surface. Size your
|
||||
operator-side hardening to your own threat model.
|
||||
@@ -0,0 +1,103 @@
|
||||
# Reproductive-health data on your own server
|
||||
|
||||
HealthLog's cycle tracking stores menstrual, fertility, and related
|
||||
reproductive-health data the same way it stores every other metric: in
|
||||
the PostgreSQL database that runs on the host you control, encrypted at
|
||||
rest for the intent-revealing fields. This page explains what that
|
||||
arrangement does and does not change about who can reach that data, in
|
||||
plain terms and without overstating the protection.
|
||||
|
||||
## What self-hosting changes
|
||||
|
||||
A consumer cycle-tracking app runs on the vendor's servers. Your
|
||||
reproductive-health data lives in their database, under their keys, in
|
||||
their jurisdiction. If that vendor receives a subpoena, a civil
|
||||
discovery request, or a law-enforcement demand it judges valid, the
|
||||
vendor — not you — decides how to respond, and it holds the data and the
|
||||
keys needed to comply. Several vendors state in their own privacy
|
||||
policies that they comply with valid legal process; that is a factual
|
||||
description of where the data sits, not an accusation.
|
||||
|
||||
Self-hosting removes that vendor from the picture. There is no cloud
|
||||
account holding your cycle data, no vendor key escrow, and no third
|
||||
party that can be served process to hand over data it does not have. The
|
||||
honest framing is narrow and worth stating precisely:
|
||||
|
||||
> Self-hosting means there is no cloud vendor to subpoena for your
|
||||
> reproductive-health data. It does **not** make the data
|
||||
> unreachable.
|
||||
|
||||
The encryption-at-rest layer is real: the intent-revealing day-log
|
||||
fields (free-text notes always; pregnancy, contraception, and
|
||||
sexual-activity fields by default for this category) are encrypted with
|
||||
AES-256-GCM under a key you supply via `ENCRYPTION_KEYS`, and the
|
||||
application fails closed rather than ever writing those fields in
|
||||
plaintext. Flow, basal body temperature, ovulation-test results,
|
||||
cervical-mucus observations, and the cycle dates stay in plaintext
|
||||
because the prediction and correlation engines read them; they are
|
||||
health observations, not the disclosure-sensitive intent fields.
|
||||
|
||||
## The residual threat (read this part)
|
||||
|
||||
Self-hosting moves the data onto a box you own. That box can still be
|
||||
reached:
|
||||
|
||||
- **Physical or legal seizure of your own host.** If the machine
|
||||
running PostgreSQL — your VPS, your home server, your NAS — is seized,
|
||||
imaged, or compelled, the data is on it. Encryption at rest protects
|
||||
against a stolen disk or a leaked backup only while the key is *not*
|
||||
also available; if the host is running, or the key is stored next to
|
||||
the data, that protection is gone.
|
||||
- **Your hosting provider.** A VPS provider can snapshot your disk and
|
||||
can be served process the same way a SaaS vendor can. Self-hosting on
|
||||
rented infrastructure narrows the set of parties who hold your data;
|
||||
it does not reduce it to zero.
|
||||
- **Your own backups.** Off-host backups (the optional S3 export, or any
|
||||
`pg_dump` you take) carry the same data. Encrypt them, control where
|
||||
they land, and treat them as part of the same threat surface.
|
||||
- **The device that talks to the server.** A phone or laptop with a
|
||||
live session, a cached PWA, or the native client holds data locally
|
||||
too. Protecting the server does nothing for an unlocked device.
|
||||
|
||||
The promise is therefore specific: **no cloud vendor to subpoena**, not
|
||||
**data nobody can ever reach**. If your threat model includes seizure of
|
||||
your own infrastructure, encryption at rest plus a key you keep off the
|
||||
host is the floor, and the threat-model note below covers the rest.
|
||||
|
||||
## Public record
|
||||
|
||||
The reason this distinction matters is documented in public legal
|
||||
record, not speculation:
|
||||
|
||||
- In 2021 the U.S. Federal Trade Commission settled with the maker of a
|
||||
period- and fertility-tracking app over allegations that it shared
|
||||
users' health data with third-party analytics and advertising
|
||||
services despite privacy promises. The settlement is public record.
|
||||
- In 2025 a federal jury found that the same app's maker violated a
|
||||
California privacy statute over the sharing of menstrual-tracking
|
||||
data; the verdict and the underlying class action are public record.
|
||||
|
||||
These are cited as factual public record to explain *why* the
|
||||
"who holds the data" question is the one that matters for this category.
|
||||
HealthLog makes no claim about any other product's current practices.
|
||||
|
||||
## Practical hardening
|
||||
|
||||
If reproductive-health privacy is the reason you self-host, the
|
||||
operator-side steps that matter most:
|
||||
|
||||
- Keep `ENCRYPTION_KEYS` off the host that runs PostgreSQL where your
|
||||
threat model allows it (an injected secret at boot, not a file next to
|
||||
the database). See `docs/ops/encryption-key-rotation.md`.
|
||||
- Turn off any integration you do not need. The fewer outbound paths,
|
||||
the smaller the surface.
|
||||
- Encrypt and control your backups. The off-host backup feature uses
|
||||
AES-GCM; the destination bucket and its access are yours to lock down.
|
||||
- Use the in-app **discreet notifications** toggle so cycle reminders
|
||||
never name the event on a lock screen, and the **client-managed
|
||||
reminders** path if you want the device, not the server, to own those
|
||||
notifications.
|
||||
- Lock the devices that hold a live session.
|
||||
|
||||
See also the [threat-model note](../security/cycle-data-threat-model.md)
|
||||
for a compact "protects against / does not protect against" summary.
|
||||
Reference in new issue
Block a user