From: Christian Heller <c.heller@plomlompom.de>
Date: Mon, 2 Jan 2023 23:23:08 +0000 (+0100)
Subject: Improve microblog.pub setup.
X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/static/%7B%7Bdb.prefix%7D%7D/do_todos?a=commitdiff_plain;h=6797c7010cdf48a198f14463fe33578733e63a7b;p=config

Improve microblog.pub setup.
---

diff --git a/bullseye/etc_files/microblogpub/etc/systemd/system/microblogpub.service b/bullseye/etc_files/microblogpub/etc/systemd/system/microblogpub.service
index 7a64014..441129d 100644
--- a/bullseye/etc_files/microblogpub/etc/systemd/system/microblogpub.service
+++ b/bullseye/etc_files/microblogpub/etc/systemd/system/microblogpub.service
@@ -6,7 +6,7 @@ Type=simple
 User=plom
 WorkingDirectory=/home/plom/testing.microblog.pub/
 ExecStart=/bin/sh -c 'poetry run supervisord -c misc/supervisord.conf -n'
-Environment=VENV_DIR=REPLACE_venv_dir_ECALPER
+Environment=VENV_DIR=/home/plom/.cache/pypoetry/virtualenvs/REPLACE_venv_dir_ECALPER
 Restart=always
 
 [Install]
diff --git a/bullseye/setup_scripts/setup_microblogpub.sh b/bullseye/setup_scripts/setup_microblogpub.sh
index 2c057af..67c7262 100755
--- a/bullseye/setup_scripts/setup_microblogpub.sh
+++ b/bullseye/setup_scripts/setup_microblogpub.sh
@@ -41,7 +41,8 @@ su -lPc "cd testing.microblog.pub && poetry run inv configuration-wizard" - plom
 su -lPc "cd testing.microblog.pub && poetry run inv migrate-db" - plom
 
 # Set up microblog.pub daemon service.
-venv_dir=$( su -lPc "cd testing.microblog.pub && poetry env info" - plom | grep 'Path' | head -1 | awk '{print $2}')
+venv_dir_path=$( su -lPc "cd testing.microblog.pub && poetry env info" - plom | grep 'Path' | head -1 | awk '{print $2}')
+venv_dir=$(basename ${venv_dir_path})
 sed -i "s/REPLACE_venv_dir_ECALPER/${venv_dir}/g" /etc/systemd/system/microblogpub.service
 systemctl enable microblogpub.service
 service microblogpub start