Post

Scoped AFFiNE Image Publication in Harbor Mirroring

Scoped AFFiNE Image Publication in Harbor Mirroring

I added a scoped image publication for AFFiNE to the Harbor mirroring pipeline, ensuring the service’s exact image digest is verified before rollout.

Implementation: Adding AFFiNE to Harbor Mirroring

I extended .github/workflows/harbor-mirror.yml to include affine in the options list and the IMAGE_SCOPE case statement, then added a new job step that runs bash scripts/ci/harbor-publish.sh mirror-affine --tailscale. A new JSON file scripts/config/harbor-affine-images.json defines the AFFiNE images to be mirrored, and the documentation docs/harbor-image-mirroring.md now contains a dedicated section showing the command line invocation with the required image_scope=affine flag.

Verification: Tests and Policy

I updated the Rego policy policy/workflows.rego and its test counterpart policy/workflows_test.rego to allow the affine scope, and added a case for affine in the policy logic. The test script scripts/ci/harbor-publish-test.py now loads the AFFiNE manifest from scripts/config/harbor-affine-images.json and validates that the workflow includes affine in the permitted scopes, ensuring the new step is exercised correctly.

Platform Engineering: Reusable Scoped Publication Pattern

This change establishes a reusable pattern for scoped image publication: define a dedicated scope, extend the workflow to recognize it, add a targeted publish script, update policy and tests, and document the exact command. The same approach can be applied to other internal services that need to publish a specific image digest while keeping the broader pipeline locked down, echoing the least‑privilege principles demonstrated in the earlier Tailscale ACL updates.

This post is licensed under CC BY 4.0 by the author.