set -x
# Heavily inspired by <https://docs-develop.pleroma.social/backend/installation/debian_based_en/>
-if [ "$#" -ne 3 ]; then
- echo 'Need domain name and mail and old server IP as argument.'
+if [ "$#" -ne 4 ]; then
+ echo 'Need domain name and mail and old server IP and key ID as argument.'
false
fi
domain="$1"
mail="$2"
old_server="$3"
+gpg_key="$4"
# Install configs, set up firewall.
config_tree_prefix="${HOME}/config/buster"
cp "${config_tree_prefix}/other_files/website_hook_post-receive" /var/repos/website.git/hooks/post-receive
su -lc 'cd /var/www && git clone /var/repos/website.git .' plom
+# Add encryption key.
+keyservers='sks-keyservers.net/ keys.gnupg.net'
+set +e
+while true; do
+ do_break=0
+ for keyserver in $(echo "${keyservers}"); do
+ su plom -c "gpg --no-tty --keyserver $keyserver --recv-key ${gpg_key}"
+ if [ $? -eq "0" ]; then
+ do_break=1
+ break
+ fi
+ echo "Attempt with keyserver ${keyserver} unsuccessful, trying other."
+ done
+ if [ "${do_break}" -eq "1" ]; then
+ break
+ fi
+done
+set -e
+
# Set up plomlombot.
irclogs_dir=/var/www/html/irclogs
irclogs_pw_dir=/var/www/irclogs_pw