mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-15 20:09:13 +02:00
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:
@@ -60,6 +60,9 @@ environment:
|
|||||||
PGID: "0"
|
PGID: "0"
|
||||||
PUID: "0"
|
PUID: "0"
|
||||||
image: ghcr.io/alexbelgium/birdnet-pipy-{arch}
|
image: ghcr.io/alexbelgium/birdnet-pipy-{arch}
|
||||||
|
ingress: true
|
||||||
|
ingress_port: 0
|
||||||
|
ingress_stream: true
|
||||||
init: false
|
init: false
|
||||||
map:
|
map:
|
||||||
- addon_config:rw
|
- addon_config:rw
|
||||||
|
|||||||
@@ -2,8 +2,22 @@ absolute_redirect off;
|
|||||||
rewrite ^%%ingress_entry%%/(.*)$ /$1 break;
|
rewrite ^%%ingress_entry%%/(.*)$ /$1 break;
|
||||||
sub_filter_once off;
|
sub_filter_once off;
|
||||||
sub_filter_types *;
|
sub_filter_types *;
|
||||||
|
|
||||||
|
# Inject <base href> for Vue Router history mode and static asset loading
|
||||||
sub_filter '<head>' '<head><base href="%%ingress_entry%%/">';
|
sub_filter '<head>' '<head><base href="%%ingress_entry%%/">';
|
||||||
|
|
||||||
|
# Rewrite absolute href/src attributes in HTML
|
||||||
sub_filter 'href="/' 'href="%%ingress_entry%%/';
|
sub_filter 'href="/' 'href="%%ingress_entry%%/';
|
||||||
sub_filter 'src="/' 'src="%%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'";
|
||||||
|
|||||||
Reference in New Issue
Block a user