1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/rainloop_ynh.git synced 2024-09-03 20:16:18 +02:00

Merge pull request #92 from YunoHost-Apps/1.17.0

1.17.0
This commit is contained in:
Éric Gaspar 2022-09-01 11:13:55 +02:00 committed by GitHub
commit aec3965f94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 41 additions and 76 deletions

View file

@ -35,7 +35,7 @@ Lightweight multi-account webmail
- Autocompletion of e-mail addresses. - Autocompletion of e-mail addresses.
**Shipped version:** 1.16.0~ynh4 **Shipped version:** 1.17.0~ynh1
**Demo:** https://mail.rainloop.net/ **Demo:** https://mail.rainloop.net/

View file

@ -35,7 +35,7 @@ Lightweight multi-account webmail
- Autocompletion of e-mail addresses. - Autocompletion of e-mail addresses.
**Version incluse :** 1.16.0~ynh4 **Version incluse :** 1.17.0~ynh1
**Démo :** https://mail.rainloop.net/ **Démo :** https://mail.rainloop.net/

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/RainLoop/rainloop-webmail/releases/download/v1.16.0/rainloop-community-1.16.0.zip SOURCE_URL=https://github.com/RainLoop/rainloop-webmail/releases/download/v1.17.0/rainloop-legacy-1.17.0.zip
SOURCE_SUM=db949c4363b048a02eaa0f06a26a8386979b8734198c2939ee1e8cc54362ca67 SOURCE_SUM=782dcabacadab5d7176f7701dd23319a040b2cfbf974fac6df068600cf69c50a
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=zip SOURCE_FORMAT=zip
SOURCE_IN_SUBDIR=false SOURCE_IN_SUBDIR=false

View file

@ -6,7 +6,7 @@
"en": "Lightweight multi-account webmail", "en": "Lightweight multi-account webmail",
"fr": "Webmail léger multi-comptes" "fr": "Webmail léger multi-comptes"
}, },
"version": "1.16.0~ynh4", "version": "1.17.0~ynh1",
"url": "https://www.rainloop.net/", "url": "https://www.rainloop.net/",
"upstream": { "upstream": {
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
@ -20,12 +20,12 @@
"name": "scith, Djip007, polytan02" "name": "scith, Djip007, polytan02"
}, },
"requirements": { "requirements": {
"yunohost": ">= 4.3.0" "yunohost": ">= 11.0.9"
}, },
"multi_instance": true, "multi_instance": true,
"services": [ "services": [
"nginx", "nginx",
"php7.3-fpm", "php7.4-fpm",
"mysql" "mysql"
], ],
"arguments": { "arguments": {

View file

@ -4,7 +4,7 @@
# PERSONAL HELPERS # PERSONAL HELPERS
#================================================= #=================================================
YNH_PHP_VERSION="7.3" YNH_PHP_VERSION="7.4"
pkg_dependencies="php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-dom" pkg_dependencies="php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-dom"

View file

@ -87,22 +87,6 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path/app" ynh_setup_source --dest_dir="$final_path/app"
ynh_script_progression --message="Patching CVE-2022-29360 code vulnerability..." --weight=1
# Deploy CVE-2022-29360 patch
version=$(ynh_app_upstream_version)
# FIXME because we need to apply the patch manually with --binary flag
# while we should be able to simply use the patching feature of ynh_setup_source
ynh_add_config --template="../sources/patches/app-CVE-2022-29360.patch.template" --destination="../sources/patches/FIXMEapp-CVE-2022-29360.patch"
patch --silent --binary $final_path/app/rainloop/v/$version/app/libraries/MailSo/Base/HtmlUtils.php < ../sources/patches/FIXMEapp-CVE-2022-29360.patch
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring NGINX web server..." --weight=2
# Create a dedicated NGINX config
ynh_add_nginx_config
#================================================= #=================================================
# PHP-FPM CONFIGURATION # PHP-FPM CONFIGURATION
#================================================= #=================================================
@ -112,6 +96,14 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=2
ynh_add_fpm_config ynh_add_fpm_config
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring NGINX web server..." --weight=2
# Create a dedicated NGINX config
ynh_add_nginx_config
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
#================================================= #=================================================

View file

@ -13,6 +13,10 @@ source /usr/share/yunohost/helpers
# MANAGE SCRIPT FAILURE # MANAGE SCRIPT FAILURE
#================================================= #=================================================
ynh_clean_setup () {
#### Remove this function if there's nothing to clean before calling the remove script.
true
}
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
ynh_abort_if_errors ynh_abort_if_errors
@ -39,12 +43,6 @@ test ! -d $final_path || ynh_die --message="There is already a directory: $final
#================================================= #=================================================
# STANDARD RESTORATION STEPS # STANDARD RESTORATION STEPS
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# RECREATE THE DEDICATED USER # RECREATE THE DEDICATED USER
#================================================= #=================================================
@ -73,6 +71,14 @@ 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 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 ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
#=================================================
# REINSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Reinstalling dependencies..." --weight=1
# Define and install dependencies
ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# RESTORE THE PHP-FPM CONFIGURATION # RESTORE THE PHP-FPM CONFIGURATION
#================================================= #=================================================
@ -81,12 +87,11 @@ ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weig
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
#================================================= #=================================================
# REINSTALL DEPENDENCIES # RESTORE THE NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Reinstalling dependencies..." --weight=1 ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1
# Define and install dependencies ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# RESTORE FAIL2BAN CONFIGURATION # RESTORE FAIL2BAN CONFIGURATION

View file

@ -112,23 +112,6 @@ then
ynh_setup_source --dest_dir="$final_path/app" ynh_setup_source --dest_dir="$final_path/app"
fi fi
ynh_script_progression --message="Patching CVE-2022-29360 code vulnerability..." --weight=1
ynh_print_warn --message="You should stop using Rainloop, its upstream code is not maintained anymore"
# Deploy CVE-2022-29360 patch
version=$(ynh_app_upstream_version)
# FIXME because we need to apply the patch manually with --binary flag
# while we should be able to simply use the patching feature of ynh_setup_source
ynh_add_config --template="../sources/patches/app-CVE-2022-29360.patch.template" --destination="../sources/patches/FIXMEapp-CVE-2022-29360.patch"
patched="$(patch --silent --binary --forward $final_path/app/rainloop/v/$version/app/libraries/MailSo/Base/HtmlUtils.php <../sources/patches/FIXMEapp-CVE-2022-29360.patch)" || echo "${patched}" | grep "Reversed (or previously applied) patch detected! Skipping patch." -q || (echo "$patched" && false);
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2
# Create a dedicated NGINX config
ynh_add_nginx_config
#================================================= #=================================================
# UPGRADE DEPENDENCIES # UPGRADE DEPENDENCIES
#================================================= #=================================================
@ -144,6 +127,14 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2
# Create a dedicated PHP-FPM config # Create a dedicated PHP-FPM config
ynh_add_fpm_config ynh_add_fpm_config
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2
# Create a dedicated NGINX config
ynh_add_nginx_config
#================================================= #=================================================
# SPECIFIC UPGRADE # SPECIFIC UPGRADE
#================================================= #=================================================
@ -151,8 +142,8 @@ ynh_add_fpm_config
#================================================= #=================================================
ynh_script_progression --message="Upgrading Rainloop configuration..." --weight=2 ynh_script_progression --message="Upgrading Rainloop configuration..." --weight=2
# Upgrade time_offset value for fail2ban # Upgrade time_offset value for Fail2Ban
# FIXME Temporary fix for rainloop, waiting for https://github.com/YunoHost/yunohost/pull/752 to be released. # FIXME Temporary fix for Rainloop, waiting for https://github.com/YunoHost/yunohost/pull/752 to be released.
# ynh_replace_string --match_string="^time_offset = .*" --replace_string="time_offset = $(date +%:::z)" --target_file="$final_path/app/data/_data_/_default_/configs/application.ini" # ynh_replace_string --match_string="^time_offset = .*" --replace_string="time_offset = $(date +%:::z)" --target_file="$final_path/app/data/_data_/_default_/configs/application.ini"
timezone="$(date +%:::z)" timezone="$(date +%:::z)"
ynh_replace_string --match_string="^time_offset = .*" --replace_string="time_offset = ${timezone//-/\\-}" --target_file="$final_path/app/data/_data_/_default_/configs/application.ini" ynh_replace_string --match_string="^time_offset = .*" --replace_string="time_offset = ${timezone//-/\\-}" --target_file="$final_path/app/data/_data_/_default_/configs/application.ini"

View file

@ -1,23 +0,0 @@
diff --git a/rainloop/v/__VERSION__/app/libraries/MailSo/Base/HtmlUtils.php b/rainloop/v/__VERSION__/app/libraries/MailSo/Base/HtmlUtils.new
index 2177627..f1e014e 100644
--- a/rainloop/v/__VERSION__/app/libraries/MailSo/Base/HtmlUtils.php
+++ b/rainloop/v/__VERSION__/app/libraries/MailSo/Base/HtmlUtils.new
@@ -239,7 +239,8 @@ class HtmlUtils
$oWrapHtml->setAttribute($sKey, $sValue);
}
- $oWrapDom = $oDom->createElement('div', '___xxx___');
+ $rand_str = base64_encode(random_bytes(32));
+ $oWrapDom = $oDom->createElement('div', $rand_str);
$oWrapDom->setAttribute('data-x-div-type', 'body');
foreach ($aBodylAttrs as $sKey => $sValue)
{
@@ -250,7 +251,7 @@ class HtmlUtils
$sWrp = $oDom->saveHTML($oWrapHtml);
- $sResult = \str_replace('___xxx___', $sResult, $sWrp);
+ $sResult = \str_replace($rand_str, $sResult, $sWrp);
}
$sResult = \str_replace(\MailSo\Base\HtmlUtils::$KOS, ':', $sResult);