mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-07-23 04:09:04 +03:00
Compare commits
6
Commits
dev
...
7bc2ef731b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7bc2ef731b | ||
|
|
a6f8e1b9a9 | ||
|
|
66bbe62ffb | ||
|
|
4b034644d2 | ||
|
|
82410f8278 | ||
|
|
2b31c53614 |
@@ -69,15 +69,15 @@ function setup_homekit_config() {
|
|||||||
local cleaned_json="/tmp/cache/homekit_cleaned.json"
|
local cleaned_json="/tmp/cache/homekit_cleaned.json"
|
||||||
jq '
|
jq '
|
||||||
# Keep only the homekit section if it exists, otherwise empty object
|
# Keep only the homekit section if it exists, otherwise empty object
|
||||||
if has("homekit") then {homekit: .homekit} else {homekit: {}} end
|
if has("homekit") then {homekit: .homekit} else {} end
|
||||||
' "${temp_json}" > "${cleaned_json}" 2>/dev/null || {
|
' "${temp_json}" > "${cleaned_json}" 2>/dev/null || {
|
||||||
echo '{"homekit": {}}' > "${cleaned_json}"
|
echo '{}' > "${cleaned_json}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Convert back to YAML and write to the config file
|
# Convert back to YAML and write to the config file
|
||||||
yq eval -P "${cleaned_json}" > "${config_path}" 2>/dev/null || {
|
yq eval -P "${cleaned_json}" > "${config_path}" 2>/dev/null || {
|
||||||
echo "[WARNING] Failed to convert cleaned config to YAML, creating minimal config"
|
echo "[WARNING] Failed to convert cleaned config to YAML, creating minimal config"
|
||||||
echo 'homekit: {}' > "${config_path}"
|
echo '{}' > "${config_path}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Clean up temp files
|
# Clean up temp files
|
||||||
|
|||||||
+7
-10
@@ -848,9 +848,10 @@ async def onvif_probe(
|
|||||||
try:
|
try:
|
||||||
if isinstance(uri, str) and uri.startswith("rtsp://"):
|
if isinstance(uri, str) and uri.startswith("rtsp://"):
|
||||||
if username and password and "@" not in uri:
|
if username and password and "@" not in uri:
|
||||||
# Inject URL-encoded credentials and add only the
|
# Inject raw credentials and add only the
|
||||||
# authenticated version.
|
# authenticated version. The credentials will be encoded
|
||||||
cred = f"{quote_plus(username)}:{quote_plus(password)}@"
|
# later by ffprobe_stream or the config system.
|
||||||
|
cred = f"{username}:{password}@"
|
||||||
injected = uri.replace(
|
injected = uri.replace(
|
||||||
"rtsp://", f"rtsp://{cred}", 1
|
"rtsp://", f"rtsp://{cred}", 1
|
||||||
)
|
)
|
||||||
@@ -903,12 +904,8 @@ async def onvif_probe(
|
|||||||
"/cam/realmonitor?channel=1&subtype=0",
|
"/cam/realmonitor?channel=1&subtype=0",
|
||||||
"/11",
|
"/11",
|
||||||
]
|
]
|
||||||
# Use URL-encoded credentials for pattern fallback URIs when provided
|
# Use raw credentials for pattern fallback URIs when provided
|
||||||
auth_str = (
|
auth_str = f"{username}:{password}@" if username and password else ""
|
||||||
f"{quote_plus(username)}:{quote_plus(password)}@"
|
|
||||||
if username and password
|
|
||||||
else ""
|
|
||||||
)
|
|
||||||
rtsp_port = 554
|
rtsp_port = 554
|
||||||
for path in common_paths:
|
for path in common_paths:
|
||||||
uri = f"rtsp://{auth_str}{host}:{rtsp_port}{path}"
|
uri = f"rtsp://{auth_str}{host}:{rtsp_port}{path}"
|
||||||
@@ -930,7 +927,7 @@ async def onvif_probe(
|
|||||||
and uri.startswith("rtsp://")
|
and uri.startswith("rtsp://")
|
||||||
and "@" not in uri
|
and "@" not in uri
|
||||||
):
|
):
|
||||||
cred = f"{quote_plus(username)}:{quote_plus(password)}@"
|
cred = f"{username}:{password}@"
|
||||||
cred_uri = uri.replace("rtsp://", f"rtsp://{cred}", 1)
|
cred_uri = uri.replace("rtsp://", f"rtsp://{cred}", 1)
|
||||||
if cred_uri not in to_test:
|
if cred_uri not in to_test:
|
||||||
to_test.append(cred_uri)
|
to_test.append(cred_uri)
|
||||||
|
|||||||
@@ -540,9 +540,16 @@ def get_jetson_stats() -> Optional[dict[int, dict]]:
|
|||||||
try:
|
try:
|
||||||
results["mem"] = "-" # no discrete gpu memory
|
results["mem"] = "-" # no discrete gpu memory
|
||||||
|
|
||||||
with open("/sys/devices/gpu.0/load", "r") as f:
|
if os.path.exists("/sys/devices/gpu.0/load"):
|
||||||
gpuload = float(f.readline()) / 10
|
with open("/sys/devices/gpu.0/load", "r") as f:
|
||||||
results["gpu"] = f"{gpuload}%"
|
gpuload = float(f.readline()) / 10
|
||||||
|
results["gpu"] = f"{gpuload}%"
|
||||||
|
elif os.path.exists("/sys/devices/platform/gpu.0/load"):
|
||||||
|
with open("/sys/devices/platform/gpu.0/load", "r") as f:
|
||||||
|
gpuload = float(f.readline()) / 10
|
||||||
|
results["gpu"] = f"{gpuload}%"
|
||||||
|
else:
|
||||||
|
results["gpu"] = "-"
|
||||||
except Exception:
|
except Exception:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|||||||
@@ -81,7 +81,8 @@ export async function detectReolinkCamera(
|
|||||||
export function maskUri(uri: string): string {
|
export function maskUri(uri: string): string {
|
||||||
try {
|
try {
|
||||||
// Handle RTSP URLs with user:pass@host format
|
// Handle RTSP URLs with user:pass@host format
|
||||||
const rtspMatch = uri.match(/rtsp:\/\/([^:]+):([^@]+)@(.+)/);
|
// Use greedy match for password to handle passwords with @
|
||||||
|
const rtspMatch = uri.match(/rtsp:\/\/([^:]+):(.+)@(.+)/);
|
||||||
if (rtspMatch) {
|
if (rtspMatch) {
|
||||||
return `rtsp://${rtspMatch[1]}:${"*".repeat(4)}@${rtspMatch[3]}`;
|
return `rtsp://${rtspMatch[1]}:${"*".repeat(4)}@${rtspMatch[3]}`;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -266,7 +266,10 @@ function ModelCard({ config, onClick, onUpdate, onDelete }: ModelCardProps) {
|
|||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
const keys = Object.keys(dataset.categories).filter((key) => key != "none");
|
const keys = Object.keys(dataset.categories).filter(
|
||||||
|
(key) => key != "none" && key.toLowerCase() != "unknown",
|
||||||
|
);
|
||||||
|
|
||||||
if (keys.length === 0) {
|
if (keys.length === 0) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user