From 816737cf99fafada3677df033b69bc847729f333 Mon Sep 17 00:00:00 2001 From: kphilippart Date: Sun, 28 Jan 2024 16:27:55 +0100 Subject: [PATCH 1/5] Update docker-compose.yml --- docker-compose.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index cb4bc6f..dc86ae8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -131,6 +131,36 @@ services: - homepage.widget.key=${LIDARR_API_KEY} profiles: - lidarr + bazarr: + image: lscr.io/linuxserver/bazarr + container_name: bazarr + environment: + - PUID=${USER_ID} + - PGID=${GROUP_ID} + - TZ=${TIMEZONE} + volumes: + - ./bazarr/config:/config + - ${DATA_ROOT}:/data + restart: always + healthcheck: + test: [ "CMD", "curl", "--fail", "http://127.0.0.1:6767/bazarr/ping" ] + interval: 5s + retries: 10 + labels: + - traefik.enable=true + - traefik.http.routers.bazarr.rule=(Host(`${HOSTNAME}`) && PathPrefix(`/bazarr`)) + - traefik.http.routers.bazarr.tls=true + - traefik.http.routers.bazarr.tls.certresolver=myresolver + - traefik.http.services.bazarr.loadbalancer.server.port=6767 + - homepage.group=Media + - homepage.name=Bazarr + - homepage.icon=bazarr.png + - homepage.href=/bazarr + - homepage.description=Subtitles management + - homepage.weight=0 + - homepage.widget.type=bazarr + - homepage.widget.url=http://bazarr:6767/bazarr + - homepage.widget.key=${BAZARR_API_KEY} jellyseerr: image: fallenbagel/jellyseerr:latest container_name: jellyseerr From 0ee728d361e08bb700a724fb32ea1e753d962cb1 Mon Sep 17 00:00:00 2001 From: kphilippart Date: Sun, 28 Jan 2024 16:37:40 +0100 Subject: [PATCH 2/5] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 86403b1..649f37a 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ I am running it in Ubuntu Server 22.04; I also tested this setup on a [Synology |-------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------|--------------| | [Sonarr](https://sonarr.tv) | PVR for newsgroup and bittorrent users | [linuxserver/sonarr](https://hub.docker.com/r/linuxserver/sonarr) | /sonarr | | [Radarr](https://radarr.video) | Movie collection manager for Usenet and BitTorrent users | [linuxserver/radarr](https://hub.docker.com/r/linuxserver/radarr) | /radarr | +| [Bazarr](https://www.bazarr.media/) | Companion application to Sonarr and Radarr that manages and downloads subtitles | [linuxserver/bazarr](https://hub.docker.com/r/linuxserver/bazarr) | /bazarr | | [Prowlarr](https://github.com/Prowlarr/Prowlarr) | Indexer aggregator for Sonarr and Radarr | [linuxserver/prowlarr:latest](https://hub.docker.com/r/linuxserver/prowlarr) | /prowlarr | | [PIA WireGuard VPN](https://github.com/thrnz/docker-wireguard-pia) | Encapsulate qBittorrent traffic in [PIA](https://www.privateinternetaccess.com/) using [WireGuard](https://www.wireguard.com/) with port forwarding. | [thrnz/docker-wireguard-pia](https://hub.docker.com/r/thrnz/docker-wireguard-pia) | | | [qBittorrent](https://www.qbittorrent.org) | Bittorrent client with a complete web UI
Uses VPN network
Using Libtorrent 1.x | [linuxserver/qbittorrent:libtorrentv1](https://hub.docker.com/r/linuxserver/qbittorrent) | /qbittorrent | @@ -89,6 +90,7 @@ For the first time, run `./update-config.sh` to update the applications base URL Get your qBittorrent password from `docker compose logs qbittorrent` and change it in the UI and in `.env.` If you want to show Jellyfin information in the homepage, create it in Jellyfin settings and fill `JELLYFIN_API_KEY`. +If you want to show Bazarr information in the homepage, open `./bazarr/config/config.yml`, find the apikey line and copy it in your .env file in a new line: `BAZARR_API_KEY='your_bazar_api_key'` ## Environment Variables @@ -150,7 +152,7 @@ The location of the server it will connect to is set by `LOC=ca`, defaulting to You need to fill the credentials in the `PIA_*` environment variable, otherwise the VPN container will exit and qBittorrent will not start. -## Sonarr, Radarr & Lidarr +## Sonarr, Radarr, Lidarr & Bazarr ### File Structure From 5e8692abf205845e79d1ecd18d139e5c57df9033 Mon Sep 17 00:00:00 2001 From: Adrien Poupa Date: Sat, 9 Mar 2024 15:35:24 -0500 Subject: [PATCH 3/5] feat: improve Bazarr configuration --- .env.example | 1 + .gitignore | 1 + README.md | 46 ++++++++++++++-------------- joplin/docker-compose.yml | 2 +- update-config.sh | 64 +++++++++++++++++++++++++++------------ 5 files changed, 70 insertions(+), 44 deletions(-) diff --git a/.env.example b/.env.example index 8ae10d8..fc88e67 100644 --- a/.env.example +++ b/.env.example @@ -28,6 +28,7 @@ SONARR_API_KEY= RADARR_API_KEY= LIDARR_API_KEY= PROWLARR_API_KEY= +BAZARR_API_KEY= JELLYFIN_API_KEY= JELLYSEERR_API_KEY= SABNZBD_API_KEY= diff --git a/.gitignore b/.gitignore index fc96e73..2b4254d 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ docker-compose.override.yml /radarr /prowlarr /lidarr +/bazarr /qbittorrent /pia /pia-shared diff --git a/README.md b/README.md index 649f37a..1076b2a 100644 --- a/README.md +++ b/README.md @@ -55,28 +55,28 @@ I am running it in Ubuntu Server 22.04; I also tested this setup on a [Synology ## Applications -| **Application** | **Description** | **Image** | **URL** | -|-------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------|--------------| -| [Sonarr](https://sonarr.tv) | PVR for newsgroup and bittorrent users | [linuxserver/sonarr](https://hub.docker.com/r/linuxserver/sonarr) | /sonarr | -| [Radarr](https://radarr.video) | Movie collection manager for Usenet and BitTorrent users | [linuxserver/radarr](https://hub.docker.com/r/linuxserver/radarr) | /radarr | -| [Bazarr](https://www.bazarr.media/) | Companion application to Sonarr and Radarr that manages and downloads subtitles | [linuxserver/bazarr](https://hub.docker.com/r/linuxserver/bazarr) | /bazarr | -| [Prowlarr](https://github.com/Prowlarr/Prowlarr) | Indexer aggregator for Sonarr and Radarr | [linuxserver/prowlarr:latest](https://hub.docker.com/r/linuxserver/prowlarr) | /prowlarr | +| **Application** | **Description** | **Image** | **URL** | +|--------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------|--------------| +| [Sonarr](https://sonarr.tv) | PVR for newsgroup and bittorrent users | [linuxserver/sonarr](https://hub.docker.com/r/linuxserver/sonarr) | /sonarr | +| [Radarr](https://radarr.video) | Movie collection manager for Usenet and BitTorrent users | [linuxserver/radarr](https://hub.docker.com/r/linuxserver/radarr) | /radarr | +| [Bazarr](https://www.bazarr.media/) | Companion application to Sonarr and Radarr that manages and downloads subtitles | [linuxserver/bazarr](https://hub.docker.com/r/linuxserver/bazarr) | /bazarr | +| [Prowlarr](https://github.com/Prowlarr/Prowlarr) | Indexer aggregator for Sonarr and Radarr | [linuxserver/prowlarr:latest](https://hub.docker.com/r/linuxserver/prowlarr) | /prowlarr | | [PIA WireGuard VPN](https://github.com/thrnz/docker-wireguard-pia) | Encapsulate qBittorrent traffic in [PIA](https://www.privateinternetaccess.com/) using [WireGuard](https://www.wireguard.com/) with port forwarding. | [thrnz/docker-wireguard-pia](https://hub.docker.com/r/thrnz/docker-wireguard-pia) | | -| [qBittorrent](https://www.qbittorrent.org) | Bittorrent client with a complete web UI
Uses VPN network
Using Libtorrent 1.x | [linuxserver/qbittorrent:libtorrentv1](https://hub.docker.com/r/linuxserver/qbittorrent) | /qbittorrent | -| [Unpackerr](https://unpackerr.zip) | Automated Archive Extractions | [golift/unpackerr](https://hub.docker.com/r/golift/unpackerr) | | -| [Jellyfin](https://jellyfin.org) | Media server designed to organize, manage, and share digital media files to networked devices | [linuxserver/jellyfin](https://hub.docker.com/r/linuxserver/jellyfin) | /jellyfin | -| [Jellyseer](https://jellyfin.org) | Manages requests for your media library | [fallenbagel/jellyseerr](https://hub.docker.com/r/fallenbagel/jellyseerr) | /jellyseer | -| [Homepage](https://gethomepage.dev) | Application dashboard | [gethomepage/homepage](https://github.com/gethomepage/homepage/pkgs/container/homepage) | / | -| [Traefik](https://traefik.io) | Reverse proxy | [traefik](https://hub.docker.com/_/traefik) | | -| [Watchtower](https://containrrr.dev/watchtower/) | Automated Docker images update | [containrrr/watchtower](https://hub.docker.com/r/containrrr/watchtower) | | -| [Autoheal](https://github.com/willfarrell/docker-autoheal/) | Monitor and restart unhealthy Docker containers | [willfarrell/autoheal](https://hub.docker.com/r/willfarrell/autoheal) | | -| [Lidarr](https://lidarr.audio) | Optional - Music collection manager for Usenet and BitTorrent users
Enable with `COMPOSE_PROFILES=lidarr` | [linuxserver/lidarr](https://hub.docker.com/r/linuxserver/lidarr) | /lidarr | -| [SABnzbd](https://sabnzbd.org/) | Optional - Free and easy binary newsreader
Enable with `COMPOSE_PROFILES=sabnzbd` | [linuxserver/sabnzbd](https://hub.docker.com/r/linuxserver/sabnzbd) | /sabnzbd | -| [FlareSolverr](https://github.com/FlareSolverr/FlareSolverr) | Optional - Proxy server to bypass Cloudflare protection in Prowlarr
Enable with `COMPOSE_PROFILES=flaresolverr` | [flaresolverr/flaresolverr](https://hub.docker.com/r/flaresolverr/flaresolverr) | | -| [AdGuard Home](https://adguard.com/en/adguard-home/overview.html) | Optional - Network-wide software for blocking ads & tracking
Enable with `COMPOSE_PROFILES=adguardhome` | [adguard/adguardhome](https://hub.docker.com/r/adguard/adguardhome) | | -| [Tandoor](https://tandoor.dev) | Optional - Smart recipe management
Enable with `COMPOSE_PROFILES=tandoor` | [vabene1111/recipes](https://hub.docker.com/r/vabene1111/recipes) | /recipes | -| [Joplin](https://joplinapp.org/) | Optional - Note taking application
Enable with `COMPOSE_PROFILES=joplin` | [joplin/server](https://hub.docker.com/r/joplin/server) | /joplin | -| [Home Assistant](https://www.home-assistant.io/) | Optional - Open source home automation that puts local control and privacy first
Enable with `COMPOSE_PROFILES=homeassistant` | [home-assistant/home-assistant:stable](https://ghcr.io/home-assistant/home-assistant) | | +| [qBittorrent](https://www.qbittorrent.org) | Bittorrent client with a complete web UI
Uses VPN network
Using Libtorrent 1.x | [linuxserver/qbittorrent:libtorrentv1](https://hub.docker.com/r/linuxserver/qbittorrent) | /qbittorrent | +| [Unpackerr](https://unpackerr.zip) | Automated Archive Extractions | [golift/unpackerr](https://hub.docker.com/r/golift/unpackerr) | | +| [Jellyfin](https://jellyfin.org) | Media server designed to organize, manage, and share digital media files to networked devices | [linuxserver/jellyfin](https://hub.docker.com/r/linuxserver/jellyfin) | /jellyfin | +| [Jellyseer](https://jellyfin.org) | Manages requests for your media library | [fallenbagel/jellyseerr](https://hub.docker.com/r/fallenbagel/jellyseerr) | /jellyseer | +| [Homepage](https://gethomepage.dev) | Application dashboard | [gethomepage/homepage](https://github.com/gethomepage/homepage/pkgs/container/homepage) | / | +| [Traefik](https://traefik.io) | Reverse proxy | [traefik](https://hub.docker.com/_/traefik) | | +| [Watchtower](https://containrrr.dev/watchtower/) | Automated Docker images update | [containrrr/watchtower](https://hub.docker.com/r/containrrr/watchtower) | | +| [Autoheal](https://github.com/willfarrell/docker-autoheal/) | Monitor and restart unhealthy Docker containers | [willfarrell/autoheal](https://hub.docker.com/r/willfarrell/autoheal) | | +| [Lidarr](https://lidarr.audio) | Optional - Music collection manager for Usenet and BitTorrent users
Enable with `COMPOSE_PROFILES=lidarr` | [linuxserver/lidarr](https://hub.docker.com/r/linuxserver/lidarr) | /lidarr | +| [SABnzbd](https://sabnzbd.org/) | Optional - Free and easy binary newsreader
Enable with `COMPOSE_PROFILES=sabnzbd` | [linuxserver/sabnzbd](https://hub.docker.com/r/linuxserver/sabnzbd) | /sabnzbd | +| [FlareSolverr](https://github.com/FlareSolverr/FlareSolverr) | Optional - Proxy server to bypass Cloudflare protection in Prowlarr
Enable with `COMPOSE_PROFILES=flaresolverr` | [flaresolverr/flaresolverr](https://hub.docker.com/r/flaresolverr/flaresolverr) | | +| [AdGuard Home](https://adguard.com/en/adguard-home/overview.html) | Optional - Network-wide software for blocking ads & tracking
Enable with `COMPOSE_PROFILES=adguardhome` | [adguard/adguardhome](https://hub.docker.com/r/adguard/adguardhome) | | +| [Tandoor](https://tandoor.dev) | Optional - Smart recipe management
Enable with `COMPOSE_PROFILES=tandoor` | [vabene1111/recipes](https://hub.docker.com/r/vabene1111/recipes) | /recipes | +| [Joplin](https://joplinapp.org/) | Optional - Note taking application
Enable with `COMPOSE_PROFILES=joplin` | [joplin/server](https://hub.docker.com/r/joplin/server) | /joplin | +| [Home Assistant](https://www.home-assistant.io/) | Optional - Open source home automation that puts local control and privacy first
Enable with `COMPOSE_PROFILES=homeassistant` | [home-assistant/home-assistant:stable](https://ghcr.io/home-assistant/home-assistant) | | Optional containers are not enabled by default, they need to be enabled, see [Optional Services](#optional-services) for more information. @@ -90,7 +90,6 @@ For the first time, run `./update-config.sh` to update the applications base URL Get your qBittorrent password from `docker compose logs qbittorrent` and change it in the UI and in `.env.` If you want to show Jellyfin information in the homepage, create it in Jellyfin settings and fill `JELLYFIN_API_KEY`. -If you want to show Bazarr information in the homepage, open `./bazarr/config/config.yml`, find the apikey line and copy it in your .env file in a new line: `BAZARR_API_KEY='your_bazar_api_key'` ## Environment Variables @@ -124,6 +123,7 @@ If you want to show Bazarr information in the homepage, open `./bazarr/config/co | `RADARR_API_KEY` | Radarr API key to show information in the homepage | | | `LIDARR_API_KEY` | Lidarr API key to show information in the homepage | | | `PROWLARR_API_KEY` | Prowlarr API key to show information in the homepage | | +| `BAZARR_API_KEY` | Bazarr API key to show information in the homepage | | | `JELLYFIN_API_KEY` | Jellyfin API key to show information in the homepage | | | `JELLYSEERR_API_KEY` | Jellyseer API key to show information in the homepage | | | `SABNZBD_API_KEY` | Sabnzbd API key to show information in the homepage | | @@ -152,7 +152,7 @@ The location of the server it will connect to is set by `LOC=ca`, defaulting to You need to fill the credentials in the `PIA_*` environment variable, otherwise the VPN container will exit and qBittorrent will not start. -## Sonarr, Radarr, Lidarr & Bazarr +## Sonarr, Radarr & Lidarr ### File Structure diff --git a/joplin/docker-compose.yml b/joplin/docker-compose.yml index ac4a563..9d3a1f9 100644 --- a/joplin/docker-compose.yml +++ b/joplin/docker-compose.yml @@ -30,7 +30,7 @@ services: - traefik.http.middlewares.joplin-stripprefix.stripPrefix.prefixes=/joplin - traefik.http.services.joplin.loadbalancer.server.port=22300 - homepage.group=Apps - - homepage.name=joplin + - homepage.name=Joplin - homepage.icon=joplin.png - homepage.href=/joplin - homepage.description=Note-taking application diff --git a/update-config.sh b/update-config.sh index 96ef019..2da93a2 100755 --- a/update-config.sh +++ b/update-config.sh @@ -2,30 +2,54 @@ # See https://stackoverflow.com/a/44864004 for the sed GNU/BSD compatible hack -function update_config { - echo "Updating ${1^} configuration..." - until [ -f ./$1/config.xml ] +function update_arr_config { + echo "Updating ${container^} configuration..." + until [ -f ./"$container"/config.xml ] do - sleep 5 + sleep 1 done - sed -i.bak "s/<\/UrlBase>/\/$1<\/UrlBase>/" ./$1/config.xml && rm ./$1/config.xml.bak - sed -i.bak 's/^'"${1^^}"'_API_KEY=.*/'"${1^^}"'_API_KEY='"$(sed -n 's/.*\(.*\)<\/ApiKey>.*/\1/p' ./$1/config.xml)"'/' .env && rm .env.bak - echo "Update of ${1^} configuration complete." - echo "Restarting ${1^}..." - docker compose restart $1 + sed -i.bak "s/<\/UrlBase>/\/$1<\/UrlBase>/" ./"$container"/config.xml && rm ./"$container"/config.xml.bak + sed -i.bak 's/^'"${container^^}"'_API_KEY=.*/'"${1^^}"'_API_KEY='"$(sed -n 's/.*\(.*\)<\/ApiKey>.*/\1/p' ./"$container"/config.xml)"'/' .env && rm .env.bak + echo "Update of ${container^} configuration complete." + echo "Restarting ${container^}..." + docker compose restart "$container" +} + +function update_jellyfin_config { + echo "Updating ${container^} configuration..." + until [ -f ./"$container"/network.xml ]; do + sleep 1 + done + sed -i.bak "s//\/$container<\/BaseUrl>/" ./"$container"/network.xml && rm ./"$container"/network.xml.bak + echo "Update of ${container^} configuration complete." + echo "Restarting ${container^}..." + docker compose restart "$container" +} + +function update_bazarr_config { + echo "Updating ${container^} configuration..." + until [ -f ./"$container"/config/config/config.yaml ]; do + sleep 1 + done + sed -i.bak "s/base_url: ''/base_url: '\/$container'/" ./"$container"/config/config/config.yaml && rm ./"$container"/config/config/config.yaml.bak + sed -i.bak "s/use_radarr: false/use_radarr: true/" ./"$container"/config/config/config.yaml && rm ./"$container"/config/config/config.yaml.bak + sed -i.bak "s/use_sonarr: false/use_sonarr: true/" ./"$container"/config/config/config.yaml && rm ./"$container"/config/config/config.yaml.bak + SONARR_API_KEY=$(sed -n 's/.*\(.*\)<\/ApiKey>.*/\1/p' ./sonarr/config.xml) + sed -i.bak "/sonarr:/,/^radarr:/ { s/apikey: .*/apikey: $SONARR_API_KEY/; s/base_url: .*/base_url: \/sonarr/; s/ip: .*/ip: sonarr/ }" "$container"/config/config/config.yaml && rm ./"$container"/config/config/config.yaml.bak + RADARR_API_KEY=$(sed -n 's/.*\(.*\)<\/ApiKey>.*/\1/p' ./radarr/config.xml) + sed -i.bak "/radarr:/,/^sonarr:/ { s/apikey: .*/apikey: $RADARR_API_KEY/; s/base_url: .*/base_url: \/radarr/; s/ip: .*/ip: radarr/ }" "$container"/config/config/config.yaml && rm ./"$container"/config/config/config.yaml.bak + sed -i.bak 's/^'"${container^^}"'_API_KEY=.*/'"${container^^}"'_API_KEY='"$(sed -n 's/.*apikey: \(.*\)*/\1/p' ./"$container"/config/config/config.yaml | head -n 1)"'/' .env && rm .env.bak + echo "Update of ${container^} configuration complete." + echo "Restarting ${container^}..." + docker compose restart "$container" } for container in $(docker ps --format '{{.Names}}'); do - if [[ $container =~ ^(radarr|sonarr|lidarr|prowlarr)$ ]]; then - update_config $container - elif [[ $container =~ ^(jellyfin)$ ]]; then - echo "Updating ${container^} configuration..." - until [ -f ./$container/network.xml ]; do - sleep 5 - done - sed -i.bak "s//\/$container<\/BaseUrl>/" ./$container/network.xml && rm ./$container/network.xml.bak - echo "Update of ${container^} configuration complete." - echo "Restarting ${container^}..." - docker compose restart $container + if [[ "$container" =~ ^(radarr|sonarr|lidarr|prowlarr)$ ]]; then + update_arr_config "$container" + elif [[ "$container" =~ ^(jellyfin)$ ]]; then + update_jellyfin_config "$container" + elif [[ "$container" =~ ^(bazarr)$ ]]; then + update_bazarr_config "$container" fi done From 5078d257ec4bd2d3d1d6e289fbac734c5b03a8dc Mon Sep 17 00:00:00 2001 From: Adrien Poupa Date: Sat, 9 Mar 2024 15:40:26 -0500 Subject: [PATCH 4/5] feat: rework homepage categories --- docker-compose.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index dc86ae8..001eae0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -152,12 +152,12 @@ services: - traefik.http.routers.bazarr.tls=true - traefik.http.routers.bazarr.tls.certresolver=myresolver - traefik.http.services.bazarr.loadbalancer.server.port=6767 - - homepage.group=Media + - homepage.group=Download - homepage.name=Bazarr - homepage.icon=bazarr.png - homepage.href=/bazarr - homepage.description=Subtitles management - - homepage.weight=0 + - homepage.weight=4 - homepage.widget.type=bazarr - homepage.widget.url=http://bazarr:6767/bazarr - homepage.widget.key=${BAZARR_API_KEY} @@ -255,7 +255,7 @@ services: - homepage.icon=prowlarr.png - homepage.href=/prowlarr - homepage.description=Indexers management - - homepage.weight=4 + - homepage.weight=1 - homepage.widget.type=prowlarr - homepage.widget.url=http://prowlarr:9696/prowlarr - homepage.widget.key=${PROWLARR_API_KEY} @@ -317,7 +317,7 @@ services: - homepage.icon=qbittorrent.png - homepage.href=/qbittorrent - homepage.description=Bittorrent client - - homepage.weight=5 + - homepage.weight=2 - homepage.widget.type=qbittorrent - homepage.widget.url=http://vpn:8080 - homepage.widget.username=${QBITTORRENT_USERNAME} @@ -390,7 +390,7 @@ services: - homepage.icon=sabnzbd.png - homepage.href=/sabnzbd - homepage.description=Usenet - - homepage.weight=6 + - homepage.weight=3 - homepage.widget.type=sabnzbd - homepage.widget.url=http://sabnzbd:8080/sabnzbd - homepage.widget.key=${SABNZBD_API_KEY} From 55db10dddb47804fef45769f6637a210df770034 Mon Sep 17 00:00:00 2001 From: Adrien Poupa Date: Sat, 9 Mar 2024 15:44:34 -0500 Subject: [PATCH 5/5] fix: make sure arr config files exist for Bazarr config --- update-config.sh | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/update-config.sh b/update-config.sh index 2da93a2..d88bdc1 100755 --- a/update-config.sh +++ b/update-config.sh @@ -4,10 +4,7 @@ function update_arr_config { echo "Updating ${container^} configuration..." - until [ -f ./"$container"/config.xml ] - do - sleep 1 - done + until [ -f ./"$container"/config.xml ]; do sleep 1; done sed -i.bak "s/<\/UrlBase>/\/$1<\/UrlBase>/" ./"$container"/config.xml && rm ./"$container"/config.xml.bak sed -i.bak 's/^'"${container^^}"'_API_KEY=.*/'"${1^^}"'_API_KEY='"$(sed -n 's/.*\(.*\)<\/ApiKey>.*/\1/p' ./"$container"/config.xml)"'/' .env && rm .env.bak echo "Update of ${container^} configuration complete." @@ -17,9 +14,7 @@ function update_arr_config { function update_jellyfin_config { echo "Updating ${container^} configuration..." - until [ -f ./"$container"/network.xml ]; do - sleep 1 - done + until [ -f ./"$container"/network.xml ]; do sleep 1; done sed -i.bak "s//\/$container<\/BaseUrl>/" ./"$container"/network.xml && rm ./"$container"/network.xml.bak echo "Update of ${container^} configuration complete." echo "Restarting ${container^}..." @@ -28,14 +23,14 @@ function update_jellyfin_config { function update_bazarr_config { echo "Updating ${container^} configuration..." - until [ -f ./"$container"/config/config/config.yaml ]; do - sleep 1 - done + until [ -f ./"$container"/config/config/config.yaml ]; do sleep 1; done sed -i.bak "s/base_url: ''/base_url: '\/$container'/" ./"$container"/config/config/config.yaml && rm ./"$container"/config/config/config.yaml.bak sed -i.bak "s/use_radarr: false/use_radarr: true/" ./"$container"/config/config/config.yaml && rm ./"$container"/config/config/config.yaml.bak sed -i.bak "s/use_sonarr: false/use_sonarr: true/" ./"$container"/config/config/config.yaml && rm ./"$container"/config/config/config.yaml.bak + until [ -f ./sonarr/config.xml ]; do sleep 1; done SONARR_API_KEY=$(sed -n 's/.*\(.*\)<\/ApiKey>.*/\1/p' ./sonarr/config.xml) sed -i.bak "/sonarr:/,/^radarr:/ { s/apikey: .*/apikey: $SONARR_API_KEY/; s/base_url: .*/base_url: \/sonarr/; s/ip: .*/ip: sonarr/ }" "$container"/config/config/config.yaml && rm ./"$container"/config/config/config.yaml.bak + until [ -f ./radarr/config.xml ]; do sleep 1; done RADARR_API_KEY=$(sed -n 's/.*\(.*\)<\/ApiKey>.*/\1/p' ./radarr/config.xml) sed -i.bak "/radarr:/,/^sonarr:/ { s/apikey: .*/apikey: $RADARR_API_KEY/; s/base_url: .*/base_url: \/radarr/; s/ip: .*/ip: radarr/ }" "$container"/config/config/config.yaml && rm ./"$container"/config/config/config.yaml.bak sed -i.bak 's/^'"${container^^}"'_API_KEY=.*/'"${container^^}"'_API_KEY='"$(sed -n 's/.*apikey: \(.*\)*/\1/p' ./"$container"/config/config/config.yaml | head -n 1)"'/' .env && rm .env.bak