feat: env for disable self hosted mode

feat/disable-self-hosted
Shivam Kalra 2023-10-05 00:04:04 +05:30
parent 3e08c66888
commit ff2cd61276
3 changed files with 8 additions and 1 deletions

View File

@ -243,6 +243,10 @@ CALCOM_CREDENTIAL_SYNC_ENDPOINT=""
# You can use: `openssl rand -base64 24` to generate one # You can use: `openssl rand -base64 24` to generate one
CALCOM_APP_CREDENTIAL_ENCRYPTION_KEY="" 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 ******************************************************************************************* # - OIDC E2E TEST *******************************************************************************************
# Ensure this ADMIN EMAIL is present in the SAML_ADMINS list # Ensure this ADMIN EMAIL is present in the SAML_ADMINS list

View File

@ -48,7 +48,9 @@ export const CONSOLE_URL =
? `https://console.cal.dev` ? `https://console.cal.dev`
: `https://console.cal.com`; : `https://console.cal.com`;
export const IS_SELF_HOSTED = !( 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 EMBED_LIB_URL = process.env.NEXT_PUBLIC_EMBED_LIB_URL || `${WEBAPP_URL}/embed/embed.js`;
export const TRIAL_LIMIT_DAYS = 14; export const TRIAL_LIMIT_DAYS = 14;

View File

@ -214,6 +214,7 @@
"DAILY_API_KEY", "DAILY_API_KEY",
"DAILY_SCALE_PLAN", "DAILY_SCALE_PLAN",
"DEBUG", "DEBUG",
"DISABLE_SELF_HOSTED_MODE",
"E2E_TEST_APPLE_CALENDAR_EMAIL", "E2E_TEST_APPLE_CALENDAR_EMAIL",
"E2E_TEST_APPLE_CALENDAR_PASSWORD", "E2E_TEST_APPLE_CALENDAR_PASSWORD",
"E2E_TEST_MAILHOG_ENABLED", "E2E_TEST_MAILHOG_ENABLED",