From 770732094d522da2fdcc4eeb2b314882160510f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E6=96=87=E9=94=8B0668000834?= Date: Tue, 7 Apr 2026 14:05:59 +0800 Subject: [PATCH] fix: improve channel allow_from logging for better debugging (Closes #2381) --- pkg/channels/base.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/channels/base.go b/pkg/channels/base.go index bd4ced849..6a1090837 100644 --- a/pkg/channels/base.go +++ b/pkg/channels/base.go @@ -5,6 +5,7 @@ import ( "crypto/rand" "encoding/binary" "encoding/hex" + "fmt" "regexp" "strconv" "strings" @@ -118,10 +119,15 @@ func NewBaseChannel( // currently defaults to accepting messages from ANYONE. To explicitly // acknowledge and permit this (e.g. for a public bot), use ["*"]. if len(bc.allowList) == 0 { - logger.WarnCF("channels", "SECURITY: Channel allows EVERYONE (allow_from is empty)", map[string]any{ + logger.WarnCF("channels", fmt.Sprintf("SECURITY: Channel '%s' allows EVERYONE (allow_from is empty)", bc.name), map[string]any{ "channel": bc.name, "hint": "Set allow_from to your ID, or use '*' to explicitly acknowledge open access.", }) + } else { + logger.InfoCF("channels", fmt.Sprintf("Channel '%s' allow_from configured", bc.name), map[string]any{ + "channel": bc.name, + "allow_list": bc.allowList, + }) } return bc