mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-04-28 19:41:17 +00:00
chore: remove legacy proxy handlers and unused functions
Remove legacy V1 handlers replaced by V2 versions: - sendError (replaced by sendErrorV2) - handleGetStatus (replaced by handleGetStatusV2) - handleEnsureClusterKeys (replaced by handleEnsureClusterKeysV2) - handleRegisterNodes (replaced by handleRegisterNodesV2) - handleGetTemperature (replaced by handleGetTemperatureV2) Also remove related unused functions: - getPublicKey wrapper (only getPublicKeyFrom is used) - pushSSHKey wrapper (only pushSSHKeyFrom is used) - nodeValidator.ipAllowed method (standalone ipAllowed is used) - validateConfigFile (never called) - runServiceDebug (Windows debug mode, never called)
This commit is contained in:
parent
2a5520ef25
commit
3fce14469c
6 changed files with 1 additions and 252 deletions
|
|
@ -338,36 +338,6 @@ func updateConfigMap(path string, updateFn func(map[string]interface{}) error) e
|
|||
})
|
||||
}
|
||||
|
||||
// validateConfigFile parses and validates the main config file
|
||||
func validateConfigFile(path string) error {
|
||||
data, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to read config file: %w", err)
|
||||
}
|
||||
|
||||
// Check for duplicate allowed_nodes blocks (the issue we're fixing)
|
||||
sanitized, cleanData := sanitizeDuplicateAllowedNodesBlocks("", data)
|
||||
if sanitized {
|
||||
return fmt.Errorf("config contains duplicate allowed_nodes blocks (would auto-fix on service start)")
|
||||
}
|
||||
|
||||
// Parse YAML
|
||||
cfg := &Config{}
|
||||
if err := yaml.Unmarshal(cleanData, cfg); err != nil {
|
||||
return fmt.Errorf("failed to parse config YAML: %w", err)
|
||||
}
|
||||
|
||||
// Validate required fields
|
||||
if cfg.ReadTimeout <= 0 {
|
||||
return fmt.Errorf("read_timeout must be positive")
|
||||
}
|
||||
if cfg.WriteTimeout <= 0 {
|
||||
return fmt.Errorf("write_timeout must be positive")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// validateAllowedNodesFile parses and validates the allowed_nodes.yaml file
|
||||
func validateAllowedNodesFile(path string) error {
|
||||
data, err := os.ReadFile(path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue