Przeglądaj źródła

chore(cli): add guest dashboard env variable

Nicolas Meienberger 1 rok temu
rodzic
commit
fd6c5afe2c

+ 2 - 0
packages/cli/src/executors/system/system.helpers.ts

@@ -32,6 +32,7 @@ type EnvKeys =
   | 'REDIS_PASSWORD'
   | 'LOCAL_DOMAIN'
   | 'DEMO_MODE'
+  | 'GUEST_DASHBOARD'
   | 'TIPI_GID'
   | 'TIPI_UID'
   // eslint-disable-next-line @typescript-eslint/ban-types
@@ -178,6 +179,7 @@ export const generateSystemEnvFile = async () => {
   envMap.set('REDIS_HOST', 'tipi-redis');
   envMap.set('REDIS_PASSWORD', redisPassword);
   envMap.set('DEMO_MODE', String(data.demoMode || 'false'));
+  envMap.set('GUEST_DASHBOARD', String(data.guestDashboard || 'false'));
   envMap.set('LOCAL_DOMAIN', data.localDomain || 'tipi.lan');
   envMap.set('NODE_ENV', 'production');
 

+ 9 - 1
packages/shared/src/schemas/env-schemas.ts

@@ -43,6 +43,14 @@ export const envSchema = z.object({
       if (typeof value === 'boolean') return value;
       return value === 'true';
     }),
+  guestDashboard: z
+    .string()
+    .or(z.boolean())
+    .optional()
+    .transform((value) => {
+      if (typeof value === 'boolean') return value;
+      return value === 'true';
+    }),
   seePreReleaseVersions: z
     .string()
     .or(z.boolean())
@@ -55,5 +63,5 @@ export const envSchema = z.object({
 
 export const settingsSchema = envSchema
   .partial()
-  .pick({ dnsIp: true, internalIp: true, appsRepoUrl: true, domain: true, storagePath: true, localDomain: true, demoMode: true })
+  .pick({ dnsIp: true, internalIp: true, appsRepoUrl: true, domain: true, storagePath: true, localDomain: true, demoMode: true, guestDashboard: true })
   .and(z.object({ port: z.number(), sslPort: z.number(), listenIp: z.string().ip().trim() }).partial());