Skip to content
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

Added ability to modify the other ACL #20

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ release, this gem would execute the following:
[..] setfacl -Rn -m u:www-data:rwX -m u:<deploy-user>:rwX <path-to-app>/shared/app/logs <path-to-app>/<release>/app/cache
```

Additionally, if you were interested in modifying the `other` ACL, setting `file_permissions_modify_other` to `true` would do the following:
```
[..] setfacl -Rn -m u:www-data:rwX -m u:<deploy-user>:rwX -m o::rwX <path-to-app>/shared/app/logs <path-to-app>/<release>/app/cache
```

### Other tasks
* deploy:set_permissions:chmod
* deploy:set_permissions:chgrp
Expand All @@ -61,6 +66,7 @@ The gem makes the following configuration variables available (shown with defaul

```ruby
set :file_permissions_roles, :all
set :file_permissions_modify_other, false
set :file_permissions_paths, []
set :file_permissions_users, []
set :file_permissions_groups, []
Expand Down
5 changes: 5 additions & 0 deletions lib/capistrano/tasks/file-permissions.rake
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ namespace :deploy do
entries.push(*acl_entries(fetch(:file_permissions_groups), 'g'))
end

if fetch(:file_permissions_modify_other)
entries.push(*acl_entries([''], 'o'))
end

entries = entries.map { |e| "-m #{e}" }.join(' ')

execute :setfacl, "-R", entries, *paths
Expand Down Expand Up @@ -94,6 +98,7 @@ end
namespace :load do
task :defaults do
set :file_permissions_roles, :all
set :file_permissions_modify_other, false
set :file_permissions_paths, []
set :file_permissions_users, []
set :file_permissions_groups, []
Expand Down