-
Notifications
You must be signed in to change notification settings - Fork 484
fix: setup least priviliged user for realtime #5632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -858,6 +858,8 @@ EOF | |
| fmt.Sprintf("DB_PORT=%d", dbConfig.Port), | ||
| "DB_USER=" + utils.SUPERUSER_ROLE, | ||
| "DB_PASSWORD=" + dbConfig.Password, | ||
| "DB_USER_REALTIME=supabase_realtime_admin", | ||
| "DB_PASS_REALTIME=" + dbConfig.Password, | ||
|
Comment on lines
+861
to
+862
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For the v2.109.1 Realtime image bumped in this change, the runtime connection username is still taken from Useful? React with 👍 / 👎.
Comment on lines
+861
to
+862
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When this env is present, Realtime v2.109.1 seeds Useful? React with 👍 / 👎.
Comment on lines
+861
to
+862
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When users keep a supported Useful? React with 👍 / 👎. |
||
| "DB_NAME=" + dbConfig.Database, | ||
| "DB_AFTER_CONNECT_QUERY=SET search_path TO _realtime", | ||
| "DB_ENC_KEY=" + utils.Config.Realtime.EncryptionKey, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,7 +50,7 @@ export const DEFAULT_VERSIONS: VersionManifest = { | |
| postgrest: "14.5", | ||
| auth: "2.188.0-rc.15", | ||
| "edge-runtime": "1.73.13", | ||
| realtime: "2.78.10", | ||
| realtime: "2.109.1", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Changing Useful? React with 👍 / 👎. |
||
| storage: "1.41.8", | ||
| imgproxy: "v3.8.0", | ||
| mailpit: "v1.22.3", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On existing local volumes that have already run Realtime's 202404 tenant migration,
supabase_realtime_adminalready exists but was created asNOLOGIN NOREPLICATION; thisIF NOT EXISTSpath skips the new LOGIN/REPLICATION attributes and only changes the password. After the startup env switches runtime connections to that role, upgraded stacks fail to authenticate assupabase_realtime_admin, so alter the role attributes even when it already exists and mirror that in the stack init copies.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The mentioned "202404 tenant migration" is https://github.com/supabase/realtime/blob/main/lib/realtime/tenants/repo/migrations/20240401105812_create_realtime_admin_and_move_ownership.ex but that role is being updated by a later migration https://github.com/supabase/realtime/blob/main/lib/realtime/tenants/repo/migrations/20260606120000_setup_supabase_realtime_admin.ex which does
ALTER ROLE supabase_realtime_admin WITH NOINHERIT CREATEROLE LOGIN REPLICATIONThat migration is currently gated behind a feature flag in Realtime while we rollout the new permission schema but it's safe to create to
CREATE ROLE supabase_realtime_admin WITH NOINHERIT CREATEROLE LOGIN REPLICATIONhere.