Disable auto-seeding on empty DB - require --seed flag or SEED_DB=true

Previously db.seed() ran unconditionally on startup and would populate
a fresh database with fake test data. Now seeding only triggers when
explicitly requested via --seed CLI flag or SEED_DB=true env var.

The seed functionality remains available for developers:
  node server.js --seed
  SEED_DB=true node server.js
  node db.js  (direct run still seeds)
This commit is contained in:
you
2026-03-21 23:00:01 +00:00
parent 1b2f28cb5f
commit ad6a796b35
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "meshcore-analyzer",
"version": "2.1.0",
"version": "2.1.1",
"description": "Community-run alternative to the closed-source `analyzer.letsmesh.net`. MQTT packet collection + open-source web analyzer for the Bay Area MeshCore mesh.",
"main": "index.js",
"scripts": {
+4 -2
View File
@@ -259,8 +259,10 @@ class TTLCache {
const cache = new TTLCache();
// Seed DB if empty
db.seed();
// Seed DB only when explicitly requested via --seed flag or SEED_DB=true env var
if (process.argv.includes('--seed') || process.env.SEED_DB === 'true') {
db.seed();
}
const app = express();