mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03:34 +00:00
feat: machine Reset endpoint with asynchronous resource and data cleanup
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user