Commit Graph

5 Commits

Author SHA1 Message Date
Yusuf Suleman
9e13984b05 fix: performance hardening — eliminate full table scans (#9)
Some checks failed
Security Checks / dependency-audit (push) Has been cancelled
Security Checks / secret-scanning (push) Has been cancelled
Security Checks / dockerfile-lint (push) Has been cancelled
Inventory:
- /issues: replaced full scan + client filter with NocoDB server-side
  WHERE filter (Received eq Issues/Issue). Single query, ~200 rows max.
- /needs-review-count: replaced full scan with server-side WHERE +
  limit=1 + pageInfo.totalRows. Returns count without fetching data.

Budget:
- buildLookups(): added 2-minute cache for payee/account/category maps.
  Eliminates 3 API calls per request for repeated queries.
- /summary cache (added earlier): 1-minute TTL still active.

Files: services/inventory/server.js, services/budget/server.js
2026-03-29 13:50:07 -05:00
Yusuf Suleman
7a7286ac1c fix(gateway,inventory): trust model hardening (#5)
Some checks failed
Security Checks / dependency-audit (push) Has been cancelled
Security Checks / secret-scanning (push) Has been cancelled
Security Checks / dockerfile-lint (push) Has been cancelled
- Renamed SERVICE_LEVEL_AUTH to GATEWAY_KEY_SERVICES (clarifies intent)
- Removed /debug-nocodb endpoint from inventory (exposed full table dump)
- Hardened NocoDB search filter construction: strip (), ~, , chars to prevent
  filter injection. Reject queries under 2 chars.

Files: gateway/dashboard.py, services/inventory/server.js
2026-03-29 13:48:18 -05:00
Yusuf Suleman
72747668f9 fix: remaining security and deployment hardening (#6 #7 #10)
#7 Transport Security:
- Removed legacy _ssl_ctx alias from config.py
- proxy.py now uses _internal_ssl_ctx directly (explicitly scoped)
- No global TLS bypass remains

#10 Deployment Hardening:
- Inventory Dockerfile: non-root (node user), health check, production deps
- Budget Dockerfile: non-root (node user), health check, npm ci, multi-stage ready
- Frontend-v2 Dockerfile: multi-stage build, non-root (node user), health check
- Added /health endpoints to inventory and budget (before auth middleware)
- All 6 containers now run as non-root with health checks

All services verified: gateway, trips, fitness, inventory, budget, frontend
2026-03-29 09:35:39 -05:00
Yusuf Suleman
fcb9383623 fix(gateway): enforce API key auth on inventory and budget services (#5)
- Added X-API-Key middleware to inventory-service and budget-service
- Services reject all requests without valid API key (401)
- Gateway proxy injects service API keys for inventory and budget
- Dashboard widget fetchers inject API keys
- Generated unique API keys per service, stored in .env
- Added SERVICE_API_KEY env var to docker-compose for both services

Partial fix for #5 — internal services now require auth.
Remaining: document trust model, validate service token semantics.
2026-03-29 09:06:41 -05:00
Yusuf Suleman
d3e250e361 Initial commit: Second Brain Platform
Complete platform with unified design system and real API integration.

Apps: Dashboard, Fitness, Budget, Inventory, Trips, Reader, Media, Settings
Infrastructure: SvelteKit + Python gateway + Docker Compose
2026-03-28 23:20:40 -05:00