chef-composer icon indicating copy to clipboard operation
chef-composer copied to clipboard

Composer home directory is not properly set for some users/systems

Open acoulton opened this issue 10 years ago • 0 comments

The composer_project resource defines a COMPOSER_HOME environment variable in the home directory of the composer user. However this is hardcoded:

environment({"COMPOSER_HOME" => "/home/#{new_resource.run_as}/.composer"})

This means that if the user has a nonstandard home directory (eg because it's a system user like www-data) it will fail to pick up the config files etc.

I think the proper way to do this would be to take the home directory from node['etc']['passwd'][new_resource.run_as]['dir'] - but probably it's best to calculate this as a default so that the end-user can also customise the home directory if required.

I can submit a pull if this seems like the right fix?

acoulton avatar Nov 18 '14 11:11 acoulton