mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-03-04 00:01:36 +01:00
Merge pull request #2538 from alexbelgium/copilot/implement-ingress-birdnet-addon
Enable ingress support for birdnet-pipy addon
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user