From 7270097fc75ef3f7697d2b9ba061bb969dc1ce60 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Fri, 25 Jul 2014 12:29:06 +0530 Subject: [PATCH] Added Roundcube installation --- src/vendor/ee_ven_install_roundcube.sh | 32 ++++++++++++++++++++++++++ src/vendor/ee_ven_install_vimbadmin.sh | 4 ++++ src/vendor/ee_ven_setup_vimbadmin.sh | 4 +++- 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/vendor/ee_ven_install_roundcube.sh diff --git a/src/vendor/ee_ven_install_roundcube.sh b/src/vendor/ee_ven_install_roundcube.sh new file mode 100644 index 00000000..1fb4b82f --- /dev/null +++ b/src/vendor/ee_ven_install_roundcube.sh @@ -0,0 +1,32 @@ +# Install Roundcube + +function ee_mod_install_roundcube() +{ + # Install Roundcube dependencies + ee_lib_echo "Installing Roundcube dependencies, please wait..." + $EE_APT_GET install php-pear \ + || ee_lib_error "Unable to install php-pear, exit status = " $? + pear install Mail_Mime Net_SMTP Mail_mimeDecode Net_IDNA2 Auth_SASL Net_Sieve Crypt_GPG \ + || ee_lib_error "Unable to install pear packages, exit status = " $? + + # Setup Roundcube directory + mkdir -p /var/www/roundcubemail/htdocs && mkdir -p /var/www/roundcubemail/logs + ee_lib_symbolic_link /var/log/nginx/roundcubemail.access.log /var/www/roundcubemail/logs/access.log + ee_lib_symbolic_link /var/log/nginx/roundcubemail.error.log /var/www/roundcubemail/logs/error.log + + # Install Roundcube + ee_lib_echo "Downloading Roundcube, please wait..." + wget -cqO /var/www/roundcube.tar.gz https://github.com/roundcube/roundcubemail/releases/download/1.0.2/roundcubemail-1.0.2.tar.gz \ + || ee_lib_error "Unable to download Roundcube, exit status = " $? + + ee_lib_echo "Installing Roundcube, please wait..." + tar -zxf /var/www/roundcube.tar.gz + mv /var/www/roundcubemail-1.0.1/* /var/www/roundcubemail/htdocs/ + + # Fix permissions + chown -R $EE_PHP_USER:$EE_PHP_USER /var/www/roundcubemail \ + || ee_lib_error "Unable to change ownership for ViMbAdmin, exit status = " $? + + # Remove unwanted files + rm -rf /var/www/roundcube.tar.gz /var/www/roundcubemail-1.0.1 +} diff --git a/src/vendor/ee_ven_install_vimbadmin.sh b/src/vendor/ee_ven_install_vimbadmin.sh index b833be11..a5ba1b61 100644 --- a/src/vendor/ee_ven_install_vimbadmin.sh +++ b/src/vendor/ee_ven_install_vimbadmin.sh @@ -18,6 +18,10 @@ function ee_mod_install_vimbadmin() php composer.phar install --prefer-dist --no-dev \ || ee_lib_error "Unable to install ViMbAdmin, exit status = " $? + # Fix permissions + chown -R $EE_PHP_USER:$EE_PHP_USER /var/www/22222/htdocs/vimbadmin \ + || ee_lib_error "Unable to change ownership for ViMbAdmin, exit status = " $? + # Remove unwanted files rm -rf /var/www/22222/htdocs/vimbadmin.tar.gz /var/www/22222/htdocs/vimbadmin/composer.phar } diff --git a/src/vendor/ee_ven_setup_vimbadmin.sh b/src/vendor/ee_ven_setup_vimbadmin.sh index 09ed2a97..cf471ca6 100644 --- a/src/vendor/ee_ven_setup_vimbadmin.sh +++ b/src/vendor/ee_ven_setup_vimbadmin.sh @@ -2,6 +2,8 @@ function ee_mod_setup_vimbadmin() { + ee_lib_echo "configuring ViMbAdmin, please wait..." + # Random characters local ee_random=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 15 | head -n1) @@ -15,7 +17,7 @@ function ee_mod_setup_vimbadmin() mysql -e "flush privileges" # Setup configuration for ViMbAdmin - cp -v /var/www/22222/htdocs/vimbadmin/application/configs/application.ini.dist /var/www/22222/htdocs/vimbadmin/application/configs/application.ini + cp -av /var/www/22222/htdocs/vimbadmin/application/configs/application.ini.dist /var/www/22222/htdocs/vimbadmin/application/configs/application.ini sed -i "s/defaults.mailbox.uid = 2000/defaults.mailbox.uid = 5000/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini sed -i "s/defaults.mailbox.gid = 2000/defaults.mailbox.gid = 5000/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini