diff --git a/conf/nginx.conf b/conf/nginx.conf index 75374c5..67cb88f 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -4,11 +4,6 @@ location __PATH__/ { # Path to source alias __FINALPATH__/ ; - # Force usage of https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - index www/index.php; try_files $uri $uri/ index.php; diff --git a/manifest.json b/manifest.json index ca2f01f..24375fa 100644 --- a/manifest.json +++ b/manifest.json @@ -14,7 +14,7 @@ "email": "misterl56@hotmail.com" }, "requirements": { - "yunohost": ">= 4.2.8" + "yunohost": ">= 4.3.0" }, "multi_instance": false, "services": [ diff --git a/scripts/_common.sh b/scripts/_common.sh index 7586433..29d5f2c 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -3,6 +3,7 @@ #================================================= YNH_PHP_VERSION="7.3" -extra_php_dependencies="php${YNH_PHP_VERSION}-geoip php${YNH_PHP_VERSION}-cli" + +pkg_dependencies="php${YNH_PHP_VERSION}-geoip php${YNH_PHP_VERSION}-cli" lang="fr_FR.UTF-8 en_US.UTF-8 it_IT.UTF-8" diff --git a/scripts/install b/scripts/install index f19de20..083cbbe 100644 --- a/scripts/install +++ b/scripts/install @@ -26,6 +26,7 @@ path_url=$YNH_APP_ARG_PATH admin=$YNH_APP_ARG_ADMIN password=$YNH_APP_ARG_PASSWORD is_public=$YNH_APP_ARG_IS_PUBLIC +phpversion=$YNH_PHP_VERSION app=$YNH_APP_INSTANCE_NAME @@ -48,6 +49,14 @@ ynh_script_progression --message="Storing installation settings..." --weight=1 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=admin --value=$admin +ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion + +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing dependencies..." --weight=1 + +ynh_install_app_dependencies $pkg_dependencies #================================================= #INSTALL DEPENDENCIES @@ -99,8 +108,7 @@ ynh_add_nginx_config ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --package="$extra_php_dependencies" -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +ynh_add_fpm_config #=============================================== # ADD A CONFIGURATION diff --git a/scripts/restore b/scripts/restore index b8a8143..d318025 100644 --- a/scripts/restore +++ b/scripts/restore @@ -35,8 +35,7 @@ admin=$(ynh_app_setting_get --app=$app --key=admin) #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=1 -test ! -d $final_path \ - || ynh_die "There is already a directory: $final_path " +test ! -d $final_path || ynh_die "There is already a directory: $final_path " # Check user ynh_user_exists "$admin" @@ -64,8 +63,6 @@ ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=5 ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" -ynh_add_fpm_config --package="$extra_php_dependencies" - #================================================= # RESTORE THE MYSQL DATABASE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index c90e112..aa69eb4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -86,19 +86,6 @@ ynh_script_progression --message="Upgrading dependencies..." ynh_install_app_dependencies $pkg_dependencies -#================================================= -#UPDATE SETTINGS -#================================================= - -#mysqlpwd setting was implemented in ynh2 - check if saved and if not implement -db_pass=$(ynh_app_setting_get $app mysqlpwd) -if [ -z $db_pass ]; then -#c'est moche mais ça fera bien l'affaire - en deux lignes sinon pb en fonction du type de shell - t=$(cat /var/www/$app/conf.php | grep DBPASS) - db_pass=${t:26:24} - ynh_app_setting_set $app mysqlpwd $db_pass -fi - #================================================= #INSTALL SOURCES #===============================================