File tree Expand file tree Collapse file tree 8 files changed +17
-11
lines changed Expand file tree Collapse file tree 8 files changed +17
-11
lines changed Original file line number Diff line number Diff line change 1
- PUBLIC_APPWRITE_ENDPOINT = https://localhost/v1
2
1
PUBLIC_CONSOLE_MODE = self-hosted
2
+ PUBLIC_APPWRITE_MULTI_REGION = false
3
+ PUBLIC_APPWRITE_ENDPOINT = http://localhost/v1
4
+
3
5
PUBLIC_STRIPE_KEY =
4
6
PUBLIC_GROWTH_ENDPOINT =
Original file line number Diff line number Diff line change 39
39
labels : ${{ steps.meta.outputs.labels }}
40
40
build-args : |
41
41
"PUBLIC_CONSOLE_MODE=cloud"
42
+ "PUBLIC_APPWRITE_MULTI_REGION=true"
42
43
"PUBLIC_GROWTH_ENDPOINT=${{ secrets.PUBLIC_GROWTH_ENDPOINT }}"
43
44
"PUBLIC_STRIPE_KEY=${{ secrets.PUBLIC_STRIPE_KEY }}"
44
45
"SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}"
77
78
labels : ${{ steps.meta.outputs.labels }}
78
79
build-args : |
79
80
"PUBLIC_CONSOLE_MODE=cloud"
81
+ "PUBLIC_APPWRITE_MULTI_REGION=true"
80
82
"PUBLIC_GROWTH_ENDPOINT=${{ secrets.PUBLIC_GROWTH_ENDPOINT }}"
81
83
"PUBLIC_STRIPE_KEY=${{ secrets.PUBLIC_STRIPE_KEY_STAGE }}"
82
84
publish-self-hosted :
@@ -113,4 +115,5 @@ jobs:
113
115
labels : ${{ steps.meta.outputs.labels }}
114
116
build-args : |
115
117
"PUBLIC_CONSOLE_MODE=self-hosted"
118
+ "PUBLIC_APPWRITE_MULTI_REGION=false"
116
119
"PUBLIC_GROWTH_ENDPOINT=${{ secrets.PUBLIC_GROWTH_ENDPOINT }}"
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ ADD ./src /app/src
21
21
ADD ./static /app/static
22
22
23
23
ARG PUBLIC_CONSOLE_MODE
24
+ ARG PUBLIC_APPWRITE_MULTI_REGION
24
25
ARG PUBLIC_APPWRITE_ENDPOINT
25
26
ARG PUBLIC_GROWTH_ENDPOINT
26
27
ARG PUBLIC_STRIPE_KEY
@@ -30,6 +31,7 @@ ARG SENTRY_RELEASE
30
31
ENV PUBLIC_APPWRITE_ENDPOINT=$PUBLIC_APPWRITE_ENDPOINT
31
32
ENV PUBLIC_GROWTH_ENDPOINT=$PUBLIC_GROWTH_ENDPOINT
32
33
ENV PUBLIC_CONSOLE_MODE=$PUBLIC_CONSOLE_MODE
34
+ ENV PUBLIC_APPWRITE_MULTI_REGION=$PUBLIC_APPWRITE_MULTI_REGION
33
35
ENV PUBLIC_STRIPE_KEY=$PUBLIC_STRIPE_KEY
34
36
ENV SENTRY_AUTH_TOKEN=$SENTRY_AUTH_TOKEN
35
37
ENV SENTRY_RELEASE=$SENTRY_RELEASE
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ async function main() {
24
24
log ( bold ( ) . magenta ( 'APPWRITE CONSOLE' ) ) ;
25
25
log ( ) ;
26
26
logEnv ( 'CONSOLE MODE' , env ?. PUBLIC_CONSOLE_MODE ) ;
27
+ logEnv ( 'MULTI REGION' , env ?. PUBLIC_APPWRITE_MULTI_REGION ) ;
27
28
logEnv ( 'APPWRITE ENDPOINT' , env ?. PUBLIC_APPWRITE_ENDPOINT , 'relative' ) ;
28
29
logEnv ( 'GROWTH ENDPOINT' , env ?. PUBLIC_GROWTH_ENDPOINT ) ;
29
30
log ( ) ;
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ services:
5
5
context : .
6
6
args :
7
7
PUBLIC_CONSOLE_MODE : ${PUBLIC_CONSOLE_MODE}
8
+ PUBLIC_APPWRITE_MULTI_REGION : ${PUBLIC_APPWRITE_MULTI_REGION}
8
9
PUBLIC_APPWRITE_ENDPOINT : ${PUBLIC_APPWRITE_ENDPOINT}
9
10
PUBLIC_GROWTH_ENDPOINT : ${PUBLIC_GROWTH_ENDPOINT}
10
11
PUBLIC_STRIPE_KEY : ${PUBLIC_STRIPE_KEY}
@@ -20,6 +21,7 @@ services:
20
21
- build/
21
22
environment :
22
23
- PUBLIC_CONSOLE_MODE
24
+ - PUBLIC_APPWRITE_MULTI_REGION
23
25
- PUBLIC_APPWRITE_ENDPOINT
24
26
- PUBLIC_GROWTH_ENDPOINT
25
27
- PUBLIC_STRIPE_KEY
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ const config: PlaywrightTestConfig = {
14
14
env : {
15
15
PUBLIC_APPWRITE_ENDPOINT : 'https://stage.cloud.appwrite.io/v1' ,
16
16
PUBLIC_CONSOLE_MODE : 'cloud' ,
17
+ PUBLIC_APPWRITE_MULTI_REGION : 'true' ,
17
18
PUBLIC_STRIPE_KEY :
18
19
'pk_test_51LT5nsGYD1ySxNCyd7b304wPD8Y1XKKWR6hqo6cu3GIRwgvcVNzoZv4vKt5DfYXL1gRGw4JOqE19afwkJYJq1g3K004eVfpdWn'
19
20
} ,
Original file line number Diff line number Diff line change @@ -40,7 +40,9 @@ export function getApiEndpoint(region?: string): string {
40
40
) ;
41
41
const protocol = url . protocol ;
42
42
const hostname = url . hostname ;
43
- const subdomain = getSubdomain ( region ) ;
43
+
44
+ // If instance supports multi-region, add the region subdomain.
45
+ const subdomain = VARS . APPWRITE_MULTI_REGION ? getSubdomain ( region ) : '' ;
44
46
45
47
return `${ protocol } //${ subdomain } ${ hostname } /v1` ;
46
48
}
@@ -95,14 +97,6 @@ export const realtime = {
95
97
const endpoint = getApiEndpoint ( region ) ;
96
98
if ( endpoint !== clientRealtime . config . endpoint ) {
97
99
clientRealtime . setEndpoint ( endpoint ) ;
98
-
99
- /**
100
- * Workaround: the SDK doesn't update the realtime in `setEndpoint`.
101
- * Until that's fixed, we manually set the realtime endpoint like this:
102
- */
103
- clientRealtime . setEndpointRealtime (
104
- endpoint . replace ( 'https://' , 'wss://' ) . replace ( 'http://' , 'ws://' )
105
- ) ;
106
100
}
107
101
return clientRealtime ;
108
102
}
Original file line number Diff line number Diff line change @@ -10,7 +10,8 @@ export const VARS = {
10
10
CONSOLE_MODE : ( env . PUBLIC_CONSOLE_MODE as Mode ) ?? undefined ,
11
11
APPWRITE_ENDPOINT : env . PUBLIC_APPWRITE_ENDPOINT ?? undefined ,
12
12
GROWTH_ENDPOINT : env . PUBLIC_GROWTH_ENDPOINT ?? undefined ,
13
- PUBLIC_STRIPE_KEY : env . PUBLIC_STRIPE_KEY ?? undefined
13
+ PUBLIC_STRIPE_KEY : env . PUBLIC_STRIPE_KEY ?? undefined ,
14
+ APPWRITE_MULTI_REGION : env . PUBLIC_APPWRITE_MULTI_REGION ?? false
14
15
} ;
15
16
16
17
export const ENV = {
You can’t perform that action at this time.
0 commit comments