From 9dc1e606ec1865bab4af20e5936a7e291af0dec2 Mon Sep 17 00:00:00 2001 From: Tobias <96661824+CrazyWolf13@users.noreply.github.com> Date: Sun, 18 Jan 2026 15:18:51 +0100 Subject: [PATCH] refactor: peanut entrypoint (#10902) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: peanut entrypoint * refactor: peanut: entrypoint fix * Apply suggestion from @tremor021 * Apply suggestion from @tremor021 --------- Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com> --- ct/peanut.sh | 11 ++++++++++- install/peanut-install.sh | 5 +++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ct/peanut.sh b/ct/peanut.sh index 2077ce4ea..4799e4d69 100644 --- a/ct/peanut.sh +++ b/ct/peanut.sh @@ -28,7 +28,7 @@ function update_script() { exit fi - NODE_VERSION="22" NODE_MODULE="pnpm" setup_nodejs + NODE_VERSION="24" NODE_MODULE="pnpm" setup_nodejs if check_for_gh_release "peanut" "Brandawg93/PeaNUT"; then msg_info "Stopping Service" @@ -37,6 +37,15 @@ function update_script() { CLEAN_INSTALL=1 fetch_and_deploy_gh_release "peanut" "Brandawg93/PeaNUT" "tarball" "latest" "/opt/peanut" + if ! grep -q '/opt/peanut/entrypoint.mjs' /etc/systemd/system/peanut.service; then + msg_info "Fixing entrypoint" + cd /opt/peanut + ln -sf .next/standalone/server.js server.js + sed -i 's|/opt/peanut/.next/standalone/server.js|/opt/peanut/entrypoint.mjs|' /etc/systemd/system/peanut.service + systemctl daemon-reload + msg_ok "Fixed entrypoint" + fi + msg_info "Updating Peanut" cd /opt/peanut $STD pnpm i diff --git a/install/peanut-install.sh b/install/peanut-install.sh index 305e4eb7d..f71c8c3be 100644 --- a/install/peanut-install.sh +++ b/install/peanut-install.sh @@ -18,7 +18,7 @@ msg_info "Installing NUT" $STD apt install -y nut-client msg_ok "Installed NUT" -NODE_VERSION="22" NODE_MODULE="pnpm" setup_nodejs +NODE_VERSION="24" NODE_MODULE="pnpm" setup_nodejs fetch_and_deploy_gh_release "peanut" "Brandawg93/PeaNUT" "tarball" "latest" "/opt/peanut" msg_info "Setup Peanut" @@ -28,6 +28,7 @@ $STD pnpm run build:local cp -r .next/static .next/standalone/.next/ mkdir -p /opt/peanut/.next/standalone/config mkdir -p /etc/peanut/ +ln -sf .next/standalone/server.js server.js cat </etc/peanut/settings.yml WEB_HOST: 0.0.0.0 WEB_PORT: 3000 @@ -53,7 +54,7 @@ Environment="NODE_ENV=production" #Environment="WEB_HOST=0.0.0.0" #Environment="WEB_PORT=3000" WorkingDirectory=/opt/peanut -ExecStart=node /opt/peanut/.next/standalone/server.js +ExecStart=node /opt/peanut/entrypoint.mjs TimeoutStopSec=30 [Install] WantedBy=multi-user.target