mirror of
https://git.myvelabs.com/docker/myvemail.git
synced 2025-12-18 18:56:19 +00:00
57 lines
2.3 KiB
Bash
57 lines
2.3 KiB
Bash
|
|
#!/usr/bin/env bash
|
||
|
|
# Roundcube
|
||
|
|
if [ ! -f /usr/share/webapps/roundcube/config/config.inc.php ]
|
||
|
|
then
|
||
|
|
|
||
|
|
echo "<?php
|
||
|
|
\$config['db_dsnw'] = 'mysql://${MYVEMAIL_ROUNDCUBE_DBUSER}:${MYVEMAIL_ROUNDCUBE_DBPASS}@localhost/${MYVEMAIL_ROUNDCUBE_DBNAME}';
|
||
|
|
|
||
|
|
\$config['imap_host'] = 'ssl://${MYVEMAIL_SUBDOMAIN}.${MYVEMAIL_DOMAIN}';
|
||
|
|
\$config['default_port'] = 993;
|
||
|
|
|
||
|
|
\$config['smtp_host'] = 'tls://${MYVEMAIL_SUBDOMAIN}.${MYVEMAIL_DOMAIN}';
|
||
|
|
\$config['product_name'] = '${MYVEMAIL_SUBDOMAIN}.${MYVEMAIL_DOMAIN}';
|
||
|
|
|
||
|
|
\$config['create_default_folders'] = true;
|
||
|
|
\$config['support_url'] = '';
|
||
|
|
|
||
|
|
\$config['des_key'] = '$(cat /dev/urandom | tr -d -c 'a-zA-Z0-9' | fold -w 24 | head -n 1)';
|
||
|
|
|
||
|
|
\$config['plugins'] = [$(printf "'%s', " $(ls /usr/share/webapps/roundcube/plugins | grep -v 'enigma\|database_attachments\|managesieve\|redundant_attachments') | sed "s/\(.*\), /\1/")];" | tee /usr/share/webapps/roundcube/config/config.inc.php >/dev/null
|
||
|
|
|
||
|
|
# Password plugin
|
||
|
|
roundcubepass_strength_drive=$(cat /dev/urandom | tr -d -c 'a-z' | fold -w 8 | head -n 1)
|
||
|
|
sed -e "/^\$config\['password_db_dsn'\]/ s|=.*|= 'mysql://${MYVEMAIL_POSTFIXADMIN_DBUSER}:${MYVEMAIL_POSTFIXADMIN_DBPASS}@localhost/${MYVEMAIL_POSTFIXADMIN_DBNAME}';|" \
|
||
|
|
-e "/^\$config\['password_strength_driver'\]/ s/=.*/= '${roundcubepass_strength_drive}';\\
|
||
|
|
\$config['password_"${roundcubepass_strength_drive}"_min_score'] = 5;/" \
|
||
|
|
-i /usr/share/webapps/roundcube/plugins/password/config.inc.php
|
||
|
|
|
||
|
|
fi
|
||
|
|
|
||
|
|
# Permissions
|
||
|
|
setfacl -R -m u:${MYVEMAIL_NGINX_USERGROUP}:rwx /usr/share/webapps/postfixadmin/templates_c/
|
||
|
|
chown ${MYVEMAIL_NGINX_USERGROUP}:${MYVEMAIL_NGINX_USERGROUP} /usr/share/webapps/roundcube/{temp,logs}/ -R
|
||
|
|
chown ${MYVEMAIL_NGINX_USERGROUP}:${MYVEMAIL_NGINX_USERGROUP} /usr/share/webapps/roundcube/plugins/password/config.inc.php
|
||
|
|
chmod 0600 /usr/share/webapps/roundcube/plugins/password/config.inc.php
|
||
|
|
|
||
|
|
# Start services
|
||
|
|
/usr/sbin/php-fpm* -D
|
||
|
|
nginx
|
||
|
|
|
||
|
|
# <<- ##appendix
|
||
|
|
# \$config['imap_conn_options'] = array(
|
||
|
|
# 'ssl' => array(
|
||
|
|
# 'verify_peer' => true,
|
||
|
|
# 'verify_peer_name' => true,
|
||
|
|
# 'allow_self_signed' => true,
|
||
|
|
# ),
|
||
|
|
# );
|
||
|
|
#
|
||
|
|
# \$config['smtp_conn_options'] = array(
|
||
|
|
# 'ssl' => array(
|
||
|
|
# 'verify_peer' => true,
|
||
|
|
# 'verify_peer_name' => true,
|
||
|
|
# 'allow_self_signed' => true,
|
||
|
|
# ),
|
||
|
|
# );
|
||
|
|
# ##appendix
|