home · contact · privacy
Fix.
[config] / buster / setup_scripts / setup_web_static.sh
1 #!/bin/sh
2 set -e
3 set -x
4 # Heavily inspired by <https://docs-develop.pleroma.social/backend/installation/debian_based_en/>
5
6 if [ "$#" -ne 1 ]; then
7     echo 'Need domain name as argument.'
8     false
9 fi
10 domain="$1"
11
12 # Install configs, set up firewall.
13 config_tree_prefix="${HOME}/config/buster"
14 ./install_for_target.sh web
15 ./copy_dirtree.sh "${config_tree_prefix}/etc_files" "" web web_static
16 nft -f /etc/nftables.conf
17
18 # Set up letsencrypt certificate. TODO: Is it auto-renewed?
19 ln -sf /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default
20 certbot --nginx --agree-tos --redirect --no-eff-email -m "${mail}" -d "${domain}"
21 rm /etc/nginx/sites-enabled/default
22
23 # Prepare NGINX config for Pleroma.
24 sed -i "s/REPLACE_fqdn_ECALPER/${domain}/g" /etc/nginx/sites-available/static.nginx
25 ln -s /etc/nginx/sites-available/static.nginx /etc/nginx/sites-enabled/static.nginx
26
27 service nginx restart