Skip to content

Commit 19e02a5

Browse files
authored
feat: add nzbhydra2 (#446)
Signed-off-by: Devin Buhl <[email protected]>
1 parent 1b1ec15 commit 19e02a5

File tree

5 files changed

+118
-0
lines changed

5 files changed

+118
-0
lines changed

.renovaterc.json5

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,12 @@
8181
matchPackageNames: ["/python/"],
8282
allowedVersions: "/3\\.13-alpine3\\.21/",
8383
},
84+
{
85+
description: ["Allowed Java Version for NZBHydra2"],
86+
matchDatasources: ["docker"],
87+
matchFileNames: ["apps/nzbhydra2/Dockerfile"],
88+
matchPackageNames: ["/amazoncorretto/"],
89+
allowedVersions: "/17-alpine3\\.21/",
90+
},
8491
],
8592
}

apps/nzbhydra2/Dockerfile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
FROM docker.io/library/amazoncorretto:17-alpine3.21
2+
3+
ARG TARGETARCH
4+
ARG VENDOR
5+
ARG VERSION
6+
7+
ENV JAVA_TOOL_OPTIONS="-Xmx256M"
8+
9+
RUN \
10+
apk add --no-cache \
11+
bash \
12+
ca-certificates \
13+
catatonit \
14+
coreutils \
15+
curl \
16+
freetype \
17+
jq \
18+
nano \
19+
tzdata \
20+
unzip \
21+
&& mkdir -p /app/bin \
22+
&& curl -fsSL -o /tmp/nzbhydra2.zip \
23+
"https://github.com/theotherp/nzbhydra2/releases/download/${VERSION}/nzbhydra2-${VERSION#*v}-generic.zip" \
24+
&& unzip -q /tmp/nzbhydra2.zip -d /tmp \
25+
&& cp /tmp/lib/core-${VERSION#*v}-exec.jar /app/bin/nzbhydra2.jar \
26+
&& mkdir -p /defaults \
27+
&& curl -fsSL -o /defaults/nzbhydra.yml \
28+
"https://raw.githubusercontent.com/theotherp/nzbhydra2/${VERSION}/core/src/main/resources/config/baseConfig.yml" \
29+
&& sed -i 's/mapIpToHost: true/mapIpToHost: false/' /defaults/nzbhydra.yml \
30+
&& sed -i 's/checkOpenPort: true/checkOpenPort: false/' /defaults/nzbhydra.yml \
31+
&& chown -R root:root /app && chmod -R 755 /app \
32+
&& rm -rf /tmp/*
33+
34+
COPY . /
35+
36+
USER nobody:nogroup
37+
WORKDIR /config
38+
VOLUME ["/config"]
39+
40+
ENTRYPOINT ["/usr/bin/catatonit", "--", "/entrypoint.sh"]

apps/nzbhydra2/docker-bake.hcl

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
target "docker-metadata-action" {}
2+
3+
variable "VERSION" {
4+
// renovate: datasource=github-releases depName=theotherp/nzbhydra2
5+
default = "v7.13.0"
6+
}
7+
8+
variable "SOURCE" {
9+
default = "https://github.com/theotherp/nzbhydra2"
10+
}
11+
12+
group "default" {
13+
targets = ["image-local"]
14+
}
15+
16+
target "image" {
17+
inherits = ["docker-metadata-action"]
18+
args = {
19+
VERSION = "${VERSION}"
20+
}
21+
labels = {
22+
"org.opencontainers.image.source" = "${SOURCE}"
23+
}
24+
}
25+
26+
target "image-local" {
27+
inherits = ["image"]
28+
output = ["type=docker"]
29+
}
30+
31+
target "image-all" {
32+
inherits = ["image"]
33+
platforms = [
34+
"linux/amd64",
35+
"linux/arm64"
36+
]
37+
}

apps/nzbhydra2/entrypoint.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
3+
mkdir -p /config/logs
4+
5+
if [[ ! -f /config/nzbhydra.yml ]]; then
6+
cp /defaults/nzbhydra.yml /config/nzbhydra.yml
7+
fi
8+
9+
exec \
10+
java \
11+
-DfromWrapper \
12+
-noverify \
13+
-XX:TieredStopAtLevel=1 \
14+
-XX:+HeapDumpOnOutOfMemoryError \
15+
-XX:HeapDumpPath=/config/logs \
16+
-Xlog:gc:/config/logs/gclog-"$(date +"%F_%H-%M-%S")".log::filecount=5,filesize=5000 \
17+
-Dspring.output.ansi.enabled=ALWAYS \
18+
-Dsun.security.pkcs11.enable-solaris=false \
19+
-Dfile.encoding=UTF8 \
20+
-DinternalApiKey="${NZBHYDRA2__API_KEY:-}" \
21+
-jar /app/bin/nzbhydra2.jar \
22+
--datafolder /config \
23+
"$@"

apps/nzbhydra2/tests.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
# yaml-language-server: $schema=https://raw.githubusercontent.com/goss-org/goss/master/docs/schema.yaml
3+
process:
4+
java:
5+
running: true
6+
port:
7+
tcp6:5076:
8+
listening: true
9+
http:
10+
http://localhost:5076:
11+
status: 200

0 commit comments

Comments
 (0)