Skip to content

Configuring

Colin Hall-Coates edited this page Apr 22, 2016 · 8 revisions

Make Stumble yours.

The Config

Stumble instances are configured by way of a simple JavaScript object.

For users of stumble-cli , the configuration object should be contained in a JSON file. It is passed to the command line application with the --config (-c) flag.

For direct users of stumble, the configuration object can be written directly in JS, or included (with require) from a JSON file. It is passed as the first and only argument to the Stumble constructor.

The rest of the document will be an outline followed by explanations of each key & value in the configuration object. Basic understanding of valid JSON types and structure will help out here, but it’s pretty straight forward.

See example.json for additional syntax hints.

Explanations

This section explains individual parts of the configuration object.

Note that:

  • All property names (keys) are case sensitive. extensions is not the same as Extensions, and Stumble will make no attempts to spot these mistakes for you.

  • Valid JSON requires double quotes around all property names, but JS does not. This document will generally use JSON syntax in examples, since it is valid in both contexts.

  • Three dots …​ indicate that data has been omitted for brevity. Take this as a fill in the blanks kind of hint.

  • Any time a path is involved, unless it is absolute, it is resolved relative to the current working directory responsible for executing whatever ultimately starts Stumble. Care must be taken to ensure that your paths are correct. When in doubt, use absolute paths.

operator

  • Type: String

  • Required

  • Example: "operator": "!"

The operator is the string value that commands should be prefixed with, differentiating them from regular messages.

echo a regular message, ignored by Stumble.

!echo a command, and it's message body.

mumble

  • Type: Object

  • Required

  • Example: "mumble": { …​ }

The mumble object contains properties pertaining to connecting to the target mumble server, and providing identification for Stumble.

server

  • Type: String

  • Required

  • Example: "server": "127.0.0.1"

The server is a string value representing the address of the Mumble server to connect to. mumble:// is prefixed internally, so you should not include it in the address.

port

  • Type: Number (Integer)

  • Required

  • Example: "port": 64738

The port is an integer value specifying the port of the Mumble server to connect to.

username

  • Type: String

  • Required

  • Example: "username": "A Stumble Bot"

The username is a string value representing the user name Stumble will identify as, in the Mumble server. It must adhere to the user name rules set by the server.

password

  • Type: String

  • Optional-ish

  • Example: "password": "super secret !"

The password is a string value representing the password Stumble will use to access the Mumble server. If the server has no password, this should be set as the empty string ("").

The password is plain text. To avoid having plain text passwords floating around:

  • create a key and cert

  • use the password to connect to the Mumble server once

  • register Stumble in the server

Afterwards this field can be omitted.

key

  • Type: String

  • Optional

  • Example: "key": "id/key.pem"

The key is a string value representing the path to an SSL key file.

cert

  • Type: String

  • Optional

  • Example: "key": "id/cert.pem"

The cert is a string value representing the path to an SSL certificate file.

Clone this wiki locally