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

webui request: support configuring backend host name #706

Open
davidxia opened this issue Mar 20, 2023 · 10 comments
Open

webui request: support configuring backend host name #706

davidxia opened this issue Mar 20, 2023 · 10 comments

Comments

@davidxia
Copy link
Contributor

davidxia commented Mar 20, 2023

Can you support configuring the backend host name in the webui code here? I have the constraint that I can't use ports and must deploy the webui to https://open-vsx.foo.com and the server to https://open-vsx-server.foo.com. So I'd like to configure serverHost = 'open-vsx-server.foo.com'. Right now the webui code assumes the server is running on the same host name.

I can contribute a PR if someone can guide me on the best way to parameterize this.

@amvanbaren
Copy link
Contributor

Hi @davidxia, the package.json has the copy2server task. It copies the webui build output to the server resources. So you don't need to run the webui on a separate server. Would this work for you?

@davidxia
Copy link
Contributor Author

Thanks! So running the webui separately is only for development? Might be nice to document the right way to deploy the app.

@amvanbaren
Copy link
Contributor

So running the webui separately is only for development?

Yes, it's so that you don't have to restart the server every time you make a small change to the webui.

Might be nice to document the right way to deploy the app.

Deployment documentation can be found here: https://github.com/eclipse/openvsx/wiki/Deploying-Open-VSX. However, I don't know if it is still up to date.

@davidxia
Copy link
Contributor Author

@amvanbaren Just FYI, I just noticed copy2server copies to server/src/dev/resources/. Seems like this script is also only for development. I need it for production at server/src/main/resources/.

@davidxia davidxia reopened this Mar 21, 2023
@amvanbaren
Copy link
Contributor

From https://github.com/eclipse/openvsx/wiki/Deploying-Open-VSX#adding-the-web-ui:
"The Docker image of the server application does not include the web UI. The reason for this is that the UI can be customized. In case you don't need customization, you can use the default web UI image and deploy it next to the server. Customization of the UI is done by creating an npm package with a dependency on openvsx-webui, which is a library of React components."

You can create a new package and define your own copy2server task or rewrite the serverHost logic.
Also take a look at https://github.com/EclipseFdn/open-vsx.org for the open-vsx.org deployment.

@amvanbaren
Copy link
Contributor

Hi @davidxia, did you manage to get openvsx running? #703 (comment) might help.

@davidxia
Copy link
Contributor Author

davidxia commented Mar 30, 2023

Thanks for asking. I got it running but had to make some small hardcoded changes to do the above. Might be nice to update the docs and accommodate my use case, but I’m also OK if this issue is closed.

@aallrd
Copy link

aallrd commented Mar 30, 2023

Hello @davidxia,
Can you please share these changes you did?
I am trying to achieve the same thing of hosting an OpenVSX server internally at openvsx.foo.com.
I built a custom openvsx-server image using the Dockerfile mentioned by @amvanbaren to bundle these changes in a single image (server + UI).
I updated my docker_compose.yml from #703 with this new single image (removed the UI service) and configured my reverse proxy to listen on http://localhost:8080 but I am unable to access the UI.
My openvsx-server container is only exposing a single port (8080), should it be exposing another one for the UI (3000?) ?

Here is the error I am getting in the web browser console when opening https://openvsx.foo.com:

The resource from “https://openvsx.foo.com/bundle.js” was blocked due to MIME type (“application/json”) mismatch (X-Content-Type-Options: nosniff).

Actually. I cannot find the file bundle.js in my custom openvsx-server image, what did I miss?

@amvanbaren
Copy link
Contributor

Might be nice to update the docs and accommodate my use case

I'd be happy to do that @davidxia. Can you share the changes you've made?

@davidxia
Copy link
Contributor Author

davidxia commented Jul 2, 2023

Sorry for late reply. These are the changes I made. It's been a while so I'm hazy on why exactly I made these specific ones.

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

No branches or pull requests

3 participants