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

Error with boolean variables #18

Open
thiagoalmeidasa opened this issue Apr 25, 2017 · 1 comment
Open

Error with boolean variables #18

thiagoalmeidasa opened this issue Apr 25, 2017 · 1 comment

Comments

@thiagoalmeidasa
Copy link
Contributor

Hi, first of all, congrats for this job.

I don't know how do you use boolean variables from docker-compose because in my tries these variables are converted from boolean to string.

Example:

---
docker-compose
PROD_MAIL_SECURE_CONNECTION: 'false'

And then, inside the container:

> typeof(process.env['PROD_MAIL_SECURE_CONNECTION'])
'string'

To work around this problem, I have edited the config.js file to use JSON.parse in specific variables, but I think the CheckEnvVar function could be improved testing for true or false strings, and then convert the value, like in http://stackoverflow.com/questions/3976714/converting-string-true-false-to-boolean-value

@killianbrackey
Copy link
Contributor

The Docker compose file is simply setting the environment variables in the containers. Becuase Thanks for pointing this out! Environment variables are always strings (no flexibility herehttp://stackoverflow.com/questions/2953646/how-to-declare-and-use-boolean-variables-in-shell-script). process.env['PROD_MAIL_SECURE_CONNECTION'] === 'true should work like the stack overflow you provided. I will take a look at the function's parsing of these variables.

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

2 participants