Commit Graph
5 Commits
Author SHA1 Message Date
nelson-baptista 836d967aeb chore(runtime): BIT-31723 upgrade Node 20 → Node 24 LTS + audit PHP/TS code
CI / Test ingest-api (pull_request) Successful in 33s
CI / Test api (pull_request) Successful in 34s
CI / Lint and typecheck admin-ui (pull_request) Successful in 1m19s
CI / Validate Docker build (pull_request) Successful in 3m54s
- Dockerfiles (admin-ui, collector-worker, ingest-api): node:20-bookworm-slim → node:24-bookworm-slim
- CI (.gitea/workflows/ci.yml): node-version '20' → '24' in all 3 jobs
- package.json engines.node: '>=20' → '>=24.22.1' (admin-ui, api, collector-worker, ingest-api, web)
- @types/node: ^20/^22 → ^24 in all packages
- api: bcrypt ^5.1.1 → ^6.0.0 (Node 24 prebuilt binary compat)
- clients/php/ErrorReporter.php: PHP 8.4+ compat audit (no deprecated patterns)
- clients/node/errorReporter.mjs: Node 24+ doc update

All tests verified locally:
- api: 51/51 passed (vitest)
- ingest-api: 40 passed + 14 skipped (vitest)
- collector-worker: 12/12 passed (vitest)
- admin-ui: lint + typecheck clean
- web: lint + typecheck + build clean

Paperclip-Agent: Nelson Baptista (urlKey nelson-baptista; id e34f1b0f-62db-487c-8584-f6a47203f7b5)
Paperclip-Issue: BIT-31723
Paperclip-Run: 76d06689-1879-421f-ad2c-04f5fe85d21d
2026-10-23 17:30:13 +01:00
David Santos 14df06dca3 Align api Fastify range with ingest-api (BIT-2517).
Set fastify to ^4.28.1 in api/package.json and sync the lockfile
metadata. npm run build && npm test passed for api and ingest-api.

Made-with: Cursor
2026-04-12 08:37:08 +00:00
Peter Spark c6e4305c79 feat(observability): stats endpoint, Prometheus metrics, SLO tracking, Grafana dashboard (BIT-734)
- GET /api/error-monitoring/stats: 24h ingestion volume, severity
  distribution, per-project metrics with resolution rates, hourly trend
- Prometheus /metrics on both api (port 3200) and ingest-api (port 3041)
  with HTTP request duration histograms, ingest SLO latency (p50/p95/p99),
  event throughput counters, domain gauges
- Grafana dashboard JSON (deploy/grafana/) with SLO panels, error volume,
  severity/state distribution, per-project charts, Node.js process metrics
- SLO runbook (docs/RUNBOOK_SLO.md): alert rules, scrape config,
  triage procedures for latency, error rate, and availability breaches

Paperclip-Agent: Peter Spark (urlKey peter-spark; id 49ce66f8-6be6-4644-afd3-eb6d8d0d4b3e)
Paperclip-Issue: BIT-734
Paperclip-Run: f45bcdc4-4757-4829-8e75-b60a8f9a7be4
2026-04-02 18:26:24 +00:00
1sonhadorandPaperclip 4604606033 feat(errors): migrate error-reporting stack from PostgreSQL to MariaDB (BIT-255)
Replace Postgres with MariaDB 11 in docker-compose; convert all
database/error_reporting and db/migrations SQL to InnoDB-friendly syntax
(DATETIME(6), AUTO_INCREMENT, ON DUPLICATE KEY). Run admin portal DDL in the
same migrate one-shot as error_reporting.

Switch ingest-api, collector-worker, and api from pg to mysql2 (pools,
parameterized queries, transactions). Align ingest writes with
er_incident_occurrences and include project_id on idempotency inserts.

Add scripts/run-mysql-migrations.sh for host-side applies; update LXC
run-migrate/verify, deployment docs, and .env.example (mysql://, ER_MYSQL_*).

Verified: npm run build + npm test in ingest-api and collector-worker;
npm run build in api. Full docker compose not run here (no local daemon).

Co-Authored-By: Paperclip <[email protected]>
2026-03-22 19:29:11 +00:00
1sonhadorandPaperclip eeb5039a3c feat(BIT-183): admin auth, RBAC, audit logging, rate limiting
Implements BIT-154.7 — Auth administrativa, RBAC e quotas:

- api/src/types/auth.ts: 3 roles (superadmin/admin/viewer), 18 permissions,
  ROLE_PERMISSIONS map as single source of truth
- api/src/plugins/auth.ts: JWT via HTTP-only __Host- cookies (15min access /
  7d refresh), token rotation, timing-safe login
- api/src/plugins/rbac.ts: requirePermission() + requireRole() Fastify
  decorators for route-level enforcement
- api/src/plugins/audit.ts: auditLog() helper + Fastify plugin; writes to
  audit_logs table; failure never aborts main operation
- api/src/plugins/rate-limit.ts: per-route limits (login: 10/5min IP,
  ingest: 1000/min token, global: 500/min) + payload size enforcement
- api/src/routes/admin/auth.ts: POST login, POST refresh, POST logout,
  GET /me — with audit events on all operations
- db/migrations/001–004: admin_users, refresh_tokens, audit_logs tables +
  dev seed (bcrypt superadmin)
- web/src/app/(admin)/login: Velzon Bootstrap 5 login page (Next.js client
  component, credentials:include, HTTP-only cookie flow)
- docs/permission-matrix.md: full permission matrix + audit event catalogue
  + rate/payload limit table (BIT-183 acceptance criterion)

Co-Authored-By: Paperclip <[email protected]>
2026-03-22 04:22:57 +00:00