-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.sh
executable file
·52 lines (41 loc) · 1.83 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
#!/usr/bin/env bash
# shellcheck disable=SC2154
export DEBIAN_FRONTEND="noninteractive"
sudo apt update -y
sudo apt install python3.8 git nginx certbot python3-pip tesseract-ocr tesseract-ocr-eng -y
sudo wget https://github.com/tesseract-ocr/tessdata/blob/master/eng.traineddata?raw=true -O /usr/share/tesseract-ocr/4.00/tessdata/eng.traineddata
sudo certbot certonly --noninteractive --webroot --webroot-path /var/www/html --agree-tos --email [email protected] --domain poseidon.thescriptgroup.in
cat << EOF | sudo tee /etc/nginx/sites-available/poseidon.thescriptgroup.in
server {
listen 80;
server_name poseidon.thescriptgroup.in;
return 301 https://poseidon.thescriptgroup.in;
}
server {
listen 443 ssl;
server_name poseidon.thescriptgroup.in;
ssl_certificate /etc/letsencrypt/live/poseidon.thescriptgroup.in/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/poseidon.thescriptgroup.in/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
location ^~ /.well-known/acme-challenge/ {
root /var/www/html;
}
location /static {
root /home/deploy/Poseidon;
try_files \$uri \$uri/ =404;
}
location ^~ / {
add_header 'Access-Control-Allow-Origin' '*';
proxy_pass http://127.0.0.1:5501;
proxy_redirect off;
proxy_set_header Host \$host;
proxy_set_header X-Real-IP \$remote_addr;
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto \$scheme;
}
}
EOF
sudo ln -s /etc/nginx/sites-available/poseidon.thescriptgroup.in /etc/nginx/sites-enabled/poseidon.thescriptgroup.in
sudo rm -fv /etc/nginx/sites-{available,enabled}/default
sudo nginx -s reload