Skip to content

Commit ec13d93

Browse files
committed
add gramps-web
1 parent 4e3b23a commit ec13d93

3 files changed

Lines changed: 267 additions & 0 deletions

File tree

ct/gramps-web.sh

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
#!/usr/bin/env bash
2+
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
3+
# Copyright (c) 2021-2026 community-scripts ORG
4+
# Author: GitHub Copilot
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
6+
# Source: https://www.grampsweb.org/
7+
8+
APP="gramps-web"
9+
var_tags="${var_tags:-genealogy;family;collaboration}"
10+
var_cpu="${var_cpu:-2}"
11+
var_ram="${var_ram:-4096}"
12+
var_disk="${var_disk:-20}"
13+
var_os="${var_os:-debian}"
14+
var_version="${var_version:-13}"
15+
var_unprivileged="${var_unprivileged:-1}"
16+
17+
header_info "$APP"
18+
variables
19+
color
20+
catch_errors
21+
22+
function update_script() {
23+
header_info
24+
check_container_storage
25+
check_container_resources
26+
27+
if [[ ! -d /opt/gramps-web-api ]]; then
28+
msg_error "No Gramps Web API Installation Found!"
29+
exit
30+
fi
31+
32+
if [[ ! -d /opt/gramps-web/frontend ]]; then
33+
msg_error "No Gramps Web Frontend Installation Found!"
34+
exit
35+
fi
36+
37+
if [[ ! -f /opt/gramps-web/config/config.cfg ]]; then
38+
msg_error "No Gramps Web Configuration Found!"
39+
exit
40+
fi
41+
42+
PYTHON_VERSION="3.12" setup_uv
43+
NODE_VERSION="22" setup_nodejs
44+
45+
UPDATE_AVAILABLE=0
46+
if check_for_gh_release "gramps-web-api" "gramps-project/gramps-web-api"; then
47+
UPDATE_AVAILABLE=1
48+
fi
49+
if check_for_gh_release "gramps-web" "gramps-project/gramps-web"; then
50+
UPDATE_AVAILABLE=1
51+
fi
52+
53+
if [[ "$UPDATE_AVAILABLE" == "1" ]]; then
54+
msg_info "Stopping Service"
55+
systemctl stop gramps-web
56+
msg_ok "Stopped Service"
57+
58+
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "gramps-web-api" "gramps-project/gramps-web-api" "tarball" "latest" "/opt/gramps-web-api"
59+
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "gramps-web" "gramps-project/gramps-web" "tarball" "latest" "/opt/gramps-web/frontend"
60+
61+
msg_info "Updating Gramps Web API"
62+
$STD uv venv -c -p python3.12 /opt/gramps-web/venv
63+
source /opt/gramps-web/venv/bin/activate
64+
$STD uv pip install --no-cache-dir --upgrade pip setuptools wheel
65+
$STD uv pip install --no-cache-dir gunicorn
66+
$STD uv pip install --no-cache-dir /opt/gramps-web-api
67+
msg_ok "Updated Gramps Web API"
68+
69+
msg_info "Updating Gramps Web Frontend"
70+
cd /opt/gramps-web/frontend
71+
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
72+
corepack enable
73+
$STD npm install
74+
$STD npm run build
75+
msg_ok "Updated Gramps Web Frontend"
76+
77+
msg_info "Applying Database Migration"
78+
GRAMPS_API_CONFIG=/opt/gramps-web/config/config.cfg \
79+
GRAMPSHOME=/opt/gramps-web/data/gramps \
80+
GRAMPS_DATABASE_PATH=/opt/gramps-web/data/gramps/grampsdb \
81+
$STD /opt/gramps-web/venv/bin/python3 -m gramps_webapi user migrate
82+
msg_ok "Applied Database Migration"
83+
84+
msg_info "Starting Service"
85+
systemctl start gramps-web
86+
msg_ok "Started Service"
87+
msg_ok "Updated successfully!"
88+
fi
89+
90+
exit
91+
}
92+
93+
start
94+
build_container
95+
description
96+
97+
msg_ok "Completed successfully!\n"
98+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
99+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
100+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5000${CL}"
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"name": "Gramps Web",
3+
"slug": "gramps-web",
4+
"categories": [
5+
12
6+
],
7+
"date_created": "2026-02-16",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": 5000,
12+
"documentation": "https://www.grampsweb.org/install_setup/setup/",
13+
"website": "https://www.grampsweb.org/",
14+
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/gramps.webp",
15+
"config_path": "/opt/gramps-web/config/config.cfg",
16+
"description": "Gramps Web is a collaborative genealogy platform for browsing, editing and sharing family trees through a modern web interface.",
17+
"install_methods": [
18+
{
19+
"type": "default",
20+
"script": "ct/gramps-web.sh",
21+
"resources": {
22+
"cpu": 2,
23+
"ram": 4096,
24+
"hdd": 20,
25+
"os": "Debian",
26+
"version": "13"
27+
}
28+
}
29+
],
30+
"default_credentials": {
31+
"username": null,
32+
"password": null
33+
},
34+
"notes": [
35+
{
36+
"text": "On first access, create the owner account via the built-in onboarding wizard.",
37+
"type": "info"
38+
},
39+
{
40+
"text": "The initial deployment compiles the frontend and can take several minutes.",
41+
"type": "warning"
42+
}
43+
]
44+
}

install/gramps-web-install.sh

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2026 community-scripts ORG
4+
# Author: GitHub Copilot
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
6+
# Source: https://www.grampsweb.org/
7+
8+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
if apt-cache show libgirepository-2.0-dev >/dev/null 2>&1; then
17+
GI_DEV_PACKAGE="libgirepository-2.0-dev"
18+
else
19+
GI_DEV_PACKAGE="libgirepository1.0-dev"
20+
fi
21+
22+
msg_info "Installing Dependencies"
23+
$STD apt install -y \
24+
appstream \
25+
build-essential \
26+
ffmpeg \
27+
gettext \
28+
gir1.2-gexiv2-0.10 \
29+
gir1.2-gtk-3.0 \
30+
gir1.2-osmgpsmap-1.0 \
31+
gir1.2-pango-1.0 \
32+
git \
33+
graphviz \
34+
libicu-dev \
35+
libopencv-dev \
36+
pkg-config \
37+
poppler-utils \
38+
python3-dev \
39+
tesseract-ocr \
40+
"$GI_DEV_PACKAGE"
41+
msg_ok "Installed Dependencies"
42+
43+
PYTHON_VERSION="3.12" setup_uv
44+
NODE_VERSION="22" setup_nodejs
45+
46+
fetch_and_deploy_gh_release "gramps-web-api" "gramps-project/gramps-web-api" "tarball" "latest" "/opt/gramps-web-api"
47+
fetch_and_deploy_gh_release "gramps-web" "gramps-project/gramps-web" "tarball" "latest" "/opt/gramps-web/frontend"
48+
49+
msg_info "Setting up Gramps Web"
50+
mkdir -p \
51+
/opt/gramps-web/config \
52+
/opt/gramps-web/data/cache/export \
53+
/opt/gramps-web/data/cache/persistent \
54+
/opt/gramps-web/data/cache/report \
55+
/opt/gramps-web/data/cache/request \
56+
/opt/gramps-web/data/cache/thumbnail \
57+
/opt/gramps-web/data/gramps/grampsdb \
58+
/opt/gramps-web/data/indexdir \
59+
/opt/gramps-web/data/media \
60+
/opt/gramps-web/data/users
61+
62+
SECRET_KEY="$(python3 -c "import secrets; print(secrets.token_urlsafe(32))")"
63+
64+
cat <<EOF >/opt/gramps-web/config/config.cfg
65+
TREE="Gramps Web"
66+
SECRET_KEY="${SECRET_KEY}"
67+
BASE_URL="http://${LOCAL_IP}:5000"
68+
USER_DB_URI="sqlite:////opt/gramps-web/data/users/users.sqlite"
69+
SEARCH_INDEX_DB_URI="sqlite:////opt/gramps-web/data/indexdir/search_index.db"
70+
MEDIA_BASE_DIR="/opt/gramps-web/data/media"
71+
STATIC_PATH="/opt/gramps-web/frontend/dist"
72+
THUMBNAIL_CACHE_CONFIG={"CACHE_TYPE":"FileSystemCache","CACHE_DIR":"/opt/gramps-web/data/cache/thumbnail","CACHE_THRESHOLD":1000,"CACHE_DEFAULT_TIMEOUT":0}
73+
REQUEST_CACHE_CONFIG={"CACHE_TYPE":"FileSystemCache","CACHE_DIR":"/opt/gramps-web/data/cache/request","CACHE_THRESHOLD":1000,"CACHE_DEFAULT_TIMEOUT":0}
74+
PERSISTENT_CACHE_CONFIG={"CACHE_TYPE":"FileSystemCache","CACHE_DIR":"/opt/gramps-web/data/cache/persistent","CACHE_THRESHOLD":0,"CACHE_DEFAULT_TIMEOUT":0}
75+
REPORT_DIR="/opt/gramps-web/data/cache/report"
76+
EXPORT_DIR="/opt/gramps-web/data/cache/export"
77+
EOF
78+
79+
$STD uv venv -c -p python3.12 /opt/gramps-web/venv
80+
source /opt/gramps-web/venv/bin/activate
81+
$STD uv pip install --no-cache-dir --upgrade pip setuptools wheel
82+
$STD uv pip install --no-cache-dir gunicorn
83+
$STD uv pip install --no-cache-dir /opt/gramps-web-api
84+
85+
cd /opt/gramps-web/frontend
86+
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
87+
corepack enable
88+
$STD npm install
89+
$STD npm run build
90+
91+
GRAMPS_API_CONFIG=/opt/gramps-web/config/config.cfg \
92+
GRAMPSHOME=/opt/gramps-web/data/gramps \
93+
GRAMPS_DATABASE_PATH=/opt/gramps-web/data/gramps/grampsdb \
94+
$STD /opt/gramps-web/venv/bin/python3 -m gramps_webapi user migrate
95+
msg_ok "Set up Gramps Web"
96+
97+
msg_info "Creating Service"
98+
cat <<EOF >/etc/systemd/system/gramps-web.service
99+
[Unit]
100+
Description=Gramps Web Service
101+
After=network.target
102+
103+
[Service]
104+
Type=simple
105+
User=root
106+
WorkingDirectory=/opt/gramps-web-api
107+
Environment=GRAMPS_API_CONFIG=/opt/gramps-web/config/config.cfg
108+
Environment=GRAMPSHOME=/opt/gramps-web/data/gramps
109+
Environment=GRAMPS_DATABASE_PATH=/opt/gramps-web/data/gramps/grampsdb
110+
Environment=PATH=/opt/gramps-web/venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
111+
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
112+
Restart=on-failure
113+
RestartSec=5
114+
115+
[Install]
116+
WantedBy=multi-user.target
117+
EOF
118+
systemctl enable -q --now gramps-web
119+
msg_ok "Created Service"
120+
121+
motd_ssh
122+
customize
123+
cleanup_lxc

0 commit comments

Comments
 (0)