From 7f8ab8cff7b311ce7a8d6fa2e3979e56c29a2a7a Mon Sep 17 00:00:00 2001
From: Christian Heller <c.heller@plomlompom.de>
Date: Thu, 13 Dec 2018 22:25:36 +0100
Subject: [PATCH] Use clear password files for HTTP basic auth on IRC logs.

---
 all_new_2018/setup_plomlombot.sh               | 2 +-
 all_new_2018/user_scripts/plomlombot_daemon.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/all_new_2018/setup_plomlombot.sh b/all_new_2018/setup_plomlombot.sh
index 4562588..fa8eab2 100755
--- a/all_new_2018/setup_plomlombot.sh
+++ b/all_new_2018/setup_plomlombot.sh
@@ -13,7 +13,7 @@ irclogs_dir=/var/www/html/irclogs
 irclogs_pw_dir=/var/www/irclogs_pw
 cp "${config_tree_prefix}"/user_scripts/plomlombot_daemon.sh /home/plom/
 chown plom:plom /home/plom/plomlombot_daemon.sh
-apt -y install screen python3-venv gpg dirmngr apache2-utils
+apt -y install screen python3-venv gpg dirmngr
 su plom -c "gpg --recv-key ${gpg_key}"
 # TODO: After this, we could in theory remove dirmngr if we only installed it just now.
 su plom -c "cd && git clone /var/public_repos/plomlombot-irc"
diff --git a/all_new_2018/user_scripts/plomlombot_daemon.sh b/all_new_2018/user_scripts/plomlombot_daemon.sh
index df4f49d..b7054e1 100755
--- a/all_new_2018/user_scripts/plomlombot_daemon.sh
+++ b/all_new_2018/user_scripts/plomlombot_daemon.sh
@@ -39,7 +39,7 @@ while true; do
     	        # FIXME: Note the trouble we will have if we have the same channel
     	        # name on different servers …
                 ln -sfn "${logs_dir}" "${irclogs_dir}/${shortened_channel_name}"
-                htpasswd -c "${irclogs_pw_dir}/${shortened_channel_name}" "${login_user}" "${login_pw}"
+                echo "${login_user}":'{PLAIN}'"${login_pw}" > "${irclogs_pw_dir}/${shortened_channel_name}"
 
     	    # If "key:" line, encrypt old raw logs to that GPG key.
     	    elif [ "${first_word}" = "gpg_key": ]; then
-- 
2.30.2