mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-05-02 03:52:29 +00:00
Update 30-ownership.sh
Make setting file permissions optional with SKIP_FILE_OWNERSHIP environment variable.
This commit is contained in:
parent
d3a654b546
commit
f4c05cf9cc
@ -3,26 +3,32 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
log_info 'Setting ownership ...'
|
# Lowercase
|
||||||
|
SKIP_FILE_OWNERSHIP=$(echo "${SKIP_FILE_OWNERSHIP:-}" | tr '[:upper:]' '[:lower:]')
|
||||||
|
|
||||||
# root
|
if [ "$SKIP_FILE_OWNERSHIP" == "false" ] || [ "$SKIP_FILE_OWNERSHIP" == "off" ] || [ "$SKIP_FILE_OWNERSHIP" == "0" ] || [ "$SKIP_FILE_OWNERSHIP" == "no" ]; then
|
||||||
chown root /tmp/nginx
|
log_info 'Skipping ownership, use only with caution ...'
|
||||||
|
else
|
||||||
# npm user and group
|
log_info 'Setting ownership ...'
|
||||||
chown -R "$PUID:$PGID" /data
|
# root
|
||||||
chown -R "$PUID:$PGID" /etc/letsencrypt
|
chown root /tmp/nginx
|
||||||
chown -R "$PUID:$PGID" /run/nginx
|
|
||||||
chown -R "$PUID:$PGID" /tmp/nginx
|
# npm user and group
|
||||||
chown -R "$PUID:$PGID" /var/cache/nginx
|
chown -R "$PUID:$PGID" /data
|
||||||
chown -R "$PUID:$PGID" /var/lib/logrotate
|
chown -R "$PUID:$PGID" /etc/letsencrypt
|
||||||
chown -R "$PUID:$PGID" /var/lib/nginx
|
chown -R "$PUID:$PGID" /run/nginx
|
||||||
chown -R "$PUID:$PGID" /var/log/nginx
|
chown -R "$PUID:$PGID" /tmp/nginx
|
||||||
|
chown -R "$PUID:$PGID" /var/cache/nginx
|
||||||
# Don't chown entire /etc/nginx folder as this causes crashes on some systems
|
chown -R "$PUID:$PGID" /var/lib/logrotate
|
||||||
chown -R "$PUID:$PGID" /etc/nginx/nginx
|
chown -R "$PUID:$PGID" /var/lib/nginx
|
||||||
chown -R "$PUID:$PGID" /etc/nginx/nginx.conf
|
chown -R "$PUID:$PGID" /var/log/nginx
|
||||||
chown -R "$PUID:$PGID" /etc/nginx/conf.d
|
|
||||||
|
# Don't chown entire /etc/nginx folder as this causes crashes on some systems
|
||||||
# Prevents errors when installing python certbot plugins when non-root
|
chown -R "$PUID:$PGID" /etc/nginx/nginx
|
||||||
chown "$PUID:$PGID" /opt/certbot /opt/certbot/bin
|
chown -R "$PUID:$PGID" /etc/nginx/nginx.conf
|
||||||
find /opt/certbot/lib/python*/site-packages -not -user "$PUID" -execdir chown "$PUID:$PGID" {} \+
|
chown -R "$PUID:$PGID" /etc/nginx/conf.d
|
||||||
|
|
||||||
|
# Prevents errors when installing python certbot plugins when non-root
|
||||||
|
chown "$PUID:$PGID" /opt/certbot /opt/certbot/bin
|
||||||
|
find /opt/certbot/lib/python*/site-packages -not -user "$PUID" -execdir chown "$PUID:$PGID" {} \+
|
||||||
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user