#!/usr/bin/env bash # # Scripts in this directory are run during the build process. # each script will be uploaded to /tmp on your build droplet, # given execute permissions and run. The cleanup process will # remove the scripts from your build system after they have run # if you use the build_image task. # set -x echo 'APT::Install-Recommends 0;' >>/etc/apt/apt.conf.d/01norecommends && echo 'APT::Install-Suggests 0;' >>/etc/apt/apt.conf.d/01norecommends && apt-get -q update && apt-get -q install locales && locale-gen en_US.UTF-8 && DEBIAN_FRONTEND=noninteractive apt-get -qy -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold" dist-upgrade wget https://download.zulip.com/server/zulip-server-latest.tar.gz tar -xf zulip-server-latest.tar.gz array=(./zulip-server-*) "${array[0]}"/scripts/setup/install --email=mail@example.com --hostname "$(hostname -f)" --no-init-db --self-signed-cert rm -f /etc/zulip/zulip-secrets.conf /etc/zulip/settings.py rm -f /var/lib/rabbitmq/.erlang.cookie # This triggers the regeneration of the Erlang cookie, and the # rabbitmq users. echo >>/etc/rabbitmq/rabbitmq-env.conf # Remove unnessary messages set by Ubuntu that appears during user login. rm -f /etc/update-motd.d/00-header rm -f /etc/update-motd.d/10-help-text rm -f /etc/update-motd.d/51-cloudguest # Configure firewall. Else, img_check.sh will warn that ufw is not configured. ufw allow ssh ufw allow http ufw allow https # Used by Zulip's incoming email gateway. For more details see https://zulip.readthedocs.io/en/latest/production/email-gateway.html ufw allow 25 # The --force prevents an interactive prompt ufw --force enable systemctl enable ufw