infra: DATA_DIR env var; gitignore data dir; remove dead STATE_FILE code

This commit is contained in:
Scott Felten 2026-04-26 18:41:04 +00:00
parent 2f60e99efc
commit 94f32c92a3
2 changed files with 3 additions and 2 deletions

2
.gitignore vendored
View file

@ -3,3 +3,5 @@ node_modules/
*.log
.env
*.bak*
data/
data/

View file

@ -11,7 +11,7 @@ const HOST = process.env.HOST || '127.0.0.1';
const PORT = process.env.PORT || 3030;
// ─── Paths ───
const DATA_DIR = path.join(__dirname, 'data');
const DATA_DIR = process.env.DATA_DIR || path.join(__dirname, 'data');
const USERS_FILE = path.join(DATA_DIR, 'users.json');
const SERVICES_CACHE = path.join(DATA_DIR, 'services-cache.json');
const TOKENS_FILE = path.join(DATA_DIR, 'tokens.json');
@ -184,7 +184,6 @@ async function syncServices() {
// Build service map from inventory repos
const newMap = {};
const STATE_FILE = path.join(DATA_DIR, '../api/inventory-data.json');
// Also try to get the inventory state which has service URLs
let stateData = {};