diff --git a/docs/src/components/DockerComposeGenerator/generator/index.ts b/docs/src/components/DockerComposeGenerator/generator/index.ts index 589d9b0b6..f6091f7c0 100644 --- a/docs/src/components/DockerComposeGenerator/generator/index.ts +++ b/docs/src/components/DockerComposeGenerator/generator/index.ts @@ -15,7 +15,7 @@ export interface GeneratorInput { enabledPorts: string[]; configPath: string; mediaPath: string; - rtspPassword: string; + rtspPassword?: string; timezone: string; shmSize: string; nvidiaGpuCount?: string; @@ -99,7 +99,7 @@ function buildPorts(enabledPorts: string[]): string[] { function buildEnvironment( device: DeviceConfig, hwEnv: Record, - rtspPassword: string, + rtspPassword: string | undefined, timezone: string ): string[] { const allEnv: Record = { @@ -107,11 +107,15 @@ function buildEnvironment( ...(device.env ?? {}), }; - const lines: string[] = [ - " environment:", - ` FRIGATE_RTSP_PASSWORD: "${rtspPassword}" # RTSP password — change to your own`, - ` TZ: "${timezone}" # Timezone`, - ]; + const lines: string[] = [" environment:"]; + + if (rtspPassword) { + lines.push( + ` FRIGATE_RTSP_PASSWORD: "${rtspPassword}" # RTSP password — change to your own` + ); + } + + lines.push(` TZ: "${timezone}" # Timezone`); for (const [key, value] of Object.entries(allEnv)) { lines.push(` ${key}: "${value}"`); diff --git a/docs/src/components/DockerComposeGenerator/hooks/useConfigGenerator.ts b/docs/src/components/DockerComposeGenerator/hooks/useConfigGenerator.ts index 2fc235382..19c3976d8 100644 --- a/docs/src/components/DockerComposeGenerator/hooks/useConfigGenerator.ts +++ b/docs/src/components/DockerComposeGenerator/hooks/useConfigGenerator.ts @@ -33,7 +33,7 @@ export function useConfigGenerator() { const [nvidiaGpuDeviceId, setNvidiaGpuDeviceId] = useState(""); const [configPath, setConfigPath] = useState(""); const [mediaPath, setMediaPath] = useState(""); - const [rtspPassword, setRtspPassword] = useState("password"); + const [rtspPassword, setRtspPassword] = useState(""); const [timezone, setTimezone] = useState(""); const [shmSize, setShmSize] = useState("512mb"); const [shmSizeError, setShmSizeError] = useState(false); @@ -166,7 +166,7 @@ export function useConfigGenerator() { enabledPorts: enabledPortLines, configPath: configPath || "/path/to/your/config", mediaPath: mediaPath || "/path/to/your/storage", - rtspPassword: rtspPassword || "password", + rtspPassword, timezone: timezone || Intl.DateTimeFormat().resolvedOptions().timeZone || "Etc/UTC", shmSize: shmSize || "512mb", nvidiaGpuCount,