From f14a726f32461b64a4feddac60d4e3eff577825e Mon Sep 17 00:00:00 2001 From: nmemmert <67961292+nmemmert@users.noreply.github.com> Date: Tue, 20 Oct 2026 14:46:55 -0400 Subject: [PATCH] Log data location and counts at startup; give the compose volume a fixed name Co-Authored-By: Claude Sonnet 5.5 --- docker-compose.yml | 1 + server.js | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 115db40..1e2facd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,3 +23,4 @@ services: - hub-data:/data # passkeys, calendar links and the session secret live here volumes: hub-data: + name: nehub-data # fixed name so the data survives redeploys and renamed stacks diff --git a/server.js b/server.js index 2969b0f..277a632 100644 --- a/server.js +++ b/server.js @@ -262,6 +262,12 @@ async function plexProxy(req, res) { } catch (e) { if (!res.headersSent) { res.writeHead(502); res.end(); } else res.destroy(); } } +{ // Make it obvious in the log whether data survived a redeploy. + const dir = process.env.DATA_DIR || require('path').join(__dirname, 'data'); + const count = f => { try { const j = JSON.parse(require('fs').readFileSync(require('path').join(dir, f), 'utf8')); return Array.isArray(j) ? j.length : (j.creds || []).length; } catch { return 0; } }; + console.log(`[data] ${dir}: ${count('passkeys.json')} passkeys, ${count('calendars.json')} calendars`); +} + if (!JWT_SECRET) console.warn('WARNING: ONLYOFFICE_JWT_SECRET not set. In-app editing only works if the Document Server has JWT disabled, and save callbacks are unauthenticated. Testing only.'); http.createServer((req, res) => {