Let's Encrypt и certbot для HTTPS в Perfect Streamer

Обсуждение настройки программы и её функций
User avatar
Support PStreamer
Posts: 44
Joined: 14 Mar 2024, 12:25
Location: Moscow
Been thanked: 7 times
Contact:
Let's Encrypt и certbot для HTTPS в Perfect Streamer

Post by Support PStreamer »

Начиная с версии 1.9.2.340 Perfect Streamer поддерживает автоматическое обновление сертификатов Let's Encrypt для работы HTTPS в Web Server, HTTP Server, EPG Server.

Настройка certbot для RHEL.
Ограничение:
- Должен быть свободен TCP/80 порт и назначен белый IP адрес с публичным доменным именем.
- Для всех HTTPS серверов используется одинаковое имя хоста. (Web Server, HTTP Server, EPG Server).

Установка certbot ([Please login or register to view this link].) :

Code: Select all

sudo yum install snapd
sudo systemctl enable --now snapd.socket
sudo ln -s /var/lib/snapd/snap /snap
sudo snap install certbot --classic
Настройка certbot:

Code: Select all

sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo certbot certonly --standalone
Проверка certbot:

Code: Select all

sudo certbot renew --dry-run
Проверка таймера certbot:

Code: Select all

systemctl list-timers | grep certbot
В админке Perfect Streamer включить HTTPS на серверах (Web Server, HTTP Server, EPG Server).

[Please login or register to view this link]. и разместить его по пути:

Code: Select all

/opt/pss/scripts/cert_update.sh
В нем, если надо, прописать доменное имя хоста, по умолчанию берется из /etc/hostname
Сделать файл исполняемым:

Code: Select all

chmod +x opt/pss/scripts/cert_update.sh
Проверить запуск скрипта, не должно быть ошибок:

Code: Select all

opt/pss/scripts/cert_update.sh
Настройки https должны применится, изменение статуса отобразится в логах.

Добавить hook файл в certbot:

Code: Select all

certbot renew --deploy-hook "opt/pss/scripts/cert_update.sh"
Еще раз проверить certbot:

Code: Select all

sudo certbot renew --dry-run
Настройки HTTPS должны применится, изменение статуса отобразится в логах.


Настройка certbot для Debian/Ubuntu.
Настройка для Debian аналогична RHEL, краткое описание установки на примере Ubuntu 24.04.2 LTS:

Установка certbot:

Code: Select all

apt install certbot
certbot certonly
Делаем скрипт исполняемым:

Code: Select all

chmod +x opt/pss/scripts/cert_update.sh
Запускаем скрипт:

Code: Select all

opt/pss/scripts/cert_update.sh
Выдаёт
Select domain name (your domain name)

Проверяем обновились ли сертификаты:

Code: Select all

ls -lat /opt/pss/config/cert/
total 44
-rw------- 1 root root  241 May 26 07:52 epgserver.key
-rw------- 1 root root  241 May 26 07:52 httpserver.key
-rw------- 1 root root  241 May 26 07:52 webserver.key
-rw-r--r-- 1 root root 1338 May 26 07:52 epgserver.crt
-rw-r--r-- 1 root root 1338 May 26 07:52 httpserver.crt
-rw-r--r-- 1 root root 1338 May 26 07:52 webserver.crt
Дата должна быть актуальной.
Attachments
cert_update.zip
cert_update.sh
(554 Bytes) Downloaded 9 times
HTTPS в Web Server, HTTP Server, EPG Server
HTTPS в Web Server, HTTP Server, EPG Server
Tech support Perfect Streamer