From 14a72a3ffe74e4968770b8f5f1371c4b75efc95a Mon Sep 17 00:00:00 2001 From: Do Siki Date: Wed, 19 Aug 2026 14:38:40 +0200 Subject: [PATCH] =?UTF-8?q?fix(cms):=20keep=20version=20tag=20fresh=20?= =?UTF-8?q?=E2=80=94=20deploy=20restarts=20CMS,=20editor=20page=20no-store?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The version tag is the git SHA read at CMS startup, but the deploy script only rebuilt the website container, leaving the tag stale (v8838304 shown after aa8d926 was live). The local deploy script now restarts the CMS service after the server-side deploy (the CMS publish flow is unaffected — it calls deploy.sh directly and never restarts itself). The editor main page also gains Cache-Control: no-store so browsers stop caching it. Closes MITHOME-71 --- content-editor.js | 2 +- scripts/deploy_to_stage_on_local.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content-editor.js b/content-editor.js index 3ad4175..c14f26b 100644 --- a/content-editor.js +++ b/content-editor.js @@ -347,7 +347,7 @@ const server = http.createServer(async (req, res) => { // overwrite those changes. const contentHash = crypto.createHash('sha256').update(jsonData).digest('hex'); - res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' }); + res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8', 'Cache-Control': 'no-store' }); res.end(HTML(activeFile, jsonData, message, CSRF_TOKEN, FILE_LABELS, clientJs, contentHash, DEPLOY_VERSION)); }); diff --git a/scripts/deploy_to_stage_on_local.sh b/scripts/deploy_to_stage_on_local.sh index 0235b25..c0469d1 100755 --- a/scripts/deploy_to_stage_on_local.sh +++ b/scripts/deploy_to_stage_on_local.sh @@ -46,7 +46,7 @@ git push origin "${DEPLOY_BRANCH}" printf '3/4 Staging deploy (%s:%s)…\n' "${STAGE_HOST}" "${STAGE_PATH}" ssh -o BatchMode=yes -o ConnectTimeout=15 "${STAGE_HOST}" \ - "cd '${STAGE_PATH}' && git pull --ff-only origin '${DEPLOY_BRANCH}' && ./deploy.sh staging" + "cd '${STAGE_PATH}' && git pull --ff-only origin '${DEPLOY_BRANCH}' && ./deploy.sh staging && sudo systemctl restart mozdit-content-editor.service" printf '4/4 Staging smoke teszt (%s)…\n' "${STAGE_URL}" (