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

Dump config through Admin API #3171

Closed
steve-chavez opened this issue Jan 18, 2024 · 5 comments
Closed

Dump config through Admin API #3171

steve-chavez opened this issue Jan 18, 2024 · 5 comments
Labels
difficulty: beginner Pure Haskell task enhancement a feature, ready for implementation

Comments

@steve-chavez
Copy link
Member

steve-chavez commented Jan 18, 2024

Problem

Currently --dump-config outputs the config applied by env vars, files and in-db config.

postgrest-with-postgresql-16 postgrest-run --dump-config 

db-aggregates-enabled = false
db-anon-role = "postgrest_test_anonymous"
...

However that doesn't work for an already running instance

Solution

Use the admin api (ref) to output the config of a running instance. Like:

curl localhost:3001/config

200 OK
Content-Type: text/plain

db-aggregates-enabled = false
db-anon-role = "postgrest_test_anonymous"
db-channel = "pgrst"
db-channel-enabled = true
db-extra-search-path = "public"
db-max-rows = ""
db-plan-enabled = false
db-pool = 1
db-pool-acquisition-timeout = 1
db-pool-max-lifetime = 1800
db-pool-max-idletime = 30
db-pool-automatic-recovery = true
db-pre-request = ""
db-prepared-statements = true
db-root-spec = ""
db-schemas = "test"
db-config = true
db-pre-config = ""
db-tx-end = "commit"
db-uri = "postgresql://"
jwt-aud = ""
jwt-role-claim-key = ".\"role\""
jwt-secret = ""
jwt-secret-is-base64 = false
jwt-cache-max-lifetime = 0
log-level = "error"
openapi-mode = "follow-privileges"
openapi-security-active = false
openapi-server-proxy-uri = ""
server-cors-allowed-origins = ""
server-host = "!4"
server-port = 3000
server-trace-header = ""
server-timing-enabled = false
server-unix-socket = ""
server-unix-socket-mode = "660"
admin-server-port = ""
@steve-chavez steve-chavez added idea Needs of discussion to become an enhancement, not ready for implementation enhancement a feature, ready for implementation difficulty: beginner Pure Haskell task and removed idea Needs of discussion to become an enhancement, not ready for implementation labels Jan 18, 2024
@wolfgangwalther
Copy link
Member

Would also be helpful to look at the schema cache.

@SkyWriter
Copy link
Contributor

SkyWriter commented Jan 28, 2024

Warm greetings! I took a stab on it, and wondering if I'm going in a right direction with my implementation at #3193 at all. Can someone take a brief look?

(Just a draft now, I'm going to bring it to a production quality, with tests and other important things, before submitting for a real review)

@SkyWriter
Copy link
Contributor

Would also be helpful to look at the schema cache.

Nice idea! Sounds like semantically worth a separate endpoint, though. What do you think?

@wolfgangwalther
Copy link
Member

Sounds like semantically worth a separate endpoint, though.

Absolutely!

@steve-chavez
Copy link
Member Author

Closed on #3193. Tracking Admin API for Schema cache on #3210

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: beginner Pure Haskell task enhancement a feature, ready for implementation
Development

No branches or pull requests

3 participants