-
Notifications
You must be signed in to change notification settings - Fork 0
/
provision.sh
87 lines (72 loc) · 2.18 KB
/
provision.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
#!/usr/bin/env bash
echo ""
echo ""
echo " _____ _ _____ _____ _ _ "
echo " | __ \ | |/ ____/ ____| | | | "
echo " | |__) |_ _ _ __ ___| | (___| (___ | |__| | "
echo " | ___/ _' | '_ \ / _ \ |\___ \\___ \| __ | "
echo " | | | (_| | | | | __/ |____) |___) | | | | "
echo " |_| \__,_|_| |_|\___|_|_____/_____/|_| |_| "
echo ""
echo ""
echo ''
echo ' > ------------------------------------------------------------'
echo ' > Run script: provision.sh'
echo ' > Short link: https://git.io/panelssh-provision'
echo ' > Repository: https://github.com/panelssh/installer-script.git'
echo ' > Created by: Panel SSH <[email protected]>'
echo ' > ------------------------------------------------------------'
echo ''
# Update repository
echo ' > Upgrading apt repositories...'
apt -y update
# Install curl
echo ' > Install make...'
apt install -y curl
# Install make
echo ' > Install make...'
apt install -y make
# Install docker
echo ' > Install docker...'
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
# Install docker-compose
# See latest version at https://github.com/docker/compose/releases
DOCKER_COMPOSE_VERSION=1.29.2
curl -L "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
# Install htop
echo ' > Install Htop...'
apt install -y htop
# Install nginx
echo ' > Install nginx...'
apt install -y nginx
# Install certbot
echo ' > Install lets encrypt...'
apt install -y certbot python3-certbot-nginx
# Install doctl
echo ' > Install doctl...'
snap install doctl
snap connect doctl:dot-docker
# Setup firewall
echo ' > Setup firewall...'
sed -i "s|^IPV6=.*$|IPV6=yes|" /etc/default/ufw
ufw default deny incoming
ufw default allow outgoing
ufw allow 22
ufw allow 'Nginx Full'
echo 'y' | ufw enable
# Setup nginx default
echo ' > Setup nginx default configuration...'
cat > /etc/nginx/sites-enabled/default <<EOL
server {
listen 80 default_server;
listen [::]:80 default_server;
location / {
return 403;
}
}
EOL
# Restart nginx
echo ' > Restart nginx...'
service nginx restart