SnowLuma

Configuration

OneBot instance config and runtime config file reference

SnowLuma stores configuration in two JSON files:

  • config/onebot.json + config/onebot_<uin>.json — OneBot network adapters (HTTP/WebSocket listeners, reverse WS, HTTP event reporting).
  • config/runtime.json — process-level settings (WebUI port, auto-injection toggle).

Both files are auto-generated on first run and normalized on every load.

OneBot config

File locations

config/onebot.json          # global defaults
config/onebot_<uin>.json    # per-account overrides
  • Global: config/onebot.json — the default for every account.
  • Per-account: config/onebot_<uin>.json — overrides the global file.
  • Auto-generated: missing per-account config or access tokens are written automatically in normalized form on first run.

Default config

Adapters are grouped by kind under a single networks object:

{
  "networks": {
    "httpServers": [
      {
        "name": "http-default",
        "enabled": true,
        "host": "0.0.0.0",
        "port": 3000,
        "path": "/",
        "accessToken": "auto-generated",
        "messageFormat": "array",
        "reportSelfMessage": false
      }
    ],
    "httpClients": [],
    "wsServers": [
      {
        "name": "ws-default",
        "enabled": true,
        "host": "0.0.0.0",
        "port": 3001,
        "path": "/",
        "role": "Universal",
        "accessToken": "auto-generated",
        "messageFormat": "array",
        "reportSelfMessage": false
      }
    ],
    "wsClients": []
  },
  "musicSignUrl": ""
}

Info

Migrating from the old format: earlier versions kept httpServers / wsServers arrays at the top level and used httpPostEndpoints for reporting. SnowLuma detects this layout, moves the entries into the networks object, renames httpPostEndpoints to httpClients, and writes the result back to disk. If you maintain configs by hand, use the new shape.

Shared fields

Every adapter accepts these (NetworkBase):

FieldTypeDefaultNotes
namestringrequiredIdentifier unique within its kind array; hot-reload addresses it by (kind, name).
enabledbooltrueSet false to keep the configuration but skip starting this adapter.
accessTokenstringautoOneBot bearer / ?access_token=.
messageFormatstringarrayarray or string — controls whether the event message field is a segment array or a flattened string.
reportSelfMessageboolfalseWhen true, this adapter sees post_type='message_sent' events.

httpServers

OneBot HTTP API listener.

FieldTypeDefaultNotes
hoststring0.0.0.0Bind address.
portnumber3000Listen port.
pathstring/API path prefix.

httpClients

Push events to external endpoints (formerly httpPostEndpoints).

FieldTypeDefaultNotes
urlstringrequiredReport URL.
timeoutMsnumber5000Request timeout.

wsServers

OneBot WebSocket server.

FieldTypeDefaultNotes
hoststring0.0.0.0Bind address.
portnumber3001Listen port.
pathstring/WebSocket path.
rolestringUniversalApi, Event, or Universal (TitleCase; older lowercase values are no longer accepted).

wsClients

Connect outbound to reverse WebSocket servers.

FieldTypeDefaultNotes
urlstringrequiredReverse WebSocket URL.
rolestringUniversalSame values as wsServers.role.
reconnectIntervalMsnumber5000Reconnect interval; clamped to a 1000 minimum.

musicSignUrl

Optional URL for a custom music-card signing service. Empty string disables.

Runtime config (runtime.json)

config/runtime.json carries process-wide settings — not per-account.

{
  "webuiPort": 5099,
  "hookAutoLoad": false
}
FieldTypeDefaultNotes
webuiPortnumber5099WebUI listen port; out-of-range values fall back to the default.
hookAutoLoadboolfalseAuto-inject the hook into every newly discovered QQ process. The Docker image flips this on.

Environment variables

VarNotes
SNOWLUMA_HOOK_AUTOLOAD1 / true forces auto-injection on; 0 / false off. Wins over runtime.json, which makes Docker overrides ergonomic.
SNOWLUMA_LOG_LEVELLog level (error / warn / info / debug).
SNOWLUMA_VERBOSE_WARMUP=1Verbose friend / group / member warm-up logs.
SNOWLUMA_DEV_MODE=1Enable dev mode (relaxes WebUI auth for local debugging).
SNOWLUMA_DEV_WEBUI=1Force-start the bundled WebUI under dev mode.

Port conflicts

If 3000 / 3001 / 5099 are taken, change the matching port / webuiPort and restart. Docker users can also remap host ports via Compose (see Docker deployment).

Was this page helpful?

Last updated on

On this page