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

Setting frontend.base_url #417

Open
kmbae opened this issue Jun 2, 2024 · 2 comments
Open

Setting frontend.base_url #417

kmbae opened this issue Jun 2, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@kmbae
Copy link

kmbae commented Jun 2, 2024

Description

I just wonder about setting the base_url for the jupyverse.
For instance, when running jupyter lab, the --LabApp.base_url option modifies the URL while connecting via browser.
I thought that --set frontend.base_url=/test/ works the same as --LabApp.base_url=/test.
But this option does not behave as I expected. Any solutions?

Reproduce

  1. Run jupyverse using below code
    jupyverse --set kernels.require_yjs=true --set jupyterlab.server_side_execution=true --set auth.mode=noauth --set frontend.collaborative=true --set frontend.base_url=/ --host 0.0.0.0 --port 8888 --allow-origin '*'

  2. access the jupyverse using browser and obtained below screen.
    http://ipaddr:8888/lab

스크린샷 2024-06-02 오후 5 27 10
  1. Run jupyverse using below code with base_url option
    jupyverse --set kernels.require_yjs=true --set jupyterlab.server_side_execution=true --set auth.mode=noauth --set frontend.collaborative=true --set frontend.base_url=/test/ --host 0.0.0.0 --port 8888 --allow-origin '*'

  2. access the jupyverse using browser and obtained below screen.
    http://ipaddr:8888/test/lab

스크린샷 2024-06-02 오후 5 28 07

Expected behavior

Expected to have the same screenshot for both options.

Context

  • Operating System and version:
  • Browser and version:
  • Jupyter Server version:
Troubleshoot Output
Paste the output from running `jupyter troubleshoot` from the command line here.
You may want to sanitize the paths in the output.
Command Line Output
Paste the output from your command line running `jupyter lab` here, use `--debug` if possible.
Browser Output
Paste the output from your browser Javascript console here, if applicable.
@kmbae kmbae added the bug Something isn't working label Jun 2, 2024
Copy link

welcome bot commented Jun 2, 2024

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@rakhmaevao
Copy link

Hi. The frontend.base_url parameter is used for correct redirects inside the frontend application (for example, jupyterlab). This must be set if you set the prefix at the level of the external proxy.

To add a prefix at the level of the entire Jupyverse, in addition to the frontend.base_url configuration, you also need to set root_path in FastApi app. Unfortunately, there is no CLI setting for this parameter. But you can do this through a plugin in which you override this parameter of the FastApi application.

For example:

class MyPluginComponent(Component):
    async def start(
        self,
        ctx: Context,
    ) -> None:
        app = await ctx.request_resource(App)
        app._app.root_path = "/test"

If any of the maintainers consider this necessary, then I can add such an option to CLI.

What do you say, @davidbrochart?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants