From 90063c3f3adf9f055ff366a6e47408feb0656e25 Mon Sep 17 00:00:00 2001 From: eduard256 Date: Tue, 18 Nov 2025 13:35:29 +0300 Subject: [PATCH] Fix API paths for Home Assistant Ingress compatibility - Change absolute API paths to relative paths in camera-search.js - Change absolute API paths to relative paths in stream-discovery.js - Fixes resource loading in HA Ingress environment - Maintains compatibility with direct Docker installations - Version bump to 1.0.2 --- cmd/strix/main.go | 2 +- go.mod | 2 +- go.sum | 1 + webui/package.json | 2 +- webui/web/js/api/camera-search.js | 2 +- webui/web/js/api/stream-discovery.js | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cmd/strix/main.go b/cmd/strix/main.go index e37abe2..0629ca0 100644 --- a/cmd/strix/main.go +++ b/cmd/strix/main.go @@ -20,7 +20,7 @@ import ( const ( // Version is the application version - Version = "1.0.0" + Version = "1.0.2" // Banner is the application banner Banner = ` diff --git a/go.mod b/go.mod index ccb7b9b..e68e447 100644 --- a/go.mod +++ b/go.mod @@ -9,6 +9,7 @@ require ( github.com/go-chi/chi/v5 v5.2.3 github.com/go-playground/validator/v10 v10.28.0 github.com/lithammer/fuzzysearch v1.1.8 + gopkg.in/yaml.v3 v3.0.1 ) require ( @@ -23,5 +24,4 @@ require ( golang.org/x/crypto v0.42.0 // indirect golang.org/x/sys v0.36.0 // indirect golang.org/x/text v0.29.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index a65434f..616a5bb 100644 --- a/go.sum +++ b/go.sum @@ -67,6 +67,7 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/webui/package.json b/webui/package.json index 5887739..11752e8 100644 --- a/webui/package.json +++ b/webui/package.json @@ -1,6 +1,6 @@ { "name": "webui", - "version": "1.0.0", + "version": "1.0.2", "type": "module", "description": "", "main": "index.js", diff --git a/webui/web/js/api/camera-search.js b/webui/web/js/api/camera-search.js index 38f8eaf..703728c 100644 --- a/webui/web/js/api/camera-search.js +++ b/webui/web/js/api/camera-search.js @@ -9,7 +9,7 @@ export class CameraSearchAPI { } async search(query, limit = 10) { - const response = await fetch(`${this.baseURL}/api/v1/cameras/search`, { + const response = await fetch(`${this.baseURL}api/v1/cameras/search`, { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/webui/web/js/api/stream-discovery.js b/webui/web/js/api/stream-discovery.js index 7de1a4a..d409451 100644 --- a/webui/web/js/api/stream-discovery.js +++ b/webui/web/js/api/stream-discovery.js @@ -12,7 +12,7 @@ export class StreamDiscoveryAPI { discover(request, callbacks) { this.close(); - const url = new URL(`${this.baseURL}/api/v1/streams/discover`, window.location.origin); + const url = new URL(`${this.baseURL}api/v1/streams/discover`, window.location.origin); fetch(url, { method: 'POST',