Skip to content

Conversation

Copy link

Copilot AI commented Oct 29, 2025

When accessed through Home Assistant ingress, the ARM web UI loads unstyled because static assets (CSS, JS, images) return 404. Home Assistant proxies the app through /api/hassio_ingress/[TOKEN]/, but ARM serves assets from root paths without accounting for this prefix.

Changes

Nginx reverse proxy layer

  • Port routing: nginx (8089) → ARM (8090)
  • Path rewriting: Uses sub_filter to inject ingress path into asset references
    • href="/"href="$ingress_path/"
    • src="/"src="$ingress_path/"
    • url(/url($ingress_path/
  • Header detection: Reads X-Ingress-Path from Home Assistant
  • Redirect handling: Rewrites Location headers via proxy_redirect

Process management

  • Launches nginx and ARM as background processes
  • Signal handlers for graceful shutdown
  • wait on ARM as primary service

Configuration

map $http_x_ingress_path $ingress_path {
    default "";
    "~^(.+)$" $1;
}

sub_filter 'href="/' 'href="$ingress_path/';
sub_filter 'src="/' 'src="$ingress_path/';
sub_filter_once off;
sub_filter_types text/css application/javascript;

Version bumped to 0.2.5. Backward compatible—direct access (non-ingress) unaffected.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/automatic-ripping-machine/automatic-ripping-machine
    • Triggering command: curl -s REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Ingress mode does not load CSS and complementary files in side panel</issue_title>
<issue_description>### Problem
When accessing the add-on through the Home Assistant side panel in ingress mode, the page loads without CSS styling or complementary files (JavaScript, images, etc.). This results in a broken and unstyled interface, making the add-on difficult to use.

Steps to reproduce

  1. Open the ARM-HASS-Addon from the Home Assistant side panel (ingress mode).
  2. Observe that the page loads without proper styling and missing assets.

Evidence

  • Unstyled ARM web interface in Home Assistant ingress panel
  • 404 errors for CSS, JS, and image files in browser devtools

Expected Behavior

The add-on web interface should load all CSS, JavaScript, and image files correctly when accessed through the Home Assistant ingress side panel.

Actual Behavior

The page loads, but only the raw HTML is displayed; all linked CSS, JS, and image files return 404 errors (see screenshot).

Impact

  • Poor user experience, add-on is hard to use.
  • Features relying on JS or CSS are broken.

Suggested Investigation

  • Check how static assets are served in ingress mode.
  • Ensure correct asset paths and Home Assistant ingress proxy compatibility.
  • See browser devtools screenshot for failed asset requests.

Additional context

  • Home Assistant version: [please specify]
  • Add-on version: [please specify]
  • Browser: [please specify]

Please investigate and fix asset loading for ingress mode.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@mliradelc mliradelc marked this pull request as ready for review October 29, 2025 21:21
Copilot AI and others added 4 commits October 29, 2025 21:28
Co-authored-by: mliradelc <8040628+mliradelc@users.noreply.github.com>
Co-authored-by: mliradelc <8040628+mliradelc@users.noreply.github.com>
Co-authored-by: mliradelc <8040628+mliradelc@users.noreply.github.com>
Co-authored-by: mliradelc <8040628+mliradelc@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix CSS and asset loading in ingress mode Fix ingress asset loading with nginx reverse proxy Oct 29, 2025
Copilot AI requested a review from mliradelc October 29, 2025 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ingress mode does not load CSS and complementary files in side panel

2 participants