Skip to content

Conversation

@doublebyte1
Copy link
Contributor

This PR enables pulling and pushing a pygeoapi configuration from a pygeoapi server.

  • The admin api needs to be enabled for this to work
  • For now, authentication is not supported.

Copy link
Collaborator

@KatKatKateryna KatKatKateryna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing seems broken!:)
I left some comments, and also 2 suggestions:

  1. Use a single-choice radio button with an alternative choice, e.g. Use Server Connection and Use Local File Configuration. So it is more clear what are we choosing between.
  2. When pulling the data from the server, we might need to check the datetimeformat in the response, as currently it is returned as a non-supported string, therefore ignored (erased): e.g. "2000-10-30T18:24:39+00:00" instead of "2000-10-30T18:24:39Z"

And regarding the admin interface, not sure how it should be reacting on incoming requests, but currently it overwrites "example-config.yaml" with unsupported content format.

P.S. I can make a PR for my comments if it's quicker, except for the admin push configuration outcome

@doublebyte1
Copy link
Contributor Author

doublebyte1 commented Dec 15, 2025

Hi @KatKatKateryna Thanks for the thourought review! 💯

Nothing seems broken!:) I left some comments, and also 2 suggestions:

  1. Use a single-choice radio button with an alternative choice, e.g. Use Server Connection and Use Local File Configuration. So it is more clear what are we choosing between.

I have added the extra radio button for clarity 🙃 and added more user facing error messages; would you be able to take care of the other stuff?

  1. When pulling the data from the server, we might need to check the datetimeformat in the response, as currently it is returned as a non-supported string, therefore ignored (erased): e.g. "2000-10-30T18:24:39+00:00" instead of "2000-10-30T18:24:39Z"

And regarding the admin interface, not sure how it should be reacting on incoming requests, but currently it overwrites "example-config.yaml" with unsupported content format.

P.S. I can make a PR for my comments if it's quicker, except for the admin push configuration outcome

If you are running pygeoapi locally with the example-config.yaml as config file, it is normal for this file to be overwritten; this is exactly what the admin UI does - overwritting the config file from the server. What is not normal, is for it to be overwritten with unsupported content format. Can you give more details about this?

@KatKatKateryna
Copy link
Collaborator

KatKatKateryna commented Dec 17, 2025

Super, I also added some fixes in a new PR: #12
I discarded some of my comments (e.g. moving requests higher a few levels), as your current implementation makes more sense:)

And regarding the push_to_server data update, here is what content is being pushed to example-config (originally it's the same as pygeoapi-config):
image

@doublebyte1
Copy link
Contributor Author

doublebyte1 commented Dec 18, 2025

Super, I also added some fixes in a new PR: #12 I discarded some of my comments (e.g. moving requests higher a few levels), as your current implementation makes more sense:)

And regarding the push_to_server data update, here is what content is being pushed to example-config (originally it's the same as pygeoapi-config): image

@KatKatKateryna it seems that it is overwriting it with the openapi definition, rather than the config file. Maybe the $PYGEOAPI_CONFIG or $PYGEOAPI_OPENAPI are not set correctly?

How are you running pygeoapi (can you paste the command line)?

@doublebyte1
Copy link
Contributor Author

doublebyte1 commented Dec 18, 2025

This is how I am running it, from the pygeoapi source directory (hot reload is needed to see the changes in the pygeoapi instance at runtime):

docker run -p 5000:80 -v $(pwd)/example-config.yml:/pygeoapi/local.config.yml geopython/pygeoapi:latest run-with-hot-reload

 echo $PYGEOAPI_CONFIG
example-config.yml

 echo $PYGEOAPI_OPENAPI
example-openapi.yml

Important note: for the push to work, the admin key needs to be set to true!

@KatKatKateryna
Copy link
Collaborator

Pulled the latest version with the updated instructions, all good now! I was using outdated commands

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

Successfully merging this pull request may close these issues.

3 participants