xworkmate-bridge/example/config.yaml
2026-06-01 11:27:58 +08:00

60 lines
2.4 KiB
YAML

# Example configuration for xworkmate-bridge public ingress and provider sync.
#
# Usage:
# BRIDGE_CONFIG_PATH=config.yaml ./xworkmate-bridge serve
# Upstream provider endpoints
# Priority: YAML > Environment Variable (e.g. CODEX_RPC_URL) > Default Constants
upstream:
codex_url: "ws://127.0.0.1:9001"
gemini_url: "ws://127.0.0.1:8791"
hermes_url: "ws://127.0.0.1:3920"
gateway_url: "ws://127.0.0.1:18789/"
opencode_url: "ws://127.0.0.1:38992"
openclaw_gateway:
max_active: 5
max_queued: 20
queue_timeout: "10m"
# Lightweight distributed bridge forwarding.
# A dual-node topology can keep both bridge nodes explicit while only enabling
# task forwarding from the node that sets task_forward_peer_id.
# Public plaintext HTTP is rejected; use HTTPS on public paths, or HTTP only on
# loopback/private/link-local VPN addresses where the tunnel provides encryption.
# bridge_endpoint is the peer bridge base URL; /gateway/openclaw or /acp/rpc is
# appended from the inbound request path when forwarding is enabled.
distributed:
topology: "dual-node"
local_node_id: "cn-xworkmate-bridge"
task_forward_peer_id: "xworkmate-bridge"
nodes:
- id: "xworkmate-bridge"
role: "primary"
public_base_url: "https://xworkmate-bridge.svc.plus"
bridge_endpoint: "http://172.29.10.1:8787"
- id: "cn-xworkmate-bridge"
role: "edge"
public_base_url: "https://cn-xworkmate-bridge.svc.plus"
bridge_endpoint: "http://172.29.10.2:8787"
# Optional direct override. Leave empty when using the topology above.
task_forward_endpoint: ""
# Optional. Defaults to BRIDGE_AUTH_TOKEN when omitted.
task_forward_token: ""
# Legacy/Reference structure (Normally managed via code constants or environment)
bridge:
listenAddr: 127.0.0.1:8787
# Token should be set via BRIDGE_AUTH_TOKEN env for security
allowedOrigins:
- https://xworkmate.svc.plus
- http://localhost:*
- http://127.0.0.1:*
notes:
- The bridge reads its own auth token from BRIDGE_AUTH_TOKEN.
- Upstream URLs can include sub-paths which will be preserved during WebSocket handshake.
- Multi-agent and Single-agent modes will use these endpoints to delegate tasks.
- Distributed task forwarding rejects public plaintext HTTP; use HTTPS or private VPN HTTP(S) endpoints.
- task_forward_endpoint can point at a WireGuard-over-VLESS/TCP/TLS local/private bridge address for GFW or carrier UDP blocking environments.