4 # Heavily inspired by <https://docs-develop.pleroma.social/backend/installation/debian_based_en/>
6 if [ "$#" -ne 1 ]; then
7 echo 'Need domain name as argument.'
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
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
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