You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/WIRING.md
+38-91Lines changed: 38 additions & 91 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,11 +6,11 @@ Step-by-step instructions for connecting every external dependency.
6
6
7
7
## Chat UI Options
8
8
9
-
Gone-Phishing ships with a built-in single-file web UI (`web/index.html`). You can swap it for a more capable chat engine by setting `CHAT_UI` in `.env`.
9
+
Gone-Phishing ships with a built-in single-file web UI (`web/index.html`). You can swap it for a more capable chat engine by setting `CHAT_UI` in `.env`.
10
10
11
11
### Option 1: Built-in (default)
12
12
13
-
Zero dependencies. A single-page dark-theme chat interface served directly by FastAPI.
13
+
Zero dependencies. A single-page dark-theme chat interface served directly by FastAPI.
14
14
15
15
```bash
16
16
CHAT_UI=builtin # or just don't set it
@@ -24,9 +24,9 @@ Good for demos, air-gapped environments, and keeping the dependency tree minimal
24
24
25
25
### Option 2: Chainlit
26
26
27
-
[Chainlit](https://github.com/Chainlit/chainlit) (Apache 2.0, 9k+ stars) mounts directly into your FastAPI process — no separate server, no Docker, no JavaScript build step. It gives you streaming responses, step visualisation, file upload, auth (OAuth / header), and a polished React frontend out of the box.
27
+
[Chainlit](https://github.com/Chainlit/chainlit) (Apache 2.0, 9k+ stars) mounts directly into your FastAPI process — no separate server, no Docker, no JavaScript build step. It gives you streaming responses, step visualisation, file upload, auth (OAuth / header), and a polished React frontend out of the box.
28
28
29
-
**Why it's a good fit:** The IRP engine already runs FastAPI. Chainlit plugs in with one function call (`mount_chainlit`), inherits your existing endpoints, and adds a production-grade chat UI at `/chat`.
29
+
**Why it's a good fit:** The IRP engine already runs FastAPI. Chainlit plugs in with one function call (`mount_chainlit`), inherits your existing endpoints, and adds a production-grade chat UI at `/chat`.
30
30
31
31
```bash
32
32
pip install chainlit>=2.10.0
@@ -43,60 +43,7 @@ cd server && python app.py
43
43
# Chat → http://localhost:8100/chat
44
44
```
45
45
46
-
The Chainlit integration lives in `server/cl_app.py`. Customise it to add step indicators for each IRP phase (Identification → Containment → Eradication → Recovery).
47
-
48
-
---
49
-
50
-
### Option 3: Open WebUI
51
-
52
-
[Open WebUI](https://github.com/open-webui/open-webui) (129k+ stars) is a full self-hosted AI platform. It runs as a separate Docker container and connects to any OpenAI-compatible API — which means you point it at Gone-Phishing's `/api/chat` endpoint.
53
-
54
-
**Why it's a good fit:** If you're already running Ollama or want a multi-model workspace with RAG, voice, and admin controls, Open WebUI is the nuclear option.
55
-
56
-
```bash
57
-
# 1. Run Open WebUI
58
-
docker run -d -p 3000:8080 \
59
-
-v open-webui:/app/backend/data \
60
-
--name open-webui \
61
-
--restart always \
62
-
ghcr.io/open-webui/open-webui:main
63
-
64
-
# 2. In Open WebUI settings → Connections, add a custom endpoint:
65
-
# Base URL: http://host.docker.internal:8100
66
-
# (or your server's LAN IP)
67
-
```
68
-
69
-
Gone-Phishing's API is already OpenAI-shape enough for basic chat. For full compatibility, a thin adapter that maps `/v1/chat/completions` to `/api/chat` is included at `server/openai_compat.py` (TODO — straightforward to add if you go this route).
70
-
71
-
---
72
-
73
-
### Option 4: Gradio
74
-
75
-
[Gradio](https://github.com/gradio-app/gradio) (Hugging Face, Apache 2.0) is the fastest path from zero to interactive demo. Three lines of Python gives you a chat interface with streaming.
76
-
77
-
```python
78
-
# server/gradio_app.py (create this file)
79
-
import gradio as gr
80
-
import httpx
81
-
82
-
defchat(message, history):
83
-
messages = [{"role": r, "content": c} for r, c in history] + [{"role": "user", "content": message}]
Good for rapid prototyping and internal demos. Not recommended for production.
46
+
The Chainlit integration lives in `server/cl_app.py`. Customise it to add step indicators for each IRP phase (Identification → Containment → Eradication → Recovery).
100
47
101
48
---
102
49
@@ -113,7 +60,7 @@ The CW integration (`server/tools/cw_tools.py`) is an MCP client that spawns you
113
60
└──────────────┘ └────────────────┘
114
61
```
115
62
116
-
Gone-Phishing spawns the Node process, establishes an MCP session, and calls tools like `cw_create_ticket` and `cw_add_ticket_note` through the protocol. The session is lazily initialised on first tool call and automatically reconnects if the subprocess dies.
63
+
Gone-Phishing spawns the Node process, establishes an MCP session, and calls tools like `cw_create_ticket` and `cw_add_ticket_note` through the protocol. The session is lazily initialised on first tool call and automatically reconnects if the subprocess dies.
All 73 tools remain available if you need to extend beyond this subset — just add more wrapper functions following the same `_call_tool()` pattern.
155
102
156
103
### Graceful degradation
157
104
158
-
If `CW_MCP_SERVER_DIR` is not set or the server can't start, every tool function returns an error dict. The IRP engine stays fully operational — you just won't get CW ticket integration.
105
+
If `CW_MCP_SERVER_DIR` is not set or the server can't start, every tool function returns an error dict. The IRP engine stays fully operational — you just won't get CW ticket integration.
159
106
160
107
### For Railway deployment
161
108
@@ -179,26 +126,26 @@ The N8N integration (`server/tools/n8n_tools.py`) fires webhooks into your N8N i
179
126
1. Import or build the matching workflows in your N8N instance.
180
127
2. Each workflow should expose a webhook trigger node at these paths:
0 commit comments