From 86c8c5a33772bfc98d0889980f1bf1fb399a95a2 Mon Sep 17 00:00:00 2001
From: Christian Heller <c.heller@plomlompom.de>
Date: Wed, 13 Sep 2023 20:35:00 +0200
Subject: [PATCH] Improve websites server setup.

---
 bookworm/setup_scripts/init_user_login.sh             | 3 +++
 bookworm/setup_scripts/setup_status.plomlompom.com.sh | 8 ++++++++
 bookworm/setup_scripts/setup_tube.plomlompom.com.sh   | 8 ++++++++
 3 files changed, 19 insertions(+)

diff --git a/bookworm/setup_scripts/init_user_login.sh b/bookworm/setup_scripts/init_user_login.sh
index aa8a03f..820b5ab 100755
--- a/bookworm/setup_scripts/init_user_login.sh
+++ b/bookworm/setup_scripts/init_user_login.sh
@@ -18,6 +18,9 @@ local_path_sshd_config="${linkable_files_dir}${system_path_sshd_config}"
 expect_n_args 1 "(server)" "$@"
 server="$1"
 
+# If we already knew that host …
+ssh-keygen -f "/home/plom/.ssh/known_hosts" -R "${server}"
+
 # So we're only asked once …
 eval $(ssh-agent)
 ssh-add
diff --git a/bookworm/setup_scripts/setup_status.plomlompom.com.sh b/bookworm/setup_scripts/setup_status.plomlompom.com.sh
index a637b09..e5db211 100755
--- a/bookworm/setup_scripts/setup_status.plomlompom.com.sh
+++ b/bookworm/setup_scripts/setup_status.plomlompom.com.sh
@@ -6,9 +6,17 @@ expect_setup_finished_file setup_web_has_been_run setup_web.sh
 
 if [ -z "$1" ]; then
     domain="status.plomlompom.com"
+    mail="plom+status@plomlompom.com"
+elif [ "$#" -lt 2 ]; then
+    domain="$1"
+    mail="plom+testing@plomlompom.com"
 else
     domain="$1"
+    mail="$2"
 fi
+echo "Assuming domain ${domain} and letsencrypt support mail address ${mail}, abort and provide as arguments in this order if other desired! (Otherwise just hit Return.)"
+read
+
 # Install configs, set up firewall.
 ./install_for_target.sh status.plomlompom.com
 ./copy_dirtree.sh "${config_tree_prefix}/etc_files" "" status.plomlompom.com 
diff --git a/bookworm/setup_scripts/setup_tube.plomlompom.com.sh b/bookworm/setup_scripts/setup_tube.plomlompom.com.sh
index cf124fe..8833de0 100755
--- a/bookworm/setup_scripts/setup_tube.plomlompom.com.sh
+++ b/bookworm/setup_scripts/setup_tube.plomlompom.com.sh
@@ -6,9 +6,17 @@ expect_setup_finished_file setup_web_has_been_run setup_web.sh
 
 if [ -z "$1" ]; then
     domain="tube.plomlompom.com"
+    mail="plom+tube@plomlompom.com"
+elif [ "$#" -lt 2 ]; then
+    domain="$1"
+    mail="plom+testing@plomlompom.com"
 else
     domain="$1"
+    mail="$2"
 fi
+echo "Assuming domain ${domain} and letsencrypt support mail address ${mail}, abort and provide as arguments in this order if other desired! (Otherwise just hit Return.)"
+read
+
 # Install configs, set up firewall.
 ./install_for_target.sh tube.plomlompom.com
 ./copy_dirtree.sh "${config_tree_prefix}/etc_files" "" tube.plomlompom.com
-- 
2.30.2