From bb8855ebe057c54a110d4f22eb8cc312220c80ff Mon Sep 17 00:00:00 2001
From: Christian Heller <c.heller@plomlompom.de>
Date: Mon, 27 Dec 2021 22:37:07 +0100
Subject: [PATCH] Fix guiltcards setup.

---
 bullseye/apt-mark/website                                      | 3 +++
 .../etc_files/website/etc/nginx/sites-available/website.nginx  | 2 +-
 bullseye/setup_scripts/setup_website.sh                        | 3 +++
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/bullseye/apt-mark/website b/bullseye/apt-mark/website
index c046f50..7bdd77f 100644
--- a/bullseye/apt-mark/website
+++ b/bullseye/apt-mark/website
@@ -6,3 +6,6 @@ gnupg
 dirmngr
 python3-venv
 screen
+# for uwsgi
+build-essential
+python3-dev
diff --git a/bullseye/etc_files/website/etc/nginx/sites-available/website.nginx b/bullseye/etc_files/website/etc/nginx/sites-available/website.nginx
index 008b586..ad5abed 100644
--- a/bullseye/etc_files/website/etc/nginx/sites-available/website.nginx
+++ b/bullseye/etc_files/website/etc/nginx/sites-available/website.nginx
@@ -38,7 +38,7 @@ server {
         autoindex on;
     }
 
-    # location /guiltcards/ {
+    location /guiltcards/ {
         include uwsgi_params;
         uwsgi_pass 127.0.0.1:9000;
     }
diff --git a/bullseye/setup_scripts/setup_website.sh b/bullseye/setup_scripts/setup_website.sh
index d2dd5e8..ad36796 100755
--- a/bullseye/setup_scripts/setup_website.sh
+++ b/bullseye/setup_scripts/setup_website.sh
@@ -125,6 +125,9 @@ fi
 
 # Set up guiltcards.
 su -lc "git clone /var/repos/guiltcards" plom
+cp "${config_tree_prefix}/setup_scripts/mirror_dir.sh" /home/plom/
+su -lc "./mirror_dir.sh ${old_server} /home/plom/guiltcards/decks" plom
+rm /home/plom/mirror_dir.sh
 
 # In the above step, we might have created a root-owned /var/www/html –
 # fix this here.
-- 
2.30.2