summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.idea/runConfigurations/Main.xml15
-rw-r--r--classpath.txt56
-rw-r--r--module/ri-engine/classpath.txt56
-rw-r--r--module/ri-engine/pom.xml93
-rw-r--r--module/ri-engine/src/main/java/io/trygvis/rules/acme/AcmeIo.java (renamed from src/main/java/io/trygvis/rules/acme/AcmeIo.java)0
-rw-r--r--module/ri-engine/src/main/java/io/trygvis/rules/acme/AcmeMyApp.java (renamed from src/main/java/io/trygvis/rules/acme/AcmeMyApp.java)0
-rw-r--r--module/ri-engine/src/main/java/io/trygvis/rules/acme/AcmeObject.java (renamed from src/main/java/io/trygvis/rules/acme/AcmeObject.java)0
-rw-r--r--module/ri-engine/src/main/java/io/trygvis/rules/acme/AcmeOps.java (renamed from src/main/java/io/trygvis/rules/acme/AcmeOps.java)0
-rw-r--r--module/ri-engine/src/main/java/io/trygvis/rules/acme/IpCalc.java (renamed from src/main/java/io/trygvis/rules/acme/IpCalc.java)0
-rw-r--r--module/ri-engine/src/main/java/io/trygvis/rules/dba/Cluster.java (renamed from src/main/java/io/trygvis/rules/dba/Cluster.java)0
-rw-r--r--module/ri-engine/src/main/java/io/trygvis/rules/dba/Container.java (renamed from src/main/java/io/trygvis/rules/dba/Container.java)0
-rw-r--r--module/ri-engine/src/main/java/io/trygvis/rules/dns/DnsEntry.java (renamed from src/main/java/io/trygvis/rules/dns/DnsEntry.java)0
-rw-r--r--module/ri-engine/src/main/java/io/trygvis/rules/dns/DnsEntryTerraformExpression.java (renamed from src/main/java/io/trygvis/rules/dns/DnsEntryTerraformExpression.java)0
-rw-r--r--module/ri-engine/src/main/java/io/trygvis/rules/engine/KeyValue.java (renamed from src/main/java/io/trygvis/rules/engine/KeyValue.java)0
-rw-r--r--module/ri-engine/src/main/java/io/trygvis/rules/engine/Main.java (renamed from src/main/java/io/trygvis/rules/engine/Main.java)0
-rw-r--r--module/ri-engine/src/main/java/io/trygvis/rules/engine/TemplateEngine.java (renamed from src/main/java/io/trygvis/rules/engine/TemplateEngine.java)0
-rw-r--r--module/ri-engine/src/main/java/io/trygvis/rules/machine/Machine.java (renamed from src/main/java/io/trygvis/rules/machine/Machine.java)0
-rw-r--r--module/ri-engine/src/main/java/io/trygvis/rules/network/Ipv4Address.java (renamed from src/main/java/io/trygvis/rules/network/Ipv4Address.java)0
-rw-r--r--module/ri-engine/src/main/java/io/trygvis/rules/network/Ipv4Cidr.java (renamed from src/main/java/io/trygvis/rules/network/Ipv4Cidr.java)0
-rw-r--r--module/ri-engine/src/main/resources/META-INF/kmodule.xml (renamed from src/main/resources/META-INF/kmodule.xml)2
-rw-r--r--module/ri-engine/src/main/resources/io/trygvis/rules/acme/acme.drl (renamed from src/main/resources/io/trygvis/rules/acme/acme.drl)2
-rw-r--r--module/ri-engine/src/main/resources/io/trygvis/rules/dba/dba.drl (renamed from src/main/resources/io/trygvis/rules/dba/dba.drl)0
-rw-r--r--module/ri-engine/src/main/resources/io/trygvis/rules/engine/default.drl (renamed from src/main/resources/io/trygvis/rules/engine/default.drl)0
-rw-r--r--module/ri-engine/src/main/resources/io/trygvis/rules/machine/machine.drl (renamed from src/main/resources/io/trygvis/rules/machine/machine.drl)0
-rw-r--r--module/ri-engine/src/main/resources/io/trygvis/rules/terraform/terraform.drl (renamed from src/main/resources/io/trygvis/rules/terraform/terraform.drl)0
-rw-r--r--module/ri-engine/src/test/java/io/trygvis/rules/acme/IpCalcTest.java (renamed from src/test/java/io/trygvis/rules/acme/IpCalcTest.java)0
-rw-r--r--module/ri-wireguard/classpath.txt1
-rw-r--r--module/ri-wireguard/pom.xml16
-rw-r--r--module/ri-wireguard/src/main/java/io/trygvis/rules/acme/Foo.java7
-rw-r--r--module/ri-wireguard/src/main/resources/META-INF/kmodule.xml9
-rw-r--r--module/ri-wireguard/src/main/resources/io/trygvis/rules/acme/vpn.drl (renamed from src/main/resources/io/trygvis/rules/acme/vpn.drl)5
-rw-r--r--pom.xml85
32 files changed, 198 insertions, 149 deletions
diff --git a/.idea/runConfigurations/Main.xml b/.idea/runConfigurations/Main.xml
deleted file mode 100644
index 73974ed..0000000
--- a/.idea/runConfigurations/Main.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<component name="ProjectRunConfigurationManager">
- <configuration default="false" name="Main" type="Application" factoryName="Application" nameIsGenerated="true">
- <option name="MAIN_CLASS_NAME" value="io.trygvis.rules.engine.Main" />
- <module name="rules-sandbox" />
- <extension name="coverage">
- <pattern>
- <option name="PATTERN" value="io.trygvis.rules.engine.*" />
- <option name="ENABLED" value="true" />
- </pattern>
- </extension>
- <method v="2">
- <option name="Make" enabled="true" />
- </method>
- </configuration>
-</component> \ No newline at end of file
diff --git a/classpath.txt b/classpath.txt
index e1fd118..681bb0d 100644
--- a/classpath.txt
+++ b/classpath.txt
@@ -1,55 +1 @@
-io.trygvis.rules-sandbox:rules-sandbox:1.0-SNAPSHOT:jar
-ch.obermuhlner:big-math:2.0.1:jar
-ch.qos.logback:logback-classic:1.2.3:jar
-ch.qos.logback:logback-core:1.2.3:jar
-com.fasterxml.jackson.core:jackson-annotations:2.12.0:jar
-com.fasterxml.jackson.core:jackson-core:2.12.0:jar
-com.fasterxml.jackson.core:jackson-databind:2.12.0:jar
-com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.12.0:jar
-com.github.virtuald:curvesapi:1.06:jar
-com.google.code.findbugs:annotations:3.0.1:jar
-com.google.errorprone:error_prone_annotations:2.1.3:jar
-com.google.guava:guava:25.0-jre:jar
-com.google.j2objc:j2objc-annotations:1.1:jar
-com.google.re2j:re2j:1.2:jar
-com.googlecode.java-ipv6:java-ipv6:0.17:jar
-com.hubspot.jinjava:jinjava:2.5.6:jar
-com.thoughtworks.xstream:xstream:1.4.14:jar
-com.zaxxer:SparseBitSet:1.2:jar
-commons-codec:commons-codec:1.11:jar
-commons-io:commons-io:2.8.0:jar
-commons-net:commons-net:2.2:jar
-org.antlr:antlr-runtime:3.5.2:jar
-org.apache.commons:commons-collections4:4.4:jar
-org.apache.commons:commons-compress:1.19:jar
-org.apache.commons:commons-lang3:3.9:jar
-org.apache.commons:commons-math3:3.4.1:jar
-org.apache.poi:poi:4.1.2:jar
-org.apache.poi:poi-ooxml:4.1.2:jar
-org.apache.poi:poi-ooxml-schemas:4.1.2:jar
-org.apache.xmlbeans:xmlbeans:3.1.0:jar
-org.checkerframework:checker-compat-qual:2.0.0:jar
-org.codehaus.mojo:animal-sniffer-annotations:1.14:jar
-org.drools:drools-compiler:7.47.0.Final:jar
-org.drools:drools-core:7.47.0.Final:jar
-org.drools:drools-core-dynamic:7.47.0.Final:jar
-org.drools:drools-core-reflective:7.47.0.Final:jar
-org.drools:drools-decisiontables:7.47.0.Final:jar
-org.drools:drools-ecj:7.47.0.Final:jar
-org.drools:drools-mvel:7.47.0.Final:jar
-org.drools:drools-templates:7.47.0.Final:jar
-org.javassist:javassist:3.26.0-GA:jar
-org.jsoup:jsoup:1.8.3:jar
-org.kie:kie-api:7.47.0.Final:jar
-org.kie:kie-internal:7.47.0.Final:jar
-org.kie:kie-memory-compiler:7.47.0.Final:jar
-org.kie.soup:kie-soup-commons:7.47.0.Final:jar
-org.kie.soup:kie-soup-maven-support:7.47.0.Final:jar
-org.kie.soup:kie-soup-project-datamodel-api:7.47.0.Final:jar
-org.kie.soup:kie-soup-project-datamodel-commons:7.47.0.Final:jar
-org.kie.soup:kie-soup-xstream:7.47.0.Final:jar
-org.mvel:mvel2:2.4.10.Final:jar
-org.slf4j:slf4j-api:1.7.26:jar
-org.yaml:snakeyaml:1.26:jar
-xmlpull:xmlpull:1.2.0:jar
-xpp3:xpp3_min:1.2.0:jar
+io.trygvis.rules-sandbox:rules-sandbox:1.0-SNAPSHOT:pom
diff --git a/module/ri-engine/classpath.txt b/module/ri-engine/classpath.txt
new file mode 100644
index 0000000..a1d5666
--- /dev/null
+++ b/module/ri-engine/classpath.txt
@@ -0,0 +1,56 @@
+io.trygvis.rules-sandbox:ri-engine:1.0-SNAPSHOT:jar
+ch.obermuhlner:big-math:2.0.1:jar
+ch.qos.logback:logback-classic:1.2.3:jar
+ch.qos.logback:logback-core:1.2.3:jar
+com.fasterxml.jackson.core:jackson-annotations:2.12.0:jar
+com.fasterxml.jackson.core:jackson-core:2.12.0:jar
+com.fasterxml.jackson.core:jackson-databind:2.12.0:jar
+com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.12.0:jar
+com.github.virtuald:curvesapi:1.06:jar
+com.google.code.findbugs:annotations:3.0.1:jar
+com.google.errorprone:error_prone_annotations:2.1.3:jar
+com.google.guava:guava:25.0-jre:jar
+com.google.j2objc:j2objc-annotations:1.1:jar
+com.google.re2j:re2j:1.2:jar
+com.googlecode.java-ipv6:java-ipv6:0.17:jar
+com.hubspot.jinjava:jinjava:2.5.6:jar
+com.thoughtworks.xstream:xstream:1.4.14:jar
+com.zaxxer:SparseBitSet:1.2:jar
+commons-codec:commons-codec:1.11:jar
+commons-io:commons-io:2.8.0:jar
+commons-net:commons-net:2.2:jar
+io.trygvis.rules-sandbox:ri-wireguard:1.0-SNAPSHOT:jar
+org.antlr:antlr-runtime:3.5.2:jar
+org.apache.commons:commons-collections4:4.4:jar
+org.apache.commons:commons-compress:1.19:jar
+org.apache.commons:commons-lang3:3.9:jar
+org.apache.commons:commons-math3:3.4.1:jar
+org.apache.poi:poi:4.1.2:jar
+org.apache.poi:poi-ooxml:4.1.2:jar
+org.apache.poi:poi-ooxml-schemas:4.1.2:jar
+org.apache.xmlbeans:xmlbeans:3.1.0:jar
+org.checkerframework:checker-compat-qual:2.0.0:jar
+org.codehaus.mojo:animal-sniffer-annotations:1.14:jar
+org.drools:drools-compiler:7.47.0.Final:jar
+org.drools:drools-core:7.47.0.Final:jar
+org.drools:drools-core-dynamic:7.47.0.Final:jar
+org.drools:drools-core-reflective:7.47.0.Final:jar
+org.drools:drools-decisiontables:7.47.0.Final:jar
+org.drools:drools-ecj:7.47.0.Final:jar
+org.drools:drools-mvel:7.47.0.Final:jar
+org.drools:drools-templates:7.47.0.Final:jar
+org.javassist:javassist:3.26.0-GA:jar
+org.jsoup:jsoup:1.8.3:jar
+org.kie:kie-api:7.47.0.Final:jar
+org.kie:kie-internal:7.47.0.Final:jar
+org.kie:kie-memory-compiler:7.47.0.Final:jar
+org.kie.soup:kie-soup-commons:7.47.0.Final:jar
+org.kie.soup:kie-soup-maven-support:7.47.0.Final:jar
+org.kie.soup:kie-soup-project-datamodel-api:7.47.0.Final:jar
+org.kie.soup:kie-soup-project-datamodel-commons:7.47.0.Final:jar
+org.kie.soup:kie-soup-xstream:7.47.0.Final:jar
+org.mvel:mvel2:2.4.10.Final:jar
+org.slf4j:slf4j-api:1.7.26:jar
+org.yaml:snakeyaml:1.26:jar
+xmlpull:xmlpull:1.2.0:jar
+xpp3:xpp3_min:1.2.0:jar
diff --git a/module/ri-engine/pom.xml b/module/ri-engine/pom.xml
new file mode 100644
index 0000000..addd8c5
--- /dev/null
+++ b/module/ri-engine/pom.xml
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>io.trygvis.rules-sandbox</groupId>
+ <artifactId>rules-sandbox</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>ri-engine</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>ri-wireguard</artifactId>
+ <version>${project.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.kie</groupId>
+ <artifactId>kie-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-compiler</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-decisiontables</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-templates</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.kie</groupId>
+ <artifactId>kie-internal</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.mvel</groupId>
+ <artifactId>mvel2</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.fasterxml.jackson.dataformat</groupId>
+ <artifactId>jackson-dataformat-yaml</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-core</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.hubspot.jinjava</groupId>
+ <artifactId>jinjava</artifactId>
+ <version>2.5.6</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.8.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-api</artifactId>
+ <version>5.7.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-params</artifactId>
+ <version>5.7.0</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/src/main/java/io/trygvis/rules/acme/AcmeIo.java b/module/ri-engine/src/main/java/io/trygvis/rules/acme/AcmeIo.java
index 456195d..456195d 100644
--- a/src/main/java/io/trygvis/rules/acme/AcmeIo.java
+++ b/module/ri-engine/src/main/java/io/trygvis/rules/acme/AcmeIo.java
diff --git a/src/main/java/io/trygvis/rules/acme/AcmeMyApp.java b/module/ri-engine/src/main/java/io/trygvis/rules/acme/AcmeMyApp.java
index a1340e7..a1340e7 100644
--- a/src/main/java/io/trygvis/rules/acme/AcmeMyApp.java
+++ b/module/ri-engine/src/main/java/io/trygvis/rules/acme/AcmeMyApp.java
diff --git a/src/main/java/io/trygvis/rules/acme/AcmeObject.java b/module/ri-engine/src/main/java/io/trygvis/rules/acme/AcmeObject.java
index a75c4ba..a75c4ba 100644
--- a/src/main/java/io/trygvis/rules/acme/AcmeObject.java
+++ b/module/ri-engine/src/main/java/io/trygvis/rules/acme/AcmeObject.java
diff --git a/src/main/java/io/trygvis/rules/acme/AcmeOps.java b/module/ri-engine/src/main/java/io/trygvis/rules/acme/AcmeOps.java
index 147fcfa..147fcfa 100644
--- a/src/main/java/io/trygvis/rules/acme/AcmeOps.java
+++ b/module/ri-engine/src/main/java/io/trygvis/rules/acme/AcmeOps.java
diff --git a/src/main/java/io/trygvis/rules/acme/IpCalc.java b/module/ri-engine/src/main/java/io/trygvis/rules/acme/IpCalc.java
index 5369d62..5369d62 100644
--- a/src/main/java/io/trygvis/rules/acme/IpCalc.java
+++ b/module/ri-engine/src/main/java/io/trygvis/rules/acme/IpCalc.java
diff --git a/src/main/java/io/trygvis/rules/dba/Cluster.java b/module/ri-engine/src/main/java/io/trygvis/rules/dba/Cluster.java
index 949d9ae..949d9ae 100644
--- a/src/main/java/io/trygvis/rules/dba/Cluster.java
+++ b/module/ri-engine/src/main/java/io/trygvis/rules/dba/Cluster.java
diff --git a/src/main/java/io/trygvis/rules/dba/Container.java b/module/ri-engine/src/main/java/io/trygvis/rules/dba/Container.java
index 6df939d..6df939d 100644
--- a/src/main/java/io/trygvis/rules/dba/Container.java
+++ b/module/ri-engine/src/main/java/io/trygvis/rules/dba/Container.java
diff --git a/src/main/java/io/trygvis/rules/dns/DnsEntry.java b/module/ri-engine/src/main/java/io/trygvis/rules/dns/DnsEntry.java
index 105ef79..105ef79 100644
--- a/src/main/java/io/trygvis/rules/dns/DnsEntry.java
+++ b/module/ri-engine/src/main/java/io/trygvis/rules/dns/DnsEntry.java
diff --git a/src/main/java/io/trygvis/rules/dns/DnsEntryTerraformExpression.java b/module/ri-engine/src/main/java/io/trygvis/rules/dns/DnsEntryTerraformExpression.java
index 79bf934..79bf934 100644
--- a/src/main/java/io/trygvis/rules/dns/DnsEntryTerraformExpression.java
+++ b/module/ri-engine/src/main/java/io/trygvis/rules/dns/DnsEntryTerraformExpression.java
diff --git a/src/main/java/io/trygvis/rules/engine/KeyValue.java b/module/ri-engine/src/main/java/io/trygvis/rules/engine/KeyValue.java
index 5046169..5046169 100644
--- a/src/main/java/io/trygvis/rules/engine/KeyValue.java
+++ b/module/ri-engine/src/main/java/io/trygvis/rules/engine/KeyValue.java
diff --git a/src/main/java/io/trygvis/rules/engine/Main.java b/module/ri-engine/src/main/java/io/trygvis/rules/engine/Main.java
index 7c96be6..7c96be6 100644
--- a/src/main/java/io/trygvis/rules/engine/Main.java
+++ b/module/ri-engine/src/main/java/io/trygvis/rules/engine/Main.java
diff --git a/src/main/java/io/trygvis/rules/engine/TemplateEngine.java b/module/ri-engine/src/main/java/io/trygvis/rules/engine/TemplateEngine.java
index ace7aaf..ace7aaf 100644
--- a/src/main/java/io/trygvis/rules/engine/TemplateEngine.java
+++ b/module/ri-engine/src/main/java/io/trygvis/rules/engine/TemplateEngine.java
diff --git a/src/main/java/io/trygvis/rules/machine/Machine.java b/module/ri-engine/src/main/java/io/trygvis/rules/machine/Machine.java
index cc3f2ed..cc3f2ed 100644
--- a/src/main/java/io/trygvis/rules/machine/Machine.java
+++ b/module/ri-engine/src/main/java/io/trygvis/rules/machine/Machine.java
diff --git a/src/main/java/io/trygvis/rules/network/Ipv4Address.java b/module/ri-engine/src/main/java/io/trygvis/rules/network/Ipv4Address.java
index 7ca9ca5..7ca9ca5 100644
--- a/src/main/java/io/trygvis/rules/network/Ipv4Address.java
+++ b/module/ri-engine/src/main/java/io/trygvis/rules/network/Ipv4Address.java
diff --git a/src/main/java/io/trygvis/rules/network/Ipv4Cidr.java b/module/ri-engine/src/main/java/io/trygvis/rules/network/Ipv4Cidr.java
index e69cd02..e69cd02 100644
--- a/src/main/java/io/trygvis/rules/network/Ipv4Cidr.java
+++ b/module/ri-engine/src/main/java/io/trygvis/rules/network/Ipv4Cidr.java
diff --git a/src/main/resources/META-INF/kmodule.xml b/module/ri-engine/src/main/resources/META-INF/kmodule.xml
index ba88a47..7a46b1a 100644
--- a/src/main/resources/META-INF/kmodule.xml
+++ b/module/ri-engine/src/main/resources/META-INF/kmodule.xml
@@ -4,7 +4,7 @@
xsi:schemaLocation="http://www.drools.org/xsd/kmodule https://www.drools.org/xsd/kmodule_7_1.xsd">
<kbase packages="io.trygvis.rules,io.trygvis.rules.acme,io.trygvis.rules.dba,io.trygvis.rules.engine,io.trygvis.rules.machine,io.trygvis.rules.terraform"
- default="true">
+ default="true" includes="wireguard">
<ksession name="Default" default="true">
</ksession>
</kbase>
diff --git a/src/main/resources/io/trygvis/rules/acme/acme.drl b/module/ri-engine/src/main/resources/io/trygvis/rules/acme/acme.drl
index 6369c24..0465343 100644
--- a/src/main/resources/io/trygvis/rules/acme/acme.drl
+++ b/module/ri-engine/src/main/resources/io/trygvis/rules/acme/acme.drl
@@ -48,7 +48,7 @@ then
var s = new AcmeServer();
s.name = $m.name;
s.machine = $m;
- insert(s)
+ insert(s);
end
rule "Set public domain for ACME servers"
diff --git a/src/main/resources/io/trygvis/rules/dba/dba.drl b/module/ri-engine/src/main/resources/io/trygvis/rules/dba/dba.drl
index 7beceef..7beceef 100644
--- a/src/main/resources/io/trygvis/rules/dba/dba.drl
+++ b/module/ri-engine/src/main/resources/io/trygvis/rules/dba/dba.drl
diff --git a/src/main/resources/io/trygvis/rules/engine/default.drl b/module/ri-engine/src/main/resources/io/trygvis/rules/engine/default.drl
index 090fddf..090fddf 100644
--- a/src/main/resources/io/trygvis/rules/engine/default.drl
+++ b/module/ri-engine/src/main/resources/io/trygvis/rules/engine/default.drl
diff --git a/src/main/resources/io/trygvis/rules/machine/machine.drl b/module/ri-engine/src/main/resources/io/trygvis/rules/machine/machine.drl
index a9a379f..a9a379f 100644
--- a/src/main/resources/io/trygvis/rules/machine/machine.drl
+++ b/module/ri-engine/src/main/resources/io/trygvis/rules/machine/machine.drl
diff --git a/src/main/resources/io/trygvis/rules/terraform/terraform.drl b/module/ri-engine/src/main/resources/io/trygvis/rules/terraform/terraform.drl
index 40b9f7c..40b9f7c 100644
--- a/src/main/resources/io/trygvis/rules/terraform/terraform.drl
+++ b/module/ri-engine/src/main/resources/io/trygvis/rules/terraform/terraform.drl
diff --git a/src/test/java/io/trygvis/rules/acme/IpCalcTest.java b/module/ri-engine/src/test/java/io/trygvis/rules/acme/IpCalcTest.java
index 8b1e2c6..8b1e2c6 100644
--- a/src/test/java/io/trygvis/rules/acme/IpCalcTest.java
+++ b/module/ri-engine/src/test/java/io/trygvis/rules/acme/IpCalcTest.java
diff --git a/module/ri-wireguard/classpath.txt b/module/ri-wireguard/classpath.txt
new file mode 100644
index 0000000..52ccd4d
--- /dev/null
+++ b/module/ri-wireguard/classpath.txt
@@ -0,0 +1 @@
+io.trygvis.rules-sandbox:ri-wireguard:1.0-SNAPSHOT:jar
diff --git a/module/ri-wireguard/pom.xml b/module/ri-wireguard/pom.xml
new file mode 100644
index 0000000..085271e
--- /dev/null
+++ b/module/ri-wireguard/pom.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>io.trygvis.rules-sandbox</groupId>
+ <artifactId>rules-sandbox</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>ri-wireguard</artifactId>
+
+</project>
diff --git a/module/ri-wireguard/src/main/java/io/trygvis/rules/acme/Foo.java b/module/ri-wireguard/src/main/java/io/trygvis/rules/acme/Foo.java
new file mode 100644
index 0000000..44f5eba
--- /dev/null
+++ b/module/ri-wireguard/src/main/java/io/trygvis/rules/acme/Foo.java
@@ -0,0 +1,7 @@
+package io.trygvis.rules.acme;
+
+public class Foo {
+ public static void main(String[] args) {
+ System.out.println("Foo.main");
+ }
+}
diff --git a/module/ri-wireguard/src/main/resources/META-INF/kmodule.xml b/module/ri-wireguard/src/main/resources/META-INF/kmodule.xml
new file mode 100644
index 0000000..64cc4d2
--- /dev/null
+++ b/module/ri-wireguard/src/main/resources/META-INF/kmodule.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<kmodule xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://www.drools.org/xsd/kmodule"
+ xsi:schemaLocation="http://www.drools.org/xsd/kmodule https://www.drools.org/xsd/kmodule_7_1.xsd">
+
+ <kbase name="wireguard" packages="io.trygvis.rules.acme">
+ <ksession name="wireguard"/>
+ </kbase>
+</kmodule>
diff --git a/src/main/resources/io/trygvis/rules/acme/vpn.drl b/module/ri-wireguard/src/main/resources/io/trygvis/rules/acme/vpn.drl
index 88c44f1..7896953 100644
--- a/src/main/resources/io/trygvis/rules/acme/vpn.drl
+++ b/module/ri-wireguard/src/main/resources/io/trygvis/rules/acme/vpn.drl
@@ -22,11 +22,6 @@ declare WgIpPool
cidr : Ipv4Cidr
end
-declare WgIpPool
- net : String
- cidr : Ipv4Cidr
-end
-
rule "Create link network" when
$net : WgNet()
not(Ipv4Cidr(network == IpCalc.cidr($net.linkCidr).network))
diff --git a/pom.xml b/pom.xml
index 47b1d04..70a06b2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,6 +7,7 @@
<groupId>io.trygvis.rules-sandbox</groupId>
<artifactId>rules-sandbox</artifactId>
<version>1.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
<properties>
<java.module.name>io.trygvis.rules.sandbox</java.module.name>
@@ -54,81 +55,13 @@
<artifactId>jackson-databind</artifactId>
<version>${version.jackson}</version>
</dependency>
-
</dependencies>
</dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.kie</groupId>
- <artifactId>kie-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.drools</groupId>
- <artifactId>drools-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.drools</groupId>
- <artifactId>drools-compiler</artifactId>
- </dependency>
- <dependency>
- <groupId>org.drools</groupId>
- <artifactId>drools-decisiontables</artifactId>
- </dependency>
- <dependency>
- <groupId>org.drools</groupId>
- <artifactId>drools-templates</artifactId>
- </dependency>
- <dependency>
- <groupId>org.kie</groupId>
- <artifactId>kie-internal</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.mvel</groupId>
- <artifactId>mvel2</artifactId>
- </dependency>
-
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- </dependency>
-
- <dependency>
- <groupId>com.fasterxml.jackson.dataformat</groupId>
- <artifactId>jackson-dataformat-yaml</artifactId>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- </dependency>
-
- <dependency>
- <groupId>com.hubspot.jinjava</groupId>
- <artifactId>jinjava</artifactId>
- <version>2.5.6</version>
- </dependency>
-
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>2.8.0</version>
- </dependency>
-
- <dependency>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter-api</artifactId>
- <version>5.7.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter-params</artifactId>
- <version>5.7.0</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
+ <modules>
+ <module>module/ri-engine</module>
+ <module>module/ri-wireguard</module>
+ </modules>
<build>
<defaultGoal>install</defaultGoal>
@@ -146,6 +79,14 @@
</configuration>
</plugin>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.22.2</version>
+ <configuration>
+ <argLine>--enable-preview</argLine>
+ </configuration>
+ </plugin>
+ <plugin>
<groupId>eu.nets.oss.maven</groupId>
<artifactId>classpath-maven-plugin</artifactId>
<version>1.0</version>