-
Notifications
You must be signed in to change notification settings - Fork 76
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
Does not support non root path in UI #49
Comments
@remy-tiitre just to clarify what is the purpose of adding this proxy? |
URL that developers/testers can remember. Besides when you run things conteinerized the IP can change as often as its needed to migrate it from one place to another. |
@remy-tiitre so what would you propose to do? I think we just need to somehow use relative URLs in JS. |
I did not digg into source code very deeply. Just confirmed that the /events was apsolute path hardcoded into code. favicon is also failing which is a lesser of a problem. I think JS code should respect the location where its. Resource loading works just fine. I think that the DOM.fromEventSource does not need this / infront of the events either. So if it was ...DOM.fromEventSource("events",e... then it would work fine. Not 100% sure though. Maybe "./events" would be more correct as you have "./index.js" url in your code. |
Well theres allways an option to use selenoid.nice.urld.name instead of the nice.urld.name/selenoid/ |
Actually, hadn't had any thoughts about usage of the UI with non-root path, so it should be fixed :) |
Merged in master, so please try latest docker image. If it will not work, pls share your proxy config |
Events are working, but the URLs at the top still assume that you are in a root folder (stats, vnc, logs). I have to check my proxy settings because on the first load it does not show the stats and capabilities block. I can see that the events come through though. When I click stats links it will show the blocks but goes to root folder. |
Its react router logic - it changes the url in browser without reload. Don't know how to make this changes relative |
@remy-tiitre some investigation says that it not so easy to implement. React-router doesn't provide out-of-the-box solution with a dynamic base path. So it will be much easier to use root location. |
I don't think that its a serious issue as the incorrect URL does not hit the backend unless you go to address bar and hit enter. But it seems that I still have some issues with the proxy configuration. Not sure what it is. Will let you know. |
There is one option I think, if you could configure the base href with config parameter. For example when you start selenoid-ui with -base=/selenoid/ parameter then the html that it generates has: |
Please provide environment to reproduce your case |
What do you mean by environment. Right now Selenoid UI can't be run in non-root context. The events queue has been fixed but the UI still relies on being in root path. Check React Router documentation - https://reacttraining.com/react-router/web/api/BrowserRouter/basename-string I don't think that the basename can be detected dynamically. So one solution would be to provide it as environment variable when you start the container. That was the idea of my previous post. |
I mean how to setup proxy with non-root context. (Generally speaking, I know how to do this, but I don't remember exact configs and I ask you to simplify the setup process for me). Without such environment, I can't modify routes as it can break something |
Should be resolved with hash-based routing. Please reopen if not |
Hello.
|
I'm not really in traefik, but |
mm.. Using Doc for traefik https://docs.traefik.io/basics/#matchers |
Hmm, yes,
and probably here:
should use always relative path then or provide some kind of For now you are forced to handle |
Does anyone have a valid Nginx config to serve Selenoid UI on path like /selenoid? |
+1 for this. We have one tester here who wants to use Selenoid. Unfortunately it gets painful if we leave a local machine and don't want to expose a single instance setup to the world (in intranet ) and try to integrate it with nginx. |
Probably it has something to do with the react build configuration described here https://create-react-app.dev/docs/deployment/#building-for-relative-paths According to this docs an attribute in the package.json may solve the issue
|
I tried to add Apache proxy infront of the SelenoidUI, but as the /events uri is hardcoded into JS it does not work. For example if your apache Proxy url is https://some.nice.server.url/selenoid/ that proxys to http://127.0.0.1:8080/ then it doesn't work.
The text was updated successfully, but these errors were encountered: