Skip to content

Commit bbcd99d

Browse files
author
Kristan Kenney
committed
Optimize roundcube configuration
Update hst-install-debian.sh Update hst-install-debian.sh Increase minimum password length (8 characters)
1 parent 6fd17eb commit bbcd99d

File tree

3 files changed

+27
-47
lines changed

3 files changed

+27
-47
lines changed

install/deb/roundcube/config.inc.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
// Require the new password to be a certain length.
1010
// set to blank to allow passwords of any length
11-
$rcmail_config['password_minimum_length'] = 6;
11+
$rcmail_config['password_minimum_length'] = 8;
1212

1313
// Require the new password to contain a letter and punctuation character
1414
// Change to false to remove this check.
@@ -21,7 +21,6 @@
2121
// will be not available (no Password tab in Settings)
2222
$rcmail_config['password_login_exceptions'] = null;
2323

24-
2524
// By default domains in variables are using unicode.
2625
// Enable this option to use punycoded names
2726
$rcmail_config['password_idn_ascii'] = false;

install/hst-install-debian.sh

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,38 +1497,26 @@ if [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
14971497
cp -f $hestiacp/roundcube/apache.conf /etc/roundcube/
14981498
ln -s /etc/roundcube/apache.conf /etc/apache2/conf.d/roundcube.conf
14991499
fi
1500-
cp -f $hestiacp/roundcube/main.inc.php /etc/roundcube/
1501-
cp -f $hestiacp/roundcube/db.inc.php /etc/roundcube/
1502-
chmod 640 /etc/roundcube/debian-db-roundcube.php
1500+
cp -f $hestiacp/roundcube/main.inc.php /etc/roundcube/config.inc.php
1501+
cp -f $hestiacp/roundcube/db.inc.php /etc/roundcube/debian-db-roundcube.php
1502+
cp -f $hestiacp/roundcube/config.inc.php /etc/roundcube/plugins/password/
1503+
cp -f $hestiacp/roundcube/hestia.php /usr/share/roundcube/plugins/password/drivers/
1504+
touch /var/log/roundcube/errors
15031505
chmod 640 /etc/roundcube/config.inc.php
1504-
chown root:www-data /etc/roundcube/debian-db-roundcube.php
15051506
chown root:www-data /etc/roundcube/config.inc.php
1506-
cp -f $hestiacp/roundcube/hestia.php \
1507-
/usr/share/roundcube/plugins/password/drivers/
1508-
cp -f $hestiacp/roundcube/config.inc.php /etc/roundcube/plugins/password/
1507+
chmod 640 /etc/roundcube/debian-db-roundcube.php
1508+
chown root:www-data /etc/roundcube/debian-db-roundcube.php
1509+
chmod 640 /var/log/roundcube/errors
1510+
chown www-data:adm /var/log/roundcube/errors
1511+
15091512
r="$(gen_pass)"
15101513
mysql -e "CREATE DATABASE roundcube"
1511-
mysql -e "GRANT ALL ON roundcube.*
1514+
mysql -e "GRANT ALL ON roundcube.*
15121515
TO roundcube@localhost IDENTIFIED BY '$r'"
1513-
sed -i "s/%password%/$r/g" /etc/roundcube/db.inc.php
1514-
sed -i "s/localhost/$servername/g" \
1515-
/etc/roundcube/plugins/password/config.inc.php
1516+
sed -i "s/%password%/$r/g" /etc/roundcube/debian-db-roundcube.php
1517+
sed -i "s/localhost/$servername/g" /etc/roundcube/plugins/password/config.inc.php
15161518
mysql roundcube < /usr/share/dbconfig-common/data/roundcube/install/mysql
1517-
chmod a+r /etc/roundcube/main.inc.php
1518-
1519-
# Send all emails through SMTP and add user information
1520-
sed -i "/\$config\['smtp_server'\]/c\$config\['smtp_server'\] = 'localhost';" /etc/roundcube/defaults.inc.php
1521-
sed -i "/\$config\['smtp_user'\]/c\$config\['smtp_user'\] = '%u';" /etc/roundcube/defaults.inc.php
1522-
sed -i "/\$config\['smtp_pass'\]/c\$config\['smtp_pass'\] = '%p';" /etc/roundcube/defaults.inc.php
1523-
1524-
if [ "$release" -eq 8 ] || [ "$release" -eq 9 ]; then
1525-
mv -f /etc/roundcube/main.inc.php /etc/roundcube/config.inc.php
1526-
mv -f /etc/roundcube/db.inc.php /etc/roundcube/debian-db-roundcube.php
1527-
chmod 640 /etc/roundcube/debian-db-roundcube.php
1528-
chmod 640 /etc/roundcube/config.inc.php
1529-
chown root:www-data /etc/roundcube/debian-db-roundcube.php
1530-
chown root:www-data /etc/roundcube/config.inc.php
1531-
fi
1519+
15321520
if [ "$release" -eq 8 ]; then
15331521
# RoundCube tinyMCE fix
15341522
tinymceFixArchiveURL=$hestiacp/roundcube/roundcube-tinymce.tar.gz

install/hst-install-ubuntu.sh

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,33 +1449,26 @@ if [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
14491449
cp -f $hestiacp/roundcube/apache.conf /etc/roundcube/
14501450
ln -s /etc/roundcube/apache.conf /etc/apache2/conf.d/roundcube.conf
14511451
fi
1452-
cp -f $hestiacp/roundcube/main.inc.php /etc/roundcube/
1453-
cp -f $hestiacp/roundcube/db.inc.php /etc/roundcube/
1452+
cp -f $hestiacp/roundcube/main.inc.php /etc/roundcube/config.inc.php
1453+
cp -f $hestiacp/roundcube/db.inc.php /etc/roundcube/debian-db-roundcube.php
14541454
cp -f $hestiacp/roundcube/config.inc.php /etc/roundcube/plugins/password/
14551455
cp -f $hestiacp/roundcube/hestia.php /usr/share/roundcube/plugins/password/drivers/
1456+
touch /var/log/roundcube/errors
1457+
chmod 640 /etc/roundcube/config.inc.php
1458+
chown root:www-data /etc/roundcube/config.inc.php
1459+
chmod 640 /etc/roundcube/debian-db-roundcube.php
1460+
chown root:www-data /etc/roundcube/debian-db-roundcube.php
1461+
chmod 640 /var/log/roundcube/errors
1462+
chown www-data:adm /var/log/roundcube/errors
14561463

14571464
r="$(gen_pass)"
14581465
mysql -e "CREATE DATABASE roundcube"
14591466
mysql -e "GRANT ALL ON roundcube.*
14601467
TO roundcube@localhost IDENTIFIED BY '$r'"
1461-
sed -i "s/%password%/$r/g" /etc/roundcube/db.inc.php
1462-
1463-
# Send all emails through SMTP and add user information
1464-
sed -i "/\$config\['smtp_server'\]/c\$config\['smtp_server'\] = 'localhost';" /etc/roundcube/main.inc.php
1465-
sed -i "/\$config\['smtp_user'\]/c\$config\['smtp_user'\] = '%u';" /etc/roundcube/main.inc.php
1466-
sed -i "/\$config\['smtp_pass'\]/c\$config\['smtp_pass'\] = '%p';" /etc/roundcube/main.inc.php
1467-
1468-
touch /var/log/roundcube/errors
1469-
chmod 640 /var/log/roundcube/errors
1470-
chown www-data:adm /var/log/roundcube/errors
1471-
if [ "$release" = '16.04' ] || [ "$release" = '18.04' ]; then
1472-
mv /etc/roundcube/db.inc.php /etc/roundcube/debian-db-roundcube.php
1473-
mv /etc/roundcube/main.inc.php /etc/roundcube/config.inc.php
1474-
fi
1475-
chmod 640 /etc/roundcube/debian-db*
1476-
chown root:www-data /etc/roundcube/debian-db*
1477-
1468+
sed -i "s/%password%/$r/g" /etc/roundcube/debian-db-roundcube.php
1469+
sed -i "s/localhost/$servername/g" /etc/roundcube/plugins/password/config.inc.php
14781470
mysql roundcube < /usr/share/dbconfig-common/data/roundcube/install/mysql
1471+
14791472
phpenmod mcrypt > /dev/null 2>&1
14801473
if [ "$apache" = 'yes' ]; then
14811474
service apache2 restart

0 commit comments

Comments
 (0)