2023-03-20 06:56:52 +00:00
|
|
|
#!/command/with-contenv bash
|
|
|
|
# shellcheck shell=bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
log_info 'Setting ownership ...'
|
|
|
|
|
|
|
|
# root
|
|
|
|
chown root /tmp/nginx
|
|
|
|
|
2023-05-04 00:03:06 +00:00
|
|
|
# npm user and group
|
2023-05-03 22:27:38 +00:00
|
|
|
chown -R "$PUID:$PGID" /data
|
|
|
|
chown -R "$PUID:$PGID" /etc/letsencrypt
|
|
|
|
chown -R "$PUID:$PGID" /run/nginx
|
|
|
|
chown -R "$PUID:$PGID" /tmp/nginx
|
|
|
|
chown -R "$PUID:$PGID" /var/cache/nginx
|
|
|
|
chown -R "$PUID:$PGID" /var/lib/logrotate
|
|
|
|
chown -R "$PUID:$PGID" /var/lib/nginx
|
|
|
|
chown -R "$PUID:$PGID" /var/log/nginx
|
2023-03-28 00:39:26 +00:00
|
|
|
|
|
|
|
# Don't chown entire /etc/nginx folder as this causes crashes on some systems
|
2023-05-03 22:27:38 +00:00
|
|
|
chown -R "$PUID:$PGID" /etc/nginx/nginx
|
|
|
|
chown -R "$PUID:$PGID" /etc/nginx/nginx.conf
|
|
|
|
chown -R "$PUID:$PGID" /etc/nginx/conf.d
|
2023-05-10 04:39:08 +00:00
|
|
|
|
|
|
|
# Prevents errors when installing python certbot plugins when non-root
|
2024-01-18 02:26:55 +00:00
|
|
|
chown "$PUID:$PGID" /opt/certbot /opt/certbot/bin
|
2024-03-10 00:55:18 +00:00
|
|
|
find /opt/certbot/lib/python*/site-packages -not -user "$PUID" -execdir chown "$PUID:$PGID" {} \+
|