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

Any npm packages that could use the same secrets? #284

Open
vfonic opened this issue May 5, 2020 · 4 comments
Open

Any npm packages that could use the same secrets? #284

vfonic opened this issue May 5, 2020 · 4 comments

Comments

@vfonic
Copy link

vfonic commented May 5, 2020

I have a rails + webpacker project and I need to share some ENV vars between rails and webpacker (webpack/node).

It works great if I use 'dotenv-rails', but I prefer 'figaro' and its "use one file, never commit it and it's YAML" philosophy.

I also like ease of use of pushing ENV vars to heroku.

Is there some npm package that I can use, like 'dotenv', that will be able to read the secrets from config/application.yml? Should we build one? Maybe we could just fork 'dotenv' and have it parse YAML instead of reading in the "plain text" key=value pairs from multiple dotfiles.

What do you think?

@laserlemon
Copy link
Owner

@vfonic Figaro 2.0 (in development) adds a figaro exec command, which uses Ruby to load your Figaro configuration into ENV and then execute some other command of your choosing.

I'm not very familiar with Node.js development but figaro exec your/node/command might be interesting for that use case.

@vfonic
Copy link
Author

vfonic commented May 5, 2020

That might work!

I'm curious how it would work after deployment. 🤔
It might be a bit inconvenient to have to add figaro exec before every command. Plus, heroku is precompiling assets automatically, so, in order for this to work there, we'd have to override "assets:precompile" task to get ENV vars into webpacker/webpack. I'm not sure actually...

I'm eager to be the beta tester if that helps! :)

@laserlemon
Copy link
Owner

I'm also very open to the creation of a JS Figaro sidecar (by somebody else! 😜), although I might suggest avoiding replicating Figaro v1 at this point, in favor of v2.

@Hanaffi
Copy link

Hanaffi commented Jun 6, 2024

@laserlemon Is there a better way to handle this please? (ie loading application.yml/figaro envs in webpack)

Also can you share more details on how to do it with figaro exec please?

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