From 31c55525c38362168ccacbaf33b35cd5a033da7b Mon Sep 17 00:00:00 2001 From: devops Date: Thu, 15 Oct 2026 07:02:00 +0000 Subject: [PATCH] fix(support-chat): sync backend key from running bot --- scripts/deploy.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/deploy.sh b/scripts/deploy.sh index e918eb44..8979fe86 100644 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -66,6 +66,18 @@ fi cd "$TARGET_DIR" +# Capture the bot key from Docker before recreating the bot; runner mounts may not include the host env file. +if docker inspect canina-bot >/dev/null 2>&1; then + LIVE_BOT_KEY= + if [ -n "" ]; then + grep -v ^SUPPORT_CHAT_KEY= .support-chat.env > .support-chat.env.tmp 2>/dev/null || true + printf "SUPPORT_CHAT_KEY=%s\n" "" >> .support-chat.env.tmp + mv .support-chat.env.tmp .support-chat.env + chmod 600 .support-chat.env + fi + unset LIVE_BOT_KEY +fi + # Inject support-chat runtime configuration from CI/CD without committing secrets. # The bot is the runtime owner of the internal key; synchronize only the # matching value into the colocated backend env file, never into Git or logs.