diff --git a/.env.example b/.env.example
index 138249fc1..ae9250596 100644
--- a/.env.example
+++ b/.env.example
@@ -1,4 +1,6 @@
-PUBLIC_APPWRITE_ENDPOINT=https://localhost/v1
PUBLIC_CONSOLE_MODE=self-hosted
+PUBLIC_APPWRITE_MULTI_REGION=false
+PUBLIC_APPWRITE_ENDPOINT=http://localhost/v1
+
PUBLIC_STRIPE_KEY=
PUBLIC_GROWTH_ENDPOINT=
\ No newline at end of file
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 91c98b81f..4c761e03e 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -39,6 +39,7 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
build-args: |
"PUBLIC_CONSOLE_MODE=cloud"
+ "PUBLIC_APPWRITE_MULTI_REGION=true"
"PUBLIC_GROWTH_ENDPOINT=${{ secrets.PUBLIC_GROWTH_ENDPOINT }}"
"PUBLIC_STRIPE_KEY=${{ secrets.PUBLIC_STRIPE_KEY }}"
"SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}"
@@ -77,6 +78,7 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
build-args: |
"PUBLIC_CONSOLE_MODE=cloud"
+ "PUBLIC_APPWRITE_MULTI_REGION=true"
"PUBLIC_GROWTH_ENDPOINT=${{ secrets.PUBLIC_GROWTH_ENDPOINT }}"
"PUBLIC_STRIPE_KEY=${{ secrets.PUBLIC_STRIPE_KEY_STAGE }}"
publish-self-hosted:
@@ -113,4 +115,5 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
build-args: |
"PUBLIC_CONSOLE_MODE=self-hosted"
+ "PUBLIC_APPWRITE_MULTI_REGION=false"
"PUBLIC_GROWTH_ENDPOINT=${{ secrets.PUBLIC_GROWTH_ENDPOINT }}"
diff --git a/Dockerfile b/Dockerfile
index 45263f235..774fb6903 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -21,6 +21,7 @@ ADD ./src /app/src
ADD ./static /app/static
ARG PUBLIC_CONSOLE_MODE
+ARG PUBLIC_APPWRITE_MULTI_REGION
ARG PUBLIC_APPWRITE_ENDPOINT
ARG PUBLIC_GROWTH_ENDPOINT
ARG PUBLIC_STRIPE_KEY
@@ -30,6 +31,7 @@ ARG SENTRY_RELEASE
ENV PUBLIC_APPWRITE_ENDPOINT=$PUBLIC_APPWRITE_ENDPOINT
ENV PUBLIC_GROWTH_ENDPOINT=$PUBLIC_GROWTH_ENDPOINT
ENV PUBLIC_CONSOLE_MODE=$PUBLIC_CONSOLE_MODE
+ENV PUBLIC_APPWRITE_MULTI_REGION=$PUBLIC_APPWRITE_MULTI_REGION
ENV PUBLIC_STRIPE_KEY=$PUBLIC_STRIPE_KEY
ENV SENTRY_AUTH_TOKEN=$SENTRY_AUTH_TOKEN
ENV SENTRY_RELEASE=$SENTRY_RELEASE
@@ -37,7 +39,7 @@ ENV NODE_OPTIONS=--max_old_space_size=8192
RUN pnpm run build
-FROM nginx:1.25-alpine
+FROM nginx:1.26.3-alpine
EXPOSE 80
diff --git a/build.js b/build.js
index 9753d0378..f56506dae 100644
--- a/build.js
+++ b/build.js
@@ -24,6 +24,7 @@ async function main() {
log(bold().magenta('APPWRITE CONSOLE'));
log();
logEnv('CONSOLE MODE', env?.PUBLIC_CONSOLE_MODE);
+ logEnv('MULTI REGION', env?.PUBLIC_APPWRITE_MULTI_REGION);
logEnv('APPWRITE ENDPOINT', env?.PUBLIC_APPWRITE_ENDPOINT, 'relative');
logEnv('GROWTH ENDPOINT', env?.PUBLIC_GROWTH_ENDPOINT);
log();
diff --git a/compose.yml b/compose.yml
index cfbb54934..6166d3776 100644
--- a/compose.yml
+++ b/compose.yml
@@ -5,6 +5,7 @@ services:
context: .
args:
PUBLIC_CONSOLE_MODE: ${PUBLIC_CONSOLE_MODE}
+ PUBLIC_APPWRITE_MULTI_REGION: ${PUBLIC_APPWRITE_MULTI_REGION}
PUBLIC_APPWRITE_ENDPOINT: ${PUBLIC_APPWRITE_ENDPOINT}
PUBLIC_GROWTH_ENDPOINT: ${PUBLIC_GROWTH_ENDPOINT}
PUBLIC_STRIPE_KEY: ${PUBLIC_STRIPE_KEY}
@@ -20,6 +21,7 @@ services:
- build/
environment:
- PUBLIC_CONSOLE_MODE
+ - PUBLIC_APPWRITE_MULTI_REGION
- PUBLIC_APPWRITE_ENDPOINT
- PUBLIC_GROWTH_ENDPOINT
- PUBLIC_STRIPE_KEY
diff --git a/docker/nginx.conf b/docker/nginx.conf
index 7f7313e00..2f7987a9f 100644
--- a/docker/nginx.conf
+++ b/docker/nginx.conf
@@ -1,8 +1,6 @@
-map $sent_http_content_type $expires {
- # cache everything for 1 year
- default 1y;
- # html files shouldn't be cached for single-page applications
- text/html off;
+map $sent_http_content_type $cc_header {
+ default "public, max-age=31536000";
+ text/html "no-cache";
}
server {
@@ -12,15 +10,17 @@ server {
# serve compressed file if filename.gz exists
gzip_static on;
+ location = /console/service-worker.js {
+ root /usr/share/nginx/html;
+ add_header Cache-Control "public, max-age=30" always;
+ }
+
location /console {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri /console/index.html;
- # Add cache headers
- expires $expires;
- add_header Pragma public;
- add_header Cache-Control "public";
+ add_header Cache-Control $cc_header always;
# Deny IE browsers from going into quirks mode
add_header X-UA-Compatible "IE=Edge";
diff --git a/package.json b/package.json
index 9064448ef..f5877e2c0 100644
--- a/package.json
+++ b/package.json
@@ -21,7 +21,8 @@
"e2e:ui": "playwright test --ui"
},
"dependencies": {
- "@appwrite.io/console": "https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@e2f082e",
+ "@ai-sdk/svelte": "^1.1.24",
+ "@appwrite.io/console": "https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@f76aff1",
"@appwrite.io/pink": "0.25.0",
"@appwrite.io/pink-icons": "0.25.0",
"@appwrite.io/pink-icons-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@bd21ff7f",
@@ -32,7 +33,6 @@
"@stripe/stripe-js": "^3.5.0",
"ai": "^2.2.37",
"analytics": "^0.8.16",
- "@ai-sdk/svelte": "^1.1.24",
"cron-parser": "^4.9.0",
"dayjs": "^1.11.13",
"deep-equal": "^2.2.3",
diff --git a/playwright.config.ts b/playwright.config.ts
index de119fa1f..fbd977757 100644
--- a/playwright.config.ts
+++ b/playwright.config.ts
@@ -15,6 +15,7 @@ const config: PlaywrightTestConfig = {
env: {
PUBLIC_APPWRITE_ENDPOINT: 'https://stage.cloud.appwrite.io/v1',
PUBLIC_CONSOLE_MODE: 'cloud',
+ PUBLIC_APPWRITE_MULTI_REGION: 'true',
PUBLIC_STRIPE_KEY:
'pk_test_51LT5nsGYD1ySxNCyd7b304wPD8Y1XKKWR6hqo6cu3GIRwgvcVNzoZv4vKt5DfYXL1gRGw4JOqE19afwkJYJq1g3K004eVfpdWn'
},
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 93acdd1ee..7e2b51ac4 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -12,8 +12,8 @@ importers:
specifier: ^1.1.24
version: 1.1.24(svelte@5.25.3)(zod@3.24.3)
'@appwrite.io/console':
- specifier: https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@e2f082e
- version: https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@e2f082e
+ specifier: https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@f76aff1
+ version: https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@f76aff1
'@appwrite.io/pink':
specifier: 0.25.0
version: 0.25.0
@@ -254,8 +254,8 @@ packages:
'@analytics/type-utils@0.6.2':
resolution: {integrity: sha512-TD+xbmsBLyYy/IxFimW/YL/9L2IEnM7/EoV9Aeh56U64Ify8o27HJcKjo38XY9Tcn0uOq1AX3thkKgvtWvwFQg==}
- '@appwrite.io/console@https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@e2f082e':
- resolution: {tarball: https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@e2f082e}
+ '@appwrite.io/console@https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@f76aff1':
+ resolution: {tarball: https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@f76aff1}
version: 1.2.1
'@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@bd21ff7f':
@@ -3625,7 +3625,7 @@ snapshots:
'@analytics/type-utils@0.6.2': {}
- '@appwrite.io/console@https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@e2f082e': {}
+ '@appwrite.io/console@https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@f76aff1': {}
'@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@bd21ff7f(svelte@5.25.3)':
dependencies:
diff --git a/src/lib/components/support.svelte b/src/lib/components/support.svelte
index 8c5ce20b8..2520ef032 100644
--- a/src/lib/components/support.svelte
+++ b/src/lib/components/support.svelte
@@ -5,18 +5,30 @@
import { isSupportOnline, showSupportModal } from '$routes/(console)/wizard/support/store';
import { Click, trackEvent } from '$lib/actions/analytics';
import { localeShortTimezoneName, utcHourToLocaleHour } from '$lib/helpers/date';
- import { upgradeURL } from '$lib/stores/billing';
+ import { plansInfo } from '$lib/stores/billing';
import { Card } from '$lib/components/index';
import { app } from '$lib/stores/app';
- import { currentPlan } from '$lib/stores/organization';
+ import { currentPlan, type Organization, organizationList } from '$lib/stores/organization';
import { isCloud } from '$lib/system';
import { Typography } from '@appwrite.io/pink-svelte';
+ import { base } from '$app/paths';
export let show = false;
export let showHeader = true;
- $: hasPremiumSupport = $currentPlan?.premiumSupport ?? false;
+ $: hasPremiumSupport = $currentPlan?.premiumSupport ?? allOrgsHavePremiumSupport ?? false;
+
+ $: allOrgsHavePremiumSupport = $organizationList.teams.every(
+ (team) => $plansInfo.get((team as Organization).billingPlan)?.premiumSupport
+ );
+
+ // there can only be one free organization
+ $: freeOrganization = $organizationList.teams.find(
+ (team) => !$plansInfo.get((team as Organization).billingPlan)?.premiumSupport
+ );
+
+ $: upgradeURL = `${base}/organization-${freeOrganization.$id}/change-plan`;
$: supportTimings = `${utcHourToLocaleHour('16:00')} - ${utcHourToLocaleHour('00:00')} ${localeShortTimezoneName()}`;
@@ -55,7 +67,7 @@
}
];
- const showCloudSupport = (index) => {
+ const showCloudSupport = (index: number) => {
return (index === 0 && isCloud) || index > 0;
};
@@ -79,7 +91,7 @@
{#if !hasPremiumSupport}