Skip to content

feat: seed Reverb apps from REVERB_SEED_APPS env at boot#1

Merged
sylvesterdamgaard merged 2 commits into
mainfrom
feature/seed-apps-from-env
May 12, 2026
Merged

feat: seed Reverb apps from REVERB_SEED_APPS env at boot#1
sylvesterdamgaard merged 2 commits into
mainfrom
feature/seed-apps-from-env

Conversation

@sylvesterdamgaard
Copy link
Copy Markdown
Contributor

Summary

  • New php artisan reverb:seed-from-env artisan command that reads a JSON array from REVERB_SEED_APPS and upserts rows into reverb_applications. Idempotent on rerun (upsert by id), no-op when env empty.
  • Wired into phpeek-pm.yaml as a oneshot between migrate and php-fpm so pods come up with their app set already provisioned — no race with the admin REST API.
  • DatabaseApplicationProvider updated for Reverb 1.x's new Application constructor signature (acceptClientEventsFrom + rateLimiting args). Legacy enable_client_messages boolean maps to "all" / "none"; override via options.accept_client_events_from for the new "members" mode.
  • composer update refresh — no security advisories, no other behaviour changes.

Enables GitOps-style bootstrap for the Cbox-internal realtime instance (and future per-customer provisioned instances): declare apps in a Sealed Secret, redeploy to rotate keys/secrets/allowed_origins.

Per-entry schema:

Field Type Required Default
id string yes
key string (unique) yes
secret string yes
name string yes
allowed_origins string[] no ["*"]
enable_client_messages bool no false
max_connections int|null no null
max_message_size int no 10000
options object no null

Test plan

  • php artisan test — 61 passing (10 new for the seed command + 51 existing including the regression covered by the Reverb-signature fix)
  • vendor/bin/pint clean
  • Spin up via docker-compose with REVERB_SEED_APPS set, verify rows materialise + admin API lists them
  • Cbox cluster smoke: kubectl apply -f cbox-infra/apps/realtime-internal/, expect pod Ready and /api/apps returning the 4 seeded apps

Pods now bootstrap with their app set already provisioned — no race with
the admin API. Seed runs as a phpeek-pm oneshot after migrate, idempotent
on re-run (upsert by id), and leaves admin-API-created rows untouched.

JSON env schema per entry: id, key, secret, name (required); allowed_origins,
enable_client_messages, max_connections, max_message_size, options (optional).

Enables GitOps-style bootstrap for the Cbox realtime control plane —
declare apps in cbox-infra Sealed Secrets, redeploy to rotate secrets or
allowed origins.
Reverb's Application::__construct gained two args between minor versions
(acceptClientEventsFrom + rateLimiting before options). DatabaseApplicationProvider
now passes them, mapping the legacy enable_client_messages bool to
"all" / "none", or honouring options.accept_client_events_from if set.

Also refreshes laravel/framework, reverb, sail, tinker, carbon, collision,
termwind, pest-plugin-laravel — no security advisories, no other behaviour
changes. Boost guideline files regenerated by post-update hook.
@sylvesterdamgaard sylvesterdamgaard merged commit cbdcc29 into main May 12, 2026
2 of 3 checks passed
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