mirror of
https://github.com/hanzoai/mpc.git
synced 2026-10-30 19:45:28 +00:00
* ci: add id-token: write to caller permissions
Required for hanzoai/.github/.github/workflows/docker-build.yml@main —
without it the workflow_call dies as startup_failure with no jobs
dispatched. Caller permissions are a CEILING.
* go.mod: bump go directive to 1.26.3 (security advisory)
* deps: luxfi/crypto v1.19.0
* deps: luxfi/crypto v1.19.0; refresh stale checksums
* feat(landing): brand-neutral landing/dashboard with per-Host branding
The MPC binary now resolves its visible brand at request time from the
HTTP Host header, so a single image serves mpc.hanzo.ai as "Hanzo MPC",
mpc.lux.network as "Lux MPC", mpc.zoo.network as "Zoo MPC", and every
other host as a generic brand-free "MPC".
What changed:
- New pkg/landing/ subpackage with:
- brand.go: Brand{} struct + FromHost(host) helper + brandTable map
keyed on registered domain (hanzo.ai/lux.network/zoo.network).
Unknown hosts -> zero Brand -> generic page (no brand prefix, no
"Sign In with X ID" suffix, no IAM redirect).
- templates.go: html/template-backed landing/dashboard/auth-callback
HTML. Every visible brand-specific string flows through
{{.Brand.TitlePrefix}}, {{.Brand.SignInLabel}}, {{.Brand.IAMURL}},
{{.Brand.DocsURL}}, {{.Brand.SiteURL}}, {{.Brand.GitHubURL}}.
- landing.go: http.Handler that intercepts GET /, /dashboard,
/auth/callback and delegates everything else to the next handler.
Templates parsed once via sync.Once; per-request execution is
bytes.Buffer-based.
- brand_test.go: per-Host title/body assertions for hanzo.ai (Hanzo),
lux.network (Lux), zoo.network (Zoo), and an unknown host
(generic). Includes a delegation test that ensures unknown paths
fall through to next.
- cmd/mpcd/main.go: wrap apiServer.Handler() in landing.Handler() so
the marketing/dashboard pages render brand-aware while the canonical
/v1/* API surface (signing, keygen, wallets) is unchanged. Same Base
mount, same SQLite, same MPC backend wire protocol.
- cmd/mpcd/main.go: add the missing HasSigningQuorum(threshold) shim on
ConsensusPeerRegistry so the build keeps up with the recent luxfi/mpc
PeerRegistry interface addition (mirrors the consul registry).
No behavioral change to keygen/signing/reshare. /health, /healthz,
/keys, /backup, /keygen on the internal API port (9800) are untouched.
Verified locally:
$ go test ./pkg/landing/... -v
=== RUN TestFromHost --- PASS
=== RUN TestBrandHelpers --- PASS
=== RUN TestHandlerPerHostBranding --- PASS
=== RUN TestHandlerDelegatesUnknownPaths --- PASS
ok github.com/hanzoai/mpc/pkg/landing
To onboard a new white-label deployment, add one row to brandTable in
pkg/landing/brand.go and point its DNS at the cluster — no code change
beyond that table.
* docker: self-sufficient build (clone luxfi/mpc inside builder)
Restores compatibility with the canonical reusable workflow
`hanzoai/.github/.github/workflows/docker-build.yml@main`, which does
a single `actions/checkout@v4` at the workspace root with
`context: .`. The previous Dockerfile assumed the historical CI did
two checkouts and built from the parent dir.
The replace `github.com/luxfi/mpc => ../../lux/mpc` directive is now
satisfied inside the build by `git clone --depth=1 --branch=...
https://github.com/luxfi/mpc.git` into `/build/lux/mpc`, parallel to
`/build/hanzo/mpc` (the COPY of the build context).
Pin: `LUXFI_MPC_REF=v1.14.4` (latest released tag at time of write,
known to satisfy the PeerRegistry.HasSigningQuorum interface). Override
via `--build-arg LUXFI_MPC_REF=<tag>` when reproducibility matters.