From 62171dbd9f8f0ff21cbd072092d4485326d77cd9 Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Sun, 8 Sep 2024 17:51:17 +0200 Subject: [PATCH 1/3] Update config_server.json with new PostgreSQL server configuration --- imageroot/state/config_server.json | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/imageroot/state/config_server.json b/imageroot/state/config_server.json index a443f6f..08241a8 100644 --- a/imageroot/state/config_server.json +++ b/imageroot/state/config_server.json @@ -1,13 +1,17 @@ { - "Servers": { - "1": { - "Name": "Localhost Server", - "Group": "Localhost server", - "Port": 5432, - "Username": "postgres", - "Host": "/var/run/postgresql/", - "MaintenanceDB": "postgres", - "PassFile": "" - } + "Servers": { + "1": { + "Name": "postgresql", + "Group": "Servers", + "Host": "/var/run/postgresql/", + "Port": 5432, + "MaintenanceDB": "postgres", + "Username": "postgres", + "TunnelPort": "22", + "KerberosAuthentication": false, + "ConnectionParameters": { + "passfile": "../../pgpass" + } } -} \ No newline at end of file + } +} From ee0899e7298d85c7a15a3f74de2bef8a3a7224b2 Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Sun, 8 Sep 2024 17:51:28 +0200 Subject: [PATCH 2/3] Add pgpass file for PostgreSQL authentication --- imageroot/state/pgpass | 1 + imageroot/systemd/user/pgadmin-app.service | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 imageroot/state/pgpass diff --git a/imageroot/state/pgpass b/imageroot/state/pgpass new file mode 100644 index 0000000..e56ea71 --- /dev/null +++ b/imageroot/state/pgpass @@ -0,0 +1 @@ +127.0.0.1 \ No newline at end of file diff --git a/imageroot/systemd/user/pgadmin-app.service b/imageroot/systemd/user/pgadmin-app.service index 14eb8d9..a4f7eba 100644 --- a/imageroot/systemd/user/pgadmin-app.service +++ b/imageroot/systemd/user/pgadmin-app.service @@ -33,6 +33,8 @@ ExecStart=/usr/bin/podman run --conmon-pidfile %t/pgadmin-app.pid \ --env-file=%S/state/smarthost.env \ ${PGADMIN4_IMAGE} ExecStartPost=/usr/bin/bash -c "while ! podman exec pgadmin-app /venv/bin/python3 setup.py get-users ; do sleep 5 ; done" +ExecStartPost=/usr/bin/podman cp pgpass pgadmin-app:/var/lib/pgadmin/pgpass +ExecStartPost=/usr/bin/podman exec pgadmin-app chmod 0600 /var/lib/pgadmin/pgpass ExecStartPost=/usr/bin/podman exec pgadmin-app /venv/bin/python3 setup.py load-servers config_server.json --replace --user admin@nethserver.org ExecStop=/usr/bin/podman stop --ignore --cidfile %t/pgadmin-app.ctr-id -t 10 ExecReload=/usr/bin/podman kill -s HUP pgadmin-app From 92300c10d960521741fa2e6453f3dfc2b6a82943 Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Sun, 8 Sep 2024 18:45:39 +0200 Subject: [PATCH 3/3] Update PostgreSQL connection TCP port description --- ui/public/i18n/en/translation.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/public/i18n/en/translation.json b/ui/public/i18n/en/translation.json index 53eac40..d36d099 100644 --- a/ui/public/i18n/en/translation.json +++ b/ui/public/i18n/en/translation.json @@ -32,12 +32,12 @@ "advanced": "Advanced", "configuring": "Configuring", "instance_configuration": "Configure postgresql", - "tcp_port_pgsql": "TCP port for postgresql", - "tcp_port_pgsql_tcp_port_tips": "TCP port restricted to the node localhost", + "tcp_port_pgsql": "PostgreSQL Connection TCP Port", + "tcp_port_pgsql_tcp_port_tips": "The TCP port is restricted to the cluster network, meaning it is not open to the public and can only be accessed from within the cluster with the internal wiregard IP for example 10.5.4.1", "domain_already_used_in_traefik": "Domain already used in traefik", "host_pattern": "Must be a valid fully qualified domain name", "host_format": "Must be a valid fully qualified domain name", - "password_tips":"Default login and password are 'admin@nethserver.org' and 'Nethesis,1234', change them as soon as possible" + "password_tips": "Default login and password are 'admin@nethserver.org' and 'Nethesis,1234', change them as soon as possible" }, "about": { "title": "About"