Skip to content

Problem: Home Assistant Add-on #3579

@felixilgatto

Description

@felixilgatto

Issue

I am developing a Home Assistant OS (HAOS) add-on for Semaphore. While exposing the Docker container on a specific port works perfectly, it doesn't allow for seamless integration into the Home Assistant sidebar.

To achieve native UI integration, I must use Home Assistant Ingress, which proxies the application through a dynamic subpath (e.g., https://ha.example.com/local_semaphore/ingress), "local" is because a running locally the add-on but will change dynamically, (e.g. for vscode, https://ha.example.com/a0d7b954_vscode/ingress)

The Issue

When accessing Semaphore via the Ingress path, the application fails to load, resulting in a blank grey screen.

Observation: The application seems unable to handle the /local_semaphore/ingress prefix. Static assets (JS/CSS) and API calls are likely looking for the root path (/) instead of the prefixed path.

Direct Access: Works fine when accessed via IP:PORT.

Attempted Workaround

I attempted to place an Nginx proxy in front of Semaphore using the recommended documentation settings, but the issue persists. My configuration currently looks like this:
Nginx

server {
  listen 8080;
  server_name _;

  add_header Strict-Transport-Security "max-age=31536000" always;
  chunked_transfer_encoding on;

  location / {
    proxy_pass http://127.0.0.1:3000/;
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;

    proxy_buffering off;
    proxy_request_buffering off;
  }

  location /api/ws {
    proxy_pass http://127.0.0.1:3000/api/ws;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Origin "";
  }
}

Question / Feature Request

Does Semaphore currently support a BASE_URL or ROOT_PATH environment variable to handle being served from a subpath? If not, what is the recommended way to handle path rewriting so the frontend can correctly locate its assets?

Impact

Web-Frontend (what users interact with)

Installation method

Binary

Database

No response

Browser

Firefox

Semaphore Version

2.16.47

Ansible Version

Logs & errors

No response

Manual installation - system information

Home Assistant OS run on a Raspberry PI 5 8Gb, but HAOS act as a supervisor for Docker

Configuration

Repositories : https://github.com/felixilgatto/addon-semaphore

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions