Fix ActivityPub first-run lifecycle #279

Merged
erik merged 1 commit from fix/task-8352da0e-activitypub-first-run-lifecycle into main 2026-08-26 14:12:17 -05:00
Owner

Summary

Allow fresh production sites to start with ActivityPub enabled while setup remains safely gated, then activate federation immediately when setup is published.

Task

task-8352da0e

Changes

  • Add a site-local ActivityPub lifecycle coordinator with setup-aware startup validation and idempotent worker activation.
  • Wire setup completion to activate the worker after actor and key creation.
  • Cover fresh, corrupt, disabled, gated, generated-site, protocol-route, and delivery behavior.
  • Document production first-run verification and porting steps for existing generated sites.

Testing

  • Unit tests added/updated
  • Manual testing performed with make dev
  • ./scripts/pre-pr.sh

Checklist

  • ./scripts/pre-pr.sh passes
  • Documentation updated
  • No unrelated changes included
## Summary Allow fresh production sites to start with ActivityPub enabled while setup remains safely gated, then activate federation immediately when setup is published. ## Task task-8352da0e ## Changes - Add a site-local ActivityPub lifecycle coordinator with setup-aware startup validation and idempotent worker activation. - Wire setup completion to activate the worker after actor and key creation. - Cover fresh, corrupt, disabled, gated, generated-site, protocol-route, and delivery behavior. - Document production first-run verification and porting steps for existing generated sites. ## Testing - [x] Unit tests added/updated - [x] Manual testing performed with `make dev` - [x] `./scripts/pre-pr.sh` ## Checklist - [x] `./scripts/pre-pr.sh` passes - [x] Documentation updated - [x] No unrelated changes included
fix: activate federation after first-run setup
All checks were successful
CI / build-lint-test (pull_request) Successful in 2m14s
d84710fea7
Task: #task-8352da0e
Author
Owner

Review summary

  • Verdict: approved
  • Scope: The changes stay in generated-site template lifecycle code and associated template packaging, tests, and documentation.
  • Quality: Startup validation, setup gating, worker activation, and disabled behavior are explicit and covered by tests.
  • Verification: ./scripts/pre-pr.sh passed locally and Forgejo CI run #459 completed successfully.

Acceptance criteria

  • Met: A fresh production database accepts enabled ActivityPub with a safe public HTTPS origin while setup is incomplete.
  • Met: Public content, federation routes, and the queue worker remain gated before setup completion.
  • Met: Setup creates/selects the actor, generates keys, marks setup complete, and invokes idempotent worker activation without restart.
  • Met: Post-setup tests and existing included integration coverage exercise WebFinger, actor, inbox, outbox, and outbound delivery behavior.
  • Met: Completed databases missing the primary actor or signing keys fail with clear errors.
  • Met: Unsafe production origins are rejected before the app is served.
  • Met: Explicitly disabled ActivityPub retains a stopped worker and existing behavior.
  • Met: Template lifecycle tests are included in generated sites and template artifacts.
  • Met: Documentation explains production first run, endpoint/delivery verification, and porting steps for existing generated sites.

Findings

  • Blocking issues: none.
  • Warnings: none.
### Review summary - Verdict: **approved** - Scope: The changes stay in generated-site template lifecycle code and associated template packaging, tests, and documentation. - Quality: Startup validation, setup gating, worker activation, and disabled behavior are explicit and covered by tests. - Verification: `./scripts/pre-pr.sh` passed locally and Forgejo CI run #459 completed successfully. ### Acceptance criteria - [x] **Met:** A fresh production database accepts enabled ActivityPub with a safe public HTTPS origin while setup is incomplete. - [x] **Met:** Public content, federation routes, and the queue worker remain gated before setup completion. - [x] **Met:** Setup creates/selects the actor, generates keys, marks setup complete, and invokes idempotent worker activation without restart. - [x] **Met:** Post-setup tests and existing included integration coverage exercise WebFinger, actor, inbox, outbox, and outbound delivery behavior. - [x] **Met:** Completed databases missing the primary actor or signing keys fail with clear errors. - [x] **Met:** Unsafe production origins are rejected before the app is served. - [x] **Met:** Explicitly disabled ActivityPub retains a stopped worker and existing behavior. - [x] **Met:** Template lifecycle tests are included in generated sites and template artifacts. - [x] **Met:** Documentation explains production first run, endpoint/delivery verification, and porting steps for existing generated sites. ### Findings - Blocking issues: none. - Warnings: none.
erik merged commit acca86ce6c into main 2026-08-26 14:12:17 -05:00
erik deleted branch fix/task-8352da0e-activitypub-first-run-lifecycle 2026-08-26 14:12:17 -05:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
erik/slugkit!279
No description provided.