2014-06-04 23:39:58 +00:00
|
|
|
# -*- mode: ruby -*-
|
|
|
|
# vi: set ft=ruby :
|
|
|
|
|
|
|
|
Vagrant.configure("2") do |config|
|
2020-04-11 18:12:40 +00:00
|
|
|
# Recreate our conditions
|
|
|
|
config.vm.box = "generic/debian10"
|
|
|
|
config.vm.provider "hyperv" do |v|
|
|
|
|
v.memory = 1024
|
|
|
|
v.cpus = 1
|
|
|
|
end
|
2017-01-15 15:47:36 +00:00
|
|
|
|
2014-06-06 12:20:26 +00:00
|
|
|
# Network config: Since it's a mail server, the machine must be connected
|
|
|
|
# to the public web. However, we currently don't want to expose SSH since
|
|
|
|
# the machine's box will let anyone log into it. So instead we'll put the
|
|
|
|
# machine on a private network.
|
2016-12-20 21:32:06 +00:00
|
|
|
config.vm.hostname = "mailinabox.lan"
|
2014-06-06 12:20:26 +00:00
|
|
|
config.vm.network "private_network", ip: "192.168.50.4"
|
2014-06-04 23:39:58 +00:00
|
|
|
|
|
|
|
config.vm.provision :shell, :inline => <<-SH
|
2018-09-03 16:52:03 +00:00
|
|
|
# Set environment variables so that the setup script does
|
|
|
|
# not ask any questions during provisioning. We'll let the
|
|
|
|
# machine figure out its own public IP.
|
2014-08-25 11:54:11 +00:00
|
|
|
export NONINTERACTIVE=1
|
2014-06-07 18:55:57 +00:00
|
|
|
export PUBLIC_IP=auto
|
2014-06-08 22:32:52 +00:00
|
|
|
export PUBLIC_IPV6=auto
|
2016-11-30 17:55:18 +00:00
|
|
|
export PRIMARY_HOSTNAME=auto
|
2018-01-15 15:33:05 +00:00
|
|
|
#export SKIP_NETWORK_CHECKS=1
|
2014-06-04 23:39:58 +00:00
|
|
|
|
2020-07-03 18:01:16 +00:00
|
|
|
if [ ! git ]
|
|
|
|
then
|
|
|
|
apt update
|
|
|
|
apt install git
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -d /mailinabox ];
|
|
|
|
then
|
|
|
|
git clone https://github.com/ddavness/power-mailinabox.git /mailinabox
|
|
|
|
fi
|
|
|
|
|
2014-06-04 23:39:58 +00:00
|
|
|
# Start the setup script.
|
2020-07-03 18:01:16 +00:00
|
|
|
cd /mailinabox
|
|
|
|
git checkout development
|
|
|
|
git pull
|
|
|
|
|
2014-06-04 23:39:58 +00:00
|
|
|
setup/start.sh
|
|
|
|
SH
|
|
|
|
end
|