mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-12-01 09:47:07 +03:00
CI / AMD64 Build (push) Canceled after 0s
CI / AMD64 Smoke Test (push) Canceled after 0s
CI / ARM Build (push) Canceled after 0s
CI / Jetson Jetpack 6 (push) Canceled after 0s
CI / AMD64 Extra Build (push) Canceled after 0s
CI / ARM Extra Build (push) Canceled after 0s
CI / Synaptics Build (push) Canceled after 0s
CI / Assemble and push default build (push) Canceled after 0s
* encode notice ids in notice action urls Notice ids went into the URL raw, so a detector on a repeated device like openvino:GPU#2 had everything after the # dropped as a fragment. The acknowledge, mute, and unhide requests 404'd and the buttons did nothing. The hooks now encode the id. * re-sweep a replaced media volume despite the ownership sentinel The boot sweep skipped whenever the sentinel in /config matched, so wiping or swapping /media/frigate while keeping the config volume left the new root-owned folder unswept and Frigate failed to create /media/frigate/recordings. The sentinel is now honored only when each volume root is still owned by the runtime user. Filesystems that accept chown without applying it (CIFS without setuids) get an unmanaged sentinel after a clean sweep so they don't re-sweep on every boot. * don't seed relative move translation from a status without position * disable relative movement when the camera doesn't report its position * stop at startup when the database location isn't writable The ownership sweep only covers /config and /media/frigate, so a database.path on another volume stayed root-owned after upgrading and Frigate boot-looped on a SQLite error. Frigate now checks the database directory and files before opening them and exits with an error naming the path, the runtime uid/gid, and the new docs section. backup.db is checked only when a migration is about to write it. * add note about explicit detect resolution * track where each camera's detect resolution came from The health tab's stream check told users to set the detect resolution whenever a probe returned no size, even when they had already set it, and a camera running on the 1280x720 fallback after a failed startup probe was never flagged unless the stream check was run by hand. The config now records whether the resolution came from the config, a startup probe, or the fallback, and /api/config exposes it per camera. The stream check skips the probe warning when the resolution is set, a camera on the fallback gets a detect settings warning that also shows on the health tab, and cloning detect from a fallback camera no longer copies the fallback size. * don't strip the fallback detect size when cloning * free tracker state when an object is deregistered deregister() removed the object from tracked_objects, disappeared and track_id_map but left its entries in positions, stationary_box_history and the stationary classifier's four per-object dicts, including a 96x96 anchor crop for every object that went stationary. Every object tracked since the camera process started stayed in memory. deregister() now pops those entries and calls a new StationaryMotionClassifier.forget() to clear the classifier's state. * avoid opencv path leak on recurring image writes OpenCV 4.11's Python bindings keep a reference to every path string passed to cv2.imwrite or cv2.imread (opencv/opencv#28047, fixed in 4.13, which needs numpy 2). Callers that write on every frame or event leaked one string per call for the life of the process, about 8 MB a day from preview frames on two cameras. New write_image and read_image helpers encode and decode in memory and do the file I/O through numpy, so OpenCV never sees the path. Preview frames, review and event thumbnails, face and classification training attempts, and the offline preview frame read now use them.
83 lines
2.4 KiB
TypeScript
83 lines
2.4 KiB
TypeScript
/**
|
|
* FrigateConfig factory for E2E tests.
|
|
*
|
|
* Uses a real config snapshot generated from the Python backend's FrigateConfig
|
|
* model. This guarantees all fields are present and match what the app expects.
|
|
* Tests override specific fields via DeepPartial.
|
|
*/
|
|
|
|
import { readFileSync } from "node:fs";
|
|
import { resolve, dirname } from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
const configSnapshot = JSON.parse(
|
|
readFileSync(resolve(__dirname, "config-snapshot.json"), "utf-8"),
|
|
);
|
|
|
|
export type DeepPartial<T> = {
|
|
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
};
|
|
|
|
export function deepMerge<T extends Record<string, unknown>>(
|
|
base: T,
|
|
overrides?: DeepPartial<T>,
|
|
): T {
|
|
if (!overrides) return base;
|
|
const result = { ...base };
|
|
for (const key of Object.keys(overrides) as (keyof T)[]) {
|
|
const val = overrides[key];
|
|
if (
|
|
val !== undefined &&
|
|
typeof val === "object" &&
|
|
val !== null &&
|
|
!Array.isArray(val) &&
|
|
typeof base[key] === "object" &&
|
|
base[key] !== null &&
|
|
!Array.isArray(base[key])
|
|
) {
|
|
result[key] = deepMerge(
|
|
base[key] as Record<string, unknown>,
|
|
val as DeepPartial<Record<string, unknown>>,
|
|
) as T[keyof T];
|
|
} else if (val !== undefined) {
|
|
result[key] = val as T[keyof T];
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
|
|
// The base config is a real snapshot from the Python backend.
|
|
// Apply test-specific overrides: friendly names, camera groups, version.
|
|
export const BASE_CONFIG = {
|
|
...configSnapshot,
|
|
version: "0.15.0-test",
|
|
// injected by the /config endpoint rather than the Pydantic model, so they
|
|
// are absent from the snapshot, as is each camera's detect_resolution_source
|
|
plus: { enabled: false },
|
|
cameras: {
|
|
...configSnapshot.cameras,
|
|
front_door: {
|
|
...configSnapshot.cameras.front_door,
|
|
friendly_name: "Front Door",
|
|
detect_resolution_source: "config",
|
|
},
|
|
backyard: {
|
|
...configSnapshot.cameras.backyard,
|
|
friendly_name: "Backyard",
|
|
detect_resolution_source: "config",
|
|
},
|
|
garage: {
|
|
...configSnapshot.cameras.garage,
|
|
friendly_name: "Garage",
|
|
detect_resolution_source: "config",
|
|
},
|
|
},
|
|
};
|
|
|
|
export function configFactory(
|
|
overrides?: DeepPartial<typeof BASE_CONFIG>,
|
|
): typeof BASE_CONFIG {
|
|
return deepMerge(BASE_CONFIG, overrides);
|
|
}
|