1
0
mirror of https://github.com/community-scripts/ProxmoxVE.git synced 2025-04-19 18:48:07 +00:00

Docmost: Bump NodeJS to 22 & fixed pnpm (#3521)

* Docmost: Bump NodeJS to 22 & fixed pnpm

* Update docmost.sh
This commit is contained in:
CanbiZ 2025-03-31 12:16:38 +02:00 committed by GitHub
parent 3abb4b0060
commit e7529a9c25
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 2 deletions

View File

@ -26,6 +26,23 @@ function update_script() {
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit exit
fi fi
if command -v node >/dev/null; then
NODE_MAJOR=$(/usr/bin/env node -v | grep -oP '^v\K[0-9]+')
if [[ "$NODE_MAJOR" != "22" ]]; then
$STD apt-get purge -y nodejs
rm -f /etc/apt/sources.list.d/nodesource.list
rm -f /etc/apt/keyrings/nodesource.gpg
else
return
fi
fi
mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" >/etc/apt/sources.list.d/nodesource.list
$STD apt-get update
$STD apt-get install -y nodejs
$STD npm install -g pnpm@10.4.0
export NODE_OPTIONS="--max_old_space_size=4096"
RELEASE=$(curl -s https://api.github.com/repos/docmost/docmost/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') RELEASE=$(curl -s https://api.github.com/repos/docmost/docmost/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Stopping ${APP}" msg_info "Stopping ${APP}"

View File

@ -24,13 +24,13 @@ msg_ok "Installed Dependencies"
msg_info "Setting up Node.js Repository" msg_info "Setting up Node.js Repository"
mkdir -p /etc/apt/keyrings mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" >/etc/apt/sources.list.d/nodesource.list echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" >/etc/apt/sources.list.d/nodesource.list
msg_ok "Set up Node.js Repository" msg_ok "Set up Node.js Repository"
msg_info "Installing Node.js" msg_info "Installing Node.js"
$STD apt-get update $STD apt-get update
$STD apt-get install -y nodejs $STD apt-get install -y nodejs
$STD npm install -g pnpm $STD npm install -g pnpm@10.4.0
msg_ok "Installed Node.js" msg_ok "Installed Node.js"
msg_info "Setting up PostgreSQL" msg_info "Setting up PostgreSQL"