mirror of
https://github.com/Dvorinka/beszel.git
synced 2026-06-03 21:02:56 +00:00
feat(site): enhance monitoring, domain, and system tracking
Build Docker images / Hub (push) Failing after 5m57s
Build Docker images / Hub (push) Failing after 5m57s
- Improve domain lookup by adding CNAME and SRV record support
- Enhance domain status logic to include expiry and DNS resolution verification
- Update monitoring API to perform synchronous initial checks for immediate status updates
- Refactor site UI:
- Add tag filtering to domains and monitors tables
- Improve calendar view with better visual indicators for today and events
- Update monitor detail view with improved status badges and pending states
- Simplify home page layout by removing redundant card wrappers
- Update localization files for numerous languages to support new UI elements
- Add `cleanEndpointsConfig` to hub to safely reuse Docker network settings during container updates
This commit is contained in:
@@ -46,3 +46,72 @@ func TestDigestValue(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestCleanEndpointsConfig(t *testing.T) {
|
||||
input := map[string]map[string]any{
|
||||
"beszel": {
|
||||
"NetworkID": "abc123",
|
||||
"EndpointID": "ep456",
|
||||
"Gateway": "172.20.0.1",
|
||||
"IPAddress": "172.20.0.5",
|
||||
"IPPrefixLen": 16,
|
||||
"IPv6Gateway": "",
|
||||
"GlobalIPv6Address": "",
|
||||
"GlobalIPv6PrefixLen": 0,
|
||||
"MacAddress": "02:42:ac:14:00:05",
|
||||
"Aliases": []string{"beszel", "beszel-hub"},
|
||||
"Links": nil,
|
||||
"IPAMConfig": nil,
|
||||
},
|
||||
"bridge": {
|
||||
"NetworkID": "bridge-net",
|
||||
"IPAddress": "172.17.0.2",
|
||||
"Aliases": []string{},
|
||||
"DriverOpts": map[string]string{},
|
||||
},
|
||||
}
|
||||
|
||||
got := cleanEndpointsConfig(input)
|
||||
|
||||
if got == nil {
|
||||
t.Fatal("cleanEndpointsConfig returned nil for non-nil input")
|
||||
}
|
||||
|
||||
for netName, cfgRaw := range got {
|
||||
cfg, ok := cfgRaw.(map[string]any)
|
||||
if !ok {
|
||||
t.Fatalf("expected network %q config to be map[string]any, got %T", netName, cfgRaw)
|
||||
}
|
||||
for k := range cfg {
|
||||
switch k {
|
||||
case "NetworkID", "EndpointID", "Gateway", "IPAddress", "IPPrefixLen",
|
||||
"IPv6Gateway", "GlobalIPv6Address", "GlobalIPv6PrefixLen", "MacAddress":
|
||||
t.Fatalf("runtime field %q was NOT stripped from network %q", k, netName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
beszelCfg, ok := got["beszel"].(map[string]any)
|
||||
if !ok {
|
||||
t.Fatal("expected beszel network config to be map[string]any")
|
||||
}
|
||||
aliases, ok := beszelCfg["Aliases"].([]string)
|
||||
if !ok || len(aliases) != 2 || aliases[0] != "beszel" {
|
||||
t.Fatalf("expected Aliases to be preserved, got %v", beszelCfg["Aliases"])
|
||||
}
|
||||
|
||||
bridgeCfg, ok := got["bridge"].(map[string]any)
|
||||
if !ok {
|
||||
t.Fatal("expected bridge network config to be map[string]any")
|
||||
}
|
||||
if _, ok := bridgeCfg["DriverOpts"]; !ok {
|
||||
t.Fatal("expected DriverOpts to be preserved in bridge network")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCleanEndpointsConfigNil(t *testing.T) {
|
||||
got := cleanEndpointsConfig(nil)
|
||||
if got != nil {
|
||||
t.Fatalf("expected nil, got %v", got)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user