Commit graph

13 commits

Author SHA1 Message Date
Brad Groux
e69bfe8c14
feat: complete governed run egress (#1080)
* feat: broker scoped egress approvals

* feat: add authenticated SOCKS5 egress

* feat: support operator upstream egress proxies

* test: hoist workflow service mocks
2026-07-25 20:55:54 -05:00
Brad Groux
ec6bc83fd2
feat: add SQLite storage foundation
## Summary

- adds a dependency-free Node `node:sqlite` database foundation with safe PRAGMAs, schema_migrations tracking, checksum validation, and transactional migration rollback
- adds the SQLite storage provider shell, lifecycle shutdown, and isolated SQLite test helpers while file repositories remain the default behavior
- wires `VERITAS_STORAGE=file|sqlite` plus `VERITAS_SQLITE_PATH` through env validation, docs, and server startup/shutdown

Closes #329.

## Verification

- CI: Build
- CI: Lint & Type Check
- CI: Workspace Unit Tests
- CI: Security Audit
- `./node_modules/.bin/prettier --check docs/SQLITE-SCHEMA.md server/src/config/env.ts server/src/index.ts server/src/storage/index.ts server/src/storage/sqlite/database.ts server/src/storage/sqlite/migrations.ts server/src/storage/sqlite/sqlite-storage.ts server/src/storage/sqlite/test-helpers.ts server/src/__tests__/config/env.test.ts server/src/__tests__/storage/sqlite-database.test.ts server/src/__tests__/storage/sqlite-storage.test.ts`
- `./node_modules/.bin/eslint server/src --ext .ts --quiet`
- `pnpm --filter @veritas-kanban/server test -- src/__tests__/storage/sqlite-database.test.ts src/__tests__/storage/sqlite-storage.test.ts src/__tests__/config/env.test.ts`
- `pnpm --filter @veritas-kanban/server typecheck`
- `pnpm --filter @veritas-kanban/server build`
- `pnpm audit --prod --audit-level=high`
- `git diff --check`
- SQLite startup smoke with `VERITAS_STORAGE=sqlite` against a fresh temp data dir and `/api/health` returning ok

## Notes

- File storage remains the default until the provider parity and migration/import issues land. SQLite mode currently owns database lifecycle and migrations, then delegates existing repositories to file storage.
2026-05-30 17:39:23 -05:00
Brad Groux
e0bd0102cb fix: add TRUST_PROXY env var for reverse proxy deployments (#100)
Resolves #100. Adds configurable trust proxy setting via TRUST_PROXY
environment variable. Supports numeric hop counts, subnet strings, and
named values (loopback, linklocal, uniquelocal). TRUST_PROXY=true is
intentionally blocked (unsafe for production — logs warning and falls
back to default). Disabled by default (no behavior change).

Includes documentation updates for nginx, Caddy, and Docker deployments.
2026-02-07 14:53:02 -06:00
Brad Groux
8cce9f24c4 feat: Squad chat protocol scripts, system events, model attribution
- Add squad-post.sh for regular agent messages
- Add squad-event.sh for lifecycle events (spawned/completed/failed/status)
- Add model field to squad messages (types, server, UI, scripts)
- System events render as divider lines in squad chat panel
- Model attribution displays next to agent names in UI
- Full protocol documented in SQUAD-CHAT-PROTOCOL.md
- Updated CONTRIBUTING.md, README.md, and all SOPs
- Added VK_HOST/VK_PORT env vars to .env.example

4-check cross-model review: 10/10 (Code/GPT-5.1, Func/Grok, Perf/Grok, Sec/GPT-5.1)
Agents: R2-D2 (feature), TARS/CASE/Ava/K-2SO (reviews)
2026-02-07 13:04:17 -06:00
Scout Murphy
4189af29cb feat: Add webhook notifications for Clawdbot Gateway integration
- Add webhookUrl to NotificationSettingsSchema
- Create clawdbot-webhook-service with fire-and-forget delivery + 1 retry
- Hook into broadcastTaskChange and broadcastChatMessage in broadcast-service
- Support VERITAS_WEBHOOK_URL and VERITAS_WEBHOOK_SECRET env vars
- HMAC-SHA256 payload signing via X-Webhook-Signature header
- Add 16 tests covering config, signing, delivery, retry, and payload formatting
- Update .env.example with new env var documentation
2026-01-31 21:30:02 -07:00
Brad Groux
5d3f75bda6 perf: add pagination and summary mode to reduce API payload 2026-01-28 17:38:04 -06:00
Brad Groux
da1532feec fix: adjust rate limit thresholds for local dev tool 2026-01-28 17:32:32 -06:00
Brad Groux
f3ffad2a9f fix: return 403 for CORS rejections instead of 500 2026-01-28 17:30:57 -06:00
Brad Groux
f5bb469f9a feat: add structured logging with pino 2026-01-28 17:14:20 -06:00
Brad Groux
c8970f0631 fix(security): use timing-safe comparison for recovery keys 2026-01-28 17:08:26 -06:00
Brad Groux
5e4f3ec6b9 fix(security): move JWT secret to env var, update .env.example 2026-01-28 12:07:11 -06:00
Brad Groux
5aa31115ae fix(security): remove .env from git, add .env.example 2026-01-28 12:05:17 -06:00
Brad Groux
3efa474eb0 feat(server): Add authentication & authorization system
- Add auth middleware (server/src/middleware/auth.ts)
  - API key authentication via Bearer token, X-API-Key header, or query param
  - Role-based authorization (admin, agent, read-only)
  - Localhost bypass option for development
  - WebSocket connection authentication

- Update index.ts to integrate auth middleware
  - Apply authenticate middleware to all /api routes
  - Add /api/auth/status endpoint for diagnostics
  - Protect WebSocket connections with token validation
  - Display auth status in startup banner

- Add configuration via environment variables
  - VERITAS_AUTH_ENABLED (default: true)
  - VERITAS_AUTH_LOCALHOST_BYPASS (default: false)
  - VERITAS_ADMIN_KEY for admin access
  - VERITAS_API_KEYS for named keys with roles

- Add comprehensive security documentation (docs/security.md)
- Add .env.example with all auth configuration options

Closes RF-01
2026-01-28 07:37:44 -06:00