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 #80 from YunoHost-Apps/testing

Testing
This commit is contained in:
Éric Gaspar 2021-05-07 21:59:27 +02:00 committed by GitHub
commit ff32859442
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 72 additions and 101 deletions

View file

@ -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

View file

@ -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

View file

@ -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&

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_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

View file

@ -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.

View file

@ -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",

View file

@ -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!"*

View file

@ -8,6 +8,7 @@
source _common.sh
source /usr/share/yunohost/helpers
ynh_abort_if_errors
#=================================================
# RETRIEVE ARGUMENTS

View file

@ -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/"
@ -186,7 +173,8 @@ ynh_use_logrotate --logfile=$final_path/app/data/_data_/_default_/logs/fail2ban/
# Set permissions to app files
find $final_path/. -type d -exec chmod 755 {} \;
find $final_path/. -type f -exec chmod 644 {} \;
chown -R $app: $final_path
chmod -R o-rwx $final_path
chown -R $app:www-data $final_path
#=================================================
# SETUP FAIL2BAN
@ -199,14 +187,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
#=================================================

View file

@ -41,7 +41,7 @@ ynh_remove_app_dependencies
#=================================================
# REMOVE APP MAIN DIR
#=================================================
ynh_script_progression --message="Removing the app main directory..."
ynh_script_progression --message="Removing the app main directory..." --weight=1
# Remove the app directory securely
ynh_secure_remove --file="$final_path"
@ -49,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 NGING config
ynh_remove_nginx_config
@ -65,7 +65,7 @@ ynh_remove_fpm_config
#=================================================
# REMOVE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Removing logrotate configuration..."
ynh_script_progression --message="Removing logrotate configuration..." --weight=1
# Remove the app-specific logrotate config
ynh_remove_logrotate
@ -83,7 +83,7 @@ ynh_remove_fail2ban_config
#=================================================
# REMOVE GPG KEY
#=================================================
ynh_script_progression --message="Removing GPG key"
ynh_script_progression --message="Removing GPG key" --weight=1
gpg --batch --delete-key --yes Rainloop

View file

@ -76,7 +76,8 @@ ynh_system_user_create --username=$app
#=================================================
# Restore permissions on app files
chown -R $app: $final_path
chmod -R o-rwx $final_path
chown -R $app:www-data $final_path
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION

View file

@ -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)
#=================================================
@ -32,16 +31,7 @@ upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# ENSURE 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
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
# If db_name doesn't exist, create it
if [ -z "$db_name" ]; then
@ -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
#=================================================
@ -131,7 +136,7 @@ ynh_add_fpm_config
#=================================================
# UPDATE SSO AND PGP
#=================================================
ynh_script_progression --message="Upgrading Rainloop configuration..."
ynh_script_progression --message="Upgrading Rainloop configuration..." --weight=2
# Upgrade time_offset value for fail2ban
# FIXME Temporary fix for rainloop, waiting for https://github.com/YunoHost/yunohost/pull/752 to be released.
@ -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/"
@ -166,7 +168,8 @@ ynh_use_logrotate --logfile=$final_path/app/data/_data_/_default_/logs/fail2ban/
#=================================================
# Set permissions on app files
chown -R $app: $final_path
chmod -R o-rwx $final_path
chown -R $app:www-data $final_path
find $final_path/. -type d -exec chmod 755 {} \;
find $final_path/. -type f -exec chmod 644 {} \;

View file

@ -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');
}