-
-
Notifications
You must be signed in to change notification settings - Fork 801
Add platform-specific log directory permissions to nginx_config resource #648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: damacus <[email protected]>
Co-authored-by: damacus <[email protected]>
I think this would be best being platform specific as (from distant memory) the cookbook reflects the default install permissions from the nginx repo package and it's the same on Redhat based systems. Debian makes a lot of changes to make nginx work the same way they did with apache. |
resources/config.rb
Outdated
|
||
property :log_dir_mode, String, | ||
description: 'Log directory mode', | ||
default: '0755' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot This should be platform specific. Using 0750
by default and 0755
for Debian-like platforms
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented platform-specific log_dir_mode
- defaults to '0750' with '0755' for Debian-like platforms using platform_family?('debian')
check. Commit: 82ba2d8
Co-authored-by: bmhughes <[email protected]>
Made the |
Slowest examplesTop 10 slowest examples (0.92 seconds, 26.25% of total time)
|
The
nginx_config
resource currently uses a singlefolder_mode
property (default '0750') for all directories it creates, including both configuration directories and the log directory. This causes issues with logrotate on Debian-like systems, which expect more permissive log directory permissions to access log files.Changes Made
This PR introduces three new properties to provide fine-grained control over log directory permissions:
log_dir_mode
(platform-specific default) - Sets log directory permissions separately from config directories. Defaults to '0750' to match nginx repo package defaults, but uses '0755' for Debian-like platformslog_dir_owner
(default: lazy { owner }) - Allows independent log directory ownershiplog_dir_group
(default: lazy { group }) - Allows independent log directory groupExample Usage
Default behavior (platform-aware):
Custom log directory permissions:
Platform-Specific Behavior
The
log_dir_mode
default is now platform-aware:This reflects the different approaches these distributions take for nginx installation and configuration.
Backward Compatibility
This change is fully backward compatible:
folder_mode
(0750) for securityTesting
Fixes #622.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.