-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
62 lines (45 loc) · 1.38 KB
/
install.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
# !/bin/bash
PACMAN_PARALLELDOWNLOADS=5
pacman-key --init \
&& pacman-key --populate archlinux \
&& sed 's/ParallelDownloads = \d+/ParallelDownloads = ${PACMAN_PARALLELDOWNLOADS}/g' -i /etc/pacman.conf \
&& sed 's/NoProgressBar/#NoProgressBar/g' -i /etc/pacman.conf \
&& sed -i 's/^Server = https:\/\/.*/Server = https:\/\/archlinux.c3sl.ufpr.br\/$repo\/os\/$arch/' /etc/pacman.d/mirrorlist
# Update system
pacman -Syyuu --noconfirm \
; pacman -Rns $(pacman -Qtdq) \
; pacman -Scc --noconfirm \
; rm -Rf /var/cache/pacman/pkg/*
if [ ! -d "gitlab" ]
then
mkdir -p gitlab/{config,data,logs,ssl}
fi
if [ ! -d "gitlab-runner" ]
then
mkdir -p gitlab-runner/{config,ssl}
fi
if [ ! -d "tmp" ]
then
mkdir -p tmp/ssl
fi
# Install Docker
pacman -S --noconfirm \
docker \
docker-compose
systemctl start docker.service
systemctl enable docker.service
sudo usermod -aG docker $USER
# Generate certificates for https
openssl genrsa -out tmp/ssl/ca.key 4096
openssl req -new -x509 -days 3650 \
-key tmp/ssl/ca.key \
-out tmp/ssl/ca.crt
openssl req -newkey rsa:4096 -nodes \
-keyout tmp/ssl/server.key \
-out tmp/ssl/server.csr
openssl x509 -req -extfile <(printf "subjectAltName=DNS:githomelab,DNS:githomelab.local") \
-days 3650 \
-in tmp/ssl/server.csr \
-CA tmp/ssl/ca.crt \
-CAkey tmp/ssl/ca.key \
-CAcreateserial -out tmp/ssl/server.crt