* feat(ops): implement production operations infrastructure dashboard (phase 1)
- Add backend read-only infrastructure metrics collector (CPU, RAM, swap, disk with 80%/90% thresholds, uptime, network cumulative totals, systemd service allowlist) using standard library only (no psutil).
- Register GET /api/v1/ops/infrastructure endpoint guarded by require_ops_roles('operator', 'owner').
- Add Next.js API proxy route /api/ops/infrastructure validating ops session cookie and forwarding to backend.
- Implement dark-surface OperationsInfrastructure component in website admin console with 30s visibility-gated polling and overlap prevention.
- Add comprehensive backend and frontend test suites (8 backend tests, 43 ops-experience tests).
* fix(ops): query internal website version endpoint defensively on verified port 3001
- Query internal website GET /api/version on verified production listener http://127.0.0.1:3001 (configurable via WEBSITE_INTERNAL_URL).
- Parse JSON defensively with a 4096-byte response bound and validate exact 40-char hex revision pattern.
- Add comprehensive tests for valid, missing, malformed, oversized, and unreachable version responses.
- Do not expose internal URLs or connection errors in API responses.
* fix(ops): map postgresql service to cluster unit postgresql@14-main and preserve health errors
- Map public logical service ID 'postgresql' to fixed systemd unit 'postgresql@14-main'.
- Reject direct systemd unit names and arbitrary service names.
- Preserve HTTP 5xx responses as degraded on /api/health before root fallback.
- Add regression tests for postgresql unit mapping, API response name stability, and health 5xx preservation.
---------
Co-authored-by: Developer <dev@example.com>
|
||
|---|---|---|
| .. | ||
| alembic | ||
| app | ||
| tests | ||
| .env.example | ||
| .gitignore | ||
| README.md | ||
| alembic.ini | ||
| requirements.lock | ||
| requirements.windows.lock | ||
README.md
MotorSignal API
Local recovery of the deployed FastAPI application and Alembic baseline.
Provenance
- Source copied from
/opt/motorsignal/currenton the production VPS on 2026-09-08. - Current release resolved to
/opt/motorsignal/releases/20260906-01. - Production environment files, credentials, virtualenv files, and database data were not copied.
requirements.lockwas reconstructed from the running production virtualenv withpip freeze; parity against a fresh production freeze passed.
Current scope
The recovered API contains health/readiness checks, registration, login, refresh,
logout, and current-user lookup. The recovered Alembic history contains one
revision creating users and sessions.
Email verification, password reset, session management endpoints, roles/RBAC, audit events, vehicles, rides, telemetry, entitlements, and admin endpoints are not present in this baseline.
Local safety
Do not point local commands at production. Use a development database and an explicit local environment file. Never commit secrets or production database credentials.