






















11---
2-summary: "Signal support via signal-cli (JSON-RPC + SSE), setup paths, and number model"
2+summary: "Signal support via signal-cli (native daemon or bbernhard container), setup paths, and number model"
33read_when:
44 - Setting up Signal support
55 - Debugging Signal send/receive
66title: "Signal"
77---
889-Status: external CLI integration. Gateway talks to `signal-cli` over HTTP JSON-RPC + SSE.
9+Status: external CLI integration. Gateway talks to `signal-cli` over HTTP — either native daemon (JSON-RPC + SSE) or bbernhard/signal-cli-rest-api container (REST + WebSocket).
10101111## Prerequisites
12121313- OpenClaw installed on your server (Linux flow below tested on Ubuntu 24).
14-- `signal-cli` available on the host where the gateway runs.
14+- One of:
15+- `signal-cli` available on the host (native mode), **or**
16+- `bbernhard/signal-cli-rest-api` Docker container (container mode).
1517- A phone number that can receive one verification SMS (for SMS registration path).
1618- Browser access for Signal captcha (`signalcaptchas.org`) during registration.
1719@@ -179,6 +181,63 @@ If you want to manage `signal-cli` yourself (slow JVM cold starts, container ini
179181180182This skips auto-spawn and the startup wait inside OpenClaw. For slow starts when auto-spawning, set `channels.signal.startupTimeoutMs`.
181183184+## Container mode (bbernhard/signal-cli-rest-api)
185+186+Instead of running `signal-cli` natively, you can use the [bbernhard/signal-cli-rest-api](https://github.com/bbernhard/signal-cli-rest-api) Docker container. This wraps `signal-cli` behind a REST API and WebSocket interface.
187+188+Requirements:
189+190+- The container **must** run with `MODE=json-rpc` for real-time message receiving.
191+- Register or link your Signal account inside the container before connecting OpenClaw.
192+193+Example `docker-compose.yml` service:
194+195+```yaml
196+signal-cli:
197+image: bbernhard/signal-cli-rest-api:latest
198+environment:
199+MODE: json-rpc
200+ports:
201+ - "8080:8080"
202+volumes:
203+ - signal-cli-data:/home/.local/share/signal-cli
204+```
205+206+OpenClaw config:
207+208+```json5
209+{
210+channels: {
211+signal: {
212+enabled: true,
213+account: "+15551234567",
214+httpUrl: "http://signal-cli:8080",
215+autoStart: false,
216+apiMode: "container", // or "auto" to detect automatically
217+},
218+},
219+}
220+```
221+222+The `apiMode` field controls which protocol OpenClaw uses:
223+224+| Value | Behavior |
225+| ------------- | ------------------------------------------------------------------------------------ |
226+| `"auto"` | (Default) Probes both transports; streaming validates container WebSocket receive |
227+| `"native"` | Force native signal-cli (JSON-RPC at `/api/v1/rpc`, SSE at `/api/v1/events`) |
228+| `"container"` | Force bbernhard container (REST at `/v2/send`, WebSocket at `/v1/receive/{account}`) |
229+230+When `apiMode` is `"auto"`, OpenClaw caches the detected mode for 30 seconds to avoid repeated probes. Container receive is only selected for streaming after `/v1/receive/{account}` upgrades to WebSocket, which requires `MODE=json-rpc`.
231+232+Container mode supports the same Signal channel operations as native mode where the container exposes matching APIs: sends, receives, attachments, typing indicators, read/viewed receipts, reactions, groups, and styled text. OpenClaw translates its native Signal RPC calls into the container's REST payloads, including `group.{base64(internal_id)}` group IDs and `text_mode: "styled"` for formatted text.
233+234+Operational notes:
235+236+- Use `autoStart: false` with container mode. OpenClaw should not spawn a native daemon when `apiMode: "container"` is selected.
237+- Use `MODE=json-rpc` for receiving. `MODE=normal` can make `/v1/about` look healthy, but `/v1/receive/{account}` does not WebSocket-upgrade, so OpenClaw will not select container receive streaming in `auto` mode.
238+- Set `apiMode: "container"` when you know the `httpUrl` points at bbernhard's REST API. Set `apiMode: "native"` when you know it points at native `signal-cli` JSON-RPC/SSE. Use `"auto"` when the deployment may vary.
239+- Container attachment downloads honor the same media byte limits as native mode. Oversized responses are rejected before being fully buffered when the server sends `Content-Length`, and while streaming otherwise.
240+182241## Access control (DMs + groups)
183242184243DMs:
@@ -202,7 +261,8 @@ Groups:
202261203262## How it works (behavior)
204263205-- `signal-cli` runs as a daemon; the gateway reads events via SSE.
264+- Native mode: `signal-cli` runs as a daemon; the gateway reads events via SSE.
265+- Container mode: the gateway sends via REST API and receives via WebSocket.
206266- Inbound messages are normalized into the shared channel envelope.
207267- Replies always route back to the same number or group.
208268@@ -302,6 +362,7 @@ Full configuration: [Configuration](/gateway/configuration)
302362Provider options:
303363304364- `channels.signal.enabled`: enable/disable channel startup.
365+- `channels.signal.apiMode`: `auto | native | container` (default: auto). See [Container mode](#container-mode-bbernhardsignal-cli-rest-api).
305366- `channels.signal.account`: E.164 for the bot account.
306367- `channels.signal.cliPath`: path to `signal-cli`.
307368- `channels.signal.httpUrl`: full daemon URL (overrides host/port).
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。