mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-02 12:08:46 +02:00
Add ingress support to Jackett addon
This commit is contained in:
8
jackett/rootfs/etc/services.d/nginx/finish
Normal file
8
jackett/rootfs/etc/services.d/nginx/finish
Normal 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
|
||||
24
jackett/rootfs/etc/services.d/nginx/run
Executable file
24
jackett/rootfs/etc/services.d/nginx/run
Executable 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
|
||||
Reference in New Issue
Block a user