Compare commits
1 Commits
master
...
dependabot
Author | SHA1 | Date |
---|---|---|
![]() |
260fb8e6ea | 5 years ago |
@ -1,5 +0,0 @@
|
|||||||
*.iml
|
|
||||||
**/.idea/
|
|
||||||
**/target/
|
|
||||||
**/config.properties
|
|
||||||
*.env
|
|
@ -1 +0,0 @@
|
|||||||
java temurin-17.0.9+9
|
|
@ -1,19 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
cd ./helper &&
|
|
||||||
mvn clean install &&
|
|
||||||
|
|
||||||
cd ../mirror &&
|
|
||||||
./build.sh &&
|
|
||||||
|
|
||||||
cd ../reverse &&
|
|
||||||
./build.sh &&
|
|
||||||
|
|
||||||
cd ../forward &&
|
|
||||||
./build.sh &
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
cd ./forward
|
||||||
|
./install-locally.sh
|
||||||
|
cd ..
|
||||||
|
cd ./helper
|
||||||
|
./install-locally.sh
|
||||||
|
cd ..
|
||||||
|
cd ./mirror
|
||||||
|
./install-locally.sh
|
||||||
|
cd ..
|
||||||
|
cd ./reverse
|
||||||
|
./install-locally.sh
|
||||||
|
cd ..
|
@ -1,31 +0,0 @@
|
|||||||
version: '3'
|
|
||||||
services:
|
|
||||||
|
|
||||||
|
|
||||||
# forward:
|
|
||||||
# container_name: forward
|
|
||||||
# image: io42630/forward:0.1
|
|
||||||
# ports:
|
|
||||||
# - "42001:8080"
|
|
||||||
# - "42002:5005"
|
|
||||||
|
|
||||||
|
|
||||||
# See .env for vars.
|
|
||||||
reverse:
|
|
||||||
container_name: reverse
|
|
||||||
image: io42630/reverse:0.1
|
|
||||||
ports:
|
|
||||||
- "42005:8090"
|
|
||||||
- "42006:5005"
|
|
||||||
environment:
|
|
||||||
- forward.url=${FORWARD_URL}
|
|
||||||
- app.url=${APP_URL}
|
|
||||||
- check.supply.interval.ms=${CHECK_SUPPLY_INTERVAL_MS}
|
|
||||||
|
|
||||||
|
|
||||||
mirror:
|
|
||||||
container_name: mirror
|
|
||||||
image: io42630/mirror:0.1
|
|
||||||
ports:
|
|
||||||
- "42003:8080"
|
|
||||||
- "42004:5005"
|
|
@ -0,0 +1,5 @@
|
|||||||
|
#### About
|
||||||
|
* Uses `com.olexyn.min.http.server.MinJettyServer` to host the servlets.
|
||||||
|
* Where to adjust the parameters:
|
||||||
|
* for `forward` -> `EmbeddedR`
|
||||||
|
* for `reverse` -> `RunAll`
|
@ -0,0 +1,208 @@
|
|||||||
|
<?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>
|
||||||
|
|
||||||
|
<groupId>com.olexyn.misp.embedded</groupId>
|
||||||
|
<artifactId>embedded</artifactId>
|
||||||
|
<version>0.1</version>
|
||||||
|
|
||||||
|
<name>embedded</name>
|
||||||
|
<!-- FIXME change it to the project's website -->
|
||||||
|
<url>http://www.example.com</url>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<maven.compiler.source>1.11</maven.compiler.source>
|
||||||
|
<maven.compiler.target>1.11</maven.compiler.target>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>junit</groupId>
|
||||||
|
<artifactId>junit</artifactId>
|
||||||
|
<version>4.11</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.olexyn.min.http.server</groupId>
|
||||||
|
<artifactId>min-http-server</artifactId>
|
||||||
|
<version>0.1</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.servlet</groupId>
|
||||||
|
<artifactId>javax.servlet-api</artifactId>
|
||||||
|
<version>4.0.1</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.olexyn.misp.helper</groupId>
|
||||||
|
<artifactId>misp-helper</artifactId>
|
||||||
|
<version>0.1</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-io</groupId>
|
||||||
|
<artifactId>commons-io</artifactId>
|
||||||
|
<version>2.6</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
|
<artifactId>jetty-server</artifactId>
|
||||||
|
<version>9.4.28.v20200408</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
|
<artifactId>jetty-webapp</artifactId>
|
||||||
|
<version>9.4.28.v20200408</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
|
<artifactId>jetty-servlets</artifactId>
|
||||||
|
<version>9.4.28.v20200408</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
|
<artifactId>jetty-servlet</artifactId>
|
||||||
|
<version>9.4.28.v20200408</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
|
<artifactId>jetty-util</artifactId>
|
||||||
|
<version>9.4.28.v20200408</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
|
<artifactId>jetty-http</artifactId>
|
||||||
|
<version>9.4.28.v20200408</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
|
<artifactId>jetty-io</artifactId>
|
||||||
|
<version>9.4.28.v20200408</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
|
<artifactId>jetty-client</artifactId>
|
||||||
|
<version>9.4.28.v20200408</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||||
|
<artifactId>websocket-server</artifactId>
|
||||||
|
<version>9.4.28.v20200408</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||||
|
<artifactId>websocket-client</artifactId>
|
||||||
|
<version>9.4.28.v20200408</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||||
|
<artifactId>websocket-servlet</artifactId>
|
||||||
|
<version>9.4.28.v20200408</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||||
|
<artifactId>websocket-api</artifactId>
|
||||||
|
<version>9.4.28.v20200408</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.jetty.aggregate</groupId>
|
||||||
|
<artifactId>jetty-all</artifactId>
|
||||||
|
<version>9.4.28.v20200408</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.olexyn.misp.mirror</groupId>
|
||||||
|
<artifactId>misp-mirror</artifactId>
|
||||||
|
<version>0.1</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.olexyn.misp.rev</groupId>
|
||||||
|
<artifactId>misp-rev</artifactId>
|
||||||
|
<version>0.1</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.olexyn.misp.reverse</groupId>
|
||||||
|
<artifactId>reverse</artifactId>
|
||||||
|
<version>0.1</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.olexyn.misp.fwd</groupId>
|
||||||
|
<artifactId>misp-fwd</artifactId>
|
||||||
|
<version>0.1</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.olexyn.misp.forward</groupId>
|
||||||
|
<artifactId>forward</artifactId>
|
||||||
|
<version>0.1</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.olexyn.misp.mirror</groupId>
|
||||||
|
<artifactId>mirror</artifactId>
|
||||||
|
<version>0.1</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.json</groupId>
|
||||||
|
<artifactId>json</artifactId>
|
||||||
|
<version>20190722</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
|
||||||
|
<plugins>
|
||||||
|
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-clean-plugin</artifactId>
|
||||||
|
<version>3.1.0</version>
|
||||||
|
</plugin>
|
||||||
|
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
|
<version>3.0.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.8.0</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>2.22.1</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<version>3.0.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-install-plugin</artifactId>
|
||||||
|
<version>2.5.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-deploy-plugin</artifactId>
|
||||||
|
<version>2.8.2</version>
|
||||||
|
</plugin>
|
||||||
|
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-site-plugin</artifactId>
|
||||||
|
<version>3.7.1</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||||
|
<version>3.0.0</version>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</pluginManagement>
|
||||||
|
</build>
|
||||||
|
</project>
|
@ -0,0 +1,28 @@
|
|||||||
|
package com.olexyn.misp.embedded;
|
||||||
|
|
||||||
|
import com.olexyn.min.http.server.MinJettyServer;
|
||||||
|
import com.olexyn.misp.forward.Forward;
|
||||||
|
import com.olexyn.misp.mirror.Mirror;
|
||||||
|
|
||||||
|
|
||||||
|
public class EmbeddedR implements Runnable {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
MinJettyServer server = new MinJettyServer();
|
||||||
|
|
||||||
|
server.PORT = 8090;
|
||||||
|
server.MAX_THREADS = 100;
|
||||||
|
server.MIN_THREADS = 10;
|
||||||
|
server.IDLE_TIMEOUT = 120;
|
||||||
|
|
||||||
|
|
||||||
|
server.addServletWithMapping("/mirror", Mirror.class);
|
||||||
|
server.addServletWithMapping("/app", Mirror.class);
|
||||||
|
server.addServletWithMapping("/forward", Forward.class);
|
||||||
|
|
||||||
|
|
||||||
|
server.start();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
package com.olexyn.misp.embedded;
|
||||||
|
|
||||||
|
import com.olexyn.misp.reverse.Reverse;
|
||||||
|
|
||||||
|
public class RunAll {
|
||||||
|
|
||||||
|
public static void main(String... args) throws InterruptedException {
|
||||||
|
|
||||||
|
Thread embeddedT = new Thread(new EmbeddedR());
|
||||||
|
embeddedT.start();
|
||||||
|
|
||||||
|
Thread.sleep(2000);
|
||||||
|
|
||||||
|
Reverse reverse = new Reverse();
|
||||||
|
reverse.FORWARD_URL = "http://localhost:8090/forward";
|
||||||
|
reverse.APP_URL = "http://localhost:8090/app";
|
||||||
|
//reverse.APP_URL = "https://olexyn.com/wp/";
|
||||||
|
|
||||||
|
|
||||||
|
Thread reverseT = new Thread(reverse);
|
||||||
|
reverseT.start();
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +0,0 @@
|
|||||||
FROM eclipse-temurin:17-alpine
|
|
||||||
COPY /target/forward-0.1.jar /usr/local/lib/forward.jar
|
|
||||||
EXPOSE 8080 5005
|
|
||||||
ENTRYPOINT ["java", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005", "-jar","/usr/local/lib/forward.jar"]
|
|
@ -0,0 +1,9 @@
|
|||||||
|
#### About
|
||||||
|
The `forward` servlet.
|
||||||
|
|
||||||
|
#### Deploy (TODO)
|
||||||
|
* Run `install-locally.sh`
|
||||||
|
* Find the `forward-0.1.war` in `./target`
|
||||||
|
* Copy it to `tomcat/webapps`.
|
||||||
|
* Assuming tomcat runs at `http://localhost:9090`
|
||||||
|
* Then the servlet will be at `http://localhost:9090/forward-0.1/mirror`
|
@ -1,9 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
mvn clean install &&
|
|
||||||
docker build -t io42630/forward:0.1 .
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
version="0.1"
|
||||||
|
file="target/forward-${version}.war"
|
||||||
|
groupId="com.olexyn.misp.forward"
|
||||||
|
artifactId="forward"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
mvn package
|
||||||
|
mvn install:install-file -Dfile=${file} -DgroupId=${groupId} -DartifactId=${artifactId} -Dversion=${version} -Dpackaging=war -DgeneratePom=true
|
@ -1,59 +1,124 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
|
||||||
|
<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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
|
||||||
<groupId>com.olexyn</groupId>
|
<groupId>com.olexyn.misp.forward</groupId>
|
||||||
<artifactId>zeeroot</artifactId>
|
|
||||||
<version>spring-boot-jdk17-0.1</version>
|
|
||||||
</parent>
|
|
||||||
<groupId>com.olexyn.misp</groupId>
|
|
||||||
<artifactId>forward</artifactId>
|
<artifactId>forward</artifactId>
|
||||||
<version>0.1</version>
|
<version>0.1</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>war</packaging>
|
||||||
<name>forward</name>
|
|
||||||
<dependencyManagement>
|
<name>forward Maven Webapp</name>
|
||||||
|
<!-- FIXME change it to the project's website -->
|
||||||
|
<url>http://www.example.com</url>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<maven.compiler.source>11</maven.compiler.source>
|
||||||
|
<maven.compiler.target>11</maven.compiler.target>
|
||||||
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.olexyn</groupId>
|
<groupId>junit</groupId>
|
||||||
<artifactId>zeebom</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
<version>1.1.1</version>
|
<version>4.11</version>
|
||||||
<type>pom</type>
|
<scope>test</scope>
|
||||||
<scope>import</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
|
||||||
</dependencyManagement>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.olexyn.misp</groupId>
|
<groupId>com.olexyn.misp.helper</groupId>
|
||||||
<artifactId>helper</artifactId>
|
<artifactId>helper</artifactId>
|
||||||
<version>0.2</version>
|
<version>0.1</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-io</groupId>
|
<groupId>commons-io</groupId>
|
||||||
<artifactId>commons-io</artifactId>
|
<artifactId>commons-io</artifactId>
|
||||||
|
<version>2.6</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.jetty.orbit</groupId>
|
||||||
|
<artifactId>javax.servlet</artifactId>
|
||||||
|
<version>3.0.0.v201112011016</version>
|
||||||
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.json</groupId>
|
<groupId>org.json</groupId>
|
||||||
<artifactId>json</artifactId>
|
<artifactId>json</artifactId>
|
||||||
|
<version>20190722</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
|
<artifactId>jetty-server</artifactId>
|
||||||
|
<version>9.4.28.v20200408</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.olexyn.min.http.server</groupId>
|
||||||
|
<artifactId>min-http-server</artifactId>
|
||||||
|
<version>0.1</version>
|
||||||
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>jetty-util</artifactId>
|
||||||
|
<version>9.4.28.v20200408</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
<artifactId>spring-boot-autoconfigure</artifactId>
|
<artifactId>jetty-servlets</artifactId>
|
||||||
|
<version>9.4.28.v20200408</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
<artifactId>jetty-servlet</artifactId>
|
||||||
<scope>provided</scope>
|
<version>9.4.28.v20200408</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<!-- for some godforsaken reason this is required. -->
|
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||||
<groupId>org.aspectj</groupId>
|
<artifactId>websocket-server</artifactId>
|
||||||
<artifactId>aspectjweaver</artifactId>
|
<version>9.4.28.v20200408</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-clean-plugin</artifactId>
|
||||||
|
<version>3.1.0</version>
|
||||||
|
</plugin>
|
||||||
|
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging -->
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
|
<version>3.0.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.8.0</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>2.22.1</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-war-plugin</artifactId>
|
||||||
|
<version>3.2.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-install-plugin</artifactId>
|
||||||
|
<version>2.5.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-deploy-plugin</artifactId>
|
||||||
|
<version>2.8.2</version>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</pluginManagement>
|
||||||
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
package com.olexyn.misp.forward;
|
|
||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
||||||
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
|
||||||
|
|
||||||
@SpringBootApplication
|
|
||||||
@EnableAspectJAutoProxy(proxyTargetClass = true)
|
|
||||||
public class App {
|
|
||||||
public static void main(String... args) {
|
|
||||||
SpringApplication.run(App.class, args);
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,22 @@
|
|||||||
|
<!DOCTYPE web-app PUBLIC
|
||||||
|
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
|
||||||
|
"http://java.sun.com/dtd/web-app_2_3.dtd" >
|
||||||
|
|
||||||
|
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
|
||||||
|
version="2.4">
|
||||||
|
|
||||||
|
<display-name>misp-fwd</display-name>
|
||||||
|
|
||||||
|
<servlet>
|
||||||
|
<servlet-name>misp-fwd</servlet-name>
|
||||||
|
<servlet-class>com.olexyn.misp.forward.Forward</servlet-class>
|
||||||
|
</servlet>
|
||||||
|
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>misp-fwd</servlet-name>
|
||||||
|
<url-pattern>/forward</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
|
||||||
|
</web-app>
|
After Width: | Height: | Size: 617 B |
@ -0,0 +1,20 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>misp-fwd</title>
|
||||||
|
</head>
|
||||||
|
<body bgcolor=white>
|
||||||
|
|
||||||
|
<table border="0">
|
||||||
|
<tr>
|
||||||
|
<td align=center>
|
||||||
|
<img src="images/io42630.png">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h1>misp-fwd</h1>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -1,7 +0,0 @@
|
|||||||
#POST http://localhost:42001
|
|
||||||
GET http://node175251-env-1739619.sh1.hidora.com:11231/
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"hello": "world"
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
#POST http://localhost:42001
|
|
||||||
POST http://node175251-env-1739619.sh1.hidora.com:11231/
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"hello": "world"
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
### MISP Helper
|
|
||||||
|
|
||||||
|
|
||||||
#### Build
|
|
||||||
* do `mvn clean install` for local
|
|
||||||
* or `mvn deploy` for local nexus
|
|
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
version="0.1"
|
||||||
|
file="target/helper-${version}.jar"
|
||||||
|
groupId="com.olexyn.misp.helper"
|
||||||
|
artifactId="helper"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
mvn package
|
||||||
|
mvn install:install-file -Dfile=${file} -DgroupId=${groupId} -DartifactId=${artifactId} -Dversion=${version} -Dpackaging=jar -DgeneratePom=true
|
@ -1,34 +1,84 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
|
||||||
|
<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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
|
||||||
<groupId>com.olexyn</groupId>
|
<groupId>com.olexyn.misp.helper</groupId>
|
||||||
<artifactId>zeeroot</artifactId>
|
|
||||||
<version>17.0.1</version>
|
|
||||||
</parent>
|
|
||||||
<groupId>com.olexyn.misp</groupId>
|
|
||||||
<artifactId>helper</artifactId>
|
<artifactId>helper</artifactId>
|
||||||
<version>0.2</version>
|
<version>0.1</version>
|
||||||
|
|
||||||
<name>helper</name>
|
<name>helper</name>
|
||||||
<dependencyManagement>
|
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<maven.compiler.source>11</maven.compiler.source>
|
||||||
|
<maven.compiler.target>11</maven.compiler.target>
|
||||||
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.olexyn</groupId>
|
<groupId>junit</groupId>
|
||||||
<artifactId>zeebom</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
<version>1.1.1</version>
|
<version>3.8.1</version>
|
||||||
<type>pom</type>
|
|
||||||
<scope>import</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
|
||||||
</dependencyManagement>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.json</groupId>
|
<groupId>org.json</groupId>
|
||||||
<artifactId>json</artifactId>
|
<artifactId>json</artifactId>
|
||||||
</dependency>
|
<version>20190722</version>
|
||||||
<dependency>
|
|
||||||
<groupId>org.projectlombok</groupId>
|
|
||||||
<artifactId>lombok</artifactId>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-clean-plugin</artifactId>
|
||||||
|
<version>3.1.0</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-site-plugin</artifactId>
|
||||||
|
<version>3.7.1</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||||
|
<version>3.0.0</version>
|
||||||
|
</plugin>
|
||||||
|
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
|
<version>3.0.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.8.0</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>2.22.1</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<version>3.0.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-install-plugin</artifactId>
|
||||||
|
<version>2.5.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-deploy-plugin</artifactId>
|
||||||
|
<version>2.8.2</version>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</pluginManagement>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<reporting>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</reporting>
|
||||||
</project>
|
</project>
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
package com.olexyn.misp.helper;
|
|
||||||
|
|
||||||
public interface Constants {
|
|
||||||
|
|
||||||
String AVAILABLE = "available";
|
|
||||||
String POST = "POST";
|
|
||||||
String GET = "GET";
|
|
||||||
String EMPTY = "";
|
|
||||||
}
|
|
@ -1,29 +0,0 @@
|
|||||||
package com.olexyn.misp.helper;
|
|
||||||
|
|
||||||
import javax.crypto.Cipher;
|
|
||||||
import javax.crypto.KeyGenerator;
|
|
||||||
import javax.crypto.SecretKey;
|
|
||||||
import javax.crypto.spec.SecretKeySpec;
|
|
||||||
import java.util.Base64;
|
|
||||||
|
|
||||||
public class SymEnc {
|
|
||||||
public static void main(String[] args) throws Exception {
|
|
||||||
// Step 1: Generate a symmetric AES key (alternatively, you can specify your own)
|
|
||||||
KeyGenerator keyGenerator = KeyGenerator.getInstance("AES");
|
|
||||||
keyGenerator.init(128); // Key size
|
|
||||||
SecretKey secretKey = keyGenerator.generateKey();
|
|
||||||
|
|
||||||
// Step 2: Create and initialize the Cipher for AES encryption
|
|
||||||
Cipher cipher = Cipher.getInstance("AES");
|
|
||||||
cipher.init(Cipher.ENCRYPT_MODE, secretKey);
|
|
||||||
|
|
||||||
// Step 3: Encrypt the string
|
|
||||||
String inputString = "Your String Here";
|
|
||||||
byte[] encryptedBytes = cipher.doFinal(inputString.getBytes());
|
|
||||||
|
|
||||||
// Convert encrypted bytes to Base64 to get a string representation
|
|
||||||
String encryptedString = Base64.getEncoder().encodeToString(encryptedBytes);
|
|
||||||
|
|
||||||
System.out.println("Encrypted String: " + encryptedString);
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,26 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
tomcat_webapps="${HOME}/app/tomcat/webapps"
|
||||||
|
jetty_webapps="${HOME}/app/jetty9.4/webapps"
|
||||||
|
webapps=$jetty_webapps
|
||||||
|
cwd=$(pwd)
|
||||||
|
|
||||||
|
/home/user/app/tomcat/bin/shutdown.sh
|
||||||
|
|
||||||
|
echo "================"
|
||||||
|
echo "END TOMCAT STOP "
|
||||||
|
echo "================"
|
||||||
|
|
||||||
|
cp -v "${cwd}/misp-mirror/target/misp-mirror-0.1.war" "${webapps}"
|
||||||
|
cp -v "${cwd}/misp-rev/target/misp-rev-0.1.war" "${webapps}"
|
||||||
|
cp -v "${cwd}/test-proxy/target/test-proxy-0.1.war" "${webapps}"
|
||||||
|
|
||||||
|
echo "================"
|
||||||
|
echo "END COPY"
|
||||||
|
echo "================"
|
||||||
|
|
||||||
|
# /home/user/app/tomcat/bin/startup.sh
|
||||||
|
|
||||||
|
echo "================"
|
||||||
|
echo "END TOMCAT START "
|
||||||
|
echo "================"
|
After Width: | Height: | Size: 26 KiB |
@ -1,4 +0,0 @@
|
|||||||
FROM eclipse-temurin:17-alpine
|
|
||||||
COPY /target/mirror-0.1.jar /usr/local/lib/mirror-0.1.jar
|
|
||||||
EXPOSE 8080 5005
|
|
||||||
ENTRYPOINT ["java", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005", "-jar","/usr/local/lib/mirror-0.1.jar"]
|
|
@ -1,9 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
mvn clean install &&
|
|
||||||
docker build -t io42630/mirror:0.1 .
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
version="0.1"
|
||||||
|
file="target/misp-mirror-${version}.war"
|
||||||
|
groupId="com.olexyn.misp.mirror"
|
||||||
|
artifactId="misp-mirror"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
mvn package
|
||||||
|
mvn install:install-file -Dfile=${file} -DgroupId=${groupId} -DartifactId=${artifactId} -Dversion=${version} -Dpackaging=war -DgeneratePom=true
|
@ -1,60 +1,90 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
|
||||||
|
<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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
|
||||||
<groupId>com.olexyn</groupId>
|
<groupId>com.olexyn.misp.mirror</groupId>
|
||||||
<artifactId>zeeroot</artifactId>
|
|
||||||
<version>spring-boot-jdk17-0.1</version>
|
|
||||||
</parent>
|
|
||||||
<groupId>com.olexyn.misp</groupId>
|
|
||||||
<artifactId>mirror</artifactId>
|
<artifactId>mirror</artifactId>
|
||||||
<version>0.1</version>
|
<version>0.1</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>war</packaging>
|
||||||
<name>mirror</name>
|
|
||||||
<dependencyManagement>
|
<name>mirror Maven Webapp</name>
|
||||||
|
<!-- FIXME change it to the project's website -->
|
||||||
|
<url>http://www.example.com</url>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<maven.compiler.source>11</maven.compiler.source>
|
||||||
|
<maven.compiler.target>11</maven.compiler.target>
|
||||||
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.olexyn</groupId>
|
<groupId>junit</groupId>
|
||||||
<artifactId>zeebom</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
<version>1.1.1</version>
|
<version>4.11</version>
|
||||||
<type>pom</type>
|
<scope>test</scope>
|
||||||
<scope>import</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
|
||||||
</dependencyManagement>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.olexyn.misp</groupId>
|
<groupId>com.olexyn.misp.helper</groupId>
|
||||||
<artifactId>helper</artifactId>
|
<artifactId>helper</artifactId>
|
||||||
<version>0.2</version>
|
<version>0.1</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-io</groupId>
|
<groupId>commons-io</groupId>
|
||||||
<artifactId>commons-io</artifactId>
|
<artifactId>commons-io</artifactId>
|
||||||
|
<version>2.6</version>
|
||||||
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.json</groupId>
|
<groupId>org.eclipse.jetty.orbit</groupId>
|
||||||
<artifactId>json</artifactId>
|
<artifactId>javax.servlet</artifactId>
|
||||||
</dependency>
|
<version>3.0.0.v201112011016</version>
|
||||||
<dependency>
|
<scope>compile</scope>
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-autoconfigure</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<!-- for some godforsaken reason this is required. -->
|
<groupId>org.json</groupId>
|
||||||
<groupId>org.aspectj</groupId>
|
<artifactId>json</artifactId>
|
||||||
<artifactId>aspectjweaver</artifactId>
|
<version>20190722</version>
|
||||||
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-clean-plugin</artifactId>
|
||||||
|
<version>3.1.0</version>
|
||||||
|
</plugin>
|
||||||
|
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging -->
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
|
<version>3.0.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.8.0</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>2.22.1</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-war-plugin</artifactId>
|
||||||
|
<version>3.2.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-install-plugin</artifactId>
|
||||||
|
<version>2.5.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-deploy-plugin</artifactId>
|
||||||
|
<version>2.8.2</version>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</pluginManagement>
|
||||||
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
package com.olexyn.misp.mirror;
|
|
||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
||||||
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
|
||||||
|
|
||||||
@SpringBootApplication
|
|
||||||
@EnableAspectJAutoProxy(proxyTargetClass = true)
|
|
||||||
public class App {
|
|
||||||
public static void main(String... args) {
|
|
||||||
SpringApplication.run(App.class, args);
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,23 @@
|
|||||||
|
<!DOCTYPE web-app PUBLIC
|
||||||
|
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
|
||||||
|
"http://java.sun.com/dtd/web-app_2_3.dtd" >
|
||||||
|
|
||||||
|
|
||||||
|
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
|
||||||
|
version="2.4">
|
||||||
|
|
||||||
|
<display-name>misp-mirror</display-name>
|
||||||
|
|
||||||
|
<servlet>
|
||||||
|
<servlet-name>misp-mirror</servlet-name>
|
||||||
|
<servlet-class>com.olexyn.misp.mirror.Mirror</servlet-class>
|
||||||
|
</servlet>
|
||||||
|
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>misp-mirror</servlet-name>
|
||||||
|
<url-pattern>/mirror</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
|
||||||
|
</web-app>
|
After Width: | Height: | Size: 617 B |
@ -0,0 +1,20 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>misp-mirror</title>
|
||||||
|
</head>
|
||||||
|
<body bgcolor=white>
|
||||||
|
|
||||||
|
<table border="0">
|
||||||
|
<tr>
|
||||||
|
<td align=center>
|
||||||
|
<img src="images/io42630.png">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h1>misp-mirror</h1>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -1,4 +0,0 @@
|
|||||||
FROM eclipse-temurin:17-alpine
|
|
||||||
COPY /target/reverse-0.1-jar-with-dependencies.jar /usr/local/lib/reverse-0.1-jar-with-dependencies.jar
|
|
||||||
EXPOSE 8090 5005
|
|
||||||
ENTRYPOINT ["java", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005", "-jar","/usr/local/lib/reverse-0.1-jar-with-dependencies.jar"]
|
|
@ -1,8 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
mvn clean install &&
|
|
||||||
docker build -t io42630/reverse:0.1 .
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
version="0.1"
|
||||||
|
artifactId="reverse"
|
||||||
|
file="target/${artifactId}-${version}.jar"
|
||||||
|
groupId="com.olexyn.misp.reverse"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
mvn package
|
||||||
|
mvn install:install-file -Dfile=${file} -DgroupId=${groupId} -DartifactId=${artifactId} -Dversion=${version} -Dpackaging=jar -DgeneratePom=true
|
@ -1,49 +1,55 @@
|
|||||||
package com.olexyn.misp.reverse.runnable;
|
package com.olexyn.misp.reverse.runnable;
|
||||||
|
|
||||||
import com.olexyn.misp.helper.Ride;
|
import com.olexyn.misp.helper.Ride;
|
||||||
|
import com.olexyn.misp.reverse.Reverse;
|
||||||
import com.olexyn.misp.reverse.Tools;
|
import com.olexyn.misp.reverse.Tools;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import static com.olexyn.misp.helper.Constants.EMPTY;
|
|
||||||
import static com.olexyn.misp.helper.Constants.GET;
|
|
||||||
import static com.olexyn.misp.helper.Constants.POST;
|
|
||||||
import static com.olexyn.misp.reverse.Reverse.APP_URL;
|
|
||||||
import static com.olexyn.misp.reverse.Reverse.FORWARD_URL;
|
|
||||||
|
|
||||||
public class JourneyR implements Runnable {
|
public class JourneyR implements Runnable {
|
||||||
|
|
||||||
|
private Reverse reverse;
|
||||||
|
|
||||||
|
public JourneyR(Reverse reverse) {
|
||||||
|
this.reverse = reverse;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
var ride = sendPostRide();
|
Ride _ride = sendPostRide();
|
||||||
sendGetRequest(ride);
|
_ride = sendGetRequest(_ride);
|
||||||
sendPostRideRequestData(ride);
|
sendPostRideRequestData(_ride);
|
||||||
} catch (Exception ignored) { /* ignored */ }
|
} catch (Exception ignored) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private Ride sendPostRide() throws IOException {
|
Ride sendPostRide() throws IOException {
|
||||||
|
|
||||||
Ride ride = new Ride();
|
final Ride ride = new Ride();
|
||||||
|
|
||||||
String result = Tools.send(POST, FORWARD_URL, ride.json());
|
final String result = Tools.send("POST", reverse.FORWARD_URL, ride.json());
|
||||||
|
|
||||||
String reqStr = new Ride(result).getRequest();
|
String _req = new Ride(result).getRequest();
|
||||||
reqStr = (reqStr == null) ? EMPTY : reqStr;
|
String request = (_req == null) ? "" : _req;
|
||||||
ride.setRequest(reqStr);
|
ride.setRequest(request);
|
||||||
|
|
||||||
return ride;
|
return ride;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Ride sendGetRequest(Ride ride) throws IOException {
|
|
||||||
String result = Tools.send(GET, APP_URL, ride.getRequest());
|
Ride sendGetRequest(Ride ride) throws IOException {
|
||||||
|
|
||||||
|
final String result = Tools.send("GET", reverse.APP_URL, ride.getRequest());
|
||||||
ride.setData(result);
|
ride.setData(result);
|
||||||
|
|
||||||
return ride;
|
return ride;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendPostRideRequestData(Ride ride) throws IOException {
|
|
||||||
Tools.send(POST, FORWARD_URL, ride.json());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
void sendPostRideRequestData(Ride ride) throws IOException {
|
||||||
|
|
||||||
|
Tools.send("POST", reverse.FORWARD_URL, ride.json());
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in new issue