From 10a04de1e9c0e92adc213f8eec008a4b97138c67 Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Thu, 5 Jan 2023 13:05:00 +0800 Subject: [PATCH] fix: bump realtime to 2.0 --- internal/start/start.go | 5 +++++ internal/utils/misc.go | 2 +- internal/utils/templates/initial_schemas/15.sql | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/internal/start/start.go b/internal/start/start.go index 6a3367da6b..a7615c6511 100644 --- a/internal/start/start.go +++ b/internal/start/start.go @@ -251,6 +251,7 @@ EOF "DB_NAME=postgres", "DB_AFTER_CONNECT_QUERY=SET search_path TO _realtime", "DB_ENC_KEY=supabaserealtime", + "API_JWT_SECRET=" + utils.JWTSecret, "FLY_ALLOC_ID=abc123", "FLY_APP_NAME=realtime", "SECRET_KEY_BASE=EAx3IQ/wRG1v47ZD4NE4/9RzBI8Jmil3x0yhcW4V2NHBP6c2iPIzwjofi2Ep4HIG", @@ -258,6 +259,10 @@ EOF "ENABLE_TAILSCALE=false", "DNS_NODES=''", }, + Cmd: []string{ + "/bin/sh", "-c", + "/app/bin/migrate && /app/bin/realtime eval 'Realtime.Release.seeds(Realtime.Repo)' && /app/bin/server", + }, }, container.HostConfig{ RestartPolicy: container.RestartPolicy{Name: "always"}, diff --git a/internal/utils/misc.go b/internal/utils/misc.go index c1eeec9744..d3621f874d 100644 --- a/internal/utils/misc.go +++ b/internal/utils/misc.go @@ -41,7 +41,7 @@ const ( // Update initial schemas in internal/utils/templates/initial_schemas when // updating any one of these. GotrueImage = "supabase/gotrue:v2.36.1" - RealtimeImage = "supabase/realtime:v1.0.0-rc.11" + RealtimeImage = "supabase/realtime:v2.0.0" StorageImage = "supabase/storage-api:v0.26.1" // Should be kept in-sync with DenoRelayImage DenoVersion = "1.28.0" diff --git a/internal/utils/templates/initial_schemas/15.sql b/internal/utils/templates/initial_schemas/15.sql index f252001fdf..50ff1ecb40 100644 --- a/internal/utils/templates/initial_schemas/15.sql +++ b/internal/utils/templates/initial_schemas/15.sql @@ -1331,7 +1331,7 @@ ALTER TABLE ONLY auth.refresh_tokens ALTER COLUMN id SET DEFAULT nextval('auth.r -- Data for Name: extensions; Type: TABLE DATA; Schema: _realtime; Owner: postgres -- -INSERT INTO _realtime.extensions (id, type, settings, tenant_external_id, inserted_at, updated_at) VALUES ('935b3773-e37c-4b3e-baa1-2309ddb697cf', 'postgres_cdc_rls', '{"region": "us-east-1", "db_host": "I4YigNuoYSZbe+Xs4vInbw==", "db_name": "sWBpZNdjggEPTQVlI52Zfw==", "db_port": "MqmbZ5ZiXXFlSy8FeFYPAQ==", "db_user": "sWBpZNdjggEPTQVlI52Zfw==", "slot_name": "supabase_realtime_replication_slot", "ip_version": 4, "db_password": "sWBpZNdjggEPTQVlI52Zfw==", "publication": "supabase_realtime", "poll_interval_ms": 100, "poll_max_changes": 100, "poll_max_record_bytes": 1048576}', 'realtime-demo', '2022-11-14 23:04:49', '2022-11-14 23:04:49'); +INSERT INTO _realtime.extensions (id, type, settings, tenant_external_id, inserted_at, updated_at) VALUES ('1d784f3e-9e48-45ac-9d56-50f8b39d5c64', 'postgres_cdc_rls', '{"region": "us-east-1", "db_host": "ABK7kBu27y/PVdL10i/b+A==", "db_name": "sWBpZNdjggEPTQVlI52Zfw==", "db_port": "+enMDFi1J/3IrrquHHwUmA==", "db_user": "sWBpZNdjggEPTQVlI52Zfw==", "slot_name": "supabase_realtime_replication_slot", "ip_version": 4, "db_password": "sWBpZNdjggEPTQVlI52Zfw==", "publication": "supabase_realtime", "poll_interval_ms": 100, "poll_max_changes": 100, "poll_max_record_bytes": 1048576}', 'realtime-dev', '2023-01-05 05:01:34', '2023-01-05 05:01:34'); -- @@ -1354,7 +1354,7 @@ INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (202211021 -- Data for Name: tenants; Type: TABLE DATA; Schema: _realtime; Owner: postgres -- -INSERT INTO _realtime.tenants (id, name, external_id, jwt_secret, max_concurrent_users, inserted_at, updated_at, max_events_per_second, postgres_cdc_default) VALUES ('98d09d90-612d-4a69-8c84-e8e5ecbaed6d', 'realtime-demo', 'realtime-demo', 'iNjicxc4+llvc9wovDvqymwfnj9teWMlyOIbJ8Fh6j2WNU8CIJ2ZgjR6MUIKqSmeDmvpsKLsZ9jgXJmQPpwL8w==', 300, '2022-11-14 23:04:49', '2022-11-14 23:04:49', 100, 'postgres_cdc_rls'); +INSERT INTO _realtime.tenants (id, name, external_id, jwt_secret, max_concurrent_users, inserted_at, updated_at, max_events_per_second, postgres_cdc_default) VALUES ('1b4a2e9b-e69c-40dc-ba5b-337c0eed2c88', 'realtime-dev', 'realtime-dev', 'cor19x6wYudqK/HY8tKJOBoA0KD/zxM/SxxkI1zPOvSCs67x4q75+0yV07SWdm0T', 200, '2023-01-05 05:01:34', '2023-01-05 05:01:34', 100, 'postgres_cdc_rls'); --