jupyterhub / jupyter-server-proxy

Jupyter notebook server extension to proxy web services.
https://jupyter-server-proxy.readthedocs.io
BSD 3-Clause "New" or "Revised" License
351 stars 148 forks source link

Specifying config via traitlets not working #171

Closed TuSKan closed 3 years ago

TuSKan commented 4 years ago

Hy guys, I could not put this to work with config via traitlets.

It appears for RStudio when I install the jupyter-rserver-proxy library but don't works because of rsession (instead of rserver) issue.

The proxy get is empty: /user/{username}/server-proxy/servers-info = {"server_processes": []}

My file is on jupyter config path: _/etc/jupyter/jupyter_notebookconfig.py

The content is:

c.ServerProxy.servers = {
    "rstudio": {
        "command": [
            "/usr/lib/rstudio-server/bin/rserver",
            "--server-daemonize=0",
            "--auth-none=1",
            "--www-port={port}",
            "--server-user={username}",
            "--server-working-dir=" +
            os.environ['DOCKER_NOTEBOOK_DIR'] + "/{username}"
        ],
        "port": 8787,
        "timeout": 20,
        "launcher_entry": {
            "enabled": True,
            "title": "RStudio",
            "icon_path": os.path.join(
                os.environ["HUB_PATH"], "icons", "rstudio.svg"
            )
        }
    },
    "vscode": {
        "command": [
            "/usr/bin/code-server",
            "--disable-telemetry",
            "--auth=none",
            "--cert="+os.environ['SSL_CERT'],
            "--cert-key="+os.environ['SSL_KEY'],
            "--user-data-dir=" +
            os.environ['DOCKER_NOTEBOOK_DIR'] + "/{username}",
            "--port={port}"
        ],
        "port": 8989,
        "timeout": 20,
        "launcher_entry": {
            "enable": True,
            "title": "VSCode",
            "icon_path": os.path.join(
                os.environ["HUB_PATH"], "icons", "vscode.svg"
            )
        }
    }
}

Any ideas?

jerowe commented 3 years ago

I'm having the same issue. Were you able to solve it?

TuSKan commented 3 years ago

Yes. You need to copy your jupyter config file to the user home directory

cp /etc/jupyter/jupyter_notebook_config.py    ~/.jupyter/jupyter_notebook_config.py
manics commented 3 years ago

Thanks for the update, since this isn't related to jupyter-server-proxy I'll close this issue.