From 9fa44c86d51511ef1e838eb3ad5e4ea95a761fdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 25 Apr 2023 21:02:28 +0200 Subject: [PATCH 01/20] v2 --- conf/app.src | 6 -- conf/extra_php-fpm.conf | 2 +- conf/nginx.conf | 2 +- manifest.toml | 75 +++++++++++++++++++++++ scripts/_common.sh | 36 +++++------ scripts/backup | 16 ++--- scripts/change_url | 74 +++++++++++----------- scripts/install | 124 ++++++++++++++++++------------------- scripts/remove | 28 ++++----- scripts/restore | 66 ++++++++++---------- scripts/upgrade | 132 ++++++++++++++++++++-------------------- 11 files changed, 316 insertions(+), 245 deletions(-) delete mode 100644 conf/app.src create mode 100644 manifest.toml diff --git a/conf/app.src b/conf/app.src deleted file mode 100644 index 53b6dbb..0000000 --- a/conf/app.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://downloads.wordpress.org/release/wordpress-6.2.zip -SOURCE_SUM=0078e0483d3447a465f71d6bbdab5c799cad2e57c221ec1d639d235b0ffced55 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=zip -SOURCE_IN_SUBDIR=true -SOURCE_EXTRACT=true diff --git a/conf/extra_php-fpm.conf b/conf/extra_php-fpm.conf index bb96483..f530c24 100644 --- a/conf/extra_php-fpm.conf +++ b/conf/extra_php-fpm.conf @@ -4,4 +4,4 @@ php_admin_value[upload_max_filesize] = 50M php_admin_value[memory_limit] = 64M php_admin_value[post_max_size] = 50M -php_admin_value[upload_tmp_dir] = __FINALPATH__/wp-content/temp/ +php_admin_value[upload_tmp_dir] = __INSTALL_DIR__/wp-content/temp/ diff --git a/conf/nginx.conf b/conf/nginx.conf index 53daa91..eb53526 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -8,7 +8,7 @@ location __PATH__/ { # Path to source - alias __FINALPATH__/; + alias __INSTALL_DIR__/; index index.php; if (!-e $request_filename) diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..23d7fab --- /dev/null +++ b/manifest.toml @@ -0,0 +1,75 @@ +packaging_format = 2 + +id = "wordpress" +name = "WordPress" +description.en = "Create a beautiful blog or website easily" +description.fr = "Logiciel de création de blog ou de site Web" + +version = "6.2~ynh1" + +maintainers = ["kay0u"] + +[upstream] +license = "GPL-2.0" +website = "https://wordpress.org/" +admindoc = "https://codex.wordpress.org/" +code = "https://core.trac.wordpress.org/browser" +cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) +fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. + +[integration] +yunohost = ">= 11.0.9" +architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +multi_instance = true +ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. +sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. +disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... +ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... + +[install] + [install.domain] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "domain" + + [install.path] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "path" + default = "/blog" + + [install.init_main_permission] + type = "group" + default = "visitors" + + [install.language] + ask.en = "Choose the application language" + ask.fr = "Choisissez la langue de l'application" + type = "string" + choices = ["en_US", "fr_FR"] + default = "en_US" + + [install.admin] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "user" + + [install.multisite] + ask.en = "Enable multisite option?" + ask.fr = "Activer l'option multisite ?" + type = "boolean" + default = false + +[resources] + [resources.sources.main] + url = "https://downloads.wordpress.org/release/wordpress-6.2.zip" + sha256 = "0078e0483d3447a465f71d6bbdab5c799cad2e57c221ec1d639d235b0ffced55" + + + [resources.system_user] + + [resources.install_dir] + + [resources.permissions] + main.url = "/" + + [resources.database] + type = "mysql" diff --git a/scripts/_common.sh b/scripts/_common.sh index 4c9ef61..312b8b8 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,9 +4,9 @@ # COMMON VARIABLES #================================================= -YNH_PHP_VERSION="8.0" +#REMOVEME? YNH_PHP_VERSION="8.0" -pkg_dependencies="php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-soap php${YNH_PHP_VERSION}-ssh2 php${YNH_PHP_VERSION}-tokenizer php${YNH_PHP_VERSION}-ldap" +#REMOVEME? pkg_dependencies="php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-soap php${YNH_PHP_VERSION}-ssh2 php${YNH_PHP_VERSION}-tokenizer php${YNH_PHP_VERSION}-ldap" #================================================= # EXPERIMENTAL HELPERS @@ -35,7 +35,7 @@ ynh_send_readme_to_admin() { type="${type:-install}" # Get the value of admin_mail_html - admin_mail_html=$(ynh_app_setting_get $app admin_mail_html) +#REMOVEME? admin_mail_html=$(ynh_app_setting_get $app admin_mail_html) admin_mail_html="${admin_mail_html:-0}" # Retrieve the email of users @@ -154,12 +154,12 @@ __PRE_TAG1__$(yunohost tools diagnosis | grep -B 100 "services:" | sed '/service #================================================= ynh_maintenance_mode_ON () { - # Load value of $path_url and $domain from the config if their not set - if [ -z $path_url ]; then - path_url=$(ynh_app_setting_get $app path) + # Load value of $path and $domain from the config if their not set + if [ -z $path ]; then +#REMOVEME? path=$(ynh_app_setting_get $app path) fi if [ -z $domain ]; then - domain=$(ynh_app_setting_get $app domain) +#REMOVEME? domain=$(ynh_app_setting_get $app domain) fi mkdir -p /var/www/html/ @@ -186,10 +186,10 @@ ynh_maintenance_mode_ON () { " > "/var/www/html/maintenance.$app.html" # Create a new nginx config file to redirect all access to the app to the maintenance notice instead. - echo "# All request to the app will be redirected to ${path_url}_maintenance and fall on the maintenance notice -rewrite ^${path_url}/(.*)$ ${path_url}_maintenance/? redirect; + echo "# All request to the app will be redirected to ${path}_maintenance and fall on the maintenance notice +rewrite ^${path}/(.*)$ ${path}_maintenance/? redirect; # Use another location, to not be in conflict with the original config file -location ${path_url}_maintenance/ { +location ${path}_maintenance/ { alias /var/www/html/ ; try_files maintenance.$app.html =503; @@ -200,7 +200,7 @@ include conf.d/yunohost_panel.conf.inc; # The current config file will redirect all requests to the root of the app. # To keep the full path, we can use the following rewrite rule: - # rewrite ^${path_url}/(.*)$ ${path_url}_maintenance/\$1? redirect; + # rewrite ^${path}/(.*)$ ${path}_maintenance/\$1? redirect; # The difference will be in the $1 at the end, which keep the following queries. # But, if it works perfectly for a html request, there's an issue with any php files. # This files are treated as simple files, and will be downloaded by the browser. @@ -210,16 +210,16 @@ include conf.d/yunohost_panel.conf.inc; } ynh_maintenance_mode_OFF () { - # Load value of $path_url and $domain from the config if their not set - if [ -z $path_url ]; then - path_url=$(ynh_app_setting_get $app path) + # Load value of $path and $domain from the config if their not set + if [ -z $path ]; then +#REMOVEME? path=$(ynh_app_setting_get $app path) fi if [ -z $domain ]; then - domain=$(ynh_app_setting_get $app domain) +#REMOVEME? domain=$(ynh_app_setting_get $app domain) fi - # Rewrite the nginx config file to redirect from ${path_url}_maintenance to the real url of the app. - echo "rewrite ^${path_url}_maintenance/(.*)$ ${path_url}/\$1 redirect;" > "/etc/nginx/conf.d/$domain.d/maintenance.$app.conf" + # Rewrite the nginx config file to redirect from ${path}_maintenance to the real url of the app. + echo "rewrite ^${path}_maintenance/(.*)$ ${path}/\$1 redirect;" > "/etc/nginx/conf.d/$domain.d/maintenance.$app.conf" systemctl reload nginx # Sleep 4 seconds to let the browser reload the pages and redirect the user to the app. @@ -269,7 +269,7 @@ ynh_app_changelog () { return 0 fi - local current_version=$(ynh_read_manifest --manifest="/etc/yunohost/apps/$YNH_APP_INSTANCE_NAME/manifest.json" --manifest_key="version") +#REMOVEME? local current_version=$(ynh_read_manifest --manifest="/etc/yunohost/apps/$YNH_APP_INSTANCE_NAME/manifest.json" --manifest_key="version") local update_version=$(ynh_read_manifest --manifest="../manifest.json" --manifest_key="version") # Get the line of the version to update to into the changelog diff --git a/scripts/backup b/scripts/backup index 5df3afe..c8a8653 100644 --- a/scripts/backup +++ b/scripts/backup @@ -15,19 +15,19 @@ source /usr/share/yunohost/helpers #================================================= # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading installation settings..." +#REMOVEME? ynh_print_info --message="Loading installation settings..." -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? 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) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -38,7 +38,7 @@ ynh_print_info --message="Declaring files to be backed up..." # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$final_path" +ynh_backup --src_path="$install_dir" #================================================= # BACKUP THE NGINX CONFIGURATION diff --git a/scripts/change_url b/scripts/change_url index 85f5144..fd65bd4 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -13,22 +13,22 @@ source /usr/share/yunohost/helpers # RETRIEVE ARGUMENTS #================================================= -old_domain=$YNH_APP_OLD_DOMAIN -old_path=$YNH_APP_OLD_PATH +#REMOVEME? old_domain=$YNH_APP_OLD_DOMAIN +#REMOVEME? old_path=$YNH_APP_OLD_PATH -new_domain=$YNH_APP_NEW_DOMAIN -new_path=$YNH_APP_NEW_PATH +#REMOVEME? new_domain=$YNH_APP_NEW_DOMAIN +#REMOVEME? new_path=$YNH_APP_NEW_PATH -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=2 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=2 -# Needed for helper "ynh_add_nginx_config" -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -multisite=$(ynh_app_setting_get --app=$app --key=multisite) +#REMOVEME? # Needed for helper "ynh_add_nginx_config" +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? multisite=$(ynh_app_setting_get --app=$app --key=multisite) if [ $multisite -eq 1 ] then @@ -39,26 +39,26 @@ fi #================================================= # BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=5 +#REMOVEME? ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=5 # Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { +#REMOVEME? ynh_backup_before_upgrade +#REMOVEME? ynh_clean_setup () { # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. - ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" +#REMOVEME? ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" # Restore it if the upgrade fails - ynh_restore_upgradebackup +#REMOVEME? ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # ACTIVATE MAINTENANCE MODE #================================================= ynh_script_progression --message="Activating maintenance mode..." --weight=2 - -path_url=$old_path +#REMOVEME? +path=$old_path domain=$old_domain ynh_maintenance_mode_ON @@ -66,16 +66,16 @@ ynh_maintenance_mode_ON # CHECK WHICH PARTS SHOULD BE CHANGED #================================================= -change_domain=0 -if [ "$old_domain" != "$new_domain" ] +#REMOVEME? change_domain=0 +#REMOVEME? if [ "$old_domain" != "$new_domain" ] then - change_domain=1 + #REMOVEME? change_domain=1 fi -change_path=0 -if [ "$old_path" != "$new_path" ] +#REMOVEME? change_path=0 +#REMOVEME? if [ "$old_path" != "$new_path" ] then - change_path=1 + #REMOVEME? change_path=1 fi #================================================= @@ -85,28 +85,30 @@ fi #================================================= ynh_script_progression --message="Updating NGINX web server configuration..." --weight=3 -nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf +ynh_change_url_nginx_config + +#REMOVEME? nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf # Change the path in the NGINX config file if [ $change_path -eq 1 ] then # Make a backup of the original NGINX config file if modified - ynh_backup_if_checksum_is_different --file="$nginx_conf_path" +#REMOVEME? ynh_backup_if_checksum_is_different --file="$nginx_conf_path" # Set global variables for NGINX helper - domain="$old_domain" - path_url="$new_path" +#REMOVEME? domain="$old_domain" +#REMOVEME? path="$new_path" # Create a dedicated NGINX config - ynh_add_nginx_config +#REMOVEME? ynh_add_nginx_config fi # Change the domain for NGINX if [ $change_domain -eq 1 ] then # Delete file checksum for the old conf file location - ynh_delete_file_checksum --file="$nginx_conf_path" - mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf +#REMOVEME? ynh_delete_file_checksum --file="$nginx_conf_path" +#REMOVEME? mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf # Store file checksum for the new config file location - ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" +#REMOVEME? ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" fi #================================================= @@ -116,7 +118,7 @@ fi #================================================= # Get the database table prefix -db_prefix=$(grep '^$table_prefix' "$final_path/wp-config.php" | sed "s/.*'\(.*\)'.*/\1/" ) +db_prefix=$(grep '^$table_prefix' "$install_dir/wp-config.php" | sed "s/.*'\(.*\)'.*/\1/" ) ynh_mysql_execute_as_root --sql="UPDATE ${db_prefix}options SET option_value='https://$new_domain$new_path' WHERE option_name='siteurl'" --database=$app ynh_mysql_execute_as_root --sql="UPDATE ${db_prefix}options SET option_value='https://$new_domain$new_path' WHERE option_name='home'" --database=$app @@ -126,16 +128,16 @@ ynh_mysql_execute_as_root --sql="UPDATE ${db_prefix}options SET option_value='ht #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? #REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # DEACTIVE MAINTENANCE MODE #================================================= ynh_script_progression --message="Disabling maintenance mode" --weight=5 - -path_url=$old_path +#REMOVEME? +path=$old_path domain=$old_domain ynh_maintenance_mode_OFF diff --git a/scripts/install b/scripts/install index 12f3567..192f9da 100644 --- a/scripts/install +++ b/scripts/install @@ -14,86 +14,86 @@ source /usr/share/yunohost/helpers #================================================= # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -domain=$YNH_APP_ARG_DOMAIN -path_url=$YNH_APP_ARG_PATH -is_public=$YNH_APP_ARG_IS_PUBLIC -language=$YNH_APP_ARG_LANGUAGE -admin_wordpress=$YNH_APP_ARG_ADMIN -multisite=$YNH_APP_ARG_MULTISITE +#REMOVEME? domain=$YNH_APP_ARG_DOMAIN +#REMOVEME? path=$YNH_APP_ARG_PATH +#REMOVEME? is_public=$YNH_APP_ARG_IS_PUBLIC +#REMOVEME? language=$YNH_APP_ARG_LANGUAGE +#REMOVEME? admin_wordpress=$YNH_APP_ARG_ADMIN +#REMOVEME? multisite=$YNH_APP_ARG_MULTISITE -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." --weight=2 +#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=2 -final_path=/var/www/$app -test ! -e "$final_path" || ynh_die --message="This path already contains a folder" +#REMOVEME? install_dir=/var/www/$app +#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" # Register (book) web path -ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url +#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path -if [ "$path_url" == "/" ] && [ $multisite -eq 1 ]; then +if [ "$path" == "/" ] && [ $multisite -eq 1 ]; then ynh_die --message="Multisite option of WordPress doesn't work at the root of a domain." fi #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." --weight=2 +#REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=2 -ynh_app_setting_set --app=$app --key=domain --value=$domain -ynh_app_setting_set --app=$app --key=path --value=$path_url +#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain +#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path ynh_app_setting_set --app=$app --key=language --value=$language -ynh_app_setting_set --app=$app --key=admin --value=$admin_wordpress +#REMOVEME? ynh_app_setting_set --app=$app --key=admin --value=$admin_wordpress ynh_app_setting_set --app=$app --key=multisite --value=$multisite ynh_app_setting_set --app=$app --key=overwrite_nginx --value=1 ynh_app_setting_set --app=$app --key=overwrite_phpfpm --value=1 -ynh_app_setting_set --app=$app --key=admin_mail_html --value=1 +#REMOVEME? ynh_app_setting_set --app=$app --key=admin_mail_html --value=1 #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing dependencies..." --weight=5 +#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=5 -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies #================================================= # STANDARD MODIFICATIONS #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Configuring system user..." --weight=3 +#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=3 # Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # CREATE A MYSQL DATABASE #================================================= -ynh_script_progression --message="Creating a MySQL database..." --weight=2 +#REMOVEME? ynh_script_progression --message="Creating a MySQL database..." --weight=2 -db_name=$(ynh_sanitize_dbid --db_name=$app) -db_user=$db_name -ynh_app_setting_set --app=$app --key=db_name --value=$db_name -ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name +#REMOVEME? db_name=$(ynh_sanitize_dbid --db_name=$app) +#REMOVEME? db_user=$db_name +#REMOVEME? ynh_app_setting_set --app=$app --key=db_name --value=$db_name +#REMOVEME? ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." --weight=4 -ynh_app_setting_set --app=$app --key=final_path --value=$final_path +#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" +ynh_setup_source --dest_dir="$install_dir" #================================================= # NGINX CONFIGURATION @@ -112,7 +112,7 @@ fpm_footprint="medium" fpm_free_footprint=0 # If the app is private, set the usage to low, otherwise to high. -if [ $is_public -eq 0 ] +#REMOVEME? if [ $is_public -eq 0 ] then fpm_usage="low" else @@ -125,7 +125,7 @@ ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage # Create a dedicated PHP-FPM config ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # SPECIFIC SETUP @@ -136,12 +136,12 @@ ynh_script_progression --message="Configuring WordPress..." --weight=1 # Change variables in Wordpress configuration dir=__DIR__ -ynh_add_config --template="../conf/wp-config.php" --destination="$final_path/wp-config.php" +ynh_add_config --template="../conf/wp-config.php" --destination="$install_dir/wp-config.php" for i in 1 2 3 4 5 6 7 8 do j=$(ynh_string_random --length=40) - ynh_replace_string --match_string="KEY$i" --replace_string="$j" --target_file=$final_path/wp-config.php + ynh_replace_string --match_string="KEY$i" --replace_string="$j" --target_file=$install_dir/wp-config.php sleep 0.5 done @@ -151,21 +151,21 @@ done ynh_script_progression --message="Installing wordpress with cURL..." --weight=10 # Set right permissions for cURL install -chown -R $app: $final_path +chown -R $app: $install_dir # Set the app as temporarily public for cURL call -ynh_permission_update --permission="main" --add="visitors" +#REMOVEME? ynh_permission_update --permission="main" --add="visitors" # Regen SSOwat configuration yunohost app ssowatconf # Reload NGINX -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload # Wordpress installation ynh_local_curl "/wp-admin/install.php?step=2" "&weblog_title=YunoBlog" "user_name=$admin_wordpress" "admin_password=$db_pwd" "admin_password2=$db_pwd" "admin_email=$admin_wordpress@$domain" "Submit=Install+WordPress" # Remove the public access -ynh_permission_update --permission="main" --remove="visitors" +#REMOVEME? ynh_permission_update --permission="main" --remove="visitors" ynh_print_info --message="Please wait during Wordpress installation..." for i in `seq 1 300` @@ -183,8 +183,8 @@ done #================================================= ynh_script_progression --message="Installing WordPress plugins..." --weight=20 -ynh_exec_warn_less wget --no-verbose https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar --output-document=$final_path/wp-cli.phar -wpcli_alias="php$phpversion $final_path/wp-cli.phar --allow-root --path=$final_path" +ynh_exec_warn_less wget --no-verbose https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar --output-document=$install_dir/wp-cli.phar +wpcli_alias="php$phpversion $install_dir/wp-cli.phar --allow-root --path=$install_dir" $wpcli_alias plugin install authldap $wpcli_alias plugin install http-authentication @@ -209,13 +209,13 @@ then ynh_replace_string --match_string="#--MULTISITE--" --replace_string="" --target_file=/etc/nginx/conf.d/$domain.d/$app.conf # Allow multisite - ynh_replace_string --match_string="//--MULTISITE1--define" --replace_string="define " --target_file=$final_path/wp-config.php + ynh_replace_string --match_string="//--MULTISITE1--define" --replace_string="define " --target_file=$install_dir/wp-config.php # Activate multisite via wp-cli - ynh_exec_fully_quiet $wpcli_alias core multisite-convert --base=$path_url/ + ynh_exec_fully_quiet $wpcli_alias core multisite-convert --base=$path/ # Activate multisite in wordpress config - ynh_replace_string --match_string="//--MULTISITE2--define" --replace_string="define" --target_file=$final_path/wp-config.php + ynh_replace_string --match_string="//--MULTISITE2--define" --replace_string="define" --target_file=$install_dir/wp-config.php db_prefix="wp_" ynh_replace_string --match_string="__DB_PREFIX__" --replace_string="$db_prefix" --target_file=../conf/sql/multisite.sql @@ -245,32 +245,32 @@ $wpcli_alias plugin activate companion-auto-update $plugin_network $wpcli_alias plugin activate wp-fail2ban-redux $plugin_network # Set file and directories ownership -mkdir -p $final_path/wp-content/uploads -mkdir -p $final_path/wp-content/temp -chown -R $app:www-data "$final_path" -find "$final_path" -type d -exec chmod 750 {} \; -find "$final_path" -type f -exec chmod 640 {} \; -find "$final_path/wp-content/uploads" -type d -exec chmod 770 {} \; -find "$final_path/wp-content/temp" -type d -exec chmod 770 {} \; -setfacl -Rm d:g:www-data:rwX "$final_path/wp-content/uploads" -setfacl -Rm d:g:www-data:rwX "$final_path/wp-content/temp" +mkdir -p $install_dir/wp-content/uploads +mkdir -p $install_dir/wp-content/temp +chown -R $app:www-data "$install_dir" +find "$install_dir" -type d -exec chmod 750 {} \; +find "$install_dir" -type f -exec chmod 640 {} \; +find "$install_dir/wp-content/uploads" -type d -exec chmod 770 {} \; +find "$install_dir/wp-content/temp" -type d -exec chmod 770 {} \; +setfacl -Rm d:g:www-data:rwX "$install_dir/wp-content/uploads" +setfacl -Rm d:g:www-data:rwX "$install_dir/wp-content/temp" #================================================= # STORE THE CONFIG FILE CHECKSUM #================================================= # Calculate and store the config file checksum into the app settings -ynh_store_file_checksum --file="$final_path/wp-config.php" +ynh_store_file_checksum --file="$install_dir/wp-config.php" -chmod 400 "$final_path/wp-config.php" -chown $app:$app "$final_path/wp-config.php" +chmod 400 "$install_dir/wp-config.php" +chown $app:$app "$install_dir/wp-config.php" #================================================= # CREATE A CRON TASK FOR AUTOMATIC UPDATE #================================================= echo "# Reach everyday wp-cron.php to trig the internal WordPress cron. -0 3 * * * $app php$phpversion $final_path/wp-cron.php" > /etc/cron.d/$app +0 3 * * * $app php$phpversion $install_dir/wp-cron.php" > /etc/cron.d/$app #================================================= # GENERIC FINALISATION @@ -285,31 +285,31 @@ ynh_add_fail2ban_config --logpath="/var/log/auth.log" --failregex="Authenticatio #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring permissions..." --weight=1 +#REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public if necessary -if [ $is_public -eq 1 ] +#REMOVEME? if [ $is_public -eq 1 ] then # Everyone can access the app. # The "main" permission is automatically created before the install script. - ynh_permission_update --permission="main" --add="visitors" +#REMOVEME? ynh_permission_update --permission="main" --add="visitors" fi # Only the admin can access the admin panel of the app -ynh_permission_create --permission="admin" --url="/wp-login.php" --additional_urls="/wp-admin.php" --allowed=$admin_wordpress +#REMOVEME? ynh_permission_create --permission="admin" --url="/wp-login.php" --additional_urls="/wp-admin.php" --allowed=$admin_wordpress #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=3 +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=3 -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # REMOVE WP-CLI.PHAR #================================================= -ynh_secure_remove --file=$final_path/wp-cli.phar +#REMOVEME? ynh_secure_remove --file=$install_dir/wp-cli.phar #================================================= # SEND A README FOR THE ADMIN diff --git a/scripts/remove b/scripts/remove index 64f0739..09404b4 100755 --- a/scripts/remove +++ b/scripts/remove @@ -12,40 +12,40 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=2 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=2 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#REMOVEME? db_user=$db_name +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) #================================================= # STANDARD REMOVE #================================================= # REMOVE THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Removing the MySQL database..." --weight=2 +#REMOVEME? ynh_script_progression --message="Removing the MySQL database..." --weight=2 # Remove a database if it exists, along with the associated user -ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name +#REMOVEME? ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing dependencies..." --weight=4 +#REMOVEME? ynh_script_progression --message="Removing dependencies..." --weight=4 # Remove metapackage and its dependencies -ynh_remove_app_dependencies +#REMOVEME? ynh_remove_app_dependencies #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." --weight=2 +#REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=2 # Remove the app directory securely -ynh_secure_remove --file="$final_path" +#REMOVEME? ynh_secure_remove --file="$install_dir" #================================================= # REMOVE NGINX CONFIGURATION @@ -86,10 +86,10 @@ ynh_secure_remove --file="/etc/cron.d/$app" #================================================= # REMOVE DEDICATED USER #================================================= -ynh_script_progression --message="Removing the dedicated system user..." --weight=3 +#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." --weight=3 # Delete a system user -ynh_system_user_delete --username=$app +#REMOVEME? ynh_system_user_delete --username=$app #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index b25d172..6740464 100644 --- a/scripts/restore +++ b/scripts/restore @@ -15,33 +15,33 @@ source /usr/share/yunohost/helpers #================================================= # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= ynh_script_progression --message="Loading settings..." --weight=3 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) -admin_wordpress=$(ynh_app_setting_get --app=$app --key=admin) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#REMOVEME? db_user=$db_name +#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +#REMOVEME? admin_wordpress=$(ynh_app_setting_get --app=$app --key=admin) -fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) -fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) +#REMOVEME? fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) +#REMOVEME? fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_script_progression --message="Validating restoration parameters..." --weight=1 +#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1 -test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path " +#REMOVEME? test ! -d $install_dir \ + || ynh_die --message="There is already a directory: $install_dir " #================================================= # ACTIVATE MAINTENANCE MODE @@ -55,31 +55,31 @@ ynh_maintenance_mode_ON #================================================= # RECREATE THE DEDICATED USER #================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --weight=3 +#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=3 # Create the dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # RESTORE THE APP MAIN DIR #================================================= ynh_script_progression --message="Restoring the app main directory..." --weight=5 -ynh_restore_file --origin_path="$final_path" +ynh_restore_file --origin_path="$install_dir" # Set file and directories ownership -mkdir -p $final_path/wp-content/uploads -mkdir -p $final_path/wp-content/temp -chown -R $app:www-data "$final_path" -find "$final_path" -type d -exec chmod 750 {} \; -find "$final_path" -type f -exec chmod 640 {} \; -find "$final_path/wp-content/uploads" -type d -exec chmod 770 {} \; -find "$final_path/wp-content/temp" -type d -exec chmod 770 {} \; -setfacl -Rm d:g:www-data:rwX "$final_path/wp-content/uploads" -setfacl -Rm d:g:www-data:rwX "$final_path/wp-content/temp" +mkdir -p $install_dir/wp-content/uploads +mkdir -p $install_dir/wp-content/temp +chown -R $app:www-data "$install_dir" +find "$install_dir" -type d -exec chmod 750 {} \; +find "$install_dir" -type f -exec chmod 640 {} \; +find "$install_dir/wp-content/uploads" -type d -exec chmod 770 {} \; +find "$install_dir/wp-content/temp" -type d -exec chmod 770 {} \; +setfacl -Rm d:g:www-data:rwX "$install_dir/wp-content/uploads" +setfacl -Rm d:g:www-data:rwX "$install_dir/wp-content/temp" -chmod 400 "$final_path/wp-config.php" -chown $app:$app "$final_path/wp-config.php" +chmod 400 "$install_dir/wp-config.php" +chown $app:$app "$install_dir/wp-config.php" #================================================= # RESTORE FAIL2BAN CONFIGURATION @@ -93,10 +93,10 @@ ynh_systemd_action --action=restart --service_name=fail2ban #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=5 +#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=5 # Define and install dependencies -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE THE PHP-FPM CONFIGURATION @@ -119,10 +119,10 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Restoring the MySQL database..." --weight=3 +#REMOVEME? ynh_script_progression --message="Restoring the MySQL database..." --weight=3 -db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd +#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) +#REMOVEME? ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index a0499ee..41b31c8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,27 +12,27 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=5 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=5 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -language=$(ynh_app_setting_get --app=$app --key=language) -admin_wordpress=$(ynh_app_setting_get --app=$app --key=admin) -multisite=$(ynh_app_setting_get --app=$app --key=multisite) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? language=$(ynh_app_setting_get --app=$app --key=language) +#REMOVEME? admin_wordpress=$(ynh_app_setting_get --app=$app --key=admin) +#REMOVEME? multisite=$(ynh_app_setting_get --app=$app --key=multisite) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) -overwrite_nginx=$(ynh_app_setting_get --app=$app --key=overwrite_nginx) -overwrite_phpfpm=$(ynh_app_setting_get --app=$app --key=overwrite_phpfpm) -admin_mail_html=$(ynh_app_setting_get --app=$app --key=admin_mail_html) +#REMOVEME? overwrite_nginx=$(ynh_app_setting_get --app=$app --key=overwrite_nginx) +#REMOVEME? overwrite_phpfpm=$(ynh_app_setting_get --app=$app --key=overwrite_phpfpm) +#REMOVEME? admin_mail_html=$(ynh_app_setting_get --app=$app --key=admin_mail_html) -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) +#REMOVEME? fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) +#REMOVEME? fpm_free_footprint=$(ynh_app_setting_get --app=$app --key=fpm_free_footprint) +#REMOVEME? fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK VERSION @@ -45,16 +45,16 @@ 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=15 +#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=15 # Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { +#REMOVEME? ynh_backup_before_upgrade +#REMOVEME? ynh_clean_setup () { # Restore it if the upgrade fails - ynh_restore_upgradebackup +#REMOVEME? ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # ACTIVATE MAINTENANCE MODE @@ -74,17 +74,17 @@ if [ -z "$admin_wordpress" ]; then ynh_mysql_execute_as_root --sql="select MAX(user_login) from wp_users where user_status=0 INTO OUTFILE '/tmp/wordpressuser';" --database=$db_name admin_wordpress=$(cat /tmp/wordpressuser) ynh_secure_remove --file=/tmp/wordpressuser - ynh_app_setting_set --app=$app --key=admin --value=$admin_wordpress +#REMOVEME? ynh_app_setting_set --app=$app --key=admin --value=$admin_wordpress fi -# If final_path doesn't exist, create it -if [ -z "$final_path" ]; then - final_path=/var/www/$app - ynh_app_setting_set --app=$app --key=final_path --value=$final_path +# If install_dir doesn't exist, create it +if [ -z "$install_dir" ]; then +#REMOVEME? install_dir=/var/www/$app +#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir fi if [ -z "$language" ]; then - language=$(grep WPLANG $final_path/wp-config.php | cut -d"'" -f4) + language=$(grep WPLANG $install_dir/wp-config.php | cut -d"'" -f4) ynh_app_setting_set --app=$app --key=language --value=$language fi @@ -100,18 +100,18 @@ fi # If db_name doesn't exist, create it if [ -z "$db_name" ]; then db_name=$(ynh_sanitize_dbid --db_name=$app) - ynh_app_setting_set --app=$app --key=db_name --value=$db_name +#REMOVEME? ynh_app_setting_set --app=$app --key=db_name --value=$db_name fi # If some 'add_filter' are still in wp_config, remove them -if grep add_filter.*auto_update $final_path/wp-config.php; then - sed --in-place '/add_filter.*auto_update/d' $final_path/wp-config.php +if grep add_filter.*auto_update $install_dir/wp-config.php; then + sed --in-place '/add_filter.*auto_update/d' $install_dir/wp-config.php fi # If admin_mail_html doesn't exist, create it if [ -z "$admin_mail_html" ]; then admin_mail_html=1 - ynh_app_setting_set --app=$app --key=admin_mail_html --value=$admin_mail_html +#REMOVEME? ynh_app_setting_set --app=$app --key=admin_mail_html --value=$admin_mail_html fi # If overwrite_nginx doesn't exist, create it @@ -141,7 +141,7 @@ fi # If fpm_usage doesn't exist, create it if [ -z "$fpm_usage" ]; then # If the app is private, set the usage to low, otherwise to high. - if [ $(ynh_app_setting_get --app=$app --key=is_public) -eq 0 ] +#REMOVEME? if [ $(ynh_app_setting_get --app=$app --key=is_public) -eq 0 ] then usage=low else @@ -158,8 +158,8 @@ if [ -z "$phpversion" ]; then fi # Replace wp-fail2ban by wp-fail2ban-redux -ynh_exec_warn_less wget --no-verbose https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar --output-document=$final_path/wp-cli.phar -wpcli_alias="php$phpversion $final_path/wp-cli.phar --allow-root --path=$final_path" +ynh_exec_warn_less wget --no-verbose https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar --output-document=$install_dir/wp-cli.phar +wpcli_alias="php$phpversion $install_dir/wp-cli.phar --allow-root --path=$install_dir" plugin_network="" if [ $multisite -eq 1 ]; then plugin_network="--network" @@ -171,24 +171,24 @@ $wpcli_alias plugin is-installed wp-fail2ban-redux || $wpcli_alias plugin instal $wpcli_alias plugin is-installed simple-ldap-login && $wpcli_alias plugin deactivate $plugin_network simple-ldap-login && $wpcli_alias plugin uninstall simple-ldap-login # Cleaning legacy permissions -if ynh_legacy_permissions_exists; then - ynh_legacy_permissions_delete_all +#REMOVEME? if ynh_legacy_permissions_exists; then +#REMOVEME? ynh_legacy_permissions_delete_all ynh_app_setting_delete --app=$app --key=is_public fi -if ! ynh_permission_exists --permission="admin"; then +#REMOVEME? if ! ynh_permission_exists --permission="admin"; then # Create the required permissions - ynh_permission_create --permission="admin" --url="/wp-login.php" --additional_urls="/wp-admin.php" --allowed=$admin_wordpress +#REMOVEME? ynh_permission_create --permission="admin" --url="/wp-login.php" --additional_urls="/wp-admin.php" --allowed=$admin_wordpress fi #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." +#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." # Create a dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # NGINX CONFIGURATION @@ -204,9 +204,9 @@ fi #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=5 +#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=5 -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies #================================================= # PHP-FPM CONFIGURATION @@ -227,14 +227,14 @@ fi #================================================= # Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script. -ynh_backup_if_checksum_is_different --file="$final_path/wp-config.php" +ynh_backup_if_checksum_is_different --file="$install_dir/wp-config.php" #================================================= # CONFIGURE MULTISITE #================================================= ynh_script_progression --message="Configuring multisite..." --weight=2 -db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) +#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) if [ $multisite -eq 1 ] then @@ -242,9 +242,9 @@ then ynh_store_file_checksum --file="/etc/nginx/conf.d/$domain.d/$app.conf" - ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - db_prefix=$(grep '^$table_prefix' "$final_path/wp-config.php" | sed "s/.*'\(.*\)'.*/\1/" ) + db_prefix=$(grep '^$table_prefix' "$install_dir/wp-config.php" | sed "s/.*'\(.*\)'.*/\1/" ) ynh_replace_string --match_string="__DB_PREFIX__" --replace_string="$db_prefix" --target_file=../conf/sql/multisite.sql ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file=../conf/sql/multisite.sql @@ -254,7 +254,7 @@ then plugin_network="--network" else multisite=0 - db_prefix=$(grep '^$table_prefix' "$final_path/wp-config.php" | sed "s/.*'\(.*\)'.*/\1/" ) + db_prefix=$(grep '^$table_prefix' "$install_dir/wp-config.php" | sed "s/.*'\(.*\)'.*/\1/" ) ynh_replace_string --match_string="__DB_PREFIX__" --replace_string="$db_prefix" --target_file=../conf/sql/single.sql ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file=../conf/sql/single.sql @@ -264,7 +264,7 @@ else plugin_network="" if ynh_permission_has_user --permission="main" --user="visitor" then - ynh_replace_string --match_string="//--PUBLIC--define" --replace_string="define" --target_file=$final_path/wp-config.php + ynh_replace_string --match_string="//--PUBLIC--define" --replace_string="define" --target_file=$install_dir/wp-config.php fi fi ynh_app_setting_set --app=$app --key=multisite --value=$multisite @@ -274,8 +274,8 @@ ynh_app_setting_set --app=$app --key=multisite --value=$multisite #================================================= ynh_script_progression --message="Updating plugins" --weight=11 -# wget -nv https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -O $final_path/wp-cli.phar -# wpcli_alias="php$phpversion $final_path/wp-cli.phar --allow-root --path=$final_path" +# wget -nv https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -O $install_dir/wp-cli.phar +# wpcli_alias="php$phpversion $install_dir/wp-cli.phar --allow-root --path=$install_dir" update_plugin () { ( $wpcli_alias plugin is-installed $1 && $wpcli_alias plugin update $1 ) || $wpcli_alias plugin install $1 } @@ -292,32 +292,32 @@ $wpcli_alias plugin is-installed http-authentication && $wpcli_alias plugin deac # Set file and directories ownership -mkdir -p $final_path/wp-content/uploads -mkdir -p $final_path/wp-content/temp -chown -R $app:www-data "$final_path" -find "$final_path" -type d -exec chmod 750 {} \; -find "$final_path" -type f -exec chmod 640 {} \; -find "$final_path/wp-content/uploads" -type d -exec chmod 770 {} \; -find "$final_path/wp-content/temp" -type d -exec chmod 770 {} \; -setfacl -Rm d:g:www-data:rwX "$final_path/wp-content/uploads" -setfacl -Rm d:g:www-data:rwX "$final_path/wp-content/temp" +mkdir -p $install_dir/wp-content/uploads +mkdir -p $install_dir/wp-content/temp +chown -R $app:www-data "$install_dir" +find "$install_dir" -type d -exec chmod 750 {} \; +find "$install_dir" -type f -exec chmod 640 {} \; +find "$install_dir/wp-content/uploads" -type d -exec chmod 770 {} \; +find "$install_dir/wp-content/temp" -type d -exec chmod 770 {} \; +setfacl -Rm d:g:www-data:rwX "$install_dir/wp-content/uploads" +setfacl -Rm d:g:www-data:rwX "$install_dir/wp-content/temp" #================================================= # STORE THE CHECKSUM OF THE CONFIG FILE #================================================= # Recalculate and store the checksum of the file for the next upgrade. -ynh_store_file_checksum --file="$final_path/wp-config.php" +ynh_store_file_checksum --file="$install_dir/wp-config.php" -chmod 400 "$final_path/wp-config.php" -chown $app:$app "$final_path/wp-config.php" +chmod 400 "$install_dir/wp-config.php" +chown $app:$app "$install_dir/wp-config.php" #================================================= # CREATE A CRON TASK FOR AUTOMATIC UPDATE #================================================= echo "# Reach everyday wp-cron.php to trig the internal WordPress cron. -0 3 * * * $app php$phpversion $final_path/wp-cron.php" > /etc/cron.d/$app +0 3 * * * $app php$phpversion $install_dir/wp-cron.php" > /etc/cron.d/$app #================================================= # GENERIC FINALISATION @@ -332,15 +332,15 @@ ynh_add_fail2ban_config --logpath="/var/log/auth.log" --failregex="Authenticatio #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # REMOVE WP-CLI.PHAR #================================================= -ynh_secure_remove --file=$final_path/wp-cli.phar +#REMOVEME? ynh_secure_remove --file=$install_dir/wp-cli.phar #================================================= # DEACTIVE MAINTENANCE MODE From 5d4009c2109185d07ef21a08867acd8a34431b12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 25 Apr 2023 21:15:35 +0200 Subject: [PATCH 02/20] v2 --- CHANGELOG.md | 72 ------- doc/{DISCLAIMER.md => ADMIN.md} | 0 doc/{DISCLAIMER_fr.md => ADMIN_fr.md} | 0 manifest.json | 87 -------- manifest.toml | 24 ++- scripts/_common.sh | 282 -------------------------- scripts/backup | 19 -- scripts/remove | 48 ----- scripts/restore | 71 +------ scripts/upgrade | 113 +---------- 10 files changed, 16 insertions(+), 700 deletions(-) delete mode 100644 CHANGELOG.md rename doc/{DISCLAIMER.md => ADMIN.md} (100%) rename doc/{DISCLAIMER_fr.md => ADMIN_fr.md} (100%) delete mode 100644 manifest.json diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 8487d12..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,72 +0,0 @@ -Changelog -========= - -## Unreleased -- Nothing for now... - -## [5.6~ynh1](https://github.com/YunoHost-Apps/wordpress_ynh/pull/115) - 2020-12-09 - -#### Changed -* [Update to 5.6](https://github.com/YunoHost-Apps/wordpress_ynh/pull/115/commits/2d72bf87c3e2e674e967058472586b31e0cb5c62) - -## [5.5.0~ynh1](https://github.com/YunoHost-Apps/wordpress_ynh/pull/108) - 2020-08-15 - -#### Fixed -- [Fix typo](https://github.com/YunoHost-Apps/wordpress_ynh/pull/106) - -#### Changed -* [Update to 5.5.0](https://github.com/YunoHost-Apps/wordpress_ynh/commit/942ca57cbeb339d27454b32ba73c34006aa1c510) -- [Update link to hardening Wordpress guide](https://github.com/YunoHost-Apps/wordpress_ynh/pull/97) - - -## [5.4.0~ynh1](https://github.com/YunoHost-Apps/wordpress_ynh/pull/85) - 2020-05-02 - -#### Added -* [Add action and config-panel feature](https://github.com/YunoHost-Apps/wordpress_ynh/pull/79) -* [Add changelog](https://github.com/YunoHost-Apps/wordpress_ynh/pull/82) -* [New reset actions](https://github.com/YunoHost-Apps/wordpress_ynh/pull/85/commits/10a1fe6bf94a8b2eed2386b614771a51e093d958) -* [Add an action to remove maintenance mode](https://github.com/YunoHost-Apps/wordpress_ynh/pull/85/commits/373685d5736eba2b42495867eb4119db9991a60d) - -#### Fixed -- [fix config is_public](https://github.com/YunoHost-Apps/wordpress_ynh/pull/84) - -#### Changed -* [Use ynh_get_scalable_phpfpm](https://github.com/YunoHost-Apps/wordpress_ynh/pull/80) -* [Update to 5.3.2](https://github.com/YunoHost-Apps/wordpress_ynh/pull/81) -* [Update to 5.4.0](https://github.com/YunoHost-Apps/wordpress_ynh/pull/85/commits/00a1a6e7dd5c814f5084c11c2810f886a32bdf61) -- [Remove php template](https://github.com/YunoHost-Apps/wordpress_ynh/pull/85/commits/9eb618f88afd8294a0c3c8e0573a055038ec5423) -- [Fix buster install](https://github.com/YunoHost-Apps/wordpress_ynh/pull/85/commits/5e68805ed1afa47778f7cd4823f636e417594c5a) -- [specify php version to use](https://github.com/YunoHost-Apps/wordpress_ynh/pull/85/commits/59baee2ef9d85e3284ecf47fc3c7bd16a3c08ac3) -- [Always show YunoHost tile](https://github.com/YunoHost-Apps/wordpress_ynh/pull/85/commits/1b63bd778af287f605314b0383e5bd21f25b8007) -- [Replace wp-fail2ban by wp-fail2ban-redux](https://github.com/YunoHost-Apps/wordpress_ynh/pull/85/commits/3faae6b27694ed363d4c3605c4718963eb3d994f) -- [Add new badges](https://github.com/YunoHost-Apps/wordpress_ynh/pull/85/commits/063a5404691d54b50b88a52addfd5e3d6de5ebd0) - - -## [5.3~ynh1](https://github.com/YunoHost-Apps/wordpress_ynh/pull/77) - 2019-12-26 - -#### Fixed -- [Get the database prefix before modifying data](https://github.com/YunoHost-Apps/wordpress_ynh/pull/77/commits/75d6e64c758443a06ca6bfd42a75291806618f03) - -#### Changed -* [Upgrade to 5.3](https://github.com/YunoHost-Apps/wordpress_ynh/pull/77/commits/7d6f1e0048ebac0c1fef06a8789192f33a8220eb) -- [Increase memory limit to support some plugin](https://github.com/YunoHost-Apps/wordpress_ynh/pull/77/commits/e5b1bb7e3449e9be49e9e60eaf3d986072a30f06) - - -## [5.2~ynh1](https://github.com/YunoHost-Apps/wordpress_ynh/pull/65) - 2019-06-05 - -#### Fixed -- [Force upgrade with a cron](https://github.com/YunoHost-Apps/wordpress_ynh/pull/63/commits/7e4808ebc3318b3b6096729a28260fc936af4e78) - -#### Changed -* [Upgrade to wordpress 5.2](https://github.com/YunoHost-Apps/wordpress_ynh/pull/63/commits/21b087ea6ebb499124745384771bfb0ddd866f11) -- [Global upgrade of the package](https://github.com/YunoHost-Apps/wordpress_ynh/pull/64/commits/87e36e665c56dfbe110f44a35a4ccc9724e89a75) - - -## [5.0.3~ynh1](https://github.com/YunoHost-Apps/wordpress_ynh/pull/56) - 2019-03-12 - -#### Added -- [Progress bar](https://github.com/YunoHost-Apps/wordpress_ynh/pull/56/commits/d140c510ea068f654ebefdd66c4e51ad3aa85067) - -#### Changed -- [Update to last packaging standard](https://github.com/YunoHost-Apps/wordpress_ynh/pull/56/commits/bb64ee0d9b8883db13da35c252ed10899559f016) -* [Update to wordpress 5.0.3](https://github.com/YunoHost-Apps/wordpress_ynh/pull/56/commits/04e76b93af5724fe23d19da2bc05e0f728398d43) diff --git a/doc/DISCLAIMER.md b/doc/ADMIN.md similarity index 100% rename from doc/DISCLAIMER.md rename to doc/ADMIN.md diff --git a/doc/DISCLAIMER_fr.md b/doc/ADMIN_fr.md similarity index 100% rename from doc/DISCLAIMER_fr.md rename to doc/ADMIN_fr.md diff --git a/manifest.json b/manifest.json deleted file mode 100644 index ef00bd7..0000000 --- a/manifest.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "name": "WordPress", - "id": "wordpress", - "packaging_format": 1, - "description": { - "en": "Create a beautiful blog or website easily", - "fr": "Logiciel de création de blog ou de site Web" - }, - "version": "6.2~ynh1", - "url": "https://wordpress.org/", - "upstream": { - "license": "GPL-2.0", - "website": "https://wordpress.org/", - "admindoc": "https://codex.wordpress.org/", - "code": "https://core.trac.wordpress.org/browser", - "cpe": "cpe:2.3:a:wordpress:wordpress" - }, - "license": "GPL-2.0", - "maintainer": { - "name": "kay0u", - "email": "pierre@kayou.io" - }, - "previous_maintainers": [ - { - "name": "Maniack Crudelis", - "email": "maniackc_dev@crudelis.fr" - } - ], - "requirements": { - "yunohost": ">= 11.0.9" - }, - "multi_instance": true, - "services": [ - "nginx", - "php8.0-fpm", - "mysql" - ], - "arguments": { - "install": [ - { - "name": "domain", - "type": "domain" - }, - { - "name": "path", - "type": "path", - "example": "/blog", - "default": "/blog" - }, - { - "name": "is_public", - "type": "boolean", - "default": true - }, - { - "name": "language", - "type": "string", - "ask": { - "en": "Choose the application language", - "fr": "Choisissez la langue de l'application" - }, - "choices": [ - "en_US", - "fr_FR" - ], - "default": "en_US" - }, - { - "name": "admin", - "type": "user", - "ask": { - "en": "Choose the WordPress administrator (must be an existing YunoHost user)", - "fr": "Administrateur du site (doit être un utilisateur YunoHost existant)" - } - }, - { - "name": "multisite", - "type": "boolean", - "ask": { - "en": "Enable multisite option?", - "fr": "Activer l'option multisite ?" - }, - "default": false - } - ] - } -} diff --git a/manifest.toml b/manifest.toml index 23d7fab..b6115aa 100644 --- a/manifest.toml +++ b/manifest.toml @@ -18,22 +18,20 @@ cpe = "???" # FIXME: optional but recommended if relevant, this is meant to cont fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. [integration] -yunohost = ">= 11.0.9" -architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +yunohost = ">= 11.1.18" +architectures = "all" multi_instance = true -ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. -sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. -disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... -ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... -ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ldap = true +sso = true +disk = "50M" +ram.build = "50M" +ram.runtime = "50M" [install] [install.domain] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "domain" [install.path] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "path" default = "/blog" @@ -49,7 +47,6 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen default = "en_US" [install.admin] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "user" [install.multisite] @@ -63,13 +60,18 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen url = "https://downloads.wordpress.org/release/wordpress-6.2.zip" sha256 = "0078e0483d3447a465f71d6bbdab5c799cad2e57c221ec1d639d235b0ffced55" - [resources.system_user] [resources.install_dir] [resources.permissions] main.url = "/" + admin.url = "/wp-login.php" + admin.additional_urls="/wp-admin.php" + admin.allowed = "admins" + + [resources.apt] + packages = "mariadb-server php8.0-mysql php8.0-curl php8.0-json php8.0-mbstring php8.0-xml php8.0-zip php8.0-gd php8.0-soap php8.0-ssh2 php8.0-tokenizer php8.0-ldap" [resources.database] type = "mysql" diff --git a/scripts/_common.sh b/scripts/_common.sh index 312b8b8..0691acc 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,155 +4,10 @@ # COMMON VARIABLES #================================================= -#REMOVEME? YNH_PHP_VERSION="8.0" - -#REMOVEME? pkg_dependencies="php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-soap php${YNH_PHP_VERSION}-ssh2 php${YNH_PHP_VERSION}-tokenizer php${YNH_PHP_VERSION}-ldap" - #================================================= # EXPERIMENTAL HELPERS #================================================= -# Send an email to inform the administrator -# -# usage: ynh_send_readme_to_admin --app_message=app_message [--recipients=recipients] [--type=type] -# | arg: -m --app_message= - The file with the content to send to the administrator. -# | arg: -r, --recipients= - The recipients of this email. Use spaces to separate multiples recipients. - default: root -# example: "root admin@domain" -# If you give the name of a YunoHost user, ynh_send_readme_to_admin will find its email adress for you -# example: "root admin@domain user1 user2" -# | arg: -t, --type= - Type of mail, could be 'backup', 'change_url', 'install', 'remove', 'restore', 'upgrade' -ynh_send_readme_to_admin() { - # Declare an array to define the options of this helper. - declare -Ar args_array=( [m]=app_message= [r]=recipients= [t]=type= ) - local app_message - local recipients - local type - # Manage arguments with getopts - - ynh_handle_getopts_args "$@" - app_message="${app_message:-}" - recipients="${recipients:-root}" - type="${type:-install}" - - # Get the value of admin_mail_html -#REMOVEME? admin_mail_html=$(ynh_app_setting_get $app admin_mail_html) - admin_mail_html="${admin_mail_html:-0}" - - # Retrieve the email of users - find_mails () { - local list_mails="$1" - local mail - local recipients=" " - # Read each mail in argument - for mail in $list_mails - do - # Keep root or a real email address as it is - if [ "$mail" = "root" ] || echo "$mail" | grep --quiet "@" - then - recipients="$recipients $mail" - else - # But replace an user name without a domain after by its email - if mail=$(ynh_user_get_info "$mail" "mail" 2> /dev/null) - then - recipients="$recipients $mail" - fi - fi - done - echo "$recipients" - } - recipients=$(find_mails "$recipients") - - # Subject base - local mail_subject="☁️🆈🅽🅷☁️: \`$app\`" - - # Adapt the subject according to the type of mail required. - if [ "$type" = "backup" ]; then - mail_subject="$mail_subject has just been backup." - elif [ "$type" = "change_url" ]; then - mail_subject="$mail_subject has just been moved to a new URL!" - elif [ "$type" = "remove" ]; then - mail_subject="$mail_subject has just been removed!" - elif [ "$type" = "restore" ]; then - mail_subject="$mail_subject has just been restored!" - elif [ "$type" = "upgrade" ]; then - mail_subject="$mail_subject has just been upgraded!" - else # install - mail_subject="$mail_subject has just been installed!" - fi - - local mail_message="This is an automated message from your beloved YunoHost server. - -Specific information for the application $app. - -$(if [ -n "$app_message" ] -then - cat "$app_message" -else - echo "...No specific information..." -fi) - ---- -Automatic diagnosis data from YunoHost - -__PRE_TAG1__$(yunohost tools diagnosis | grep -B 100 "services:" | sed '/services:/d')__PRE_TAG2__" - - # Store the message into a file for further modifications. - echo "$mail_message" > mail_to_send - - # If a html email is required. Apply html tags to the message. - if [ "$admin_mail_html" -eq 1 ] - then - # Insert 'br' tags at each ending of lines. - ynh_replace_string "$" "
" mail_to_send - - # Insert starting HTML tags - sed --in-place '1s@^@\n\n\n\n@' mail_to_send - - # Keep tabulations - ynh_replace_string " " "\ \ " mail_to_send - ynh_replace_string "\t" "\ \ " mail_to_send - - # Insert url links tags - ynh_replace_string "__URL_TAG1__\(.*\)__URL_TAG2__\(.*\)__URL_TAG3__" "\1" mail_to_send - - # Insert pre tags - ynh_replace_string "__PRE_TAG1__" "
" mail_to_send
-		ynh_replace_string "__PRE_TAG2__" "<\pre>" mail_to_send
-
-		# Insert finishing HTML tags
-		echo -e "\n\n" >> mail_to_send
-
-	# Otherwise, remove tags to keep a plain text.
-	else
-		# Remove URL tags
-		ynh_replace_string "__URL_TAG[1,3]__" "" mail_to_send
-		ynh_replace_string "__URL_TAG2__" ": " mail_to_send
-
-		# Remove PRE tags
-		ynh_replace_string "__PRE_TAG[1-2]__" "" mail_to_send
-	fi
-
-	# Define binary to use for mail command
-	if [ -e /usr/bin/bsd-mailx ]
-	then
-		local mail_bin=/usr/bin/bsd-mailx
-	else
-		local mail_bin=/usr/bin/mail.mailutils
-	fi
-
-	if [ "$admin_mail_html" -eq 1 ]
-	then
-		content_type="text/html"
-	else
-		content_type="text/plain"
-	fi
-
-	# Send the email to the recipients
-	cat mail_to_send | $mail_bin -a "Content-Type: $content_type; charset=UTF-8" -s "$mail_subject" "$recipients"
-}
-
-#=================================================
-
 ynh_maintenance_mode_ON () {
 	# Load value of $path and $domain from the config if their not set
 	if [ -z $path ]; then
@@ -232,143 +87,6 @@ ynh_maintenance_mode_OFF () {
 	systemctl reload nginx
 }
 
-#=================================================
-
-# Create a changelog for an app after an upgrade from the file CHANGELOG.md.
-#
-# usage: ynh_app_changelog [--format=markdown/html/plain] [--output=changelog_file] --changelog=changelog_source]
-# | arg: -f --format= - Format in which the changelog will be printed
-#       markdown: Default format.
-#       html:     Turn urls into html format.
-#       plain:    Plain text changelog
-# | arg: -o --output= - Output file for the changelog file (Default ./changelog)
-# | arg: -c --changelog= - CHANGELOG.md source (Default ../CHANGELOG.md)
-#
-# The changelog is printed into the file ./changelog and ./changelog_lite
-ynh_app_changelog () {
-    # Declare an array to define the options of this helper.
-    local legacy_args=foc
-    declare -Ar args_array=( [f]=format= [o]=output= [c]=changelog= )
-    local format
-    local output
-    local changelog
-    # Manage arguments with getopts
-    ynh_handle_getopts_args "$@"
-    format=${format:-markdown}
-    output=${output:-changelog}
-    changelog=${changelog:-../CHANGELOG.md}
-
-    local original_changelog="$changelog"
-    local temp_changelog="changelog_temp"
-    local final_changelog="$output"
-
-    if [ ! -n "$original_changelog" ]
-    then
-        echo "No changelog available..." > "$final_changelog"
-        echo "No changelog available..." > "${final_changelog}_lite"
-        return 0
-    fi
-
-#REMOVEME?     local current_version=$(ynh_read_manifest --manifest="/etc/yunohost/apps/$YNH_APP_INSTANCE_NAME/manifest.json" --manifest_key="version")
-    local update_version=$(ynh_read_manifest --manifest="../manifest.json" --manifest_key="version")
-
-    # Get the line of the version to update to into the changelog
-    local update_version_line=$(grep --max-count=1 --line-number "^## \[$update_version" "$original_changelog" | cut -d':' -f1)
-    # If there's no entry for this version yet into the changelog
-    # Get the first available version
-    if [ -z "$update_version_line" ]
-    then
-        update_version_line=$(grep --max-count=1 --line-number "^##" "$original_changelog" | cut -d':' -f1)
-    fi
-
-    # Get the length of the complete changelog.
-    local changelog_length=$(wc --lines "$original_changelog" | awk '{print $1}')
-    # Cut the file before the version to update to.
-    tail --lines=$(( $changelog_length - $update_version_line + 1 )) "$original_changelog" > "$temp_changelog"
-
-    # Get the length of the troncated changelog.
-    changelog_length=$(wc --lines "$temp_changelog" | awk '{print $1}')
-    # Get the line of the current version into the changelog
-    # Keep only the last line found
-    local current_version_line=$(grep --line-number "^## \[$current_version" "$temp_changelog" | cut -d':' -f1 | tail --lines=1)
-    # If there's no entry for this version into the changelog
-    # Get the last available version
-    if [ -z "$current_version_line" ]
-    then
-        current_version_line=$(grep --line-number "^##" "$original_changelog" | cut -d':' -f1 | tail --lines=1)
-    fi
-    # Cut the file before the current version.
-    # Then grep the previous version into the changelog to get the line number of the previous version
-    local previous_version_line=$(tail --lines=$(( $changelog_length - $current_version_line )) \
-        "$temp_changelog" | grep --max-count=1 --line-number "^## " | cut -d':' -f1)
-    # If there's no previous version into the changelog
-    # Go until the end of the changelog
-    if [ -z "$previous_version_line" ]
-    then
-        previous_version_line=$changelog_length
-    fi
-
-    # Cut the file after the previous version to keep only the changelog between the current version and the version to update to.
-    head --lines=$(( $current_version_line + $previous_version_line - 1 )) "$temp_changelog" | tee "$final_changelog"
-
-    if [ "$format" = "html" ]
-    then
-        # Replace markdown links by html links
-        ynh_replace_string --match_string="\[\(.*\)\](\(.*\)))" --replace_string="\1)" --target_file="$final_changelog"
-        ynh_replace_string --match_string="\[\(.*\)\](\(.*\))" --replace_string="\1" --target_file="$final_changelog"
-    elif [ "$format" = "plain" ]
-    then
-        # Change title format.
-        ynh_replace_string --match_string="^##.*\[\(.*\)\](\(.*\)) - \(.*\)$" --replace_string="## \1 (\3) - \2" --target_file="$final_changelog"
-        # Change modifications lines format.
-        ynh_replace_string --match_string="^\([-*]\).*\[\(.*\)\]\(.*\)" --replace_string="\1 \2 \3" --target_file="$final_changelog"
-    fi
-    # else markdown. As the file is already in markdown, nothing to do.
-
-    # Keep only important changes into the changelog
-    # Remove all minor changes
-    sed '/^-/d' "$final_changelog" > "${final_changelog}_lite"
-    # Remove all blank lines (to keep a clear workspace)
-    sed --in-place '/^$/d' "${final_changelog}_lite"
-    # Add a blank line at the end
-    echo "" >> "${final_changelog}_lite"
-
-    # Clean titles if there's no significative changes
-    local line
-    local previous_line=""
-    while read line <&3
-    do
-        if [ -n "$previous_line" ]
-        then
-            # Remove the line if it's a title or a blank line, and the previous one was a title as well.
-            if ( [ "${line:0:1}" = "#" ] || [ ${#line} -eq 0 ] ) && [ "${previous_line:0:1}" = "#" ]
-            then
-                ynh_replace_special_string --match_string="${previous_line//[/.}" --replace_string="" --target_file="${final_changelog}_lite"
-            fi
-        fi
-        previous_line="$line"
-    done 3< "${final_changelog}_lite"
-
-    # Remove all blank lines again
-    sed --in-place '/^$/d' "${final_changelog}_lite"
-
-    # Restore changelog format with blank lines
-    ynh_replace_string --match_string="^##.*" --replace_string="\n\n&\n" --target_file="${final_changelog}_lite"
-    # Remove the 2 first blank lines
-    sed --in-place '1,2d' "${final_changelog}_lite"
-    # Add a blank line at the end
-    echo "" >> "${final_changelog}_lite"
-
-    # If changelog are empty, add an info
-    if [ $(wc --words "$final_changelog" | awk '{print $1}') -eq 0 ]
-    then
-        echo "No changes from the changelog..." > "$final_changelog"
-    fi
-    if [ $(wc --words "${final_changelog}_lite" | awk '{print $1}') -eq 0 ]
-    then
-        echo "No significative changes from the changelog..." > "${final_changelog}_lite"
-    fi
-}
 
 #=================================================
 
diff --git a/scripts/backup b/scripts/backup
index c8a8653..8f2ab35 100644
--- a/scripts/backup
+++ b/scripts/backup
@@ -10,25 +10,6 @@
 source ../settings/scripts/_common.sh
 source /usr/share/yunohost/helpers
 
-#=================================================
-# MANAGE SCRIPT FAILURE
-#=================================================
-
-# Exit if an error occurs during the execution of the script
-#REMOVEME? ynh_abort_if_errors
-
-#=================================================
-# LOAD SETTINGS
-#=================================================
-#REMOVEME? ynh_print_info --message="Loading installation settings..."
-
-#REMOVEME? app=$YNH_APP_INSTANCE_NAME
-
-#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir)
-#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain)
-#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name)
-#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
-
 #=================================================
 # DECLARE DATA AND CONF FILES TO BACKUP
 #=================================================
diff --git a/scripts/remove b/scripts/remove
index 09404b4..be80278 100755
--- a/scripts/remove
+++ b/scripts/remove
@@ -9,44 +9,6 @@
 source _common.sh
 source /usr/share/yunohost/helpers
 
-#=================================================
-# LOAD SETTINGS
-#=================================================
-#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=2
-
-#REMOVEME? app=$YNH_APP_INSTANCE_NAME
-
-#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain)
-#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name)
-#REMOVEME? db_user=$db_name
-#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir)
-
-#=================================================
-# STANDARD REMOVE
-#=================================================
-# REMOVE THE MYSQL DATABASE
-#=================================================
-#REMOVEME? ynh_script_progression --message="Removing the MySQL database..." --weight=2
-
-# Remove a database if it exists, along with the associated user
-#REMOVEME? ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name
-
-#=================================================
-# REMOVE DEPENDENCIES
-#=================================================
-#REMOVEME? ynh_script_progression --message="Removing dependencies..." --weight=4
-
-# Remove metapackage and its dependencies
-#REMOVEME? ynh_remove_app_dependencies
-
-#=================================================
-# REMOVE APP MAIN DIR
-#=================================================
-#REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=2
-
-# Remove the app directory securely
-#REMOVEME? ynh_secure_remove --file="$install_dir"
-
 #=================================================
 # REMOVE NGINX CONFIGURATION
 #=================================================
@@ -81,16 +43,6 @@ ynh_script_progression --message="Removing various files..." --weight=1
 # Remove a cron file
 ynh_secure_remove --file="/etc/cron.d/$app"
 
-#=================================================
-# GENERIC FINALIZATION
-#=================================================
-# REMOVE DEDICATED USER
-#=================================================
-#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." --weight=3
-
-# Delete a system user
-#REMOVEME? ynh_system_user_delete --username=$app
-
 #=================================================
 # END OF SCRIPT
 #=================================================
diff --git a/scripts/restore b/scripts/restore
index 6740464..76707f8 100644
--- a/scripts/restore
+++ b/scripts/restore
@@ -10,56 +10,12 @@
 source ../settings/scripts/_common.sh
 source /usr/share/yunohost/helpers
 
-#=================================================
-# MANAGE SCRIPT FAILURE
-#=================================================
-
-# Exit if an error occurs during the execution of the script
-#REMOVEME? ynh_abort_if_errors
-
-#=================================================
-# LOAD SETTINGS
-#=================================================
-ynh_script_progression --message="Loading settings..." --weight=3
-
-#REMOVEME? app=$YNH_APP_INSTANCE_NAME
-
-#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain)
-#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path)
-#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir)
-#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name)
-#REMOVEME? db_user=$db_name
-#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
-#REMOVEME? admin_wordpress=$(ynh_app_setting_get --app=$app --key=admin)
-
-#REMOVEME? fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint)
-#REMOVEME? fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage)
-
-#=================================================
-# CHECK IF THE APP CAN BE RESTORED
-#=================================================
-#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1
-
-#REMOVEME? test ! -d $install_dir \
-	|| ynh_die --message="There is already a directory: $install_dir "
-
 #=================================================
 # ACTIVATE MAINTENANCE MODE
 #=================================================
-ynh_script_progression --message="Activating maintenance mode..." --weight=1
 
 ynh_maintenance_mode_ON
 
-#=================================================
-# STANDARD RESTORATION STEPS
-#=================================================
-# RECREATE THE DEDICATED USER
-#=================================================
-#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=3
-
-# Create the dedicated user (if not existing)
-#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir"
-
 #=================================================
 # RESTORE THE APP MAIN DIR
 #=================================================
@@ -90,14 +46,6 @@ ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf"
 ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf"
 ynh_systemd_action --action=restart --service_name=fail2ban
 
-#=================================================
-# REINSTALL DEPENDENCIES
-#=================================================
-#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=5
-
-# Define and install dependencies
-#REMOVEME? ynh_install_app_dependencies $pkg_dependencies
-
 #=================================================
 # RESTORE THE PHP-FPM CONFIGURATION
 #=================================================
@@ -119,10 +67,8 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
 #=================================================
 # RESTORE THE MYSQL DATABASE
 #=================================================
-#REMOVEME? ynh_script_progression --message="Restoring the MySQL database..." --weight=3
+ynh_script_progression --message="Restoring the MySQL database..." --weight=3
 
-#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
-#REMOVEME? ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
 ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
 
 #=================================================
@@ -145,24 +91,9 @@ ynh_systemd_action --service_name=nginx --action=reload
 #=================================================
 # DEACTIVE MAINTENANCE MODE
 #=================================================
-ynh_script_progression --message="Disabling maintenance mode..." --weight=8
 
 ynh_maintenance_mode_OFF
 
-#=================================================
-# SEND A README FOR THE ADMIN
-#=================================================
-
-# Get main domain and buid the url of the admin panel of the app.
-admin_panel="https://$(grep portal_domain /etc/ssowat/conf.json | cut -d'"' -f4)/yunohost/admin/#/apps/$app"
-
-echo "You can configure this app easily by using the experimental __URL_TAG1__config-panel feature__URL_TAG2__$admin_panel/config-panel__URL_TAG3__.
-You can also find some specific actions for this app by using the experimental __URL_TAG1__action feature__URL_TAG2__$admin_panel/actions__URL_TAG3__.
-
-If you're facing an issue or want to improve this app, please open a new issue in this __URL_TAG1__project__URL_TAG2__https://github.com/YunoHost-Apps/wordpress_ynh__URL_TAG3__." > mail_to_send
-
-ynh_send_readme_to_admin --app_message="mail_to_send" --recipients="$admin_wordpress" --type=restore
-
 #=================================================
 # END OF SCRIPT
 #=================================================
diff --git a/scripts/upgrade b/scripts/upgrade
index 41b31c8..be0e97b 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -9,57 +9,15 @@
 source _common.sh
 source /usr/share/yunohost/helpers
 
-#=================================================
-# LOAD SETTINGS
-#=================================================
-#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=5
-
-#REMOVEME? app=$YNH_APP_INSTANCE_NAME
-
-#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain)
-#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path)
-#REMOVEME? language=$(ynh_app_setting_get --app=$app --key=language)
-#REMOVEME? admin_wordpress=$(ynh_app_setting_get --app=$app --key=admin)
-#REMOVEME? multisite=$(ynh_app_setting_get --app=$app --key=multisite)
-#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir)
-#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name)
-
-#REMOVEME? overwrite_nginx=$(ynh_app_setting_get --app=$app --key=overwrite_nginx)
-#REMOVEME? overwrite_phpfpm=$(ynh_app_setting_get --app=$app --key=overwrite_phpfpm)
-#REMOVEME? admin_mail_html=$(ynh_app_setting_get --app=$app --key=admin_mail_html)
-
-#REMOVEME? fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint)
-#REMOVEME? fpm_free_footprint=$(ynh_app_setting_get --app=$app --key=fpm_free_footprint)
-#REMOVEME? fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage)
-
-#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
-
 #=================================================
 # CHECK VERSION
 #=================================================
 
 upgrade_type=$(ynh_check_app_version_changed)
 
-#=================================================
-# STANDARD UPGRADE STEPS
-#=================================================
-# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
-#=================================================
-#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=15
-
-# Backup the current version of the app
-#REMOVEME? ynh_backup_before_upgrade
-#REMOVEME? ynh_clean_setup () {
-	# Restore it if the upgrade fails
-#REMOVEME? 	ynh_restore_upgradebackup
-}
-# Exit if an error occurs during the execution of the script
-#REMOVEME? ynh_abort_if_errors
-
 #=================================================
 # ACTIVATE MAINTENANCE MODE
 #=================================================
-ynh_script_progression --message="Activating maintenance mode..." --weight=2
 
 ynh_maintenance_mode_ON
 
@@ -170,26 +128,6 @@ $wpcli_alias plugin is-installed wp-fail2ban-redux || $wpcli_alias plugin instal
 # Remove old ldap plugin
 $wpcli_alias plugin is-installed simple-ldap-login && $wpcli_alias plugin deactivate $plugin_network simple-ldap-login && $wpcli_alias plugin uninstall simple-ldap-login
 
-# Cleaning legacy permissions
-#REMOVEME? if ynh_legacy_permissions_exists; then
-#REMOVEME? 	ynh_legacy_permissions_delete_all
-
-	ynh_app_setting_delete --app=$app --key=is_public
-fi
-
-#REMOVEME? if ! ynh_permission_exists --permission="admin"; then
-	# Create the required permissions
-#REMOVEME? 	ynh_permission_create --permission="admin" --url="/wp-login.php" --additional_urls="/wp-admin.php" --allowed=$admin_wordpress
-fi
-
-#=================================================
-# CREATE DEDICATED USER
-#=================================================
-#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..."
-
-# Create a dedicated user (if not existing)
-#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir"
-
 #=================================================
 # NGINX CONFIGURATION
 #=================================================
@@ -201,13 +139,6 @@ then
 	ynh_add_nginx_config
 fi
 
-#=================================================
-# UPGRADE DEPENDENCIES
-#=================================================
-#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=5
-
-#REMOVEME? ynh_install_app_dependencies $pkg_dependencies
-
 #=================================================
 # PHP-FPM CONFIGURATION
 #=================================================
@@ -234,15 +165,13 @@ ynh_backup_if_checksum_is_different --file="$install_dir/wp-config.php"
 #=================================================
 ynh_script_progression --message="Configuring multisite..." --weight=2
 
-#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
-
 if [ $multisite -eq 1 ]
 then
 	ynh_replace_string --match_string="#--MULTISITE--" --replace_string="" --target_file=/etc/nginx/conf.d/$domain.d/$app.conf
 
     ynh_store_file_checksum --file="/etc/nginx/conf.d/$domain.d/$app.conf"
 
-#REMOVEME?     ynh_systemd_action --service_name=nginx --action=reload
+	ynh_systemd_action --service_name=nginx --action=reload
 
 	db_prefix=$(grep '^$table_prefix' "$install_dir/wp-config.php" | sed "s/.*'\(.*\)'.*/\1/" )
 
@@ -329,56 +258,18 @@ ynh_script_progression --message="Reconfiguring Fail2Ban..." --weight=9
 # Create a dedicated Fail2Ban config
 ynh_add_fail2ban_config --logpath="/var/log/auth.log" --failregex="Authentication (attempt for unknown user|failure for) .* from " --max_retry=5
 
-#=================================================
-# RELOAD NGINX
-#=================================================
-#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..."
-
-#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload
-
 #=================================================
 # REMOVE WP-CLI.PHAR
 #=================================================
 
-#REMOVEME? ynh_secure_remove --file=$install_dir/wp-cli.phar
+ynh_secure_remove --file=$install_dir/wp-cli.phar
 
 #=================================================
 # DEACTIVE MAINTENANCE MODE
 #=================================================
-ynh_script_progression --message="Disabling maintenance mode..." --weight=5
 
 ynh_maintenance_mode_OFF
 
-#=================================================
-# SEND A README FOR THE ADMIN
-#=================================================
-
-# Get main domain and buid the url of the admin panel of the app.
-admin_panel="https://$(grep portal_domain /etc/ssowat/conf.json | cut -d'"' -f4)/yunohost/admin/#/apps/$app"
-
-# If a html email is required. Apply html to the changelog.
-if [ "$admin_mail_html" -eq 1 ]; then
-    format=html
-else
-    format=plain
-fi
-ynh_app_changelog --format=$format
-
-echo "Please manually trigger updates to major versions in the WordPress admin area.
-You can also activate the automatic update in the Companion Auto Update plugin settings.
-
-You can configure this app easily by using the experimental __URL_TAG1__config-panel feature__URL_TAG2__$admin_panel/config-panel__URL_TAG3__.
-You can also find some specific actions for this app by using the experimental __URL_TAG1__action feature__URL_TAG2__$admin_panel/actions__URL_TAG3__.
-
-If you're facing an issue or want to improve this app, please open a new issue in this __URL_TAG1__project__URL_TAG2__https://github.com/YunoHost-Apps/wordpress_ynh__URL_TAG3__.
-
----
-
-Changelog since your last upgrade:
-$(cat changelog)" > mail_to_send
-
-ynh_send_readme_to_admin --app_message="mail_to_send" --recipients="$admin_wordpress" --type=upgrade
-
 #=================================================
 # END OF SCRIPT
 #=================================================

From 57a5ac5d233285bfe15f395c5ed9f1e239ba3cca Mon Sep 17 00:00:00 2001
From: yunohost-bot 
Date: Tue, 25 Apr 2023 19:15:45 +0000
Subject: [PATCH 03/20] Auto-update README

---
 README.md    | 32 --------------------------------
 README_fr.md | 32 --------------------------------
 2 files changed, 64 deletions(-)

diff --git a/README.md b/README.md
index 3fba65c..8470425 100644
--- a/README.md
+++ b/README.md
@@ -26,38 +26,6 @@ With this package, you can even activate the [multisite](https://wordpress.org/s
 
 ![Screenshot of WordPress](./doc/screenshots/screen-themes.png)
 
-## Disclaimers / important information
-
-## Configuration
-
-Use the admin panel of your WordPress to configure this app.
-
-## YunoHost specific features
-
- * Integration with YunoHost users and SSO:
-   * private mode: Blog only accessible by YunoHost users
-   * public mode: Visible by anyone, YunoHost users automatically connected
- * Automatic update of wordpress core, plugins and themes.
- * Allow to set up a [multisite](https://codex.wordpress.org/Glossary#Multisite) instance.
-
-#### Multi-users support
-
-Supported, with LDAP and SSO.
-
-## Limitations
-
-* Multisite only available on subdirectories.
-* As the automatic update plugin isn't working as expected, pay attention to keep your WordPress up to date from the WordPress admin panel, and not only from YunoHost admin panel. For security reason, you should control that all updates are regularly applied in WordPress admin panel as well as in YunoHost admin panel.
-
-**Security**
-
-Please be aware that WordPress is known for being frequently a source of security risks (https://en.wikipedia.org/wiki/WordPress#Vulnerabilities), and also as the most popular website management system it is a target for bots and attackers.
-Some vulnerabilities might let an attacker breach into your WordPress, or even your YunoHost server (via privilege escalation).
-
-Don't forget to comply with good security principles (strong password, frequent updates, don't add unknow code in your theme/extensions…). In particular, *please keep your WordPress as up-to-date as possible*.
-
-Furthermore, you might take a look at the [Hardening Wordpress Guide](https://wordpress.org/support/article/hardening-wordpress/). You might see some benefits in the use of Wordpress security plugins.
-
 ## :red_circle: Antifeatures
 
 - **Non-free Addons**: Promotes other non-free applications or plugins.
diff --git a/README_fr.md b/README_fr.md
index ddc73fd..72b28fe 100644
--- a/README_fr.md
+++ b/README_fr.md
@@ -26,38 +26,6 @@ Avec ce package, vous pouvez même activer l'option [multisite](https://codex.wo
 
 ![Capture d’écran de WordPress](./doc/screenshots/screen-themes.png)
 
-## Avertissements / informations importantes
-
-## Configuration
-
-Utilisez le panneau d'administration de votre WordPress pour le configurer.
-
-## Caractéristiques spécifiques YunoHost
-
- * Intégration avec les utilisateurs YunoHost et le SSO :
-   * en mode privé : Le blog ou le site est accessible uniquement aux utilisateurs YunoHost
-   * en mode public : Le blog ou le site est accessible par n'importe qui et les utilisateurs YunoHost sont automatiquement connectés
- * Mises à jour automatiques du cœur de WordPress, extentions et thèmes.
- * Capable de configurer une instance [multisite](https://codex.wordpress.org/Glossary#Multisite).
-
-#### Support multi-utilisateur
-
-Supporté, avec LDAP et SSO.
-
-## Limitations
-
-* Le multisite n'est disponible que sur des sous-domaines.
-* Comme les mises à jour automatiques ne fonctionnent pas correctement, prenez soin de bien mettre à jour WordPress via le panneau d'administration de WordPress et pas seulement via le panneau d'administration de YunoHost. Pour des raisons de sécurité, vérifiez bien que toutes les mises à jour sont bien installées dans le panneau d'administration de WordPress comme dans le panneau d'administration de YunoHost.
-
-**Sécurité**
-
-Soyez conscients que WordPress est connu pour avoir souvent des risques de sécurité (https://en.wikipedia.org/wiki/WordPress#Vulnerabilities), donc comme c'est le gestionnaire de sites le plus populaire il est la cible des robots et pirates.
-Des vulnérabilités peuvent offrir une brêche dans votre WordPress ou dans votre serveur YunoHost (via l'escalade des droits).
-
-N'oubliez pas d'appliquer les principes de sécurité de base (mots de passe forts, mises à jours fréquentes, ne pas ajouter du code inconnu dans le thème et les extensionts…). En particuler, *gardez votre Wordpress à jour le plus possible*.
-
-Par ailleurs, vous pourriez avoir besoin de regarder [ce guide](https://wordpress.org/support/article/hardening-wordpress/). Installer des extensions de sécurité peut-être une bonne chose.
-
 ## :red_circle: Fonctions indésirables
 
 - **Non-free Addons**: Promotes other non-free applications or plugins.

From a0b1737ba1ee69c9adeeaf67293fbdf5a81eea36 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?E=CC=81ric=20Gaspar?=
 <46165813+ericgaspar@users.noreply.github.com>
Date: Tue, 25 Apr 2023 21:15:54 +0200
Subject: [PATCH 04/20] v2

---
 doc/ADMIN.md       |   4 --
 scripts/change_url |  89 +----------------------------------
 scripts/install    | 115 ++-------------------------------------------
 3 files changed, 7 insertions(+), 201 deletions(-)

diff --git a/doc/ADMIN.md b/doc/ADMIN.md
index 5e65adb..ac55464 100644
--- a/doc/ADMIN.md
+++ b/doc/ADMIN.md
@@ -10,10 +10,6 @@ Use the admin panel of your WordPress to configure this app.
  * Automatic update of wordpress core, plugins and themes.
  * Allow to set up a [multisite](https://codex.wordpress.org/Glossary#Multisite) instance.
 
-#### Multi-users support
-
-Supported, with LDAP and SSO.
-
 ## Limitations
 
 * Multisite only available on subdirectories.
diff --git a/scripts/change_url b/scripts/change_url
index fd65bd4..619a3e1 100644
--- a/scripts/change_url
+++ b/scripts/change_url
@@ -9,26 +9,9 @@
 source _common.sh
 source /usr/share/yunohost/helpers
 
-#=================================================
-# RETRIEVE ARGUMENTS
-#=================================================
-
-#REMOVEME? old_domain=$YNH_APP_OLD_DOMAIN
-#REMOVEME? old_path=$YNH_APP_OLD_PATH
-
-#REMOVEME? new_domain=$YNH_APP_NEW_DOMAIN
-#REMOVEME? new_path=$YNH_APP_NEW_PATH
-
-#REMOVEME? app=$YNH_APP_INSTANCE_NAME
-
 #=================================================
 # LOAD SETTINGS
 #=================================================
-#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=2
-
-#REMOVEME? # Needed for helper "ynh_add_nginx_config"
-#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir)
-#REMOVEME? multisite=$(ynh_app_setting_get  --app=$app --key=multisite)
 
 if [ $multisite -eq 1 ]
 then
@@ -36,48 +19,14 @@ then
 	ynh_die --message="https://codex.wordpress.org/Moving_WordPress#Moving_WordPress_Multisite"
 fi
 
-#=================================================
-# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP
-#=================================================
-#REMOVEME? ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=5
-
-# Backup the current version of the app
-#REMOVEME? ynh_backup_before_upgrade
-#REMOVEME? ynh_clean_setup () {
-	# Remove the new domain config file, the remove script won't do it as it doesn't know yet its location.
-#REMOVEME? 	ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
-
-	# Restore it if the upgrade fails
-#REMOVEME? 	ynh_restore_upgradebackup
-}
-# Exit if an error occurs during the execution of the script
-#REMOVEME? ynh_abort_if_errors
-
 #=================================================
 # ACTIVATE MAINTENANCE MODE
 #=================================================
-ynh_script_progression --message="Activating maintenance mode..." --weight=2
-#REMOVEME? 
+
 path=$old_path
 domain=$old_domain
 ynh_maintenance_mode_ON
 
-#=================================================
-# CHECK WHICH PARTS SHOULD BE CHANGED
-#=================================================
-
-#REMOVEME? change_domain=0
-#REMOVEME? if [ "$old_domain" != "$new_domain" ]
-then
-	#REMOVEME? change_domain=1
-fi
-
-#REMOVEME? change_path=0
-#REMOVEME? if [ "$old_path" != "$new_path" ]
-then
-	#REMOVEME? change_path=1
-fi
-
 #=================================================
 # STANDARD MODIFICATIONS
 #=================================================
@@ -87,30 +36,6 @@ ynh_script_progression --message="Updating NGINX web server configuration..." --
 
 ynh_change_url_nginx_config
 
-#REMOVEME? nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
-
-# Change the path in the NGINX config file
-if [ $change_path -eq 1 ]
-then
-	# Make a backup of the original NGINX config file if modified
-#REMOVEME? 	ynh_backup_if_checksum_is_different --file="$nginx_conf_path"
-	# Set global variables for NGINX helper
-#REMOVEME? 	domain="$old_domain"
-#REMOVEME? 	path="$new_path"
-	# Create a dedicated NGINX config
-#REMOVEME? 	ynh_add_nginx_config
-fi
-
-# Change the domain for NGINX
-if [ $change_domain -eq 1 ]
-then
-	# Delete file checksum for the old conf file location
-#REMOVEME? 	ynh_delete_file_checksum --file="$nginx_conf_path"
-#REMOVEME? 	mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf
-	# Store file checksum for the new config file location
-#REMOVEME? 	ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
-fi
-
 #=================================================
 # SPECIFIC MODIFICATIONS
 #=================================================
@@ -123,20 +48,10 @@ db_prefix=$(grep '^$table_prefix' "$install_dir/wp-config.php" | sed "s/.*'\(.*\
 ynh_mysql_execute_as_root --sql="UPDATE ${db_prefix}options SET option_value='https://$new_domain$new_path' WHERE option_name='siteurl'" --database=$app
 ynh_mysql_execute_as_root --sql="UPDATE ${db_prefix}options SET option_value='https://$new_domain$new_path' WHERE option_name='home'" --database=$app
 
-#=================================================
-# GENERIC FINALISATION
-#=================================================
-# RELOAD NGINX
-#=================================================
-#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..."
-
-#REMOVEME? #REMOVEME? ynh_systemd_action --service_name=nginx --action=reload
-
 #=================================================
 # DEACTIVE MAINTENANCE MODE
 #=================================================
-ynh_script_progression --message="Disabling maintenance mode" --weight=5
-#REMOVEME? 
+
 path=$old_path
 domain=$old_domain
 ynh_maintenance_mode_OFF
diff --git a/scripts/install b/scripts/install
index 192f9da..88676db 100644
--- a/scripts/install
+++ b/scripts/install
@@ -9,36 +9,9 @@
 source _common.sh
 source /usr/share/yunohost/helpers
 
-#=================================================
-# MANAGE SCRIPT FAILURE
-#=================================================
-
-# Exit if an error occurs during the execution of the script
-#REMOVEME? ynh_abort_if_errors
-
-#=================================================
-# RETRIEVE ARGUMENTS FROM THE MANIFEST
-#=================================================
-
-#REMOVEME? domain=$YNH_APP_ARG_DOMAIN
-#REMOVEME? path=$YNH_APP_ARG_PATH
-#REMOVEME? is_public=$YNH_APP_ARG_IS_PUBLIC
-#REMOVEME? language=$YNH_APP_ARG_LANGUAGE
-#REMOVEME? admin_wordpress=$YNH_APP_ARG_ADMIN
-#REMOVEME? multisite=$YNH_APP_ARG_MULTISITE
-
-#REMOVEME? app=$YNH_APP_INSTANCE_NAME
-
 #=================================================
 # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
 #=================================================
-#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=2
-
-#REMOVEME? install_dir=/var/www/$app
-#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder"
-
-# Register (book) web path
-#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path
 
 if [ "$path" == "/" ] && [ $multisite -eq 1 ]; then
 	ynh_die --message="Multisite option of WordPress doesn't work at the root of a domain."
@@ -47,51 +20,19 @@ fi
 #=================================================
 # STORE SETTINGS FROM MANIFEST
 #=================================================
-#REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=2
 
-#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain
-#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path
 ynh_app_setting_set --app=$app --key=language --value=$language
-#REMOVEME? ynh_app_setting_set --app=$app --key=admin --value=$admin_wordpress
 ynh_app_setting_set --app=$app --key=multisite --value=$multisite
 
-ynh_app_setting_set --app=$app --key=overwrite_nginx --value=1
-ynh_app_setting_set --app=$app --key=overwrite_phpfpm --value=1
+#ynh_app_setting_set --app=$app --key=overwrite_nginx --value=1
+#ynh_app_setting_set --app=$app --key=overwrite_phpfpm --value=1
 #REMOVEME? ynh_app_setting_set --app=$app --key=admin_mail_html --value=1
 
-#=================================================
-# INSTALL DEPENDENCIES
-#=================================================
-#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=5
-
-#REMOVEME? ynh_install_app_dependencies $pkg_dependencies
-
-#=================================================
-# STANDARD MODIFICATIONS
-#=================================================
-# CREATE DEDICATED USER
-#=================================================
-#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=3
-
-# Create a system user
-#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir"
-
-#=================================================
-# CREATE A MYSQL DATABASE
-#=================================================
-#REMOVEME? ynh_script_progression --message="Creating a MySQL database..." --weight=2
-
-#REMOVEME? db_name=$(ynh_sanitize_dbid --db_name=$app)
-#REMOVEME? db_user=$db_name
-#REMOVEME? ynh_app_setting_set --app=$app --key=db_name --value=$db_name
-#REMOVEME? ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name
-
 #=================================================
 # DOWNLOAD, CHECK AND UNPACK SOURCE
 #=================================================
 ynh_script_progression --message="Setting up source files..." --weight=4
 
-#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir
 # Download, check integrity, uncompress and patch the source from app.src
 ynh_setup_source --dest_dir="$install_dir"
 
@@ -112,7 +53,7 @@ fpm_footprint="medium"
 fpm_free_footprint=0
 
 # If the app is private, set the usage to low, otherwise to high.
-#REMOVEME? if [ $is_public -eq 0 ]
+if [ $is_public -eq 0 ]
 then
     fpm_usage="low"
 else
@@ -125,7 +66,6 @@ ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
 
 # Create a dedicated PHP-FPM config
 ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
-#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
 
 #=================================================
 # SPECIFIC SETUP
@@ -153,20 +93,15 @@ ynh_script_progression --message="Installing wordpress with cURL..." --weight=10
 # Set right permissions for cURL install
 chown -R $app: $install_dir
 
-# Set the app as temporarily public for cURL call
-#REMOVEME? ynh_permission_update --permission="main" --add="visitors"
 # Regen SSOwat configuration
 yunohost app ssowatconf
 
 # Reload NGINX
-#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload
+ynh_systemd_action --service_name=nginx --action=reload
 
 # Wordpress installation
 ynh_local_curl "/wp-admin/install.php?step=2" "&weblog_title=YunoBlog" "user_name=$admin_wordpress" "admin_password=$db_pwd" "admin_password2=$db_pwd" "admin_email=$admin_wordpress@$domain" "Submit=Install+WordPress"
 
-# Remove the public access
-#REMOVEME? ynh_permission_update --permission="main" --remove="visitors"
-
 ynh_print_info --message="Please wait during Wordpress installation..."
 for i in `seq 1 300`
 do
@@ -282,51 +217,11 @@ ynh_script_progression --message="Configuring Fail2Ban..." --weight=7
 # Create a dedicated Fail2Ban config
 ynh_add_fail2ban_config --logpath="/var/log/auth.log" --failregex="Authentication (attempt for unknown user|failure for) .* from " --max_retry=5
 
-#=================================================
-# SETUP SSOWAT
-#=================================================
-#REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=1
-
-# Make app public if necessary
-#REMOVEME? if [ $is_public -eq 1 ]
-then
-	# Everyone can access the app.
-	# The "main" permission is automatically created before the install script.
-#REMOVEME? 	ynh_permission_update --permission="main" --add="visitors"
-fi
-
-# Only the admin can access the admin panel of the app
-#REMOVEME? ynh_permission_create --permission="admin" --url="/wp-login.php" --additional_urls="/wp-admin.php" --allowed=$admin_wordpress
-
-#=================================================
-# RELOAD NGINX
-#=================================================
-#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=3
-
-#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload
-
 #=================================================
 # REMOVE WP-CLI.PHAR
 #=================================================
 
-#REMOVEME? ynh_secure_remove --file=$install_dir/wp-cli.phar
-
-#=================================================
-# SEND A README FOR THE ADMIN
-#=================================================
-
-# Get main domain and buid the url of the admin panel of the app.
-admin_panel="https://$(grep portal_domain /etc/ssowat/conf.json | cut -d'"' -f4)/yunohost/admin/#/apps/$app"
-
-echo "Please manually trigger updates to major versions in the WordPress admin area.
-You can also activate the automatic update in the Companion Auto Update plugin settings.
-
-You can configure this app easily by using the experimental __URL_TAG1__config-panel feature__URL_TAG2__$admin_panel/config-panel__URL_TAG3__.
-You can also find some specific actions for this app by using the experimental __URL_TAG1__action feature__URL_TAG2__$admin_panel/actions__URL_TAG3__.
-
-If you're facing an issue or want to improve this app, please open a new issue in this __URL_TAG1__project__URL_TAG2__https://github.com/YunoHost-Apps/wordpress_ynh__URL_TAG3__." > mail_to_send
-
-ynh_send_readme_to_admin --app_message="mail_to_send" --recipients="$admin_wordpress" --type=install
+ynh_secure_remove --file=$install_dir/wp-cli.phar
 
 #=================================================
 # END OF SCRIPT

From 3732d1cd52de588e4e14a6ad8c6ac098a716c6d0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?E=CC=81ric=20Gaspar?=
 <46165813+ericgaspar@users.noreply.github.com>
Date: Tue, 25 Apr 2023 21:26:13 +0200
Subject: [PATCH 05/20] v2

---
 manifest.toml   |  2 --
 scripts/upgrade | 70 +++++++++----------------------------------------
 tests.toml      |  0
 3 files changed, 13 insertions(+), 59 deletions(-)
 create mode 100644 tests.toml

diff --git a/manifest.toml b/manifest.toml
index b6115aa..c0b569a 100644
--- a/manifest.toml
+++ b/manifest.toml
@@ -14,8 +14,6 @@ license = "GPL-2.0"
 website = "https://wordpress.org/"
 admindoc = "https://codex.wordpress.org/"
 code = "https://core.trac.wordpress.org/browser"
-cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number)
-fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin.
 
 [integration]
 yunohost = ">= 11.1.18"
diff --git a/scripts/upgrade b/scripts/upgrade
index be0e97b..82f4c9c 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -28,20 +28,14 @@ ynh_maintenance_mode_ON
 #=================================================
 ynh_script_progression --message="Ensuring downward compatibility..."
 
-if [ -z "$admin_wordpress" ]; then
+if [ -z "${admin:-}" ]; then
 	ynh_mysql_execute_as_root --sql="select MAX(user_login) from wp_users where user_status=0 INTO OUTFILE '/tmp/wordpressuser';" --database=$db_name
-	admin_wordpress=$(cat /tmp/wordpressuser)
+	admin=$(cat /tmp/wordpressuser)
 	ynh_secure_remove --file=/tmp/wordpressuser
-#REMOVEME? 	ynh_app_setting_set --app=$app --key=admin --value=$admin_wordpress
+	ynh_app_setting_set --app=$app --key=admin --value=$admin
 fi
 
-# If install_dir doesn't exist, create it
-if [ -z "$install_dir" ]; then
-#REMOVEME? 	install_dir=/var/www/$app
-#REMOVEME? 	ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir
-fi
-
-if [ -z "$language" ]; then
+if [ -z "${language:-}" ]; then
 	language=$(grep WPLANG $install_dir/wp-config.php | cut -d"'" -f4)
 	ynh_app_setting_set --app=$app --key=language --value=$language
 fi
@@ -55,51 +49,27 @@ elif [ "${multisite,,}" = "no" ]; then
 	multisite=0
 fi
 
-# If db_name doesn't exist, create it
-if [ -z "$db_name" ]; then
-	db_name=$(ynh_sanitize_dbid --db_name=$app)
-#REMOVEME? 	ynh_app_setting_set --app=$app --key=db_name --value=$db_name
-fi
-
 # If some 'add_filter' are still in wp_config, remove them
 if grep add_filter.*auto_update $install_dir/wp-config.php; then
 	sed --in-place '/add_filter.*auto_update/d' $install_dir/wp-config.php
 fi
 
-# If admin_mail_html doesn't exist, create it
-if [ -z "$admin_mail_html" ]; then
-	admin_mail_html=1
-#REMOVEME? 	ynh_app_setting_set --app=$app --key=admin_mail_html --value=$admin_mail_html
-fi
-
-# If overwrite_nginx doesn't exist, create it
-if [ -z "$overwrite_nginx" ]; then
-	overwrite_nginx=1
-	ynh_app_setting_set $app overwrite_nginx $overwrite_nginx
-fi
-
-# If overwrite_phpfpm doesn't exist, create it
-if [ -z "$overwrite_phpfpm" ]; then
-    overwrite_phpfpm=1
-    ynh_app_setting_set --app=$app --key=overwrite_phpfpm --value=$overwrite_phpfpm
-fi
-
 # If fpm_footprint doesn't exist, create it
-if [ -z "$fpm_footprint" ]; then
+if [ -z "${fpm_footprint:-}" ]; then
     fpm_footprint=medium
     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
+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
+if [ -z "${fpm_usage:-}" ]; then
 	# If the app is private, set the usage to low, otherwise to high.
-#REMOVEME? 	if [ $(ynh_app_setting_get --app=$app --key=is_public) -eq 0 ]
+	if [ $(ynh_app_setting_get --app=$app --key=is_public) -eq 0 ]
 	then
 		usage=low
 	else
@@ -109,12 +79,6 @@ if [ -z "$fpm_usage" ]; then
     ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
 fi
 
-# If phpversion doesn't exist, create it
-if [ -z "$phpversion" ]; then
-    phpversion=$YNH_PHP_VERSION
-    ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion
-fi
-
 # Replace wp-fail2ban by wp-fail2ban-redux
 ynh_exec_warn_less wget --no-verbose https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar --output-document=$install_dir/wp-cli.phar
 wpcli_alias="php$phpversion $install_dir/wp-cli.phar --allow-root --path=$install_dir"
@@ -131,25 +95,17 @@ $wpcli_alias plugin is-installed simple-ldap-login && $wpcli_alias plugin deacti
 #=================================================
 # NGINX CONFIGURATION
 #=================================================
+ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2
 
-# Overwrite the NGINX configuration only if it's allowed
-if [ $overwrite_nginx -eq 1 ]
-then
-    ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2
-	ynh_add_nginx_config
-fi
+ynh_add_nginx_config
 
 #=================================================
 # PHP-FPM CONFIGURATION
 #=================================================
+ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=4
 
-# Overwrite the PHP-FPM configuration only if it's allowed
-if [ $overwrite_phpfpm -eq 1 ]
-then
-    ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=4
-    # Create a dedicated PHP-FPM config
-    ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
-fi
+ # Create a dedicated PHP-FPM config
+ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
 
 #=================================================
 # SPECIFIC UPGRADE
diff --git a/tests.toml b/tests.toml
new file mode 100644
index 0000000..e69de29

From 236ec751794df7121d0a87c6cbb16d58ab3350a6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?E=CC=81ric=20Gaspar?=
 <46165813+ericgaspar@users.noreply.github.com>
Date: Tue, 25 Apr 2023 21:29:31 +0200
Subject: [PATCH 06/20] v2

---
 scripts/install |  6 +-----
 tests.toml      | 31 +++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/scripts/install b/scripts/install
index 88676db..78cd258 100644
--- a/scripts/install
+++ b/scripts/install
@@ -24,10 +24,6 @@ fi
 ynh_app_setting_set --app=$app --key=language --value=$language
 ynh_app_setting_set --app=$app --key=multisite --value=$multisite
 
-#ynh_app_setting_set --app=$app --key=overwrite_nginx --value=1
-#ynh_app_setting_set --app=$app --key=overwrite_phpfpm --value=1
-#REMOVEME? ynh_app_setting_set --app=$app --key=admin_mail_html --value=1
-
 #=================================================
 # DOWNLOAD, CHECK AND UNPACK SOURCE
 #=================================================
@@ -100,7 +96,7 @@ yunohost app ssowatconf
 ynh_systemd_action --service_name=nginx --action=reload
 
 # Wordpress installation
-ynh_local_curl "/wp-admin/install.php?step=2" "&weblog_title=YunoBlog" "user_name=$admin_wordpress" "admin_password=$db_pwd" "admin_password2=$db_pwd" "admin_email=$admin_wordpress@$domain" "Submit=Install+WordPress"
+ynh_local_curl "/wp-admin/install.php?step=2" "&weblog_title=YunoBlog" "user_name=$admin" "admin_password=$db_pwd" "admin_password2=$db_pwd" "admin_email=$admin@$domain" "Submit=Install+WordPress"
 
 ynh_print_info --message="Please wait during Wordpress installation..."
 for i in `seq 1 300`
diff --git a/tests.toml b/tests.toml
index e69de29..a84a8fc 100644
--- a/tests.toml
+++ b/tests.toml
@@ -0,0 +1,31 @@
+test_format = 1.0
+
+[default]
+
+    # ------------
+    # Tests to run
+    # ------------
+
+    exclude = ["install.private", "install.multi"]  # The test IDs to be used in only/exclude statements are: install.root, install.subdir, install.nourl, install.multi, backup_restore, upgrade, upgrade.someCommitId change_url
+
+    # -------------------------------
+    # Default args to use for install
+    # -------------------------------
+
+    args.multisite = 0
+
+    # -------------------------------
+    # Commits to test upgrade from
+    # -------------------------------
+
+    test_upgrade_from.773073679873fbed3562c2d315f58eb4c1c0d4fc.name = "Upgrade from 5.8"
+
+# This is an additional test suite
+[with_multisite]
+
+    # On additional tests suites, you can decide to run only specific tests
+
+    only = ["install.subdir"]
+
+    args.language = "en_GB"
+    args.multisite = 1

From 9135a9ecb2a0cea3125d97f6b9ba0c770776a52e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?E=CC=81ric=20Gaspar?=
 <46165813+ericgaspar@users.noreply.github.com>
Date: Tue, 25 Apr 2023 21:41:24 +0200
Subject: [PATCH 07/20] Update manifest.toml

---
 manifest.toml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/manifest.toml b/manifest.toml
index c0b569a..12730fa 100644
--- a/manifest.toml
+++ b/manifest.toml
@@ -65,7 +65,7 @@ ram.runtime = "50M"
     [resources.permissions]
     main.url = "/"
     admin.url = "/wp-login.php"
-    admin.additional_urls="/wp-admin.php"
+    admin.additional_urls = ["/wp-admin.php"]
     admin.allowed = "admins"
 
     [resources.apt]

From 8660b53c6a6e1028b111bd12f1dc2f0e206b3d17 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?E=CC=81ric=20Gaspar?=
 <46165813+ericgaspar@users.noreply.github.com>
Date: Fri, 12 May 2023 09:42:05 +0200
Subject: [PATCH 08/20] cleaning

---
 conf/nginx.conf    | 2 +-
 doc/ADMIN.md       | 2 +-
 doc/ADMIN_fr.md    | 6 +-----
 manifest.toml      | 2 +-
 scripts/_common.sh | 8 ++++----
 5 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/conf/nginx.conf b/conf/nginx.conf
index eb53526..52a64d5 100644
--- a/conf/nginx.conf
+++ b/conf/nginx.conf
@@ -16,7 +16,7 @@ location __PATH__/ {
               rewrite ^(.+)$ __PATH__/index.php?q=$1 last;
        }
 
-       client_max_body_size 30m;
+       client_max_body_size 50m;
        location ~ [^/]\.php(/|$) {
            fastcgi_split_path_info ^(.+?\.php)(/.*)$;
            fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
diff --git a/doc/ADMIN.md b/doc/ADMIN.md
index ac55464..61a8eeb 100644
--- a/doc/ADMIN.md
+++ b/doc/ADMIN.md
@@ -1,6 +1,6 @@
 ## Configuration
 
-Use the admin panel of your WordPress to configure this app.
+Use WordPress admin panel to configure this app.
 
 ## YunoHost specific features
 
diff --git a/doc/ADMIN_fr.md b/doc/ADMIN_fr.md
index eb9bfed..35f24c8 100644
--- a/doc/ADMIN_fr.md
+++ b/doc/ADMIN_fr.md
@@ -1,6 +1,6 @@
 ## Configuration
 
-Utilisez le panneau d'administration de votre WordPress pour le configurer.
+Utilisez le panneau d'administration de WordPress pour configurer l'application.
 
 ## Caractéristiques spécifiques YunoHost
 
@@ -10,10 +10,6 @@ Utilisez le panneau d'administration de votre WordPress pour le configurer.
  * Mises à jour automatiques du cœur de WordPress, extentions et thèmes.
  * Capable de configurer une instance [multisite](https://codex.wordpress.org/Glossary#Multisite).
 
-#### Support multi-utilisateur
-
-Supporté, avec LDAP et SSO.
-
 ## Limitations
 
 * Le multisite n'est disponible que sur des sous-domaines.
diff --git a/manifest.toml b/manifest.toml
index 12730fa..c013092 100644
--- a/manifest.toml
+++ b/manifest.toml
@@ -16,7 +16,7 @@ admindoc = "https://codex.wordpress.org/"
 code = "https://core.trac.wordpress.org/browser"
 
 [integration]
-yunohost = ">= 11.1.18"
+yunohost = ">= 11.1.19"
 architectures = "all"
 multi_instance = true
 ldap = true
diff --git a/scripts/_common.sh b/scripts/_common.sh
index 0691acc..9f92349 100755
--- a/scripts/_common.sh
+++ b/scripts/_common.sh
@@ -11,10 +11,10 @@
 ynh_maintenance_mode_ON () {
 	# Load value of $path and $domain from the config if their not set
 	if [ -z $path ]; then
-#REMOVEME? 		path=$(ynh_app_setting_get $app path)
+		path=$(ynh_app_setting_get $app path)
 	fi
 	if [ -z $domain ]; then
-#REMOVEME? 		domain=$(ynh_app_setting_get $app domain)
+		domain=$(ynh_app_setting_get $app domain)
 	fi
 
 	mkdir -p /var/www/html/
@@ -67,10 +67,10 @@ include conf.d/yunohost_panel.conf.inc;
 ynh_maintenance_mode_OFF () {
 	# Load value of $path and $domain from the config if their not set
 	if [ -z $path ]; then
-#REMOVEME? 		path=$(ynh_app_setting_get $app path)
+		path=$(ynh_app_setting_get $app path)
 	fi
 	if [ -z $domain ]; then
-#REMOVEME? 		domain=$(ynh_app_setting_get $app domain)
+		domain=$(ynh_app_setting_get $app domain)
 	fi
 
 	# Rewrite the nginx config file to redirect from ${path}_maintenance to the real url of the app.

From cb3fc1bb2e80363aa06326602bf7d69904d9a1be Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?E=CC=81ric=20Gaspar?=
 <46165813+ericgaspar@users.noreply.github.com>
Date: Fri, 12 May 2023 10:12:43 +0200
Subject: [PATCH 09/20] Update install

---
 scripts/install | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/scripts/install b/scripts/install
index 78cd258..12cdb99 100644
--- a/scripts/install
+++ b/scripts/install
@@ -47,14 +47,7 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=2
 
 fpm_footprint="medium"
 fpm_free_footprint=0
-
-# If the app is private, set the usage to low, otherwise to high.
-if [ $is_public -eq 0 ]
-then
-    fpm_usage="low"
-else
-    fpm_usage="high"
-fi
+fpm_usage="low"
 
 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

From 418d61f29f62dcb8d6bfe1c8fbdf3cd8dc8a95ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?E=CC=81ric=20Gaspar?=
 <46165813+ericgaspar@users.noreply.github.com>
Date: Fri, 12 May 2023 10:13:40 +0200
Subject: [PATCH 10/20] Update upgrade

---
 scripts/upgrade | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/scripts/upgrade b/scripts/upgrade
index 82f4c9c..ef6ab17 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -68,14 +68,7 @@ fi
 
 # If fpm_usage doesn't exist, create it
 if [ -z "${fpm_usage:-}" ]; then
-	# If the app is private, set the usage to low, otherwise to high.
-	if [ $(ynh_app_setting_get --app=$app --key=is_public) -eq 0 ]
-	then
-		usage=low
-	else
-		usage=high
-	fi
-    fpm_usage=$usage
+    fpm_usage=low
     ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
 fi
 

From fbbf957dbc7d44b4134eee14c1c08bcc71d7cd14 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?E=CC=81ric=20Gaspar?=
 <46165813+ericgaspar@users.noreply.github.com>
Date: Fri, 12 May 2023 15:20:22 +0200
Subject: [PATCH 11/20] Update tests.toml

---
 tests.toml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests.toml b/tests.toml
index a84a8fc..9fc5a83 100644
--- a/tests.toml
+++ b/tests.toml
@@ -27,5 +27,5 @@ test_format = 1.0
 
     only = ["install.subdir"]
 
-    args.language = "en_GB"
+    args.language = "en_US"
     args.multisite = 1

From 3acae94350326e64fb7932999e61bf2ecd06e2bb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?E=CC=81ric=20Gaspar?=
 <46165813+ericgaspar@users.noreply.github.com>
Date: Tue, 16 May 2023 09:58:54 +0200
Subject: [PATCH 12/20] update php to 8.2

---
 manifest.toml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/manifest.toml b/manifest.toml
index c013092..efbe58e 100644
--- a/manifest.toml
+++ b/manifest.toml
@@ -69,7 +69,7 @@ ram.runtime = "50M"
     admin.allowed = "admins"
 
     [resources.apt]
-    packages = "mariadb-server php8.0-mysql php8.0-curl php8.0-json php8.0-mbstring php8.0-xml php8.0-zip php8.0-gd php8.0-soap php8.0-ssh2 php8.0-tokenizer php8.0-ldap"
+    packages = "mariadb-server php8.2-mysql php8.2-curl php8.2-json php8.2-mbstring php8.2-xml php8.2-zip php8.2-gd php8.2-soap php8.2-ssh2 php8.2-tokenizer php8.2-ldap"
 
     [resources.database]
     type = "mysql"

From 5d5a75a89a0efa4dcd68182d205e6c3a87507edd Mon Sep 17 00:00:00 2001
From: Alexandre Aubin 
Date: Tue, 16 May 2023 12:29:17 +0200
Subject: [PATCH 13/20] Update ADMIN.md

---
 doc/ADMIN.md | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/doc/ADMIN.md b/doc/ADMIN.md
index 61a8eeb..5808580 100644
--- a/doc/ADMIN.md
+++ b/doc/ADMIN.md
@@ -1,21 +1,8 @@
-## Configuration
+### Updating wordpress
 
-Use WordPress admin panel to configure this app.
+As the automatic update plugin isn't working as expected, pay attention to keep your WordPress up to date from the WordPress admin panel, and not only from YunoHost admin panel. For security reason, you should control that all updates are regularly applied in WordPress admin panel as well as in YunoHost admin panel.
 
-## YunoHost specific features
-
- * Integration with YunoHost users and SSO:
-   * private mode: Blog only accessible by YunoHost users
-   * public mode: Visible by anyone, YunoHost users automatically connected
- * Automatic update of wordpress core, plugins and themes.
- * Allow to set up a [multisite](https://codex.wordpress.org/Glossary#Multisite) instance.
-
-## Limitations
-
-* Multisite only available on subdirectories.
-* As the automatic update plugin isn't working as expected, pay attention to keep your WordPress up to date from the WordPress admin panel, and not only from YunoHost admin panel. For security reason, you should control that all updates are regularly applied in WordPress admin panel as well as in YunoHost admin panel.
-
-**Security**
+### Security
 
 Please be aware that WordPress is known for being frequently a source of security risks (https://en.wikipedia.org/wiki/WordPress#Vulnerabilities), and also as the most popular website management system it is a target for bots and attackers.
 Some vulnerabilities might let an attacker breach into your WordPress, or even your YunoHost server (via privilege escalation).

From 64de86a0ad72b385053fab23840a6d0393789e47 Mon Sep 17 00:00:00 2001
From: Alexandre Aubin 
Date: Tue, 16 May 2023 12:30:44 +0200
Subject: [PATCH 14/20] Update ADMIN_fr.md

---
 doc/ADMIN_fr.md | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/doc/ADMIN_fr.md b/doc/ADMIN_fr.md
index 35f24c8..7d777d4 100644
--- a/doc/ADMIN_fr.md
+++ b/doc/ADMIN_fr.md
@@ -1,21 +1,8 @@
-## Configuration
+### Mises à jour de wordpress
 
-Utilisez le panneau d'administration de WordPress pour configurer l'application.
+Comme les mises à jour automatiques ne fonctionnent pas correctement, prenez soin de bien mettre à jour WordPress via le panneau d'administration de WordPress et pas seulement via le panneau d'administration de YunoHost. Pour des raisons de sécurité, vérifiez bien que toutes les mises à jour sont bien installées dans le panneau d'administration de WordPress comme dans le panneau d'administration de YunoHost.
 
-## Caractéristiques spécifiques YunoHost
-
- * Intégration avec les utilisateurs YunoHost et le SSO :
-   * en mode privé : Le blog ou le site est accessible uniquement aux utilisateurs YunoHost
-   * en mode public : Le blog ou le site est accessible par n'importe qui et les utilisateurs YunoHost sont automatiquement connectés
- * Mises à jour automatiques du cœur de WordPress, extentions et thèmes.
- * Capable de configurer une instance [multisite](https://codex.wordpress.org/Glossary#Multisite).
-
-## Limitations
-
-* Le multisite n'est disponible que sur des sous-domaines.
-* Comme les mises à jour automatiques ne fonctionnent pas correctement, prenez soin de bien mettre à jour WordPress via le panneau d'administration de WordPress et pas seulement via le panneau d'administration de YunoHost. Pour des raisons de sécurité, vérifiez bien que toutes les mises à jour sont bien installées dans le panneau d'administration de WordPress comme dans le panneau d'administration de YunoHost.
-
-**Sécurité**
+### Securité
 
 Soyez conscients que WordPress est connu pour avoir souvent des risques de sécurité (https://en.wikipedia.org/wiki/WordPress#Vulnerabilities), donc comme c'est le gestionnaire de sites le plus populaire il est la cible des robots et pirates.
 Des vulnérabilités peuvent offrir une brêche dans votre WordPress ou dans votre serveur YunoHost (via l'escalade des droits).

From d7b3cea730be3c076d99e28f06b6b76fd9dc3ffa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?E=CC=81ric=20Gaspar?=
 <46165813+ericgaspar@users.noreply.github.com>
Date: Tue, 20 Jun 2023 22:38:47 +0200
Subject: [PATCH 15/20] cleaning

---
 .github/workflows/updater.py  | 126 ----------------------------------
 .github/workflows/updater.yml |  38 ----------
 doc/ADMIN.md                  |   2 +-
 doc/ADMIN_fr.md               |   2 +-
 manifest.toml                 |  10 +--
 5 files changed, 7 insertions(+), 171 deletions(-)
 delete mode 100755 .github/workflows/updater.py
 delete mode 100644 .github/workflows/updater.yml

diff --git a/.github/workflows/updater.py b/.github/workflows/updater.py
deleted file mode 100755
index 002368b..0000000
--- a/.github/workflows/updater.py
+++ /dev/null
@@ -1,126 +0,0 @@
-#!/usr/bin/env python3
-"""
-This script is meant to be run by GitHub Actions.
-It comes with a Github Action updater.yml to run this script periodically.
-
-Since each app is different, maintainers can adapt its contents to perform
-automatic actions when a new upstream release is detected.
-
-You need to enable the action by removing `if ${{ false }}` in updater.yml!
-"""
-
-import hashlib
-import json
-import logging
-import os
-import re
-from subprocess import run, PIPE
-import textwrap
-from typing import List, Tuple, Any
-import requests
-from packaging import version
-
-logging.getLogger().setLevel(logging.INFO)
-
-
-# ========================================================================== #
-# Functions customizable by app maintainer
-
-def get_latest_version(repo: str) -> Tuple[version.Version, Any]:
-    """
-    May be customized by maintainers for other forges than Github.
-    Returns a tuple: a comparable version, and some data that will
-    be passed to get_asset_urls_of_release().
-    """
-    api_url = "https://api.wordpress.org/core/version-check/1.7/"
-
-    # Maintainer: use either releases or tags
-    tags = requests.get(f"{api_url}").json()
-    tag_info = next(
-        tag for tag in tags["offers"]
-    )
-    return version.Version(tag_info["version"]), tag_info
-
-def generate_src_files(repo: str, release: Any):
-    """
-    Should call write_src_file() for every asset/binary/... to download.
-    """
-
-    built_release = release["packages"]["full"]
-    logging.info("Handling main tarball at %s", built_release)
-    write_src_file("app.src", built_release, "zip")
-
-
-# ========================================================================== #
-# Core generic code of the script, app maintainers should not edit this part
-
-def sha256sum_of_url(url: str) -> str:
-    """Compute checksum without saving the file"""
-    checksum = hashlib.sha256()
-    for chunk in requests.get(url, stream=True).iter_content(10*1024):
-        checksum.update(chunk)
-    return checksum.hexdigest()
-
-def write_src_file(name: str, asset_url: str, extension: str,
-                   extract: bool = True, subdir: bool = True) -> None:
-    """Rewrite conf/app.src"""
-    logging.info("Writing %s...", name)
-
-    with open(f"conf/{name}", "w", encoding="utf-8") as conf_file:
-        conf_file.write(textwrap.dedent(f"""\
-            SOURCE_URL={asset_url}
-            SOURCE_SUM={sha256sum_of_url(asset_url)}
-            SOURCE_SUM_PRG=sha256sum
-            SOURCE_FORMAT={extension}
-            SOURCE_IN_SUBDIR={str(subdir).lower()}
-            SOURCE_EXTRACT={str(extract).lower()}
-        """))
-
-def write_github_env(proceed: bool, new_version: str, branch: str):
-    """Those values will be used later in the workflow"""
-    if "GITHUB_ENV" not in os.environ:
-        logging.warning("GITHUB_ENV is not in the envvars, assuming not in CI")
-        return
-    with open(os.environ["GITHUB_ENV"], "w", encoding="utf-8") as github_env:
-        github_env.write(textwrap.dedent(f"""\
-            VERSION={new_version}
-            BRANCH={branch}
-            PROCEED={str(proceed).lower()}
-        """))
-
-def main():
-    with open("manifest.json", "r", encoding="utf-8") as manifest_file:
-        manifest = json.load(manifest_file)
-    repo = manifest["upstream"]["code"]
-
-    current_version = version.Version(manifest["version"].split("~")[0])
-    latest_version, release_info = get_latest_version(repo)
-    logging.info("Current version: %s", current_version)
-    logging.info("Latest upstream version: %s", latest_version)
-
-    # Proceed only if the retrieved version is greater than the current one
-    if latest_version <= current_version:
-        logging.warning("No new version available")
-        write_github_env(False, "", "")
-        return
-
-    # Proceed only if a PR for this new version does not already exist
-    branch = f"ci-auto-update-v{latest_version}"
-    command = ["git", "ls-remote", "--exit-code", "-h", repo, branch]
-    if run(command, stderr=PIPE, stdout=PIPE, check=False).returncode == 0:
-        logging.warning("A branch already exists for this update")
-        write_github_env(False, "", "")
-        return
-
-    generate_src_files(repo, release_info)
-
-    manifest["version"] = f"{latest_version}~ynh1"
-    with open("manifest.json", "w", encoding="utf-8") as manifest_file:
-        json.dump(manifest, manifest_file, indent=4, ensure_ascii=False)
-        manifest_file.write("\n")
-
-    write_github_env(True, latest_version, branch)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml
deleted file mode 100644
index fd577d1..0000000
--- a/.github/workflows/updater.yml
+++ /dev/null
@@ -1,38 +0,0 @@
-# This workflow allows GitHub Actions to automagically update your app whenever a new upstream release is detected.
-# You need to enable Actions in your repository settings, and fetch this Action from the YunoHost-Apps organization.
-# This file should be enough by itself, but feel free to tune it to your needs.
-# It calls updater.sh, which is where you should put the app-specific update steps.
-name: Check for new upstream releases
-on:
-  # Allow to manually trigger the workflow
-  workflow_dispatch:
-  # Run it every day at 8:00 UTC
-  schedule:
-    - cron: '0 8 * * *'
-
-jobs:
-  updater:
-
-    runs-on: ubuntu-latest
-    steps:
-      - name: Fetch the source code
-        uses: actions/checkout@v3
-        with:
-          token: ${{ secrets.GITHUB_TOKEN }}
-
-      - name: Run the updater script
-        run: .github/workflows/updater.py
-
-      - name: Create Pull Request
-        if: ${{ env.PROCEED == 'true' }}
-        uses: peter-evans/create-pull-request@v4
-        with:
-          token: ${{ secrets.GITHUB_TOKEN }}
-          title: Upgrade ${{ env.APP_NAME }} to version ${{ env.VERSION }}
-          body: Upgrade ${{ env.APP_NAME }} to version ${{ env.VERSION }}
-          commit-message: Upgrade ${{ env.APP_NAME }} to version ${{ env.VERSION }}
-          committer: 'yunohost-bot '
-          author: 'yunohost-bot '
-          base: testing
-          branch: ${{ env.BRANCH }}
-          delete-branch: true
diff --git a/doc/ADMIN.md b/doc/ADMIN.md
index 5808580..0e578e7 100644
--- a/doc/ADMIN.md
+++ b/doc/ADMIN.md
@@ -1,4 +1,4 @@
-### Updating wordpress
+### Updating WordPress
 
 As the automatic update plugin isn't working as expected, pay attention to keep your WordPress up to date from the WordPress admin panel, and not only from YunoHost admin panel. For security reason, you should control that all updates are regularly applied in WordPress admin panel as well as in YunoHost admin panel.
 
diff --git a/doc/ADMIN_fr.md b/doc/ADMIN_fr.md
index 7d777d4..7a1b5ed 100644
--- a/doc/ADMIN_fr.md
+++ b/doc/ADMIN_fr.md
@@ -1,4 +1,4 @@
-### Mises à jour de wordpress
+### Mises à jour de WordPress
 
 Comme les mises à jour automatiques ne fonctionnent pas correctement, prenez soin de bien mettre à jour WordPress via le panneau d'administration de WordPress et pas seulement via le panneau d'administration de YunoHost. Pour des raisons de sécurité, vérifiez bien que toutes les mises à jour sont bien installées dans le panneau d'administration de WordPress comme dans le panneau d'administration de YunoHost.
 
diff --git a/manifest.toml b/manifest.toml
index efbe58e..af6b630 100644
--- a/manifest.toml
+++ b/manifest.toml
@@ -5,7 +5,7 @@ name = "WordPress"
 description.en = "Create a beautiful blog or website easily"
 description.fr = "Logiciel de création de blog ou de site Web"
 
-version = "6.2~ynh1"
+version = "6.2.2~ynh1"
 
 maintainers = ["kay0u"]
 
@@ -16,7 +16,7 @@ admindoc = "https://codex.wordpress.org/"
 code = "https://core.trac.wordpress.org/browser"
 
 [integration]
-yunohost = ">= 11.1.19"
+yunohost = ">= 11.1.21"
 architectures = "all"
 multi_instance = true
 ldap = true
@@ -55,8 +55,8 @@ ram.runtime = "50M"
 
 [resources]
         [resources.sources.main]
-        url = "https://downloads.wordpress.org/release/wordpress-6.2.zip"
-        sha256 = "0078e0483d3447a465f71d6bbdab5c799cad2e57c221ec1d639d235b0ffced55"
+        url = "https://downloads.wordpress.org/release/wordpress-6.2.2.zip"
+        sha256 = "08669faf3c0c2289c66b1971cb0a6162d8d3ddac885ccbf342e29a0bda36250b"
 
     [resources.system_user]
 
@@ -69,7 +69,7 @@ ram.runtime = "50M"
     admin.allowed = "admins"
 
     [resources.apt]
-    packages = "mariadb-server php8.2-mysql php8.2-curl php8.2-json php8.2-mbstring php8.2-xml php8.2-zip php8.2-gd php8.2-soap php8.2-ssh2 php8.2-tokenizer php8.2-ldap"
+    packages = "mariadb-server php8.2-mysql php8.2-curl php8.2-mbstring php8.2-xml php8.2-zip php8.2-gd php8.2-soap php8.2-ssh2 php8.2-tokenizer php8.2-ldap"
 
     [resources.database]
     type = "mysql"

From a467b564dac8e0817b4cd025a7b7410e163b56cc Mon Sep 17 00:00:00 2001
From: yunohost-bot 
Date: Tue, 20 Jun 2023 20:38:54 +0000
Subject: [PATCH 16/20] Auto-update README

---
 README.md    | 2 +-
 README_fr.md | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 8470425..0830401 100644
--- a/README.md
+++ b/README.md
@@ -20,7 +20,7 @@ WordPress is open source software you can use to create a beautiful website, blo
 With this package, you can even activate the [multisite](https://wordpress.org/support/article/glossary/#multisite) option.
 
 
-**Shipped version:** 6.2~ynh1
+**Shipped version:** 6.2.2~ynh1
 
 ## Screenshots
 
diff --git a/README_fr.md b/README_fr.md
index 72b28fe..8571ec5 100644
--- a/README_fr.md
+++ b/README_fr.md
@@ -20,7 +20,7 @@ WordPress est un logiciel libre que vous pouvez utiliser pour créer un site ou
 Avec ce package, vous pouvez même activer l'option [multisite](https://codex.wordpress.org/Glossary#Multisite).
 
 
-**Version incluse :** 6.2~ynh1
+**Version incluse :** 6.2.2~ynh1
 
 ## Captures d’écran
 

From f0e4b14cb0e64efb671f4352115411fcd3541a74 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89ric=20Gaspar?=
 <46165813+ericgaspar@users.noreply.github.com>
Date: Mon, 3 Jul 2023 14:28:28 +0200
Subject: [PATCH 17/20] Update doc/ADMIN.md

Co-authored-by: Alexandre Aubin 
---
 doc/ADMIN.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/ADMIN.md b/doc/ADMIN.md
index 0e578e7..b59e290 100644
--- a/doc/ADMIN.md
+++ b/doc/ADMIN.md
@@ -7,6 +7,6 @@ As the automatic update plugin isn't working as expected, pay attention to keep
 Please be aware that WordPress is known for being frequently a source of security risks (https://en.wikipedia.org/wiki/WordPress#Vulnerabilities), and also as the most popular website management system it is a target for bots and attackers.
 Some vulnerabilities might let an attacker breach into your WordPress, or even your YunoHost server (via privilege escalation).
 
-Don't forget to comply with good security principles (strong password, frequent updates, don't add unknow code in your theme/extensions…). In particular, *please keep your WordPress as up-to-date as possible*.
+Don't forget to comply with good security principles (strong password, frequent updates, don't add unknow code in your theme/extensions…). In particular, *please keep your WordPress as up-to-date as possible*, and *do not install random, untrustworthy plug-ins*.
 
 Furthermore, you might take a look at the [Hardening Wordpress Guide](https://wordpress.org/support/article/hardening-wordpress/). You might see some benefits in the use of Wordpress security plugins.

From b59305675b31527dc916096d32b77866336548f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89ric=20Gaspar?=
 <46165813+ericgaspar@users.noreply.github.com>
Date: Mon, 3 Jul 2023 14:28:40 +0200
Subject: [PATCH 18/20] Update doc/ADMIN_fr.md

Co-authored-by: Alexandre Aubin 
---
 doc/ADMIN_fr.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/ADMIN_fr.md b/doc/ADMIN_fr.md
index 7a1b5ed..1477741 100644
--- a/doc/ADMIN_fr.md
+++ b/doc/ADMIN_fr.md
@@ -7,6 +7,6 @@ Comme les mises à jour automatiques ne fonctionnent pas correctement, prenez so
 Soyez conscients que WordPress est connu pour avoir souvent des risques de sécurité (https://en.wikipedia.org/wiki/WordPress#Vulnerabilities), donc comme c'est le gestionnaire de sites le plus populaire il est la cible des robots et pirates.
 Des vulnérabilités peuvent offrir une brêche dans votre WordPress ou dans votre serveur YunoHost (via l'escalade des droits).
 
-N'oubliez pas d'appliquer les principes de sécurité de base (mots de passe forts, mises à jours fréquentes, ne pas ajouter du code inconnu dans le thème et les extensionts…). En particuler, *gardez votre Wordpress à jour le plus possible*.
+N'oubliez pas d'appliquer les principes de sécurité de base (mots de passe forts, mises à jours fréquentes, ne pas ajouter du code inconnu dans le thème et les extensionts…). En particuler, *gardez votre Wordpress à jour le plus possible* et *n'installez pas d'extensions qui ne soit pas digne de confiance*.
 
 Par ailleurs, vous pourriez avoir besoin de regarder [ce guide](https://wordpress.org/support/article/hardening-wordpress/). Installer des extensions de sécurité peut-être une bonne chose.

From 8daae56756b7acccf2a85e9858c719e819a4b23a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89ric=20Gaspar?=
 <46165813+ericgaspar@users.noreply.github.com>
Date: Mon, 3 Jul 2023 14:30:06 +0200
Subject: [PATCH 19/20] Update scripts/install

Co-authored-by: Alexandre Aubin 
---
 scripts/install | 1 -
 1 file changed, 1 deletion(-)

diff --git a/scripts/install b/scripts/install
index 12cdb99..c7c6cb5 100644
--- a/scripts/install
+++ b/scripts/install
@@ -22,7 +22,6 @@ fi
 #=================================================
 
 ynh_app_setting_set --app=$app --key=language --value=$language
-ynh_app_setting_set --app=$app --key=multisite --value=$multisite
 
 #=================================================
 # DOWNLOAD, CHECK AND UNPACK SOURCE

From ff1a645b4864c9d036ac4c5a746aced37df3c48a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89ric=20Gaspar?=
 <46165813+ericgaspar@users.noreply.github.com>
Date: Tue, 4 Jul 2023 18:49:14 +0200
Subject: [PATCH 20/20] Update scripts/install

Co-authored-by: Alexandre Aubin 
---
 scripts/install | 1 -
 1 file changed, 1 deletion(-)

diff --git a/scripts/install b/scripts/install
index c7c6cb5..9254878 100644
--- a/scripts/install
+++ b/scripts/install
@@ -21,7 +21,6 @@ fi
 # STORE SETTINGS FROM MANIFEST
 #=================================================
 
-ynh_app_setting_set --app=$app --key=language --value=$language
 
 #=================================================
 # DOWNLOAD, CHECK AND UNPACK SOURCE