diff --git a/README.md b/README.md index c1bb8d7..911c8d2 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Create a beautiful blog or website easily -**Shipped version:** 5.8~ynh1 +**Shipped version:** 5.8.1~ynh1 diff --git a/README_fr.md b/README_fr.md index 4a3504a..832dcdd 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Logiciel de création de blog ou de site Web -**Version incluse :** 5.8~ynh1 +**Version incluse :** 5.8.1~ynh1 diff --git a/check_process b/check_process index 8f4b0cf..9913b17 100644 --- a/check_process +++ b/check_process @@ -1,11 +1,11 @@ ;; Test complet sans multisite ; Manifest - domain="domain.tld" (DOMAIN) - path="/path" (PATH) - admin="john" (USER) + domain="domain.tld" + path="/path" + admin="john" language="fr_FR" multisite=0 - is_public=1 (PUBLIC|public=1|private=0) + is_public=1 ; Actions is_public=0|1 ; Config_panel @@ -34,12 +34,12 @@ config_panel=1 ;; Test avec multisite ; Manifest - domain="domain.tld" (DOMAIN) - path="/path" (PATH) - admin="john" (USER) + domain="domain.tld" + path="/path" + admin="john" language="fr_FR" multisite=1 - is_public=1 (PUBLIC|public=1|private=0) + is_public=1 ; Checks setup_sub_dir=1 setup_root=0 diff --git a/conf/app.src b/conf/app.src index c695ce3..10c19ef 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,6 +1,5 @@ -SOURCE_URL=https://wordpress.org/wordpress-5.8.tar.gz -SOURCE_SUM=d29813ab55361318f519f2a8fa6631126a0a8f91ac30f62cb6002c108577e87f +SOURCE_URL=https://wordpress.org/wordpress-5.8.1.tar.gz +SOURCE_SUM=90ca90c4afa37dadc8a4743b5cb111b20cda5f983ce073c2c0bebdce64fa822a SOURCE_SUM_PRG=sha256sum ARCH_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= diff --git a/conf/nginx.conf b/conf/nginx.conf index 2b5cf35..8cb8a21 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -7,30 +7,24 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { - # Path to source - alias __FINALPATH__/; + # Path to source + alias __FINALPATH__/; - index index.php; - if (!-e $request_filename) - { - rewrite ^(.+)$ __PATH__/index.php?q=$1 last; - } + index index.php; + if (!-e $request_filename) { + rewrite ^(.+)$ __PATH__/index.php?q=$1 last; + } - # Force usage of https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - - client_max_body_size 30m; - location ~ [^/]\.php(/|$) { - fastcgi_split_path_info ^(.+?\.php)(/.*)$; - fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; - fastcgi_index index.php; - include fastcgi_params; - fastcgi_param REMOTE_USER $remote_user; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param SCRIPT_FILENAME $request_filename; - } + client_max_body_size 30m; + location ~ [^/]\.php(/|$) { + fastcgi_split_path_info ^(.+?\.php)(/.*)$; + fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param REMOTE_USER $remote_user; + fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param SCRIPT_FILENAME $request_filename; + } # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; diff --git a/manifest.json b/manifest.json index 5dbaa42..592dcc8 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Create a beautiful blog or website easily", "fr": "Logiciel de création de blog ou de site Web" }, - "version": "5.8~ynh1", + "version": "5.8.1~ynh1", "url": "https://wordpress.org/", "upstream": { "license": "GPL-2.0", @@ -24,7 +24,7 @@ "email": "maniackc_dev@crudelis.fr" }], "requirements": { - "yunohost": ">= 4.1.2" + "yunohost": ">= 4.3.0" }, "multi_instance": true, "services": [ @@ -36,31 +36,17 @@ "install" : [ { "name": "domain", - "type": "domain", - "ask": { - "en": "Choose a domain for WordPress", - "fr": "Choisissez un domaine pour WordPress" - }, - "example": "domain.org" + "type": "domain" }, { "name": "path", "type": "path", - "ask": { - "en": "Choose a path for WordPress", - "fr": "Choisissez un chemin pour WordPress" - }, "example": "/blog", "default": "/blog" }, { "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)" - }, - "example": "john" + "type": "user" }, { "name": "language", @@ -84,10 +70,6 @@ { "name": "is_public", "type": "boolean", - "ask": { - "en": "Is it a public WordPress site?", - "fr": "Est-ce un site public ?" - }, "default": true, "help": { "en": "A public WordPress will be publicly visible for everyone. If you're looking for a public blog, you should choose to install a public WordPress.", diff --git a/scripts/_common.sh b/scripts/_common.sh index 4404f4b..a0a56fb 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,7 +6,7 @@ YNH_PHP_VERSION="7.3" -extra_php_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" +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 diff --git a/scripts/install b/scripts/install index 7e8dd21..119bf98 100644 --- a/scripts/install +++ b/scripts/install @@ -59,12 +59,19 @@ 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 +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing dependencies..." --weight=1 + +ynh_install_app_dependencies $pkg_dependencies + #================================================= # STANDARD MODIFICATIONS #================================================= # CREATE A MYSQL DATABASE #================================================= -ynh_script_progression --message="Creating a MySQL database..." +ynh_script_progression --message="Creating a MySQL database..." --weight=2 db_name=$(ynh_sanitize_dbid --db_name=$app) ynh_app_setting_set --app=$app --key=db_name --value=$db_name @@ -108,7 +115,7 @@ else usage=high fi # Create a dedicated PHP-FPM config -ynh_add_fpm_config --usage=$usage --footprint=medium --package="$extra_php_dependencies" +ynh_add_fpm_config --usage=$usage --footprint=medium phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= @@ -120,7 +127,7 @@ ynh_script_progression --message="Configuring WordPress..." cp ../conf/wp-config.php $final_path/wp-config.php # Change variables in Wordpress configuration -ynh_replace_string --match_string="__DB_USER__" --replace_string=$db_name --target_file=$final_path/wp-config.php +ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_name" --target_file=$final_path/wp-config.php ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file=$final_path/wp-config.php for i in 1 2 3 4 5 6 7 8 diff --git a/scripts/remove b/scripts/remove index d48c28a..14cdc00 100755 --- a/scripts/remove +++ b/scripts/remove @@ -30,10 +30,18 @@ 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_name --db_name=$db_name +#================================================= +# REMOVE DEPENDENCIES +#================================================= +ynh_script_progression --message="Removing dependencies..." --weight=1 + +# Remove metapackage and its dependencies +ynh_remove_app_dependencies + #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." +ynh_script_progression --message="Removing app main directory..." --weight=2 # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -41,7 +49,7 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." +ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 # Remove the dedicated NGINX config ynh_remove_nginx_config diff --git a/scripts/restore b/scripts/restore index 7672833..a0ef6c1 100644 --- a/scripts/restore +++ b/scripts/restore @@ -38,8 +38,6 @@ fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) #================================================= ynh_script_progression --message="Validating restoration parameters..." -ynh_webpath_available --domain=$domain --path_url=$path_url \ - || ynh_die --message="Path not available: ${domain}${path_url}" test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path " @@ -101,7 +99,7 @@ chmod 640 $final_path/wp-config.php ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" # Recreate a dedicated php-fpm config -ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_php_dependencies" +ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint #================================================= # RESTORE THE FAIL2BAN CONFIGURATION @@ -112,9 +110,18 @@ 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 +#================================================= +ynh_script_progression --message="Reinstalling dependencies..." --weight=1 + +# Define and install dependencies +ynh_install_app_dependencies $pkg_dependencies + #================================================= # RESTORE THE CRON #================================================= +ynh_script_progression --message="Restoring various files..." --weight=1 ynh_restore_file "/etc/cron.d/$app" diff --git a/scripts/upgrade b/scripts/upgrade index b911bb7..a4750c1 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -183,6 +183,13 @@ then ynh_add_nginx_config fi +#================================================= +# UPGRADE DEPENDENCIES +#================================================= +ynh_script_progression --message="Upgrading dependencies..." --weight=1 + +ynh_install_app_dependencies $pkg_dependencies + #================================================= # CREATE DEDICATED USER #================================================= @@ -200,7 +207,7 @@ 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 --package="$extra_php_dependencies" + ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint fi #=================================================