Skip to content

Commit fb18373

Browse files
committed
whisparr and whisparr-eros patches
1 parent d6bca79 commit fb18373

7 files changed

Lines changed: 165 additions & 5 deletions

File tree

apps/whisparr-eros/Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
3+
FROM ghcr.io/trueforge-org/ubuntu:24.4.0@sha256:fdcc4e24cd12eed53bb1338ab6dd5651f5326bcbb98920aa3e8f0c8f5c9b2458
4+
ARG TARGETARCH
5+
ARG VENDOR
6+
ARG VERSION
7+
8+
ENV DOTNET_EnableDiagnostics=0 \
9+
WHISPARR__UPDATE__BRANCH=eros \
10+
WHISPARR__SERVER__PORT=6969
11+
12+
USER root
13+
WORKDIR /app
14+
15+
RUN apt-get update && \
16+
apt-get install -y --no-install-recommends \
17+
sqlite3 \
18+
&& \
19+
mkdir -p /app/bin && \
20+
curl -fsSL "https://github.com/Whisparr/whisparr-eros/releases/download/v${VERSION}/Whisparr.eros.${VERSION}.linux-${TARGETARCH/amd64/x64}.tar.gz" \
21+
| tar xzf - -C /app/bin --strip-components=1 && \
22+
printf "UpdateMethod=docker\nBranch=%s\nPackageVersion=%s\nPackageAuthor=[%s](https://github.com/%s)\n" \
23+
"${WHISPARR__UPDATE__BRANCH}" "${VERSION}" "${VENDOR}" "${VENDOR}" > /app/package_info && \
24+
chown -R root:root /app && chmod -R 755 /app && \
25+
rm -rf /var/lib/apt/lists/* /tmp/* /app/bin/Whisparr.Update
26+
27+
28+
USER apps
29+
COPY --chmod=0755 . /
30+
WORKDIR /config
31+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/trueforge-org/forgetool/refs/heads/main/pkg/containers/test/container-test.schema.json
2+
3+
http:
4+
- port: '6969'
5+
path: /

apps/whisparr-eros/docker-bake.hcl

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
target "docker-metadata-action" {}
2+
3+
variable "APP" {
4+
default = "whisparr-eros"
5+
}
6+
7+
variable "VERSION" {
8+
// renovate: datasource=github-releases depName=Whisparr/whisparr-eros versioning=loose extractVersion=^v(?<version>.+-release\..+)$
9+
default = "3.3.3-release.683"
10+
}
11+
12+
variable "LICENSE" {
13+
default = "AGPL-3.0-or-later"
14+
}
15+
16+
variable "SOURCE" {
17+
default = "https://github.com/Whisparr/whisparr-eros"
18+
}
19+
20+
group "default" {
21+
targets = ["image-local"]
22+
}
23+
24+
target "image" {
25+
inherits = ["docker-metadata-action"]
26+
args = {
27+
VERSION = "${VERSION}"
28+
}
29+
labels = {
30+
"org.opencontainers.image.source" = "${SOURCE}"
31+
"org.opencontainers.image.licenses" = "${LICENSE}"
32+
}
33+
}
34+
35+
target "image-local" {
36+
inherits = ["image"]
37+
output = ["type=docker"]
38+
tags = ["${APP}:${VERSION}"]
39+
}
40+
41+
target "image-all" {
42+
inherits = ["image"]
43+
platforms = [
44+
"linux/amd64",
45+
"linux/arm64"
46+
]
47+
}

apps/whisparr-eros/settings.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/trueforge-org/forgetool/refs/heads/main/schemas/container-settings.schema.json
2+
schema_version: 1
3+
upstream_env_url: "https://github.com/Whisparr/whisparr-eros"
4+
ports:
5+
- port: 6969
6+
protocol: tcp
7+
required: false
8+
env:
9+
- name: TZ
10+
default: "Etc/UTC"
11+
required: false
12+
- name: UMASK
13+
default: "002"
14+
required: false
15+
volumes:
16+
- path: /config
17+
required: true
18+
opt_dependencies:
19+
- name: postgresql

apps/whisparr-eros/start.sh

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/usr/bin/env bash
2+
3+
# Environment variables
4+
: "${DB_TYPE:=sqlite}"
5+
6+
if [[ "$DB_TYPE" == "postgres" ]]; then
7+
echo "Postgres selected as database type, starting configuration..."
8+
9+
CONFIG_FILE="./config.xml" # Adjust path if needed
10+
if [[ ! -f "$CONFIG_FILE" ]]; then
11+
echo "Missing config file, running Whisparr to ensure configfile can be accessed"
12+
13+
/app/bin/Whisparr --nobrowser --data=/config "$@" &
14+
WHISPARR_PID=$!
15+
16+
timeout=60
17+
count=0
18+
while [[ ! -f "$CONFIG_FILE" ]]; do
19+
sleep 5
20+
((count+=5))
21+
if [[ $count -ge $timeout ]]; then
22+
echo "Timeout waiting for config.xml"
23+
kill "$WHISPARR_PID"
24+
exit 1
25+
fi
26+
done
27+
28+
echo "Config file present, stopping Whisparr..."
29+
kill "$WHISPARR_PID"
30+
fi
31+
32+
: "${DB_USER:?Need to set DB_USER}"
33+
: "${DB_PASSWORD:?Need to set DB_PASSWORD}"
34+
: "${DB_DATABASE:=whisparr-main}"
35+
: "${DB_LOGSDB:=whisparr-log}"
36+
: "${DB_HOST:=postgres}"
37+
: "${DB_PORT:=5432}"
38+
39+
echo "Updating Whisparr config.xml for PostgreSQL..."
40+
cp -rf "$CONFIG_FILE" "${CONFIG_FILE}.bak"
41+
42+
xmlstarlet ed -L \
43+
-u "/Config/PostgresUser" -v "$DB_USER" \
44+
-u "/Config/PostgresPassword" -v "$DB_PASSWORD" \
45+
-u "/Config/PostgresHost" -v "$DB_HOST" \
46+
-u "/Config/PostgresPort" -v "$DB_PORT" \
47+
-u "/Config/PostgresMainDb" -v "$DB_DATABASE" \
48+
-u "/Config/PostgresLogDb" -v "$DB_LOGSDB" \
49+
"$CONFIG_FILE"
50+
51+
echo "Config.xml updated for PostgreSQL support"
52+
fi
53+
54+
exec \
55+
/app/bin/Whisparr \
56+
--nobrowser \
57+
--data=/config \
58+
"$@"

apps/whisparr/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ ARG TARGETARCH
55
ARG VENDOR
66
ARG VERSION
77

8-
ENV COMPlus_EnableDiagnostics=0 \
9-
WHISPARR__UPDATE__BRANCH=eros \
8+
ENV DOTNET_EnableDiagnostics=0 \
9+
WHISPARR__UPDATE__BRANCH=v2-develop \
1010
WHISPARR__SERVER__PORT=6969
1111

1212
USER root
@@ -17,7 +17,7 @@ RUN apt-get update && \
1717
sqlite3 \
1818
&& \
1919
mkdir -p /app/bin && \
20-
curl -fsSL "https://whisparr.servarr.com/v1/update/${WHISPARR__UPDATE__BRANCH}/updatefile?version=${VERSION}&os=linux&runtime=netcore&arch=${TARGETARCH/amd64/x64}" \
20+
curl -fsSL "https://github.com/Whisparr/Whisparr/releases/download/v${VERSION}/Whisparr.${VERSION}.linux-${TARGETARCH/amd64/x64}.tar.gz" \
2121
| tar xzf - -C /app/bin --strip-components=1 && \
2222
printf "UpdateMethod=docker\nBranch=%s\nPackageVersion=%s\nPackageAuthor=[%s](https://github.com/%s)\n" \
2323
"${WHISPARR__UPDATE__BRANCH}" "${VERSION}" "${VENDOR}" "${VENDOR}" > /app/package_info && \

apps/whisparr/docker-bake.hcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ variable "APP" {
55
}
66

77
variable "VERSION" {
8-
// renovate: datasource=custom.servarr-eros depName=whisparr versioning=loose
9-
default = "3.1.0.2116"
8+
// renovate: datasource=github-releases depName=Whisparr/Whisparr versioning=loose extractVersion=^v(?<version>.+-release\..+)$
9+
default = "2.2.0-release.108"
1010
}
1111

1212
variable "LICENSE" {

0 commit comments

Comments
 (0)