1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2024-11-26 02:57:04 +00:00
mailinabox/setup/bootstrap.sh

52 lines
1.1 KiB
Bash
Raw Normal View History

#!/bin/bash
#########################################################
# This script is intended to be run like this:
#
2014-09-21 20:37:04 +00:00
# curl https://.../bootstrap.sh | sudo bash
#
#########################################################
if [ -z "$TAG" ]; then
Version 0.08 CHANGELOG ========= v0.08 (April 1, 2015) --------------------- Mail: * The Roundcube vacation_sieve plugin by @arodier is now installed to make it easier to set vacation auto-reply messages from within Roundcube. * Authentication-Results headers for DMARC, added in v0.07, were mistakenly added for outbound mail --- that's now removed. * The Trash folder is now created automatically for new mail accounts, addressing a Roundcube error. DNS: * Custom DNS TXT records were not always working and they can now override the default SPF, DKIM, and DMARC records. System: * ownCloud updated to version 8.0.2. * Brute-force SSH and IMAP login attempts are now prevented by properly configuring fail2ban. * Status checks are run each night and any changes from night to night are emailed to the box administrator (the first user account). Control panel: * The new check that system services are running mistakenly checked that the Dovecot Managesieve service is publicly accessible. Although the service binds to the public network interface we don't open the port in ufw. On some machines it seems that ufw blocks the connection from the status checks (which seems correct) and on some machines (mine) it doesn't, which is why I didn't notice the problem. * The current backup chain will now try to predict how many days until it is deleted (always at least 3 days after the next full backup). * The list of aliases that forward to a user are removed from the Mail Users page because when there are many alises it is slow and times-out. * Some status check errors are turned into warnings, especially those that might not apply if External DNS is used.
2015-04-01 14:14:34 +00:00
TAG=v0.08
fi
# Are we running as root?
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root. Did you leave out sudo?"
exit
fi
# Clone the Mail-in-a-Box repository if it doesn't exist.
if [ ! -d $HOME/mailinabox ]; then
2014-09-21 20:37:04 +00:00
echo Installing git . . .
DEBIAN_FRONTEND=noninteractive apt-get -q -q install -y git < /dev/null
echo
2014-09-21 20:37:04 +00:00
echo Downloading Mail-in-a-Box $TAG. . .
git clone \
-b $TAG --depth 1 \
https://github.com/mail-in-a-box/mailinabox \
$HOME/mailinabox \
< /dev/null 2> /dev/null
echo
fi
# Change directory to it.
cd $HOME/mailinabox
# Update it.
if [ "$TAG" != `git describe` ]; then
echo Updating Mail-in-a-Box to $TAG . . .
git fetch --depth 1 --force --prune origin tag $TAG
if ! git checkout -q $TAG; then
echo "Update failed. Did you modify something in `pwd`?"
exit
fi
echo
fi
# Start setup script.
setup/start.sh
2014-09-21 20:37:04 +00:00