-
Notifications
You must be signed in to change notification settings - Fork 20
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
Environment variables loading with escaped quotes #20
Comments
@monting I think that you are having this issue because of the double quotes you have used in your
should be...
Try this out and let me know if this works for you. To answer your question about the code to load the environment variables. I didn't write this tutorial/example but I think that it was added so that people do not have to remember to type |
@RobStallion thanks for your response! Appreciate it. It is indeed because I'm quoting my shell variable exports. I'd say this is accepted, even recommended practice, so there are readers that will encounter this. Quoting is safer - necessary if you have whitespaces, easier to see that there are no trailing whitespace,... Furthermore, there's an instance here: where the quotes are later getting stripped out here: phoenix-ecto-encryption-example/config/config.exs Lines 45 to 49 in 6d79f25
This makes quoting inconsistent in the I'd say that this is too much env var fiddling, for just being able to load env vars automatically, which is something that seems to be out of scope for the topic of this fantastic readme. |
@RobStallion thanks for responding, agreed. ✅ If you have time to improve it, please create a PR. 👍 |
@nelsonic thanks for the response, and your work on this has been a godsend 👏 I can see the reasoning behind the multiple encryption keys. phoenix-ecto-encryption-example/config/config.exs Lines 30 to 42 in 6d79f25
Will send PR for improvement. |
@monting I figured that if I was going to split the encryption keys, I might as well write a tiny function to load all the environment variables from the |
Firstly, thank you so much for this amazing resource!
Onto the issue. When I insert this code:
phoenix-ecto-encryption-example/config/config.exs
Lines 30 to 42 in 6d79f25
and have (double/single) quotes around the values in the
.env
file, the environment variables are loaded with the quotes.For example, in the
.env
file:export SOME_ENV_VAR="randomString"
results in:
I'm not entirely sure why there's code to load the environment variables like this. Why not just do the standard
source .env
?The text was updated successfully, but these errors were encountered: