From dc432d3f70a5b0b9fcc91bbb06ddc9f476b5ebe3 Mon Sep 17 00:00:00 2001 From: Dmitriy Fofanov Date: Wed, 29 Oct 2025 22:57:12 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=20=D1=83=D0=BB=D1=83=D1=87=D1=88=D0=B5=D0=BD=D0=BD?= =?UTF-8?q?=D0=BE=D0=B5=20=D0=BB=D0=BE=D0=B3=D0=B8=D1=80=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B4=D0=BB=D1=8F=20=D1=85=D1=83=D0=BA?= =?UTF-8?q?=D0=BE=D0=B2=20certbot,=20=D0=B2=D0=BA=D0=BB=D1=8E=D1=87=D0=B0?= =?UTF-8?q?=D1=8F=20=D0=B8=D0=BD=D1=84=D0=BE=D1=80=D0=BC=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D1=8E=20=D0=BE=20=D0=B7=D0=B0=D0=BF=D1=83=D1=89=D0=B5=D0=BD?= =?UTF-8?q?=D0=BD=D0=BE=D0=B9=20=D0=BA=D0=BE=D0=BC=D0=B0=D0=BD=D0=B4=D0=B5?= =?UTF-8?q?,=20Python=20=D0=B8=20=D1=81=D0=BA=D1=80=D0=B8=D0=BF=D1=82?= =?UTF-8?q?=D0=B5.=20=D0=A3=D0=BB=D1=83=D1=87=D1=88=D0=B5=D0=BD=D1=8B=20?= =?UTF-8?q?=D1=81=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20auth=20=D0=B8=20cleanup=20=D1=85=D1=83=D0=BA?= =?UTF-8?q?=D0=BE=D0=B2=20=D1=81=20=D0=B2=D1=8B=D0=B2=D0=BE=D0=B4=D0=BE?= =?UTF-8?q?=D0=BC=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=BD=D1=8B?= =?UTF-8?q?=D1=85=20=D0=BE=D0=BA=D1=80=D1=83=D0=B6=D0=B5=D0=BD=D0=B8=D1=8F?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- letsencrypt_regru_api.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/letsencrypt_regru_api.py b/letsencrypt_regru_api.py index 81dc9ed..463ddfe 100644 --- a/letsencrypt_regru_api.py +++ b/letsencrypt_regru_api.py @@ -1112,7 +1112,15 @@ class LetsEncryptManager: "--expand", ] + domain_args - self.logger.info(f"Выполнение команды: {' '.join(cmd)}") + self.logger.info("=" * 80) + self.logger.info("ЗАПУСК CERTBOT") + self.logger.info("=" * 80) + self.logger.info(f"Команда: {' '.join(cmd)}") + self.logger.info(f"Python: {sys.executable}") + self.logger.info(f"Скрипт: {os.path.abspath(__file__)}") + self.logger.info(f"Auth hook: {sys.executable} {os.path.abspath(__file__)} --auth-hook") + self.logger.info(f"Cleanup hook: {sys.executable} {os.path.abspath(__file__)} --cleanup-hook") + self.logger.info("=" * 80) try: result = subprocess.run( @@ -1481,10 +1489,17 @@ def main(): # Обработка хуков для certbot if args.auth_hook: + logger.info("=" * 80) + logger.info("🔑 AUTH HOOK ВЫЗВАН") + logger.info("=" * 80) + # Certbot передает домен и токен через переменные окружения domain = os.environ.get("CERTBOT_DOMAIN") token = os.environ.get("CERTBOT_VALIDATION") + logger.info(f"CERTBOT_DOMAIN: {domain}") + logger.info(f"CERTBOT_VALIDATION: {token[:20]}..." if token else "CERTBOT_VALIDATION: None") + if domain and token: api = RegRuAPI(config["regru_username"], config["regru_password"], logger) manager = LetsEncryptManager(config, api, logger) @@ -1495,9 +1510,16 @@ def main(): return 1 if args.cleanup_hook: + logger.info("=" * 80) + logger.info("🧹 CLEANUP HOOK ВЫЗВАН") + logger.info("=" * 80) + domain = os.environ.get("CERTBOT_DOMAIN") token = os.environ.get("CERTBOT_VALIDATION") + logger.info(f"CERTBOT_DOMAIN: {domain}") + logger.info(f"CERTBOT_VALIDATION: {token[:20]}..." if token else "CERTBOT_VALIDATION: None") + if domain and token: api = RegRuAPI(config["regru_username"], config["regru_password"], logger) manager = LetsEncryptManager(config, api, logger)