@@ -9,9 +9,11 @@ import encoding.base64
99
1010export ServerConfig ServerConfigSupabase ServerConfigHttp
1111
12+ ORIGINAL-SUPABASE-SERVER-URI ::= "voisfafsfolxhqpkudzd.supabase.co"
13+
1214DEFAULT-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+
5671get-servers-from-config --cli / Cli -> List :
5772 config := cli .config
5873 default-name := DEFAULT-ARTEMIS-SERVER-CONFIG .name
0 commit comments