1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/rainloop_ynh.git synced 2024-09-03 20:16:18 +02:00
This commit is contained in:
ericgaspar 2021-03-26 08:56:58 +01:00
parent c5b84d4912
commit 57e3436cb6
No known key found for this signature in database
GPG key ID: 574F281483054D44
6 changed files with 22 additions and 38 deletions

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
@ -25,4 +24,4 @@ Notification=none
;;; Upgrade options ;;; Upgrade options
; commit=7a48f5b9b35ff22529190f282bfcf5f56944741a ; commit=7a48f5b9b35ff22529190f282bfcf5f56944741a
name=Upgrade to v.1.14.0 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

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

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

@ -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,7 +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=lang --value=$lang ynh_app_setting_set --app=$app --key=lang --value=$language
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
@ -120,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"
@ -150,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/"

View file

@ -19,7 +19,7 @@ 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)
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)
#================================================= #=================================================
@ -45,14 +45,14 @@ 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 case "$language" in
Francais) Francais)
lang="fr" lang="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" lang="en"
ynh_app_setting_set --app=$app --key=lang --value=$lang ynh_app_setting_set --app=$app --key=language --value=$language
;; ;;
*) *)
;; ;;
@ -138,10 +138,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');
} }