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

Boolean environment variable interpolation in config file #896

Closed
begriffs opened this issue Jun 26, 2017 · 6 comments
Closed

Boolean environment variable interpolation in config file #896

begriffs opened this issue Jun 26, 2017 · 6 comments

Comments

@begriffs
Copy link
Member

As reported by @frosenb, attempting to read a boolean value from the environment from the config file causes an error. For example,

export ISBASE64=true

then

secret-is-base64 = "$(ISBASE64)"

Postgrest issues an error and dies:

ConfigError {configErrorLocation = Key "" "secret-is-base64", configConversionError = Just [ConversionError {conversionErrorLoc = "boolValue", conversionErrorWhy = TypeError, conversionErrorVal = Just (String "true"), conversionErrorType = Just Bool, conversionErrorMsg = Nothing}]}
@devton
Copy link

devton commented Jul 12, 2017

having same issue when passing a number on DB_SCHEMA=1

       ConfigError {configErrorLocation = Key "" "db-schema", configConversionError = Just [ConversionError {conversionErrorLoc = "textValue", conversionErrorWhy = TypeError, conversionErrorVal = Just (Number 1.0), conversionErrorType = Just Text, conversionErrorMsg = Nothing}]}

@begriffs
Copy link
Member Author

What if you quote it like db-schema = "1"?

@devton
Copy link

devton commented Jul 12, 2017

@begriffs this errors is on deploying using the postgrest-heroku, i think that is on env-to-config.
Directly on postgrest.conf works fine.

@begriffs
Copy link
Member Author

begriffs commented Aug 6, 2017

Can you check whether it works if you deploy a fresh Heroku app? I fixed a typo in the buildpack and perhaps you deployed initially pre-typo and subsequent deploys are messed up because of it.

@begriffs begriffs reopened this Aug 6, 2017
@grudda
Copy link

grudda commented Aug 9, 2017

The same for me when deploying on jelastic paas. I can define the env variable by a form and they are set then on startup. But I got the same error message as above.
image

@ruslantalpa
Copy link
Contributor

@begriffs i think all the issues related to env vars and configs were fixed by your 2 PRs
(comment/reopen if not so)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants