seweryn
a împins spre master la aiac/eks_relay
7fe0ea23e8 Rewrite EKSRelay as a Node.js/TypeScript service
Replaces the PHP relay with a containerised Node 22 / TypeScript service while
keeping every /tools/* contract byte-compatible with the deployed Flowise
custom tools.
What this fixes from the PHP version:
- Flowise auth sent a literal 'Bearer ***' placeholder; the real API key is
now used, and only when one is configured.
- Webhook retries could answer a customer twice; ProcessedMessage is now
unique on (source, messageId), with a content-hash surrogate id for
payloads that carry none.
- The webhook waited synchronously for Flowise; it now persists a job,
returns 202, and a worker processes it with retry and backoff.
- No spam filtering; a rule-based gate now sits in front of Flowise.
- Ticket number was the bare conversation id; it is now
EKS-YYYYMMDD-<conversationId>, idempotent per conversation.
- unassignConversation() existed but was never called; it now runs behind
CHATWOOT_UNASSIGN_ON_TICKET.
- Request bodies with PII were written to a log file; logging is now
structured JSON with secrets always redacted and PII behind LOG_PII.
Adds: /health and /ready, /admin/* behind a separate token, Prisma/SQLite
persistence with migrations, Zod-validated config, Docker Compose with Traefik
labels, and 86 tests.
The PHP implementation is preserved at the php-legacy tag and stays deployed
as a fallback; see docs/MIGRATION.md.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WvzjhjUY7tr5Naj1Co4N6B
4 săptămâni în urmă