Update relaytester-test.sh log level to off and improve follows key decoding logic in ACL implementation for clarity and error handling.

This commit is contained in:
2025-09-10 14:30:31 +01:00
parent faad7ddc93
commit 2385d1f752
2 changed files with 7 additions and 3 deletions

View File

@@ -69,8 +69,10 @@ func (f *Follows) Configure(cfg ...any) (err error) {
for _, admin := range f.cfg.Admins { for _, admin := range f.cfg.Admins {
log.I.F("%s", admin) log.I.F("%s", admin)
var adm []byte var adm []byte
if adm, err = bech32encoding.NpubOrHexToPublicKeyBinary(admin); chk.E(err) { if a, e := bech32encoding.NpubOrHexToPublicKeyBinary(admin); chk.E(e) {
continue continue
} else {
adm = a
} }
log.I.F("admin: %0x", adm) log.I.F("admin: %0x", adm)
f.admins = append(f.admins, adm) f.admins = append(f.admins, adm)
@@ -100,8 +102,10 @@ func (f *Follows) Configure(cfg ...any) (err error) {
for _, v := range ev.Tags.GetAll([]byte("p")) { for _, v := range ev.Tags.GetAll([]byte("p")) {
log.I.F("adding follow: %s", v.Value()) log.I.F("adding follow: %s", v.Value())
var a []byte var a []byte
if a, err = hex.Dec(string(v.Value())); chk.E(err) { if b, e := hex.Dec(string(v.Value())); chk.E(e) {
continue continue
} else {
a = b
} }
f.follows = append(f.follows, a) f.follows = append(f.follows, a)
} }

View File

@@ -7,7 +7,7 @@ if ! command -v "relay-tester" &> /dev/null; then
echo "./scripts/relaytester-install.sh" echo "./scripts/relaytester-install.sh"
exit exit
fi fi
export ORLY_LOG_LEVEL=trace export ORLY_LOG_LEVEL=off
export ORLY_LISTEN=127.0.0.1 export ORLY_LISTEN=127.0.0.1
export ORLY_PORT=3334 export ORLY_PORT=3334
export ORLY_IP_WHITELIST=127.0.0 export ORLY_IP_WHITELIST=127.0.0