From ff2cd612768373664ea576256153fce23dd4a34f Mon Sep 17 00:00:00 2001 From: Shivam Kalra Date: Thu, 5 Oct 2023 00:04:04 +0530 Subject: [PATCH] feat: env for disable self hosted mode --- .env.example | 4 ++++ packages/lib/constants.ts | 4 +++- turbo.json | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index f6f6188a1b..21b7f4764b 100644 --- a/.env.example +++ b/.env.example @@ -243,6 +243,10 @@ CALCOM_CREDENTIAL_SYNC_ENDPOINT="" # You can use: `openssl rand -base64 24` to generate one CALCOM_APP_CREDENTIAL_ENCRYPTION_KEY="" +# Disable Self Hosted Mode. +# Set this to "1" if you need to disable self hosted mode +DISABLE_SELF_HOSTED_MODE= + # - OIDC E2E TEST ******************************************************************************************* # Ensure this ADMIN EMAIL is present in the SAML_ADMINS list diff --git a/packages/lib/constants.ts b/packages/lib/constants.ts index 3bc778935b..e73cb3a623 100644 --- a/packages/lib/constants.ts +++ b/packages/lib/constants.ts @@ -48,7 +48,9 @@ export const CONSOLE_URL = ? `https://console.cal.dev` : `https://console.cal.com`; export const IS_SELF_HOSTED = !( - new URL(WEBAPP_URL).hostname.endsWith(".cal.dev") || new URL(WEBAPP_URL).hostname.endsWith(".cal.com") + new URL(WEBAPP_URL).hostname.endsWith(".cal.dev") || + new URL(WEBAPP_URL).hostname.endsWith(".cal.com") || + Boolean(process.env.DISABLE_SELF_HOSTED_MODE) ); export const EMBED_LIB_URL = process.env.NEXT_PUBLIC_EMBED_LIB_URL || `${WEBAPP_URL}/embed/embed.js`; export const TRIAL_LIMIT_DAYS = 14; diff --git a/turbo.json b/turbo.json index 977c976d2e..af25fcb286 100644 --- a/turbo.json +++ b/turbo.json @@ -214,6 +214,7 @@ "DAILY_API_KEY", "DAILY_SCALE_PLAN", "DEBUG", + "DISABLE_SELF_HOSTED_MODE", "E2E_TEST_APPLE_CALENDAR_EMAIL", "E2E_TEST_APPLE_CALENDAR_PASSWORD", "E2E_TEST_MAILHOG_ENABLED",