Skip to content

Commit 95400c0

Browse files
committed
Switch to artemis-api.toit.io as server URL.
1 parent 53cf1cb commit 95400c0

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ test-supabase: install-pkgs rebuild-cmake download-sdk
6262
(cd build && ninja check_supabase)
6363

6464
# From https://app.supabase.com/project/voisfafsfolxhqpkudzd/settings/auth
65-
ARTEMIS_HOST := voisfafsfolxhqpkudzd.supabase.co
65+
ARTEMIS_HOST := supabase-api.toit.io
6666
ARTEMIS_ANON := eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZvaXNmYWZzZm9seGhxcGt1ZHpkIiwicm9sZSI6ImFub24iLCJpYXQiOjE2NzMzNzQyNDEsImV4cCI6MTk4ODk1MDI0MX0.dmfxNl5WssxnZ8jpvGJeryg4Fd47fOcrlZ8iGrHj2e4
6767
ARTEMIS_CERTIFICATE := Baltimore CyberTrust Root
6868

src/cli/cmds/config.toit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ create-server-config-commands -> List:
9292
Example "Add a local Supabase broker (anon-token is truncated):"
9393
--arguments="my-local-supabase 127.0.0.1:54321 eyJhb...6XHc",
9494
Example "Add a Supabase broker with a certificate (anon-token is truncated):"
95-
--arguments="my-remote-broker --certificate=\"Baltimore CyberTrust Root\" voisfafsfolxhqpkudzd.subabase.co eyJh...j2e4",
95+
--arguments="my-remote-broker --certificate=\"Baltimore CyberTrust Root\" artemis-api.toit.io eyJh...j2e4",
9696
]
9797
--run=:: add-supabase it
9898

src/cli/server-config.toit

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ import encoding.base64
99

1010
export ServerConfig ServerConfigSupabase ServerConfigHttp
1111

12+
ORIGINAL-SUPABASE-SERVER-URI ::= "voisfafsfolxhqpkudzd.supabase.co"
13+
1214
DEFAULT-ARTEMIS-SERVER-CONFIG ::= ServerConfigSupabase
1315
"Artemis"
14-
--host="voisfafsfolxhqpkudzd.supabase.co"
16+
--host="artemis-api.toit.io"
1517
--anon="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZvaXNmYWZzZm9seGhxcGt1ZHpkIiwicm9sZSI6ImFub24iLCJpYXQiOjE2NzMzNzQyNDEsImV4cCI6MTk4ODk1MDI0MX0.dmfxNl5WssxnZ8jpvGJeryg4Fd47fOcrlZ8iGrHj2e4"
1618
--root-certificate-name="Baltimore CyberTrust Root"
1719

@@ -50,9 +52,22 @@ get-server-from-config --cli/Cli --name/string -> ServerConfig?:
5052

5153
json-map := servers[name]
5254

53-
return ServerConfig.from-json name json-map
55+
result := ServerConfig.from-json name json-map
5456
--der-deserializer=: base64.decode it
5557

58+
if result is ServerConfigSupabase:
59+
// If the server config is for supabase, and it uses the original
60+
// server URI, update it to use the new one.
61+
supabase-config := result as ServerConfigSupabase
62+
if supabase-config.host == ORIGINAL-SUPABASE-SERVER-URI:
63+
json-map["host"] = DEFAULT-ARTEMIS-SERVER-CONFIG.host
64+
cli.ui.emit --info
65+
"Using updated Artemis server URI: $DEFAULT-ARTEMIS-SERVER-CONFIG.host"
66+
return ServerConfig.from-json name json-map
67+
--der-deserializer=: base64.decode it
68+
69+
return result
70+
5671
get-servers-from-config --cli/Cli -> List:
5772
config := cli.config
5873
default-name := DEFAULT-ARTEMIS-SERVER-CONFIG.name

0 commit comments

Comments
 (0)