nickthecook / ops

The operations team for your project.
GNU General Public License v3.0
50 stars 1 forks source link

Fall back to `.json` secrets file if `.ejson` file cannot be found #13

Closed nickthecook closed 4 years ago

nickthecook commented 4 years ago

By default, ops will load secrets from config/$environment/secrets.ejson. If this file does not exist, it will load secrets from config/$environment/secrets.json. This allows the development environment to have unencrypted secrets (which is safe because development secrets should not be checked in).

However, if the user overrides the secrets file path with options.secrets.path, this fall-back-to-json logic is not employed.

Even if a repo changed the path to the secrets file, it is still likely that there would be different secrets for different environments, and that the development secrets would still not be committed to source control. Therefore, the fallback-to-json logic should be used in this case as well.

E.g., with the following options:

options:
  secrets:
    path: "secrets/$environment.ejson"

ops should look for that file first, and, if it does not exist, look for secrets/$environment.json.

nickthecook commented 4 years ago

Fixed in 0.4.0.