capistrano / symfony

Capistrano tasks for deploying the Symfony standard edition
MIT License
353 stars 65 forks source link

Fix order of symfony:set_permissions #37

Closed amansilla closed 4 years ago

amansilla commented 9 years ago

I think the current postion of symfony:set_permissions is wrong. If you use different users for deployment (e.g. deploy) and your web server (www-data), the files generated by symfony:cache:warmup are going to be owned by deploy user instead of www-data as it should be, since symfony:cache:warmup is executed by the deployment user after symfony:set_permission.

This pull request solves the problem and updates the readme documentation as well.

amansilla commented 9 years ago

Anybody with time to take a look here? :smile:

peterjmit commented 9 years ago

@amansilla I am in the middle of moving countries but I should be able to take a look next week. At first glance though this should not be necessary

amansilla commented 9 years ago

@peterjmit just try to deploy as a different user than your web server user and you'll see what I mean.

peterjmit commented 9 years ago

@amansilla I have multiple projects (as do others AFAIK) running with the current setup and I haven't experienced or heard of any problems.

edit: Perhaps https://github.com/capistrano/symfony/issues/40 is related

Neirda24 commented 9 years ago

up

PGLongo commented 8 years ago

Any news? I've the same problem here, but I've temporarily fixed doing:

after 'deploy:updated', 'pglongo:permission'

    namespace :pglongo do
    desc "Fix cache permissions if deploy user is different from apache user"
    task :permission do
      on roles :all do
        paths = absolute_writable_paths
        execute :setfacl, '-R -m u:"apache":rwX -m u:`whoami`:rwX', *paths
        execute :setfacl, '-dR -m u:"apache":rwX -m u:`whoami`:rwX', *paths
    end
    end
    end

Notice that I've changed '-Rn' ->'-R' and '-dRn' -> '-dR' as in the Symfony doc, otherwise it won't works.

shakaran commented 8 years ago

BUMP @peterjmit

Nyholm commented 4 years ago

Closing due inactivity.