From 2be32698145d40fbd570c9dd8e9d7cf0adc9ed79 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Thu, 30 Apr 2026 13:44:53 +0200 Subject: [PATCH] Refactor storyteller.sh for clarity and updates --- ct/storyteller.sh | 76 ++++++++++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 37 deletions(-) diff --git a/ct/storyteller.sh b/ct/storyteller.sh index 2fe6d0193..5f6d6c189 100644 --- a/ct/storyteller.sh +++ b/ct/storyteller.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) # Copyright (c) 2021-2026 community-scripts ORG -# Author: CanbiZ (MickLesk) +# Author: MickLesk (CanbiZ) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # Source: https://gitlab.com/storyteller-platform/storyteller @@ -29,47 +29,49 @@ function update_script() { exit fi - msg_info "Stopping Service" - systemctl stop storyteller - msg_ok "Stopped Service" + if check_for_gl_release "storyteller" "storyteller-platform/storyteller"; then + msg_info "Stopping Service" + systemctl stop storyteller + msg_ok "Stopped Service" - msg_info "Backing up Data" - cp /opt/storyteller/.env /opt/storyteller_env.bak - msg_ok "Backed up Data" + msg_info "Backing up Data" + cp /opt/storyteller/.env /opt/storyteller_env.bak + msg_ok "Backed up Data" - CLEAN_INSTALL=1 fetch_and_deploy_gl_release "storyteller" "storyteller-platform/storyteller" "tarball" + CLEAN_INSTALL=1 fetch_and_deploy_gl_release "storyteller" "storyteller-platform/storyteller" "tarball" "latest" "/opt/storyteller" - msg_info "Restoring Configuration" - mv /opt/storyteller_env.bak /opt/storyteller/.env - msg_ok "Restored Configuration" + msg_info "Restoring Configuration" + mv /opt/storyteller_env.bak /opt/storyteller/.env + msg_ok "Restored Configuration" - msg_info "Rebuilding Storyteller" - cd /opt/storyteller - export NODE_OPTIONS="--max-old-space-size=4096" - $STD yarn install --network-timeout 600000 - $STD gcc -g -fPIC -rdynamic -shared web/sqlite/uuid.c -o web/sqlite/uuid.c.so - export CI=1 - export NODE_ENV=production - export NEXT_TELEMETRY_DISABLED=1 - export SQLITE_NATIVE_BINDING=/opt/storyteller/node_modules/better-sqlite3/build/Release/better_sqlite3.node - $STD yarn workspaces foreach -Rpt --from @storyteller-platform/web --exclude @storyteller-platform/eslint run build - mkdir -p /opt/storyteller/web/.next/standalone/web/.next/static - cp -rT /opt/storyteller/web/.next/static /opt/storyteller/web/.next/standalone/web/.next/static - if [[ -d /opt/storyteller/web/public ]]; then - mkdir -p /opt/storyteller/web/.next/standalone/web/public - cp -rT /opt/storyteller/web/public /opt/storyteller/web/.next/standalone/web/public + msg_info "Rebuilding Storyteller" + cd /opt/storyteller + export NODE_OPTIONS="--max-old-space-size=4096" + $STD yarn install --network-timeout 600000 + $STD gcc -g -fPIC -rdynamic -shared web/sqlite/uuid.c -o web/sqlite/uuid.c.so + export CI=1 + export NODE_ENV=production + export NEXT_TELEMETRY_DISABLED=1 + export SQLITE_NATIVE_BINDING=/opt/storyteller/node_modules/better-sqlite3/build/Release/better_sqlite3.node + $STD yarn workspaces foreach -Rpt --from @storyteller-platform/web --exclude @storyteller-platform/eslint run build + mkdir -p /opt/storyteller/web/.next/standalone/web/.next/static + cp -rT /opt/storyteller/web/.next/static /opt/storyteller/web/.next/standalone/web/.next/static + if [[ -d /opt/storyteller/web/public ]]; then + mkdir -p /opt/storyteller/web/.next/standalone/web/public + cp -rT /opt/storyteller/web/public /opt/storyteller/web/.next/standalone/web/public + fi + mkdir -p /opt/storyteller/web/.next/standalone/web/migrations + cp -rT /opt/storyteller/web/migrations /opt/storyteller/web/.next/standalone/web/migrations + mkdir -p /opt/storyteller/web/.next/standalone/web/sqlite + cp -rT /opt/storyteller/web/sqlite /opt/storyteller/web/.next/standalone/web/sqlite + ln -sf /opt/storyteller/.env /opt/storyteller/web/.next/standalone/web/.env + msg_ok "Rebuilt Storyteller" + + msg_info "Starting Service" + systemctl start storyteller + msg_ok "Started Service" + msg_ok "Updated successfully!" fi - mkdir -p /opt/storyteller/web/.next/standalone/web/migrations - cp -rT /opt/storyteller/web/migrations /opt/storyteller/web/.next/standalone/web/migrations - mkdir -p /opt/storyteller/web/.next/standalone/web/sqlite - cp -rT /opt/storyteller/web/sqlite /opt/storyteller/web/.next/standalone/web/sqlite - ln -sf /opt/storyteller/.env /opt/storyteller/web/.next/standalone/web/.env - msg_ok "Rebuilt Storyteller" - - msg_info "Starting Service" - systemctl start storyteller - msg_ok "Started Service" - msg_ok "Updated successfully!" exit }