diff --git a/README.md b/README.md index 23d2202..c6d5364 100644 --- a/README.md +++ b/README.md @@ -1,64 +1,68 @@ -# Rainloop for YunoHost +# Rainloop for YunoHost [![Integration level](https://dash.yunohost.org/integration/rainloop.svg)](https://dash.yunohost.org/appci/app/rainloop) -[![Install rainloop with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=rainloop) +[![Install Rainloop with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=rainloop) *[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.* ## Overview -Rainloop is a lightweight webmail. + +Rainloop is a lightweight webmail. **Shipped version:** 1.12.1 ## Screenshots -![](http://www.rainloop.net/static/media/screenshots/v2/12.png) +![](https://www.rainloop.net/static/media/screenshots/v2/12.png) ## Demo +* [YunoHost demo](https://demo.yunohost.org/rainloop/app/) * [Official demo](https://mail.rainloop.net/) ## Configuration - -To configure it, go to http://DOMAIN.TLD/rainloop/app/?admin - -- The default login is : admin -- The default password is : Password chosen during install + +Go to http://DOMAIN.TLD/rainloop/app/?admin + +- The default login is : admin +- The default password is : Password chosen during install + - If you lost the admin password, you can retrieve it using ``sudo yunohost app settings rainloop password`` - -Each user can add a remote carddav server from their own parameters interface. + +Each user can add a remote carddav server from their own parameters interface. - If you use baikal, the CardDav address is: https://DOMAIN.TLD/baikal/card.php/addressbooks/USER/default/ - If you use NextCloud, the CardDav address is: https://DOMAIN.TLD/nextcloud/remote.php/carddav/addressbooks/USER/contacts - -Rainloop saves your PGP private keys in the browser storage. This means that you will loose your private keys if you clear your browser storage (e.g., private browsing, different computer...). This packages integrates [PGPback by chtixof](https://github.com/chtixof/pgpback_ynh) so you can store your PGP private keys on the server securely. Go to **http://DOMAIN.TLD/rainloop/pgpback** to backup your PGP keys on the server or restore them. ## Documentation - * Official documentation: https://www.rainloop.net/docs/ + * Official documentation: https://www.rainloop.net/docs/configuration/ + * YunoHost documentation: https://yunohost.org/#/app_rainloop ## YunoHost specific features #### Multi-users support -Are LDAP and HTTP auth supported? -Can the app be used by multiple users? - #### Supported architectures * x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/rainloop%20%28Official%29.svg)](https://ci-apps.yunohost.org/ci/apps/rainloop/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/rainloop%20%28Official%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/rainloop/) * Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/rainloop%20%28Official%29.svg)](https://ci-stretch.nohost.me/ci/apps/rainloop/) +## Limitations + +## Additional information + +* Rainloop saves your PGP private keys in the browser storage. This means that you will loose your private keys if you clear your browser storage (e.g., private browsing, different computer...). This packages integrates [PGPback by chtixof](https://github.com/chtixof/pgpback_ynh) so you can store your PGP private keys on the server securely. Go to **http://DOMAIN.TLD/rainloop/pgpback** to backup your PGP keys on the server or restore them. ## Links * Report a bug: https://github.com/YunoHost-Apps/rainloop_ynh/issues - * App website: http://rainloop.net/ - * App github website: https://github.com/RainLoop/rainloop-webmail + * Rainloop website: https://www.rainloop.net/ + * Rainloop github website: https://github.com/RainLoop/rainloop-webmail * YunoHost website: https://yunohost.org/ --- diff --git a/README_fr.md b/README_fr.md index 375fd24..2f7543f 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,63 +1,67 @@ -# App exemple pour YunoHost +# Rainloop pour YunoHost [![Integration level](https://dash.yunohost.org/integration/rainloop.svg)](https://dash.yunohost.org/appci/app/rainloop) -[![Install rainloop with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=rainloop) +[![Install Rainloop with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=rainloop) *[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.* ## Vue d'ensemble -Rainloop est un webmail simple et léger. + +Rainloop est un webmail léger. **Version incluse:** 1.12.1 ## Captures d'écran -![](http://www.rainloop.net/static/media/screenshots/v2/12.png) +![](https://www.rainloop.net/static/media/screenshots/v2/12.png) ## Démo +* [Démo YunoHost](https://demo.yunohost.org/rainloop/app/) * [Démo officielle](https://mail.rainloop.net/) ## Configuration -Pour le configurer après l'installation, veuillez vous rendre sur http://DOMAIN.TLD/rainloop/app/?admin - -- Le nom d'utilisateur admin par défaut est : admin -- Le mot de passe admin par défaut est : Mot de passe choisi lors de l'installation -- Si vous avez oublié votre mot de passe, vous pouvez le retrouver avec ``sudo yunohost app settings rainloop password`` - -Chaque utilisateur peut ajouter un carnet d'adresse distant CardDav via leurs propres paramètres. - -- Si vous utilisez Baikal, l'adresse à renseigner est du type : https://DOMAIN.TLD/baikal/card.php/addressbooks/UTILISATEUR/default/ -- Si vous utilisez NextCloud, l'adresse à renseigner est du type : https://DOMAIN.TLD/nextcloud/remote.php/carddav/addressbooks/USER/contacts +Veuillez vous rendre sur http://DOMAIN.TLD/rainloop/app/?admin -Rainloop stocke les clés PGP privées dans le stockage de navigateur. Cela implique que vos clés seront perdues quand vous videz le stockage de navigateur (navigation incognito, changement d'ordinateur, ...). Ce paquet intègre [PGPback de chtixof](https://github.com/chtixof/pgpback_ynh) pour que vous puissiez stocker vos clés privées PGP de manière sécurisée sur le serveur. Rendez-vous **http://DOMAIN.TLD/rainloop/pgpback** pour stocker vos clés privées PGP sur le serveur ou les restaurer dans un nouveau navigateur. +- Le nom d'utilisateur admin par défaut est : admin +- Le mot de passe admin par défaut est : Mot de passe choisi lors de l'installation +- Si vous avez oublié votre mot de passe, vous pouvez le retrouver avec ``sudo yunohost app settings rainloop password`` + +Chaque utilisateur peut ajouter un carnet d'adresse distant CardDav via leurs propres paramètres. + +- Si vous utilisez Baikal, l'adresse à renseigner est du type : https://DOMAIN.TLD/baikal/card.php/addressbooks/UTILISATEUR/default +- Si vous utilisez NextCloud, l'adresse à renseigner est du type : https://DOMAIN.TLD/nextcloud/remote.php/carddav/addressbooks/USER/contacts ## Documentation - * Documentation officielle: https://www.rainloop.net/docs/ + * Documentation officielle: https://www.rainloop.net/docs/configuration/ + * Documentation YunoHost: https://yunohost.org/#/app_rainloop_fr ## Caractéristiques spécifiques YunoHost #### Support multi-utilisateurs -L'authentification LDAP et HTTP est-elle prise en charge? -L'application peut-elle être utilisée par plusieurs utilisateurs? - #### Supported architectures * x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/rainloop%20%28Official%29.svg)](https://ci-apps.yunohost.org/ci/apps/rainloop/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/rainloop%20%28Official%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/rainloop/) * Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/rainloop%20%28Official%29.svg)](https://ci-stretch.nohost.me/ci/apps/rainloop/) +## Limitations + +## Informations additionnelles + +* Rainloop stocke les clés PGP privées dans le stockage de navigateur. Cela implique que vos clés seront perdues quand vous videz le stockage de navigateur (navigation incognito, changement d'ordinateur, ...). Ce paquet intègre [PGPback de chtixof](https://github.com/chtixof/pgpback_ynh) pour que vous puissiez stocker vos clés privées PGP de manière sécurisée sur le serveur. Rendez-vous **http://DOMAIN.TLD/rainloop/pgpback** pour stocker vos clés privées PGP sur le serveur ou les restaurer dans un nouveau navigateur. + ## Links * Signaler un bug: https://github.com/YunoHost-Apps/rainloop_ynh/issues - * Site de l'application: http://rainloop.net/ - * Site Github de l'application: https://github.com/RainLoop/rainloop-webmail + * Site de Rainloop: https://www.rainloop.net/ + * Github de Rainloop: https://github.com/RainLoop/rainloop-webmail * Site web YunoHost: https://yunohost.org/ --- diff --git a/check_process b/check_process index f8eeef1..3400f69 100644 --- a/check_process +++ b/check_process @@ -2,9 +2,9 @@ ; Manifest domain="domain.tld" (DOMAIN) path="/rainloop" (PATH) - lang="fr" + lang="English" is_public=1 (PUBLIC|public=1|private=0) - password="pass" + password="pass" ldap=1 ; Checks diff --git a/conf/data/configs/application.ini b/conf/data/configs/application.ini index 4b22ba1..71a4cc5 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 = "__LANGTOCHANGE__" ; Admin Panel interface language -language_admin = "LANGTOCHANGE" +language_admin = "__LANGTOCHANGE__" ; Allow language selection on settings screen allow_languages_on_settings = On @@ -58,9 +58,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=__MYSQLUSER__" +pdo_user = "__MYSQLUSER__" +pdo_password = "__MYSQLPASSWORD__" suggestions_limit = 30 [security] @@ -114,7 +114,7 @@ messagelist_actions = On attachments_actions = On [login] -default_domain = "domain.tld" +default_domain = "__DOMAIN__" ; Allow language selection on webmail login screen allow_languages_on_login = On @@ -138,7 +138,7 @@ sign_me_auto = "DefaultOff" enable = On ; List of enabled plugins -enabled_list = "PLUGINSTOENABLE" +enabled_list = "__PLUGINSTOENABLE__" [defaults] ; Editor mode used by default (Plain, Html, HtmlForced or PlainForced) diff --git a/conf/nginx.conf b/conf/nginx.conf index f5d5170..8f3144d 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,11 +1,11 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { - # Path to source - alias __FINALPATH__/ ; + # Path to source + alias __FINALPATH__/; - # Force usage of https - if ($scheme = http) { + # Force usage of https + if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } @@ -23,12 +23,11 @@ location __PATH__/ { location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock; - - fastcgi_index index.php; - include fastcgi_params; - fastcgi_param REMOTE_USER $remote_user; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param SCRIPT_FILENAME $request_filename; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param REMOTE_USER $remote_user; + fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param SCRIPT_FILENAME $request_filename; } # Include SSOWAT user panel. diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index 488cd35..7f15f79 100644 --- a/conf/php-fpm.conf +++ b/conf/php-fpm.conf @@ -46,7 +46,7 @@ listen = /var/run/php/php7.0-fpm-__NAMETOCHANGE__.sock ; mode is set to 0660 listen.owner = www-data listen.group = www-data -listen.mode = 0660 +;listen.mode = 0660 ; When POSIX Access Control Lists are supported you can set them using ; these options, value is a comma separated list of user/group names. ; When set, listen.owner and listen.group are ignored @@ -136,7 +136,7 @@ pm.max_spare_servers = 3 ; This can be useful to work around memory leaks in 3rd party libraries. For ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. ; Default Value: 0 -pm.max_requests = 500 +;pm.max_requests = 500 ; The URI to view the FPM status page. If this value is not set, no URI will be ; recognized as a status page. It shows the following informations: @@ -235,7 +235,7 @@ pm.max_requests = 500 ; anything, but it may not be a good idea to use the .php extension or it ; may conflict with a real PHP file. ; Default Value: not set -pm.status_path = /fpm-status +;pm.status_path = /status ; The ping URI to call the monitoring page of FPM. If this value is not set, no ; URI will be recognized as a ping page. This could be used to test from outside @@ -247,7 +247,7 @@ pm.status_path = /fpm-status ; anything, but it may not be a good idea to use the .php extension or it ; may conflict with a real PHP file. ; Default Value: not set -ping.path = /ping +;ping.path = /ping ; This directive may be used to customize the response of a ping request. The ; response is formatted as text/plain with a 200 response code. @@ -321,29 +321,28 @@ ping.path = /ping ; Default Value: not set ; Note: slowlog is mandatory if request_slowlog_timeout is set ;slowlog = log/$pool.log.slow -slowlog = /var/log/nginx/__NAME__.slow.log ; The timeout for serving a single request after which a PHP backtrace will be ; dumped to the 'slowlog' file. A value of '0s' means 'off'. ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) ; Default Value: 0 -request_slowlog_timeout = 5s +;request_slowlog_timeout = 0 ; The timeout for serving a single request after which the worker process will ; be killed. This option should be used when the 'max_execution_time' ini option ; does not stop script execution for some reason. A value of '0' means 'off'. ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) ; Default Value: 0 -request_terminate_timeout = 120s +request_terminate_timeout = 1d ; Set open file descriptor rlimit. ; Default Value: system defined value -rlimit_files = 4096 +;rlimit_files = 1024 ; Set max core size rlimit. ; Possible Values: 'unlimited' or an integer greater or equal to 0 ; Default Value: system defined value -rlimit_core = 0 +;rlimit_core = 0 ; Chroot to this directory at the start. This value must be defined as an ; absolute path. When this value is not set, chroot is not used. @@ -366,7 +365,24 @@ chdir = __FINALPATH__ ; Note: on highloaded environement, this can cause some delay in the page ; process time (several ms). ; Default Value: no -catch_workers_output = yes +;catch_workers_output = yes + +; Clear environment in FPM workers +; Prevents arbitrary environment variables from reaching FPM worker processes +; by clearing the environment in workers before env vars specified in this +; pool configuration are added. +; Setting to "no" will make all environment variables available to PHP code +; via getenv(), $_ENV and $_SERVER. +; Default Value: yes +;clear_env = no + +; Limits the extensions of the main script FPM will allow to parse. This can +; prevent configuration mistakes on the web server side. You should only limit +; FPM to .php extensions to prevent malicious users to use other extensions to +; execute php code. +; Note: set an empty value to allow all extensions. +; Default Value: .php +;security.limit_extensions = .php .php3 .php4 .php5 .php7 ; Clear environment in FPM workers ; Prevents arbitrary environment variables from reaching FPM worker processes @@ -420,12 +436,16 @@ catch_workers_output = yes ;php_admin_value[memory_limit] = 32M ; Common values to change to increase file upload limit -php_admin_value[upload_max_filesize] = 10G -php_admin_value[post_max_size] = 10G -php_admin_flag[mail.add_x_header] = Off +; php_admin_value[upload_max_filesize] = 50M +; php_admin_value[post_max_size] = 50M +; php_admin_flag[mail.add_x_header] = Off ; Other common parameters ; php_admin_value[max_execution_time] = 600 ; php_admin_value[max_input_time] = 300 ; php_admin_value[memory_limit] = 256M ; php_admin_flag[short_open_tag] = On + +php_value[upload_max_filesize] = 10G +php_value[post_max_size] = 10G +php_value[mail.add_x_header] = Off diff --git a/manifest.json b/manifest.json index fd53967..a884fb3 100644 --- a/manifest.json +++ b/manifest.json @@ -6,19 +6,19 @@ "en": "Lightweight multi-account webmail", "fr": "Webmail léger multi-comptes" }, - "version": "1.12.1~ynh1", + "version": "1.12.1~ynh2", "url": "https://www.rainloop.net/", "license": "AGPL-3.0-or-later", "maintainer": { "name": "scith, Djip007, polytan02" }, "requirements": { - "yunohost": ">= 3.4" + "yunohost": ">= 3.2.0" }, "multi_instance": true, "services": [ "nginx", - "php7.0-fpm", + "php7.0-fpm", "mysql" ], "arguments": { @@ -52,28 +52,18 @@ "default": false }, { - "name": "lang", - "type": "string", + "name": "password", + "type": "password", "ask": { - "en": "Choose the application language", - "fr": "Choisissez la langue de l'application" - }, - "choices": ["fr", "en"], - "default": "fr" + "en": "Set the administrator password", + "fr": "Définissez le mot de passe administrateur" + }, + "help": { + "en": "Use the help field to add an information for the admin about this question.", + "fr": "Utilisez le champ aide pour ajouter une information à l'intention de l'administrateur à propos de cette question." + }, + "example": "Choose a password" }, - { - "name": "password", - "type": "password", - "ask": { - "en": "Set the administrator password", - "fr": "Définissez le mot de passe administrateur" - }, - "help": { - "en": "Use the help field to add an information for the admin about this question.", - "fr": "Utilisez le champ aide pour ajouter une information à l'intention de l'administrateur à propos de cette question." - }, - "example": "Choose a password" - }, { "name": "ldap", "type": "boolean", @@ -82,6 +72,16 @@ "fr": "Souhaitez-vous ajouter les utilisateurs YunoHost dans les suggestions de destinataires ?" }, "default": true + }, + { + "name": "lang", + "type": "string", + "ask": { + "en": "Select default language", + "fr": "Definir la langue par defaut" + }, + "choices": ["English", "Francais"], + "default": "English" } ] } diff --git a/scripts/install b/scripts/install index 4510754..c843404 100644 --- a/scripts/install +++ b/scripts/install @@ -61,7 +61,7 @@ ynh_app_setting_set $app ldap $ldap #================================================= # CREATE A MYSQL DATABASE #================================================= -ynh_print_info "Creating a mysql database ..." +ynh_print_info "Creating a MySQL database..." db_name=$(ynh_sanitize_dbid $app) ynh_app_setting_set $app db_name $db_name @@ -70,7 +70,7 @@ ynh_mysql_setup_db $db_name $db_name #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_print_info "Setting up source files ..." +ynh_print_info "Setting up source files..." ynh_app_setting_set $app final_path $final_path # Download, check integrity, uncompress and patch the source from app.src @@ -87,7 +87,7 @@ ynh_add_nginx_config #================================================= # CREATE DEDICATED USER #================================================= -ynh_print_info "Configuring system user ..." +ynh_print_info "Configuring system user..." # Create a system user ynh_system_user_create $app @@ -95,7 +95,7 @@ ynh_system_user_create $app #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_print_info "Configuring php-fpm ..." +ynh_print_info "Configuring php-fpm..." # Create a dedicated php-fpm config ynh_add_fpm_config @@ -105,33 +105,46 @@ ynh_add_fpm_config #================================================= # AUTOCONFIG #================================================= +ynh_print_info "Configuring rainloop..." - +# Set lang => define from install manifest +case "$lang" in + Francais) + lang="fr" + ;; + English) + lang="en" + ;; + *) + lang="en" +esac +ynh_app_setting_set $app lang $lang # Set plugins -plugins="ynh-login-mapping,auto-domain-grab" # This plugin is trying to automatically grab unknown domains if users want to add external email accounts +# This plugin is trying to automatically grab unknown domains if users want to add external email accounts +plugins="ynh-login-mapping,auto-domain-grab" if [ $ldap -eq 1 ] then - plugins="$plugins,ynh-ldap-suggestions" # This plugin is to suggest YunoHost users in recipients list + # This plugin is to suggest YunoHost users in recipients list + plugins="$plugins,ynh-ldap-suggestions" fi -ynh_app_setting_set "$app" plugins "$plugins" +ynh_app_setting_set $app plugins "$plugins" mkdir -p "$final_path/app/data/_data_/_default_/configs/" application_file="$final_path/app/data/_data_/_default_/configs/application.ini" -sudo cp ../conf/data/configs/application.ini "$application_file" -ynh_replace_string "domain.tld" "$domain" "$application_file" -ynh_replace_string "MYSQLUSER" "$db_name" "$application_file" -ynh_replace_string "MYSQLPASSWORD" "$db_pwd" "$application_file" -ynh_replace_string "LANGTOCHANGE" "$lang" "$application_file" -ynh_replace_string "PLUGINSTOENABLE" "$plugins" "$application_file" +cp ../conf/data/configs/application.ini "$application_file" +ynh_replace_string "__DOMAIN__" $domain "$application_file" +ynh_replace_string "__MYSQLUSER__" $db_name "$application_file" +ynh_replace_string "__MYSQLPASSWORD__" "$db_pwd" "$application_file" +ynh_replace_string "__LANGTOCHANGE__" $lang "$application_file" +ynh_replace_string "__PLUGINSTOENABLE__" "$plugins" "$application_file" # Set admin password php ../conf/config.php --index="$final_path/app/index.php" --password="$password" - # Add default domain configs by looping through all the domains already added mkdir -p "$final_path/app/data/_data_/_default_/domains/" # get list of ldap domains @@ -145,15 +158,14 @@ 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 "domain.tld" "$domain" "$final_path/index.php" -ynh_replace_string "ALIASTOCHANGE" "$final_path" "$final_path/index.php" +ynh_replace_string "__DOMAIN__" "$domain" "$final_path/index.php" +ynh_replace_string "__ALIASTOCHANGE__" "$final_path" "$final_path/index.php" if [ $path_url = "/" ]; then - ynh_replace_string "ROOTTOCHANGE" "" "$final_path/index.php" + ynh_replace_string "__ROOTTOCHANGE__" "" "$final_path/index.php" else - ynh_replace_string "ROOTTOCHANGE" "$path_url" "$final_path/index.php" + ynh_replace_string "__ROOTTOCHANGE__" "$path_url" "$final_path/index.php" fi - # Install PGPback by chtixof to allow users to backup/restore their PGP private keys on the server cp -rf ../sources/pgpback "$final_path/" @@ -178,7 +190,7 @@ chown -R $app: $final_path #================================================= # SETUP SSOWAT #================================================= -ynh_print_info "Configuring SSOwat ..." +ynh_print_info "Configuring SSOwat..." # Make app public if necessary if [ $is_public -eq 1 ] diff --git a/scripts/remove b/scripts/remove index 7094419..f630a9d 100644 --- a/scripts/remove +++ b/scripts/remove @@ -59,6 +59,7 @@ ynh_remove_fpm_config #================================================= # REMOVE GPG KEY #================================================= +ynh_print_info "Removing GPG key" gpg --batch --delete-key --yes Rainloop diff --git a/scripts/restore b/scripts/restore index a5e21df..921fc65 100644 --- a/scripts/restore +++ b/scripts/restore @@ -53,6 +53,15 @@ ynh_print_info "Restoring the app main directory..." ynh_restore_file "$final_path" +#================================================= +# RESTORE THE MYSQL DATABASE +#================================================= +ynh_print_info "Restoring the MySQL database..." + +db_pwd=$(ynh_app_setting_get $app mysqlpwd) +ynh_mysql_setup_db $db_name $db_name $db_pwd +ynh_mysql_connect_as $db_name $db_pwd $db_name < ./db.sql + #================================================= # RECREATE THE DEDICATED USER #================================================= @@ -74,15 +83,6 @@ chown -R $app: $final_path ynh_restore_file "/etc/php/7.0/fpm/pool.d/$app.conf" -#================================================= -# RESTORE THE MYSQL DATABASE -#================================================= -ynh_print_info "Restoring the MySQL database..." - -db_pwd=$(ynh_app_setting_get $app mysqlpwd) -ynh_mysql_setup_db $db_name $db_name $db_pwd -ynh_mysql_connect_as $db_name $db_pwd $db_name < ./db.sql - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 186e2cb..0502049 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -109,18 +109,18 @@ ynh_add_fpm_config #================================================= # UPDATE SSO AND PGP #================================================= +ynh_print_info "Upgrading rainloop configuration..." # update SSO cp ../sources/sso/sso.php "$final_path/index.php" -ynh_replace_string "domain.tld" "$domain" "$final_path/index.php" -ynh_replace_string "ALIASTOCHANGE" "$final_path" "$final_path/index.php" +ynh_replace_string "__DOMAIN__" "$domain" "$final_path/index.php" +ynh_replace_string "__ALIASTOCHANGE__" "$final_path" "$final_path/index.php" if [ $path_url = "/" ]; then - ynh_replace_string "ROOTTOCHANGE" "" "$final_path/index.php" + ynh_replace_string "__ROOTTOCHANGE__" "" "$final_path/index.php" else - ynh_replace_string "ROOTTOCHANGE" "$path_url" "$final_path/index.php" + ynh_replace_string "__ROOTTOCHANGE__" "$path_url" "$final_path/index.php" fi - # 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 98980ae..b8a374a 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 '__ALIASTOCHANGE__/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.tldROOTTOCHANGE/app/index.php?sso&hash='.$ssoHash); + \header('Location: https://__DOMAIN____ROOTTOCHANGE__/app/index.php?sso&hash='.$ssoHash); } else { - \header('Location: https://domain.tldROOTTOCHANGE/app/index.php'); + \header('Location: https://__DOMAIN____ROOTTOCHANGE__/app/index.php'); }