Skip to content
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

240 config vars #269

Merged
merged 15 commits into from
Jul 31, 2018
Merged

240 config vars #269

merged 15 commits into from
Jul 31, 2018

Conversation

senorprogrammer
Copy link
Collaborator

@senorprogrammer senorprogrammer commented Jul 31, 2018

Before this change, all module API keys and sensitive configuration had to be done via ENV vars, which sucks for lots of reasons, chief among them:

  • Configuration in multiple places
  • Not very easy to remove from the machine
  • Leaky, anything else running has access to them
  • Blocks support for multiple instances of the same module

This change supports sensitive configuration in the config.yml file. If the necessary value cannot be found there, then it falls back to looking for an ENV var.

Example implementation:

func (widget *Widget) loadAPICredentials() {
   widget.APIKey = wtf.Config.UString(
     "wtf.mods.weather.apiKey",
     os.Getenv("WTF_OWM_API_KEY"),
   )
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant