Skip to content
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

Web Root Feature request #746

Open
ajdaniel opened this issue Jun 18, 2020 · 55 comments
Open

Web Root Feature request #746

ajdaniel opened this issue Jun 18, 2020 · 55 comments

Comments

@ajdaniel
Copy link

It is a pain for me to not be able to specify a web root path e.g. /homebridgeui So I can proxy more effectively on my system instead of having to use the root.

Describe the solution you'd like:
I would like to be able to have an option to provide a web root path, such as /homebridgeui which means all UI is prefixed with that path. This allows me to use NGINX to proxy all of my applications that all run on / on a single system across multiple ports.

Describe alternatives you've considered:
Can't find a way around this yet.

Additional context:
I run homebridge on the same home server as a tool called Tautulli, which provides this option and looks like this:

image

@stale
Copy link

stale bot commented Jul 18, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 18, 2020
@htims1989
Copy link

+1 on this, to prevent stale bot closing it!

@stale stale bot removed the stale label Jul 21, 2020
@ajdaniel
Copy link
Author

+1 please keep this alive - closing feature requests that are old is not a good idea

@stale
Copy link

stale bot commented Aug 22, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 22, 2020
@ajdaniel
Copy link
Author

Keeping this open!

@stale stale bot removed the stale label Aug 22, 2020
@XVII
Copy link

XVII commented Sep 10, 2020

Yes please! An option like the one described in config.json would be cool.
https://github.com/oznu/homebridge-config-ui-x/wiki/Config-Options#proxyhost

@ingria
Copy link

ingria commented Sep 16, 2020

+1 That would be a useful feature

@stale
Copy link

stale bot commented Oct 17, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 17, 2020
@XVII
Copy link

XVII commented Oct 17, 2020

Wow stale bot is keen

@hroland
Copy link

hroland commented Oct 19, 2020

+1

@stale stale bot removed the stale label Oct 19, 2020
@NicolasLiampotis
Copy link

+1 to keep this alive

@stale
Copy link

stale bot commented Dec 18, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 18, 2020
@xbrunosousa
Copy link

+1 to keep alive

@stale stale bot removed the stale label Dec 18, 2020
@ajdaniel
Copy link
Author

Does anyone have any suggestions on how to implement this feature? If we make a start on how to implement, then it should be more like that it gets picked up and done.

@ajdaniel
Copy link
Author

It does look like the way to go forward with this is to implement a config variable which is applied to the prefix attribute in the Fastify init https://www.fastify.io/docs/latest/Server/#prefix

@timdream
Copy link

Does anyone have any suggestions on how to implement this feature? If we make a start on how to implement, then it should be more like that it gets picked up and done.

You probably don't need a config — HTML markup can be made relative, and JavaScript can figure out the path on its own. If this is true, the issue would become much simpler.

https://github.com/oznu/homebridge-config-ui-x/blob/66c1e5d61b9d197cdb6408716e33a13bf25883af/ui/src/index.html#L7-L18

These relative URLs would need to change from absolute path to relative, for example, from /assets to ./assets. (I am not sure why there is a <base href="/"> in the markup; I couldn't find HB serving any pages under a sub-directory path.)

The links and the image paths on the top navbar would need to be relative too (I only casually search the code on GitHub, perhaps there are more links/image paths):

https://github.com/oznu/homebridge-config-ui-x/blob/bbd2299e21ecfb5e2c661f47f698350278bb90cd/ui/src/app/shared/layout/layout.component.html#L5-L6

Same goes to these API socket.io path stored in environment.prod.ts. It can probably deduce to the right URL inline by parsing document.location.pathname.

https://github.com/oznu/homebridge-config-ui-x/blob/3e9fd2e17ffd8263fd8fe9c4444374eb8e3127bd/ui/src/environments/environment.prod.ts#L3-L12

One thing I am not sure is the socket.io URL. Not sure if it will work if you give that ws:/wss: URL a path.

Beyond that I don't see anything outstanding that would need to be fixed.

@timdream
Copy link

You probably don't need a config

Just to clarify, proxyHost is still needed, otherwise socket.io will be blocked by CSP. You just don't need a new config.

@stale
Copy link

stale bot commented Jan 18, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 18, 2021
@XVII
Copy link

XVII commented Jan 18, 2021

Bump :(

@stale stale bot removed the stale label Jan 18, 2021
@SmolSoftBoi
Copy link

Bad bot

@rhyssmith
Copy link

Still waaaaant

@github-actions github-actions bot removed the stale label Aug 24, 2021
@ustaerk
Copy link

ustaerk commented Aug 25, 2021

I just saw this now but already opened #1211. In my opinion, unability to run the config UI behind a proxy providing proper security is a risk to the end user which mandates a bug.

Cheers, Uli

@hamwong
Copy link

hamwong commented Aug 29, 2021

+1

1 similar comment
@Animosity022
Copy link

+1

@mriksman
Copy link

mriksman commented Oct 3, 2021

Bumpity Bump

@github-actions
Copy link

github-actions bot commented Nov 3, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Nov 3, 2021
@rhyssmith
Copy link

Still really want this!

@mriksman
Copy link

mriksman commented Nov 3, 2021

Not sure if this applies to anyone, but what about if you use subdomains instead of folders?
So instead of
domain.com/homebridge
Do
homebridge.domain.com
And let nginx reverse proxy based on host name to location root / for that host name.

@github-actions github-actions bot removed the stale label Nov 4, 2021
@mofman
Copy link

mofman commented Nov 8, 2021

Bump

@github-actions
Copy link

github-actions bot commented Dec 9, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Dec 9, 2021
@XVII
Copy link

XVII commented Dec 9, 2021

Bump...

@jfelixfalcon
Copy link

My only recommendation is to create a two container deployment. The first one will be an nginx container to act as the redirect to the container hosting homebridge. It sounds tedious but this is how we deploy applications on kubernetes most of the time :)

@ghost
Copy link

ghost commented Mar 1, 2023

Looks like a time to make fork

@mieldehabanero
Copy link

Bump

@cviebrock
Copy link

bump

1 similar comment
@mufler
Copy link

mufler commented Nov 24, 2023

bump

@HanSooloo
Copy link

+1

@HanSooloo
Copy link

Tried to go over all the paths with a root reference and make them relative here: ce74f18

Did a general search for a few specific tokens to find where web paths are being used:

  1. ('/
  2. ['/
  3. (`/
  4. [`/

Made sure the results from the search in Sublime text only captured code that has web paths and NOT Unix commands or file paths.

Would this be of interest? I saw a reference to a commit by @mikeh in the backlog, but couldn't see the contents.

@brandonb927
Copy link

brandonb927 commented Feb 15, 2024

Chiming in here to keep this issue alive and say that I'm surprised this option doesn't exist given that you can change the proxy host already, but I want to proxy to a path instead of host like /homebridge, not homebridge.example.com. I'm not exposing homebridge over the internet, this is more to make it easier and nicer in my local network where I can just link to paths off my main proxied domain rather than keeping bookmarks for hostname:port combos.

I'll try to open a PR to see if this issue can be resolved as it would really solve a big problem for a lot of people.

@HanSooloo
Copy link

Tried to go over all the paths with a root reference and make them relative here: ce74f18

Did a general search for a few specific tokens to find where web paths are being used:

  1. ('/
  2. ['/
  3. (`/
  4. [`/

Made sure the results from the search in Sublime text only captured code that has web paths and NOT Unix commands or file paths.

Would this be of interest? I saw a reference to a commit by @mikeh in the backlog, but couldn't see the contents.

I just realized, and as someone else pointed out, simply changing those to ./ is not the right way to do it, since some parts of the code don't work like that.

We need proper sub-path support.

@naanlizard
Copy link

Frustrating this has been open and ignored for so long

@donavanbecker
Copy link
Contributor

Frustrating this has been open and ignored for so long

How has this been ignored? Is there a PR open on it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests