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 #76 from YunoHost-Apps/patch

Upgrade to 1.16.0
This commit is contained in:
Éric Gaspar 2021-05-07 13:40:00 +02:00 committed by GitHub
commit 6c7e833231
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 59 additions and 92 deletions

View file

@ -6,7 +6,7 @@
*[Lire ce readme en français.](./README_fr.md)* *[Lire ce readme en français.](./README_fr.md)*
> *This package allow you to install Rainloop quickly and simply on a YunoHost server. > *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 ## Overview
@ -40,7 +40,7 @@ Each user can add a remote carddav server from their own parameters interface.
## Documentation ## Documentation
* Official documentation: https://www.rainloop.net/docs/configuration/ * 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 ## YunoHost specific features
@ -48,8 +48,8 @@ Each user can add a remote carddav server from their own parameters interface.
#### Supported architectures #### 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/) * 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%20%28Apps%29.svg)](https://ci-apps-arm.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 ## Limitations

View file

@ -6,13 +6,13 @@
*[Read this readme in english.](./README.md)* *[Read this readme in english.](./README.md)*
> *Ce package vous permet d'installer Rainloop rapidement et simplement sur un serveur YunoHost. > *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 ## Vue d'ensemble
Rainloop est un webmail léger. Rainloop est un webmail léger.
**Version incluse:** 1.15.0 **Version incluse:** 1.16.0
## Captures d'écran ## Captures d'écran
@ -39,7 +39,7 @@ Chaque utilisateur peut ajouter un carnet d'adresse distant CardDav via leurs pr
## Documentation ## Documentation
* Documentation officielle : https://www.rainloop.net/docs/configuration/ * 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 ## Caractéristiques spécifiques YunoHost
@ -47,8 +47,8 @@ Chaque utilisateur peut ajouter un carnet d'adresse distant CardDav via leurs pr
#### Supported architectures #### 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/) * 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%20%28Apps%29.svg)](https://ci-apps-arm.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 ## Limitations

View file

@ -2,11 +2,10 @@
; Manifest ; Manifest
domain="domain.tld" (DOMAIN) domain="domain.tld" (DOMAIN)
path="/rainloop" (PATH) path="/rainloop" (PATH)
lang="en" language="en"
is_public=1 (PUBLIC|public=1|private=0) is_public=1 (PUBLIC|public=1|private=0)
password="pass" password="pass"
ldap=1 ldap=1
; Checks ; Checks
pkg_linter=1 pkg_linter=1
setup_sub_dir=1 setup_sub_dir=1
@ -15,15 +14,14 @@
setup_private=1 setup_private=1
setup_public=1 setup_public=1
upgrade=1 upgrade=1
upgrade=1 from_commit=e26b7e5823858ea5f526659f320692a2768786b5 upgrade=1 from_commit=7a48f5b9b35ff22529190f282bfcf5f56944741a
backup_restore=1 backup_restore=1
multi_instance=1 multi_instance=1
port_already_use=0
change_url=1 change_url=1
;;; Options ;;; Options
Email= Email=
Notification=none Notification=none
;;; Upgrade options ;;; Upgrade options
; commit=e26b7e5823858ea5f526659f320692a2768786b5 ; commit=7a48f5b9b35ff22529190f282bfcf5f56944741a
name=Define ereg() if it does not exists name=Upgrade to v.1.14.0
manifest_arg=domain=DOMAIN&path=PATH&is_public=Yes&password=password&ldap=Yes&lang=en& manifest_arg=domain=DOMAIN&path=PATH&is_public=Yes&password=password&ldap=Yes&language=en&

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/RainLoop/rainloop-webmail/releases/download/v1.15.0/rainloop-community-1.15.0.zip SOURCE_URL=https://github.com/RainLoop/rainloop-webmail/releases/download/v1.16.0/rainloop-community-1.16.0.zip
SOURCE_SUM=cbfa285d015e923a32440a64be0085347e96ad40fe40758864bb2fcc26cdad5e SOURCE_SUM=db949c4363b048a02eaa0f06a26a8386979b8734198c2939ee1e8cc54362ca67
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=zip SOURCE_FORMAT=zip
SOURCE_IN_SUBDIR=false SOURCE_IN_SUBDIR=false

View file

@ -17,10 +17,10 @@ allow_themes = On
allow_user_background = Off allow_user_background = Off
; Language used by default ; Language used by default
language = "__LANGTOCHANGE__" language = "__LANGUAGE__"
; Admin Panel interface language ; Admin Panel interface language
language_admin = "__LANGTOCHANGE__" language_admin = "__LANGUAGE__"
; Allow language selection on settings screen ; Allow language selection on settings screen
allow_languages_on_settings = On allow_languages_on_settings = On
@ -60,9 +60,9 @@ allow_sharing = On
allow_sync = On allow_sync = On
sync_interval = 20 sync_interval = 20
type = "mysql" type = "mysql"
pdo_dsn = "mysql:host=127.0.0.1;port=3306;dbname=__MYSQLUSER__" pdo_dsn = "mysql:host=127.0.0.1;port=3306;dbname=__DB_NAME__"
pdo_user = "__MYSQLUSER__" pdo_user = "__DB_NAME__"
pdo_password = "__MYSQLPASSWORD__" pdo_password = "__DB_PWD__"
suggestions_limit = 30 suggestions_limit = 30
[security] [security]
@ -142,7 +142,7 @@ sign_me_auto = "DefaultOff"
enable = On enable = On
; List of enabled plugins ; List of enabled plugins
enabled_list = "__PLUGINSTOENABLE__" enabled_list = "__PLUGINS_"
[defaults] [defaults]
; Editor mode used by default (Plain, Html, HtmlForced or PlainForced) ; Editor mode used by default (Plain, Html, HtmlForced or PlainForced)
@ -173,7 +173,7 @@ write_on_timeout_only = 0
; Required for development purposes only. ; Required for development purposes only.
; Disabling this option is not recommended. ; Disabling this option is not recommended.
hide_passwords = On hide_passwords = On
time_offset = __TIME_ZONE__ time_offset = __TIMEZONE__
session_filter = "" session_filter = ""
; Log filename. ; Log filename.

View file

@ -6,19 +6,19 @@
"en": "Lightweight multi-account webmail", "en": "Lightweight multi-account webmail",
"fr": "Webmail léger multi-comptes" "fr": "Webmail léger multi-comptes"
}, },
"version": "1.15.0~ynh1", "version": "1.16.0~ynh1",
"url": "https://www.rainloop.net/", "url": "https://www.rainloop.net/",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"maintainer": { "maintainer": {
"name": "scith, Djip007, polytan02" "name": "scith, Djip007, polytan02"
}, },
"requirements": { "requirements": {
"yunohost": ">= 3.8.1" "yunohost": ">= 4.1.7"
}, },
"multi_instance": true, "multi_instance": true,
"services": [ "services": [
"nginx", "nginx",
"php7.0-fpm", "php7.3-fpm",
"mysql" "mysql"
], ],
"arguments": { "arguments": {
@ -26,38 +26,22 @@
{ {
"name": "domain", "name": "domain",
"type": "domain", "type": "domain",
"ask": {
"en": "Choose a domain name for Rainloop",
"fr": "Choisissez un nom de domaine pour Rainloop"
},
"example": "example.com" "example": "example.com"
}, },
{ {
"name": "path", "name": "path",
"type": "path", "type": "path",
"ask": {
"en": "Choose a path for Rainloop",
"fr": "Choisissez un chemin pour Rainloop"
},
"example": "/rainloop", "example": "/rainloop",
"default": "/rainloop" "default": "/rainloop"
}, },
{ {
"name": "is_public", "name": "is_public",
"type": "boolean", "type": "boolean",
"ask": {
"en": "Is it a public application?",
"fr": "Est-ce une application publique ?"
},
"default": false "default": false
}, },
{ {
"name": "password", "name": "password",
"type": "password", "type": "password",
"ask": {
"en": "Set the administrator password",
"fr": "Définissez le mot de passe administrateur"
},
"example": "Choose a password" "example": "Choose a password"
}, },
{ {
@ -70,7 +54,7 @@
"default": true "default": true
}, },
{ {
"name": "lang", "name": "language",
"type": "string", "type": "string",
"ask": { "ask": {
"en": "Select default language", "en": "Select default language",

View file

@ -13,6 +13,4 @@
## Package_check results ## 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* * 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!"*
[![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)/)

View file

@ -23,7 +23,7 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH path_url=$YNH_APP_ARG_PATH
is_public=$YNH_APP_ARG_IS_PUBLIC is_public=$YNH_APP_ARG_IS_PUBLIC
lang=$YNH_APP_ARG_LANG language=$YNH_APP_ARG_LANGUAGE
password=$YNH_APP_ARG_PASSWORD password=$YNH_APP_ARG_PASSWORD
ldap=$YNH_APP_ARG_LDAP 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=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url 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=language --value=$language
ynh_app_setting_set --app=$app --key=lang --value=$lang
ynh_app_setting_set --app=$app --key=password --value=$password ynh_app_setting_set --app=$app --key=password --value=$password
ynh_app_setting_set --app=$app --key=ldap --value=$ldap ynh_app_setting_set --app=$app --key=ldap --value=$ldap
@ -121,20 +120,11 @@ then
fi fi
ynh_app_setting_set --app=$app --key=plugins --value="$plugins" ynh_app_setting_set --app=$app --key=plugins --value="$plugins"
mkdir -p "$final_path/app/data/_data_/_default_/configs/" mkdir -p "$final_path/app/data/_data_/_default_/configs/"
application_file="$final_path/app/data/_data_/_default_/configs/application.ini" 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)" 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 # Set admin password
php"${phpversion}" ../conf/config.php --index="$final_path/app/index.php" --password="$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 # 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_add_config --template="../sources/sso/sso.php" --destination="$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"
# Install PGPback by chtixof to allow users to backup/restore their PGP private keys on the server # Install PGPback by chtixof to allow users to backup/restore their PGP private keys on the server
cp -rf ../sources/pgpback "$final_path/" 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 # SETUP SSOWAT
#================================================= #=================================================
ynh_script_progression --message="Configuring SSOwat..." ynh_script_progression --message="Configuring permissions..."
# Make app public if necessary or protect it # Make app public if necessary or protect it
if [ $is_public -eq 1 ] if [ $is_public -eq 1 ]
then then
# Everyone can access the app. ynh_permission_update --permission="main" --add="visitors"
# The "main" permission is automatically created before the install script.
ynh_permission_update --permission "main" --add "visitors"
fi fi
#================================================= #=================================================

View file

@ -18,9 +18,8 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path) 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) 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) 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..." 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 db_name doesn't exist, create it
if [ -z "$db_name" ]; then if [ -z "$db_name" ]; then
db_name=$(ynh_sanitize_dbid --db_name=$app) 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 ynh_app_setting_set --app=$app --key=final_path --value=$final_path
fi 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) Francais)
lang="fr" language="fr"
ynh_app_setting_set --app=$app --key=lang --value=$lang ynh_app_setting_set --app=$app --key=language --value=$language
;; ;;
English) English)
lang="en" language="en"
ynh_app_setting_set --app=$app --key=lang --value=$lang ynh_app_setting_set --app=$app --key=language --value=$language
;; ;;
*) *)
;; ;;
esac 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 # 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" 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 # update SSO
cp ../sources/sso/sso.php "$final_path/index.php" ynh_add_config --template="../sources/sso/sso.php" --destination="$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"
# Install PGPback by chtixof to allow users to backup/restore their PGP private keys on the server # Install PGPback by chtixof to allow users to backup/restore their PGP private keys on the server
cp -rf ../sources/pgpback "$final_path/" cp -rf ../sources/pgpback "$final_path/"

View file

@ -2,7 +2,7 @@
// Enable RainLoop Api and include index file // Enable RainLoop Api and include index file
$_ENV['RAINLOOP_INCLUDE_AS_API'] = true; $_ENV['RAINLOOP_INCLUDE_AS_API'] = true;
include '__ALIASTOCHANGE__/app/index.php'; include '__FINALPATH__/app/index.php';
// Retrieve email and password // Retrieve email and password
if (isset($_SERVER['HTTP_EMAIL']) && isset($_SERVER['PHP_AUTH_PW'])) { 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); $ssoHash = \RainLoop\Api::GetUserSsoHash($email, $password);
// redirect to webmail sso url // 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 { else {
\header('Location: https://__DOMAIN____ROOTTOCHANGE__/app/index.php'); \header('Location: https://__DOMAIN____PATH__/app/index.php');
} }