Mercurial > hg > soundsoftware-site
diff deploy/provision.d/020-users.sh @ 1590:c18460da6620 dockerise
Numerous deployment updates
author | Chris Cannam |
---|---|
date | Thu, 17 Aug 2017 16:04:36 +0100 |
parents | 94669513c53c |
children |
line wrap: on
line diff
--- a/deploy/provision.d/020-users.sh Thu Aug 17 13:56:15 2017 +0100 +++ b/deploy/provision.d/020-users.sh Thu Aug 17 16:04:36 2017 +0100 @@ -2,11 +2,14 @@ set -e -# The "code" user (in group www-data) owns the site and repo -# directories. +# The webapp directory is owned and run by the code user, in group +# www-data. The repos and other things served directly are the other +# way around -- owned by the www-data user, in group code. -if ! grep -q '^code:' /etc/passwd ; then - groupadd code - useradd -g code -G www-data code -fi +for user in code docgen ; do + if ! grep -q "^$user:" /etc/passwd ; then + groupadd "$user" + useradd -g "$user" -G www-data "$user" + fi +done