Chuyển tới nội dung chính
Phiên bản: 1.0

Kiến trúc tổng thể — giải thích

Vì sao stack có hình dạng như hiện tại: 11 containers, loopback, strip header, JWT verify. Lệnh vận hành: Vận hành hằng ngày.

Sơ đồ runtime (production)

Vì sao server bind loopback?

agentjira_server từng publish 0.0.0.0:8080. Kết hợp danh tính qua header, ai chạm được port đó đều gửi được x-forwarded-email: attacker@x.com và approve task — merge code agent vào nhánh chính. Hai chốt độc lập chặn lại:

  1. Server verify chữ ký Cloudflare Access JWT và bỏ qua x-forwarded-role hoàn toàn.
  2. nginx client xoá sạch X-Forwarded-Email/User/Name/Role từ request inbound.
Không bao giờ republish 8080 ra 0.0.0.0.

Vì sao nginx đứng giữa?

  • Là mặt tiền duy nhất (:8081) serve SPA, proxy /api + WebSocket (timeout dài cho stream realtime).
  • Là nơi strip header danh tính do client gửi — server chỉ tin JWT đã verify hoặc proxy được liệt kê (TRUSTED_PROXY_IPS + TRUST_PROXY_IDENTITY=1 ở dev).
  • Ở DEV FULL-STACK, nginx.dev.conf.template đóng vai Cloudflare: tiêm X-Forwarded-Email từ đúng 1 IP tĩnh (.10) — request từ host tới 127.0.0.1:8080 bị NAT thành IP gateway bridge nên giả mạo header vẫn fail, nhờ đó pentest Human Gate local mới có ý nghĩa.

11 containers làm gì?

NhómContainerVai trò
Boardagentjira_server, agentjira_client, agentjira_dbAPI + runtime agent, SPA, Postgres Board
Arkon APIarkon_api, arkon_migratorFastAPI + Alembic migration lúc boot
Arkon dataarkon_postgres, arkon_redis, arkon_miniopgvector, queue MRP, object storage
Arkon workerarkon_worker, arkon_worker_skillsPipeline biên dịch Wiki, worker skills
Arkon UIarkon_frontendPortal :3119
Docs (mới)agentjira_docsSite tài liệu này :8082 — tĩnh, không DB