mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-03-03 16:15:54 +00:00
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:
@@ -51,11 +51,23 @@ function update_script() {
|
|||||||
cd /opt/gramps-web-api
|
cd /opt/gramps-web-api
|
||||||
GRAMPS_API_CONFIG=/opt/gramps-web/config/config.cfg \
|
GRAMPS_API_CONFIG=/opt/gramps-web/config/config.cfg \
|
||||||
ALEMBIC_CONFIG=/opt/gramps-web-api/alembic.ini \
|
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 \
|
GRAMPS_DATABASE_PATH=/opt/gramps-web/data/gramps/grampsdb \
|
||||||
$STD /opt/gramps-web/venv/bin/python3 -m gramps_webapi user migrate
|
$STD /opt/gramps-web/venv/bin/python3 -m gramps_webapi user migrate
|
||||||
msg_ok "Applied Database Migration"
|
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"
|
msg_info "Starting Service"
|
||||||
systemctl start gramps-web
|
systemctl start gramps-web
|
||||||
msg_ok "Started Service"
|
msg_ok "Started Service"
|
||||||
|
|||||||
@@ -76,6 +76,20 @@ source /opt/gramps-web/venv/bin/activate
|
|||||||
$STD uv pip install --no-cache-dir --upgrade pip setuptools wheel
|
$STD uv pip install --no-cache-dir --upgrade pip setuptools wheel
|
||||||
$STD uv pip install --no-cache-dir gunicorn
|
$STD uv pip install --no-cache-dir gunicorn
|
||||||
$STD uv pip install --no-cache-dir /opt/gramps-web-api
|
$STD uv pip install --no-cache-dir /opt/gramps-web-api
|
||||||
|
|
||||||
|
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"
|
||||||
|
|
||||||
|
msg_info "Installing Gramps Addons (gramps${GRAMPS_VERSION})"
|
||||||
|
$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 "Installed Gramps Addons"
|
||||||
|
|
||||||
cd /opt/gramps-web/frontend
|
cd /opt/gramps-web/frontend
|
||||||
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
|
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
|
||||||
$STD corepack enable
|
$STD corepack enable
|
||||||
@@ -84,7 +98,7 @@ $STD npm run build
|
|||||||
cd /opt/gramps-web-api
|
cd /opt/gramps-web-api
|
||||||
GRAMPS_API_CONFIG=/opt/gramps-web/config/config.cfg \
|
GRAMPS_API_CONFIG=/opt/gramps-web/config/config.cfg \
|
||||||
ALEMBIC_CONFIG=/opt/gramps-web-api/alembic.ini \
|
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 \
|
GRAMPS_DATABASE_PATH=/opt/gramps-web/data/gramps/grampsdb \
|
||||||
$STD /opt/gramps-web/venv/bin/python3 -m gramps_webapi user migrate
|
$STD /opt/gramps-web/venv/bin/python3 -m gramps_webapi user migrate
|
||||||
msg_ok "Set up Gramps Web"
|
msg_ok "Set up Gramps Web"
|
||||||
@@ -100,7 +114,7 @@ Type=simple
|
|||||||
User=root
|
User=root
|
||||||
WorkingDirectory=/opt/gramps-web-api
|
WorkingDirectory=/opt/gramps-web-api
|
||||||
Environment=GRAMPS_API_CONFIG=/opt/gramps-web/config/config.cfg
|
Environment=GRAMPS_API_CONFIG=/opt/gramps-web/config/config.cfg
|
||||||
Environment=GRAMPSHOME=/opt/gramps-web/data/gramps
|
Environment=GRAMPSHOME=/opt/gramps-web/data
|
||||||
Environment=GRAMPS_DATABASE_PATH=/opt/gramps-web/data/gramps/grampsdb
|
Environment=GRAMPS_DATABASE_PATH=/opt/gramps-web/data/gramps/grampsdb
|
||||||
Environment=PATH=/opt/gramps-web/venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
Environment=PATH=/opt/gramps-web/venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||||
ExecStart=/opt/gramps-web/venv/bin/gunicorn -w 2 -b 0.0.0.0:5000 gramps_webapi.wsgi:app --timeout 120 --limit-request-line 8190
|
ExecStart=/opt/gramps-web/venv/bin/gunicorn -w 2 -b 0.0.0.0:5000 gramps_webapi.wsgi:app --timeout 120 --limit-request-line 8190
|
||||||
|
|||||||
Reference in New Issue
Block a user