From 301efb32ffe2c15b9ac7021906aba153b2a470bd Mon Sep 17 00:00:00 2001 From: kjh2064 Date: Sat, 27 Jun 2026 22:12:08 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=ED=85=94=EB=A0=88=EA=B7=B8=EB=9E=A8=20?= =?UTF-8?q?=EC=95=8C=EB=A6=BC=20=EC=9A=B4=EC=98=81=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=EB=B0=B0=ED=8F=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/deploy.yml | 12 +++++++++++- .../Services/TelegramInquiryNotificationService.cs | 6 ++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 120b9fe..2596cb7 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -36,11 +36,21 @@ jobs: run: | set -e JWT_SECRET_KEY="${{ secrets.TAXBAIK_JWT_SECRET_KEY }}" + TELEGRAM_BOT_TOKEN="${{ secrets.TAXBAIK_TELEGRAM_BOT_TOKEN }}" + TELEGRAM_CHAT_ID="${{ secrets.TAXBAIK_TELEGRAM_CHAT_ID }}" if [ -z "$JWT_SECRET_KEY" ]; then echo "Missing TAXBAIK_JWT_SECRET_KEY secret" >&2 exit 1 fi - JWT_SECRET_KEY="$JWT_SECRET_KEY" python3 -c 'import json, os, pathlib; pathlib.Path("./publish/appsettings.Production.json").write_text(json.dumps({"Jwt":{"SecretKey":os.environ["JWT_SECRET_KEY"]}}, ensure_ascii=False, indent=2), encoding="utf-8")' + if [ -z "$TELEGRAM_BOT_TOKEN" ]; then + echo "Missing TAXBAIK_TELEGRAM_BOT_TOKEN secret" >&2 + exit 1 + fi + if [ -z "$TELEGRAM_CHAT_ID" ]; then + echo "Missing TAXBAIK_TELEGRAM_CHAT_ID secret" >&2 + exit 1 + fi + JWT_SECRET_KEY="$JWT_SECRET_KEY" TELEGRAM_BOT_TOKEN="$TELEGRAM_BOT_TOKEN" TELEGRAM_CHAT_ID="$TELEGRAM_CHAT_ID" python3 -c 'import json, os, pathlib; pathlib.Path("./publish/appsettings.Production.json").write_text(json.dumps({"Jwt":{"SecretKey":os.environ["JWT_SECRET_KEY"]},"Telegram":{"BotToken":os.environ["TELEGRAM_BOT_TOKEN"],"ChatId":os.environ["TELEGRAM_CHAT_ID"]}}, ensure_ascii=False, indent=2), encoding="utf-8")' test -s ./publish/appsettings.Production.json - name: Copy migrations to publish diff --git a/TaxBaik.Web/Services/TelegramInquiryNotificationService.cs b/TaxBaik.Web/Services/TelegramInquiryNotificationService.cs index d794b48..0dfd011 100644 --- a/TaxBaik.Web/Services/TelegramInquiryNotificationService.cs +++ b/TaxBaik.Web/Services/TelegramInquiryNotificationService.cs @@ -24,7 +24,10 @@ public class TelegramInquiryNotificationService : IInquiryNotificationService var botToken = _configuration["Telegram:BotToken"]; var chatId = _configuration["Telegram:ChatId"]; if (string.IsNullOrWhiteSpace(botToken) || string.IsNullOrWhiteSpace(chatId)) + { + _logger.LogWarning("텔레그램 새 문의 알림 설정이 누락되었습니다. Telegram:BotToken 또는 Telegram:ChatId를 확인하세요."); return; + } var adminLink = $"{_baseUrl}/admin/inquiries"; var summary = message.Length > 180 ? message[..180] + "..." : message; @@ -77,7 +80,10 @@ public class TelegramInquiryNotificationService : IInquiryNotificationService var botToken = _configuration["Telegram:BotToken"]; var chatId = _configuration["Telegram:ChatId"]; if (string.IsNullOrWhiteSpace(botToken) || string.IsNullOrWhiteSpace(chatId)) + { + _logger.LogWarning("텔레그램 상태 변경 알림 설정이 누락되었습니다. Telegram:BotToken 또는 Telegram:ChatId를 확인하세요."); return; + } var adminLink = $"{_baseUrl}/admin/inquiries"; var text = new StringBuilder()