diff --git a/conf/php-fpm.conf b/conf/extra_php-fpm.conf similarity index 100% rename from conf/php-fpm.conf rename to conf/extra_php-fpm.conf diff --git a/conf/nginx.conf b/conf/nginx.conf index d29b7e1..ca51a82 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -14,6 +14,8 @@ location __PATH__/ { index index.php; + client_max_body_size 50M; + location ~ ^(.+\.php)(.*)$ { include fastcgi_params; fastcgi_split_path_info ^(.+\.php)(.*)$; diff --git a/scripts/install b/scripts/install index 39b34c0..803ea56 100644 --- a/scripts/install +++ b/scripts/install @@ -26,12 +26,16 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH password=$YNH_APP_ARG_PASSWORD +phpversion=$YNH_PHP_VERSION app=$YNH_APP_INSTANCE_NAME timezone=$(cat /etc/timezone) encrypt_key=$(ynh_string_random 24) password_hash=$(echo -n admin:BaikalDAV:$password | sha256sum | cut -d ' ' -f 1) +fpm_footprint="low" +fpm_free_footprint=0 +fpm_usage="low" #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS @@ -59,6 +63,9 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=encrypt_key --value="$encrypt_key" ynh_app_setting_set --app=$app --key=password_hash --value="$password_hash" +ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint +ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint +ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage #================================================= # STANDARD MODIFICATIONS @@ -106,7 +113,7 @@ chown -R $app:www-data "$final_path" ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 # Create a dedicated PHP-FPM config -ynh_add_fpm_config +ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index fe9e335..e9e9f02 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -26,6 +26,10 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) password_hash=$(ynh_app_setting_get --app=$app --key=password_hash) encrypt_key=$(ynh_app_setting_get --app=$app --key=encrypt_key) +fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) +fpm_free_footprint=$(ynh_app_setting_get --app=$app --key=fpm_free_footprint) +fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) + #================================================= # CHECK VERSION #================================================= @@ -73,6 +77,23 @@ if [ -z "$password_hash" ]; then ynh_app_setting_set --app=$app --key=password_hash --value=$password_hash fi +# If fpm_footprint doesn't exist, create it +if [ -z "$fpm_footprint" ]; then + fpm_footprint=low + ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint +fi + +# If fpm_free_footprint doesn't exist, create it +if [ -z "$fpm_free_footprint" ]; then + fpm_free_footprint=0 + ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint +fi + +# If fpm_usage doesn't exist, create it +if [ -z "$fpm_usage" ]; then + fpm_usage=low + ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage +fi # Cleaning legacy permissions if ynh_legacy_permissions_exists; then @@ -123,7 +144,7 @@ ynh_install_app_dependencies $pkg_dependencies ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 # Create a dedicated PHP-FPM config -ynh_add_fpm_config +ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint #================================================= # NGINX CONFIGURATION