Spaces:
Build error
Build error
Commit History
-
fix: centralize + desktop-mode-adapt the logs directory (P-1)
New finding while implementing this: config/settings.py's LOGS_PATH constant was dead code -- grepped every consumer, zero hits anywhere outside its own definition. The 3 real log-writing call sites each independently hardcoded or recomputed their own path instead: - scrapers/base_scraper.py: a bare CWD-relative "logs" string - api/middleware/audit_logger.py: __file__-relative, 3 dirname() calls up to project root - blockchain/audit_chain.py: __file__-relative, 2 dirname() calls up to project root (different file depth, same target) All 3 resolve to the identical directory TODAY only because Docker's fixed WORKDIR makes CWD == project root -- a coincidence, not a guarantee. A desktop build has no such guarantee: a double-clicked app's CWD is unpredictable, so the CWD-relative scraper logs and the __file__-relative audit logs could silently end up in two different, unrelated directories the moment this ships as a desktop app. Fix: LOGS_PATH is now desktop-mode-aware (same…6d12c24
-
feat(security):complete — security hardening and provenance
- api/middleware/rate_limiter.py: sliding window per IP per endpoint class Limits: /search 100/min, /investigate 30/min, /export 10/min, /admin 5/min Returns HTTP 429 with Retry-After header. IP stored as SHA-256 hash (privacy) - api/middleware/security_headers.py: CSP, HSTS, X-Frame-Options, nosniff, Referrer-Policy, Permissions-Policy on every response - api/middleware/input_validator.py: max 200 chars, Cypher injection detection, Indian script Unicode range allowlist for multilingual queries - api/middleware/audit_logger.py: append-only JSONL audit log with SHA-256 hash chain. Each entry includes hash of previous entry for tamper detection - blockchain/audit_chain.py: compute_daily_root() builds Merkle-style daily root hash from all entries. store_root_hash() anchors it in Neo4j AuditRoot node. verify_chain() confirms chain integrity end-to-end - api/main.py: all 4 middleware registered in correct orderb1a489c
-
fix: add __init__.py to all packages, create venv setup
- Added __init__.py to scrapers, processing, graph, ai, api, blockchain, config, tests folders - Fixes ModuleNotFoundError when running scrapers - Added main.py as project entry point - Updated .gitignore to exclude venv/ and __pycache__/ - All scripts must now run from project root with: python -m scrapers.Xd76057f
-
feat: add requirements.txt and base_scraper.py - Day 2
1c02240