home · contact · privacy
Improve static website setup script.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 8 Oct 2023 23:47:11 +0000 (01:47 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 8 Oct 2023 23:47:11 +0000 (01:47 +0200)
bookworm/setup_scripts/setup_static_website.sh
bookworm/setup_scripts/setup_status.plomlompom.com.sh [deleted file]
bookworm/setup_scripts/setup_tube.plomlompom.com.sh [deleted file]

index 1b5da97db50ed9dffb452cb78497fdd8fc09128a..1ab6a18075137eb1afcff50c14eda28e9fdfd835 100755 (executable)
@@ -9,7 +9,7 @@ website_template="$1"
 shift 1
 
 mirror_ip=""
-mirror_state="not mirroring automatically"
+mirror_state="not mirroring automatically, since no IP given"
 domain="${website_template}"
 mail="plom+webmaster@plomlompom.com"
 if [ "$#" -gt 0 ]; then
diff --git a/bookworm/setup_scripts/setup_status.plomlompom.com.sh b/bookworm/setup_scripts/setup_status.plomlompom.com.sh
deleted file mode 100755 (executable)
index 726cffc..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/sh
-set -e
-. ./misc.sh
-
-expect_setup_finished_file setup_web_has_been_run setup_web.sh
-
-mirror_ip=""
-mirror_state="not mirroring automatically"
-domain="status.plomlompom.com"
-mail="plom+status@plomlompom.com"
-if [ "$#" -gt 0 ]; then
-    domain="$1"
-    if [ "$#" -gt 1 ]; then
-        mail="plom+testing@plomlompom.com"
-       if [ "$#" -gt 2 ]; then
-           mirror_ip="$3"
-            mirror_state="mirroring automatically from ${mirror_ip}"
-        fi
-    fi
-fi
-echo "Assuming domain ${domain} and letsencrypt support mail address ${mail} and ${mirror_state}, 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 
-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
-
-# 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
-
-if [ ! -z "${mirror_ip}" ]; then
-    # Set up connection to old server.
-    cp "${setup_scripts_dir}/misc.sh" /home/plom/
-    cp "${setup_scripts_dir}/prepare_to_meet_server.sh" /home/plom/
-    chown plom:plom /home/plom/prepare_to_meet_server.sh
-    su -lc "./prepare_to_meet_server.sh ${mirror_ip}" plom
-    read -p 'Hit Enter when you are done.' ignore
-    rm /home/plom/prepare_to_meet_server.sh
-
-    # Mirror dirs.
-    cp "${setup_scripts_dir}/mirror_dir.sh" /home/plom/
-    su -lc "./mirror_dir.sh ${mirror_ip} /var/www/status.plomlompom.com" plom
-    rm /home/plom/mirror_dir.sh
-    rm /home/plom/misc.sh
-fi
-
-service nginx restart
-
diff --git a/bookworm/setup_scripts/setup_tube.plomlompom.com.sh b/bookworm/setup_scripts/setup_tube.plomlompom.com.sh
deleted file mode 100755 (executable)
index 246f8bc..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/sh
-set -e
-. ./misc.sh
-
-expect_setup_finished_file setup_web_has_been_run setup_web.sh
-
-mirror_ip=""
-mirror_state="not mirroring automatically"
-domain="tube.plomlompom.com"
-mail="plom+tube@plomlompom.com"
-if [ "$#" -gt 0 ]; then
-    domain="$1"
-    if [ "$#" -gt 1 ]; then
-        mail="plom+testing@plomlompom.com"
-       if [ "$#" -gt 2 ]; then
-           mirror_ip="$3"
-            mirror_state="mirroring automatically from ${mirror_ip}"
-        fi
-    fi
-fi
-echo "Assuming domain ${domain} and letsencrypt support mail address ${mail} and ${mirror_state}, 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
-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
-
-# Prepare NGINX for tube.plomlompom.com.
-sed -i "s/REPLACE_fqdn_ECALPER/${domain}/g" /etc/nginx/sites-available/tube.plomlompom.com.nginx
-ln -s /etc/nginx/sites-available/tube.plomlompom.com.nginx /etc/nginx/sites-enabled/tube.plomlompom.com.nginx
-
-if [ ! -z "${mirror_ip}" ]; then
-    # Set up connection to old server.
-    cp "${setup_scripts_dir}/misc.sh" /home/plom/
-    cp "${setup_scripts_dir}/prepare_to_meet_server.sh" /home/plom/
-    chown plom:plom /home/plom/prepare_to_meet_server.sh
-    su -lc "./prepare_to_meet_server.sh ${mirror_ip}" plom
-    read -p 'Hit Enter when you are done.' ignore
-    rm /home/plom/prepare_to_meet_server.sh
-
-    # Mirror dirs.
-    cp "${setup_scripts_dir}/mirror_dir.sh" /home/plom/
-    su -lc "./mirror_dir.sh ${mirror_ip} /var/www/tube.plomlompom.com" plom
-    rm /home/plom/mirror_dir.sh
-    rm /home/plom/misc.sh
-fi
-
-service nginx restart
-