capistrano / capistrano/symfony

Permission issue using ACL

Open
#65 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
353
Forks
61
PR merge metrics
No merged PRs in 30d

Description

Hi there,

I use ACL to set permissions on certain directories upon deployment. Here's the part of `deploy.rb`:

```
set :linked_files, ['app/config/parameters.yml']
set :linked_dirs, ["app/logs", "web/uploads"]

set :permission_method, :acl
set :file_permissions_paths, ["app/logs", "app/cache", "web/uploads"]
set :file_permissions_users, ["www-data"]

before "deploy:updated", "deploy:set_permissions:acl"
```

So this works on the first deployment, when you set up your directories where nothing has been created inside them yet. However, after some time, say you uploaded an image to the `web/uploads` directory, the file would be under the `www-data` user, while the directory is still owned by the deploy user. So when you deploy code again, capistrano will fail because it attempts to run acl on a directory that contains files owned by `www-data`.

How can I work around this?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the deploy.rb permission configuration shown in the issue and reproduce a second deployment after a file exists in web/uploads under www-data. Trace the deploy:set_permissions:acl task and determine the expected behavior for directories containing files with different ownership; done means a repeat deployment completes without the ACL failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.