Giter VIP home page Giter VIP logo

Comments (7)

Undistraction avatar Undistraction commented on August 22, 2024

+1 heroku config:push only supports a single .env file. Would be great to have something similar for Dotenv that observes environmental specific files:

dotenv heroku:push --staging

from dotenv.

newtriks avatar newtriks commented on August 22, 2024

+1

from dotenv.

bkeepers avatar bkeepers commented on August 22, 2024

It seems like a task like that would encourage you to put production variables in your local .env. My philosophy is that all the settings in your local .env should be development-only. The server is really the only thing that should know the production credentials.

from dotenv.

andrii avatar andrii commented on August 22, 2024

@bkeepers production credentials could be manually uploaded to the server and copied into the app using deployment recipe, would this case still adhere to your philosophy? If not could you please clarify what are the advantages of dotenv vs, say, SettingsLogic approach?

from dotenv.

bkeepers avatar bkeepers commented on August 22, 2024

I'm pretty much against anything that encourages you to store production credentials in the repository.

If not could you please clarify what are the advantages of dotenv vs, say, SettingsLogic approach?

dotenv is really just meant as a development shim for apps that conform to twelve factor principles for config like Heroku. It does not attempt to solve any of the of the application concerns that SettingsLogic or Figaro try to solve.

from dotenv.

Undistraction avatar Undistraction commented on August 22, 2024

I think we're talking at cross-purposes. There is a difference between pushing an .env file to a repo and pushing the adding the variables it contains to Heroku. Using $ heroku config:push adds all the variables from a .env file to the Heroku server - equivalent to calling $heroku config:add SOME_VAR=123 for each variable.

Environmental variables can generally be split into 2 sets: Application configuration shared across development/production/staging - configuration that is shared across environments such as TZ=Europe/London and environmental configuration that is specific to a particular server/environment.

It seems to me that a mechanism for keeping the former in sync between environments can only be a good thing. Dotenv already supports sharing envs between environments using a base .env file, so why not support keeping environments in sync by making it easy to push the variables to production or staging. Rather than encouraging people to upload envs it removes the need for it.

The second group are more debatable. Personally I find it very useful to have a single location where all my envs are stored. Obviously they aren't under source control, but it the advantage is that it greatly reduces the chances of what I think are the envs on staging or production and what I know are the envs. I currently add envs to production/staging as part of deployment, but I think it would be useful and within Dotenv's remit to offer a simple way to push the envs themselves.

from dotenv.

bkeepers avatar bkeepers commented on August 22, 2024

Having a command like this would certainly be cool. I understand that there are some legitimate uses as @1ndivisible describes, but it also could encourage people to store production creds in .env. For now, I don't think the benefits outweigh the costs.

I would encourage someone to create a dotenv-heroku gem that has this functionality.

from dotenv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.