forked from compiler-explorer/infra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-node.sh
101 lines (88 loc) · 2.26 KB
/
setup-node.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/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 -
apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ jammy main'
add-apt-repository ppa:deadsnakes/ppa
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 \
libgmp3-dev \
libnl-route-3-dev \
libprotobuf-dev \
libwww-perl \
linux-libc-dev \
make \
nfs-common \
nginx \
patch \
pkg-config \
protobuf-compiler \
python-is-python3 \
python3-pip \
python3-venv \
python3.8 \
s3cmd \
subversion \
texinfo \
unzip \
wget \
winehq-stable \
wine-stable \
wine-stable-amd64 \
wine-stable-i386 \
xz-utils
pushd /tmp
git clone https://github.com/apmorton/firejail.git firejail-apmorton
cd firejail-apmorton
git checkout 0.9.58.2-ce-patch.1
./configure --enable-apparmor --prefix /usr/local/firejail-0.9.58.2-ce-patch.1
make "-j$(nproc)"
make install
popd
ln -s /usr/local/firejail-0.9.58.2-ce-patch.1/bin/firejail /usr/local/bin
pushd /tmp
git clone https://github.com/netblue30/firejail.git
cd firejail
git checkout 0.9.70
./configure --enable-apparmor --prefix /usr/local/firejail-0.9.70
make "-j$(nproc)"
make install
popd
pushd /tmp
git clone --recursive --branch ce https://github.com/compiler-explorer/nsjail.git
cd nsjail
make "-j$(nproc)"
cp nsjail /usr/local/bin/nsjail
popd
pushd /opt
# node.js
TARGET_NODE_VERSION=v20.15.0
echo "Installing node ${TARGET_NODE_VERSION}"
curl -sL "https://nodejs.org/dist/${TARGET_NODE_VERSION}/node-${TARGET_NODE_VERSION}-linux-x64.tar.xz" | tar xJf - && mv node-${TARGET_NODE_VERSION}-linux-x64 node
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