home · contact · privacy
Add dump blog (without uwsgi part).
authorChristian Heller <c.heller@plomlompom.de>
Fri, 3 Apr 2020 22:06:29 +0000 (00:06 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Fri, 3 Apr 2020 22:06:29 +0000 (00:06 +0200)
buster/apt-mark/dumpsite
buster/other_files/blog_hook_post-receive [new file with mode: 0755]
buster/setup_scripts/setup_dumpsite.sh

index cd1cd375561d0e4b0919cb4d704745cf95da6245..403aefbe19b615b4432913652dce1dc0c44954a1 100644 (file)
@@ -1,3 +1,8 @@
 pwgen
 wget
+# for blog and zettel
 pandoc
+# for blog
+html2text
+uuid-runtime
+python3
diff --git a/buster/other_files/blog_hook_post-receive b/buster/other_files/blog_hook_post-receive
new file mode 100755 (executable)
index 0000000..b671248
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/sh
+blog_dir=~/blog
+export GIT_DIR=$(pwd)
+export GIT_WORK_TREE="$blog_dir"
+git checkout -f
+cd "$GIT_WORK_TREE"
+redo
+git add metadata/author metadata/url metadata/title metadata/*.tmpl metadata/automatic_metadata captchas/linkable/*
+count=$(ls -1 metadata/*.automatic_metadata 2>/dev/null | wc -l)
+if [ "$count" != 0 ]; then
+  git add metadata/*.automatic_metadata
+fi
+status=$(git status -s)
+n_updates=$(printf "$status" | grep -vE '^\?\?' | wc -l)
+if [ "$n_updates" -gt 0 ]; then
+  git commit -a -m 'Update metadata'
+fi
index c2ed7cd104b00033840bb777104fc97271a3bb6f..923072c289259ba221b6aee38fbb6cc277e9f7c6 100755 (executable)
@@ -33,17 +33,32 @@ password_geheim=$(pwgen -1)
 echo "foo:{PLAIN}${password_geheim}" > /var/www-dump/password_geheim
 echo "geheim password is: ${password_geheim}"
 
-# Set up zettel and redo.
+# Set up redo.
 wget http://news.dieweltistgarnichtso.net/bin/archives/redo-sh.tar.gz
 tar -moxzf redo-sh.tar.gz -C /usr/local
+
+# Set up connection to old dump server.
 cp "${config_tree_prefix}/setup_scripts/prepare_to_meet_server.sh" /home/plom/
 chown plom:plom /home/plom/prepare_to_meet_server.sh
 su -lc "./prepare_to_meet_server.sh ${old_server}" plom
-su -lc "cd /var/repos && git clone --mirror ${old_server}:zettel.git" plom
+read -p'Hit Enter when you are done.' ignore
+rm /home/plom/prepare_to_meet_server.sh
+
+# Set up zettel.
+su -lc "git clone --mirror ${old_server}:zettel.git" plom
 cp "${config_tree_prefix}/other_files/zettel_hook_post-receive" /home/plom/zettel.git/hooks/
-su -lc "git clone ~/zettel.git" plom
+su -lc "git clone ~/zettel.git && cd zettel && redo" plom
 su -lc "ln -s /home/plom/zettel /var/www-dump/zettel" plom
-rm /home/plom/prepare_to_meet_server.sh
+
+# Set up redo blog.
+su -lc "git clone --mirror ${old_server}:blog.git" plom
+cp "${config_tree_prefix}/other_files/blog_hook_post-receive" /home/plom/blog.git/hooks/
+su -lc "git clone ~/blog.git" plom
+# FIXME: we should not depend on a GitHub repo
+su -lc "git clone https://github.com/plomlompom/redo-blog.git" plom
+su -lc "cd redo-blog && ./add_dir.sh ~/blog" plom
+su -lc "cd blog && redo" plom
+su -lc "ln -s /home/plom/blog/public /var/www-dump/blog" plom
 
 # Prepare NGINX.
 sed -i "s/REPLACE_fqdn_ECALPER/${domain}/g" /etc/nginx/sites-available/dumpsite.nginx