docs: RTSP password is optional

This commit is contained in:
ZhaiSoul 2026-05-01 22:24:27 +08:00
parent bb5e01ac45
commit 9e72a825f3
No known key found for this signature in database
2 changed files with 13 additions and 9 deletions

View File

@ -15,7 +15,7 @@ export interface GeneratorInput {
enabledPorts: string[]; enabledPorts: string[];
configPath: string; configPath: string;
mediaPath: string; mediaPath: string;
rtspPassword: string; rtspPassword?: string;
timezone: string; timezone: string;
shmSize: string; shmSize: string;
nvidiaGpuCount?: string; nvidiaGpuCount?: string;
@ -99,7 +99,7 @@ function buildPorts(enabledPorts: string[]): string[] {
function buildEnvironment( function buildEnvironment(
device: DeviceConfig, device: DeviceConfig,
hwEnv: Record<string, string>, hwEnv: Record<string, string>,
rtspPassword: string, rtspPassword: string | undefined,
timezone: string timezone: string
): string[] { ): string[] {
const allEnv: Record<string, string> = { const allEnv: Record<string, string> = {
@ -107,11 +107,15 @@ function buildEnvironment(
...(device.env ?? {}), ...(device.env ?? {}),
}; };
const lines: string[] = [ const lines: string[] = [" environment:"];
" environment:",
` FRIGATE_RTSP_PASSWORD: "${rtspPassword}" # RTSP password — change to your own`, if (rtspPassword) {
` TZ: "${timezone}" # Timezone`, 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)) { for (const [key, value] of Object.entries(allEnv)) {
lines.push(` ${key}: "${value}"`); lines.push(` ${key}: "${value}"`);

View File

@ -33,7 +33,7 @@ export function useConfigGenerator() {
const [nvidiaGpuDeviceId, setNvidiaGpuDeviceId] = useState(""); const [nvidiaGpuDeviceId, setNvidiaGpuDeviceId] = useState("");
const [configPath, setConfigPath] = useState(""); const [configPath, setConfigPath] = useState("");
const [mediaPath, setMediaPath] = useState(""); const [mediaPath, setMediaPath] = useState("");
const [rtspPassword, setRtspPassword] = useState("password"); const [rtspPassword, setRtspPassword] = useState("");
const [timezone, setTimezone] = useState(""); const [timezone, setTimezone] = useState("");
const [shmSize, setShmSize] = useState("512mb"); const [shmSize, setShmSize] = useState("512mb");
const [shmSizeError, setShmSizeError] = useState(false); const [shmSizeError, setShmSizeError] = useState(false);
@ -166,7 +166,7 @@ export function useConfigGenerator() {
enabledPorts: enabledPortLines, enabledPorts: enabledPortLines,
configPath: configPath || "/path/to/your/config", configPath: configPath || "/path/to/your/config",
mediaPath: mediaPath || "/path/to/your/storage", mediaPath: mediaPath || "/path/to/your/storage",
rtspPassword: rtspPassword || "password", rtspPassword,
timezone: timezone || Intl.DateTimeFormat().resolvedOptions().timeZone || "Etc/UTC", timezone: timezone || Intl.DateTimeFormat().resolvedOptions().timeZone || "Etc/UTC",
shmSize: shmSize || "512mb", shmSize: shmSize || "512mb",
nvidiaGpuCount, nvidiaGpuCount,