home · contact · privacy
Add redo blog URL catcher.
authorChristian Heller <c.heller@plomlompom.de>
Thu, 9 Apr 2020 20:45:57 +0000 (22:45 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 9 Apr 2020 20:45:57 +0000 (22:45 +0200)
buster/apt-mark/dumpsite
buster/etc_files/dumpsite/etc/nginx/sites-available/dumpsite.nginx
buster/etc_files/dumpsite/etc/systemd/system/url_catcher.service [new file with mode: 0644]
buster/setup_scripts/setup_dumpsite.sh

index 403aefbe19b615b4432913652dce1dc0c44954a1..881bba2203fa2f7381fe2d852f4cc14d623e3114 100644 (file)
@@ -6,3 +6,8 @@ pandoc
 html2text
 uuid-runtime
 python3
+# for url_catcher daemon
+python3-venv
+build-essential
+python3-dev
+screen
index edd79fb108ec011bbe9e86d1c7b2b952431356fa..25c2d623645db1e5d11f188ff9924650b81224f6 100644 (file)
@@ -16,8 +16,13 @@ server {
     }
 
     location /zettel/ {
-            # rewrite non-suffixed filenames to .html ones
-            rewrite ^(/zettel/(.*/)*[^./]+)$ $1.html;
-            autoindex on;
+        # rewrite non-suffixed filenames to .html ones
+        rewrite ^(/zettel/(.*/)*[^./]+)$ $1.html;
+        autoindex on;
+    }
+
+    location /uwsgi/ {
+        include uwsgi_params;
+        uwsgi_pass 127.0.0.1:3031;
     }
 }
diff --git a/buster/etc_files/dumpsite/etc/systemd/system/url_catcher.service b/buster/etc_files/dumpsite/etc/systemd/system/url_catcher.service
new file mode 100644 (file)
index 0000000..8b8f2d9
--- /dev/null
@@ -0,0 +1,11 @@
+[Unit]
+Description=url_catcher screen
+
+[Service]
+Type=forking
+User=plom
+ExecStart=/bin/sh -c 'cd ~/url-catcher && screen -d -m ./run.sh'
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
index 2fa9d89cfd71d41873b9c94cc68f2431f28e8439..5a0bec3c1d9d7d1b1f15ba012745deb2ce2d405c 100755 (executable)
@@ -49,16 +49,28 @@ 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/post-receive
 su -lc "git clone ~/zettel.git && cd zettel && redo" plom
 su -lc "ln -s /home/plom/zettel /var/www-dump/zettel" plom
+# NOTE: Locally, to update content, clone zettel.git, not zettel.
 
 # 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/post-receive
 su -lc "git clone ~/blog.git" plom
-# FIXME: we should not depend on a GitHub repo
+# FIXME: we should not depend on a GitHub repo;
+# instead, set up like plomlombot repo (with post-recieve hook)
 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
+# NOTE: Locally, to update content, clone blog.git, not blog.
+
+# Set up url catcher.
+su -lc "git clone https://github.com/plomlompom/url-catcher.git" plom
+# FIXME: we should not depend on a GitHub repo;
+# instead, set up like plomlombot repo (with post-recieve hook)
+su -lc "cd url-catcher && ln -s ../blog/captchas/linkable/ captchas" plom
+systemctl enable url_catcher.service
+service url_catcher startc
+# NOTE: fix metadata/article_tmpl referencing dump.plomlompom.com explicitely
 
 # Prepare NGINX.
 sed -i "s/REPLACE_fqdn_ECALPER/${domain}/g" /etc/nginx/sites-available/dumpsite.nginx