Reading Meteor.settings from a file in meteor bundles

Unlike meteor run and meteor deploy, bundles built with meteor build read Meteor.settings from an environment variable containing literal JSON, rather than a path to a JSON file. There’s been some discussion about this, with no clear response from MDG.

I’d like to submit a pull request that would add support for a METEOR_SETTINGS_FILE environment variable. If this environment variable is defined at startup, Meteor would treat it as a path to a JSON file containing data for Meteor.settings. This change would involve a small amount of additional code in server_environment.js in the meteor package Before I implement this, I’d like to raise a few issues for discussion:

  1. Are there any objections to this proposal?
  2. server_environment_test.js does not contain tests for METEOR_SETTINGS. Are there tests for it? What’s the best testing strategy for this change?
  3. What should be the behavior be if both METEOR_SETTINGS_FILE and METEOR_SETTINGS are defined? Use METEOR_SETTINGS? Throw an error? Shallow merge? Deep merge?