mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-11-16 02:23:02 +03:00
feat: native support for rootless container execution
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#!/command/with-contenv bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
exec logutil-service /dev/shm/logs/certsync
|
||||
exec /usr/local/bin/logutil /dev/shm/logs/certsync/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/command/with-contenv bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
exec logutil-service /dev/shm/logs/frigate
|
||||
exec /usr/local/bin/logutil /dev/shm/logs/frigate/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/command/with-contenv bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
exec logutil-service /dev/shm/logs/go2rtc
|
||||
exec /usr/local/bin/logutil /dev/shm/logs/go2rtc/
|
||||
|
||||
@@ -7,5 +7,7 @@ set -o errexit -o nounset -o pipefail
|
||||
dirs=(/dev/shm/logs/frigate /dev/shm/logs/go2rtc /dev/shm/logs/nginx /dev/shm/logs/certsync)
|
||||
|
||||
mkdir -p "${dirs[@]}"
|
||||
chown nobody:nogroup "${dirs[@]}"
|
||||
if [ "$(id -u)" = "0" ]; then
|
||||
chown nobody:nogroup "${dirs[@]}"
|
||||
fi
|
||||
chmod 02755 "${dirs[@]}"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/command/with-contenv bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
exec logutil-service /dev/shm/logs/nginx
|
||||
exec /usr/local/bin/logutil /dev/shm/logs/nginx/
|
||||
|
||||
@@ -65,6 +65,11 @@ function set_worker_processes() {
|
||||
|
||||
set_worker_processes
|
||||
|
||||
# NGINX cannot switch users if running rootless; strip the directive
|
||||
if [ "$(id -u)" != "0" ]; then
|
||||
sed -i '/^user root;/d' /usr/local/nginx/conf/nginx.conf || true
|
||||
fi
|
||||
|
||||
# ensure the directory for ACME challenges exists
|
||||
mkdir -p /etc/letsencrypt/www
|
||||
|
||||
|
||||
Reference in New Issue
Block a user