From 6868d67c12c51b9811f021b27622d13322d605fa Mon Sep 17 00:00:00 2001 From: Z2l0aHViLXVzZXIK <86216534+Z2l0aHViLXVzZXIK@users.noreply.github.com> Date: Sun, 20 Jun 2021 20:48:02 -0700 Subject: [PATCH 1/5] Create Dockerfile --- Dockerfile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..75a528e8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM maven:3.8.1-jdk-11-slim AS build + +RUN mkdir /build +COPY . /build + +WORKDIR /build +RUN mvn package -Dmaven.test.skip=true -T 2C + + +FROM openjdk:11.0.11-jre-slim AS run + +ARG VERSION +ENV VERSION=${VERSION:-unspecified} +ENV JAR_FILE=vripper-server-${VERSION}-web.jar +ENV VRIPPER_DIR=/vripper + +RUN mkdir ${VRIPPER_DIR} +COPY --from=build /build/vripper-server/target/${JAR_FILE} ${VRIPPER_DIR} +WORKDIR ${VRIPPER_DIR} +RUN mkdir downloads + +EXPOSE 8080/tcp + +CMD java -Dbase.dir.name=base -Duser.home=${VRIPPER_DIR}/downloads -jar ${VRIPPER_DIR}/${JAR_FILE} From 21b808668dab4722f87493fa86579cd855578fa0 Mon Sep 17 00:00:00 2001 From: Z2l0aHViLXVzZXIK <86216534+Z2l0aHViLXVzZXIK@users.noreply.github.com> Date: Sun, 20 Jun 2021 20:52:13 -0700 Subject: [PATCH 2/5] Create docker-compose.yml --- docker-compose.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..a7c67444 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,11 @@ +services: + + vripper: + container_name: vripper + image: death-claw/vripper-project:3.5.4 + ports: + - "8080:8080/tcp" + volumes: + - "./base:/vripper/base" + - "./downloads:/vripper/downloads" + restart: "unless-stopped" From 6f2ab99ecec50b730cb03ca7ac8f3c9d5a78d2e1 Mon Sep 17 00:00:00 2001 From: Z2l0aHViLXVzZXIK <86216534+Z2l0aHViLXVzZXIK@users.noreply.github.com> Date: Sun, 20 Jun 2021 21:21:42 -0700 Subject: [PATCH 3/5] Create README-docker.md --- README-docker.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 README-docker.md diff --git a/README-docker.md b/README-docker.md new file mode 100644 index 00000000..b6da5d4e --- /dev/null +++ b/README-docker.md @@ -0,0 +1,37 @@ +# VRipper! In Docker! + +_WARNING_: This is experimental. Not familiar with Docker? This isn't for you, yet. + +Java is nice. Java is cross-platform. But, it can be a challenge for people unfamiliar with Java to run and use an app built it. Docker can help. + +## How to build + +You need a recent version of Docker (tested with `20.10.2`). + +The [`Dockerfile`](Dockerfile) will build the VRipper _Server_ app and then build it into a Docker image. + +To build the server app as a Docker image: + + docker build --build-arg VERSION=3.5.4 --tag=death-claw/vripper-project:3.5.4 --file=Dockerfile . + +## How to run + +You could use `docker run` but `docker-compose` makes it more convenient. You need a recent version of `docker-compose` (tested with `1.25.0`). + +Change ports and volumes in [`docker-compose.yml`](docker-compose.yml) if necessary. Then, to run the server app container in the background: + + docker-compose up --detach + +## How to use + +Use the Server app as you would, normally. See [`README.md`](README.md). + +## Future + +If **death-claw** wishes: + +- Run VRipper in container as non-root user. +- Resolve non-root user file permissions. +- Automatically build and tag a Docker image for each tagged version of VRipper. +- Push images to the GitHub Packages Docker registry. +- Write end-user instructions for running images pulled from GitHub registry. From fad878107ed9736af5f6e3bdbd7000ffc96fc7c8 Mon Sep 17 00:00:00 2001 From: theRealKLH <65736720+theRealKLH@users.noreply.github.com> Date: Sat, 24 Jul 2021 18:16:21 -0400 Subject: [PATCH 4/5] Update SettingsService.java changed max concurrent to 16 (division of 4 connections for 4 hosts) --- .../main/java/tn/mnlr/vripper/services/SettingsService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vripper-server/src/main/java/tn/mnlr/vripper/services/SettingsService.java b/vripper-server/src/main/java/tn/mnlr/vripper/services/SettingsService.java index 25a3c7e5..d9953d86 100644 --- a/vripper-server/src/main/java/tn/mnlr/vripper/services/SettingsService.java +++ b/vripper-server/src/main/java/tn/mnlr/vripper/services/SettingsService.java @@ -247,10 +247,10 @@ public void check(Settings settings) throws ValidationException { String.format("%s is not a directory", settings.getDownloadPath())); } - if (settings.getMaxTotalThreads() < 0 || settings.getMaxTotalThreads() > 12) { + if (settings.getMaxTotalThreads() < 0 || settings.getMaxTotalThreads() > 16) { throw new ValidationException( String.format( - "Invalid max global concurrent download settings, values must be in [%d,%d]", 0, 12)); + "Invalid max global concurrent download settings, values must be in [%d,%d]", 0, 16)); } if (settings.getMaxThreads() < 1 || settings.getMaxThreads() > 4) { From 35db3b823eeb3c9dc67169ebe6e51989bab0f8cc Mon Sep 17 00:00:00 2001 From: theRealKLH <65736720+theRealKLH@users.noreply.github.com> Date: Sat, 24 Jul 2021 21:07:29 -0400 Subject: [PATCH 5/5] updated to 16 threads max --- .../main/java/tn/mnlr/vripper/download/DownloadService.java | 2 +- .../java/tn/mnlr/vripper/services/ConnectionService.java | 6 +++--- vripper-ui/src/app/settings/settings.component.html | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vripper-server/src/main/java/tn/mnlr/vripper/download/DownloadService.java b/vripper-server/src/main/java/tn/mnlr/vripper/download/DownloadService.java index 4af11f76..dc7d0b49 100644 --- a/vripper-server/src/main/java/tn/mnlr/vripper/download/DownloadService.java +++ b/vripper-server/src/main/java/tn/mnlr/vripper/download/DownloadService.java @@ -25,7 +25,7 @@ @Slf4j public class DownloadService { - private final int MAX_POOL_SIZE = 12; + private final int MAX_POOL_SIZE = 16; private final SettingsService settingsService; private final DataService dataService; diff --git a/vripper-server/src/main/java/tn/mnlr/vripper/services/ConnectionService.java b/vripper-server/src/main/java/tn/mnlr/vripper/services/ConnectionService.java index c4f9952d..1c69e5fe 100644 --- a/vripper-server/src/main/java/tn/mnlr/vripper/services/ConnectionService.java +++ b/vripper-server/src/main/java/tn/mnlr/vripper/services/ConnectionService.java @@ -118,7 +118,7 @@ public HttpGet buildHttpGet(String url, final HttpClientContext context) { HttpGet httpGet = new HttpGet(url.replace(" ", "+")); httpGet.addHeader( "User-Agent", - "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"); + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36 Edg/91.0.864.67"); addToContext(context, httpGet); return httpGet; } @@ -127,7 +127,7 @@ public HttpPost buildHttpPost(String url, final HttpClientContext context) { HttpPost httpPost = new HttpPost(url.replace(" ", "+")); httpPost.addHeader( "User-Agent", - "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"); + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36 Edg/91.0.864.67"); addToContext(context, httpPost); return httpPost; } @@ -136,7 +136,7 @@ public HttpGet buildHttpGet(URI uri, final HttpClientContext context) { HttpGet httpGet = new HttpGet(uri); httpGet.addHeader( "User-Agent", - "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"); + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36 Edg/91.0.864.67"); addToContext(context, httpGet); return httpGet; } diff --git a/vripper-ui/src/app/settings/settings.component.html b/vripper-ui/src/app/settings/settings.component.html index 62e6a0c0..7da51741 100644 --- a/vripper-ui/src/app/settings/settings.component.html +++ b/vripper-ui/src/app/settings/settings.component.html @@ -86,7 +86,7 @@

Preferences