Skip to content

feat(site): seed index and signatures locally - #182

Merged
abn merged 1 commit into
mainfrom
feat/build-site-seed-dir
Nov 8, 2026
Merged

abn merged 1 commit into
mainfrom
feat/build-site-seed-dir

Conversation

@abn

@abn abn commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Stacked on #181. Refs #180.

Problem

--index-file removed the Pages round trip for the index, but backfillSignatures still fetched
<pages-url>/sigs for every seeded image. A build from a checked-out site was therefore not
offline: it still stalled when Pages was unavailable and emitted one warning per missing signature.

Change

  • Add --seed-dir <site-dir> (env AETHERPAK_SEED_DIR) to build-site. It seeds the index from
    <site-dir>/index/static and the per-image signature tree from <site-dir>/sigs, then skips the
    Pages backfill entirely.
  • --index-file keeps its index-only semantics; the two flags are mutually exclusive.
  • Seeded lookaside metadata (key.asc, signing.json) is not copied: the build generates its own.
    Record signatures and the current key still win over seeded files.
  • A signed build warns, listing up to five refs, when indexed images have no signature-1 anywhere.
    Unsigned builds stay silent.
  • Path safety: the seed root and lookaside are resolved with EvalSymlinks, the lookaside must stay
    inside the seed site, non-regular files are rejected, and a hardlinked destination is never
    truncated.
  • A dry run validates the seed path without writing anything.
  • Passing the same path for --seed-dir and --site-dir rebuilds in place.

Testing

  • Dual-channel seed with signatures: both refs survive, the other channel's signature is copied, a
    record signature overrides the seed, and no Pages request is made.
  • Signed seed without signatures proceeds and logs the missing-ref warning; unsigned seed without
    signatures proceeds silently.
  • Root key.asc/signing.json from the seed are not copied.
  • Escaping lookaside, non-regular seed file, non-directory lookaside, missing index, in-place seed,
    and dry-run behavior.
  • copyFile hardlink safety and missingSignatureRefs dedupe, fallback, sha512, and containment
    cases.
  • go test ./..., go vet ./..., and make lint pass.

@abn
abn added this pull request to stack #183 November 8, 2026 15:31
@abn
abn added this pull request to the merge queue Nov 8, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 8, 2026
Base automatically changed from fix/build-site-seed-index to main November 8, 2026 15:36
--index-file skipped the Pages index fetch but still backfilled
signature lookaside files from Pages, so a build from a checked-out
site was not offline. Add --seed-dir to seed the index and the sigs
from a local site and skip the Pages backfill.
@abn
abn force-pushed the feat/build-site-seed-dir branch from eed8f8b to 10d1d8e Compare November 8, 2026 15:36
@abn
abn added this pull request to the merge queue Nov 8, 2026
Merged via the queue into main with commit 54ffc2b Nov 8, 2026
6 checks passed
@abn
abn deleted the feat/build-site-seed-dir branch November 8, 2026 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant