Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only dev *or* prod config, not both #225

Open
g105b opened this issue Jul 25, 2024 · 0 comments
Open

Only dev *or* prod config, not both #225

g105b opened this issue Jul 25, 2024 · 0 comments

Comments

@g105b
Copy link
Member

g105b commented Jul 25, 2024

Sometimes it's useful for the code to know whether we're in dev or prod mode. Currently, there is no way to know which mode we're in.

On the development environment, there can be an optional config.dev.ini that will override the default values in the config.ini. The expectation is that the dev ini does not get checked into version control, as this is where the actual keys and secret values will lie.

However, on dev it might be that you use "mock" versions of API keys, or have specific low-exposure keys generated for each developer. When the code gets to production, it would (and should) always be an error if the dev ini was found on the production server.


Proposed changes:

  1. throw an exception if there are both dev and prod at the same time.
  2. assume "prod" by default (for code reasons), so things like $config->getDeployment() will return the appropriate enum, and only assume "dev" if there is a config.dev.ini. This will mean that assuming prod by default can apply more strict security / not bundle source maps / etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

1 participant