[object Object]

← back to 1960swallpaper

fix: remove public bak file leak + fix 404-guard regex + gitignore bak-* pattern

a2788ec871b458a4cb5d9d7e0bac3f4275c2a379 · 2026-05-30 21:34:08 -0700 · SteveStudio2

- Removed public/index.html.bak-20260526152130 (was served HTTP 200)
- Fixed 404-guard regex to block .bak-<timestamp> patterns (was only blocking .bak and .bak.)
- Added *.bak-* to .gitignore (was missing; *.bak and *.bak.* did not cover hyphenated timestamps)
- npm install ran to populate empty node_modules (express was MODULE_NOT_FOUND on boot)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Files touched

Diff

commit a2788ec871b458a4cb5d9d7e0bac3f4275c2a379
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date:   Sat May 30 21:34:08 2026 -0700

    fix: remove public bak file leak + fix 404-guard regex + gitignore bak-* pattern
    
    - Removed public/index.html.bak-20260526152130 (was served HTTP 200)
    - Fixed 404-guard regex to block .bak-<timestamp> patterns (was only blocking .bak and .bak.)
    - Added *.bak-* to .gitignore (was missing; *.bak and *.bak.* did not cover hyphenated timestamps)
    - npm install ran to populate empty node_modules (express was MODULE_NOT_FOUND on boot)
    
    Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---
 .gitignore        |  1 +
 package-lock.json | 13 +++++++++++++
 server.js         |  2 +-
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index b062b4a..0fb7b7f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,5 +26,6 @@ out/
 # snapshot / backup files — never track
 *.bak
 *.bak.*
+*.bak-*
 *.pre-*
 *.orig
diff --git a/package-lock.json b/package-lock.json
index 6b99b5b..bca250c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -8,6 +8,7 @@
       "name": "1960swallpaper",
       "version": "0.1.0",
       "dependencies": {
+        "dotenv": "^17.4.2",
         "express": "^4.21.0",
         "helmet": "^8.1.0"
       }
@@ -172,6 +173,18 @@
         "npm": "1.2.8000 || >= 1.4.16"
       }
     },
+    "node_modules/dotenv": {
+      "version": "17.4.2",
+      "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.4.2.tgz",
+      "integrity": "sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==",
+      "license": "BSD-2-Clause",
+      "engines": {
+        "node": ">=12"
+      },
+      "funding": {
+        "url": "https://dotenvx.com"
+      }
+    },
     "node_modules/dunder-proto": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
diff --git a/server.js b/server.js
index bc9a749..8fe37a2 100644
--- a/server.js
+++ b/server.js
@@ -152,7 +152,7 @@ require('./_universal-auth')(app, { siteName: "1960swallpaper" });
 
 // 404-guard: never serve snapshot/backup files from static root.
 app.use((req, res, next) => {
-  if (/\.(bak|orig)(\.|$)|\.pre-/i.test(req.path)) return res.status(404).send('Not found');
+  if (/\.(bak|orig)(\.|[-_]|$)|\.pre-/i.test(req.path)) return res.status(404).send('Not found');
   next();
 });
 

← 534a955 feat(fleet): theme1/theme2 query-param-gated toggle on catal  ·  back to 1960swallpaper  ·  fix(api): /api/facets counts reflect filtered result set (sk 7ae3889 →