These configuration files are provided for ease-of-life testing or local instances. It is highly recommended that for publicly accessible instances the configuration is set via environment variables and these files are removed.
To indicate the bot should retrieve its configuration from file use the
-bearnbotcfg
command line argument:
node bearnbot.js -bearnbotcfg
If you wish to use a specific configuration file specify it by using the
-bearnbotcfg
command line argument with a path to the configuration file:
node bearnbot.js -bearnbotcfg="/path/to/config.json"
The configuration file must be properly formatted JSON containing an object with the following items:
This is the domain under which the webserver is being ran. It must be a validly
registered domain, localhost
, or an ip address.
"domain": "localhost"
Currently used to indicate if the webserver can receive https requests.
"ssl": false
Contains information related to the mongodb database to which data will be wrote
The username and password used to access the database. If one is specified the other must also be specified
The address to the database server
The port of which to use when connecting to the database server. If not
specified it defaults to 27017
"database": {
"username": "JohnDoe",
"password": "xyz789",
"address": "example.com",
"port": 27017
}
Contains information related to your beam oauth application.
The client_id beam assigned to your app
The client_secret beam assigned to your app
"api": {
"clientid": "abc123",
"clientsecret": "987zyx"
}
Contains data related to the webserver component should be loaded
Indicates if the webserver component should be loaded
The adapter address to bind listening connections to.
The port on which to listen for incoming connections.
Defaults to port 80
"webserver": {
"enable": true
"address": "127.0.0.1",
"port": 80
}
Contains data related to the beam chat-bot component
Indicates if the chatbot should be loaded.
The username and password the bot will use as its default login to beam.
Required if chatbot is enabled
"chatbot": {
"enable": true
"username": "BearnBot",
"password": "321cba"
}
Contains data related to logging
Indicates that logging should be enabled
The directory to store logs in.
Defaults to /logs
Indicates the logging level; more severe levels log more information
Valid options: error
, info
, verbose
, debug
Defaults to info
"logging": {
"enable": true,
"directory": "/logs",
"level": "debug"
}
{
"domain": "localhost",
"ssl" : false,
"database":{
"address" : "database_address",
"port" : "port",
"username": "database_username",
"password": "database_password"
},
"api": {
"clientid": "your client_id_from_beam",
"clientsecret": "your_client_secret_from_beam"
},
"webserver": {
"enable" : true,
"address": "127.0.0.1",
"port" : 80
},
"chatbot": {
"enable": true,
"username": "Bot's Beam username",
"password": "Bot's Beam password"
},
"logging":{
"enable": true,
"directory": "/logs",
"level": "debug"
}
}