Don't install npm dependencies in /var/log

The ${epuser} home directory is being set to ${base_log_dir} which
results in the npm dependencies being installed into /var/log.

Create a regular homedir for the user (it's not put under
${base_install_dir} because we want that owned by the user, which is a
race).

Change-Id: I0020468ec275c7f12f038f5a152fe9adab64a3e8
This commit is contained in:
Ian Wienand 2017-12-18 15:22:58 +11:00
parent 0b7f9dcd33
commit ad5cc1f357
1 changed files with 7 additions and 6 deletions

View File

@ -26,11 +26,11 @@ class etherpad_lite (
$path = "/usr/local/bin:/usr/bin:/bin:${base_install_dir}/etherpad-lite"
user { $ep_user:
shell => '/usr/sbin/nologin',
home => "${base_log_dir}/${ep_user}",
system => true,
gid => $ep_user,
require => Group[$ep_user],
shell => '/usr/sbin/nologin',
system => true,
gid => $ep_user,
require => Group[$ep_user],
managehome => true,
}
group { $ep_user:
@ -95,11 +95,12 @@ class etherpad_lite (
path => $path,
user => $ep_user,
cwd => "${base_install_dir}/etherpad-lite",
environment => "HOME=${base_log_dir}/${ep_user}",
environment => "HOME=/home/${ep_user}",
require => [
Package['curl'],
Vcsrepo["${base_install_dir}/etherpad-lite"],
Anchor['nodejs-anchor'],
User[$ep_user],
],
before => File["${base_install_dir}/etherpad-lite/settings.json"],
creates => "${base_install_dir}/etherpad-lite/node_modules",