| 1 |
########################################################################## |
| 2 |
# # |
| 3 |
# This is the config-template for Err. This file should be copied and # |
| 4 |
# renamed to config.py, then modified as you see fit to run Errbot # |
| 5 |
# the way you like it. # |
| 6 |
# # |
| 7 |
# As this is a regular Python file, note that you can do variable # |
| 8 |
# assignments and the likes as usual. This can be useful for example if # |
| 9 |
# you use the same values in multiple places. # |
| 10 |
# # |
| 11 |
# Note: Various config options require a tuple to be specified, even # |
| 12 |
# when you are configuring only a single value. An example of this is # |
| 13 |
# the BOT_ADMINS option. Make sure you use a valid tuple here, even if # |
| 14 |
# you are only configuring a single item, else you will get errors. # |
| 15 |
# (So don't forget the trailing "," in these cases) # |
| 16 |
# # |
| 17 |
########################################################################## |
| 18 |
|
| 19 |
import logging |
| 20 |
|
| 21 |
########################################################################## |
| 22 |
# Core Errbot configuration # |
| 23 |
########################################################################## |
| 24 |
|
| 25 |
# BACKEND selection. |
| 26 |
# This configures the type of chat server you wish to use Errbot with. |
| 27 |
# |
| 28 |
# The current choices: |
| 29 |
|
| 30 |
# Debug backends to test your plugins manually: |
| 31 |
# "Text" - on the text console |
| 32 |
|
| 33 |
# Commercial backends: |
| 34 |
# "Slack" - see https://slack.com/ |
| 35 |
# "Gitter" - see https://gitter.im/ (follow instructions from https://github.com/errbotio/err-backend-gitter) |
| 36 |
|
| 37 |
# Open protocols: |
| 38 |
# "TOX" - see https://tox.im/ (follow instructions from https://github.com/errbotio/err-backend-tox) |
| 39 |
# "IRC" - for classic IRC or bridged services like https://gitter.im |
| 40 |
# "XMPP" - the Extensible Messaging and Presence Protocol (https://xmpp.org/) |
| 41 |
# "Telegram" - cloud-based mobile and desktop messaging app with a focus |
| 42 |
# on security and speed. (https://telegram.org/) |
| 43 |
|
| 44 |
# BACKEND = "Text" # defaults to Text |
| 45 |
|
| 46 |
# STORAGE selection. |
| 47 |
# This configures the type of persistence you wish to use Errbot with. |
| 48 |
# |
| 49 |
# The current choices: |
| 50 |
|
| 51 |
# Debug: |
| 52 |
# "Memory" - local memory storage to test your bot in memory: |
| 53 |
|
| 54 |
# Filesystem: |
| 55 |
# "Shelf" - python shelf (default) |
| 56 |
|
| 57 |
# STORAGE = "Shelf" # defaults to filestorage (python shelf). |
| 58 |
|
| 59 |
# BOT_EXTRA_STORAGE_PLUGINS_DIR = None # extra search path to find custom storage plugins |
| 60 |
|
| 61 |
# The location where all of Err's data should be stored. Make sure to set |
| 62 |
# this to a directory that is writable by the user running the bot. |
| 63 |
BOT_DATA_DIR = "/var/lib/err" |
| 64 |
|
| 65 |
### Repos and plugins config. |
| 66 |
|
| 67 |
# Set this to change from where errbot gets its installable plugin list. |
| 68 |
# By default it gets the index from errbot.io which is a file generated by tools/plugin-gen.py. |
| 69 |
# BOT_PLUGIN_INDEXES = "https://errbot.io/repos.json" |
| 70 |
# |
| 71 |
# You can also specify a local file: |
| 72 |
# BOT_PLUGIN_INDEXES = "tools/repos.json" |
| 73 |
# |
| 74 |
# Or a list. note: if some plugins exists in 2 lists, only the first hit will be taken into account. |
| 75 |
# BOT_PLUGIN_INDEXES = ("/data/repos.json", "https://my.private.tld/errbot/myrepos.json") |
| 76 |
|
| 77 |
# Set this to a directory on your system where you want to load extra |
| 78 |
# plugins from, which is useful mostly if you want to develop a plugin |
| 79 |
# locally before publishing it. Note that you can specify only a single |
| 80 |
# directory, however you are free to create subdirectories with multiple |
| 81 |
# plugins inside this directory. |
| 82 |
BOT_EXTRA_PLUGIN_DIR = None |
| 83 |
|
| 84 |
# If you use an external backend as a plugin, |
| 85 |
# this is where you tell Errbot where to find it. |
| 86 |
# BOT_EXTRA_BACKEND_DIR = "/opt/errbackends" |
| 87 |
|
| 88 |
# If you want only a subset of the core plugins that are bundled with errbot, you can specify them here. |
| 89 |
# CORE_PLUGINS = None # This is default, all core plugins. |
| 90 |
# For example CORE_PLUGINS = ("ACLs", "Backup", "Help") you get those names from the .plug files Name entry. |
| 91 |
# For absolutely no plug: CORE_PLUGINS = () |
| 92 |
|
| 93 |
# Defines an order in which the plugins are getting their callbacks. Useful if you want to have plugins do |
| 94 |
# pre- or post-processing on messages. |
| 95 |
# The "None" tuple entry represents all the plugins that aren't to be explicitly ordered. For example, if |
| 96 |
# you want "A" to run first, then everything else but "B", then "B", you would use ("A", None, "B"). |
| 97 |
PLUGINS_CALLBACK_ORDER = (None,) |
| 98 |
|
| 99 |
# Should plugin dependencies be installed automatically? If this is true |
| 100 |
# then Errbot will use pip to install any missing dependencies automatically. |
| 101 |
# |
| 102 |
# If you have installed Errbot in a virtualenv, this will run the equivalent |
| 103 |
# of `pip install -r requirements.txt`. |
| 104 |
# If no virtualenv is detected, the equivalent of `pip install --user -r |
| 105 |
# requirements.txt` is used to ensure the package(s) is/are only installed for |
| 106 |
# the user running Err. |
| 107 |
# AUTOINSTALL_DEPS = True |
| 108 |
|
| 109 |
# To use your own custom log formatter, uncomment and set BOT_LOG_FORMATTER |
| 110 |
# to your formatter instance (inherits from logging.Formatter) |
| 111 |
# For information on how to create a logging formatter and what it can do, see |
| 112 |
# https://docs.python.org/3/library/logging.html#formatter-objects |
| 113 |
# BOT_LOG_FORMATTER = |
| 114 |
|
| 115 |
# The location of the log file. If you set this to None, then logging will |
| 116 |
# happen to console only. |
| 117 |
BOT_LOG_FILE = BOT_DATA_DIR + "/err.log" |
| 118 |
|
| 119 |
# The verbosity level of logging that is done to the above logfile, and to |
| 120 |
# the console. This takes the standard Python logging levels, DEBUG, INFO, |
| 121 |
# WARN, ERROR. For more info, see http://docs.python.org/library/logging.html |
| 122 |
# |
| 123 |
# If you encounter any issues with Err, please set your log level to |
| 124 |
# logging.DEBUG and attach a log with your bug report to aid the developers |
| 125 |
# in debugging the issue. |
| 126 |
BOT_LOG_LEVEL = logging.INFO |
| 127 |
|
| 128 |
# Enable logging to sentry (find out more about sentry at www.getsentry.com). |
| 129 |
# You can also separate Flask exceptions by enabling it. This will give more information in sentry |
| 130 |
# This is optional and disabled by default. |
| 131 |
BOT_LOG_SENTRY = False |
| 132 |
BOT_LOG_SENTRY_FLASK = False |
| 133 |
SENTRY_DSN = "" |
| 134 |
SENTRY_LOGLEVEL = BOT_LOG_LEVEL |
| 135 |
SENTRY_EVENTLEVEL = BOT_LOG_LEVEL |
| 136 |
|
| 137 |
# Options that can be passed to sentry_sdk.init() at initialization time |
| 138 |
# Note that DSN should be specified via its dedicated config option |
| 139 |
# and that the 'integrations' setting cannot be set |
| 140 |
# e.g: SENTRY_OPTIONS = {"environment": "production"} |
| 141 |
SENTRY_OPTIONS = {} |
| 142 |
|
| 143 |
# Execute commands in asynchronous mode. In this mode, Errbot will spawn 10 |
| 144 |
# separate threads to handle commands, instead of blocking on each |
| 145 |
# single command. |
| 146 |
# BOT_ASYNC = True |
| 147 |
|
| 148 |
# Size of the thread pool for the asynchronous mode. |
| 149 |
# BOT_ASYNC_POOLSIZE = 10 |
| 150 |
|
| 151 |
########################################################################## |
| 152 |
# Account and chatroom (MUC) configuration # |
| 153 |
########################################################################## |
| 154 |
|
| 155 |
# The identity, or credentials, used to connect to a server |
| 156 |
BOT_IDENTITY = { |
| 157 |
## Text mode |
| 158 |
"username": "@errbot", # The name for the bot |
| 159 |
## XMPP (Jabber) mode |
| 160 |
# "username": "err@localhost", # The JID of the user you have created for the bot |
| 161 |
# "password": "changeme", # The corresponding password for this user |
| 162 |
# "server": ("host.domain.tld", 5222), # server override |
| 163 |
## Slack mode (comment the others above if using this mode) |
| 164 |
# "token": "xoxb-4426949411-aEM7...", |
| 165 |
## you can also include the proxy for the SlackClient connection |
| 166 |
# "proxies": {"http": "some-http-proxy", "https": "some-https-proxy"} |
| 167 |
## Telegram mode (comment the others above if using this mode) |
| 168 |
# "token": "103419016:AAbcd1234...", |
| 169 |
## IRC mode (Comment the others above if using this mode) |
| 170 |
# "nickname": "err-chatbot", |
| 171 |
# "username": "err-chatbot", # optional, defaults to nickname if omitted |
| 172 |
# "password": None, # optional |
| 173 |
# "server": "irc.freenode.net", |
| 174 |
# "port": 6667, # optional |
| 175 |
# "ssl": False, # optional |
| 176 |
# "ipv6": False, # optional |
| 177 |
# "nickserv_password": None, # optional |
| 178 |
## Optional: Specify an IP address or hostname (vhost), and a |
| 179 |
## port, to use when making the connection. Leave port at 0 |
| 180 |
## if you have no source port preference. |
| 181 |
## example: "bind_address": ("my-errbot.io", 0) |
| 182 |
# "bind_address": ("localhost", 0), |
| 183 |
} |
| 184 |
|
| 185 |
# Set the admins of your bot. Only these users will have access |
| 186 |
# to the admin-only commands. |
| 187 |
# |
| 188 |
# Unix-style glob patterns are supported, so "gbin@localhost" |
| 189 |
# would be considered an admin if setting "*@localhost". |
| 190 |
BOT_ADMINS = ("gbin@localhost",) |
| 191 |
|
| 192 |
# Set of admins that wish to receive administrative bot notifications. |
| 193 |
# BOT_ADMINS_NOTIFICATIONS = () |
| 194 |
|
| 195 |
# Chatrooms your bot should join on startup. For the IRC backend you |
| 196 |
# should include the # sign here. For XMPP rooms that are password |
| 197 |
# protected, you can specify another tuple here instead of a string, |
| 198 |
# using the format (RoomName, Password). |
| 199 |
# CHATROOM_PRESENCE = ("[email protected]",) |
| 200 |
|
| 201 |
# The FullName, or nickname, your bot should use. What you set here will |
| 202 |
# be the nickname that Errbot shows in chatrooms. Note that some XMPP |
| 203 |
# implementations are very picky about what name you use. |
| 204 |
# CHATROOM_FN = "Errbot" |
| 205 |
|
| 206 |
########################################################################## |
| 207 |
# Prefix configuration # |
| 208 |
########################################################################## |
| 209 |
|
| 210 |
# Command prefix, the prefix that is expected in front of commands directed |
| 211 |
# at the bot. |
| 212 |
# |
| 213 |
# Note: When writing plugins,you should always use the default "!". |
| 214 |
# If the prefix is changed from the default, the help strings will be |
| 215 |
# automatically adjusted for you. |
| 216 |
# |
| 217 |
# BOT_PREFIX = "!" |
| 218 |
# |
| 219 |
# Uncomment the following and set it to True if you want the prefix to be |
| 220 |
# optional for normal chat. |
| 221 |
# (Meaning messages sent directly to the bot as opposed to within a MUC) |
| 222 |
# BOT_PREFIX_OPTIONAL_ON_CHAT = False |
| 223 |
|
| 224 |
# You might wish to have your bot respond by being called with certain |
| 225 |
# names, rather than the BOT_PREFIX above. This option allows you to |
| 226 |
# specify alternative prefixes the bot will respond to in addition to |
| 227 |
# the prefix above. |
| 228 |
# BOT_ALT_PREFIXES = ("Err",) |
| 229 |
|
| 230 |
# If you use alternative prefixes, you might want to allow users to insert |
| 231 |
# separators like , and ; between the prefix and the command itself. This |
| 232 |
# allows users to refer to your bot like this (Assuming "Err" is in your |
| 233 |
# BOT_ALT_PREFIXES): |
| 234 |
# "Err, status" or "Err: status" |
| 235 |
# |
| 236 |
# Note: There's no need to add spaces to the separators here |
| 237 |
# |
| 238 |
# BOT_ALT_PREFIX_SEPARATORS = (":", ",", ";") |
| 239 |
|
| 240 |
# Continuing on this theme, you might want to permit your users to be |
| 241 |
# lazy and not require correct capitalization, so they can do "Err", |
| 242 |
# "err" or even "ERR". |
| 243 |
# BOT_ALT_PREFIX_CASEINSENSITIVE = True |
| 244 |
|
| 245 |
########################################################################## |
| 246 |
# Access controls and message diversion # |
| 247 |
########################################################################## |
| 248 |
|
| 249 |
# Access controls, allowing commands to be restricted to specific users/rooms. |
| 250 |
# Available filters (you can omit a filter or set it to None to disable it): |
| 251 |
# allowusers: Allow command from these users only |
| 252 |
# denyusers: Deny command from these users |
| 253 |
# allowrooms: Allow command only in these rooms (and direct messages) |
| 254 |
# denyrooms: Deny command in these rooms |
| 255 |
# allowargs: Allow a command's argument from these users only |
| 256 |
# denyargs: Deny a command's argument from these users |
| 257 |
# allowprivate: Allow command from direct messages to the bot |
| 258 |
# allowmuc: Allow command inside rooms |
| 259 |
# Rules listed in ACCESS_CONTROLS_DEFAULT are applied by default and merged |
| 260 |
# with any commands found in ACCESS_CONTROLS. |
| 261 |
# |
| 262 |
# The options allowusers, denyusers, allowrooms and denyrooms, allowargs, |
| 263 |
# denyargs support unix-style globbing similar to BOT_ADMINS. |
| 264 |
# |
| 265 |
# Command names also support unix-style globs and can optionally be restricted |
| 266 |
# to a specific plugin by prefixing the command with the name of a plugin, |
| 267 |
# separated by a colon. For example, `Health:status` will match the `!status` |
| 268 |
# command of the `Health` plugin and `Health:*` will match all commands defined |
| 269 |
# by the `Health` plugin. |
| 270 |
# |
| 271 |
# Please note that the first command match found will be used so if you have |
| 272 |
# overlapping patterns you must used an OrderedDict instead of a regular dict: |
| 273 |
# https://docs.python.org/3/library/collections.html#collections.OrderedDict |
| 274 |
# |
| 275 |
# Example: |
| 276 |
# |
| 277 |
# ACCESS_CONTROLS_DEFAULT = {} # Allow everyone access by default |
| 278 |
# ACCESS_CONTROLS = { |
| 279 |
# "status": { |
| 280 |
# "allowrooms": ("[email protected]",), |
| 281 |
# }, |
| 282 |
# "about": { |
| 283 |
# "denyusers": ("*@evilhost",), |
| 284 |
# "allowrooms": ("[email protected]", "[email protected]"), |
| 285 |
# }, |
| 286 |
# "uptime": {"allowusers": BOT_ADMINS}, |
| 287 |
# "help": {"allowmuc": False}, |
| 288 |
# "ChatRoom:*": {"allowusers": BOT_ADMINS}, |
| 289 |
# } |
| 290 |
|
| 291 |
# Uncomment and set this to True to hide the restricted commands from |
| 292 |
# the help output. |
| 293 |
# HIDE_RESTRICTED_COMMANDS = False |
| 294 |
|
| 295 |
# Uncomment and set this to True to ignore commands from users that have no |
| 296 |
# access for these instead of replying with error message. |
| 297 |
# HIDE_RESTRICTED_ACCESS = False |
| 298 |
|
| 299 |
# A list of commands which should be responded to in private, even if |
| 300 |
# the command was given in a MUC. For example: |
| 301 |
# DIVERT_TO_PRIVATE = ("help", "about", "status") |
| 302 |
# If all commands are desired, use the specical case "ALL_COMMANDS" |
| 303 |
DIVERT_TO_PRIVATE = () |
| 304 |
|
| 305 |
# A list of commands which should be responded to in a thread if the backend supports it. |
| 306 |
# For example: |
| 307 |
# DIVERT_TO_THREAD = ("help", "about", "status") |
| 308 |
# If all commands are desired, use the specical case "ALL_COMMANDS" |
| 309 |
DIVERT_TO_THREAD = () |
| 310 |
|
| 311 |
# Chat relay |
| 312 |
# Can be used to relay one to one message from specific users to the bot |
| 313 |
# to MUCs. This can be useful with XMPP notifiers like for example the |
| 314 |
# standard Altassian Jira which don't have native support for MUC. |
| 315 |
# For example: CHATROOM_RELAY = {"gbin@localhost" : (_TEST_ROOM,)} |
| 316 |
CHATROOM_RELAY = {} |
| 317 |
|
| 318 |
# Reverse chat relay |
| 319 |
# This feature forwards whatever is said to a specific user. |
| 320 |
# It can be useful if you client like gtalk doesn't support MUC correctly |
| 321 |
# For example: REVERSE_CHATROOM_RELAY = {_TEST_ROOM : ("gbin@localhost",)} |
| 322 |
REVERSE_CHATROOM_RELAY = {} |
| 323 |
|
| 324 |
########################################################################## |
| 325 |
# Miscellaneous configuration options # |
| 326 |
########################################################################## |
| 327 |
|
| 328 |
# Define the maximum length a single message may be. If a plugin tries to |
| 329 |
# send a message longer than this length, it will be broken up into multiple |
| 330 |
# shorter messages that do fit. |
| 331 |
# MESSAGE_SIZE_LIMIT = 10000 |
| 332 |
|
| 333 |
# XMPP TLS certificate verification. In order to validate offered certificates, |
| 334 |
# you must supply a path to a file containing certificate authorities. By |
| 335 |
# default, "/etc/ssl/certs/ca-certificates.crt" is used, which on most Linux |
| 336 |
# systems holds the default system trusted CA certificates. You might need to |
| 337 |
# change this depending on your environment. Setting this to None disables |
| 338 |
# certificate validation, which can be useful if you have a self-signed |
| 339 |
# certificate for example. |
| 340 |
# XMPP_CA_CERT_FILE = "/etc/ssl/certs/ca-certificates.crt" |
| 341 |
|
| 342 |
# Influence the security methods used on connection with XMPP-based |
| 343 |
# backends. You can use this to work around authentication issues with |
| 344 |
# some buggy XMPP servers. |
| 345 |
# |
| 346 |
# The default is to try anything: |
| 347 |
# XMPP_FEATURE_MECHANISMS = {} |
| 348 |
# To use only unencrypted plain auth: |
| 349 |
# XMPP_FEATURE_MECHANISMS = { |
| 350 |
# "use_mech": "PLAIN", |
| 351 |
# "unencrypted_plain": True, |
| 352 |
# "encrypted_plain": False, |
| 353 |
# } |
| 354 |
|
| 355 |
# Modify the default keep-alive interval. By default, Errbot will send |
| 356 |
# some whitespace to the XMPP server every 300 seconds to keep the TCP |
| 357 |
# connection alive. On some servers, or when running Errbot from behind |
| 358 |
# a NAT router, the default might not be fast enough and you will need |
| 359 |
# to set it to a lower value. |
| 360 |
# |
| 361 |
# If you're having issues with your bot getting constantly disconnected, |
| 362 |
# try to gradually lower this value until it no longer happens. |
| 363 |
# XMPP_KEEPALIVE_INTERVAL = 300 |
| 364 |
|
| 365 |
# Modify default settings for IPv6 usage. This key affects the XMPP backend. |
| 366 |
# XMPP_USE_IPV6 = False |
| 367 |
|
| 368 |
# XMPP supports some formatting with XEP-0071 (http://www.xmpp.org/extensions/xep-0071.html). |
| 369 |
# It is disabled by default because XMPP clients support has been found to be spotty. |
| 370 |
# Switch it to True to enable XHTML-IM formatting. |
| 371 |
# XMPP_XHTML_IM = False |
| 372 |
|
| 373 |
# Message rate limiting for the IRC backend. This will delay subsequent |
| 374 |
# messages by this many seconds (floats are supported). Setting these |
| 375 |
# to a value of 0 effectively disables rate limiting. |
| 376 |
# IRC_CHANNEL_RATE = 1 # Regular channel messages |
| 377 |
# IRC_PRIVATE_RATE = 1 # Private messages |
| 378 |
# IRC_RECONNECT_ON_KICK = 5 # Reconnect back to a channel after a kick (in seconds) |
| 379 |
# Put it at None if you don't want the chat to |
| 380 |
# reconnect |
| 381 |
# IRC_RECONNECT_ON_DISCONNECT = 5 # Reconnect back to a channel after a disconnection (in seconds) |
| 382 |
|
| 383 |
# The pattern to build a user representation from for ACL matches. |
| 384 |
# The default is "{nick}!{user}@{host}" which results in "[email protected]" |
| 385 |
# for the user zoni connecting from ams1.groenen.me. |
| 386 |
# Available substitution variables: |
| 387 |
# {nick} -> The nickname of the user |
| 388 |
# {user} -> The username of the user |
| 389 |
# {host} -> The hostname the user is connecting from |
| 390 |
# IRC_ACL_PATTERN = "{nick}!{user}@{host}" |
| 391 |
|
| 392 |
# Allow messages sent in a chatroom to be directed at requester. |
| 393 |
# GROUPCHAT_NICK_PREFIXED = False |
| 394 |
|
| 395 |
# Disable table borders, making output more compact (supported only on IRC, Slack and Telegram currently). |
| 396 |
# COMPACT_OUTPUT = True |
| 397 |
|
| 398 |
# Disables the logging output in Text mode and only outputs Ansi. |
| 399 |
# TEXT_DEMO_MODE = False |
| 400 |
|
| 401 |
# Prevent ErrBot from saying anything if the command is unrecognized. |
| 402 |
# SUPPRESS_CMD_NOT_FOUND = False |