[keyserver] Introduce getDBConfig that can source from environmental variables
Summary:
- As we Dockerize the keyserver, we need to make it possible to define config via environmental variables.
- In most of those cases, we can define the entire JSON file as an environmental variable.
- But for the case of the DB config, we'd like to be able to share a config style with the mysql Docker image, which uses separate environmental variables for each key
- So we're going to special-case DB config here
- The rest of the configs will be handled through importJSON in a following diff
Depends on D4025
Test Plan:
- Test to make sure the keyserver still runs and can load the website with db_config.json defined
- Test to make sure scripts that need DB access (such as reset-password.js) still runs with db_config.json defined
- In combination with a later diff I'll make sure to test that the environmental variables work too
Reviewers: palys-swm, atul
Reviewed By: palys-swm, atul
Subscribers: Adrian, yayabosh
Differential Revision: https://phabricator.ashoat.com/D4097