diff --git a/README.md b/README.md index bf22173..0f05ecb 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ *[Lire ce readme en français.](./README_fr.md)* > *This package allow you to install Rainloop quickly and simply on a YunoHost server. -If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* +If you don't have YunoHost, please see [here](https://yunohost.org/install) to know how to install and enjoy it.* ## Overview @@ -40,7 +40,7 @@ Each user can add a remote carddav server from their own parameters interface. ## Documentation * Official documentation: https://www.rainloop.net/docs/configuration/ - * YunoHost documentation: https://yunohost.org/#/app_rainloop + * YunoHost documentation: https://yunohost.org/en/app_rainloop ## YunoHost specific features @@ -48,8 +48,8 @@ Each user can add a remote carddav server from their own parameters interface. #### Supported architectures -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/rainloop%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/rainloop/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/rainloop%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/rainloop/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/rainloop.svg)](https://ci-apps.yunohost.org/ci/apps/rainloop/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/rainloop.svg)](https://ci-apps-arm.yunohost.org/ci/apps/rainloop/) ## Limitations diff --git a/README_fr.md b/README_fr.md index 38fa854..c376c69 100644 --- a/README_fr.md +++ b/README_fr.md @@ -6,13 +6,13 @@ *[Read this readme in english.](./README.md)* > *Ce package vous permet d'installer Rainloop rapidement et simplement sur un serveur YunoHost. -Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* +Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/install) pour savoir comment l'installer et en profiter.* ## Vue d'ensemble Rainloop est un webmail léger. -**Version incluse:** 1.15.0 +**Version incluse:** 1.16.0 ## Captures d'écran @@ -39,7 +39,7 @@ Chaque utilisateur peut ajouter un carnet d'adresse distant CardDav via leurs pr ## Documentation * Documentation officielle : https://www.rainloop.net/docs/configuration/ - * Documentation YunoHost : https://yunohost.org/#/app_rainloop_fr + * Documentation YunoHost : https://yunohost.org/fr/app_rainloop ## Caractéristiques spécifiques YunoHost @@ -47,8 +47,8 @@ Chaque utilisateur peut ajouter un carnet d'adresse distant CardDav via leurs pr #### Supported architectures -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/rainloop%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/rainloop/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/rainloop%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/rainloop/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/rainloop.svg)](https://ci-apps.yunohost.org/ci/apps/rainloop/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/rainloop.svg)](https://ci-apps-arm.yunohost.org/ci/apps/rainloop/) ## Limitations diff --git a/check_process b/check_process index 7b125fb..ab6d52d 100644 --- a/check_process +++ b/check_process @@ -2,11 +2,10 @@ ; Manifest domain="domain.tld" (DOMAIN) path="/rainloop" (PATH) - lang="en" + language="en" is_public=1 (PUBLIC|public=1|private=0) password="pass" ldap=1 - ; Checks pkg_linter=1 setup_sub_dir=1 @@ -15,15 +14,14 @@ setup_private=1 setup_public=1 upgrade=1 - upgrade=1 from_commit=e26b7e5823858ea5f526659f320692a2768786b5 + upgrade=1 from_commit=7a48f5b9b35ff22529190f282bfcf5f56944741a backup_restore=1 multi_instance=1 - port_already_use=0 change_url=1 ;;; Options Email= Notification=none ;;; Upgrade options - ; commit=e26b7e5823858ea5f526659f320692a2768786b5 - name=Define ereg() if it does not exists - manifest_arg=domain=DOMAIN&path=PATH&is_public=Yes&password=password&ldap=Yes&lang=en& + ; commit=7a48f5b9b35ff22529190f282bfcf5f56944741a + name=Upgrade to v.1.14.0 + manifest_arg=domain=DOMAIN&path=PATH&is_public=Yes&password=password&ldap=Yes&language=en& diff --git a/conf/app.src b/conf/app.src index 5b10bba..c7bb800 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/RainLoop/rainloop-webmail/releases/download/v1.15.0/rainloop-community-1.15.0.zip -SOURCE_SUM=cbfa285d015e923a32440a64be0085347e96ad40fe40758864bb2fcc26cdad5e +SOURCE_URL=https://github.com/RainLoop/rainloop-webmail/releases/download/v1.16.0/rainloop-community-1.16.0.zip +SOURCE_SUM=db949c4363b048a02eaa0f06a26a8386979b8734198c2939ee1e8cc54362ca67 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=false diff --git a/conf/data/configs/application.ini b/conf/data/configs/application.ini index 1849204..e8873eb 100644 --- a/conf/data/configs/application.ini +++ b/conf/data/configs/application.ini @@ -17,10 +17,10 @@ allow_themes = On allow_user_background = Off ; Language used by default -language = "__LANGTOCHANGE__" +language = "__LANGUAGE__" ; Admin Panel interface language -language_admin = "__LANGTOCHANGE__" +language_admin = "__LANGUAGE__" ; Allow language selection on settings screen allow_languages_on_settings = On @@ -60,9 +60,9 @@ allow_sharing = On allow_sync = On sync_interval = 20 type = "mysql" -pdo_dsn = "mysql:host=127.0.0.1;port=3306;dbname=__MYSQLUSER__" -pdo_user = "__MYSQLUSER__" -pdo_password = "__MYSQLPASSWORD__" +pdo_dsn = "mysql:host=127.0.0.1;port=3306;dbname=__DB_NAME__" +pdo_user = "__DB_NAME__" +pdo_password = "__DB_PWD__" suggestions_limit = 30 [security] @@ -142,7 +142,7 @@ sign_me_auto = "DefaultOff" enable = On ; List of enabled plugins -enabled_list = "__PLUGINSTOENABLE__" +enabled_list = "__PLUGINS_" [defaults] ; Editor mode used by default (Plain, Html, HtmlForced or PlainForced) @@ -173,7 +173,7 @@ write_on_timeout_only = 0 ; Required for development purposes only. ; Disabling this option is not recommended. hide_passwords = On -time_offset = __TIME_ZONE__ +time_offset = __TIMEZONE__ session_filter = "" ; Log filename. diff --git a/manifest.json b/manifest.json index 53719aa..55b8b1e 100644 --- a/manifest.json +++ b/manifest.json @@ -6,19 +6,19 @@ "en": "Lightweight multi-account webmail", "fr": "Webmail léger multi-comptes" }, - "version": "1.15.0~ynh1", + "version": "1.16.0~ynh1", "url": "https://www.rainloop.net/", "license": "AGPL-3.0-or-later", "maintainer": { "name": "scith, Djip007, polytan02" }, "requirements": { - "yunohost": ">= 3.8.1" + "yunohost": ">= 4.1.7" }, "multi_instance": true, "services": [ "nginx", - "php7.0-fpm", + "php7.3-fpm", "mysql" ], "arguments": { @@ -26,38 +26,22 @@ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain name for Rainloop", - "fr": "Choisissez un nom de domaine pour Rainloop" - }, "example": "example.com" }, { "name": "path", "type": "path", - "ask": { - "en": "Choose a path for Rainloop", - "fr": "Choisissez un chemin pour Rainloop" - }, "example": "/rainloop", "default": "/rainloop" }, { "name": "is_public", "type": "boolean", - "ask": { - "en": "Is it a public application?", - "fr": "Est-ce une application publique ?" - }, "default": false }, { "name": "password", "type": "password", - "ask": { - "en": "Set the administrator password", - "fr": "Définissez le mot de passe administrateur" - }, "example": "Choose a password" }, { @@ -70,7 +54,7 @@ "default": true }, { - "name": "lang", + "name": "language", "type": "string", "ask": { "en": "Select default language", diff --git a/pull_request_template.md b/pull_request_template.md index 82767fc..6c28fc5 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -13,6 +13,4 @@ ## Package_check results --- -*If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results* - -[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/rainloop_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/rainloop_ynh%20PR-NUM-%20(USERNAME)/) +* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"* diff --git a/scripts/install b/scripts/install index 3d8f0bd..492187c 100644 --- a/scripts/install +++ b/scripts/install @@ -23,7 +23,7 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC -lang=$YNH_APP_ARG_LANG +language=$YNH_APP_ARG_LANGUAGE password=$YNH_APP_ARG_PASSWORD ldap=$YNH_APP_ARG_LDAP @@ -47,8 +47,7 @@ ynh_script_progression --message="Storing installation settings..." ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url -ynh_app_setting_set --app=$app --key=is_public --value=$is_public -ynh_app_setting_set --app=$app --key=lang --value=$lang +ynh_app_setting_set --app=$app --key=language --value=$language ynh_app_setting_set --app=$app --key=password --value=$password ynh_app_setting_set --app=$app --key=ldap --value=$ldap @@ -121,20 +120,11 @@ then fi ynh_app_setting_set --app=$app --key=plugins --value="$plugins" - mkdir -p "$final_path/app/data/_data_/_default_/configs/" application_file="$final_path/app/data/_data_/_default_/configs/application.ini" -cp ../conf/data/configs/application.ini "$application_file" -ynh_replace_string --match_string="__DOMAIN__" --replace_string=$domain --target_file="$application_file" -ynh_replace_string --match_string="__MYSQLUSER__" --replace_string=$db_name --target_file="$application_file" -ynh_replace_string --match_string="__MYSQLPASSWORD__" --replace_string="$db_pwd" --target_file="$application_file" -ynh_replace_string --match_string="__LANGTOCHANGE__" --replace_string=$lang --target_file="$application_file" -ynh_replace_string --match_string="__PLUGINSTOENABLE__" --replace_string="$plugins" --target_file="$application_file" -# FIXME Temporary fix for rainloop, waiting for https://github.com/YunoHost/yunohost/pull/752 to be released. -# ynh_replace_string --match_string="__TIME_ZONE__" --replace_string="$(date +%:::z)" --target_file="$application_file" timezone="$(date +%:::z)" -ynh_replace_string --match_string="__TIME_ZONE__" --replace_string="${timezone//-/\\-}" --target_file="$application_file" +ynh_add_config --template="../conf/data/configs/application.ini" --destination="$application_file" # Set admin password php"${phpversion}" ../conf/config.php --index="$final_path/app/index.php" --password="$password" @@ -151,10 +141,7 @@ cp ../conf/data/domains/default.ini "$final_path/app/data/_data_/_default_/domai # install SSO - at the moment the index is the SSO and rainloop is installed in /app -cp ../sources/sso/sso.php "$final_path/index.php" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/index.php" -ynh_replace_string --match_string="__ALIASTOCHANGE__" --replace_string="$final_path" --target_file="$final_path/index.php" -ynh_replace_string --match_string="__ROOTTOCHANGE__" --replace_string="${path_url%/}" --target_file="$final_path/index.php" +ynh_add_config --template="../sources/sso/sso.php" --destination="$final_path/index.php" # Install PGPback by chtixof to allow users to backup/restore their PGP private keys on the server cp -rf ../sources/pgpback "$final_path/" @@ -199,14 +186,12 @@ ynh_add_fail2ban_config --logpath="$final_path/app/data/_data_/_default_/logs/fa #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring SSOwat..." +ynh_script_progression --message="Configuring permissions..." # Make app public if necessary or protect it 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" + ynh_permission_update --permission="main" --add="visitors" fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 4f93f74..26e3e1e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,9 +18,8 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) -is_public=$(ynh_app_setting_get --app=$app --key=is_public) final_path=$(ynh_app_setting_get --app=$app --key=final_path) -lang=$(ynh_app_setting_get --app=$app --key=lang) +language=$(ynh_app_setting_get --app=$app --key=language) db_name=$(ynh_app_setting_get --app=$app --key=db_name) #================================================= @@ -34,15 +33,6 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Ensuring downward compatibility..." -# Fix is_public as a boolean value -if [ "$is_public" = "Yes" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=1 - is_public=1 -elif [ "$is_public" = "No" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=0 - is_public=0 -fi - # If db_name doesn't exist, create it if [ -z "$db_name" ]; then db_name=$(ynh_sanitize_dbid --db_name=$app) @@ -55,18 +45,33 @@ if [ -z "$final_path" ]; then ynh_app_setting_set --app=$app --key=final_path --value=$final_path fi -case "$lang" in +# If language doesn't exist, create it +if [ -z "$language" ]; then + language="en" + ynh_app_setting_set --app=$app --key=language --value=$language + ynh_app_setting_delete --app=$app --key=$lang +fi + +case "$language" in Francais) - lang="fr" - ynh_app_setting_set --app=$app --key=lang --value=$lang + language="fr" + ynh_app_setting_set --app=$app --key=language --value=$language ;; English) - lang="en" - ynh_app_setting_set --app=$app --key=lang --value=$lang + language="en" + ynh_app_setting_set --app=$app --key=language --value=$language ;; *) ;; esac + +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -140,10 +145,7 @@ 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" # update SSO -cp ../sources/sso/sso.php "$final_path/index.php" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/index.php" -ynh_replace_string --match_string="__ALIASTOCHANGE__" --replace_string="$final_path" --target_file="$final_path/index.php" -ynh_replace_string --match_string="__ROOTTOCHANGE__" --replace_string="${path_url%/}" --target_file="$final_path/index.php" +ynh_add_config --template="../sources/sso/sso.php" --destination="$final_path/index.php" # Install PGPback by chtixof to allow users to backup/restore their PGP private keys on the server cp -rf ../sources/pgpback "$final_path/" diff --git a/sources/sso/sso.php b/sources/sso/sso.php index b8a374a..28383bb 100644 --- a/sources/sso/sso.php +++ b/sources/sso/sso.php @@ -2,7 +2,7 @@ // Enable RainLoop Api and include index file $_ENV['RAINLOOP_INCLUDE_AS_API'] = true; -include '__ALIASTOCHANGE__/app/index.php'; +include '__FINALPATH__/app/index.php'; // Retrieve email and password if (isset($_SERVER['HTTP_EMAIL']) && isset($_SERVER['PHP_AUTH_PW'])) { @@ -11,8 +11,8 @@ if (isset($_SERVER['HTTP_EMAIL']) && isset($_SERVER['PHP_AUTH_PW'])) { $ssoHash = \RainLoop\Api::GetUserSsoHash($email, $password); // redirect to webmail sso url - \header('Location: https://__DOMAIN____ROOTTOCHANGE__/app/index.php?sso&hash='.$ssoHash); + \header('Location: https://__DOMAIN____PATH__/app/index.php?sso&hash='.$ssoHash); } else { - \header('Location: https://__DOMAIN____ROOTTOCHANGE__/app/index.php'); + \header('Location: https://__DOMAIN____PATH__/app/index.php'); }