-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Can't set app settings when using environment variables #1624
Comments
@LorenzHenk Are you on docker? Otherwise the config should accept env vars like:
(From: http://postgrest.org/en/v7.0.0/configuration.html#app-settings) |
Yes I'm using docker & docker-compose. I'm not using a config file. Instead, I'm using environment variables (like |
I see. Inside Docker, right now the config file is the only way to use the You could do it like:
This is a limitation because we currently use a static postgrest.conf inside Docker. We interpolate the env vars inside that config. |
One way we could solve this is by changing the In the regular binary, one would use like:
On Docker:
Would that work for you? |
The other way to solve this would be to make our binary also understand command line arguments instead of only the config file. But I think that would be more work since we'd need to integrate an additional library. |
I think we should just separate the config file from the environment variables. If we read those in a second step manually, we can easily read all of the custom settings with a pattern like Environment variables should override those values, that were set in the config file. Including environment variables with the current syntax in the config file would still be possible, because that's part of the lib we're using, right? Since we would be parsing the environment variables ourself, that would solve #1572 as well. |
@steve-chavez I think changing the
@wolfgangwalther I think having |
@wolfgangwalther So we create the config file dynamically on Docker right? That certainly looks like a better solution. |
Yes, the docker container would not need a config file at all anymore. All env variables directly read into |
@wolfgangwalther , this change broke my docker-setup where I was using the documented https://postgrest.org/en/stable/configuration.html?highlight=app.settings#app-settings app.settings.xxx in my /etc/postgrest.conf via a docker-compose volume override. I think your new environment variables are more elegant and easier, but would it be possible to update the documentation about PGRST_APP_SETTINGS_xxx ? |
The docs you are referencing are for v7. We have not released the docs for v8, yet. @laurenceisla is working hard on those docs right now, I'm sure this will be included soon. |
@tcarr-harriscomputer As Wolfgang mentioned, the docs for v8 are now available. You can find a section for Environment Variables and an updated section for Docker configuration as well. |
Environment
Description of issue
The documentation mentions the
app.settings.*
settings, where one can set custom session variables.How can this setting be set when configuring PostgREST through environment variables?
I tried:
PGRST_APP.SETTINGS.TEST
- this is not allowed in the shellPGRST_APP_SETTINGS_TEST
- this is not recognized by PostgRESTThe text was updated successfully, but these errors were encountered: