Skip to content

Commit cc1c2f8

Browse files
authored
Refactor: Grist (#7681)
* Refactor * Refactor
1 parent 3aff0d9 commit cc1c2f8

File tree

3 files changed

+21
-47
lines changed

3 files changed

+21
-47
lines changed

ct/grist.sh

Lines changed: 16 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/usr/bin/env bash
22
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: cfurrow | Co-Author: Slaviša Arežina (tremor021)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
36
# Source: https://github.com/gristlabs/grist-core
47

58
APP="Grist"
@@ -26,57 +29,34 @@ function update_script() {
2629
exit
2730
fi
2831

29-
RELEASE=$(curl -fsSL https://api.github.com/repos/gristlabs/grist-core/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
30-
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
31-
32+
if check_for_gh_release "grist" "gristlabs/grist-core"; then
3233
msg_info "Stopping ${APP} Service"
3334
systemctl stop grist
3435
msg_ok "Stopped ${APP} Service"
3536

36-
msg_info "Updating ${APP} to v${RELEASE}"
37-
38-
cd /opt
39-
rm -rf grist_bak
37+
msg_info "Creating backup"
38+
rm -rf /opt/grist_bak
4039
mv grist grist_bak
41-
curl -fsSL "https://github.com/gristlabs/grist-core/archive/refs/tags/v${RELEASE}.zip" -o $(basename "https://github.com/gristlabs/grist-core/archive/refs/tags/v${RELEASE}.zip")
42-
$STD unzip v$RELEASE.zip
43-
mv grist-core-${RELEASE} grist
40+
msg_ok "Backup created"
4441

45-
mkdir -p grist/docs
42+
fetch_and_deploy_gh_release "grist" "gristlabs/grist-core" "tarball"
4643

47-
cp -n grist_bak/.env grist/.env || true
48-
cp -r grist_bak/docs/* grist/docs/ || true
49-
cp grist_bak/grist-sessions.db grist/grist-sessions.db || true
50-
cp grist_bak/landing.db grist/landing.db || true
51-
52-
cd grist
53-
msg_info "Installing Dependencies"
44+
msg_info "Updating ${APP}"
45+
mkdir -p grist/docs
46+
cp -n /opt/grist_bak/.env /opt/grist/.env
47+
cp -r /opt/grist_bak/docs/* /opt/grist/docs/
48+
cp /opt/grist_bak/grist-sessions.db /opt/grist/grist-sessions.db
49+
cp /opt/grist_bak/landing.db /opt/grist/landing.db
5450
$STD yarn install
55-
msg_ok "Installed Dependencies"
56-
57-
msg_info "Building"
5851
$STD yarn run build:prod
59-
msg_ok "Done building"
60-
61-
msg_info "Installing Python"
6252
$STD yarn run install:python
63-
msg_ok "Installed Python"
64-
65-
echo "${RELEASE}" >/opt/${APP}_version.txt
66-
67-
msg_ok "Updated ${APP} to v${RELEASE}"
53+
msg_ok "Updated ${APP}"
6854

6955
msg_info "Starting ${APP} Service"
7056
systemctl start grist
7157
msg_ok "Started ${APP} Service"
7258

73-
msg_info "Cleaning up"
74-
rm -rf /opt/v$RELEASE.zip
75-
msg_ok "Cleaned"
76-
77-
msg_ok "Updated Successfully!\n"
78-
else
79-
msg_ok "No update required. ${APP} is already at ${RELEASE}"
59+
msg_ok "Updated Successfully"
8060
fi
8161
exit
8262
}

frontend/public/json/grist.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"website": "https://www.getgrist.com/",
1414
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/grist.webp",
1515
"config_path": "/opt/grist/.env",
16-
"description": "Grist is a modern, open source spreadsheet that goes beyond the grid",
16+
"description": "Grist is like a spreadsheet + database hybrid. It lets you store structured data, use relational links between tables, apply formulas (even with Python), build custom layouts (cards, forms, dashboards), set fine-grained access rules, and visualize data with charts or pivot-tables.",
1717
"install_methods": [
1818
{
1919
"type": "default",

install/grist-install.sh

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
# Copyright (c) 2021-2025 community-scripts ORG
4-
# Author: cfurrow
4+
# Author: cfurrow | Co-Author: Slaviša Arežina (tremor021)
55
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
66
# Source: https://github.com/gristlabs/grist-core
77

@@ -17,20 +17,15 @@ msg_info "Installing Dependencies"
1717
$STD apt-get install -y \
1818
make \
1919
ca-certificates \
20-
python3.11-venv
20+
python3-venv
2121
msg_ok "Installed Dependencies"
22-
2322
NODE_VERSION="22" NODE_MODULE="yarn@latest" setup_nodejs
23+
fetch_and_deploy_gh_release "grist" "gristlabs/grist-core" "tarball"
2424

2525
msg_info "Installing Grist"
26-
RELEASE=$(curl -fsSL https://api.github.com/repos/gristlabs/grist-core/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
2726
export CYPRESS_INSTALL_BINARY=0
2827
export NODE_OPTIONS="--max-old-space-size=2048"
29-
cd /opt
30-
curl -fsSL "https://github.com/gristlabs/grist-core/archive/refs/tags/v${RELEASE}.zip" -o "v${RELEASE}.zip"
31-
$STD unzip v$RELEASE.zip
32-
mv grist-core-${RELEASE} grist
33-
cd grist
28+
cd /opt/grist
3429
$STD yarn install
3530
$STD yarn run build:prod
3631
$STD yarn run install:python
@@ -64,7 +59,6 @@ motd_ssh
6459
customize
6560

6661
msg_info "Cleaning up"
67-
rm -rf /opt/v${RELEASE}.zip
6862
$STD apt-get -y autoremove
6963
$STD apt-get -y autoclean
7064
msg_ok "Cleaned"

0 commit comments

Comments
 (0)