diff --git a/conf/nginx.conf b/conf/nginx.conf index 2614b01..f4c59bf 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -3,11 +3,6 @@ location / { # Path to source alias __FINALPATH__/web/; - # Force usage of https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - index index.php; try_files $uri $uri/ __PATH__/__PATH__/index.php?$query_string; diff --git a/manifest.json b/manifest.json index 1f2ddbe..74128eb 100644 --- a/manifest.json +++ b/manifest.json @@ -13,7 +13,6 @@ "website": "https://www.elabftw.net", "demo": "https://demo.elabftw.net/login.php", "admindoc": "https://doc.elabftw.net/", - "userdoc": "https://yunohost.org/apps", "code": "https://github.com/elabftw/elabftw" }, "license": "AGPL-3.0-only", @@ -22,7 +21,7 @@ "email": "" }, "requirements": { - "yunohost": ">= 4.2.4" + "yunohost": ">= 4.3.0" }, "multi_instance": true, "services": [ @@ -33,8 +32,7 @@ "arguments": { "install": [{ "name": "domain", - "type": "domain", - "example": "example.com" + "type": "domain" }, { "name": "is_public", diff --git a/scripts/_common.sh b/scripts/_common.sh index e204bc0..d8b9a81 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -10,7 +10,7 @@ nodejs_version=14 YNH_PHP_VERSION="8.0" # dependencies used by the app -extra_php_dependencies="php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-exif php${YNH_PHP_VERSION}-fileinfo php${YNH_PHP_VERSION}-gettext php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-fileinfo php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-xml" +pkg_dependencies="php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-exif php${YNH_PHP_VERSION}-fileinfo php${YNH_PHP_VERSION}-gettext php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-fileinfo php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-xml" YNH_COMPOSER_VERSION="2.1.5" diff --git a/scripts/install b/scripts/install index d96f134..feb5acc 100644 --- a/scripts/install +++ b/scripts/install @@ -107,7 +107,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" +ynh_add_fpm_config phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= diff --git a/scripts/restore b/scripts/restore index c958361..8a14815 100644 --- a/scripts/restore +++ b/scripts/restore @@ -69,11 +69,10 @@ chown -R $app:www-data "$final_path" #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= +ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=1 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 81ff6a1..9f48d62 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -30,6 +30,20 @@ secret_key=$(ynh_app_setting_get --app=$app --key=secret_key) upgrade_type=$(ynh_check_app_version_changed) +#================================================= +# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +#================================================= +ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=7 + +# Backup the current version of the app +ynh_backup_before_upgrade +ynh_clean_setup () { + # restore it if the upgrade fails + ynh_restore_upgradebackup +} +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= @@ -54,20 +68,6 @@ if ynh_legacy_permissions_exists; then ynh_app_setting_delete --app=$app --key=is_public fi -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=7 - -# Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { - # restore it if the upgrade fails - ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - #================================================= # CREATE DEDICATED USER #================================================= @@ -87,7 +87,7 @@ then ynh_script_progression --message="Upgrading source files..." --weight=7 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" + ynh_setup_source --dest_dir="$final_path" --keep="$final_path/config.php" fi chmod 750 "$final_path" @@ -108,16 +108,7 @@ ynh_add_nginx_config ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --package="$extra_php_dependencies" - -#================================================= -# MODIFY A CONFIG FILE -#================================================= - -ynh_add_config --template="../conf/config.php" --destination="$final_path/config.php" - -chmod 400 "$final_path/config.php" -chown $app "$final_path/config.php" +ynh_add_fpm_config #================================================= # GENERIC FINALIZATION