Merge pull request #2538 from alexbelgium/copilot/implement-ingress-birdnet-addon

Enable ingress support for birdnet-pipy addon
This commit is contained in:
Alexandre
2026-02-26 17:59:22 +01:00
committed by GitHub
2 changed files with 20 additions and 2 deletions

View File

@@ -60,6 +60,9 @@ environment:
PGID: "0"
PUID: "0"
image: ghcr.io/alexbelgium/birdnet-pipy-{arch}
ingress: true
ingress_port: 0
ingress_stream: true
init: false
map:
- addon_config:rw

View File

@@ -2,8 +2,23 @@ absolute_redirect off;
rewrite ^%%ingress_entry%%/(.*)$ /$1 break;
sub_filter_once off;
sub_filter_types *;
# Inject <base href> for Vue Router history mode and static asset loading
sub_filter '<head>' '<head><base href="%%ingress_entry%%/">';
# Rewrite absolute href/src attributes in HTML
sub_filter 'href="/' 'href="%%ingress_entry%%/';
sub_filter 'src="/' 'src="%%ingress_entry%%/';
sub_filter '"/birdnet/' '"%%ingress_entry%%/birdnet/';
sub_filter 'url(/birdnet/' 'url(%%ingress_entry%%/birdnet/';
# Rewrite API paths in JS bundles (axios baseURL and fetch calls)
# Pattern includes baseURL:"/api" (no trailing slash) so "/api" is needed
sub_filter '"/api' '"%%ingress_entry%%/api';
sub_filter "'/api" "'%%ingress_entry%%/api";
# Rewrite stream paths
sub_filter '"/stream/' '"%%ingress_entry%%/stream/';
sub_filter "'/stream/" "'%%ingress_entry%%/stream/";
# Rewrite Socket.IO default path in the client library
sub_filter '"/socket.io' '"%%ingress_entry%%/socket.io';
sub_filter "'/socket.io" "'%%ingress_entry%%/socket.io";