From ef9ded90b458c8e9667c8f7bd713268ae95323f1 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 5 Aug 2022 08:48:21 +0000 Subject: [PATCH 1/6] Upgrade to v1.4.0 --- conf/app.src | 4 ++-- manifest.json | 2 +- scripts/_common.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/conf/app.src b/conf/app.src index 346707a..71b2778 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/flarum/flarum/archive/v1.3.0.zip -SOURCE_SUM=78955c2f34f32593738b6e1908b282bb92fe50c4e3d33b5492f46fc19309084e +SOURCE_URL=https://github.com/flarum/flarum/archive/v1.4.0.zip +SOURCE_SUM=7d8a529d0e83a17a4d97304d78446c1e5c192b7c979cb88c272d3f0a77646b90 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index d2efcd2..b21cf6a 100644 --- a/manifest.json +++ b/manifest.json @@ -7,7 +7,7 @@ "fr": "Forum de nouvelle génération, simplement", "de": "Forum der nächsten Generation leicht gemacht" }, - "version": "1.3.1~ynh1", + "version": "1.4.0~ynh1", "url": "http://flarum.org/", "upstream": { "license": "MIT", diff --git a/scripts/_common.sh b/scripts/_common.sh index 36f2c88..1140ac0 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -13,7 +13,7 @@ YNH_COMPOSER_VERSION="2.0.13" extra_php_dependencies="php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-dom php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-pdo-mysql php${YNH_PHP_VERSION}-tokenizer php${YNH_PHP_VERSION}-zip" # Version numbers -project_version="1.3.0" +project_version="1.4.0" #core_version is now retrieved from the manifest ldap_version="*" From e85a44b7bdbfe8a83b8d36bcfd4534103ab9c954 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 5 Aug 2022 08:48:26 +0000 Subject: [PATCH 2/6] 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 dda73a2..e3393f2 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 Flarum is a simple discussion platform for your website. It's fast and easy to use, with all the features you need to run a successful community. -**Shipped version:** 1.3.1~ynh1 +**Shipped version:** 1.4.0~ynh1 **Demo:** https://discuss.flarum.org/d/21101-demos-come-to-flarum diff --git a/README_fr.md b/README_fr.md index 6864180..ca0ad80 100644 --- a/README_fr.md +++ b/README_fr.md @@ -17,7 +17,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Flarum est une plate-forme de discussion simple pour votre site Web. C'est rapide et facile à utiliser, avec toutes les fonctionnalités dont vous avez besoin pour gérer une communauté. -**Version incluse :** 1.3.1~ynh1 +**Version incluse :** 1.4.0~ynh1 **Démo :** https://discuss.flarum.org/d/21101-demos-come-to-flarum From 93177dfa7d5c4d9764d0fb04625f130e561f9611 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Fri, 5 Aug 2022 10:50:45 +0200 Subject: [PATCH 3/6] Do not add swap if in CI --- scripts/install | 4 +++- scripts/restore | 4 +++- scripts/upgrade | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 3794626..0efc0a0 100644 --- a/scripts/install +++ b/scripts/install @@ -126,7 +126,9 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= ynh_print_info --message="Adding swap..." -ynh_add_swap --size=$swap_needed +if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then + ynh_add_swap --size=$swap_needed +fi #================================================= # INSTALL COMPOSER DEPENDENCIES diff --git a/scripts/restore b/scripts/restore index 74aa201..0f906b9 100644 --- a/scripts/restore +++ b/scripts/restore @@ -105,7 +105,9 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./ #================================================= ynh_script_progression --message="Adding swap..." -ynh_add_swap --size=$swap_needed +if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then + ynh_add_swap --size=$swap_needed +fi #================================================= # RESTORE THE LOGROTATE CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 98d5fb3..7ec3cc5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -168,7 +168,9 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= ynh_script_progression --message="Adding swap..." -ynh_add_swap --size=$swap_needed +if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then + ynh_add_swap --size=$swap_needed +fi #================================================= # COMPOSER AND FLARUM UPGRADE From a95fe798f24eb9c470ad92d6c07ab56517502df1 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Fri, 5 Aug 2022 10:55:58 +0200 Subject: [PATCH 4/6] Appease linter: install PHP dependencies with apt helper --- scripts/_common.sh | 8 ++++---- scripts/install | 2 +- scripts/restore | 20 ++++++++++---------- scripts/upgrade | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 1140ac0..7002e04 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -2,16 +2,16 @@ # COMMON VARIABLES #================================================= -# dependencies used by the app -pkg_dependencies="" - swap_needed=1024 +# PHP YNH_PHP_VERSION="7.3" YNH_COMPOSER_VERSION="2.0.13" - extra_php_dependencies="php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-dom php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-pdo-mysql php${YNH_PHP_VERSION}-tokenizer php${YNH_PHP_VERSION}-zip" +# dependencies used by the app +pkg_dependencies="$extra_php_dependencies" + # Version numbers project_version="1.4.0" #core_version is now retrieved from the manifest diff --git a/scripts/install b/scripts/install index 0efc0a0..83b2f58 100644 --- a/scripts/install +++ b/scripts/install @@ -116,7 +116,7 @@ ynh_add_nginx_config ynh_script_progression --message="Configuring PHP-FPM..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" +ynh_add_fpm_config --usage=low --footprint=low phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= diff --git a/scripts/restore b/scripts/restore index 0f906b9..e63366d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -71,16 +71,6 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#================================================= -# RESTORE THE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the PHP-FPM configuration..." - -ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" - -# Recreate a dedicated php-fpm config -ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" - #================================================= # SPECIFIC RESTORATION #================================================= @@ -91,6 +81,16 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=2 # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies +#================================================= +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the PHP-FPM configuration..." + +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" + +# Recreate a dedicated php-fpm config +ynh_add_fpm_config --usage=low --footprint=low + #================================================= # RESTORE THE MYSQL DATABASE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 7ec3cc5..f07d15c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -158,7 +158,7 @@ ynh_install_app_dependencies $pkg_dependencies ynh_script_progression --message="Upgrading php-fpm configuration..." --weight=1 # Create a dedicated php-fpm config -ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" +ynh_add_fpm_config --usage=low --footprint=low phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= From c4e0bc310bbc6183787ce74ceba6a916aada4d64 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Fri, 5 Aug 2022 10:56:34 +0200 Subject: [PATCH 5/6] Appease linter: redirect to https is now handled by the Core --- conf/nginx.conf | 4 ---- 1 file changed, 4 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 8a7374e..67bbe89 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -4,10 +4,6 @@ location __PATH__/ { # Path to source alias __FINALPATH__/public/ ; - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - index index.php; # Bug in Nginx with locations and aliases (see http://stackoverflow.com/a/35102259 ) From 9ae6b06f5f7a7e3e6be66effeb6f7dfd3845dd0a Mon Sep 17 00:00:00 2001 From: tituspijean Date: Fri, 5 Aug 2022 11:08:38 +0200 Subject: [PATCH 6/6] [fix] Do not add swap if in CI --- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 83b2f58..08e7924 100644 --- a/scripts/install +++ b/scripts/install @@ -126,7 +126,7 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= ynh_print_info --message="Adding swap..." -if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then +if [ ${PACKAGE_CHECK_EXEC:-0} -eq 0 ]; then ynh_add_swap --size=$swap_needed fi diff --git a/scripts/restore b/scripts/restore index e63366d..0e7a94c 100644 --- a/scripts/restore +++ b/scripts/restore @@ -105,7 +105,7 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./ #================================================= ynh_script_progression --message="Adding swap..." -if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then +if [ ${PACKAGE_CHECK_EXEC:-0} -eq 0 ]; then ynh_add_swap --size=$swap_needed fi diff --git a/scripts/upgrade b/scripts/upgrade index f07d15c..dcfc23b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -168,7 +168,7 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= ynh_script_progression --message="Adding swap..." -if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then +if [ ${PACKAGE_CHECK_EXEC:-0} -eq 0 ]; then ynh_add_swap --size=$swap_needed fi