Skip to content

Add option to load/replace servers.json every boot #8519

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

Conversation

LauJosefsen
Copy link
Contributor

Hi.

This PR adds the env PGADMIN_REPLACE_SERVERS_ON_STARTUP do the Docker image.

If this env is set to true, the servers.json will be loaded on every container boot, with the --replace option.

The motivation for this change is to be able to define servers as part of the deployments / infrastructure as code instead of manually manipulating the pgadmin database state.

This should not introduce any breaking change, and will only differ in execution if PGADMIN_REPLACE_SERVERS_ON_STARTUP is set to true.

I have tested the image locally, with both PGADMIN_REPLACE_SERVERS_ON_STARTUP undefined and with it set to true. I have also tested both cases on an initialized database and on a non-initialized database.

@firecow
Copy link

firecow commented Mar 5, 2025

Uh, nice 😄

We could use this. We are forced to use some sort of IoC db row seeding solution at the moment.

@yogeshmahajan-1903 yogeshmahajan-1903 self-assigned this Mar 10, 2025
Copy link
Contributor

@yogeshmahajan-1903 yogeshmahajan-1903 left a comment

Choose a reason for hiding this comment

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

Please update documentation for the same here.

@LauJosefsen
Copy link
Contributor Author

Please update documentation for the same here.

I tried adding some documentation below the PGADMIN_SERVER_JSON_FILE definition, as it seems related. I dont know if it should be moved?

@akshay-joshi akshay-joshi merged commit 2d10e95 into pgadmin-org:master Mar 11, 2025
24 of 32 checks passed
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.

4 participants