Open cdunklau opened 5 years ago
Config object appears not to be mutated externally except for the config_loc and dbpool attribute.
Extra attributes:
config_loc
: path to config file that was loaded, set by infobat.servicedbpool
: database.InfobatDatabaseRunner instance, set by infobat.serviceConfig file is a JSON object, structured as follows:
irc
: Object with keys:
ssl
: Should we use SSL (boolean)? Default false.server
: IRC server address (str). Required.port
: IRC server port (int). Default 6667.nickname
: Nick (str). Required.password
: Password to send by PASS command (str). Default null.autojoin
: List of channel names to join automatically. Required.nickserv_pw
: Password to use for identifying with NickServ. Use a false value to prevent identify attempt.channels
: maps channel name => channel config.
defaults
: Special section storing defaults for channels. Same format as the channel config object.$CHANNEL
: A channel config. Keys are:
have_ops
: Boolean, appears to enable ban managementanti_redirect
: Appears to be used as an alternate channel name, not sure what it does. It's related to joining channels.commands
: This one is tricky. Looks kinda like an ACL. It's an array of arrays, each inner array having either 'allow' or 'deny' as the first element. Subsequent elements appear to be "features" (not just commands) that are either enabled or disabled for the given channel. Using 'all' appears to be shorthand for "all features".flood_control
: Apparently unusedkey
: "Key" (i.e. password) for joining the channel.default_ban_time
: Duration to use for bans, in seconds (account-bans and those pulled from server's banlist).misc
: Object with keys:
locale
:
dir
: Directory containing gettext locale data. Default is the locale dir within the infobat package.default_lang
: Default translations language. Default value is 'en'.default_encoding
: Default encoding for translations, unknown if it affects anything else. Default value is 'utf-8'.manhole
:
socket
: Path to a UNIX socket to use for manhole. Default null.passwd_file
: Path to the passwd database for manhole. Default null.magic8_file
: unused
web
port
: Web UI portroot
: Templates directory for web UIurl
: Base URL to use for sending links to web UI, without the trailing slashdatabase
sqlite
db_file
: Path to the sqlite3 database file
After #7 is fixed, configuration should be formalized somewhat to make it easier to see what's required, optional, etc. A few
attrs
classes should do the trick, perhaps with marshmallow or similar to do the config validation.There is some leftover cruft in the example config file, e.g. database.dbm (for long-removed markov chain), misc.magic8_file, and the "divine" command in the channel ACLs.
There are also some required things missing from the config file, although these should probably be optional and just use defaults if not provided:
Tasks: