Skip to content

Commit

Permalink
Update readme on external network connexion
Browse files Browse the repository at this point in the history
  • Loading branch information
stephdl committed Jun 17, 2024
1 parent 19e551b commit 6b976a7
Showing 1 changed file with 33 additions and 16 deletions.
49 changes: 33 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,18 @@ pgadmin needs a default credential to login: `admin@nethserver.org` `Nethesis,12
runagent -m postgresql1
podman exec -ti postgresql-app psql -U postgres

2. using another terminal, access the database from the host using the postgres uri

2 - access inside the cluster via the network

```
psql postgresql://postgres:Nethesis,1234@IP_of_Node:${TCP_PORT_PGSQL}/postgres
psql -h IP_of_Node -U postgres -d postgres -p ${TCP_PORT_PGSQL}
```

The password of postgres user can be found inside a secret file `/home/postgresql1/.config/state/secrets/passwords.secret`

`${TCP_PORT_PGSQL} `is set inside the environment of the module

`IP_of_Node` is the IP running the container, it might be the internal wiregard IP or the external IP of the node
`IP_of_Node` is the IP running the container, it must be the internal wiregard IP for example 10.5.4.1, the port is not opened in the firewall

## Get the configuration
You can retrieve the configuration with
Expand Down Expand Up @@ -113,7 +116,7 @@ on the root terminal

`runagent -m postgresql1`

the path become :
the path become :
```
echo $PATH
/home/postgresql1/.config/bin:/usr/local/agent/pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/
Expand All @@ -132,19 +135,33 @@ d8df02bf6f4a docker.io/library/mariadb:10.11.5 --character-set-s... 9
you can see what environment variable is inside the container
```
podman exec postgresql-app env
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
TERM=xterm
PKG_RELEASE=1
MARIADB_DB_HOST=127.0.0.1
MARIADB_DB_NAME=postgresql
MARIADB_IMAGE=docker.io/mariadb:10.11.5
MARIADB_DB_TYPE=mysql
PG_MAJOR=14
POSTGRES_USER=postgres
TCP_PORT_PGSQL=20040
container=podman
NGINX_VERSION=1.24.0
NJS_VERSION=0.7.12
MARIADB_DB_USER=postgresql
MARIADB_DB_PASSWORD=postgresql
MARIADB_DB_PORT=3306
PGADMIN4_IMAGE=docker.io/dpage/pgadmin4:8.6
TRAEFIK_HOST=p3.rocky9-3.org
TCP_PORT_PGADMIN=20041
IMAGE_REOPODIGEST=ghcr.io/nethserver/postgresql@sha256:7214285985f1b83a24349b734e492b39d32627a818a71a71e53ad2f611602904
IMAGE_DIGEST=sha256:7214285985f1b83a24349b734e492b39d32627a818a71a71e53ad2f611602904
PGDATA=/var/lib/postgresql/data
TCP_PORTS_RANGE=20040-20041
GOSU_VERSION=1.17
TRAEFIK_HTTP2HTTPS=False
IMAGE_ID=0697feb0d5ae91dd8aeecfd4ec3cc686ed2a24e8b02a875715898dddfe17ab28
TCP_PORTS=20040,20041
LANG=en_US.utf8
MODULE_ID=postgresql3
NODE_ID=1
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/postgresql/14/bin
IMAGE_URL=ghcr.io/nethserver/postgresql:opennetwork
TRAEFIK_LETS_ENCRYPT=False
MODULE_UUID=631248ae-6296-45c9-84d7-a981fb269dc1
TCP_PORT=20040
POSTGRES_PASSWORD=d4079c78337e27abd9b200458a46834dbf205218
POSTGRES_IMAGE=docker.io/postgres:14.12-bookworm
PG_VERSION=14.12-1.pgdg120+1
TERM=xterm
HOME=/root
```

Expand Down

0 comments on commit 6b976a7

Please sign in to comment.