chore(cli): add guest dashboard env variable

This commit is contained in:
Nicolas Meienberger 2023-11-02 07:55:10 +01:00 committed by Nicolas Meienberger
parent 9b9541cee7
commit fd6c5afe2c
2 changed files with 11 additions and 1 deletions

View file

@ -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');

View file

@ -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());