From a0874d9f37e7d155d67af4d65031c658232172fe Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Fri, 13 Dec 2024 02:43:32 +0100 Subject: [PATCH] Add `jellyseerr` by default --- .../services/jellyfin/docker-compose.base.yml | 9 +++++ .../jellyfin/docker-compose.overrides.yml | 3 ++ .../docker/services/jellyfin/main.fish | 38 +++++++++++++++++-- 3 files changed, 47 insertions(+), 3 deletions(-) diff --git a/scripts/Common/Software/docker/services/jellyfin/docker-compose.base.yml b/scripts/Common/Software/docker/services/jellyfin/docker-compose.base.yml index f2b97998..40153bb2 100644 --- a/scripts/Common/Software/docker/services/jellyfin/docker-compose.base.yml +++ b/scripts/Common/Software/docker/services/jellyfin/docker-compose.base.yml @@ -8,6 +8,15 @@ services: - ./data/config/jellyfin:/config - cache:/cache - ./data/media:/media + jellyseerr: + image: fallenbagel/jellyseerr + restart: unless-stopped + user: 1337:1337 + environment: + LOG_LEVEL: debug + volumes: + - /etc/localtime:/etc/localtime:ro + - ./data/config/jellyseerr:/app/config radarr: image: linuxserver/radarr restart: unless-stopped diff --git a/scripts/Common/Software/docker/services/jellyfin/docker-compose.overrides.yml b/scripts/Common/Software/docker/services/jellyfin/docker-compose.overrides.yml index f735895d..f13a692a 100644 --- a/scripts/Common/Software/docker/services/jellyfin/docker-compose.overrides.yml +++ b/scripts/Common/Software/docker/services/jellyfin/docker-compose.overrides.yml @@ -3,6 +3,9 @@ services: environment: {} ports: - 127.0.0.1:1337:8096 + jellyseerr: + ports: + - 127.0.0.1:1337:5055 radarr: ports: - 127.0.0.1:1337:7878 diff --git a/scripts/Common/Software/docker/services/jellyfin/main.fish b/scripts/Common/Software/docker/services/jellyfin/main.fish index 32bc8b31..2e6f93cc 100755 --- a/scripts/Common/Software/docker/services/jellyfin/main.fish +++ b/scripts/Common/Software/docker/services/jellyfin/main.fish @@ -4,6 +4,7 @@ begin set -l user jellyfin set -l domain media set -l server "$domain" "" + set -l suggest "jellyseerr" set -l servarr radarr sonarr lidarr prowlarr set -l flood flood set -l service $user @@ -77,10 +78,11 @@ begin printf "%s\0" $server end - function getServiceLocations -V servarr -V flood + function getServiceLocations -V suggest -V servarr -V flood argparse -i "name=" -- $argv printf "%s\0" \ - "$_flag_name" / "" ( + "$_flag_name" / "" \ + "$suggest" "/suggest" "Jellyseerr" ( for app in $servarr printf "%s\n" "$app" "/$app" "" printf "%s\n" "$app" "/$app/signalr" "" @@ -112,7 +114,7 @@ begin end end - function getExtraLocationSettings -a domain s location -V service -V servarr + function getExtraLocationSettings -a domain s location -V service -V suggest -V servarr set -l wsConfig ( printf "%s\n" \ '# Websocket' \ @@ -128,6 +130,36 @@ begin else if [ "$location" = /socket ] echo "$wsConfig" end + else if [ "$s" = "$suggest" ] + printf "%s\n" \ + "" \ + 'set $app \'suggest\';' \ + "# Remove /suggest path to pass to the app" \ + 'rewrite ^/suggest/?(.*)$ /$1 break;' \ + "" \ + "#Redirect location headers" \ + 'proxy_redirect ^ /$app;' \ + 'proxy_redirect /setup /$app/setup;' \ + 'proxy_redirect /login /$app/login;' \ + "" \ + "# Sub filters to replace hardcoded paths" \ + 'proxy_set_header Accept-Encoding "";' \ + 'sub_filter_once off;' \ + 'sub_filter_types *;' \ + 'sub_filter \'\' \'\';' \ + 'sub_filter \'href="/"\' \'href="/$app"\';' \ + 'sub_filter \'href="/login"\' \'href="/$app/login"\'' \ + 'sub_filter \'href:"/"\' \'href:"/$app"\';' \ + 'sub_filter \'\/_next\' \'\/$app\/_next\';' \ + 'sub_filter \'/_next\' \'/$app/_next\';' \ + 'sub_filter \'/api/v1\' \'/$app/api/v1\';' \ + 'sub_filter \'/login/plex/loading\' \'/$app/login/plex/loading\';' \ + 'sub_filter \'/images/\' \'/$app/images/\';' \ + 'sub_filter \'/android-\' \'/$app/android-\';' \ + 'sub_filter \'/apple-\' \'/$app/apple-\';' \ + 'sub_filter \'/favicon\' \'/$app/favicon\';' \ + 'sub_filter \'/logo_\' \'/$app/logo_\';' \ + 'sub_filter \'/site.webmanifest\' \'/$app/site.webmanifest\';' else if contains "$s" $servarr if string match --regex ".*/signalr^" "$location" >/dev/null echo "$wsConfig"