-
Notifications
You must be signed in to change notification settings - Fork 238
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
Add the ability to run dev locally using environment variables #82
Conversation
in order not to modify the `config.json`
1. `DRSS_BOT_CONTROLLER` is missing in `app.json` manifest, maybe meant `DRSS_BOT_CONTROLLER_IDS` ? 2. `.replace(' ', '')` doesn't make sense because it replaces only the first occurrence 3. Simple array creation without internal spaces 4. Heroku config vars parser should trim leading and trailing spaces by itself, if not, then in this case it is necessary to trim all vars
@synzen what do you think? |
sorry for the late reply - I have time to review this now. This seems interesting, I didn't know there was a module like that. But I am wondering what the use case here for dotenv is though? I can't think of a reason other than it being an added complication to something that already works (also yes, the controllers variable was a typo, thanks) |
This is mainly intended for developers who want to contribute. Config varies across devs, code does not This is also useful for running Heroku app locally, since it reads configuration variables from a .env file: Glitch also uses a .env file |
Right, but when I say "added complication to something that already works", the "already works" part I'm referring to is the config json. A couple problems to list that I see this are
For heroku in particular, it gives you an interface to input those variables, which is great - they put into the process environment. But if you're modifying the .env file to change variables anyways, why not just change config.json in the first place? |
CONFIG={"log":{"dates":true,"linkErrs":true,"unfiltered":true,"failedFeeds":true},"bot":{"token":"","enableCommands":true,"prefix":"~","status":"online","activityType":"","activityName":"","streamActivityURL":"","controllerIds":[""],"menuColor":5285609,"deleteMenus":false,"exitOnSocketIssues":false,"commandAliases":{}},"database":{"uri":"mongodb://localhost:27017/rss","connection":{},"clean":false,"articlesExpire":14,"guildBackupsExpire":7},"feeds":{"refreshTimeMinutes":15,"checkTitles":false,"timezone":"America/New_York","dateFormat":"ddd, D MMMM YYYY, h:mm A z","dateLanguage":"en","dateLanguageList":["en"],"dateFallback":false,"timeFallback":false,"failLimit":0,"notifyFail":true,"sendOldOnFirstCycle":true,"cycleMaxAge":1,"defaultMessage":":newspaper: | **{title}**\n\n{link}\n\n{subscriptions}","imgPreviews":true,"imgLinksExistence":true,"checkDates":true,"formatTables":false,"toggleRoleMentions":false},"advanced":{"shards":2,"batchSize":400,"processorMethod":"concurrent","parallel":2}} const config = JSON.parse(process.env.CONFIG) But again, we don't need to store the entire config in About Heroku, it prunes If you don't want to use Hiroku CLI you can use And I’ll repeat it again, this is necessary:
|
Ah I see now, thanks 👍 |
in order not to modify the
config.json
_IDS
)?