mirror of
https://github.com/fruworg/fruworg.github.io.git
synced 2025-06-26 04:53:59 +03:00
small fix
This commit is contained in:
@ -7,25 +7,23 @@ tags: [linux, postgres, tls]
|
||||
## Создание сертификата
|
||||
В этом посте я буду использовать самоподписанный сертификат, но сертификат от Let's Encrypt тоже подойдёт.
|
||||
Сертификат и ключ желательно держать в той же папке, где лежат конфиги Postgres Pro.
|
||||
``` shell
|
||||
```shell
|
||||
openssl req -x509 -newkey rsa:4096 -keyout <key>.pem -out <cert>.pem -sha256 -days 365
|
||||
```
|
||||
|
||||
## Включение TLS
|
||||
``` shell
|
||||
В файл `/var/lib/pgpro/std-*/data/postgresql.conf` необходимо добавить следующие строки:
|
||||
```sh
|
||||
ssl = on
|
||||
ssl_cert_file = '<cert>.pem'
|
||||
ssl_key_file = '<key>.pem'
|
||||
listen_addresses = 'localhost, <master-ip>'
|
||||
|
||||
# /var/lib/pgpro/std-13/data/postgresql.conf
|
||||
```
|
||||
|
||||
## Разрешение доступа через TLS
|
||||
```shell
|
||||
В файл `/var/lib/pgpro/std-*/data/pg_hba.conf` необходимо добавить следующие строки:
|
||||
```sh
|
||||
hostssl <user> <database> <client-ip> scram-sha-256
|
||||
|
||||
# /var/lib/pgpro/std-13/data/pg_hba.conf
|
||||
```
|
||||
|
||||
## (ре)Генерация пароля
|
||||
|
Reference in New Issue
Block a user