Skip to content

Sensitive environment variables #3336

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

Closed
mikesigs opened this issue Dec 1, 2016 · 9 comments
Closed

Sensitive environment variables #3336

mikesigs opened this issue Dec 1, 2016 · 9 comments
Labels
needs: investigation Requires some digging to determine if action is needed

Comments

@mikesigs
Copy link

mikesigs commented Dec 1, 2016

Hi guys,

I am wondering if there is any plan to support something like dotenv

It would be nice to be able to store sensitive environment settings (e.g. api keys) this way. It's a really helpful npm package and would make a great addition to the CLI.

Thanks!

@antonybudianto7
Copy link

antonybudianto7 commented Dec 1, 2016

I agreed with using dotenv, but not for storing sensitive information

https://softwareengineering.stackexchange.com/questions/194045/securely-storing-secret-data-in-a-client-side-web-application

using dotenv really helps with many environments and is scalable, and more importantly, we can migrate from cli to other starters (and vice-verca) without much problem since dotenv is much standard and widely used.

even create-react-app bundled dotenv by default https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#adding-development-environment-variables-in-env

@mikesigs
Copy link
Author

mikesigs commented Dec 1, 2016

Y'know I didn't realize how dumb of a question I had asked until just now. Of course you're not going to be able to use dotenv in a client side app. You're not going to access environment variables on the clients machine. And yeah... Obviously not going to store sensitive data there either.

@mikesigs mikesigs closed this as completed Dec 1, 2016
@mikesigs mikesigs reopened this Dec 1, 2016
@antonybudianto7
Copy link

Well, some key like firebase apiKey, is non-secret, and can be bundled to client-side code, since they have domain whitelist mechanism. Using dotenv in a client side app is possible, like create-react-app, but you still store secret information on server side.

@mikesigs
Copy link
Author

mikesigs commented Dec 1, 2016

I was just thinking about not committing certain settings to the repository and dotenv enables that. But I didn't consider that anything you put in dotenv will need to be in your compiled code anyways.

So I guess the real question is, what does dotenv provide that the current environment configuration in the CLI doesn't?

@antonybudianto7
Copy link

antonybudianto7 commented Dec 1, 2016

well, if the env is used for things like debug flag, production flag, or API url, then current configuration is enough, but since it's committed to source control, then it'll affect other developers that uses the same environment. (much like if you commit your own IDE config)
and,.... it's not the problem with dotenv, since each developer/environment have their own .env 👍

@hansl hansl added the needs: investigation Requires some digging to determine if action is needed label Dec 9, 2016
@frankfullstack
Copy link

frankfullstack commented Dec 9, 2016

I tried with the dotenv package, and several webpack plugins unsuccessfully.

Anyone tried these packages: webpack-dotenv-plugin and dotenv-webpack?

I want to inject some environment api keys to my Angular services but I'm not be able to do it.

@antonybudianto
Copy link
Contributor

Example starter using dotenv
https://github.com/antonybudianto/angular-webpack-starter

@filipesilva
Copy link
Contributor

Discussion on how to do this sort of thing can be found in #3855.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: investigation Requires some digging to determine if action is needed
Projects
None yet
Development

No branches or pull requests

6 participants