mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-10-03 13:26:48 +03:00
tolerate homekit config chown failures in the go2rtc run script
This commit is contained in:
@@ -113,9 +113,11 @@ setup_homekit_config "${homekit_config_path}"
|
|||||||
if [[ "$(id -u)" -eq 0 && "${FRIGATE_RUN_AS_ROOT:-false}" != "true" ]]; then
|
if [[ "$(id -u)" -eq 0 && "${FRIGATE_RUN_AS_ROOT:-false}" != "true" ]]; then
|
||||||
chown go2rtc:go2rtc /dev/shm/go2rtc.yaml 2>/dev/null || true
|
chown go2rtc:go2rtc /dev/shm/go2rtc.yaml 2>/dev/null || true
|
||||||
# go2rtc rewrites this in place (os.WriteFile, no rename), so owning the
|
# go2rtc rewrites this in place (os.WriteFile, no rename), so owning the
|
||||||
# file is enough; /config grants frigate-data traverse only
|
# file is enough; /config grants frigate-data traverse only. Tolerated so
|
||||||
chown go2rtc:frigate-data "${homekit_config_path}"
|
# a chown-refusing mount (NFS root_squash) degrades pairing persistence
|
||||||
chmod 664 "${homekit_config_path}"
|
# instead of crash-looping the service
|
||||||
|
chown go2rtc:frigate-data "${homekit_config_path}" 2>/dev/null && chmod 664 "${homekit_config_path}" 2>/dev/null || \
|
||||||
|
echo "[WARN] Could not hand ${homekit_config_path} to the go2rtc user; HomeKit pairing changes may not persist"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
readonly config_path="/config"
|
readonly config_path="/config"
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ echo "$nginx_settings" | \
|
|||||||
|
|
||||||
if [[ "$(id -u)" -eq 0 && "${FRIGATE_RUN_AS_ROOT:-false}" != "true" ]]; then
|
if [[ "$(id -u)" -eq 0 && "${FRIGATE_RUN_AS_ROOT:-false}" != "true" ]]; then
|
||||||
chown -R frigate:frigate /tmp/nginx
|
chown -R frigate:frigate /tmp/nginx
|
||||||
# only the self-signed key we just generated; user-mounted certs may be :ro
|
# self-signed certs are root-generated; tolerant because mounted certs may be :ro
|
||||||
if [ -f "$letsencrypt_path/privkey.pem" ]; then
|
if [ -f "$letsencrypt_path/privkey.pem" ]; then
|
||||||
chown frigate:frigate "$letsencrypt_path/privkey.pem" "$letsencrypt_path/fullchain.pem" 2>/dev/null || true
|
chown frigate:frigate "$letsencrypt_path/privkey.pem" "$letsencrypt_path/fullchain.pem" 2>/dev/null || true
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user