Commit Graph
263 Commits
Author SHA1 Message Date
1sonhador c02c300dc3 feat(deploy): version.json generation, webhook promote, verify (BIT-468)
Align LXC deploy with BIT-465: write-version-json.sh, optional
webhook-deploy.sh, verify.sh fails when ER_VERSION_JSON_PATH is set but
missing/invalid, env.example + nginx sketch + runbook updates.
Ignore deploy/lxc/runtime/ (generated on server).
2026-03-24 18:33:37 +00:00
1sonhadorandPaperclip e17acc983c fix(admin-ui): require session for dashboard in production (BIT-403)
- Add middleware redirecting unauthenticated users to /login unless dev+demo
- Disable demo incident data when NODE_ENV=production
- Forward __Host-access cookie on SSR fetches to admin API
- Document NPM /admin/ proxy to Fastify api (§14.2.2)

Co-Authored-By: Paperclip <[email protected]>
2026-03-23 23:00:20 +00:00
1sonhadorandPaperclip e3a7efc1a3 docs(NPM): domain without :3040 needs no path rewrite; forward + headers
Co-Authored-By: Paperclip <[email protected]>
2026-03-23 21:26:10 +00:00
1sonhadorandPaperclip 4a32bb3b0c fix(admin-ui): force-dynamic routes so DEMO/API env is not CDN-cached stale
Co-Authored-By: Paperclip <[email protected]>
2026-03-23 21:13:46 +00:00
1sonhadorandPaperclip b95aee6f85 deploy(lxc): systemd After=mariadb (not postgresql); note Gitea clone on CT
Co-Authored-By: Paperclip <[email protected]>
2026-03-23 21:10:52 +00:00
1sonhadorandPaperclip ff11f79acb docs(compose): admin-ui port 3040 verify + troubleshooting when host not redeployed
Co-Authored-By: Paperclip <[email protected]>
2026-03-23 20:56:50 +00:00
1sonhadorandPaperclip 563f644861 compose: add admin-ui service on port 3040 (Next standalone)
Expose Velzon admin dashboard in docker-compose with ERROR_REPORTING_UI_DEMO=1
by default until admin API serves /v1/incidents. Document env vars in .env.example.

Co-Authored-By: Paperclip <[email protected]>
2026-03-23 19:50:30 +00:00
1sonhadorandPaperclip a9d85a2fec fix: use regular unique index for MariaDB 10.6 compat (BIT-277)
MariaDB 10.6 does not support functional indexes. Replace the
LOWER(email) functional index with a plain unique index on email;
case-insensitive uniqueness is enforced at the application layer.

Paperclip-Agent: DevOps Engineer (urlKey devops-engineer; id 5d084b36-f38f-42a5-a92a-520005afda4f)
Paperclip-Issue: BIT-277
Paperclip-Run: 7cc9257b-0d1a-475b-9133-8d0aa78d0f08

Co-Authored-By: Paperclip <[email protected]>
2026-03-23 16:26:19 +00:00
1sonhadorandPaperclip 09eef93b34 docs(deployment): add public NPM/DNS/Cloudflare runbook for LXC (BIT-277)
Document Nginx Proxy Manager (CT 102), DNS for errors.bitreport.pt and
ingest.errors.bitreport.pt, Cloudflare 525 troubleshooting, and external
verification curls alongside existing verify.sh checks.

Co-Authored-By: Paperclip <[email protected]>
2026-03-22 23:33:56 +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 b0b733d5e1 feat(BIT-247): consolidate error reporting repo from OTT
Merge ingest-api, collector-worker, admin-ui, database/error_reporting, deploy/lxc,
docker-compose, and deployment docs into the dedicated repository. Paths updated
for repo root (ER_REPO_ROOT, systemd WorkingDirectory). Root README documents layout.

Co-Authored-By: Paperclip <[email protected]>
2026-03-22 18:20:27 +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
1sonhadorandPaperclip d455a26333 chore: init errors.bitreport.pt repo
Co-Authored-By: Paperclip <[email protected]>
2026-03-22 04:18:09 +00:00