Skip to content

Phase 6: unsigned distribution — ad-hoc codesign + release runbook + install page#28

Merged
fitz123 merged 3 commits into
mainfrom
phase6-unsigned-distribution
May 21, 2026
Merged

Phase 6: unsigned distribution — ad-hoc codesign + release runbook + install page#28
fitz123 merged 3 commits into
mainfrom
phase6-unsigned-distribution

Conversation

@fitz123
Copy link
Copy Markdown
Owner

@fitz123 fitz123 commented May 21, 2026

Summary

Phase 6 of docs/plans/20260517-pkg-and-pull-control-plane.md — operator-facing distribution flow for the .pkg.

  • client/pkg-build/build.sh — ad-hoc codesign (codesign -s - --force) of bb-vpn, sing-box, xray, and BBVPN.app in the staging tree before pkgbuild. Verifies with codesign --verify --strict (per binary) and --verify --deep --strict (on the .app). Signing happens before xattr -cr since the signature lives in LC_CODE_SIGNATURE / Contents/_CodeSignature/, not as an xattr.
  • docs/release.md — operator runbook covering: prerequisites, make build-pkg, what ad-hoc signing buys (and doesn't buy — Gatekeeper still treats the .pkg as "unidentified developer"), hosting via long-random nginx path (/d/<32-hex>/), per-user install-page generation via envsubst, 9-step token rotation procedure with time estimates, upgrade flow that matches postinstall.sh actual behavior (immediate bb-vpn start for enrolled users), and verification on a fresh Mac.
  • client/pkg-build/install-page-template.html — user-facing install page template with PKG_URL / PKG_NAME / ENROLL_URI / USER_NAME envsubst placeholders. Self-contained CSS, dark-mode aware, robots: noindex, nofollow. Text-only Gatekeeper instructions (no screenshots — intentional per zero-license constraints).
  • README.md + AGENTS.md — added .pkg distribution (Phase 4–6) section + link to docs/release.md so future operators/agents land on the runbook.

The .pkg itself stays unsigned (no Developer ID Installer cert; productbuild --sign with an arbitrary identity would be worse than unsigned).

Pre-PR review

  • /ralph-review (4 phases, all green): 23 fixes applied to address review iter 1 findings (envsubst prereq, upgrade-flow narrative, README/AGENTS cross-refs, redundant pre-sign of inner Mach-O, dead .btn.secondary CSS, sudo on system-domain bootout examples, etc.). Iter 2 critical re-check, smells, codex, and phase 4 safety net all clean.
  • Local gitleaks scan against fitz123/gitleaks-config: clean.

Test plan

  • make build-pkg succeeds end-to-end with the new codesign step
  • codesign -dvv on staged binaries: Signature=adhoc
  • codesign --verify --deep --strict on BBVPN.app: passes silently
  • envsubst < install-page-template.html renders cleanly (placeholders filled, no unfilled ${...} sequences)
  • Operator verifies the runbook on a fresh hosted endpoint (deferred to Phase 7 rollout)

fitz123 added 2 commits May 21, 2026 15:45
- client/pkg-build/build.sh: codesign -s - --force the staged bb-vpn,
  sing-box, xray binaries and BBVPN.app; verify --strict before pkgbuild.
  Strips xattrs AFTER signing (signature lives in LC_CODE_SIGNATURE /
  Contents/_CodeSignature, not xattrs).
- docs/release.md: operator runbook covering build, ad-hoc signing
  semantics, hosting via long-random nginx path, per-user install-page
  generation via envsubst, token rotation procedure (9-step table with
  time estimates), upgrade flow + verification steps on a clean Mac.
- client/pkg-build/install-page-template.html: user-facing install page
  template with PKG_URL/PKG_NAME/ENROLL_URI/USER_NAME envsubst slots.
  Self-contained CSS, dark-mode aware, robots noindex/nofollow.
Copilot AI review requested due to automatic review settings May 21, 2026 12:18
@fitz123
Copy link
Copy Markdown
Owner Author

fitz123 commented May 21, 2026

@copilot please re-review — fixes pushed since the last review

Copy link
Copy Markdown
Contributor

Copilot AI commented May 21, 2026

@copilot please re-review — fixes pushed since the last review

Re-reviewed the latest changes at 614c70e. I re-checked the updated files and reran quick validation (bash -n client/pkg-build/build.sh and install-page envsubst placeholder rendering), and I don’t see any new blocking issues.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements “Phase 6” of the macOS .pkg distribution plan by adding ad-hoc codesigning of staged payload binaries, plus operator/user documentation for building, hosting, and installing the package via a per-user install page.

Changes:

  • Add ad-hoc codesigning + verification for staged payload (bb-vpn, sing-box, xray, BBVPN.app) prior to pkgbuild.
  • Add an operator release runbook describing build/host/distribute flow (including install-page generation and token rotation guidance).
  • Add a user-facing install page template and cross-link the runbook from repo docs (README/AGENTS).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
README.md Adds a .pkg distribution (Phase 4–6) section and links to the operator runbook.
docs/release.md New operator runbook for building, ad-hoc signing, hosting, install-page generation, upgrade flow, and token rotation.
client/pkg-build/install-page-template.html New per-user install page template with envsubst placeholders and Gatekeeper guidance.
client/pkg-build/build.sh Adds ad-hoc codesign + verification step for staged payload prior to packaging.
AGENTS.md Updates .pkg installer section and links to the Phase 6 runbook/template.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread client/pkg-build/install-page-template.html Outdated
Comment thread client/pkg-build/install-page-template.html
Comment thread client/pkg-build/install-page-template.html
Comment thread client/pkg-build/install-page-template.html
Comment thread docs/release.md
Comment thread docs/release.md
Comment thread AGENTS.md Outdated
- install-page Stop/start: use absolute bb-vpn path (sudo strips PATH so
  ~/.local/bin/bb-vpn shortcut isn't on the search path; same fix
  already applied to the enroll Terminal fallback).
- docs/release.md + AGENTS.md: clarify that --deep only applies to
  BBVPN.app; standalone bb-vpn/sing-box/xray Mach-Os are signed
  without --deep (matches what build.sh actually does).

Dismissed (not in Phase 6 must-fix scope): HTML-escape of envsubst
placeholders (operator-controlled inputs, single-user threat model);
token-gen tr -d shortening (pre-existing pattern from
control-plane-bootstrap.md, mirrored in release.md for consistency).
@fitz123
Copy link
Copy Markdown
Owner Author

fitz123 commented May 21, 2026

@copilot please re-review — fixes pushed since the last review

Copy link
Copy Markdown
Contributor

Copilot AI commented May 21, 2026

@copilot please re-review — fixes pushed since the last review

Re-reviewed the latest updates at 34b262f. I re-checked the touched files and reran targeted validation (install-page envsubst render + docs/template checks), and I don’t see any new blocking issues.

@fitz123 fitz123 merged commit ecf9d09 into main May 21, 2026
3 checks passed
@fitz123 fitz123 deleted the phase6-unsigned-distribution branch May 21, 2026 12:36
Copilot stopped work on behalf of fitz123 due to an error May 21, 2026 12:36
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.

3 participants