refactor: common util package, ESL/AMI/security fixes, Prometheus metrics
Backend stability and security improvements: * internal/util/ — common RandomHex helper, removed 3 duplicates * ESL: deduplicated readMessage (locked/unlocked), net.JoinHostPort for IPv6 * AMI: synchronous reconnect() in readEventsLoop, net.JoinHostPort for IPv6 * Auth: /api/auth/refresh accepts Authorization header only (no ?token=) * decodeJSON: http.MaxBytesReader(1<<20) body limit * Trunks: gatewayParams() uses configured ESL.GatewayPrefix * Config: jwt_secret_env env-var fallback * FSCollector: time.After → time.NewTimer with defer Stop * Monitoring: Prometheus counters (route_requests, nodes_total/healthy, uptime) * go fmt pass across all internal/ packages
This commit is contained in:
@@ -49,7 +49,7 @@ type valueSpec struct {
|
||||
isRand bool
|
||||
}
|
||||
|
||||
func fixed(v float64) valueSpec { return valueSpec{fixed: v} }
|
||||
func fixed(v float64) valueSpec { return valueSpec{fixed: v} }
|
||||
func rrange(min, max float64) valueSpec {
|
||||
return valueSpec{min: min, max: max, isRand: true}
|
||||
}
|
||||
@@ -71,7 +71,7 @@ type nodeSpec struct {
|
||||
idleCPU valueSpec
|
||||
loadAvg valueSpec
|
||||
failRate valueSpec
|
||||
sipGateway string // SIP-адрес для авто-создания транка
|
||||
sipGateway string // SIP-адрес для авто-создания транка
|
||||
}
|
||||
|
||||
func (ns *nodeSpec) generate() nodeMetric {
|
||||
|
||||
Reference in New Issue
Block a user