I noticed someone created an N8N addon for Home Assistant here: GitHub - Rbillon59/hass-n8n: Home assistant addon to host a n8n.io instance
Now, this is fine at first glance, but it relies on basic auth and exposes its web UI (the N8N admin panel) via the web. That’s really bad from a security standpoint.
Ideally, you’d use ingress
in Home Assistant, which will run the container with an ingress in front of it, relaying all traffic to it. I wanted to contribute that to the addon, but ran into issues.
Now, the problem with this is that Home Assistant will host each addon at its own relative URL.
So let’s say that I install the N8N addon. Home Assistant then might decide to host it at “http://localhost:1234/some-weird-addon-subdirectory/blahblah”.
That’s fine, and that part works. I can even programmatically (inside the container) fetch the path, also at build time of my addon’s Docker image.
However, that’s where the problem arises. When I load the addon, the HTML still refers to static assets inside “/assets”, which should now be “/some-weird-addon-subdirectory/blahblah/assets”.
I am aware that I can change this using the VUE_APP_URL_BASE_API
environment variable. However, that happens at build time.
And if I want my Home Assistant addon’s Dockerfile to base itself on “docker.n8n.io/n8nio/n8n” to avoid duplication, then the base image has already been built, and altering VUE_APP_URL_BASE_API
is too late.
What other options do I have here? Any ideas?
Having a Home Assistant addon for N8N could really help kick it off. I’ve been using Node Red in the past which is hugely popular as an addon as well, but I think N8N is way better than Node Red, and could really gain a lot of market share via Home Assistant.