From 38be6c13f76e893cf47636257071b440dec0c5b2 Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Sun, 7 Sep 2025 17:32:13 +0200 Subject: initial commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Robert Günzler --- bundles/jellyfin/bcast.py | 20 ++++ bundles/jellyfin/files/SSO-Auth.xml | 71 +++++++++++++ bundles/jellyfin/files/branding.xml | 17 +++ bundles/jellyfin/files/kube.yaml | 72 +++++++++++++ bundles/jellyfin/files/logging.json | 11 ++ bundles/jellyfin/files/system.xml | 202 ++++++++++++++++++++++++++++++++++++ bundles/jellyfin/items.py | 33 ++++++ bundles/jellyfin/metadata.py | 16 +++ 8 files changed, 442 insertions(+) create mode 100644 bundles/jellyfin/bcast.py create mode 100644 bundles/jellyfin/files/SSO-Auth.xml create mode 100644 bundles/jellyfin/files/branding.xml create mode 100644 bundles/jellyfin/files/kube.yaml create mode 100644 bundles/jellyfin/files/logging.json create mode 100644 bundles/jellyfin/files/system.xml create mode 100644 bundles/jellyfin/items.py create mode 100644 bundles/jellyfin/metadata.py (limited to 'bundles/jellyfin') diff --git a/bundles/jellyfin/bcast.py b/bundles/jellyfin/bcast.py new file mode 100644 index 0000000..2318441 --- /dev/null +++ b/bundles/jellyfin/bcast.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 + +import socket +from time import sleep + +def main(): + msg = b'Who is JellyfinServer?' + + sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP) # UDP + sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) + sock.bind(('0.0.0.0',0)) + sock.sendto(msg, ("255.255.255.255", 7359)) + sock.settimeout(10) + recvd, (ip, port) = sock.recvfrom(4096) + sock.close() + print(f"{ip}:{port} says:") + print(recvd.decode('utf-8')) + +main() + diff --git a/bundles/jellyfin/files/SSO-Auth.xml b/bundles/jellyfin/files/SSO-Auth.xml new file mode 100644 index 0000000..50dfdc8 --- /dev/null +++ b/bundles/jellyfin/files/SSO-Auth.xml @@ -0,0 +1,71 @@ + + + + + + + authelia + + + + https://login.gzr.im + jellyfin + ${repo.vault.cmd(f"rbw get authelia/client/jellyfin")} + true + true + false + + f137a2dd21bbc1b99aa5c0f6bf02a805 + a656b907eb3a73532e40e44b968d0225 + + + admins + + + jellyfin + + true + false + false + false + + + + + jellyfin + + f137a2dd21bbc1b99aa5c0f6bf02a805 + a656b907eb3a73532e40e44b968d0225 + + + + jellyfin-anime + + abebc196cc1b8bbf6f8bb5ca7b5ad6f1 + 29391378c4118b35b77f84980d25f0a6 + + + + jellyfin-misc + + a1bc8a1aac164cd3d91bf3f4252f92f4 + + + + groups + + groups + + authelia + https + true + + false + false + false + false + + + + + diff --git a/bundles/jellyfin/files/branding.xml b/bundles/jellyfin/files/branding.xml new file mode 100644 index 0000000..487db6e --- /dev/null +++ b/bundles/jellyfin/files/branding.xml @@ -0,0 +1,17 @@ + + + <form action="https://tv.gzr.im/sso/OID/start/authelia"> + <button class="raised block emby-button button-submit"> + Sign in with SSO + </button> +</form> + a.raised.emby-button { + padding: 0.9em 1em; + color: inherit !important; +} + +.disclaimerContainer { + display: block; +} + false + diff --git a/bundles/jellyfin/files/kube.yaml b/bundles/jellyfin/files/kube.yaml new file mode 100644 index 0000000..fb6897c --- /dev/null +++ b/bundles/jellyfin/files/kube.yaml @@ -0,0 +1,72 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: jellyfin +data: + JELLYFIN_PublishedServerUrl: http://shimakaze:8096 +--- +apiVersion: v1 +kind: Pod +metadata: + name: jellyfin + labels: + traefik.enable: true + traefik.http.routers.jellyfin.tls: true + traefik.http.routers.jellyfin.tls.certresolver: le + traefik.http.routers.jellyfin.entrypoints: http,https + traefik.http.routers.jellyfin.rule: Host(`tv.gzr.im`) + traefik.http.routers.jellyfin.service: jellyfin + traefik.http.services.jellyfin.loadbalancer.server.port: 8096 + # metrics + traefik.http.routers.jellyfin-metrics.entrypoints: metrics + traefik.http.routers.jellyfin-metrics.rule: Path(`/metrics/jellyfin`) + traefik.http.routers.jellyfin-metrics.middlewares: replacepath-metrics +spec: + # NOTE: required to make discovery work + # jellyfin clients use udp broadcast messages on port 7359 + # sending "Who is JellyfinServer?". To receive those requests the + # jellyfin server can't be behind container networking + hostNetwork: true + + restartPolicy: Never + dnsPolicy: Default + containers: + - name: jellyfin + image: ghcr.io/jellyfin/jellyfin:10.10.7 + envFrom: + - configMapRef: + name: jellyfin + ports: + - containerPort: 8096 + protocol: TCP + - containerPort: 1900 + protocol: UDP + - containerPort: 7359 + protocol: UDP + volumeMounts: + - name: data + mountPath: /config + - name: cache + mountPath: /cache + - name: media + mountPath: /media + readOnly: true + resources: + requests: + podman.io/device=/dev/dri/card0: 1 + podman.io/device=/dev/dri/renderD128: 1 + limits: + #cpu: 300m + #memory: 512Mi + + volumes: + - name: data + hostPath: + path: /var/lib/jellyfin + type: DirectoryOrCreate + - name: cache + emptyDir: {} + - name: media + hostPath: + path: /media/hayasui/media + type: Directory diff --git a/bundles/jellyfin/files/logging.json b/bundles/jellyfin/files/logging.json new file mode 100644 index 0000000..b658515 --- /dev/null +++ b/bundles/jellyfin/files/logging.json @@ -0,0 +1,11 @@ +{ + "Serilog": { + "MinimumLevel": { + "Default": "Information", + "Override": { + "Microsoft": "Warning", + "System": "Warning" + } + } + } +} diff --git a/bundles/jellyfin/files/system.xml b/bundles/jellyfin/files/system.xml new file mode 100644 index 0000000..0696f49 --- /dev/null +++ b/bundles/jellyfin/files/system.xml @@ -0,0 +1,202 @@ + + + 3 + true + /cache + true + true + true + false + true + true + /config/metadata + en + DE + + . + + + % + + + , + & + - + { + } + ' + + + the + a + an + + 5 + 90 + 300 + 5 + 5 + 0 + 60 + 30 + Legacy + + + Book + + + + + + + + + Movie + + + + + + + + + MusicVideo + + + + The Open Movie Database + + + + The Open Movie Database + + + + + Series + + + + + + + + + MusicAlbum + + + + TheAudioDB + + + + + + + MusicArtist + + + + TheAudioDB + + + + + + + BoxSet + + + + + + + + + Season + + + + + + + + + Episode + + + + + + + + + true + jellyfin + en-US + false + + 0 + false + false + true + + + + Jellyfin Stable + https://repo.jellyfin.org/files/plugin/manifest.json + true + + + Jellyfin SSO + https://raw.githubusercontent.com/9p4/jellyfin-plugin-sso/manifest-release/manifest.json + true + + + Intro Skipper + https://manifest.intro-skipper.org/manifest.json + true + + + true + 0 + + true + 500 + + * + + 30 + 0 + 0 + false + true + 0 + MatchSource + 0 + + + F007D354 + Stable + + + 6F511C87 + Unstable + + + + false + false + false + NonBlocking + BelowNormal + 10000 + + 320 + + 10 + 10 + 4 + 90 + 1 + + diff --git a/bundles/jellyfin/items.py b/bundles/jellyfin/items.py new file mode 100644 index 0000000..5ed07ef --- /dev/null +++ b/bundles/jellyfin/items.py @@ -0,0 +1,33 @@ +files = { + "/var/lib/jellyfin/plugins/SSO-Auth.zip": { + "content_type": "download", + "source": "https://github.com/9p4/jellyfin-plugin-sso/releases/download/v3.5.2.4/sso-authentication_3.5.2.4.zip", + "content_hash": "a2f00e5acc7adf785202e27fffc969e019cbd9e8", + "triggers": {"action:extract-jellyfin-plugin-sso"}, + }, + "/var/lib/jellyfin/config/branding.xml": { + "content_type": "text", + "triggers": {"svc_s6rc:jellyfin:restart"}, + }, + "/var/lib/jellyfin/config/logging.json": { + "content_type": "mako", + "triggers": {"svc_s6rc:jellyfin:restart"}, + }, + "/var/lib/jellyfin/plugins/configurations/SSO-Auth.xml": { + "content_type": "mako", + "triggers": {"svc_s6rc:jellyfin:restart"}, + }, + + "/etc/deployments/jellyfin/kube.yaml": { + "content_type": "text", + "source": "kube.yaml", + "triggers": {"svc_s6rc:jellyfin:restart"}, + }, +} + +actions = { + "extract-jellyfin-plugin-sso": { + "command": "unzip -d /var/lib/jellyfin/plugins/SSO-Auth /var/lib/jellyfin/plugins/SSO-Auth.zip", + "triggered": True, + }, +} diff --git a/bundles/jellyfin/metadata.py b/bundles/jellyfin/metadata.py new file mode 100644 index 0000000..a614afd --- /dev/null +++ b/bundles/jellyfin/metadata.py @@ -0,0 +1,16 @@ +defaults = { + "backup": { + "includes": { + "/var/lib/jellyfin", + # "/media/hayasui/media/movies", + # "/media/hayasui/media/tvshows", + # "/media/hayasui/media/anime", + } + }, + "containers": { + "jellyfin": {}, + }, + "metrics": { + "jellyfin": {}, + }, +} -- cgit 1.4.1