30-ownership.sh 781 B

123456789101112131415161718192021222324252627
  1. #!/command/with-contenv bash
  2. # shellcheck shell=bash
  3. set -e
  4. log_info 'Setting ownership ...'
  5. # root
  6. chown root /tmp/nginx
  7. # npm user and group
  8. chown -R "$PUID:$PGID" /data
  9. chown -R "$PUID:$PGID" /etc/letsencrypt
  10. chown -R "$PUID:$PGID" /run/nginx
  11. chown -R "$PUID:$PGID" /tmp/nginx
  12. chown -R "$PUID:$PGID" /var/cache/nginx
  13. chown -R "$PUID:$PGID" /var/lib/logrotate
  14. chown -R "$PUID:$PGID" /var/lib/nginx
  15. chown -R "$PUID:$PGID" /var/log/nginx
  16. # Don't chown entire /etc/nginx folder as this causes crashes on some systems
  17. chown -R "$PUID:$PGID" /etc/nginx/nginx
  18. chown -R "$PUID:$PGID" /etc/nginx/nginx.conf
  19. chown -R "$PUID:$PGID" /etc/nginx/conf.d
  20. # Prevents errors when installing python certbot plugins when non-root
  21. chown "$PUID:$PGID" /opt/certbot/lib/python3.7/site-packages/