Skip to content

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

Merged
akshay-joshi merged 5 commits intopgadmin-org:masterfrom
LauJosefsen:add-option-to-refresh-servers-json-every-boot
Mar 11, 2025
Merged

Add option to load/replace servers.json every boot#8519
akshay-joshi merged 5 commits intopgadmin-org:masterfrom
LauJosefsen:add-option-to-refresh-servers-json-every-boot

Conversation

@LauJosefsen
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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