From 5ce99935eb1f240b74cf6cef0dc9826924de06ca Mon Sep 17 00:00:00 2001 From: Petro1990 Date: Sat, 14 Mar 2026 22:30:06 +0300 Subject: [PATCH] =?UTF-8?q?rproxy=20v1.8.1:=20=D0=BF=D0=B5=D1=80=D0=B5?= =?UTF-8?q?=D1=85=D0=BE=D0=B4=20=D0=BD=D0=B0=20Certbot=20certonly=20=D0=B8?= =?UTF-8?q?=20=D0=BF=D1=80=D0=B8=D0=BD=D1=83=D0=B4=D0=B8=D1=82=D0=B5=D0=BB?= =?UTF-8?q?=D1=8C=D0=BD=D0=B0=D1=8F=20=D0=BE=D1=87=D0=B8=D1=81=D1=82=D0=BA?= =?UTF-8?q?=D0=B0=20=D1=81=D1=82=D0=B0=D1=80=D1=8B=D1=85=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=BD=D1=84=D0=B8=D0=B3=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rproxy | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/rproxy b/rproxy index 8b4acde..9226f23 100644 --- a/rproxy +++ b/rproxy @@ -3,7 +3,7 @@ # Публикация локальных сервисов через SSH-туннели + nginx на VPS # https://github.com/l-ptrol/rProxy -VERSION="1.8.0" +VERSION="1.8.1" export PATH="/opt/bin:/opt/sbin:$PATH" CONF_DIR="/opt/etc/rproxy" CONF_FILE="$CONF_DIR/rproxy.conf" @@ -600,6 +600,9 @@ do_add_interactive() { local tmp="/tmp/rproxy_$name.conf" generate_nginx_conf "$name" "$t_host" "$t_port" "$tunnel_port" "$domain" "$ext_port" "$use_ndm_auth" "$path" "$tmp" + # Очистка старых конфигов (миграция на v1.8.0+) + ssh_cmd "rm -f $REMOTE_NGINX_DIR/rproxy_$name.conf" + # Деплой htpasswd если нужно if [ "$use_ndm_auth" = "yes" ]; then local ht_tmp="/tmp/rproxy_$name.htpasswd" @@ -630,8 +633,9 @@ do_add_interactive() { # SSL (теперь Certbot вызывается только если сертификата НЕТ) if [ "$use_ssl" = "yes" ]; then if ssh_cmd "[ ! -f /etc/letsencrypt/live/$domain/fullchain.pem ]"; then - msg "SSL сертификат не найден. Запускаю Certbot..." - ssh_cmd "certbot --nginx -d $domain --non-interactive --agree-tos -m $CERTBOT_EMAIL" || warn "Certbot вернул ошибку" + msg "SSL сертификат не найден. Запрашиваю через Certbot (certonly)..." + # Используем certonly чтобы Certbot не ломал наши конфиги своими правками + ssh_cmd "certbot certonly --nginx -d $domain --non-interactive --agree-tos -m $CERTBOT_EMAIL" || warn "Certbot вернул ошибку" # После Certbot пересобираем конфиг, чтобы он прописал SSL пути rebuild_vhost_config "$domain" "$ext_port" "$vps_id" else @@ -697,8 +701,8 @@ do_ssl_interactive() { warn "Не удалось автоматически установить Certbot на VPS" } - msg "Запрашиваю сертификат для $SVC_DOMAIN..." - if ssh_cmd "certbot --nginx -d $SVC_DOMAIN --non-interactive --agree-tos -m $CERTBOT_EMAIL"; then + msg "Запрашиваю сертификат для $SVC_DOMAIN (certonly)..." + if ssh_cmd "certbot certonly --nginx -d $SVC_DOMAIN --non-interactive --agree-tos -m $CERTBOT_EMAIL"; then msg "SSL сертификат успешно получен!" # Обновляем конфиг сервиса sed -i "s/SVC_SSL=.*/SVC_SSL=\"yes\"/" "$SERVICES_DIR/$name.conf"