'How to permanently save the path of the identity file in pgAdmin4

Context

I'm using this pgAdmin4 docker image: https://hub.docker.com/r/dpage/pgadmin4/ in its latest state (version 6.9 at the time of writing).

And I am currently wondering how to permanently set the path of the identity file in the servers.json file.

This identity file is mounted as a bind mount in my compose file:

- ./id_ed25519:/var/lib/pgadmin/storage/<user_domain>/id_ed25519

For the moment, if I set this file path within the running application:

ssh tunnel parameters within pgadmin4

and if I export that definition in a test_export.json file according to the documentation, I end up with the following server definition, which curiously doesn't have any reference to the identity file path:

# cat test_export.json 
{
    "Servers": {
        "1": {
            "Name": "local.pg9",
            "Group": "SERVER",
            "Host": "localhost",
            "Port": 5432,
            "MaintenanceDB": "postgres",
            "Username": "postgres",
            "SSLMode": "prefer",
            "PassFile": "/.pgpass",
            "UseSSHTunnel": 1,
            "TunnelHost": "my-test-server.org",
            "TunnelPort": "22",
            "TunnelUsername": "vpsroot",
            "TunnelAuthentication": 1
        }
    }

I also "randomly" tried to guess it by adding "TunnelIdentityfile": "/id_ed25519" but it didn't work.

And I cannot find any information about that file in the documentation at https://www.pgadmin.org/docs/pgadmin4/6.5/import_export_servers.html#json-format

Question

How could I save the identity file path (ideally in the servers.json file) so that I don't have to manually set it up each time I reboot the pgAdmin4 container?



Solution 1:[1]

The identity file or passwords are not exported by default for security reasons and will not be restored as well. If you wish to have this then you can raise a feature request on pgAdmin - https://redmine.postgresql.org/projects/pgadmin4/issues/new

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1