Fix static file permission handling - add user to www-data group instead of vice versa
This commit is contained in:
1 parent
3703af0d66
commit
6380577791
1 file changed
+4
-4
+4
-4
@@ -90,10 +90,10 @@ if sudo chown -R www-data:www-data static/ 2>/dev/null; then
|
|||||||
log_success "Static files ownership set to www-data"
|
log_success "Static files ownership set to www-data"
|
||||||
else
|
else
|
||||||
log_warning "Could not change ownership to www-data, using group permissions instead"
|
log_warning "Could not change ownership to www-data, using group permissions instead"
|
||||||
# Add www-data to the user's group and set group permissions
|
# Add user to www-data group for nginx access
|
||||||
sudo usermod -a -G $USER www-data 2>/dev/null || true
|
sudo usermod -a -G www-data $USER 2>/dev/null || true
|
||||||
sudo chmod -R 750 static/
|
sudo chmod -R 755 static/
|
||||||
find static/ -type f -exec sudo chmod 640 {} \;
|
find static/ -type f -exec sudo chmod 644 {} \;
|
||||||
log_info "Set group permissions for nginx access"
|
log_info "Set group permissions for nginx access"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user