🔱 BACKDOOR: Direct PostgreSQL access when Directus is down

New endpoint: /api/god/[action]
- GET /api/god/health     - Full system health (DB, pool, tables)
- GET /api/god/db-status  - Database connection test
- GET /api/god/tables     - List all tables with row counts
- GET /api/god/logs       - Recent work_log entries
- POST /api/god/sql       - Execute raw SQL

Features:
- Bypasses Directus entirely, connects directly to PostgreSQL
- Works even when Directus is crashed/frozen
- Validates X-God-Token header
- Added pg package for direct DB access
This commit is contained in:
cawcenter
2025-12-14 15:09:53 -05:00
parent 6465c3d1f8
commit c8c0ced446
2 changed files with 289 additions and 1 deletions

View File

@@ -64,6 +64,7 @@
"nanostores": "^1.1.0",
"papaparse": "^5.5.3",
"pdfmake": "^0.2.20",
"pg": "^8.11.3",
"react": "^18.3.1",
"react-contenteditable": "^3.3.7",
"react-diff-viewer-continued": "^3.4.0",
@@ -96,4 +97,4 @@
"vite-plugin-compression": "^0.5.1",
"vite-plugin-inspect": "^11.3.3"
}
}
}