Merge pull request #2497 from alexbelgium/copilot/sub-pr-2496

Fix Seerr ingress implementation: use s6 services instead of background processes
This commit is contained in:
Alexandre
2026-02-19 10:24:34 +01:00
committed by GitHub
6 changed files with 55 additions and 16 deletions

View File

@@ -2,15 +2,13 @@
# shellcheck shell=bash
set -e
rm -r /app/config
# Setup config directory
if [ -d /app/config ]; then
rm -r /app/config
fi
ln -sf /config /app/config
# Set permissions
chown -R "$PUID:$PGID" /config || true
cd /app || true
bashio::log.info "Starting NGinx..."
nginx &
bashio::log.info "Starting app"
npm start
bashio::log.info "Seerr initialization complete"

View File

@@ -1,9 +1,6 @@
server {
listen %%interface%%:%%port%% default_server;
#include /etc/nginx/includes/server_params.conf;
#include /etc/nginx/includes/proxy_params.conf;
client_max_body_size 0;
location / {
@@ -11,20 +8,26 @@ server {
proxy_connect_timeout 30m;
proxy_send_timeout 30m;
proxy_read_timeout 30m;
proxy_pass http://0.0.0.0:5055;
proxy_pass http://127.0.0.1:5055;
# Allow signalr
# WebSocket support for real-time updates
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $http_host;
# Correct base_url
# Correct base_url - rewrite absolute root paths to ingress entry
proxy_set_header Accept-Encoding "";
sub_filter_once off;
sub_filter_types *;
sub_filter 'href="/"' 'href="%%ingress_entry%%/"';
sub_filter 'src="/"' 'src="%%ingress_entry%%/"';
sub_filter '"\/"' '"%%ingress_entry2%%\/"';
}
sub_filter 'action="/"' 'action="%%ingress_entry%%/"';
}
}

View File

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

View File

@@ -0,0 +1,14 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
set -e
# ==============================================================================
# Set variables
slug=seerr
port=5055
# Wait for seerr to become available
bashio::net.wait_for "$port" localhost 900
bashio::log.info "Starting NGINX..."
exec nginx

View File

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

View File

@@ -0,0 +1,8 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
set -e
cd /app || exit 1
bashio::log.info "Starting Seerr..."
exec npm start