diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b196dd1..88f404c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,6 +70,25 @@ jobs: # Starts the previous published release, tries an update that fails, then updates to this code. - run: sh scripts/test-update.sh + # The upgrade from each earlier minor, with a backup made by that version. A new job, so the name of "update" stays. + update-from: + name: update-from-${{ matrix.minor }} + runs-on: ubuntu-latest + timeout-minutes: 25 + strategy: + fail-fast: false + matrix: + # Each earlier 0.x minor. v0.1.0 never had a published image, so 0.1 means v0.1.1. Add a line for each new minor. + minor: ["0.1", "0.2", "0.3", "0.4", "0.5"] + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 0 + persist-credentials: false + - run: sh scripts/test-update.sh "$MINOR" + env: + MINOR: ${{ matrix.minor }} + secret-scan: runs-on: ubuntu-latest timeout-minutes: 10 diff --git a/CHANGELOG.md b/CHANGELOG.md index d7b74bd..fc544e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ version may change things that need attention when updating, and these notes say ## Unreleased +### For people running an archive and for maintainers + +- **The 1.0 checklist** is written down in `docs/release-1.0.md`: each condition, how it is checked, and where it stands. Some are + not met yet and it says so (a group that has run it for a season, a second person who + can approve a release). `SUPPORT.md` says which versions get security fixes and what is not supported: the newest minor only, as + the maintainer decided on 2026-11-23. The program itself does not change. +- **The update is tested from every earlier minor.** `scripts/test-update.sh` takes a minor (`scripts/test-update.sh 0.3`), + makes a backup with that release's own scripts and, after updating, restores that backup into the new version. A new CI job + `update-from` runs it for 0.1 to 0.5. It has not run in CI yet, so `docs/release-1.0.md` does not claim more than that. + ### For visitors and other programs - **A public item can be read by a program.** Each public item page now names `/items/{number}.json` as an alternate and carries diff --git a/README.md b/README.md index 1dba984..191720b 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ and password from `.env`. The health check is at http://localhost:8080/health. Report vulnerabilities as described in [SECURITY.md](SECURITY.md). - [Development](docs/development.md): working on the code, and how it fits together. - [Handing the project over](docs/handover.md): what a new maintainer needs to know. +- [The 1.0 checklist](docs/release-1.0.md) and [support](SUPPORT.md): what has to be true before 1.0, and where it stands. If this project ever stops, archives keep working: a running archive calls no service of this project, and exports, backups and the published images stay usable. See [what that means in practice](docs/handover.md#if-the-project-stops). diff --git a/SUPPORT.md b/SUPPORT.md new file mode 100644 index 0000000..9f67e6a --- /dev/null +++ b/SUPPORT.md @@ -0,0 +1,51 @@ +# Support + +> **Confirmed by the maintainer, Seb H., on 2026-11-23.** Which versions get security fixes is decided. +> The rest of this page is written as defaults a single maintainer can keep. +> See [docs/release-1.0.md](docs/release-1.0.md). [SECURITY.md](SECURITY.md) says the same about fixes. + +## Reporting a security problem + +Follow [SECURITY.md](SECURITY.md): GitHub's private vulnerability reporting, and the contact address in that file if you have +no GitHub account. Please do not report security problems in public issues. + +## Other problems and questions + +Open an issue in the repository, `SebHenn/commonage`. Never put an archive's material, a contributor's details or a password in +an issue: describe what you did and what happened, and say which version you run. A group's export, backup or `.env` +does not belong in a public place. + +## Which versions get security fixes + +| Version | Security fixes | For how long | +|---|---|---| +| The newest minor (today 0.5; after 1.0, the newest 1.x) | Yes: Commonage, and relevant fixes in .NET, libvips and the base images, as a rule within a week of a fix being available | As long as it is the newest | +| Any older minor | No | Update to the newest one | + +"Fix" means a bug-fix release of the newest minor (for example 0.5.1). Fixes are not made for older minors, and there is +no extra period after 1.0: someone on an older version updates through the newest minor. This is the rule in SECURITY.md. + +Updating is done with `scripts/update.sh`; see [docs/operations.md](docs/operations.md). Keep a backup before updating. +Updating to a newer minor before 1.0 may need attention; the notes in [CHANGELOG.md](CHANGELOG.md) say so. + +## What is supported + +- Running the published image the way [docs/deployment.md](docs/deployment.md) describes, on x86 or ARM. +- The export, backup and restore described in [docs/operations.md](docs/operations.md). +- Updating to the newest release. The update test jumps from each earlier minor straight to the current version, so that is the path that is tested. + +## What is not supported + +- Modified copies, or images built from a changed source. +- A server without HTTPS, or one that exposes the database or the files folder. +- A version that is not the newest minor. +- Reading another system's export; only Commonage's own export is read. +- Recovering an archive without a backup. Commonage stores files in a folder and data in PostgreSQL; the backup is the group's job. +- Help with a group's own server, domain, mail or network. +- Response times. This is a project run by a volunteer: a security report gets an answer within a week, and other issues + when there is time. + +## If the project stops + +See "If the project stops" in [docs/handover.md](docs/handover.md): a running archive keeps running, and the export and backups are +open formats. diff --git a/docs/development.md b/docs/development.md index 04416bb..460ac5b 100644 --- a/docs/development.md +++ b/docs/development.md @@ -244,7 +244,9 @@ Without JavaScript, `css/nojs.css` shows what would otherwise stay folded away. violation), tests each JavaScript behaviour, and does the main tasks with JavaScript switched off. Add new pages to `AccessibilityTests`, and a test for each new behaviour in `wwwroot/js`. - `scripts/test-backup-restore.sh` and `scripts/test-update.sh` run whole archives in Docker. The second needs ports 80 - and 443 free. + and 443 free. `scripts/test-update.sh 0.3` starts from the newest published 0.3.x (without an argument, from the newest earlier + release), also makes a backup with that release and restores it into the new version at the end. CI runs it for each earlier + minor in the `update-from` job. Before a release, also check by hand what automated tests cannot judge ([accessibility.md](accessibility.md#before-each-release)). diff --git a/docs/handover.md b/docs/handover.md index eee6adc..19f51af 100644 --- a/docs/handover.md +++ b/docs/handover.md @@ -19,7 +19,8 @@ should not. - **Dependency updates** arrive from Dependabot. Patches and minor updates that pass all checks merge themselves. Everything else needs someone to look. - **A release** is a tag: see "Releasing" in [development.md](development.md). The image is built for x86 and ARM, waits for - approval, and gets a signed attestation. + approval, and gets a signed attestation. Before 1.0, [release-1.0.md](release-1.0.md) lists what else has to be true; + a second person who can approve a release is one of its conditions, and is not met yet. - **Code scanning alerts** are in the repository's Security tab. Some are open on purpose; the reason is in each one. - **Where the project is going** is in [roadmap.md](roadmap.md), including what was decided against and why. diff --git a/docs/plan-m28-toward-1-0.md b/docs/plan-m28-toward-1-0.md index 835c92a..2c72404 100644 --- a/docs/plan-m28-toward-1-0.md +++ b/docs/plan-m28-toward-1-0.md @@ -1,6 +1,6 @@ # Plan for M28: toward 1.0 -Status: **plan, no code yet; decisions made (see "Decisions").** Three parts, in this order, each its own pull request. The plan goes to the `privacy-reviewer` agent +Status: **built in three parts; part 3 is `docs/release-1.0.md` and `SUPPORT.md`. Decisions made (see "Decisions").** Three parts, in this order, each its own pull request. The plan goes to the `privacy-reviewer` agent before part 1 starts, as M27 did, because part 1 brings material into the archive from outside and part 2 adds public addresses. ## What is wanted diff --git a/docs/release-1.0.md b/docs/release-1.0.md new file mode 100644 index 0000000..bc61bf5 --- /dev/null +++ b/docs/release-1.0.md @@ -0,0 +1,104 @@ +# The 1.0 checklist + +What has to be true before Commonage is called 1.0, how each condition is checked, and where it stands today. It is +written down so that it is checked, not remembered. The plan behind it is in +[plan-m28-toward-1-0.md](plan-m28-toward-1-0.md), part 3. + +Status written on 2026-11-23, on top of v0.5.0 with M28 parts 1 and 2 merged. **Not every condition is met, and this page says +which.** Nothing here changes how the program behaves. + +## What 1.0 means + +The version number does not wait for a group. 1.0 is tagged when every condition marked "machine" below is met and the +others are met or consciously accepted by the maintainer. A real group running it for a season (the first row) is a +condition for calling 1.0 **supported**, as decided in the plan (decision 4); until then the release notes say that no group has +yet run it for a season. + +Where a condition is checked by a machine, it is checked by a named test or script, so the claim can be run again. + +## The conditions + +| # | Condition | Checked by | Status | +|---|---|---|---| +| 1 | A real group has run it for a season | A written note from the group (their name only if they agree). Not something a test can show. | **Not met.** No group has reported yet (see the roadmap). Needed for "supported", not for the number. | +| 2 | The upgrade works from every 0.x minor | `scripts/test-update.sh` in CI: job `update` (newest earlier release) and the matrix job `update-from` (each earlier minor), both in `ci.yml`, run on every pull request. | **Built, not yet run in CI.** The matrix covers every earlier minor with an image; see below. | +| 3 | Export and import round trip | `ExportImportTests` in `tests/Commonage.Tests`. | **Met, with the limits below.** | +| 4 | A support policy | [SUPPORT.md](../SUPPORT.md) and the "Which versions get fixes" section of [SECURITY.md](../SECURITY.md). | **Met.** Confirmed by the maintainer (Seb H.) on 2026-11-23: security fixes go to the newest minor only; older versions update through it. | +| 5 | A second person can release | [handover.md](handover.md): a second reviewer of the `release` environment, or a written handover. | **Not met.** The handover is written; no second approver exists. | +| 6 | No open `LEAK` from the privacy review, and no known accepted limit missing from `security.md` | The last dated review, below, and [security.md](security.md). | **Reviews done for M28; a final review before the tag is still to do.** | +| 7 | Accessibility and translations | `AccessibilityTests` in `tests/Commonage.BrowserTests` (axe, every page; a new page must be added) and `TranslationTests` in `tests/Commonage.Tests`. | **Met by tests.** Real phones and screen readers have not been tested (see below). | + +### 2. The upgrade, in detail + +What `scripts/test-update.sh ` does: it takes the **newest release of that minor that has a published image**, starts it +in the production setup with the demo content, makes a backup with **that release's own** `scripts/backup.sh`, tries an update +to a deliberately broken image that fails after the database was upgraded, checks that the old version, `.env`, checkout and +database all come back, refuses an unknown release, a wrong version and an update over changed files, then updates to the +code in the pull request, checks that updating to the version it is already on changes nothing, and finally restores the old +release's backup into the new version (the app upgrades that database when it starts) and checks the content is back. + +Which minors are covered: the published images are 0.1.1, 0.2.0, 0.3.0, 0.4.0, 0.4.1 and 0.5.0 (checked against the registry's +tag list on 2026-11-23). v0.1.0 never had an image, so 0.1 is tested as v0.1.1. The `update-from` job in `ci.yml` runs one +matrix entry for each of 0.1 to 0.5 with `fail-fast: false`; the older `update` job still tests the newest earlier release. A +new minor needs a new line in the matrix. The `update-from-*` check names are new and are not required checks until the +maintainer makes them so. + +What is **not** shown, said plainly: + +- The matrix has not run in CI yet, and `scripts/test-update.sh` was **not run here** (Docker Desktop was not running, and it + is not started without asking). It passes `sh -n` and its release selection was checked against the tags only. Releases + 0.1 to 0.4 have not been tried by this script at all: an old release's own scripts or health check may need a small fix the + first time. Read the first CI run before ticking this condition. +- Only the newest patch of each minor is the starting point (0.4.0 is not tried separately from 0.4.1). +- The archive in it holds the demo content, not a large or old one. + +### 3. The round trip, in detail + +`ExportImportTests` reads an export of this app back as drafts, checks versions 4 to the current one, refuses other +versions and other files, drops a file with a wrong checksum, never looks up a name that climbs out of the folder, copes with an +entry that lies about its size and an `archive.json` that inflates, leaves out rejected, withdrawn and unconsented items, runs +twice without adding anything, and has a test that fails when the exporter gains a property the importer has no decision for. + +The limits are stated, not hidden: contributor details and consent are never carried over, so an export read back is not +identical to the source, and everything arrives as a draft. That is the decision in [security.md](security.md) and the +plan, not a gap. + +### 7. What no test can show + +The browser tests run in Chrome. They do not replace real phones, a screen reader in use, or a person with a slow +connection. [accessibility.md](accessibility.md) says what has and has not been checked; the usability test in +[usability-test.md](usability-test.md) has not been run with a group. + +## The privacy review + +The agent reviews are run with the `privacy-reviewer` agent against a base ref, as the project rules ask, and the last one before a +tag is dated here. A review looks for what Commonage cannot ship: showing the public something that is not published, leaking an +original file or a contributor's personal details, deleting at once, text that only works in one language, and the security +checks in [security.md](security.md). + +**Where the output is kept.** The dated summary on this page is the record: the date, what was reviewed, how many findings +of each kind were open, and what was done. The full text of a review is kept in the description of the pull request it +belongs to, and nowhere with contributor details or real archive material in it: reviews are done on code and on test +data, never on a real archive. A review that would need real material is not run; its findings are written from the code. +A finding is closed by a commit that says so, or is written into [security.md](security.md) as an accepted limit with its reason. + +### Review log + +| Date | What was reviewed | Result | Open `LEAK` | +|---|---|---|---| +| 2026-11 (M28) | The plan for M28 (before any code) | Fourteen gaps found and folded into the plan ("Changes after the review") | none open in the plan | +| 2026-11 (M28, part 1) | Reading Commonage's own export (the ZIP import): three reviews | Findings were fixed in the same pull request; the decisions on consent and on what arrives are in [security.md](security.md) | none known open; **to be confirmed by the maintainer** | +| 2026-11 (M28, part 2) | The public JSON and Dublin Core tags: one review | Same rules as the link preview; the cache and 404 behaviour are in [security.md](security.md) | none known open; **to be confirmed by the maintainer** | +| before the tag | A final review of the whole tree against `main` | **Not done yet** | open until done | + +The two "to be confirmed" rows are written from the milestone's own record and not from the review texts, which are not in this +repository. The maintainer should check them against the pull requests (#72 and #75) before the tag, and date the final review. + +## What the maintainer still has to decide or do + +1. (Done on 2026-11-23: the support policy is confirmed, newest minor only.) +2. Read the first CI run of the `update-from` matrix, fix what it finds, and decide whether `update-from-*` become required checks. +3. Add a second reviewer of the `release` environment, or someone who takes over (condition 5); see [handover.md](handover.md). +4. Run and date the final privacy review, and confirm the log above. +5. Find a group, and decide when "supported" is announced. +6. Check the README status line, which still says v0.4. diff --git a/docs/roadmap.md b/docs/roadmap.md index 7251a04..3741a99 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -183,7 +183,7 @@ real pace over M7 and M8 before promising dates. Each milestone is a minor relea | **M25 Oral histories** | 4 | A curator uploads an interview. Visitors play it with its transcript beside it, and the file carries no metadata. | | **M26 Description history** | 3 | A curator sees who changed which field and when, and restores an earlier description. | | **M27 Visibility levels** ✅ | 5 | An item can be public as a record without its media, or embargoed until a date. Every public query goes through `VisibleItems`. | -| **M28 Toward 1.0** | 3 | Commonage reads its own export, so archives can be merged. Dublin Core and a JSON alternate exist. A 1.0 checklist is met. | +| **M28 Toward 1.0** ✅ | 3 | Commonage reads its own export, so archives can be merged. Dublin Core and a JSON alternate exist. A 1.0 checklist is written ([release-1.0.md](release-1.0.md)); not all of it is met yet. | M22 to M28 were planned in November 2026, after M21, from the "Later" list. There are still no reports from groups or testers, so the order is a judgement again: documents are the largest gap between what groups hold and what the app takes, @@ -530,7 +530,7 @@ shows the years of its published items. M19 is complete. **M26 Description history** | 3 | A curator sees who changed which field and when, and restores an earlier description. | | **M27 Visibility levels** ✅ | 5 | An item can be public as a record without its media, or embargoed until a date. Every public query goes through `VisibleItems`. | -| **M28 Toward 1.0** | 3 | Commonage reads its own export, so archives can be merged. Dublin Core and a JSON alternate exist. A 1.0 checklist is met. | +| **M28 Toward 1.0** ✅ | 3 | Commonage reads its own export, so archives can be merged. Dublin Core and a JSON alternate exist. A 1.0 checklist is written ([release-1.0.md](release-1.0.md)); not all of it is met yet. | M22 to M28 were planned in November 2026, after M21, from the "Later" list. There are still no reports from groups or testers, so the order is a judgement again: documents are the largest gap between what groups hold and what the app takes, @@ -898,7 +898,8 @@ shows the years of its published items. M19 is complete. **M28 Toward 1.0** -- The plan is in [plan-m28-toward-1-0.md](plan-m28-toward-1-0.md). +- The plan is in [plan-m28-toward-1-0.md](plan-m28-toward-1-0.md). Built in three parts; the checklist and what is still unmet are in + [release-1.0.md](release-1.0.md), the proposed support policy in [SUPPORT.md](../SUPPORT.md). - Reading Commonage's own export (versions 4 and later) with the import's dry run. Dublin Core and `/items/{id}.json` as an alternate link. A 1.0 checklist: a real group running it, the upgrade tested from every 0.x minor version, a support policy, and a second release approver or a written handover. diff --git a/scripts/test-update.sh b/scripts/test-update.sh index ae95041..8250e59 100755 --- a/scripts/test-update.sh +++ b/scripts/test-update.sh @@ -1,9 +1,12 @@ #!/bin/sh -# Tests updating a real archive: starts the previous published release in the production setup, tries an update that -# fails after upgrading the database, checks that everything went back, then updates to the current code. +# Tests updating a real archive: starts an earlier published release in the production setup, makes a backup with that +# release's own scripts, tries an update that fails after upgrading the database, checks that everything went back, +# updates to the current code, and finally restores the old release's backup into the new version. # -# scripts/test-update.sh +# scripts/test-update.sh from the newest earlier release that has a published image +# scripts/test-update.sh 0.3 from the newest 0.3.x release that has a published image # +# CI runs it for each earlier minor (job "update-from" in ci.yml), and from the newest one on every pull request. # Works on its own clone and as its own Compose project, so it never touches your archive, but it needs ports 80 and # 443 free. CI runs it on every pull request. set -eu @@ -15,9 +18,15 @@ cd "$repository" if command -v cygpath >/dev/null 2>&1; then repository=$(cygpath -m "$repository"); fi head=$(git rev-parse HEAD) -# The newest earlier release with a published image. A release just tagged may still be waiting for its approval. +minor=${1:-} +case "$minor" in + "" | [0-9]*.[0-9]*) case "$minor" in *[!0-9.]*) echo "Usage: scripts/test-update.sh [minor, such as 0.3]" >&2; exit 2 ;; esac ;; + *) echo "Usage: scripts/test-update.sh [minor, such as 0.3]" >&2; exit 2 ;; +esac +# The newest earlier release (of the given minor) with a published image. A release just tagged may still be waiting for +# its approval, and v0.1.0 never had an image. previous= -for tag in $(git tag --list 'v[0-9]*.[0-9]*.[0-9]*' --merged HEAD --sort=-v:refname); do +for tag in $(git tag --list "v${minor:-[0-9]*}.[0-9]*" --merged HEAD --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$'); do [ "$(git rev-parse "$tag^{commit}")" != "$head" ] || continue if docker pull --quiet "ghcr.io/sebhenn/commonage:${tag#v}" >/dev/null 2>&1; then previous=$tag @@ -25,7 +34,7 @@ for tag in $(git tag --list 'v[0-9]*.[0-9]*.[0-9]*' --merged HEAD --sort=-v:refn fi echo "$tag has no published image yet, so trying the release before it." done -[ -n "$previous" ] || { echo "FAILED: no earlier release with an image found. CI must fetch the tags." >&2; exit 1; } +[ -n "$previous" ] || { echo "FAILED: no earlier release ${minor:+of $minor }with an image found. CI must fetch the tags." >&2; exit 1; } echo "Testing the update from $previous to $head." work=$(mktemp -d) @@ -104,6 +113,12 @@ docker compose up -d --no-build >/dev/null 2>&1 wait_for_page migrations_before=$(migrations) +# The backup that release itself makes, with its own scripts. It is restored into the new version at the end. +echo "Making a backup with $previous..." +sh scripts/backup.sh "$work/old-backup" >/dev/null || fail "$previous could not make a backup" +old_backup=$(ls -dt "$work"/old-backup/commonage-* 2>/dev/null | head -n 1) +[ -n "$old_backup" ] || fail "$previous made no backup folder" + echo "Trying an update that fails after upgrading the database..." if sh scripts/update.sh 9.0.1 "$work/backups"; then fail "the update to a broken version reported success" @@ -134,9 +149,17 @@ readable=$(docker compose exec -T db psql --username=commonage --dbname=commonag "select count(*) from \"DataProtectionKeys\" where \"Xml\" like '%requiresEncryption=\"true\"%'" | tr -d '\r') [ "$readable" = 0 ] || fail "$readable login keys in the database are still readable without the key" curl -kfsS https://localhost/search | grep -q "Flood in Mill Street" || fail "the content did not survive the update" +migrations_current=$(migrations) [ "$(ls -d "$work"/backups/commonage-* | wc -l)" -ge 2 ] || fail "no backup was made" echo "Updating to the version it is already on changes nothing..." sh scripts/update.sh 9.0.0 "$work/backups" | grep -q "Already on" || fail "it did not notice the version is current" +echo "Restoring the backup made by $previous into the new version..." +sh scripts/restore.sh --yes "$old_backup" >/dev/null +wait_for_page +[ "$(running_image)" = "$image:9.0.0" ] || fail "the new image does not run after the restore, but $(running_image)" +[ "$(migrations)" = "$migrations_current" ] || fail "the database from the backup was not upgraded ($(migrations) migrations, the new version has $migrations_current)" +curl -kfsS https://localhost/search | grep -q "Flood in Mill Street" || fail "the content of the old backup did not come back" + echo "The update works."