small fix

This commit is contained in:
root
2023-09-30 14:18:44 +03:00
parent a598e645c2
commit 6ebf65cdb9
15 changed files with 59 additions and 67 deletions

View File

@ -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
```
## (ре)Генерация пароля