feat: machine Reset endpoint with asynchronous resource and data cleanup

This commit is contained in:
Pasha Sviderski
2025-07-24 19:50:25 +10:00
parent 2acfafe218
commit 7a6c5bf6d7
9 changed files with 217 additions and 35 deletions
@@ -6,3 +6,8 @@ import "fmt"
func ConfigureIptablesChains() error {
return fmt.Errorf("not supported on Darwin")
}
// CleanupIptablesChains is a stub for Darwin.
func CleanupIptablesChains() error {
return fmt.Errorf("not supported on Darwin")
}
+1 -4
View File
@@ -16,7 +16,7 @@ const (
// ConfigureIptablesChains sets up custom iptables chains and initial firewall rules for Uncloud networking.
func ConfigureIptablesChains() error {
// Ensure iptables UNCLOUD-INPUT chain with a RETURN rule exists. All existing rules are flushed.
// Ensure iptables UNCLOUD-INPUT chain exists. All existing rules are flushed.
ipt := iptables.GetIptable(iptables.IPv4)
if _, err := ipt.NewChain(UncloudInputChain, iptables.Filter); err != nil {
return fmt.Errorf("create iptables chain '%s': %w", UncloudInputChain, err)
@@ -24,9 +24,6 @@ func ConfigureIptablesChains() error {
if err := ipt.RawCombinedOutput("-t", string(iptables.Filter), "-F", UncloudInputChain); err != nil {
return fmt.Errorf("flush iptables chain '%s': %w", UncloudInputChain, err)
}
if err := ipt.AddReturnRule(UncloudInputChain); err != nil {
return fmt.Errorf("add the RETURN rule for iptables chain '%s': %w", UncloudInputChain, err)
}
// Ensure the main iptables INPUT chain has a jump rule to the UNCLOUD-INPUT chain before any DROP/REJECT rules.
jumpRule := []string{"-m", "comment", "--comment", "Uncloud-managed", "-j", UncloudInputChain}