Builds on #24 (requirements cleanup): merge #24 first. Until then this PR also shows its changes in 02-requirements.md.
Change history retention (F-HIS-12)
What is kept: entries of the last 365 days, at most 1,000, whichever limit is reached first.
Where to set it: the System page, PUT /api/v1/settings/app (history_days 7–3650, history_entries 50–100000) or settings.json.
When it runs: at start, once a day, and right away when the setting changes. Each run is recorded in the history.
Backups: backups of config files go together with the history. The newest 10 per file always stay.
Changes page: shows "Kept: the last … days, at most … entries · oldest entry …".
Safety: the journal is rewritten atomically. Entries that are still kept stay undoable (tested).
Privacy (GDPR)
docs/privacy.md: what personal data Sharestead keeps, where, for how long, and how to delete it, including when someone leaves. It also states that Sharestead sends no data anywhere.
Elsewhere: N-17 in the requirements, and a link in the README.
Tests
Unit and API tests: the retention rules, trimming the journal and backups on real files, settings and their fallback, and the API (defaults, bounds, trim when the setting changes).
e2e: desktop and phone; the UI scenarios are updated (Test changed because: in the commit).
CT 151: with history_entries=50 the journal went from 286 to 51 entries and the backups from 43 to 26.
**Builds on #24 (requirements cleanup): merge #24 first.** Until then this PR also shows its changes in `02-requirements.md`.
## Change history retention (F-HIS-12)
- **What is kept:** entries of the last **365 days**, at most **1,000**, whichever limit is reached first.
- **Where to set it:** the System page, `PUT /api/v1/settings/app` (`history_days` 7–3650, `history_entries` 50–100000) or `settings.json`.
- **When it runs:** at start, once a day, and right away when the setting changes. Each run is recorded in the history.
- **Backups:** backups of config files go together with the history. The newest 10 per file always stay.
- **Changes page:** shows "Kept: the last … days, at most … entries · oldest entry …".
- **Safety:** the journal is rewritten atomically. Entries that are still kept stay undoable (tested).
## Privacy (GDPR)
- **`docs/privacy.md`:** what personal data Sharestead keeps, where, for how long, and how to delete it, including when someone leaves. It also states that Sharestead sends no data anywhere.
- **Elsewhere:** N-17 in the requirements, and a link in the README.
## Tests
- **Unit and API tests:** the retention rules, trimming the journal and backups on real files, settings and their fallback, and the API (defaults, bounds, trim when the setting changes).
- **e2e:** desktop and phone; the UI scenarios are updated (*Test changed because:* in the commit).
- **CT 151:** with `history_entries=50` the journal went from 286 to 51 entries and the backups from 43 to 26.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Compared every requirement in 02-requirements with the code on main (routes,
code, tests; #22 counted as it is about to land) and cleaned up with the
owner (2026-11-30):
- ✅ in the release column for what is built (new legend entry), so the
state is visible without searching the code.
- Removed (owner's decision): F-SHR-9 raw "Advanced" parameter editor — hand
edits in smb.conf are the advanced mode and are kept (its "kept and shown"
part moves to F-CFG-2); F-HIS-8 undo of users/groups through inverse
operations — large for little use, those changes stay audit-only; the
CSV/JSON export of F-HIS-11 — the API gives the same data.
- Duplicates removed: F-USR-6 (self-service, done as F-AUT-7) and F-AUT-3
(audit log, done by the change history).
- Duplicate IDs fixed: TOTP is F-AUT-8 (F-AUT-6 is the dropped passkey
login); the protective read-only action is F-MON-13 (F-MON-11 stays the
limitations, which code and tests refer to).
- MVP items not built moved to v1: first-run wizard (F-INS-4), CLI user
changes in the history (F-HIS-10), journal retention (F-HIS-12), NFS
options in plain words and NFS versions (F-NFS-3, F-NFS-6), certificate
expiry and quota-scan checks (part of F-MON-1), admin access check
(F-MON-6), automatic service restarts (F-MON-12), app release checks
(F-UPD-1/2/3/7/8 — there are no releases yet), protective action (F-MON-13).
- Corrected: F-SHR-5 (force group and create masks instead of setgid), N-8
WCAG 2.2 AA like F-UX-2, the family-member persona (changes their own
password now; office staff added), F-QUO-8 after F-QUO-7.
- MVP checklist rewritten for the planned NAS (a VM with host folders):
personal folder limits instead of per-user quotas, DLNA instead of the open
TV question, subfolder access added, the Cockpit removal on CT 110 dropped
(homelab task, not product).
Test changed because: comment only — web/e2e/ui-states.spec.ts cited
F-SHR-9 for "custom settings are shown and not overwritten"; that guarantee
now lives in F-CFG-2. The test code is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The change journal and the config backups grew forever: every entry holds
the full content of the changed files, and every change left a backup copy.
The history also holds personal data (who changed what, user names), which
the GDPR's storage limitation says not to keep longer than needed.
Retention, owner's decision 2026-11-30:
- Entries older than 365 days go, and of the rest at most the newest 1,000
stay (whichever is reached first). Both values are app settings: System
page, PUT /api/v1/settings/app (history_days 7–3650, history_entries
50–100000) or settings.json; out-of-range values in the file fall back to
the defaults, never to "keep forever".
- Applied at start, once a day, and right away when the setting changes.
The journal is rewritten atomically (temp file + rename), so a crash leaves
the old or the new file; unreadable lines, already ignored, are dropped.
- Backups older than the oldest kept entry go; the newest 10 per file always
stay. Backup names now carry a UTC timestamp, so writing and reading them
agree in every time zone.
- What a trim removed is itself an audit entry; the setting change too.
- The Changes page says how long the history is kept and how far back it
goes (GET /api/v1/changes → kept).
Privacy: docs/privacy.md lists what personal data Sharestead keeps, where,
for how long and how to delete it (incl. when someone leaves), and that it
sends nothing anywhere. N-17 in the requirements; README links to it.
03-solution-design: retention row added; the user/group undo row now says
audit only (F-HIS-8 was dropped).
Tests: retention rules (changes, 98%), journal and backup trimming on real
files incl. undo after a trim and unrelated files kept (configstore),
settings defaults and fallback, API (defaults, trim on change, bounds,
history entries); e2e on CT 151 (desktop + phone), axe unchanged. Checked on
CT 151: history_entries 50 trimmed 286 → 51 entries and 43 → 26 backups,
journal still 0600. Coverage minimums raised (total 77, server 85, auth 95).
Test changed because: web/e2e/fixtures/base.json is a recorded API answer
that fixtures_test.go checks against the API description; GET
/api/v1/settings/app and GET /api/v1/changes now have the required fields
history_days/history_entries and kept. Only those fields were added (two
existing lines got a trailing comma); no expectation changed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Shortening the retention deleted history at once and for good, with no
second look. Besides mistakes, it was a way to remove traces: anyone with an
open admin session could wipe the history of what they did.
Now (owner's decision 2026-11-30):
- PUT /api/v1/settings/app?dry_run=1 saves nothing and returns what the new
retention would remove (entries, backups, oldest entry left) and whether
it is shorter.
- A shorter retention (fewer days or entries) needs a recently confirmed
password (403 confirm_password, like deleting data, F-AUT-5). A longer one
removes nothing new and needs none.
- System page: Save on a shorter setting shows the preview first ("Removed
now: 237 entries and 17 backups; the oldest entry left is from …",
can't be undone); "Remove now" applies it, and the UI asks for the
password when needed. While the preview is open the fields are locked, so
what was previewed is what gets applied. When nothing would be removed now
the button says "Save shorter history".
- The daily trim stays automatic; it only removes what the confirmed
setting already lets expire.
Trim got a dry-run mode (journal and backups are only counted);
Retention.Shorter compares two retentions.
Tests: dry run changes nothing (configstore), Shorter (changes), API:
preview saves and removes nothing, shorter without a recent password is
refused and changes nothing, longer needs no password, after confirming it
applies (internal/server); e2e on CT 151 desktop + phone. Checked in a real
browser on CT 151 after the 5-minute window: the password dialog appears
("Shortening the change history needs your password again"), and after
confirming the setting is saved.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Builds on #24 (requirements cleanup): merge #24 first. Until then this PR also shows its changes in
02-requirements.md.Change history retention (F-HIS-12)
PUT /api/v1/settings/app(history_days7–3650,history_entries50–100000) orsettings.json.Privacy (GDPR)
docs/privacy.md: what personal data Sharestead keeps, where, for how long, and how to delete it, including when someone leaves. It also states that Sharestead sends no data anywhere.Tests
history_entries=50the journal went from 286 to 51 entries and the backups from 43 to 26.🤖 Generated with Claude Code
Shortening the retention deleted history at once and for good, with no second look. Besides mistakes, it was a way to remove traces: anyone with an open admin session could wipe the history of what they did. Now (owner's decision 2026-11-30): - PUT /api/v1/settings/app?dry_run=1 saves nothing and returns what the new retention would remove (entries, backups, oldest entry left) and whether it is shorter. - A shorter retention (fewer days or entries) needs a recently confirmed password (403 confirm_password, like deleting data, F-AUT-5). A longer one removes nothing new and needs none. - System page: Save on a shorter setting shows the preview first ("Removed now: 237 entries and 17 backups; the oldest entry left is from …", can't be undone); "Remove now" applies it, and the UI asks for the password when needed. While the preview is open the fields are locked, so what was previewed is what gets applied. When nothing would be removed now the button says "Save shorter history". - The daily trim stays automatic; it only removes what the confirmed setting already lets expire. Trim got a dry-run mode (journal and backups are only counted); Retention.Shorter compares two retentions. Tests: dry run changes nothing (configstore), Shorter (changes), API: preview saves and removes nothing, shorter without a recent password is refused and changes nothing, longer needs no password, after confirming it applies (internal/server); e2e on CT 151 desktop + phone. Checked in a real browser on CT 151 after the 5-minute window: the password dialog appears ("Shortening the change history needs your password again"), and after confirming the setting is saved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>