X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=bookworm%2Fsetup_scripts%2Fsetup_web.sh;h=a2e672f684899ce51620f7ba1090cb91192a900c;hb=4511a2b60887c56bd12a2640e3a2e532491c39f4;hp=4b1e93f1196628f5329be670aa2823a37953d3cc;hpb=532fa439a92bac271690e1cc90314c8c53a07bb5;p=config diff --git a/bookworm/setup_scripts/setup_web.sh b/bookworm/setup_scripts/setup_web.sh index 4b1e93f..a2e672f 100755 --- a/bookworm/setup_scripts/setup_web.sh +++ b/bookworm/setup_scripts/setup_web.sh @@ -2,26 +2,25 @@ set -e . ./misc.sh +expect_setup_finished_file setup_server_has_been_run setup_server.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 static_websites -./copy_dirtree.sh "${config_tree_prefix}/etc_files" "" web static_websites +./install_for_target.sh web +./copy_dirtree.sh "${config_tree_prefix}/etc_files" "" web nft -f /etc/nftables.conf -# Set up letsencrypt certificate. TODO: Is it auto-renewed? -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 +# # Set up letsencrypt certificate. TODO: Is it auto-renewed? +# 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 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 +# # 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 -service nginx restart +touch "$HOME/setup_web_has_been_run"