Search code examples
linuxfile-permissionsvlad-deployer

vlad the deployer - deploying with different users?


We're using vlad the deployer for deploying rails apps to production and test servers. All our servers are Ubuntu servers.

We have a problem related with linux permissions.

Vlad uses ssh to put files on any server, be it production or test. My company has several people, and each one has a different account on each server.

On the other hand, the way our Apache server is configured, it uses the "owner" of a website directory for reading files on that directory.

As a result, the user that makes the first deployment becomes the "owner" of the site; other users can't make deployments - Apache will not be able to read the modified files, since the owner has changed.

Normally this isn't much of an issue, but now holidays are approaching and we'd like to solve this as cleanly as possible - for example, we'd like to avoid sharing passwords/ssh keys.

Ideally I would need one vlad task that does something to the permissions of the deployed files so they could be completely modified by other users. I don't know enough about unix commands in order to do this.


Solution

  • I've been fighting with it for a couple months now and I've only found a couple ways to do it:

    • Use a single shared account for all the users deploying to the server (boo!)
    • Use different accounts, but make a chown to a common user account (www-data, rails, or similar) before performing account-dependant tasks (such as the svn update). This might work, but I haven't tested it.
    • Use access control lists. Someone has hinted at me that this might be the right solution. However, I don't have the knowledge or time to make this work properly.

    For now, we are just continuing using one single user per project, and chowning everything manually when needed. It's a bit of a pain, but it works.