-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework how the configuration of marvin is done #71
Comments
i like the .env file (combined with environment variables) better than the json file. |
Ok, if moving on with dotenv, the config file would look something like this. # In all environments, the following files are loaded if they exist,
# the latter taking precedence over the former:
#
# * .env contains default values for the environment variables needed by the app
# * .env.local uncommitted file with local overrides
# * .env.$APP_ENV committed environment-specific defaults
# * .env.$APP_ENV.local uncommitted environment-specific overrides
#
# Real environment variables win over .env files.
#
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
# General for any bot
DIR_INCOMING="work/incoming"
DIR_DONE="work/done"
# Bot irc specifics
IRC_SERVER="127.0.0.1"
IRC_PORT=6667
IRC_CHANNEL="marvin"
IRC_NICK="marvin"
IRC_REAL_NAME="Marvin The All Mighty"
IRC_IDENT=
# Bot discord specifics
DISCORD_TOKEN= |
maybe we should prefix the "framework" related config with "MARVIN" or "BOT" or something, and in case we have config for plugins they can have the plugin name in uppercase as prefix? |
Sounds nice. All fine with me. All and all, I guess/feel dotenv is better than json in many aspects for this configuration, so lets move on with that. |
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.
Some generic options should be available, such as:
The default configuration file could be named
marvin.json
and it should be possible to use another config file using cli.An example of the generic and default configuration file can be like this.
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 haveTOKEN
.In the existing irc configuration we also have items like
irclogfile
,irclogmax
andlastfm
which might be removed.The text was updated successfully, but these errors were encountered: