Skip to content
This repository was archived by the owner on Sep 25, 2020. It is now read-only.
This repository was archived by the owner on Sep 25, 2020. It is now read-only.

./config/secrets loading interface and order needs to match the ./config loading interface and order #19

@lxe

Description

@lxe

I think we need to change the current interface of loading secrets in the context of environments.

We used to load config/secrets/secrets.json regardless of NODE_ENV, but after #17, secrets/secrets.json gets loaded iff NODE_ENV === 'production'

The interface to load the 'normal, non-secret config' is pretty nice:

  1. Load config/common.json
  2. If NODE_ENV is set to foo, load config/foo.json
  3. ...
  4. Profit

Adding secrets, now we have this:

  1. Load config/common.json
  2. If NODE_ENV is set to foo, load config/foo.json
  3. If NODE_ENV is set to foo, load config/secrets/secrets-foo.json...
    • Unless NODE_ENV is set to production, in that case config/secrets/secrets.json
  4. ...
  5. Cry

There's no reason to complicate the secrets interface. Why not do this???:

  1. Load config/common.json
  2. If NODE_ENV is set to foo, load config/foo.json
  3. Load config/secrets/common.json
  4. If NODE_ENV is set to foo, load config/secrets/foo.json
  5. ...
  6. Profit

cc @sh1mmer @Raynos @mlmorg

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions