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

Maybe simplify environment variables/files? #12

Open
rosswintle opened this issue Nov 3, 2021 · 3 comments
Open

Maybe simplify environment variables/files? #12

rosswintle opened this issue Nov 3, 2021 · 3 comments

Comments

@rosswintle
Copy link
Contributor

Coming to this for the first time, I found config/app.php a bit confusing.

Is there a reason to have both environment files that get stored in Git (in /config/environments) AND .env files?

It feels like this could cause all sorts of problems with constants being defined in the wrong order? Or with people accidentally committing secrets to Git.

I feel like JUST using .env files would be much simpler, safer and less error prone?

If not then do we need some better docs on using the environments?

Happy to make a PR if that helps.

@jonathanbossenger
Copy link
Contributor

My understanding is that this is modeled after the way Laravel does things.

  1. you have default configuration variables on your config/app.php file, which should be set to whatever defaults exist for a local/development environment
  2. You then create specific .env files for your staging or production environments, ideally set up and automatically generated from your CI pipeline, not stored in the GitHub repo.

It looks like what this repo is doing is allowing you to specify certain configuration variables per environment (like debugging) that you would not want to have to store in your .env, which has its uses.

If not then do we need some better docs on using the environments?

That's probably a good idea.

@rosswintle
Copy link
Contributor Author

Thanks. That's cool. And I understand it. But in my opinion it's overly complex and hard to reason about.

I'll see if I can PR some improvements sometime without changing how it works.

@polevaultweb
Copy link
Contributor

It looks like what this repo is doing is allowing you to specify certain configuration variables per environment (like debugging) that you would not want to have to store in your .env, which has its uses.

💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants