From: Marcel van der Veldt Date: Sat, 13 Dec 2025 11:37:51 +0000 (+0100) Subject: small tweak to ingress setup X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=5fe1c629e3b36b6cb5c661271c01ebefbdd246c5;p=music-assistant-server.git small tweak to ingress setup --- diff --git a/music_assistant/controllers/webserver/controller.py b/music_assistant/controllers/webserver/controller.py index 8881f273..01183fcb 100644 --- a/music_assistant/controllers/webserver/controller.py +++ b/music_assistant/controllers/webserver/controller.py @@ -613,12 +613,9 @@ class WebserverController(CoreController): async def _handle_index(self, request: web.Request) -> web.StreamResponse: """Handle request for index page (Vue frontend).""" - # If not yet onboarded, redirect to setup - if ( - not self.auth.has_users - and not self.mass.config.onboard_done - and is_request_from_ingress(request) - ): + is_ingress_request = is_request_from_ingress(request) + + if (not self.auth.has_users or not self.mass.config.onboard_done) and is_ingress_request: # a non-admin user tries to access the index via HA ingress # while we're not yet onboarded, prevent that as it leads to a bad UX ingress_user_id = request.headers.get("X-Remote-User-ID", "") @@ -631,9 +628,11 @@ class WebserverController(CoreController): # NOTE: For ingress admin user, # we allow access to index, user will be auto created and then forwarded to the # frontend (which will take care of onboarding) - if not self.auth.has_users: + + if not self.auth.has_users and not is_ingress_request: # non ingress request and no users yet, redirect to setup return web.Response(status=302, headers={"Location": "setup"}) + # Serve the Vue frontend index.html return await self._server.serve_static(self._index_path, request)