From acae5dcd7a2d76776f6fa78ced6323b744c0ddef Mon Sep 17 00:00:00 2001 From: Daniel Winzen Date: Sun, 2 Jun 2024 13:20:53 +0200 Subject: [PATCH] Add more install steps --- install_binaries.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/install_binaries.sh b/install_binaries.sh index d8d2de6..ebffaed 100755 --- a/install_binaries.sh +++ b/install_binaries.sh @@ -21,6 +21,16 @@ if [ ! -e /etc/mysql/encryption/keyfile.enc ]; then openssl rand -hex 128 > /etc/mysql/encryption/keyfile.key echo "1;"$(openssl rand -hex 32) | openssl enc -aes-256-cbc -md sha1 -pass file:/etc/mysql/encryption/keyfile.key -out /etc/mysql/encryption/keyfile.enc fi +# dovecot encryption +if [ ! -e /etc/dovecot/ecprivkey.pem ]; then + mkdir -p /etc/dovecot/ + openssl ecparam -name secp521r1 -genkey | openssl pkey -out /etc/dovecot/ecprivkey.pem + openssl pkey -in /etc/dovecot/ecprivkey.pem -pubout -out /etc/dovecot/ecpubkey.pem +fi +# postifx certificates +if [ ! -e /etc/postfix/danwin1210-mail.chain ]; then + openssl req -x509 -nodes -days 3650 -newkey ed448 -keyout /etc/postfix/danwin121-mail.key -out /etc/postfix/danwin1210-mail.crt && cat /etc/postfix/danwin1210-mail.key >> /etc/postfix/danwin1210-mail.chain && cat /etc/postfix/danwin1210-mail.crt >> /etc/postfix/danwin1210-mail.chain +fi #install scripts mkdir -p /var/www/mail @@ -46,6 +56,15 @@ else git pull fi +# install snappymail +mkdir -p /var/www/mail/www/snappymail +cd /var/www/mail/www/snappymail +VERSION=$(curl -s https://api.github.com/repos/the-djmaze/snappymail/releases/latest | grep tag_name | cut -d '"' -f 4) +wget https://github.com/the-djmaze/snappymail/releases/download/${VERSION}/snappymail-${VERSION:1}.zip +unzip -o snappymail-${VERSION:1}.zip +mkdir -p /var/local/snappymail +chown www-data:www-data -R /var/local/snappymail + # copy configuration file cd $workingdir if [ ! -e /var/www/mail/common_config.php ]; then