1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/cops_ynh.git synced 2024-09-03 18:25:57 +02:00

Use of runninguser instead of usergroup

This commit is contained in:
polytan02 2016-12-22 00:44:07 +00:00
parent 195558564d
commit 499a1777c4
5 changed files with 11 additions and 10 deletions

View file

@ -15,7 +15,7 @@ domain=$(ynh_app_setting_get $app domain)
is_public=$(ynh_app_setting_get $app is_public)
finalnginxconf=$(ynh_app_setting_get $app finalnginxconf)
finalphpconf=$(ynh_app_setting_get $app finalphpconf)
runninguser=$(ynh_app_setting_get $app runninguser)
# Backup sources & data
# Note: the last argument is where to save this path, see the restore script.

View file

@ -15,7 +15,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$YNH_APP_ARG_DOMAIN
path=$YNH_APP_ARG_PATH
is_public=$YNH_APP_ARG_IS_PUBLIC
usergroup="owncloud:owncloud"
runninguser="owncloud"
# We check variables are not empty
CHECK_VAR "$app" "app name not set"
@ -31,7 +31,7 @@ CHECK_FINALPATH
final_path=/var/www/$app
# Define variables and Save app settings
ynh_app_setting_set "$app" usergroup "$usergroup"
ynh_app_setting_set "$app" runninguser "$runninguser"
ynh_app_setting_set "$app" domain "$domain"
ynh_app_setting_set "$app" is_public "$is_public"
ynh_app_setting_set "$app" final_path "$final_path"
@ -54,7 +54,7 @@ sudo mkdir -p $final_path
# Set permissions
sudo chmod 775 -R $final_path
sudo chown -hR $usergroup $final_path
sudo chown -hR $runninguser:$runninguser $final_path
# Modify Nginx configuration file and copy it to Nginx conf directory
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf
@ -65,7 +65,7 @@ sudo cp ../conf/nginx.conf $finalnginxconf
sed -i "s@NAMETOCHANGE@$app@g" ../conf/php-fpm.conf
sed -i "s@FOLDERTOCHANGE@$final_path@g" ../conf/php-fpm.conf
sed -i "s@USERTOCHANGE@$usergroup@g" ../conf/php-fpm.conf
sed -i "s@USERTOCHANGE@$runninguser@g" ../conf/php-fpm.conf
sudo cp ../conf/php-fpm.conf $finalphpconf
sudo chown root: $finalphpconf

View file

@ -22,6 +22,7 @@ final_path=$(ynh_app_setting_get $app final_path)
sitename=$(ynh_app_setting_get $app sitename)
finalnginxconf=$(ynh_app_setting_get $app finalnginxconf)
finalphpconf=$(ynh_app_setting_get $app finalphpconf)
runninguser=$(ynh_app_setting_get $app runninguser)
# Suppression du dossier de la webapp
sudo rm -rf $final_path

View file

@ -20,7 +20,7 @@ domain=$(ynh_app_setting_get $app domain)
is_public=$(ynh_app_setting_get $app is_public)
finalnginxconf=$(ynh_app_setting_get $app finalnginxconf)
finalphpconf=$(ynh_app_setting_get $app finalphpconf)
usergroup=$(ynh_app_setting_get $app usergroup)
runninguser=$(ynh_app_setting_get $app runninguser)
# Check domain/path availability
#sudo yunohost app checkurl "${domain}${path}" -a "$app" \
@ -32,7 +32,7 @@ sudo cp -a ./sources/* $final_path/
# Restore permissions to app files
# you may need to make some file and/or directory writeable by www-data (nginx user)
sudo chown -R $usergroup $final_path
sudo chown -R $runninguser:$runninguser $final_path
### MySQL (remove if not used) ###
# If a MySQL database is used:

View file

@ -22,7 +22,7 @@ final_path=$(ynh_app_setting_get $app final_path)
sitename=$(ynh_app_setting_get $app sitename)
finalnginxconf=$(ynh_app_setting_get $app finalnginxconf)
finalphpconf=$(ynh_app_setting_get $app finalphpconf)
usergroup=$(ynh_app_setting_get $app usergroup)
runninguser=$(ynh_app_setting_get $app runninguser)
# Modify Nginx configuration file and copy it to Nginx conf directory
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf
@ -33,7 +33,7 @@ sudo cp ../conf/nginx.conf $finalnginxconf
sed -i "s@NAMETOCHANGE@$app@g" ../conf/php-fpm.conf
sed -i "s@FOLDERTOCHANGE@$final_path@g" ../conf/php-fpm.conf
sed -i "s@USERTOCHANGE@$usergroup@g" ../conf/php-fpm.conf
sed -i "s@USERTOCHANGE@$runninguser@g" ../conf/php-fpm.conf
sudo cp ../conf/php-fpm.conf $finalphpconf
sudo chown root: $finalphpconf
@ -42,7 +42,7 @@ sudo chmod 644 $finalphpconf
# We adjust permissions
sudo chmod 775 -R $final_path
sudo chown -hR $usergroup $final_path
sudo chown -hR $runninguser:$runninguser $final_path
# Make app public if necessary