Add ingress support to Jackett addon

This commit is contained in:
Alexandre
2026-01-19 16:09:44 +01:00
parent 6780681551
commit 2d82787c5d
13 changed files with 305 additions and 1 deletions

View File

@@ -0,0 +1,8 @@
#!/usr/bin/execlineb -S0
# ==============================================================================
# Take down the S6 supervision tree when Nginx fails
# ==============================================================================
if { s6-test ${1} -ne 0 }
if { s6-test ${1} -ne 256 }
s6-svscanctl -t /var/run/s6/services

View File

@@ -0,0 +1,24 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
set -e
# ==============================================================================
# Set variables
slug=jackett
port=9117
CONFIG_LOCATION=/config/addons_config/Jackett/ServerConfig.json
# Wait for Jackett to become available
bashio::net.wait_for "$port" localhost 900
# Ensure BasePathOverride is set for ingress
if [ -f "$CONFIG_LOCATION" ] && ! bashio::config.true "ingress_disabled"; then
if ! grep -q "\"BasePathOverride\"[[:space:]]*:[[:space:]]*\"${slug}\"" "$CONFIG_LOCATION"; then
bashio::log.warning "BasePathOverride not set properly, restarting"
sed -i -E "s/\"BasePathOverride\"[[:space:]]*:[[:space:]]*\"[^\"]*\"/\"BasePathOverride\": \"${slug}\"/" "$CONFIG_LOCATION"
bashio::addon.restart
fi
fi
bashio::log.info "Starting NGinx..."
exec nginx