movableink / doorman

HTTP Proxy + OAuth
MIT License
167 stars 52 forks source link

Add Doorman config file initialized from environment vars #27

Open pataquets opened 9 years ago

pataquets commented 9 years ago

As I'm working on dockerizing Doorman, being able to start it loading config from env vars is the easiest and simplest solution and the most flexible. My proposal does not involve changing code, but adding a conf.environment.js file to copy as conf.js for scenarios where it is needed. Most of the config params are covered. It works successfully for me for GitHub auth by running Doorman like this:

$ DOORMAN_SECRET=AeV8Thaieel0Oor6shainu6OUfoh3ohwZaemohC0Ahn3guowieth2eiCkohhohG4 \
DOORMAN_LISTEN_PORT=8085 \
DOORMAN_GITHUB_APPID=my_gh_appid DOORMAN_GITHUB_APPSECRET=my_gh_appsecret \
DOORMAN_GITHUB_REQUIRED_ORGANIZATION=MyOrganization \
DOORMAN_GOOGLE_REQUIRED_DOMAIN=mydomain.com \
DOORMAN_PROXY_HOST=example.com DOORMAN_PROXY_PORT=80 \
npm start
pataquets commented 8 years ago

Since the referenced PR is already merged, I think this issue can be closed, unless it is meant to keep it open awaiting multi-domain support.