Enhance Dockerfile to build and include a new HTTP API service (mtproxy_checkerd) alongside the existing CLI tool (mtproxy_checker). Update README and documentation to reflect the new service and its usage, including environment variables and Docker run instructions.
Publish mtproxy_checker Docker image / test (push) Successful in 11s
Publish mtproxy_checker Docker image / build-and-push (push) Successful in 56s

This commit is contained in:
Denozordec
2026-04-11 00:50:57 +07:00
parent 4905c06b9b
commit 5a66f0f2e8
8 changed files with 482 additions and 6 deletions
+32
View File
@@ -0,0 +1,32 @@
package allowlist
import (
"net/netip"
"testing"
)
func TestParseCommaList(t *testing.T) {
list, err := ParseCommaList(" ")
if err != nil || list != nil {
t.Fatalf("empty: list=%v err=%v", list, err)
}
list, err = ParseCommaList("192.168.1.1, 10.0.0.0/8")
if err != nil {
t.Fatal(err)
}
if len(list) != 2 {
t.Fatalf("want 2 prefixes, got %d", len(list))
}
a := netip.MustParseAddr("10.5.5.5")
if !Contains(list, a) {
t.Fatal("10.5.5.5 should match 10.0.0.0/8")
}
b := netip.MustParseAddr("192.168.1.1")
if !Contains(list, b) {
t.Fatal("192.168.1.1 should match host /32")
}
c := netip.MustParseAddr("8.8.8.8")
if Contains(list, c) {
t.Fatal("8.8.8.8 should not match")
}
}