Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
package dockeragent
import (
"fmt"
"io"
)
const (
maxPulseResponseBodyBytes = 1 * 1024 * 1024
maxVersionResponseBodyBytes = 64 * 1024
maxRegistryManifestBodyBytes = 4 * 1024 * 1024
maxRegistryTokenBodyBytes = 1 * 1024 * 1024
maxContainerStatsBodyBytes = 4 * 1024 * 1024
)
func readBodyWithLimit(r io.Reader, maxBytes int64) ([]byte, error) {
body, err := io.ReadAll(io.LimitReader(r, maxBytes+1))
if err != nil {
return nil, err
}
if int64(len(body)) > maxBytes {
return nil, fmt.Errorf("response body exceeds %d bytes", maxBytes)
}
return body, nil
}