Commits

Zhang Huangbin committed a049a4c

* iRedMail doesn't provide phpMyAdmin and phpPgAdmin anymore, due to security concern, and their own package dependencies.
* Add 'pidfile =' in uWSGI config file for iRedAdmin.
* Create dblink extension in PostgreSQL (9.2) on RHEL/CentOS 7.

Comments (0)

Files changed (17)

iRedMail/ChangeLog

-iRedMail-0.9.0-beta1:
+iRedMail-0.9.0-beta2:
     * Improvement:
         - Nginx support available on all Linux/BSD distributions.
         - MariaDB support is now available on FreeBSD.
     * Updated packages:
         + Roundcube webmail -> 1.0.2
 
+    * Below packages are removed from iRedMail for security concern:
+        - phpMyAdmin
+        - phpPgAdmin
+
+      If you need a sql management tool, please try http://adminer.org/
+      (web-based, a single PHP file) or other desktop applications instead.
+
 iRedMail-0.8.7:
     * Works on new Linux/BSD distribution releases:
         + Ubuntu 14.04 LTS. With MariaDB support.

iRedMail/conf/core

     fi
 }
 
+#enable_service()
+#{
+#    services="$@"
+#
+#    for i in $services; do
+#        ECHO_DEBUG "Enable service: $i."
+#
+#        if [ X"${DISTRO}" == X'RHEL' ]; then
+#            if [ X"${DISTRO_VERSION}" == X'6' ]; then
+#                if [ -x /etc/init.d/$i ]; then
+#                    /sbin/chkconfig --level 345 $i on
+#                fi
+#            else
+#                systemctl enable $i
+#            fi
+#        elif [ X"${DISTRO}" == X'DEBIAN' -o X"${DISTRO}" == X'UBUNTU' ]; then
+#            update-rc.d $i defaults
+#        elif [ X"${DISTRO}" == X'OPENBSD' ]; then
+#            [ -f ${RC_CONF_LOCAL} ] || touch ${RC_CONF_LOCAL}
+#            if [ X"$#" == X'2' ]; then
+#                flag="${1}"
+#                value="${2}"
+#                comment_mark="# ${PROG_NAME}-${flag}"
+#                if ! grep "^${comment_mark}$" ${RC_CONF_LOCAL} &>/dev/null; then
+#                    ECHO_DEBUG "Add flag in ${RC_CONF_LOCAL}: ${flag}='${value}'"
+#                    echo "${comment_mark}" >> ${RC_CONF_LOCAL}
+#                    echo "${flag}='${value}'" >> ${RC_CONF_LOCAL}
+#                else
+#                    ECHO_DEBUG "Skip adding flag in ${RC_CONF_LOCAL}: ${pkg}='${value}'"
+#                fi
+#            fi
+#        fi
+#    done
+#}
+
 # Generate MD5 password
 gen_md5_passwd()
 {

iRedMail/conf/nginx

 # uWSGI
 export UWSGI_CONF_DIR='/etc/uwsgi'
 export UWSGI_SOCKET_IREDADMIN='/var/run/uwsgi_iredadmin.socket'
+export UWSGI_PID_IREDADMIN='/var/run/uwsgi_iredadmin.pid'
 
 if [ X"${DISTRO}" == X'RHEL' ]; then
     export PHP_FASTCGI_SOCKET='/var/run/php-fpm/php-fpm.socket'
     export NGINX_LOG_ERRORLOG='logs/error.log'
 
     export UWSGI_SOCKET_IREDADMIN="${HTTPD_SERVERROOT}/run/uwsgi_iredadmin.socket"
+    export UWSGI_PID_IREDADMIN="${HTTPD_SERVERROOT}/run/uwsgi_iredadmin.pid"
 fi
 
 export NGINX_CONF="${NGINX_CONF_ROOT}/nginx.conf"

iRedMail/conf/phpmyadmin

-#!/usr/bin/env bash
-
-# Author:   Zhang Huangbin (zhb _at_ iredmail.org)
-
-#---------------------------------------------------------------------
-# This file is part of iRedMail, which is an open source mail server
-# solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
-#
-# iRedMail is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# iRedMail is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with iRedMail.  If not, see <http://www.gnu.org/licenses/>.
-#---------------------------------------------------------------------
-
-export PHPMYADMIN_VERSION='4.2.0-all-languages'
-export PHPMYADMIN_TARBALL="phpMyAdmin-${PHPMYADMIN_VERSION}.tar.bz2"
-
-# Install phpMyAdmin with source tarball.
-export PHPMYADMIN_USE_SOURCE='YES'
-export PHPMYADMIN_HTTPD_ROOT="${HTTPD_SERVERROOT}/phpMyAdmin-${PHPMYADMIN_VERSION}"
-export PHPMYADMIN_HTTPD_ROOT_SYMBOL_LINK="${HTTPD_SERVERROOT}/phpmyadmin"
-
-# Install phpMyAdmin with binary packages.
-if [ X"${DISTRO}" == X'DEBIAN' -o X"${DISTRO}" == X'UBUNTU' ]; then
-    export PHPMYADMIN_USE_SOURCE='NO'
-    export PHPMYADMIN_HTTPD_ROOT="/usr/share/phpmyadmin"
-    export PHPMYADMIN_HTTPD_ROOT_SYMBOL_LINK="${PHPMYADMIN_HTTPD_ROOT}"
-elif [ X"${DISTRO}" == X"FREEBSD" -o X"${DISTRO}" == X'OPENBSD' ]; then
-    export PHPMYADMIN_USE_SOURCE='NO'
-    export PHPMYADMIN_HTTPD_ROOT="${HTTPD_SERVERROOT}/phpMyAdmin"
-    export PHPMYADMIN_HTTPD_ROOT_SYMBOL_LINK="${PHPMYADMIN_HTTPD_ROOT}"
-fi
-
-export PHPMYADMIN_CONFIG_FILE="${PHPMYADMIN_HTTPD_ROOT}/config.inc.php"

iRedMail/conf/phppgadmin

-#!/usr/bin/env bash
-
-# Author:   Zhang Huangbin (zhb _at_ iredmail.org)
-
-#---------------------------------------------------------------------
-# This file is part of iRedMail, which is an open source mail server
-# solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
-#
-# iRedMail is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# iRedMail is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with iRedMail.  If not, see <http://www.gnu.org/licenses/>.
-#---------------------------------------------------------------------
-
-export PHPPGADMIN_VERSION='5.1'
-export PHPPGADMIN_TARBALL="phpPgAdmin-${PHPPGADMIN_VERSION}.tar.bz2"
-
-# Install phpPgAdmin with source tarball.
-export PHPPGADMIN_USE_SOURCE='YES'
-export PHPPGADMIN_HTTPD_ROOT="${HTTPD_SERVERROOT}/phpPgAdmin-${PHPPGADMIN_VERSION}"
-export PHPPGADMIN_HTTPD_ROOT_SYMBOL_LINK="${HTTPD_SERVERROOT}/phppgadmin"
-export PHPPGADMIN_HTTPD_CONF="${HTTPD_CONF_DIR}/phppgadmin.conf"
-
-# Install phpPgAdmin with binary packages.
-if [ X"${DISTRO}" == X'DEBIAN' -o X"${DISTRO}" == X'UBUNTU' ]; then
-    export PHPPGADMIN_USE_SOURCE='NO'
-    export PHPPGADMIN_HTTPD_ROOT="/usr/share/phppgadmin"
-    export PHPPGADMIN_HTTPD_ROOT_SYMBOL_LINK="${PHPPGADMIN_HTTPD_ROOT}"
-    if [ X"${DISTRO_CODENAME}" == X'wheezy' \
-        -o X"${DISTRO_CODENAME}" == X'precise' ]; then
-        export PHPPGADMIN_HTTPD_CONF="${HTTPD_CONF_DIR}/phppgadmin"
-    else
-        export PHPPGADMIN_HTTPD_CONF="${HTTPD_CONF_DIR}/phppgadmin.conf"
-    fi
-elif [ X"${DISTRO}" == X"FREEBSD" -o X"${DISTRO}" == X'OPENBSD' ]; then
-    export PHPPGADMIN_USE_SOURCE='NO'
-    export PHPPGADMIN_HTTPD_ROOT="${HTTPD_SERVERROOT}/phpPgAdmin"
-    export PHPPGADMIN_HTTPD_ROOT_SYMBOL_LINK="${PHPPGADMIN_HTTPD_ROOT}"
-    export PHPPGADMIN_HTTPD_CONF="${HTTPD_CONF_DIR}/phppgadmin.conf"
-fi
-
-export PHPPGADMIN_CONFIG_FILE="${PHPPGADMIN_HTTPD_ROOT}/conf/config.inc.php"

iRedMail/dialog/optional_components.sh

     if [ X"${DIALOG_SELECTABLE_PHPLDAPADMIN}" == X'YES' ]; then
         LIST_OF_OPTIONAL_COMPONENTS="${LIST_OF_OPTIONAL_COMPONENTS} phpLDAPadmin Web-based_LDAP_management_tool on"
     fi
-    LIST_OF_OPTIONAL_COMPONENTS="${LIST_OF_OPTIONAL_COMPONENTS} phpMyAdmin Web-based_MySQL_management_tool on"
-elif [ X"${BACKEND}" == X'MYSQL' ]; then
-    LIST_OF_OPTIONAL_COMPONENTS="${LIST_OF_OPTIONAL_COMPONENTS} phpMyAdmin Web-based_MySQL_management_tool on"
-elif [ X"${BACKEND}" == X'PGSQL' ]; then
-    LIST_OF_OPTIONAL_COMPONENTS="${LIST_OF_OPTIONAL_COMPONENTS} phpPgAdmin Web-based_PostgreSQL_management_tool on"
 fi
 
 if [ X"${DIALOG_SELECTABLE_AWSTATS}" == X'YES' ]; then
     echo "export REQUIRE_PHP='YES'" >> ${IREDMAIL_CONFIG_FILE}
 fi
 
-echo ${OPTIONAL_COMPONENTS} | grep -i 'phpmyadmin' >/dev/null 2>&1
-if [ X"$?" == X"0" ]; then
-    export USE_PHPMYADMIN='YES'
-    echo "export USE_PHPMYADMIN='YES'" >>${IREDMAIL_CONFIG_FILE}
-    echo "export REQUIRE_PHP='YES'" >> ${IREDMAIL_CONFIG_FILE}
-fi
-
-if echo ${OPTIONAL_COMPONENTS} | grep -i 'phppgadmin' &>/dev/null; then
-    export USE_PHPPGADMIN='YES'
-    echo "export USE_PHPPGADMIN='YES'" >>${IREDMAIL_CONFIG_FILE}
-fi
-
 if echo ${OPTIONAL_COMPONENTS} | grep -i 'awstats' &>/dev/null; then
     export USE_AWSTATS='YES'
     echo "export USE_AWSTATS='YES'" >>${IREDMAIL_CONFIG_FILE}

iRedMail/functions/nginx.sh

     perl -pi -e 's#PH_RCM_HTTPD_ROOT_SYMBOL_LINK#$ENV{RCM_HTTPD_ROOT_SYMBOL_LINK}#g' ${NGINX_CONF_DEFAULT}
     # phpLDAPadmin
     perl -pi -e 's#PH_PLA_HTTPD_ROOT_SYMBOL_LINK#$ENV{PLA_HTTPD_ROOT_SYMBOL_LINK}#g' ${NGINX_CONF_DEFAULT}
-    # phpMyAdmin
-    perl -pi -e 's#PH_PHPMYADMIN_HTTPD_ROOT_SYMBOL_LINK#$ENV{PHPMYADMIN_HTTPD_ROOT_SYMBOL_LINK}#g' ${NGINX_CONF_DEFAULT}
-    # phpPgAdmin
-    perl -pi -e 's#PH_PHPPGADMIN_HTTPD_ROOT_SYMBOL_LINK#$ENV{PHPPGADMIN_HTTPD_ROOT_SYMBOL_LINK}#g' ${NGINX_CONF_DEFAULT}
     # iRedAdmin
     perl -pi -e 's#PH_IREDADMIN_HTTPD_ROOT_SYMBOL_LINK#$ENV{IREDADMIN_HTTPD_ROOT_SYMBOL_LINK}#g' ${NGINX_CONF_DEFAULT}
     perl -pi -e 's#PH_UWSGI_SOCKET_IREDADMIN_FULL#$ENV{UWSGI_SOCKET_IREDADMIN_FULL}#g' ${NGINX_CONF_DEFAULT}
         perl -pi -e 's#PH_HTTPD_USER#$ENV{HTTPD_USER}#g' ${UWSGI_CONF_DIR}/iredadmin.ini
         perl -pi -e 's#PH_HTTPD_GROUP#$ENV{HTTPD_GROUP}#g' ${UWSGI_CONF_DIR}/iredadmin.ini
         perl -pi -e 's#PH_UWSGI_SOCKET_IREDADMIN#$ENV{UWSGI_SOCKET_IREDADMIN}#g' ${UWSGI_CONF_DIR}/iredadmin.ini
+        perl -pi -e 's#PH_UWSGI_PID_IREDADMIN#$ENV{UWSGI_PID_IREDADMIN}#g' ${UWSGI_CONF_DIR}/iredadmin.ini
     fi
 
     cat >> ${TIP_FILE} <<EOF

iRedMail/functions/optional_components.sh

     [ X"${USE_PHPLDAPADMIN}" == X"YES" ] && \
         check_status_before_run pla_install
 
-    # phpMyAdmin
-    [ X"${USE_PHPMYADMIN}" == X"YES" ] && \
-        check_status_before_run phpmyadmin_install
-
-    # phpPgAdmin
-    [ X"${USE_PHPPGADMIN}" == X"YES" ] && \
-        check_status_before_run phppgadmin_install
-
-
 }

iRedMail/functions/packages.sh

         if [ X"${DISTRO}" == X"RHEL" ]; then
             ALL_PKGS="${ALL_PKGS} nginx php-fpm"
         elif [ X"${DISTRO}" == X'DEBIAN' -o X"${DISTRO}" == X'UBUNTU' ]; then
-            ALL_PKGS="${ALL_PKGS} nginx php5-fpm"
+            ALL_PKGS="${ALL_PKGS} nginx-full php5-fpm"
         elif [ X"${DISTRO}" == X'OPENBSD' ]; then
             # Nginx is available in base system
             ALL_PKGS="${ALL_PKGS} php-fpm${OB_PHP_VER}"
         PKG_SCRIPTS="${PKG_SCRIPTS} ${CLAMAV_CLAMD_RC_SCRIPT_NAME} ${CLAMAV_FRESHCLAMD_RC_SCRIPT_NAME} ${AMAVISD_RC_SCRIPT_NAME} ${POSTFIX_RC_SCRIPT_NAME}"
     fi
 
-    # phpPgAdmin
-    if [ X"${USE_PHPPGADMIN}" == X"YES" ]; then
-        if [ X"${DISTRO}" == X"RHEL" ]; then
-            :
-        elif [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" ]; then
-            ALL_PKGS="${ALL_PKGS} phppgadmin"
-        elif [ X"${DISTRO}" == X'OPENBSD' ]; then
-            ALL_PKGS="${ALL_PKGS} phpPgAdmin"
-        fi
-    fi
-
     # Roundcube
     if [ X"${USE_RCM}" == X"YES" ]; then
         if [ X"${DISTRO}" == X'OPENBSD' ]; then
         fi
     fi
 
-    # phpMyAdmin
-    if [ X"${USE_PHPMYADMIN}" == X"YES" ]; then
-        if [ X"${DISTRO}" == X'DEBIAN' -o X"${DISTRO}" == X'UBUNTU' ]; then
-            ALL_PKGS="${ALL_PKGS} phpmyadmin"
-        elif [ X"${DISTRO}" == X'OPENBSD' ]; then
-            ALL_PKGS="${ALL_PKGS} phpMyAdmin"
-        fi
-    fi
-
     # phpLDAPadmin
     if [ X"${USE_PHPLDAPADMIN}" == X'YES' ]; then
         if [ X"${DISTRO}" == X'DEBIAN' -o X"${DISTRO}" == X'UBUNTU' ]; then

iRedMail/functions/packages_freebsd.sh

     for p in \
         archivers_p5-Archive-Tar \
         converters_libiconv \
-        databases_phpmyadmin \
         databases_postgresql${WANT_PGSQL_VER}-client \
         databases_postgresql${WANT_PGSQL_VER}-contrib \
         databases_postgresql${WANT_PGSQL_VER}-server \
         ALL_PORTS="${ALL_PORTS} net/phpldapadmin"
     fi
 
-    # phpMyAdmin.
-    cat > /var/db/ports/databases_phpmyadmin/options <<EOF
-OPTIONS_FILE_SET+=APC
-OPTIONS_FILE_SET+=BZ2
-OPTIONS_FILE_SET+=GD
-OPTIONS_FILE_SET+=MCRYPT
-OPTIONS_FILE_SET+=OPENSSL
-OPTIONS_FILE_UNSET+=PDF
-OPTIONS_FILE_SET+=ZIP
-OPTIONS_FILE_SET+=ZLIB
-OPTIONS_FILE_SET+=MYSQL
-OPTIONS_FILE_SET+=MYSQLI
-EOF
-
-    if [ X"${USE_PHPMYADMIN}" == X"YES" ]; then
-        ALL_PORTS="${ALL_PORTS} databases/phpmyadmin"
-    fi
-
-    # phpPgAdmin
-    if [ X"${USE_PHPPGADMIN}" == X"YES" ]; then
-        ALL_PORTS="${ALL_PORTS} databases/phppgadmin"
-    fi
-
     # Python database interfaces
     if [ X"${BACKEND}" == X'OPENLDAP' ]; then
         ALL_PORTS="${ALL_PORTS} net/py-ldap2 databases/py-MySQLdb"

iRedMail/functions/phpmyadmin.sh

-#!/usr/bin/env bash
-
-# Author: Zhang Huangbin <zhb _at_ iredmail.org>
-
-# -------------------------------------------------
-# phpMyAdmin.
-# -------------------------------------------------
-phpmyadmin_install()
-{
-    ECHO_INFO "Configure phpMyAdmin (web-based MySQL management tool)." 
-
-    if [ X"${PHPMYADMIN_USE_SOURCE}" == X"YES" ]; then
-        cd ${PKG_MISC_DIR}
-
-        extract_pkg ${PHPMYADMIN_TARBALL} ${HTTPD_SERVERROOT}
-
-        ECHO_DEBUG "Set file permission for phpMyAdmin: ${PHPMYADMIN_HTTPD_ROOT}."
-        chown -R ${SYS_ROOT_USER}:${SYS_ROOT_GROUP} ${PHPMYADMIN_HTTPD_ROOT}
-        chmod -R 0755 ${PHPMYADMIN_HTTPD_ROOT}
-
-        # Create symbol link, so that we don't need to modify apache
-        # conf.d/phpmyadmin.conf file after upgrade this component.
-        ln -s ${PHPMYADMIN_HTTPD_ROOT} ${PHPMYADMIN_HTTPD_ROOT_SYMBOL_LINK} >/dev/null
-    fi
-
-    # Make phpMyAdmin can be accessed via HTTPS only.
-    if [ X"${WEB_SERVER_USE_APACHE}" == X'YES' ]; then
-        perl -pi -e 's#^(\s*</VirtualHost>)#Alias /phpmyadmin "$ENV{PHPMYADMIN_HTTPD_ROOT_SYMBOL_LINK}/"\n${1}#' ${HTTPD_SSL_CONF}
-    fi
-
-    ECHO_DEBUG "Config phpMyAdmin: ${PHPMYADMIN_CONFIG_FILE}."
-    cd ${PHPMYADMIN_HTTPD_ROOT} && cp config.sample.inc.php ${PHPMYADMIN_CONFIG_FILE}
-
-    export COOKIE_STRING="$(${RANDOM_STRING})"
-    perl -pi -e 's#(.*blowfish_secret.*= )(.*)#${1}"$ENV{COOKIE_STRING}"; //${2}#' ${PHPMYADMIN_CONFIG_FILE}
-
-    # New option in phpMyAdmin-3.5.1
-    perl -pi -e 's#(.*blowfish_secret.*)#${1}\n\$cfg\["AllowThirdPartyFraming"\] = true;#' ${PHPMYADMIN_CONFIG_FILE}
-
-    perl -pi -e 's#(.*Servers.*host.*=.*)localhost(.*)#${1}$ENV{SQL_SERVER}${2}#' ${PHPMYADMIN_CONFIG_FILE}
-
-    if [ X"${SQL_SERVER}" == X"localhost" ]; then
-        # Use unix socket.
-        perl -pi -e 's#(.*Servers.*connect_type.*=).*#${1}"socket";#' ${PHPMYADMIN_CONFIG_FILE}
-    else
-        # Use TCP/IP.
-        perl -pi -e 's#(.*Servers.*connect_type.*=).*#${1}"tcp";#' ${PHPMYADMIN_CONFIG_FILE}
-    fi
-
-    cat >> ${TIP_FILE} <<EOF
-phpMyAdmin:
-    * Configuration files:
-        - ${PHPMYADMIN_HTTPD_ROOT}
-        - ${PHPMYADMIN_CONFIG_FILE}
-    * Login account:
-        - Username: ${MYSQL_ROOT_USER}, password: ${MYSQL_ROOT_PASSWD}
-        - Username: ${VMAIL_DB_ADMIN_USER}, password: ${VMAIL_DB_ADMIN_PASSWD}
-        - Username (read-only): ${VMAIL_DB_BIND_USER}, password: ${VMAIL_DB_BIND_PASSWD}
-    * URL:
-        - https://${HOSTNAME}/phpmyadmin
-    * See also:
-        - ${HTTPD_CONF_DIR}/phpmyadmin.conf
-
-EOF
-
-    echo 'export status_phpmyadmin_install="DONE"' >> ${STATUS_FILE}
-}

iRedMail/functions/phppgadmin.sh

-#!/usr/bin/env bash
-
-# Author: Zhang Huangbin <zhb _at_ iredmail.org>
-
-# -------------------------------------------------
-# phpPgAdmin.
-# -------------------------------------------------
-phppgadmin_install()
-{
-    ECHO_INFO "Configure phpPgAdmin (web-based PostgreSQL management tool)." 
-
-    if [ X"${PHPPGADMIN_USE_SOURCE}" == X"YES" ]; then
-        cd ${PKG_MISC_DIR}
-
-        extract_pkg ${PHPPGADMIN_TARBALL} ${HTTPD_SERVERROOT}
-
-        ECHO_DEBUG "Set file permission for phpPgAdmin: ${PHPPGADMIN_HTTPD_ROOT}."
-        chown -R ${SYS_ROOT_USER}:${SYS_ROOT_GROUP} ${PHPPGADMIN_HTTPD_ROOT}
-        chmod -R 0755 ${PHPPGADMIN_HTTPD_ROOT}
-
-        # Create symbol link, so that we don't need to modify apache
-        # conf.d/phppgadmin.conf file after upgrade this component.
-        ln -s ${PHPPGADMIN_HTTPD_ROOT} ${PHPPGADMIN_HTTPD_ROOT_SYMBOL_LINK} >/dev/null
-    fi
-
-    backup_file ${PHPPGADMIN_CONFIG_FILE}
-
-    ECHO_DEBUG "Create directory alias for phpPgAdmin in Apache: ${PHPPGADMIN_HTTPD_CONF}."
-    cat > ${PHPPGADMIN_HTTPD_CONF} <<EOF
-${CONF_MSG}
-# Note: Please refer to ${HTTPD_SSL_CONF} for SSL/TLS setting.
-<Directory "${PHPPGADMIN_HTTPD_ROOT_SYMBOL_LINK}/">
-    Options -Indexes
-</Directory>
-EOF
-
-    # Make phpPgAdmin can be accessed via HTTPS only.
-    perl -pi -e 's#^(\s*</VirtualHost>)#Alias /phppgadmin "$ENV{PHPPGADMIN_HTTPD_ROOT_SYMBOL_LINK}/"\n${1}#' ${HTTPD_SSL_CONF}
-
-    ECHO_DEBUG "Config phpPgAdmin: ${PHPPGADMIN_CONFIG_FILE}."
-    cd ${PHPPGADMIN_HTTPD_ROOT} && cp config.inc.php-dist ${PHPPGADMIN_CONFIG_FILE} &>/dev/null
-
-    perl -pi -e 's#(.*servers.*host.*=).*#${1} "$ENV{SQL_SERVER}";#' ${PHPPGADMIN_CONFIG_FILE}
-    perl -pi -e 's#(.*servers.*port.*=).*#${1} $ENV{SQL_SERVER_PORT};#' ${PHPPGADMIN_CONFIG_FILE}
-    perl -pi -e 's#(.*servers.*sslmode.*=).*#${1} "require";#' ${PHPPGADMIN_CONFIG_FILE}
-
-    perl -pi -e 's#(.*servers.*pg_dump_path.*=).*#${1} "$ENV{PGSQL_BIN_PG_DUMP}";#' ${PHPPGADMIN_CONFIG_FILE}
-    perl -pi -e 's#(.*servers.*pg_dumpall_path.*=).*#${1} "$ENV{PGSQL_BIN_PG_DUMPALL}";#' ${PHPPGADMIN_CONFIG_FILE}
-
-    perl -pi -e 's#(.*owned_only.*=).*#${1} false;#' ${PHPPGADMIN_CONFIG_FILE}
-    perl -pi -e 's#(.*show_reports.*=).*#${1} false;#' ${PHPPGADMIN_CONFIG_FILE}
-    perl -pi -e 's#(.*owned_reports_only.*=).*#${1} true;#' ${PHPPGADMIN_CONFIG_FILE}
-    perl -pi -e 's#(.*min_password_length.*=).*#${1} 8;#' ${PHPPGADMIN_CONFIG_FILE}
-
-    perl -pi -e 's#(.*Servers.*connect_type.*=).*#${1}"socket";#' ${PHPPGADMIN_CONFIG_FILE}
-
-    if [ X"${DISTRO}" == X'DEBIAN' -o X"${DISTRO}" == X'UBUNTU' ]; then
-        # Create a symbol link
-        if [ -f /etc/phppgadmin/config.inc.php ]; then
-            backup_file /etc/phppgadmin/config.inc.php
-            rm -f /etc/phppgadmin/config.inc.php &>/dev/null
-            ln -s ${PHPPGADMIN_CONFIG_FILE} /etc/phppgadmin/config.inc.php
-        fi
-    fi
-
-    cat >> ${TIP_FILE} <<EOF
-phpPgAdmin:
-    * Configuration files:
-        - ${PHPPGADMIN_HTTPD_ROOT}
-        - ${PHPPGADMIN_CONFIG_FILE}
-    * Login account:
-        - Username: ${PGSQL_ROOT_USER}, password: ${PGSQL_ROOT_PASSWD}
-        - Username: ${VMAIL_DB_ADMIN_USER}, password: ${VMAIL_DB_ADMIN_PASSWD}
-        - Username (read-only): ${VMAIL_DB_BIND_USER}, password: ${VMAIL_DB_BIND_PASSWD}
-    * URL:
-        - httpS://${HOSTNAME}/phppgadmin
-    * See also:
-        - ${PHPPGADMIN_HTTPD_CONF}
-
-EOF
-
-    echo 'export status_phppgadmin_install="DONE"' >> ${STATUS_FILE}
-}

iRedMail/functions/postgresql.sh

         if [ X"${DISTRO_VERSION}"  == X'6' ]; then
             ${PGSQL_RC_SCRIPT} initdb &>/dev/null
         else
-            postgresql-setup initdb
+            postgresql-setup initdb &>/dev/null
         fi
     elif [ X"${DISTRO}" == X'FREEBSD' ]; then
         # FreeBSD: Start pgsql when system start up.
     # PostgreSQL 8.x
     # - Create language plpgsql
     # - Create extension dblink via importing SQL file
-    if [ X"${DISTRO}" == X'RHEL' -a X"${DISTRO_VERSION}" == X'6' ]; then
-        cat >> ${PGSQL_INIT_SQL_SAMPLE} <<EOF
+    if [ X"${DISTRO}" == X'RHEL' ]; then
+        if [ X"${DISTRO_VERSION}" == X'6' ]; then
+            cat >> ${PGSQL_INIT_SQL_SAMPLE} <<EOF
 CREATE LANGUAGE plpgsql;
 \i /usr/share/pgsql/contrib/dblink.sql;
 EOF
+        else
+            cat >> ${PGSQL_INIT_SQL_SAMPLE} <<EOF
+CREATE EXTENSION dblink;
+EOF
+        fi
     fi
 
     cat >> ${PGSQL_INIT_SQL_SAMPLE} <<EOF

iRedMail/iRedMail.sh

 . ${CONF_DIR}/clamav
 . ${CONF_DIR}/spamassassin
 . ${CONF_DIR}/roundcube
-. ${CONF_DIR}/phpmyadmin
-. ${CONF_DIR}/phppgadmin
 . ${CONF_DIR}/awstats
 . ${CONF_DIR}/fail2ban
 . ${CONF_DIR}/iredadmin
 . ${FUNCTIONS_DIR}/spamassassin.sh
 . ${FUNCTIONS_DIR}/roundcubemail.sh
 . ${FUNCTIONS_DIR}/phpldapadmin.sh
-. ${FUNCTIONS_DIR}/phpmyadmin.sh
-. ${FUNCTIONS_DIR}/phppgadmin.sh
 . ${FUNCTIONS_DIR}/awstats.sh
 . ${FUNCTIONS_DIR}/fail2ban.sh
 . ${FUNCTIONS_DIR}/iredadmin.sh

iRedMail/pkgs/MD5.misc

 b6b6696e3f94244c5b007d53083c0f13  misc/iRedAdmin-0.3.3.tar.bz2
 59a49054039ceb852c2da377d8742360  misc/phpldapadmin-1.2.3.tgz
-2172407367c215640d5bb39271471fc3  misc/phpMyAdmin-4.2.0-all-languages.tar.bz2
 3e2389b226f28fbe18a8e9049bdcb2d8  misc/iRedAPD-1.4.3.tar.bz2
-ad8f05cef0c443d9ce2940bf36319c24  misc/phpPgAdmin-5.1.tar.bz2
 5028c6f9fa88d0c84b0fde0b84355203  misc/roundcubemail-1.0.2.tar.gz

iRedMail/samples/nginx/default.conf

         index index.php;
     }
 
-    # phpMyAdmin
-    location ~ /phpmyadmin(.*)\.php$ {
-        include fastcgi_params;
-        fastcgi_pass php_workers;
-        fastcgi_index index.php;
-        fastcgi_param SCRIPT_FILENAME PH_PHPMYADMIN_HTTPD_ROOT_SYMBOL_LINK$1.php;
-    }
-
-    location ~ /phpmyadmin(.*) {
-        alias PH_PHPMYADMIN_HTTPD_ROOT_SYMBOL_LINK$1;
-        index index.php;
-    }
-
-    # phpPgAdmin
-    location ~ /phppgadmin(.*)\.php$ {
-        include fastcgi_params;
-        fastcgi_pass php_workers;
-        fastcgi_index index.php;
-        fastcgi_param SCRIPT_FILENAME PH_PHPPGADMIN_HTTPD_ROOT_SYMBOL_LINK$1.php;
-    }
-
-    location ~ /phppgadmin(.*) {
-        alias PH_PHPPGADMIN_HTTPD_ROOT_SYMBOL_LINK$1;
-        index index.php;
-    }
-
     # Normal PHP scripts
     location ~ \.php$ {
         include fastcgi_params;

iRedMail/samples/nginx/uwsgi_iredadmin.ini

 plugins = python
 vhost = true
 socket = PH_UWSGI_SOCKET_IREDADMIN
+pidfile = PH_UWSGI_PID_IREDADMIN
 chown-socket = PH_HTTPD_USER:PH_HTTPD_GROUP
 chmod-socket = 660
 uid = iredadmin