feat: start Wallarm via supervisord after registration

This commit is contained in:
admin 2026-08-01 19:26:52 +00:00
parent b01f5d6a52
commit bf3ba41179

View file

@ -95,7 +95,14 @@ func InstallNode(node state.Node, apiToken, apiHost, labels string) error {
return fmt.Errorf("register: %w\n%s", regErr, string(out)) return fmt.Errorf("register: %w\n%s", regErr, string(out))
} }
// 7. Move /opt/wallarm → /opt/fw/{name}/wallarm // 7. Stop our temporary NGINX, start Wallarm via supervisord
exec.Command("pkill", "-f", filepath.Join(DeployTo, "nginx")).Run()
supervisorCmd := exec.Command("bash", filepath.Join(DeployTo, "supervisord.sh"), "start")
supervisorCmd.Dir = DeployTo
supervisorCmd.Run()
fmt.Printf("[%s] Services started.\n", node.Name)
// 8. Move /opt/wallarm → /opt/fw/{name}/wallarm
os.MkdirAll(filepath.Join(BaseDir, node.Name), 0755) os.MkdirAll(filepath.Join(BaseDir, node.Name), 0755)
os.RemoveAll(instanceDir) os.RemoveAll(instanceDir)
os.Rename(DeployTo, instanceDir) os.Rename(DeployTo, instanceDir)