diff --git a/conf/nginx.conf b/conf/nginx.conf index d3513a7..e8d8aac 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -17,7 +17,7 @@ location __PATH__/ { try_files $uri $uri/ index.php; location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; - fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock; + fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; fastcgi_index index.php; include fastcgi_params; diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index b278147..ccade7b 100644 --- a/conf/php-fpm.conf +++ b/conf/php-fpm.conf @@ -30,7 +30,7 @@ group = __USER__ ; specific port; ; '/path/to/unix/socket' - to listen on a unix socket. ; Note: This value is mandatory. -listen = /var/run/php7-fpm-__NAMETOCHANGE__.sock +listen = /var/run/php__PHPVERSION__-fpm-__NAMETOCHANGE__.sock ; Set listen(2) backlog. ; Default Value: 128 (-1 on FreeBSD and OpenBSD) diff --git a/conf/php-fpm.ini b/conf/php-fpm.ini deleted file mode 100644 index 18ddf9c..0000000 --- a/conf/php-fpm.ini +++ /dev/null @@ -1 +0,0 @@ -post_max_size=30M \ No newline at end of file diff --git a/scripts/_common.sh b/scripts/_common.sh index b0cbf30..224cc38 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,7 +7,7 @@ # dependencies used by the app #pkg_dependencies="" -#YNH_PHP_VERSION="7.3" +YNH_PHP_VERSION="7.3" #================================================= # PERSONAL HELPERS diff --git a/scripts/backup b/scripts/backup index e885b2c..df7da25 100644 --- a/scripts/backup +++ b/scripts/backup @@ -31,7 +31,7 @@ app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP diff --git a/scripts/install b/scripts/install index a20af47..37023af 100644 --- a/scripts/install +++ b/scripts/install @@ -35,8 +35,6 @@ app=$YNH_APP_INSTANCE_NAME #================================================= ynh_script_progression --message="Validating installation parameters..." --time --weight=1 -### If the app uses nginx as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app". -### If the app provides an internal web server (or uses another application server such as uwsgi), the final path should be "/opt/yunohost/$app" final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" @@ -80,11 +78,13 @@ ynh_system_user_create --username=$app #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring php-fpm..." --time --weight=1 +ynh_script_progression --message="Configuring PHP-fpm..." --time --weight=1 # Create a dedicated php-fpm config ynh_add_fpm_config +phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion) + #================================================= # GENERIC FINALIZATION #================================================= @@ -99,17 +99,16 @@ chown -R $app: $final_path #================================================= ynh_script_progression --message="Configuring SSOwat..." --time --weight=1 -# Make app public if necessary +# Make app public if necessary or protect it if [ $is_public -eq 1 ] then - # unprotected_uris allows SSO credentials to be passed anyway. - ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" + ynh_permission_update --permission "main" --add "visitors" fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --time --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1 ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/remove b/scripts/remove index 5f82707..0f6cec9 100644 --- a/scripts/remove +++ b/scripts/remove @@ -51,7 +51,7 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing nginx web server configuration..." --time --weight=1 +ynh_script_progression --message="Removing NGINX web server configuration..." --time --weight=1 # Remove the dedicated nginx config ynh_remove_nginx_config @@ -59,7 +59,7 @@ ynh_remove_nginx_config #================================================= # REMOVE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Removing php-fpm configuration..." --time --weight=1 +ynh_script_progression --message="Removing PHP-fpm configuration..." --time --weight=1 # Remove the dedicated php-fpm config ynh_remove_fpm_config diff --git a/scripts/restore b/scripts/restore index 7ffc012..1c6b490 100644 --- a/scripts/restore +++ b/scripts/restore @@ -14,11 +14,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - #### Remove this function if there's nothing to clean before calling the remove script. - true -} -# Exit if an error occurs during the execution of the script ynh_abort_if_errors #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 0e484d0..59289cb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -94,15 +94,15 @@ ynh_system_user_create --username=$app #================================================= # Set permissions to app files -chown -R $app $final_path +chown -R $app: $final_path #================================================= # PHP-FPM CONFIGURATION #================================================= ynh_script_progression --message="Upgrading PHP-fpm configuration..." --weight=1 -# Create a dedicated php-fpm config -ynh_add_fpm_config #--package="$extra_php_dependencies" +# Create a dedicated PHP-fpm config +ynh_add_fpm_config #================================================= # RELOAD NGINX