fix(gramps-web): install Gramps addons and fix GRAMPSHOME path

- Fix GRAMPSHOME: was /opt/gramps-web/data/gramps, but Gramps internally appends /gramps, so plugins were searched at .../gramps/gramps/gramps60/plugins (wrong). Changed to /opt/gramps-web/data so the path resolves correctly. - Install FilterRules + JSON addons from gramps-project/addons repo (needed for relationship diagram DegreesOfSeparation filter). - Detect Gramps version dynamically from venv python (fallback: 60). - Add addon update step to update_script (ct/gramps-web.sh). Ref: https://github.com/gramps-project/gramps-web-api/issues/612
This commit is contained in:
CanbiZ (MickLesk)
2026-02-27 13:48:06 +01:00
parent 5ec5f980dc
commit d385637b0a
2 changed files with 29 additions and 3 deletions
+13 -1
View File
@@ -51,11 +51,23 @@ function update_script() {
cd /opt/gramps-web-api
GRAMPS_API_CONFIG=/opt/gramps-web/config/config.cfg \
ALEMBIC_CONFIG=/opt/gramps-web-api/alembic.ini \
GRAMPSHOME=/opt/gramps-web/data/gramps \
GRAMPSHOME=/opt/gramps-web/data \
GRAMPS_DATABASE_PATH=/opt/gramps-web/data/gramps/grampsdb \
$STD /opt/gramps-web/venv/bin/python3 -m gramps_webapi user migrate
msg_ok "Applied Database Migration"
msg_info "Updating Gramps Addons"
GRAMPS_VERSION=$(/opt/gramps-web/venv/bin/python3 -c "import gramps.version; print('%s%s' % (gramps.version.VERSION_TUPLE[0], gramps.version.VERSION_TUPLE[1]))" 2>/dev/null || echo "60")
GRAMPS_PLUGINS_DIR="/opt/gramps-web/data/gramps/gramps${GRAMPS_VERSION}/plugins"
mkdir -p "$GRAMPS_PLUGINS_DIR"
$STD wget -q https://github.com/gramps-project/addons/archive/refs/heads/master.zip -O /tmp/gramps-addons.zip
for addon in FilterRules JSON; do
unzip -p /tmp/gramps-addons.zip "addons-master/gramps${GRAMPS_VERSION}/download/${addon}.addon.tgz" |
tar -xz -C "$GRAMPS_PLUGINS_DIR"
done
rm -f /tmp/gramps-addons.zip
msg_ok "Updated Gramps Addons"
msg_info "Starting Service"
systemctl start gramps-web
msg_ok "Started Service"