forked from compiler-explorer/infra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
78 lines (69 loc) · 1.64 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
set -exuo pipefail
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
env EXTRA_NFS_ARGS=",ro" "${DIR}/setup-common.sh"
apt-get -y update
apt-get -y install software-properties-common
dpkg --add-architecture i386
curl -s https://dl.winehq.org/wine-builds/winehq.key | apt-key add -
# TODO at some point see if we can upgrade wine
apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main'
apt-get install -y \
binutils-multiarch \
bison \
bzip2 \
cgroup-tools \
curl \
dos2unix \
file \
flex \
g++ \
gawk \
gcc \
gnat \
jq \
libapparmor-dev \
libc6-dev-i386 \
libdatetime-perl \
libelf-dev \
libprotobuf-dev \
libnl-route-3-dev \
libwww-perl \
linux-libc-dev \
make \
nfs-common \
nginx \
patch \
pkg-config \
protobuf-compiler \
python3-pip \
s3cmd \
subversion \
texinfo \
unzip \
wget \
winehq-stable=4.0.3~bionic \
wine-stable=4.0.3~bionic \
wine-stable-amd64=4.0.3~bionic \
wine-stable-i386=4.0.3~bionic \
xz-utils
pushd /tmp
git clone https://github.com/apmorton/firejail.git
cd firejail
git checkout 0.9.58.2-ce-patch.1
./configure --enable-apparmor
make "-j$(nproc)"
make install
popd
pushd /tmp
git clone --recursive --branch 2.9 https://github.com/google/nsjail.git
cd nsjail
make "-j$(nproc)"
cp nsjail /usr/local/bin/nsjail
popd
cp nginx/nginx.conf /etc/nginx/nginx.conf
systemctl restart nginx
cp /infra/init/compiler-explorer.service /lib/systemd/system/compiler-explorer.service
systemctl daemon-reload
systemctl enable compiler-explorer
adduser --system --group ce