mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-11-28 16:27:07 +03:00
* hand renewed tls keys to the runtime user and time out the go2rtc healthcheck - Renewed certbot keys were owned by root with mode 0600, so the non-root nginx couldn't read them and every certsync reload failed until the cert expired. certsync now chowns a mounted key to the runtime user before each reload, under the same conditions as the nginx startup handover - The go2rtc healthcheck curl had no total timeout, so a go2rtc that accepted connections but never answered blocked the check forever. It now gives up after 15 s - The TLS and non-root docs now tell read-only mount users to set the key's group and group read, which certbot keeps on renewal * stop chowning mounted tls keys and check they're readable instead The root chown of a mounted key followed symlinks, so a runtime user that could write the cert folder could have any root file handed to it, and the chown never covered keys renewed after startup. Frigate no longer changes ownership of mounted certs. nginx startup logs an error naming the gid when the runtime user can't read the key, and the TLS docs have users grant group read once on the host, which certbot keeps on renewal. This also drops the certsync handover added earlier on this branch. * skip the tls key check when tls is disabled and tighten its wording * check fullchain.pem and folder access in the tls startup check
23 lines
850 B
Plaintext
Executable File
23 lines
850 B
Plaintext
Executable File
#!/command/with-contenv bash
|
|
# shellcheck shell=bash
|
|
# Start the go2rtc-healthcheck service
|
|
|
|
set -o errexit -o nounset -o pipefail
|
|
|
|
# Logs should be sent to stdout so that s6 can collect them
|
|
|
|
# Give some additional time for go2rtc to start before start pinging
|
|
sleep 10s
|
|
echo "[INFO] Starting go2rtc healthcheck service..."
|
|
|
|
while sleep 30s; do
|
|
# Check if the service is running
|
|
if ! curl --connect-timeout 10 --max-time 15 --fail --silent --show-error --output /dev/null http://127.0.0.1:1984/api/streams 2>&1; then
|
|
echo "[ERROR] The go2rtc service is not responding to ping, restarting..."
|
|
# We can also use -r instead of -t to send kill signal rather than term
|
|
s6-svc -t /var/run/service/go2rtc 2>&1
|
|
# Give some additional time to go2rtc to restart before start pinging again
|
|
sleep 10s
|
|
fi
|
|
done
|