-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy-web.sh
executable file
·66 lines (41 loc) · 1.48 KB
/
deploy-web.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
#!/bin/bash
echo "Installing Nginx"
sudo apt -y install nginx ufw
echo "Setting up Firewall"
sudo ufw allow 22
sudo ufw allow 'Nginx Full'
echo "y" | sudo ufw enable
sudo ufw reload
sudo ufw status
echo "Setting up Hugo"
wget https://github.com/gohugoio/hugo/releases/download/v0.81.0/hugo_0.81.0_Linux-ARM64.deb
sudo dpkg -i hugo_0.81.0_Linux-ARM64.deb
rm hugo_0.81.0_Linux-ARM64.deb
echo "Clonning Webs"
cd /home/nazori/
pwd
git clone --recurse-submodules https://github.com/nazori-eu/nazori-web.git
git clone --recurse-submodules https://github.com/nazori-eu/btapes-site.git
read -p "Press enter to continue"
echo "Setting up Nginx"
sudo systemctl start nginx
sudo cp /home/nazori/web-setup/btapes.conf /etc/nginx/sites-available/
sudo cp /home/nazori/web-setup/nazori.conf /etc/nginx/sites-available/
sudo mkdir /var/www/btapes
sudo mkdir /var/www/nazori
sudo chown nazori /var/www/nazori
sudo chown nazori /var/www/btapes
read -p "Press enter to continue"
sudo ln -s /etc/nginx/sites-available/nazori.conf /etc/nginx/sites-enabled/
sudo ln -s /etc/nginx/sites-available/btapes.conf /etc/nginx/sites-enabled/
cd /home/nazori/btapes-site
./deploy-hugo.sh
cd /home/nazori/nazori-web
./deploy-hugo.sh
sudo systemctl reload nginx
read -p "Press enter to continue"
echo "Installing Cerbot"
sudo apt -y install certbot python3-certbot-nginx
sudo certbot --nginx
sudo systemctl restart nginx
crontab -l | { cat; echo "0 9 * * * certbot renew --post-hook "systemctl reload nginx""; } | crontab -