diff --git a/docs/channels/groups.md b/docs/channels/groups.md index c746a5ef6e7..3999dfcbe51 100644 --- a/docs/channels/groups.md +++ b/docs/channels/groups.md @@ -190,8 +190,8 @@ Control how group/room messages are handled per channel: groupPolicy: "allowlist", groupAllowFrom: ["@owner:example.org"], groups: { - "!roomId:example.org": { allow: true }, - "#alias:example.org": { allow: true }, + "!roomId:example.org": { enabled: true }, + "#alias:example.org": { enabled: true }, }, }, }, diff --git a/docs/channels/matrix.md b/docs/channels/matrix.md index dd12a57a344..40d5eb12ec3 100644 --- a/docs/channels/matrix.md +++ b/docs/channels/matrix.md @@ -44,6 +44,7 @@ See [Plugins](/tools/plugin) for plugin behavior and install rules. - `homeserver` + `userId` + `password`. 4. Restart the gateway. 5. Start a DM with the bot or invite it to a room. + - Fresh Matrix invites only work when `channels.matrix.autoJoin` allows them. Interactive setup paths: @@ -70,6 +71,44 @@ Wizard behavior that matters: - Runtime room/session identity uses the stable Matrix room ID. Room-declared aliases are only used as lookup inputs, not as the long-term session key or stable group identity. - To resolve room names before saving them, use `openclaw channels resolve --channel matrix "Project Room"`. + +`channels.matrix.autoJoin` defaults to `off`. + +If you leave it unset, the bot will not join invited rooms or fresh DM-style invites, so it will not appear in new groups or invited DMs unless you join manually first. + +Set `autoJoin: "allowlist"` together with `autoJoinAllowlist` to restrict which invites it accepts, or set `autoJoin: "always"` if you want it to join every invite. + + +Allowlist example: + +```json5 +{ + channels: { + matrix: { + autoJoin: "allowlist", + autoJoinAllowlist: ["!ops:example.org", "#support:example.org"], + groups: { + "!ops:example.org": { + requireMention: true, + }, + }, + }, + }, +} +``` + +Join every invite: + +```json5 +{ + channels: { + matrix: { + autoJoin: "always", + }, + }, +} +``` + Minimal token-based setup: ```json5 @@ -920,14 +959,16 @@ By default, OpenClaw blocks private/internal Matrix homeservers for SSRF protect explicitly opt in per account. If your homeserver runs on localhost, a LAN/Tailscale IP, or an internal hostname, enable -`allowPrivateNetwork` for that Matrix account: +`network.dangerouslyAllowPrivateNetwork` for that Matrix account: ```json5 { channels: { matrix: { homeserver: "http://matrix-synapse:8008", - allowPrivateNetwork: true, + network: { + dangerouslyAllowPrivateNetwork: true, + }, accessToken: "syt_internal_xxx", }, }, @@ -986,7 +1027,7 @@ Live directory lookup uses the logged-in Matrix account: - `name`: optional label for the account. - `defaultAccount`: preferred account ID when multiple Matrix accounts are configured. - `homeserver`: homeserver URL, for example `https://matrix.example.org`. -- `allowPrivateNetwork`: allow this Matrix account to connect to private/internal homeservers. Enable this when the homeserver resolves to `localhost`, a LAN/Tailscale IP, or an internal host such as `matrix-synapse`. +- `network.dangerouslyAllowPrivateNetwork`: allow this Matrix account to connect to private/internal homeservers. Enable this when the homeserver resolves to `localhost`, a LAN/Tailscale IP, or an internal host such as `matrix-synapse`. - `proxy`: optional HTTP(S) proxy URL for Matrix traffic. Named accounts can override the top-level default with their own `proxy`. - `userId`: full Matrix user ID, for example `@bot:example.org`. - `accessToken`: access token for token-based auth. Plaintext values and SecretRef values are supported for `channels.matrix.accessToken` and `channels.matrix.accounts..accessToken` across env/file/exec providers. See [Secrets Management](/gateway/secrets). @@ -1003,7 +1044,7 @@ Live directory lookup uses the logged-in Matrix account: - `groupAllowFrom`: allowlist of user IDs for room traffic. - `groupAllowFrom` entries should be full Matrix user IDs. Unresolved names are ignored at runtime. - `historyLimit`: max room messages to include as group history context. Falls back to `messages.groupChat.historyLimit`; if both are unset, the effective default is `0`. Set `0` to disable. -- `replyToMode`: `off`, `first`, or `all`. +- `replyToMode`: `off`, `first`, `all`, or `batched`. - `markdown`: optional Markdown rendering configuration for outbound Matrix text. - `streaming`: `off` (default), `partial`, `quiet`, `true`, or `false`. `partial` and `true` enable preview-first draft updates with normal Matrix text messages. `quiet` uses non-notifying preview notices for self-hosted push-rule setups. - `blockStreaming`: `true` enables separate progress messages for completed assistant blocks while draft preview streaming is active. diff --git a/docs/gateway/configuration-reference.md b/docs/gateway/configuration-reference.md index b11f34ba159..efc3bcbd221 100644 --- a/docs/gateway/configuration-reference.md +++ b/docs/gateway/configuration-reference.md @@ -646,8 +646,9 @@ Matrix is extension-backed and configured under `channels.matrix`. - Token auth uses `accessToken`; password auth uses `userId` + `password`. - `channels.matrix.proxy` routes Matrix HTTP traffic through an explicit HTTP(S) proxy. Named accounts can override it with `channels.matrix.accounts..proxy`. -- `channels.matrix.allowPrivateNetwork` allows private/internal homeservers. `proxy` and `allowPrivateNetwork` are independent controls. +- `channels.matrix.network.dangerouslyAllowPrivateNetwork` allows private/internal homeservers. `proxy` and this network opt-in are independent controls. - `channels.matrix.defaultAccount` selects the preferred account in multi-account setups. +- `channels.matrix.autoJoin` defaults to `off`, so invited rooms and fresh DM-style invites are ignored until you set `autoJoin: "allowlist"` with `autoJoinAllowlist` or `autoJoin: "always"`. - `channels.matrix.execApprovals`: Matrix-native exec approval delivery and approver authorization. - `enabled`: `true`, `false`, or `"auto"` (default). In auto mode, exec approvals activate when approvers can be resolved from `approvers` or `commands.ownerAllowFrom`. - `approvers`: Matrix user IDs (e.g. `@owner:example.org`) allowed to approve exec requests.