Skip to content

Commit 5f9e2c6

Browse files
committed
feat: add overseerr and tuliprox
1 parent 62fc767 commit 5f9e2c6

File tree

13 files changed

+330
-8
lines changed

13 files changed

+330
-8
lines changed

Taskfile.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ tasks:
3535

3636
test-x64:
3737
desc: |-
38-
task APP=<app> CHANNEL=<channel> BASE=<true/false> test
38+
task APP=<app> CHANNEL=<channel> BASE=<true/false> [SKIP_STARTUP=true] test
3939
cmds:
4040
- task: download-goss
4141
- >-
@@ -49,10 +49,15 @@ tasks:
4949
--build-arg VERSION={{.VERSION}}
5050
-f ./apps/{{.APP}}/Dockerfile .
5151
- >-
52-
./.goss/dgoss run {{.APP}}:{{.CHANNEL}} {{if eq .BASE "true"}}tail -f /dev/null{{end}}
52+
./.goss/dgoss run
53+
--platform linux/amd64
54+
{{if eq .SKIP_STARTUP "true"}}-e SKIP_STARTUP=1{{end}}
55+
{{.APP}}:{{.CHANNEL}}
56+
{{if eq .BASE "true"}}tail -f /dev/null{{end}}
5357
vars:
5458
VERSION:
5559
sh: bash ./.github/scripts/upstream.sh "{{.APP}}" "{{.CHANNEL}}"
60+
SKIP_STARTUP: '{{.SKIP_STARTUP | default "false"}}'
5661
env:
5762
CONTAINER_RUNTIME: docker
5863
GOSS_PATH: ./.goss/goss

apps/gluetun/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG VERSION
2-
FROM qmcgaw/gluetun:v${VERSION} AS upstream
2+
FROM qmcgaw/gluetun:v${VERSION} as upstream
33

4-
RUN apk --no-cache add bind-tools curl bash
4+
RUN apk --no-cache add bind-tools curl
55

66
COPY --chmod=0755 ./apps/gluetun/promknight-entrypoint.sh /promknight-entrypoint.sh

apps/gluetun/metadata.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55
{
66
"name": "master",
77
"platforms": [
8-
"linux/amd64",
9-
"linux/arm64"
8+
"linux/amd64"
109
],
1110
"stable": true,
1211
"tests": {
1312
"enabled": false,
1413
"type": "cli"
1514
}
16-
}
15+
}
1716
]
18-
}
17+
}

apps/overseerr/Dockerfile

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
FROM ghcr.io/ipromknight/alpine:rolling
2+
ARG VERSION
3+
ENV HOME="/config"
4+
5+
RUN \
6+
echo "**** install build packages ****" && \
7+
apk add --no-cache --virtual=build-dependencies \
8+
curl \
9+
g++ \
10+
make \
11+
python3 && \
12+
echo "**** install runtime packages ****" && \
13+
apk add --no-cache \
14+
yarn git && \
15+
if [ -z ${VERSION+x} ]; then \
16+
VERSION=$(curl -sX GET "https://api.github.com/repos/sct/overseerr/releases/latest" \
17+
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
18+
fi && \
19+
export COMMIT_TAG="${VERSION}" && \
20+
curl -o \
21+
/tmp/overseerr.tar.gz -L \
22+
"https://github.com/sct/overseerr/archive/${VERSION}.tar.gz" && \
23+
mkdir -p /app/overseerr && \
24+
tar xzf \
25+
/tmp/overseerr.tar.gz -C \
26+
/app/overseerr/ --strip-components=1 && \
27+
cd /app/overseerr && \
28+
curl -L https://patch-diff.githubusercontent.com/raw/sct/overseerr/pull/4220.patch | git apply -v && \
29+
export NODE_OPTIONS=--max_old_space_size=2048 && \
30+
CYPRESS_INSTALL_BINARY=0 yarn --frozen-lockfile --network-timeout 1000000 && \
31+
yarn build && \
32+
yarn install --production --ignore-scripts --prefer-offline && \
33+
yarn cache clean && \
34+
rm -rf \
35+
/app/overseerr/src \
36+
/app/overseerr/server && \
37+
echo "{\"commitTag\": \"${COMMIT_TAG}\"}" > committag.json && \
38+
rm -rf /app/overseerr/config && \
39+
ln -s /config /app/overseerr/config && \
40+
touch /config/DOCKER && \
41+
echo "**** cleanup ****" && \
42+
apk del --purge \
43+
build-dependencies && \
44+
rm -rf \
45+
/root/.cache \
46+
/tmp/* \
47+
/app/overseerr/.next/cache/*
48+
49+
COPY --chmod=0755 apps/overseerr/promknight-entrypoint.sh /promknight-entrypoint.sh
50+
51+
# ports and volumes
52+
EXPOSE 5055
53+
VOLUME /config
54+
USER 568

apps/overseerr/ci/goss.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#process
3+
process:
4+
node:
5+
running: true
6+
7+
# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#port
8+
port:
9+
# https://github.com/aelsabbahy/goss/issues/149
10+
tcp6:5055:
11+
listening: true
12+
13+
# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#http
14+
http:
15+
http://localhost:5055:
16+
status: 200
17+
timeout: 5000

apps/overseerr/ci/latest.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
AUTH="Authorization: token ${GH_PAT:-${TOKEN:-}}"
3+
version=$(curl -sLf -H "$AUTH" https://api.github.com/repos/sct/overseerr/releases/latest | jq --raw-output '. | .tag_name')
4+
printf "%s" "${version}"

apps/overseerr/metadata.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"app": "overseerr",
3+
"base": false,
4+
"channels": [
5+
{
6+
"name": "master",
7+
"platforms": [
8+
"linux/amd64"
9+
],
10+
"stable": true,
11+
"tests": {
12+
"enabled": true,
13+
"type": "web"
14+
}
15+
}
16+
]
17+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
cat << "EOF"
6+
7+
▐▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▌
8+
▐ ▌
9+
▐ ██▓███ ██▀███ ▒█████ ███▄ ▄███▓ ██ ▄█▀ ███▄ █ ██▓ ▄████ ██░ ██ ▄▄▄█████▓ ▌
10+
▐ ▓██░ ██▒▓██ ▒ ██▒▒██▒ ██▒▓██▒▀█▀ ██▒ ██▄█▒ ██ ▀█ █ ▓██▒ ██▒ ▀█▒▓██░ ██▒▓ ██▒ ▓▒ ▌
11+
▐ ▓██░ ██▓▒▓██ ░▄█ ▒▒██░ ██▒▓██ ▓██░▓███▄░ ▓██ ▀█ ██▒▒██▒▒██░▄▄▄░▒██▀▀██░▒ ▓██░ ▒░ ▌
12+
▐ ▒██▄█▓▒ ▒▒██▀▀█▄ ▒██ ██░▒██ ▒██ ▓██ █▄ ▓██▒ ▐▌██▒░██░░▓█ ██▓░▓█ ░██ ░ ▓██▓ ░ ▌
13+
▐ ▒██▒ ░ ░░██▓ ▒██▒░ ████▓▒░▒██▒ ░██▒▒██▒ █▄▒██░ ▓██░░██░░▒▓███▀▒░▓█▒░██▓ ▒██▒ ░ ▌
14+
▐ ▒▓▒░ ░ ░░ ▒▓ ░▒▓░░ ▒░▒░▒░ ░ ▒░ ░ ░▒ ▒▒ ▓▒░ ▒░ ▒ ▒ ░▓ ░▒ ▒ ▒ ░░▒░▒ ▒ ░░ ▌
15+
▐ ░▒ ░ ░▒ ░ ▒░ ░ ▒ ▒░ ░ ░ ░░ ░▒ ▒░░ ░░ ░ ▒░ ▒ ░ ░ ░ ▒ ░▒░ ░ ░ ▌
16+
▐ ░░ ░░ ░ ░ ░ ░ ▒ ░ ░ ░ ░░ ░ ░ ░ ░ ▒ ░░ ░ ░ ░ ░░ ░ ░ ▌
17+
▐ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▌
18+
▐ ▌
19+
▐ Overseerr ▌
20+
▐▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▌
21+
22+
EOF
23+
24+
cd /app/overseerr || exit
25+
26+
export CONFIG_DIRECTORY="/config"
27+
28+
exec \
29+
/usr/bin/yarn start

apps/tuliprox/Dockerfile

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
FROM alpine AS cloner
2+
3+
ARG VERSION
4+
5+
WORKDIR /src
6+
7+
RUN apk add --update --no-cache git && \
8+
git clone -b v$VERSION https://github.com/euzu/tuliprox.git .
9+
10+
FROM rust:bookworm AS rust-build
11+
12+
ARG RUST_TARGET=x86_64-unknown-linux-musl
13+
14+
RUN apt-get update && apt-get install -y --no-install-recommends pkg-config musl-tools libssl-dev
15+
RUN rustup update && rustup target add $RUST_TARGET
16+
ENV RUSTFLAGS='--remap-path-prefix $HOME=~ -C target-feature=+crt-static'
17+
18+
COPY --from=cloner /src/Cargo.toml /src/Cargo.lock /src/
19+
COPY --from=cloner /src/backend/Cargo.toml /src/backend/
20+
COPY --from=cloner /src/frontend/Cargo.toml /src/frontend/
21+
COPY --from=cloner /src/shared/Cargo.toml /src/shared/
22+
23+
RUN mkdir -p /src/src /src/backend/src /src/frontend/src /src/shared/src && \
24+
echo "fn main() {}" > /src/src/main.rs && \
25+
echo "fn main() {}" > /src/backend/src/main.rs && \
26+
echo "fn main() {}" > /src/frontend/src/main.rs && \
27+
echo "pub fn dummy() {}" > /src/shared/src/lib.rs
28+
29+
WORKDIR /src
30+
31+
RUN cargo build -p tuliprox --target $RUST_TARGET --release || true
32+
RUN cargo build -p shared --target $RUST_TARGET --release || true
33+
34+
COPY --from=cloner /src/ .
35+
36+
RUN cargo build -p tuliprox --target $RUST_TARGET --release
37+
38+
FROM rust:bookworm AS trunk-build
39+
40+
ARG RUST_TARGET=x86_64-unknown-linux-musl
41+
42+
RUN apt-get update && apt-get install -y --no-install-recommends \
43+
pkg-config libssl-dev curl libclang-dev binaryen
44+
45+
RUN rustup target add wasm32-unknown-unknown
46+
RUN cargo install --locked trunk wasm-bindgen-cli
47+
48+
COPY --from=cloner /src/Cargo.toml /src/Cargo.lock /src/
49+
COPY --from=cloner /src/frontend/Cargo.toml /src/frontend/Trunk.toml /src/frontend/
50+
COPY --from=cloner /src/shared/Cargo.toml /src/shared/
51+
52+
RUN mkdir -p /src/frontend/src /src/shared/src && \
53+
echo "fn main() {}" > /src/frontend/src/main.rs && \
54+
echo "pub fn dummy() {}" > /src/shared/src/lib.rs
55+
56+
WORKDIR /src/frontend
57+
58+
RUN cargo build --target wasm32-unknown-unknown --release || true
59+
60+
COPY --from=cloner /src/ /src/
61+
62+
WORKDIR /src/frontend
63+
64+
RUN trunk build --release
65+
66+
# -----------------------------------------------------------------
67+
# Stage 3: Build video resources with ffmpeg
68+
# -----------------------------------------------------------------
69+
FROM linuxserver/ffmpeg:latest AS resource-build
70+
71+
COPY --from=cloner /src/resources /src/resources
72+
73+
RUN ffmpeg -loop 1 -i /src/resources/channel_unavailable.jpg -t 10 -r 1 -an \
74+
-vf "scale=1920:1080" \
75+
-c:v libx264 -preset veryfast -crf 23 -pix_fmt yuv420p \
76+
/src/resources/channel_unavailable.ts && \
77+
ffmpeg -loop 1 -i /src/resources/user_connections_exhausted.jpg -t 10 -r 1 -an \
78+
-vf "scale=1920:1080" \
79+
-c:v libx264 -preset veryfast -crf 23 -pix_fmt yuv420p \
80+
/src/resources/user_connections_exhausted.ts && \
81+
ffmpeg -loop 1 -i /src/resources/provider_connections_exhausted.jpg -t 10 -r 1 -an \
82+
-vf "scale=1920:1080" \
83+
-c:v libx264 -preset veryfast -crf 23 -pix_fmt yuv420p \
84+
/src/resources/provider_connections_exhausted.ts && \
85+
ffmpeg -loop 1 -i /src/resources/user_account_expired.jpg -t 10 -r 1 -an \
86+
-vf "scale=1920:1080" \
87+
-c:v libx264 -preset veryfast -crf 23 -pix_fmt yuv420p \
88+
/src/resources/user_account_expired.ts
89+
90+
FROM alpine:latest AS tz-prep
91+
92+
ARG TZ=UTC
93+
ENV TZ=${TZ}
94+
95+
RUN apk add --no-cache tzdata \
96+
&& mkdir -p /output/etc \
97+
&& mkdir -p /output/usr/share \
98+
&& cp -r /usr/share/zoneinfo /output/usr/share/zoneinfo \
99+
&& ln -sf /usr/share/zoneinfo/${TZ} /output/etc/localtime
100+
101+
102+
FROM ghcr.io/ipromknight/alpine:rolling
103+
104+
ARG RUST_TARGET=x86_64-unknown-linux-musl
105+
ARG TZ=UTC
106+
ENV TZ=${TZ}
107+
108+
RUN apk add --no-cache bash curl ca-certificates tini
109+
110+
COPY --from=tz-prep /output/usr/share/zoneinfo /usr/share/zoneinfo
111+
COPY --from=rust-build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
112+
113+
RUN ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime
114+
115+
WORKDIR /app
116+
COPY --from=rust-build /src/target/${RUST_TARGET}/release/tuliprox /app/tuliprox
117+
COPY --from=trunk-build /src/frontend/dist /app/web
118+
COPY --from=resource-build /src/resources /app/resources
119+
120+
USER 568
121+
122+
EXPOSE 8901
123+
124+
COPY --chmod=0755 apps/tuliprox/promknight-entrypoint.sh /promknight-entrypoint.sh

apps/tuliprox/ci/goss.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
file:
3+
/app/tuliprox:
4+
exists: true
5+
mode: "0755"
6+
7+
command:
8+
tuliprox-version:
9+
exec: "/app/tuliprox -V"
10+
exit-status: 0
11+
stdout:
12+
- '/^[a-zA-Z0-9._-]*\s*[0-9]+\.[0-9]+\.[0-9]+.*$/'
13+
14+
tuliprox-smoke-no-config:
15+
# Capture stderr too, and don't fail the test on non-zero exit
16+
exec: sh -c '/app/tuliprox -s -p /app/config -l info 2>&1 || true'
17+
exit-status: 0
18+
stdout:
19+
- "Log Level info"
20+
- "Version:"
21+
- "Build time:"
22+
- "Tuliprox error: Can't read the config file"

0 commit comments

Comments
 (0)