From 10369c59abf6e75c8de71a7a133b5ca43c0e54ab Mon Sep 17 00:00:00 2001 From: Rithvik Nishad Date: Wed, 20 Nov 2024 19:16:47 +0530 Subject: [PATCH] fix plausible site domain env validation (#9168) --- vite.config.mts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vite.config.mts b/vite.config.mts index ca92aa50954..3fc64d66829 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -111,7 +111,12 @@ export default defineConfig(({ mode }) => { REACT_SENTRY_DSN: z.string().url().optional(), REACT_SENTRY_ENVIRONMENT: z.string().optional(), - REACT_PLAUSIBLE_SITE_DOMAIN: z.string().url().optional(), + REACT_PLAUSIBLE_SITE_DOMAIN: z + .string() + .regex(/^[a-zA-Z0-9][a-zA-Z0-9-_.]*\.[a-zA-Z]{2,}$/) + .optional() + .describe("Domain name without protocol (e.g., sub.domain.com)"), + REACT_PLAUSIBLE_SERVER_URL: z.string().url().optional(), REACT_CDN_URLS: z .string()