website/DEPLOYMENT.md
Website deployment and private storage
website/manage.py stages local test/release catalogs, imports website backups,
selects verified assets, builds pages, prints release upload plans and cleans
managed test work. It does not connect to a server, approve publication or upload.
URL import, deployment receipts/readback and mirror pruning are not implemented.
The important separation is between public site content, retained release state and private corresponding sources. Test previews must not change the release catalog, and deleting test work must not destroy sources or downloads needed to reconstruct a real release.
For the browser metadata contract, see ARCHIVE.md. For application freezing, package validation and tagged provenance, see the release guide. Displaying a version number is not release approval.
Real local snapshot: tagged or untagged
snapshot generates static pages in dist/website/, the selected public catalog
and verified downloads in persistent dist/archive/, and a static-only
dist/website.tar.gz with dist/website.tar.gz.sha256. The tar contains no
archive, packages, manager state or private mirror. Tagged history is retained.
The static renderer uses the selected checkout source; final release pages and
packages must come from the approved annotated tagged input.
python3 website/build.py (or manage.py static) regenerates just the managed
static directory, tarball and checksum. It never updates the archive/catalog.
Use snapshot when selecting a new package listing; use preview to assemble
the retained static and archive outputs for local inspection.
Snapshot also assembles a disposable, public-only combined preview. On an untagged or dirty checkout, select one verified candidate listing:
| 1 | python3 website/manage.py snapshot --id candidate-example |
| 2 | python3 -m http.server 8000 --bind 127.0.0.1 \ |
| 3 | --directory packaging/build/website/current/site |
Never serve the dist/ root: it contains private corresponding sources and
manager state. The combined preview is not a synthetic test and has no test
banner.
Create that listing with the freeze/build, private-mirror import and add/enrich
steps below, or the one-command preparation workflow.
That workflow produces all six supported download choices without hand-written
presentation JSON and keeps candidate and approved tagged inputs separate.
Its embedded source inventory must match the current tracked
checkout bytes and modes, not merely the base commit. Old packages cannot be
relabeled as the current build. Snapshotting does not fetch missing sources or
invent downloads: all selected package/source records must already verify.
For a website-only presentation correction, use
snapshot --id candidate-example --presentation-only. This allows changes
under website/ without rebuilding the packages, but still requires every
other source input byte/mode to match the verified package export. The packages,
downloadable source archive and their original source identity stay unchanged;
only the site renderer/presentation is refreshed. This option cannot bypass an
application, dependency, recipe, bundled artwork or user-manual source change.
The generated catalog carries a separate latest_untagged pointer only when an
untagged candidate is selected. Its files live in dist/archive/untagged/;
releases contains only retained tagged history. Tagged and untagged snapshots
use the same UI: only the latest wording and dark-red untagged distinction
change, while displayed fields vary with the listing. The release panel reads
LATEST UNTAGGED RELEASE, and the homepage identifies that build. Each
untagged snapshot replaces the provisional directory rather than accumulating
staging history. A tagged snapshot contains neither that directory nor the
pointer. Private corresponding sources remain unchanged in dist/mirror/.
On a clean checkout at its version-matched annotated release tag, run
snapshot without --id. The tag must already have verified approved packages
in the release target. This generates a tagged snapshot without provisional
metadata/files. Tag detection does not approve publication or discover packages.
An explicit release add --tag advances the recorded website revision while
preserving history/baselines/assets and selects that tag as latest stable. For
an already-listed approved tag, use:
| 1 | python3 website/manage.py advance --target release --tag vX.Y.Z |
| 2 | python3 website/manage.py snapshot |
Snapshots are local output, not upload authorization. Publishing an untagged
snapshot requires explicit approval and a manual upload; it is presented as
the latest untagged release, distinct from tagged stable releases. For a
tagged-only publication, inspect archive/meta.json for the absence of
latest_untagged and of archive/untagged/ before upload. Tagged-release
imports/plans reject untagged metadata. The existing --target test preview
and --target release commands remain available; neither is silently promoted.
Only manager-owned unchanged public output is replaced. Keep personal files
elsewhere; edited/unknown output blocks replacement. Test cleanup leaves the
public snapshot, release state and mirror intact. After removing scratch with
packaging/clean-build.sh --apply, recreate the combined preview without
rebuilding packages or changing source identity:
| 1 | python3 website/manage.py preview |
| 2 | python3 -m http.server 8000 --bind 127.0.0.1 \ |
| 3 | --directory packaging/build/website/current/site |
Output publication keeps rollback copies in dist/.state/current/recovery/,
outside scratch. A failed write attempts to restore the previous outputs and
inventories. If rollback itself fails, the recovery directory is preserved and
later publication refuses; inspect and restore that state before retrying, never
delete the recovery copy merely to bypass the guard.
Storage and ownership
Paths are relative to the checkout, or to an explicit --root PATH managed root:
| 1 | dist/ |
| 2 | website/ # Generated static site only; no archive/ |
| 3 | website.tar.gz # Static-only site transfer |
| 4 | website.tar.gz.sha256 |
| 5 | archive/ # Persistent public catalog, packages and manuals |
| 6 | mirror/ # PRIVATE deduplicated sources and artifact records |
| 7 | .state/ |
| 8 | release/ # Private editable release catalog/baseline/assets |
| 9 | test/ # Private editable candidate catalog/assets |
| 10 | current/ # Ownership inventories for public outputs |
| 11 | imports/ # Website backups awaiting import |
| 12 | packaging/build/ # ALL disposable build/export work |
| 13 | website/ |
| 14 | test/site/ # TEST PREVIEW, public-only combined tree |
| 15 | release/site/ # Release build preview, public-only combined tree |
| 16 | current/site/ # Combined snapshot preview: website + archive |
Target state retains target.json, metadata/, baseline/ where applicable,
and assets/objects/sha256/<hash>. The init, add, import, enrich and
other target command signatures are unchanged; build --target test|release
now writes its preview under packaging/build/website/<target>/site/.
Edit dist/.state/<target>/metadata/{meta.json,<id>/meta.json}, not generated
preview JSON or dist/archive/ files.
Do not edit private origin/generated records, baselines or inventories.
Presentation text is editable; hashes, sizes and provenance must come from
verified files. The manager rejects undocumented public JSON fields, except
its validated source_identity extension. It does not scan directories or Git
tags to discover or promote releases.
Keep personal files outside managed targets. Unexpected site edits/files block rebuild, remove or clean rather than being silently erased. Generated sites have 0755 directories and 0644 files, including downloads; users set executable bits where installation requires them. Private metadata, assets and ancestors retain private permissions. Copy the generated tree to a traversable serving location instead of opening private parents to a web server.
Serve only a public-only combined preview; upload the static site and the
reviewed public archive independently. Never serve the repository, all of
dist/, .state/ or mirror. Root archive/ is legacy private source retention,
not dist/archive/ or the public site's archive/ URL.
Back up dist/archive/, dist/mirror/ and dist/.state/, including retained
objects and artifact records. These stores are durable outside Git. Release
assets must not depend on disposable builds surviving. A complete public archive
backup can reconstruct release metadata/files through import --target release,
but it cannot restore private mirror sources, test notes or all manager state.
A backup under .state/imports/ is not safely retained until imported/verified
or moved to backup storage. Blanket rm -rf dist is not supported.
Migrate the previous layout
Preserve unknown legacy outputs at the dist/ root: back them up and move them
elsewhere before migration; do not discard them to satisfy ownership checks.
Then run:
| 1 | python3 website/manage.py migrate-layout |
This migrates manager-owned state from dist/deploy/ into .state/, moves
managed previews into build scratch and separates the old snapshot's static
files from its public archive. It verifies managed inventories and refuses
conflicting or unknown destinations. Migration does not discard bytes, alter
package/source identity or change dist/mirror/. Review the resulting public
outputs before serving or upload.
Preview selected candidates
Use Python 3.10+ and an environment equipped with unsquashfs for AppImage or
dpkg-deb for .deb. On restricted hosts use an existing authorized equipped
container; the workflow is not permission to install host tools.
First import the actual package and its sources into the private mirror using the mirror CLI. For example, with an already collected matching archive:
| 1 | A=/path/to/build/Selected.AppImage |
| 2 | AH=$(sha256sum "$A"); AH=${AH%% *} |
| 3 | python3 packaging/source/mirror.py import "$A" --mode candidate \ |
| 4 | --archive "archive/candidate-example/$AH" --mirror-root dist/mirror |
| 5 | python3 website/manage.py init --target test |
| 6 | python3 website/manage.py add --target test --id candidate-example \ |
| 7 | --from-build /path/to/build --asset "$A" --mirror-artifact "$AH" |
| 8 | python3 website/manage.py check --target test --complete |
| 9 | python3 website/manage.py build --target test |
| 10 | python3 -m http.server 8000 --bind 127.0.0.1 \ |
| 11 | --directory packaging/build/website/test/site |
Select exact final files beneath --from-build, which must contain matching
source records. Repeat --asset and --mirror-artifact for multiple packages;
each selected package needs its own imported artifact ID, every specified mirror
package must be selected, and source identities must agree. Additional selected
assets also use explicit --asset flags. No recursive build-output scan occurs.
The mirror is reverified against the embedded package record, not trusted from
a sidecar or an asserted commit in JSON.
Actual download filenames are retained, including Debian underscores and tildes; unsafe path components and symlinks are rejected. The target stores bytes by hash and generates their size, checksum and source facts. Write nonempty release notes in editable metadata; generated entries omit notes until supplied.
Test entries use unmistakable candidate IDs and prerelease channels. Their
assembly timestamp is not a publication timestamp, and the base commit alone
does not describe a dirty candidate. Every preview page has a TEST PREVIEW banner
and title. plan --target test refuses. Building or editing a preview leaves
the release metadata, stable pointer and site untouched.
For an isolated root, pass the same --root PATH to every manager command and
use PATH/dist/mirror for imports. Keep the root if the preview is to survive;
initialization refuses any pre-existing target. The independent site-only
builder remains supported; see website/README.md.
Recover release state from a website backup
A repository clone and website backup suffice for metadata repair; original build directories and private agent logs are not required.
Select the appropriate website source revision.
Obtain a public archive backup using your normal server-access method; the tooling needs no server credentials. Place it under
dist/.state/imports/<name>/archive/with the originalmeta.json, every indexed<tag>/meta.jsonand the referenced downloads/manuals. A static-onlywebsite.tar.gzis not an archive backup.Initialize and import:
sh1 python3 website/manage.py init --target release 2 python3 website/manage.py import --target release \ 3 --from dist/.state/imports/site-backup 4 python3 website/manage.py check --target release
Import validates metadata, preserves its bytes as a baseline and retains verified assets by hash. Existing local work is not silently overwritten. Different bytes with the same filename remain distinct objects; missing/wrong bytes are errors, not invitations to find a similarly named local build.
A public backup does not restore private dependency sources. Restore the mirror separately, or use artifact-derived upstream retrieval. Unavailable sources remain an explicit gap. Backup metadata itself is not cryptographic proof of source provenance.
Metadata-only import
If downloads are unavailable, add --metadata-only to import. This retains all
entries while recording assets as remote-only / not locally verified. It
permits preview and metadata-only plans, not complete/offline site copies.
check --complete and full plans fail until required bytes are present. A
configured public URL is not an implicit substitute for retained local assets.
Full imports separately inventory and retain the two explicitly referenced
manual/manual_markdown paths when not listed as downloads. They do not crawl
HTML dependencies such as images or stylesheets. Metadata-only imports report
missing manuals without inventing hashes.
Starting an empty catalog
init --target release creates:
| 1 | {"schema_version": 1, "latest_stable": null, "releases": []} |
Use that as a genuinely new catalog, not as a replacement for inaccessible live metadata. Missing metadata is not evidence that no releases exist.
Repair public metadata
Start from the current imported baseline, edit release metadata/ JSON, then:
| 1 | python3 website/manage.py check --target release |
| 2 | python3 website/manage.py plan --target release --metadata-only |
Plans print changed public paths, old/new hashes and reasons to stdout; they do not upload or record deployment. Labels, descriptions and installation notes do not require rebuilding binaries. Changing recorded file facts requires verification of the actual published bytes; never substitute a new binary under an old published URL.
Check the live baseline before upload. If it changed since import, merge rather than overwrite. Upload only the reviewed set using your normal deployment method; a delete-sync from a metadata-only tree could erase old binaries. Upload referenced metadata before the top-level catalog, replacing JSON atomically where possible. Read back public files and verify manually afterward. The tool does not maintain deployment receipts.
Stage an approved release
After approval of the tagged source and validation of its final packages, the
release target's recorded site_revision, current checkout HEAD and package
source commit must all match. Use a clean checkout of that approved commit.
init records HEAD and refuses to overwrite existing state. An explicit
add --tag validates the clean version-matched annotated tag and verified
package identity before advancing site_revision; history, baselines and
retained assets stay intact. advance --target release --tag vX.Y.Z supports an
already-listed approved tag. Never delete/reinitialize the target to change
revisions.
| 1 | python3 website/manage.py add --target release --tag vX.Y.Z \ |
| 2 | --from-build /path/to/release-build --asset /path/to/release-build/Selected.deb \ |
| 3 | --mirror-artifact VERIFIED_PACKAGE_SHA256 |
| 4 | python3 website/manage.py check --target release --complete |
| 5 | python3 website/manage.py build --target release |
| 6 | python3 website/manage.py plan --target release |
Import final packages into the mirror first. The manager checks tagged source and package identities, retains selected downloads and refuses candidates, inconsistent source or replacement of an existing release. Adding an approved version tag selects it as latest stable. Notes, compatibility, installation text and the actual publication timestamp still need maintainer review. Staging an entry is not upload approval.
There is no test-to-release promotion: build final assets from the approved tag.
Public site/manual builds must use the recorded appropriate source revision;
release build checks Git HEAD and a clean tracked checkout. Missing source is
an error, not permission to use another revision. Metadata-only repair does not
require the native compiler or a full site rebuild.
Upload the reviewed dist/archive/<tag>/ to archive/<tag>/ first and replace
the public archive/meta.json last. Generate the final current outputs with
snapshot at the approved tag. Transfer dist/website/ or its static-only
website.tar.gz independently of packages, checking website.tar.gz.sha256
after transfer. Never delete-sync a static-only upload over the live archive;
old release directories/manuals stay intact. Transfer only verified public
content, never .state/, baselines, mirror data or logs. Follow
ARCHIVE.md for caching and publication checks.
Enrich an existing verified listing
enrich updates one test or release entry's presentation and can attach a source-matched
AppImage installer and local Arch source kit. It does not promote or publish,
and is not a workflow for provenance of a prebuilt Arch binary. Start from an
entry added with verified matching mirror packages; do not replace its ID with
add or bypass a missing mirror.
For the supported release recipe, use tracked automatic presentation instead
of creating JSON. Select AppImage, deb and Arch binary at add, then attach
the verified installer/kit/source and generate all six choices in one step:
| 1 | python3 website/manage.py enrich --target test --id candidate-example \ |
| 2 | --arch-dir /path/to/frozen/arch-output --auto-presentation --notes 'Initial release' |
| 3 | python3 website/manage.py check --target test --complete |
Initial release is the exact default; --notes supplies replacement text.
Automatic presentation refuses incomplete, duplicate, unknown or wrong-version
filenames rather than guessing roles/instructions. It supplies labels, explicit
roles, platforms, architectures, compatibility limits and fenced sh commands;
no source facts, filenames, sizes or hashes are inferred or changed. Its Arch-kit
commands enter splotch-blot-VERSION-arch-kit/, not the candidate ID or archive
filename. Omit --arch-dir to regenerate presentation for an already attached
complete set. For release entries use --target release --id vX.Y.Z; this does
not convert candidate provenance into tagged provenance. The release driver
also verifies the actual Arch binary's embedded source/package identity; plain
enrich verifies the kit, not a prebuilt binary.
When invoking a frozen manager, pass both --root /actual/checkout for managed
storage and --checkout-root /actual/checkout for Git identity/input comparison.
Rendering and automatic presentation still use the frozen manager's source
tree. For an intentional candidate snapshot at a clean tagged checkout, pass
snapshot --candidate --id candidate-example; this keeps the source mode
explicit rather than treating the clean tag as candidate approval.
A presentation JSON file may contain notes and a files mapping keyed by
exact selected filename. Values may set label, kind, role, platform,
architecture, requirements and install (plain text). They cannot change
filenames, sizes, hashes, source identity, manuals or generated facts. State
compatibility limits rather than inferring them from the build distro.
Use explicit fenced shell blocks in install to separate copyable commands
from explanatory paragraphs; see the metadata format. Commands
and optional install/removal actions must not be mixed into prose on one line.
| 1 | python3 website/manage.py enrich --target test --id candidate-example \ |
| 2 | --presentation /path/to/listing.json --arch-dir /path/to/frozen/arch-output |
| 3 | python3 website/manage.py check --target test --complete |
| 4 | python3 website/manage.py build --target test |
--arch-dir is first-attachment only; omit it for later text-only edits. It
requires PKGBUILD, .SRCINFO, source-input.json and the named source tarball
from one frozen Arch output. Commit/export/version must match the mirror source.
Archive contents must match declared files exactly, without links, duplicates
or traversal. The supported recipe is the project's literal, single-package
PKGBUILD, not arbitrary dynamic/split-package makepkg code:
- Only the two actual source/provenance checksums and one numeric
pkgrelmay differ from the recipe in the verified source export. .SRCINFOmust describe one matching pkgbase/pkgname with base sources, checksums, version, revision and literal recipe metadata. Package overrides may only repeat identical effective supported values; comments/blank lines are harmless. Conflicting, duplicate or undeclared inputs are rejected.- Verification never executes a submitted recipe. Retained kits are rechecked semantically on complete checks/rebuilds, not just by attachment digest.
The installer is extracted from the verified export, never branch HEAD. The kit contains recipe, metadata, source/provenance and a README; it is not an AUR-ready recipe or pacman binary. Helper, kit and application source are independently retained/checksummed. Other entries, release state, original builds and mirror remain unchanged. Failed later edits retain matched objects: resolve the error, not by cleaning real data. On restricted hosts run in the authorized equipped environment with project inputs read-only and required target/lock paths writable.
Mirror retention
The mirror stores exact source bytes once per hash across packages/releases, plus each artifact's embedded record and the original package needed for offline verification. A tarball of dependencies alone cannot prove what a binary shipped. Mirror imports are private retention, not approval or public mirroring. See the source guide for import, verification, bundle commands and locking.
Never edit shared objects in place. Site staging may use verified reflinks or immutable hardlinks, with copy fallback; metadata is independently written. Deleting a test asset must leave the mirror's reference intact. Portable site transfers contain regular files, not workstation symlinks. Deduplication does not promise zero duplication in backups or binary reproducibility.
Per-artifact root archive/ collections remain supported read-only mirror-import
inputs. Import does not move/delete them. No bulk migration, age-based eviction
or automatic pruning is performed; pruning needs its own explicit retention
choice, verified backup and approval.
Clean and remove test work
Both operations preview by default and recheck inputs when --apply is used:
| 1 | python3 website/manage.py clean |
| 2 | python3 website/manage.py clean --apply |
| 3 | python3 website/manage.py remove --target test --id candidate-example |
| 4 | python3 website/manage.py remove --target test --id candidate-example --apply |
Manager clean removes only inventoried test state and its managed preview;
remove removes one test listing. Neither is the build-scratch cleaner. Both
preserve dist/archive/, dist/website/, static transfer files,
dist/.state/release/ and dist/mirror/. Pending imports, unknown files and
unrecognized legacy outputs require inspection, not sweeping removal. Root
archive/, source/Git, container images and external caches are outside scope.
For all disposable builds, freezes and previews, use:
| 1 | ./packaging/clean-build.sh # dry-run |
| 2 | ./packaging/clean-build.sh --apply # packaging/build only; stop builds first |
| 3 | python3 website/manage.py preview # regenerate the current combined preview |
This does not delete public packages/catalog, private editable catalogs or mirror
records. No build/export examples should use persistent dist/ storage as
scratch; default freezes and package builds use packaging/build/.
Before either deletion, retained release assets and mirror verification inputs must be independently present and valid under protected roots. Missing/corrupt retained material blocks cleanup even when test work still has those bytes. Only an explicitly recorded metadata-only import permits missing local downloads; older records are not silently treated as remote-only. Unknown files, notes, unreferenced assets and interrupted site stages under the test target require inspection rather than sweeping removal.
Cleanup rejects symlinks and changed inputs and excludes cooperating writers; a dry run is not durable authorization. Partial errors are reported and safe retry is permitted. Keep using managed inventories, not a blanket deletion.
remove deletes one entry's metadata, generated downloads and now-unreferenced
test assets. It keeps other tests, all real-release state, mirrored sources and
retained packages. Original builds/evidence are outside this command. Space
reported as reclaimable must account for shared bytes. Catalog references are
removed before files so interruption can leave harmless leftovers, not broken
links. The last removal yields an empty test catalog; an absent ID is a no-op.
remove --target release refuses: withdrawing a public release is separate work.
After cleanup, rebuild/check the release site from its retained state and recorded source revision as needed, then initialize a new test target. Deleted test entries are not rediscovered automatically from the mirror; recreating one requires retained candidate inputs or a new build with a new identity. The mirror does not retain unsaved test notes or every compiler/build cache.