Repository navigation
Migrate self-hosted Supabase and fix Auth TLS trust - #1508
Conversation
|
🪓 PR closed, deleted preview. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 39abb1d481
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2584871f9c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 504f7c0651
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Why
The bundled self-hosted stack uses unavailable MinIO images (or main's pgsty replacement), and its Auth image accepts certificate chains affected by the eMudhra compromise. Move deployments to a pinned upstream bundle with an upstream Auth TLS fix and a tested migration procedure.
Architecture
Deployment files and operating scripts come from Supabase
self-hosted/v0.8.3, verified against commitbc27d2661edd09a5d0b8d76ce33da6d4071a756e, outside the application checkout. It supplies Postgres 17, Envoy and Storage 1.81 with persistent local files. reVISit owns setup SQL, GitHub configuration, migration helpers and instructions.A required Compose override pins
supabase/gotrue:v2.198.0-rc.25by digest, including Supabase's Go 1.27.3 fix. The bundle's stable Auth 2.197 predates the fix. GitHub remains optional; the fixed Auth override applies to every deployment and persists through recreation. No custom Auth build is required.Migration preserves existing signing/encryption secrets, sessions, application records, bucket settings and access policies. Original object bytes are exported through the old Storage API and installed with their versioned paths and HTTP metadata; database object records are not rewritten. Checksums, truncated responses, concurrent metadata changes and S3 file/directory conflicts are checked before upgrading the database. Atomic installs support retries after interruption, disk exhaustion or failed metadata writes.
A small guarded helper prepares a copy of the pinned upstream database-upgrade script. It selects this database's encryption volume, respects the saved Auth/GitHub overrides on first startup, and treats required migration failures as fatal. The original upstream script remains unchanged. Unexpected upstream source is rejected before producing a prepared copy.
User-facing impact
Existing self-hosted operators must follow the migration guide during a maintenance window. Updating the application checkout alone does not update running services. New deployments follow the setup guide; hosted Supabase does not require this migration.
Validation
At
5dc9fc5b53e9716efb8735ba5744e707bf5b9d81:Rehearsals used synthetic data on Docker Desktop's Linux VM, Linux-volume paths and native Auth/Postgres images. Ports, checkout paths and noninteractive/root invocation were adapted for the fixture; the actual guide commands and prepared upgrade script were exercised without a volume-discovery shim. Full container removal/recreation and an actual Docker VM reboot passed. The kernel boot ID changed; all 11 services recovered healthy, all 29 current objects and database metadata matched the post-browser export, application/policy/Vault snapshots matched, and existing access/refresh tokens and password login passed. Unrelated containers retained their original stopped states and restart policies. Live external GitHub credentials/callback, SMTP delivery and hardware capture were not tested. The user confirmed live OAuth/SMTP are unavailable locally.
Risk and rollout
Pause all writes; make coordinated external database, object-store, encryption and configuration backups; save the original object-store images; rehearse restoration before changing a deployment. The guide checks Linux extended attributes and export compatibility before the database upgrade, checks required database migrations/grants and reindexes, compares application/bucket/policy snapshots and verifies every exported object before acceptance. Never regenerate existing keys or run fresh setup SQL during migration.
Storage's schema migration is one-way: rollback requires coordinated backups and loses subsequent writes. Rollback restores vulnerable Auth, so the documented certificate mitigation must succeed before normal operation and must be reapplied after recreation. File storage requires Linux extended attributes and does not supply multi-host failover. Custom databases/extensions/S3 layouts need separate rehearsal. Move retained copies and the upgrade binary cache outside the deployment before upstream updates.
Auth remains a release candidate; review a patched stable replacement before removing the override. Verify the deployed GitHub callback and SMTP settings during the deployment smoke test before reopening traffic.