home · contact · privacy
a637b099f1f2f445818370ddf0c41f05c668db1a
[config] / bookworm / setup_scripts / setup_status.plomlompom.com.sh
1 #!/bin/sh
2 set -e
3 . ./misc.sh
4
5 expect_setup_finished_file setup_web_has_been_run setup_web.sh
6
7 if [ -z "$1" ]; then
8     domain="status.plomlompom.com"
9 else
10     domain="$1"
11 fi
12 # Install configs, set up firewall.
13 ./install_for_target.sh status.plomlompom.com
14 ./copy_dirtree.sh "${config_tree_prefix}/etc_files" "" status.plomlompom.com 
15 nft -f /etc/nftables.conf
16
17 # Set up letsencrypt certificate. TODO: Is it auto-renewed?
18 ln -sf /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default
19 certbot --nginx --agree-tos --redirect --no-eff-email -m "${mail}" -d "${domain}"
20 rm /etc/nginx/sites-enabled/default
21
22 # Prepare NGINX for status.plomlompom.com.
23 sed -i "s/REPLACE_fqdn_ECALPER/${domain}/g" /etc/nginx/sites-available/status.plomlompom.com.nginx
24 ln -s /etc/nginx/sites-available/status.plomlompom.com.nginx /etc/nginx/sites-enabled/status.plomlompom.com.nginx
25
26 service nginx restart
27