Skip to content

kernel: read the release public key and sync host from AppConfig - #423

Open
johanhal wants to merge 1 commit into
nyblnet:mainfrom
betamobility:upstream-pr/appconfig-lift
Open

kernel: read the release public key and sync host from AppConfig#423
johanhal wants to merge 1 commit into
nyblnet:mainfrom
betamobility:upstream-pr/appconfig-lift

Conversation

@johanhal

@johanhal johanhal commented Sep 8, 2026

Copy link
Copy Markdown

kernel: read the release public key and sync host from AppConfig

kernel/src/update.ts hardcodes PUBLIC_KEY_JWK and kernel/src/sync/online.ts hardcodes DEFAULT_SYNC_HOST. Both are per-publisher values, not per-kernel ones: a downstream build that runs its own signed release channel and its own relay has to patch the kernel to change them, and then carries that patch across every merge.

This adds two optional fields to AppConfig:

  • publicKeyJwk — the P-256 public JWK manifests and pack indexes are verified against. Absent, update.ts uses the embedded platform key exactly as today.
  • syncHost — the default relay host. Absent, sync/online.ts uses DEFAULT_SYNC_HOST exactly as today. The bento-sync-url localStorage dev override still wins over both.

Nothing changes for the apps in this repo: none of them set the fields, and every existing rig passes unchanged. test-release-channel.mjs still swaps the embedded constant by regex, because the constant is still there as the default.

Why optional and why in AppConfig: app.ts already says only three values are app-specific across the kernel. These two are publisher-specific, which is the same axis, and configureApp() is the one call every app already makes before any kernel module runs. syncHost() reads the config lazily and tolerates an unconfigured kernel, so rigs that never call configureApp() are unaffected.

Verified: tsc -b, tsc -p ../kernel, npm run build:single, shell-gate.mjs, test-release-channel.mjs --app slides, test-sync-session.ts, test-relay-protocol.ts, test-offline.ts, test-storage.ts, test-autosave.ts.

Two optional AppConfig fields, publicKeyJwk and syncHost, so a build that
runs its own signed release channel and relay configures them per app
instead of patching the kernel. Absent, the embedded platform key and
DEFAULT_SYNC_HOST apply exactly as before; no app in this repo sets them.
johanhal added a commit to betamobility/slides that referenced this pull request Sep 8, 2026
…without R2 (#2)

README gains a Beta "Releasing" section (dated versions and why, gh
set-default, Pages direct upload, the .html 308) and links the two upstream
PRs (nyblnet#423, nyblnet#424). AGENTS.md's upstream-merge conflict list adds
slides/package.json and CHANGELOG.md. wrangler.toml drops the R2 binding per
plan U2: binding it means a paid subscription on the account, which is the
maintainer's decision, and the inline fallback is upstream-supported.


Claude-Session: https://claude.ai/code/session_01SQN76RTkurkAAxMMvnwfbt

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
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