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:
@@ -521,7 +521,7 @@ func (d *dockerAPI) replaceContainer(targetID, image string) error {
|
||||
delete(hostConfig, "AutoRemove")
|
||||
createBody := cloneMap(config)
|
||||
createBody["HostConfig"] = hostConfig
|
||||
createBody["NetworkingConfig"] = map[string]any{"EndpointsConfig": current.NetworkSettings.Networks}
|
||||
createBody["NetworkingConfig"] = map[string]any{"EndpointsConfig": cleanEndpointsConfig(current.NetworkSettings.Networks)}
|
||||
|
||||
var created dockerCreateResponse
|
||||
if err := d.do(http.MethodPost, "/containers/create?name="+url.QueryEscape(newName), createBody, &created); err != nil {
|
||||
@@ -565,3 +565,26 @@ func cloneMap(in map[string]any) map[string]any {
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
// cleanEndpointsConfig strips runtime-populated fields from Docker network settings
|
||||
// so they can be safely reused in a container create request.
|
||||
func cleanEndpointsConfig(networks map[string]map[string]any) map[string]any {
|
||||
if networks == nil {
|
||||
return nil
|
||||
}
|
||||
out := make(map[string]any, len(networks))
|
||||
for netName, cfg := range networks {
|
||||
cleaned := make(map[string]any, len(cfg))
|
||||
for k, v := range cfg {
|
||||
switch k {
|
||||
case "NetworkID", "EndpointID", "Gateway", "IPAddress", "IPPrefixLen",
|
||||
"IPv6Gateway", "GlobalIPv6Address", "GlobalIPv6PrefixLen", "MacAddress":
|
||||
continue
|
||||
default:
|
||||
cleaned[k] = v
|
||||
}
|
||||
}
|
||||
out[netName] = cleaned
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user