Closed filler closed 7 years ago
Hi, and thanks for the kind words!
slack-irc was actually configured solely with environment variables in the beginning, but I changed it when channel mappings and similar were introduced, as it quickly got quite complex. I've thought of allowing the configuration to be passed in through one large env variable before, i.e. something like JSON_CONFIG="{"nickname": "nick, "server": "irc.freenode.net", ... }"
.
However, if you don't mind adding an extra file to your Docker image this can be done today by using a JS config file, instead of JSON: Example:
module.exports = {
nickname: process.env.NICKNAME,
server: process.env.IRC_SERVER,
token: process.env.SLACK_TOKEN,
channelMapping: JSON.parse(process.env.CHANNEL_MAPPING), // pass the mapping as a JSON string
ircOptions: JSON.parse(process.env.IRC_OPTIONS) // or create specific env variables for the underlying options
};
In support of making things more shareable and more like a 12-factor app, it would be great to be able to pass in some bits from
config.json
at runtime as opposed to flat-file. This could include secrets like the slack token, any SASL creds. Also any site-specificity in terms of channel maps, botnicks, etc.Doing this would allow someone who Docker-ize's the app to pass in environment variables at runtime, keeping them out of
config.json
, making the code more 'shareable' and less of risk should it be compromised.Looking over my existing
config.json
, I would love to externalize the following:My node-fu is pretty weak, but it looks like this isnt possible now. If it is, please do let me know!
Thanks for this awesome project. 👍 💯 ✨ 🌟