mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-05-01 21:10:13 +00:00
feat: add comprehensive node cleanup system
Implements automated cleanup workflow when nodes are deleted from Pulse, removing all monitoring footprint from the host. Changes include a new RPC handler in the sensor proxy for cleanup requests, enhanced node deletion modal with detailed cleanup explanations, and improved SSH key management with proper tagging for atomic updates.
This commit is contained in:
parent
d0f7fd6404
commit
123e0f04ca
8 changed files with 487 additions and 130 deletions
|
|
@ -35,6 +35,10 @@ const (
|
|||
maxRequestBytes = 16 * 1024 // 16 KiB max request size
|
||||
)
|
||||
|
||||
func defaultWorkDir() string {
|
||||
return "/var/lib/pulse-sensor-proxy"
|
||||
}
|
||||
|
||||
var rootCmd = &cobra.Command{
|
||||
Use: "pulse-sensor-proxy",
|
||||
Short: "Pulse Sensor Proxy - Secure sensor data bridge for containerized Pulse",
|
||||
|
|
@ -74,6 +78,7 @@ func main() {
|
|||
type Proxy struct {
|
||||
socketPath string
|
||||
sshKeyPath string
|
||||
workDir string
|
||||
listener net.Listener
|
||||
rateLimiter *rateLimiter
|
||||
nodeGate *nodeGate
|
||||
|
|
@ -93,6 +98,7 @@ const (
|
|||
RPCRegisterNodes = "register_nodes"
|
||||
RPCGetTemperature = "get_temperature"
|
||||
RPCGetStatus = "get_status"
|
||||
RPCRequestCleanup = "request_cleanup"
|
||||
)
|
||||
|
||||
// RPCRequest represents a request from Pulse
|
||||
|
|
@ -158,12 +164,20 @@ func runProxy() {
|
|||
metrics: metrics,
|
||||
}
|
||||
|
||||
if wd, err := os.Getwd(); err == nil {
|
||||
proxy.workDir = wd
|
||||
} else {
|
||||
log.Warn().Err(err).Msg("Failed to determine working directory; using default")
|
||||
proxy.workDir = defaultWorkDir()
|
||||
}
|
||||
|
||||
// Register RPC method handlers
|
||||
proxy.router = map[string]handlerFunc{
|
||||
RPCGetStatus: proxy.handleGetStatusV2,
|
||||
RPCEnsureClusterKeys: proxy.handleEnsureClusterKeysV2,
|
||||
RPCRegisterNodes: proxy.handleRegisterNodesV2,
|
||||
RPCGetTemperature: proxy.handleGetTemperatureV2,
|
||||
RPCRequestCleanup: proxy.handleRequestCleanup,
|
||||
}
|
||||
|
||||
if err := proxy.initAuthRules(); err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue