fix: improve channel allow_from logging for better debugging (Closes #2381)
This commit is contained in:
parent
f0e6b7aa37
commit
770732094d
1 changed files with 7 additions and 1 deletions
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
|
"fmt"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
@ -118,10 +119,15 @@ func NewBaseChannel(
|
||||||
// currently defaults to accepting messages from ANYONE. To explicitly
|
// currently defaults to accepting messages from ANYONE. To explicitly
|
||||||
// acknowledge and permit this (e.g. for a public bot), use ["*"].
|
// acknowledge and permit this (e.g. for a public bot), use ["*"].
|
||||||
if len(bc.allowList) == 0 {
|
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,
|
"channel": bc.name,
|
||||||
"hint": "Set allow_from to your ID, or use '*' to explicitly acknowledge open access.",
|
"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
|
return bc
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue