diff --git a/hooks/post_user_create b/hooks/post_user_create index f62dbed..24ebf8c 100644 --- a/hooks/post_user_create +++ b/hooks/post_user_create @@ -1,6 +1,6 @@ #!/bin/bash -APP=${!#} user=$1 + sudo mkdir -p /home/$user -sudo setfacl -m g:$APP:rwx /home/$user +sudo setfacl -m g:#GROUP#:rwx /home/$user diff --git a/manifest.json b/manifest.json index 50ff561..a66c373 100644 --- a/manifest.json +++ b/manifest.json @@ -17,7 +17,7 @@ "mysql" ], "requirements": { - "yunohost": ">= 2.3.12" + "yunohost": ">= 2.3.16" }, "arguments": { "install" : [ diff --git a/scripts/install b/scripts/install index e8da711..817496b 100755 --- a/scripts/install +++ b/scripts/install @@ -53,6 +53,9 @@ sudo useradd -c "$app system account" \ -d /var/lib/$app --system --user-group $app \ || die "Unable to create $app system account" +# Set system group in hooks +sed -i "s@#GROUP#@${app}@g" ../hooks/post_user_create + # Create app folders sudo mkdir -p "$DESTDIR" "$DATADIR" diff --git a/scripts/upgrade b/scripts/upgrade index 3f407dc..e69b3a4 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -55,6 +55,9 @@ sudo cp ../conf/php-fpm.conf "$phpfpm_conf" sudo chown root: $phpfpm_conf sudo chmod 644 $phpfpm_conf +# Set system group in hooks +sed -i "s@#GROUP#@${app}@g" ../hooks/post_user_create + # occ helper for the current installation _exec_occ() { exec_occ "$DESTDIR" "$app" $@