From 552c6e944593e4393a204fcb0e4d0fec11c49c8d Mon Sep 17 00:00:00 2001 From: az Date: Fri, 9 Sep 2022 15:59:28 +0200 Subject: [PATCH] [skip ci] move provisionFirewall --- .../firewall/base => ubuntu/firewall}/FirewallBackup.kt | 4 +++- .../firewall/ProvisionFirewall.kt | 2 +- .../firewall/ProvisionFirewallKtTest.kt | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) rename src/main/kotlin/org/domaindrivenarchitecture/provs/framework/{extensions/server_software/standalone_server/firewall/base => ubuntu/firewall}/FirewallBackup.kt (86%) rename src/main/kotlin/org/domaindrivenarchitecture/provs/framework/{extensions/server_software/standalone_server => ubuntu}/firewall/ProvisionFirewall.kt (97%) rename src/test/kotlin/org/domaindrivenarchitecture/provs/framework/{extensions/server_software/standalone_server => ubuntu}/firewall/ProvisionFirewallKtTest.kt (94%) diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/extensions/server_software/standalone_server/firewall/base/FirewallBackup.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/firewall/FirewallBackup.kt similarity index 86% rename from src/main/kotlin/org/domaindrivenarchitecture/provs/framework/extensions/server_software/standalone_server/firewall/base/FirewallBackup.kt rename to src/main/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/firewall/FirewallBackup.kt index a9d5dc0..bbdaccf 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/extensions/server_software/standalone_server/firewall/base/FirewallBackup.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/firewall/FirewallBackup.kt @@ -1,4 +1,4 @@ -package org.domaindrivenarchitecture.provs.framework.extensions.server_software.standalone_server.firewall.base +package org.domaindrivenarchitecture.provs.framework.ubuntu.firewall import org.domaindrivenarchitecture.provs.framework.core.Prov import org.domaindrivenarchitecture.provs.framework.core.ProvResult @@ -6,6 +6,7 @@ import java.time.LocalDateTime import java.time.format.DateTimeFormatter +@Suppress("unused") fun Prov.saveIpTablesToFile() = task { val dateTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("-yyyy-MM-dd--HH:mm:ss")) val file = "savedrules$dateTime.txt" @@ -14,6 +15,7 @@ fun Prov.saveIpTablesToFile() = task { cat $file""") } +@Suppress("unused") fun Prov.restoreIpTablesFromFile(file: String? = null) = task { val fileName = file ?: cmd("ls -r a* | head -1\n").out fileName?.let { cmd("sudo iptables-restore < $file") } diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/extensions/server_software/standalone_server/firewall/ProvisionFirewall.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/firewall/ProvisionFirewall.kt similarity index 97% rename from src/main/kotlin/org/domaindrivenarchitecture/provs/framework/extensions/server_software/standalone_server/firewall/ProvisionFirewall.kt rename to src/main/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/firewall/ProvisionFirewall.kt index 3c1dd7c..53dc0a9 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/extensions/server_software/standalone_server/firewall/ProvisionFirewall.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/firewall/ProvisionFirewall.kt @@ -1,4 +1,4 @@ -package org.domaindrivenarchitecture.provs.framework.extensions.server_software.standalone_server.firewall +package org.domaindrivenarchitecture.provs.framework.ubuntu.firewall import org.domaindrivenarchitecture.provs.framework.core.Prov import org.domaindrivenarchitecture.provs.framework.core.ProvResult diff --git a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/extensions/server_software/standalone_server/firewall/ProvisionFirewallKtTest.kt b/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/firewall/ProvisionFirewallKtTest.kt similarity index 94% rename from src/test/kotlin/org/domaindrivenarchitecture/provs/framework/extensions/server_software/standalone_server/firewall/ProvisionFirewallKtTest.kt rename to src/test/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/firewall/ProvisionFirewallKtTest.kt index 2c770a0..08f4076 100644 --- a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/extensions/server_software/standalone_server/firewall/ProvisionFirewallKtTest.kt +++ b/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/firewall/ProvisionFirewallKtTest.kt @@ -1,4 +1,4 @@ -package org.domaindrivenarchitecture.provs.framework.extensions.server_software.standalone_server.firewall +package org.domaindrivenarchitecture.provs.framework.ubuntu.firewall import org.domaindrivenarchitecture.provs.framework.core.Prov import org.domaindrivenarchitecture.provs.framework.core.docker.dockerProvideImage