From 80cce268248d4d34b2ad1671ee31d3403f9262c6 Mon Sep 17 00:00:00 2001 From: scith Date: Sat, 8 Apr 2017 17:03:46 +0200 Subject: [PATCH 1/2] Fix root install Fix install at root path --- scripts/install | 13 +++++++++---- scripts/upgrade | 11 ++++++++--- sources/sso/index.php | 35 ----------------------------------- sources/sso/sso.php | 6 +++--- 4 files changed, 20 insertions(+), 45 deletions(-) delete mode 100644 sources/sso/index.php diff --git a/scripts/install b/scripts/install index 0e46e8b..00422d0 100644 --- a/scripts/install +++ b/scripts/install @@ -110,9 +110,14 @@ CHECK_DOMAINPATH sudo cp ../conf/data/domains/default.ini $rainloop_path/data/_data_/_default_/domains/default.ini # install SSO - at the moment the index is the SSO and rainloop is installed in /app - sudo cp ../sources/sso/sso.php $final_path/index.php - sudo sed -i "s@domain.tld@$domain@g" $final_path/index.php - sudo sed -i "s@PATHTOCHANGE@$path@g" $final_path/index.php + sudo cp ../sources/sso/sso.php $final_path/index.php + sudo sed -i "s@domain.tld@$domain@g" $final_path/index.php + sudo sed -i "s@ALIASTOCHANGE@$final_path@g" $final_path/index.php + if [ $path = "/" ]; then + sudo sed -i "s@ROOTTOCHANGE@@g" $final_path/index.php + else + sudo sed -i "s@ROOTTOCHANGE@$path@g" $final_path/index.php + fi # Install PGPback by chtixof to allow users to backup/restore their PGP private keys on the server sudo cp -rf ../sources/pgpback $final_path/. @@ -130,7 +135,7 @@ CHECK_DOMAINPATH else sudo sed -i "s@ROOTTOCHANGE@$path@g" $nginx_conf_file fi - sudo sed -i "s@PATHTOCHANGE@$path@g" $nginx_conf_file + sudo sed -i "s@PATHTOCHANGE@$path@g" $nginx_conf_file sudo sed -i "s@ALIASTOCHANGE@$final_path/@g" $nginx_conf_file sudo sed -i "s@NAMETOCHANGE@$app@g" $nginx_conf_file sudo chown root: $nginx_conf_file diff --git a/scripts/upgrade b/scripts/upgrade index c1410eb..5334d83 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -63,9 +63,14 @@ CHECK_PATH sudo cp -rf ../sources/plugins/ynh-ldap-suggestions $rainloop_path/data/_data_/_default_/plugins/. # update SSO - sudo cp ../sources/sso/sso.php $final_path/index.php - sudo sed -i "s@domain.tld@$domain@g" $final_path/index.php - sudo sed -i "s@PATHTOCHANGE@$path@g" $final_path/index.php + sudo cp ../sources/sso/sso.php $final_path/index.php + sudo sed -i "s@domain.tld@$domain@g" $final_path/index.php + sudo sed -i "s@ALIASTOCHANGE@$final_path@g" $final_path/index.php + if [ $path = "/" ]; then + sudo sed -i "s@ROOTTOCHANGE@@g" $final_path/index.php + else + sudo sed -i "s@ROOTTOCHANGE@$path@g" $final_path/index.php + fi # Install PGPback by chtixof to allow users to backup/restore their PGP private keys on the server sudo cp -rf ../sources/pgpback $final_path/. diff --git a/sources/sso/index.php b/sources/sso/index.php deleted file mode 100644 index c88e331..0000000 --- a/sources/sso/index.php +++ /dev/null @@ -1,35 +0,0 @@ - diff --git a/sources/sso/sso.php b/sources/sso/sso.php index 0764943..98980ae 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 '/var/www/rainloop/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.tldPATHTOCHANGE/app/index.php?sso&hash='.$ssoHash); + \header('Location: https://domain.tldROOTTOCHANGE/app/index.php?sso&hash='.$ssoHash); } else { - \header('Location: https://domain.tldPATHTOCHANGE/app/index.php'); + \header('Location: https://domain.tldROOTTOCHANGE/app/index.php'); } From 1311c083bf1843e46c6cc450d5ff4b9b3a42081a Mon Sep 17 00:00:00 2001 From: scith Date: Sat, 8 Apr 2017 17:07:51 +0200 Subject: [PATCH 2/2] Update Rainloop 1.11.0.203 https://www.rainloop.net/changelog/ --- sources/rainloop_version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/rainloop_version b/sources/rainloop_version index 26049ae..b2929d0 100644 --- a/sources/rainloop_version +++ b/sources/rainloop_version @@ -1 +1 @@ -1.10.5.192 +1.11.0.203