X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/balance?a=blobdiff_plain;f=bookworm%2Fsetup_scripts%2Fsetup_web.sh;h=4b1e93f1196628f5329be670aa2823a37953d3cc;hb=532fa439a92bac271690e1cc90314c8c53a07bb5;hp=ea4e30508d8be803aed615aa10f2878161ab0424;hpb=b2689a62b11cf9a4423ac51af582a12a17a781a0;p=config diff --git a/bookworm/setup_scripts/setup_web.sh b/bookworm/setup_scripts/setup_web.sh index ea4e305..4b1e93f 100755 --- a/bookworm/setup_scripts/setup_web.sh +++ b/bookworm/setup_scripts/setup_web.sh @@ -1,12 +1,18 @@ #!/bin/sh set -e +. ./misc.sh expect_n_args 1 "(domain name)" "$@" domain="$1" +if [ ! -f "$HOME/setup_server_has_been_run" ]; then + echo "First need to run setup_server.sh." + false +fi + # Install configs, set up firewall. -./install_for_target.sh web -./copy_dirtree.sh "${config_tree_prefix}/etc_files" "" web +./install_for_target.sh web static_websites +./copy_dirtree.sh "${config_tree_prefix}/etc_files" "" web static_websites nft -f /etc/nftables.conf # Set up letsencrypt certificate. TODO: Is it auto-renewed? @@ -14,8 +20,8 @@ ln -sf /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default certbot --nginx --agree-tos --redirect --no-eff-email -m "${mail}" -d "${domain}" rm /etc/nginx/sites-enabled/default -# Prepare NGINX. -sed -i "s/REPLACE_fqdn_ECALPER/${domain}/g" /etc/nginx/sites-available/dumpsite.nginx -ln -s /etc/nginx/sites-available/dumpsite.nginx /etc/nginx/sites-enabled/dumpsite.nginx +# Prepare NGINX for status.plomlompom.com. +sed -i "s/REPLACE_fqdn_ECALPER/${domain}/g" /etc/nginx/sites-available/status.plomlompom.com.nginx +ln -s /etc/nginx/sites-available/status.plomlompom.com.nginx /etc/nginx/sites-enabled/status.plomlompom.com.nginx service nginx restart