Skip to content

Commit cee6fe3

Browse files
joshuadugieColdHeat
authored andcommitted
Fix several issues in Vagrant provisioning (CTFd#1046)
* Fixes to Vagrantfile
1 parent 7a7595c commit cee6fe3

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

Vagrantfile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
# -*- mode: ruby -*-
22
# vi: set ft=ruby :
33

4-
# Install tmux and virtualenv to support development
4+
# Install tmux, virtualenv, and mariadb-server to support development
55
$preProvision= <<SCRIPT
6-
sudo apt-get install tmux virtualenvwrapper mariadb-server -y
6+
# Prevent attempt to access stdin, causing dpkg-reconfigure error output
7+
export DEBIAN_FRONTEND=noninteractive
8+
apt-get install -y tmux virtualenvwrapper
9+
10+
# As per instructions at https://downloads.mariadb.org/mariadb/repositories
11+
apt-get install -y software-properties-common
12+
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 2>&1
13+
add-apt-repository -y 'deb [arch=amd64,arm64,i386,ppc64el] http://mirror.lstn.net/mariadb/repo/10.4/ubuntu xenial main'
14+
apt-get update
15+
apt-get install -y mariadb-server
716
SCRIPT
817

918
# Wrap provisioning script with a virutalenv for pip packages
@@ -59,6 +68,6 @@ Vagrant.configure("2") do |config|
5968
run: "always"
6069

6170
# Install docker (convenience)
62-
config.vm.provision "shell", path: "scripts/install_docker_ubuntu.sh"
71+
config.vm.provision "shell", path: "scripts/install_docker.sh", privileged: false
6372

6473
end

prepare.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
sudo apt-get update
3-
sudo apt-get install build-essential python-dev python-pip libffi-dev -y
3+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential python-dev python-pip libffi-dev
44
pip install -r requirements.txt

scripts/install_docker_ubuntu.sh renamed to scripts/install_docker.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
# per: https://docs.docker.com/engine/installation/linux/debian/#install-docker-ce
55

66
# Install packages to allow apt to use a repository over HTTPS
7-
sudo apt-get install -y \
8-
python-pip
7+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y \
8+
python-pip \
99
apt-transport-https \
1010
ca-certificates \
1111
curl \
@@ -25,14 +25,14 @@ sudo add-apt-repository \
2525
sudo apt-get update
2626

2727
# Install the latest version of Docker
28-
sudo apt-get install -y docker-ce
28+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y docker-ce
2929

3030
# Add user to the docker group
3131
# Warning: The docker group grants privileges equivalent to the root user.
32-
sudo usermod -aG docker ubuntu
32+
sudo usermod -aG docker ${USER}
3333

3434
# Configure Docker to start on boot
3535
sudo systemctl enable docker
3636

3737
# Install docker-compose
38-
sudo pip install docker-compose
38+
pip install docker-compose

0 commit comments

Comments
 (0)