1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/kresus_ynh.git synced 2024-09-03 19:36:10 +02:00

Add dedicated system user.

This adds a dependency on YNH version to be able to use helpers.
   Prepare work on #2.
This commit is contained in:
J. Fernando Lagrange 2017-09-17 11:09:49 +02:00
parent ceea8f3265
commit 21dd08c9a4
3 changed files with 14 additions and 1 deletions

View file

@ -13,7 +13,7 @@
"url": "https://github.com/scith" "url": "https://github.com/scith"
}, },
"requirements": { "requirements": {
"yunohost": ">= 2.4.0" "yunohost": ">= 2.6.4"
}, },
"multi_instance": true, "multi_instance": true,
"services": [ "services": [

View file

@ -9,6 +9,9 @@ app=$YNH_APP_INSTANCE_NAME
domain=$YNH_APP_ARG_DOMAIN domain=$YNH_APP_ARG_DOMAIN
path=$YNH_APP_ARG_PATH path=$YNH_APP_ARG_PATH
# Compute parameters
final_path=/home/yunohost.app/$app
# Source YunoHost helpers # Source YunoHost helpers
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -16,6 +19,13 @@ source /usr/share/yunohost/helpers
sudo yunohost app checkurl "${domain}${path}" -a "$app" \ sudo yunohost app checkurl "${domain}${path}" -a "$app" \
|| ynh_die "Path not available: ${domain}${path}" || ynh_die "Path not available: ${domain}${path}"
# Check system user availability
if ynh_system_user_exists "$app" ; then
ynh_die "System user $app already exists !"
else
ynh_system_user_create "$app" "$final_path"
fi
# Install dependencies # Install dependencies
sudo apt-get update sudo apt-get update
sudo apt-get install nodejs-legacy npm python-pip python-dev python-lxml python-imaging -y -qq sudo apt-get install nodejs-legacy npm python-pip python-dev python-lxml python-imaging -y -qq

View file

@ -17,3 +17,6 @@ sudo rm -f /etc/systemd/system/$app.service
# Reload nginx service # Reload nginx service
sudo service nginx reload sudo service nginx reload
# Remove dedicated system user
ynh_system_user_delete $app