feat: enable ingress support for birdnet-pipy addon

Add ingress: true, ingress_port: 0, and ingress_stream: true to
config.yaml. Update ingress_params.conf with sub_filter rules for
Vue.js SPA: rewrite API paths, stream paths, Socket.IO paths, and
inject base href for Vue Router history mode.

Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-26 10:51:29 +00:00
parent a887dd5edf
commit e0f9c91e43
2 changed files with 19 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,22 @@ 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)
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'";