[enh] review, variables, typo, syntax, fixes

- update yunohost package version dependency
- use variable for $nginx_conf
- rename $final_path to $src_path variable for data path
- other small fixes
This commit is contained in:
Moul
2016-06-13 22:25:00 +02:00
parent 16f11425a2
commit bdbe0ac79e
6 changed files with 32 additions and 34 deletions

View File

@@ -20,35 +20,35 @@ language=$(ynh_app_setting_get "$app" language)
path=${path%/}
# Copy source files
final_path=/var/www/$app
sudo mkdir -p $final_path
sudo cp -a ../sources/. $final_path
src_path=/var/www/$app
sudo mkdir -p $src_path
sudo cp -a ../sources/. $src_path
# Set permissions to app files
# you may need to make some file and/or directory writeable by www-data (nginx user)
sudo chown -R root:root $final_path
sudo chown -R root: $src_path
# Modify Nginx configuration file and copy it to Nginx conf directory
sed -i "s@YNH_WWW_PATH@$path@g" ../conf/nginx.conf
sed -i "s@YNH_WWW_ALIAS@$final_path/@g" ../conf/nginx.conf
nginx_conf=../conf/nginx.conf
sed -i "s@YNH_WWW_PATH@$path@g" $nginx_conf
sed -i "s@YNH_WWW_ALIAS@$src_path/@g" $nginx_conf
# If a dedicated php-fpm process is used:
#
# sudo sed -i "s@YNH_WWW_APP@$app@g" ../conf/nginx.conf
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
# sed -i "s@YNH_WWW_APP@$app@g" $nginx_conf
sudo cp $nginx_conf /etc/nginx/conf.d/$domain.d/$app.conf
# If a dedicated php-fpm process is used:
#
# # Modify PHP-FPM pool configuration and copy it to the pool directory
# sed -i "s@YNH_WWW_APP@$app@g" ../conf/php-fpm.conf
# sed -i "s@YNH_WWW_ALIAS@$final_path/@g" ../conf/php-fpm.conf
# sed -i "s@YNH_WWW_ALIAS@$src_path/@g" ../conf/php-fpm.conf
# finalphpconf=/etc/php5/fpm/pool.d/$app.conf
# sudo cp ../conf/php-fpm.conf $finalphpconf
# sudo chown root: $finalphpconf
# sudo chmod 644 $finalphpconf
# If app is public, add url to SSOWat conf as skipped_uris
if [[ $is_public -eq 1 ]];
then
if [[ $is_public -eq 1 ]]; then
# See install script
ynh_app_setting_set "$app" unprotected_uris "/"
fi
@@ -57,5 +57,5 @@ fi
#
# sudo service php5-fpm restart
# Restart services
# Reload nginx service
sudo service nginx reload