The hermes-bridge service is configured entirely through environment variables. Required values are validated on startup — a missing or malformed value fails fast with a descriptive error rather than starting in a broken state.
Variable Required Default Description DONUT_BOT_TOKEN✅ — The bridged bot’s donutbot_… token. DONUT_STREAM_URL✅ — Bot event WebSocket URL, e.g. wss://api.donutchat.com/bots/v1/stream. DONUT_SEND_URL✅ — Bot send API URL, e.g. https://api.donutchat.com/bots/v1/messages. DONUT_TYPING_URLoptional (empty) Typing-indicator URL, e.g. https://api.donutchat.com/bots/v1/typing. Empty disables the thinking indicator. BRIDGE_REPLY_CONTENT_TYPEoptional MDContent type for posted replies — MD (markdown) or TX (plain text).
Variable Required Default Description HERMES_BASE_URL✅ — Base URL of the Hermes OpenAI-compatible API server, e.g. http://hermes-host:8642. Keep it private. HERMES_API_KEY✅ — API key for the Hermes API server (API_SERVER_KEY on the Hermes box). HERMES_MODELoptional hermesModel name passed to /v1/chat/completions. BRIDGE_SYSTEM_PROMPToptional (empty) System prompt prepended to each conversation.
Variable Required Default Description BRIDGE_MAX_CONCURRENToptional 4Max parallel Hermes calls across chats . Must be ≥ 1. Within a single chat, messages are always serialized. BRIDGE_REQUEST_TIMEOUToptional 120sPer-call timeout for a Hermes request. Go duration syntax (e.g. 90s, 2m). Must be positive. BRIDGE_RESPOND_TO_BOTSoptional falseWhen false, the bridge ignores messages from other bots/webhooks/feeds — a loop guard. Set true only if you intentionally want bot-to-bot replies.
Variable Required Default Description BRIDGE_BREAKER_THRESHOLDoptional 3Consecutive Hermes failures that open the circuit breaker. Must be ≥ 1. BRIDGE_BREAKER_COOLDOWNoptional 60sHow long the breaker stays open before admitting one probe. Go duration syntax. Must be positive. BRIDGE_FALLBACK_MESSAGEoptional ⚠️ The agent is unavailable right now. Please try again later.Posted to a chat (rate-limited) when the breaker is open. Must be non-empty and ≤ 4000 bytes.
On startup the bridge rejects:
Any missing required variable (DONUT_BOT_TOKEN, DONUT_STREAM_URL, DONUT_SEND_URL, HERMES_BASE_URL, HERMES_API_KEY).
BRIDGE_MAX_CONCURRENT or BRIDGE_BREAKER_THRESHOLD less than 1.
A non-positive BRIDGE_REQUEST_TIMEOUT or BRIDGE_BREAKER_COOLDOWN.
A malformed integer / boolean / duration for any typed variable.
An empty or over-4000-byte BRIDGE_FALLBACK_MESSAGE.
Durations use Go syntax
Duration variables accept Go’s time.ParseDuration format: 30s, 90s, 2m, 1m30s. A bare number is not valid.
When deploying via infra/, these map onto the environment above:
Terraform variable Maps to Notes hermes_bridge_enabled(deploy toggle) false by default; set true to create the service + secret.hermes_bridge_bot_tokenDONUT_BOT_TOKENSensitive → Secrets Manager. hermes_bridge_api_keyHERMES_API_KEYSensitive → Secrets Manager. hermes_bridge_stream_urlDONUT_STREAM_URLPlain env var. hermes_bridge_send_urlDONUT_SEND_URLPlain env var. hermes_bridge_typing_urlDONUT_TYPING_URLPlain env var. hermes_bridge_hermes_base_urlHERMES_BASE_URLPlain env var; use a private address. hermes_bridge_modelHERMES_MODELPlain env var.