Skip to content

Rework how the configuration of marvin is done #71

@mosbth

Description

@mosbth

We have two bot protocols, irc and discord. They need separate settings and perhaps they have some common settings.

Today each bot has its own configuration as a dictionary in each bot and that is merged with the external config file, if such exists at startup.

The bot should work, if possible, with the default hard coded settings. That is to avoid the need of actual creating a separate config file.

It should be easy to start marvin, like this.

marvin irc
marvin discord

Some generic options should be available, such as:

marvin --help
marvin --version

The default configuration file could be named marvin.json and it should be possible to use another config file using cli.

marvin --config marvin2.json irc

An example of the generic and default configuration file can be like this.

{
    "general": {
        "dirIncoming": "work/incoming",
        "dirDone": "work/done"
    },
    "irc": {
        "server": "127.0.0.1",
        "port": 6667,
        "channel": "marvin",
        "nick": "marvin",
        "realname": "Marvin The All Mighty",
        "ident": null
    },
    "discord": {
        "token": ""
    }
}

An alternative, or complement, to a json config file could be .env, if that for some reason seems suitable.

We could support environment variables (without env) if needed. That could be useful for example when dealing with secrets. Each bot can have its own support for various environment variables.For example the irc bot could have IDENT and the discord bot could have TOKEN.

In the existing irc configuration we also have items like irclogfile, irclogmax and lastfm which might be removed.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions