New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to host the application on a path #156
Comments
This will involve a LOT of work to both the backend and the frontend. And it will add work to each new feature/integration added, too. Or let alone the idea that a user would want to change the hosted path and all the config that now needs to be updated. I don't think it's worth the effort to get there nor the effort to maintain it. |
@balloob What you're saying appears to indicate that there are parts of Home Assistant that don't use or adhere to the Out of curiosity, the documentation indicates that |
The frontend really doesn't care what host is used, but it will put a |
Okay, good to know -- so in that case, if it's set to prefix requests with |
Closing this. Subdomain is the way to go. It adds a lot of complexity. |
So many people wants it. Some don't => closed. |
@max5962 there are many other ways. You can also use a second no-ip and use a proxy like nginx in front to serve the right page. |
@max5962 making our code more complex for a feature hardly anyone wants is not worth it. It hurts the project longterm and we're not doing it. |
https://community.home-assistant.io/t/configurable-webroot/516 Not sure who I think the perception of "hardly anyone wants" is a bit inaccurate in the sense that many people probably want it, but don't believe they have any value to contribute to the conversation beyond 👍 . So they don't make themselves noticed. Pretty sure adding this feature will widen your user base. I have a collection of users that the subdomain approach isn't an option for. It exposes that The lack of this feature put me off by about 2 years from finally putting this together in my own home, "I'll check back in 6 months and get started then when it handles custom URI roots" was what I kept telling myself. Currently these users are restricted to VPN'ing to their homes, or communicating with their environments via Discord or similar from their phones. That said, this is your project and your decision, but I wanted to at least toss in my usecases and related limitations for consideration. If you ever change your mind, I'd look forward to seeing this supported someday. If not, I think it's a pity. |
Maybe I am missing something obvious here... Shouldn't it be possible to achieve what you want with nginx, using a rewrite+reverse proxy setup? |
@zeehio That type of configuration rewrites requests to the application but doesn't affect the URLs and links the backend is generating (or that are hard-coded in places). For example, the frontend HTML is currently using hard-coded paths to point at resources served from @LostLakkris You've summed up my setup in a nutshell. I missed seeing home-assistant/core#805 in my original search, curious. At any rate, with the |
Home Assistant will not accept a contribution that adds support for this. It's not worth the added complexity that we will have to deal with forever. This decision is final. |
front end change is not complex. In homepage change |
I would certainly vote for this feature as having a subdomain requires a dedicated SSL certificate for it... |
May I suggest a workaround please? |
For instance, here is my config for lighttpd (
It is working, but you've probably got the idea why it is not optimal. |
Sounds like we need a fork :) |
+1 I've been looking for a solution all day, can't afford another SSL certificate, I guess I'll wait for the next product that will be flexible enough. |
Yeah. I generally agree with the focus and complexity argument. My own projects would suffer as well. Hardcoded urls however are just plane bugs. This is the last of 17 apps I host, that does not support path prefix. Even bitwarden_rs agreed and swiftly fixed this. Hard to imagine having to set up 17 specific domains to manage my server. I understand you not wanting to spend time to do it yourselves. That's what we are here for. But just blocking any potential support ist wrong. |
You probably don't understand how much effort it costs to maintain a fork. It's ridiculously more than maintaining a config file like this: #156 (comment) |
This discussion has been closed. Please use another location for discussing this more socially. For example on Discord or our community forum. Thanks! 👍 |
As first discussed at home-assistant/core#21113, Home Assistant doesn't currently support hosting on a path (eg
https://home.example.com/homeassistant
), being only able to be hosted at the root of a domain.Being able to serving Home Assistant from a subdirectory would allow it to co-exist alongside several other applications on an existing single hostname (served by a web server or reverse proxy, like Nginx) . This would save maintaining a separate hostname for this one application, removing the need for additional firewall, DNS configuration or HTTPS certificate config/renewals and so on.
In other applications, serving an application on a path is common. It usually involves the app's resources being served with either absolute URLs (eg prefixed with a full
base_url
or just a path component), or via relative URLs (possibly with a<base>
tag in the HTML). Dynamic apps often allow the frontend host to pass the "path" as part of the request (egPATH_INFO
in FastCGI), or otherwise applications might statically prefix all the resources on a page and it is up to the user to configure this correctly in the app's settings. I'm only generally familiar with Home Assistant's internals but given the httpbase_url
setting setting exists already, it appears to be following the latter "static" style of configuration.To implement the ability for Home Assistant to be served with a path, the simplest solution appears to be a case of ensuring
base_url
affects Home Assistant's URLs correctly, where any assumptions have been made in the code about the app being hosted at the root (/
) of the domain. For example, resources and links in the frontend HTML currently point at/frontend_latest
and/static
, so these would need the ability to be prefixed based on live configuration (or made relative). A comment on the previous issue mentioned there are other components that rely on knowing the path exposed to the internet so these would need adjusting too to make them flexible (& anywhere else that assumes the same).Is Home Assistant's architecture able to accommodate being served on a path / is this something that can be done? I'm new to the project so happy to contribute a PR but I'd need some initial guidance from the core team to understand the scope and of changes required.
The text was updated successfully, but these errors were encountered: