Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# This GitHub workflow installs RStudio Server alongside JupyterLab
# and verifies the /rstudio/ proxy endpoint is reachable.
name: Test

on:
pull_request:
paths:
- "**.py"
- "pyproject.toml"
workflow_dispatch:

jobs:
test-proxy:
runs-on: ubuntu-latest
container:
image: quay.io/jupyter/r-notebook:latest
options: --user root

steps:
- uses: actions/checkout@v4

- name: Install package
run: pip install -e .

- name: Install RStudio Server
run: |
apt-get update -qq
apt-get install -y --no-install-recommends gdebi-core jq wget

RELEASE=$(. /etc/os-release && echo "$VERSION_CODENAME")
RSTUDIO_URL=$(wget --output-document - --output-file /dev/null \
'https://www.rstudio.com/wp-content/downloads.json' \
| jq --raw-output --arg RELEASE "$RELEASE" \
'.rstudio.open_source.stable.server.installer[$RELEASE].url')

wget --no-verbose --output-document rstudio-server-latest-amd64.deb "$RSTUDIO_URL"
gdebi --non-interactive rstudio-server-latest-amd64.deb
rm rstudio-server-latest-amd64.deb

- name: Start JupyterLab
run: |
jupyter lab --no-browser --ServerApp.token='' --ServerApp.password='' --allow-root &
timeout 60 bash -c 'until curl -sf http://localhost:8888/api; do sleep 1; done'

- name: Test Proxy
run: |
# Use a cookie jar so curl accumulates auth cookies across redirects.
HTTP_CODE=$(curl -s --max-time 60 \
-c /tmp/rstudio_cookies.txt -b /tmp/rstudio_cookies.txt \
-L --max-redirs 5 \
-w "%{http_code}" -o /tmp/rstudio_response.html \
http://localhost:8888/rstudio/)
echo "HTTP response code: $HTTP_CODE"

if [ "${HTTP_CODE:-0}" -lt 200 ] || [ "${HTTP_CODE:-0}" -ge 400 ]; then
echo "--- Response body ---"
cat /tmp/rstudio_response.html
exit 1
fi
Comment thread
jrdnbradford marked this conversation as resolved.
Outdated

grep -qi "rstudio" /tmp/rstudio_response.html \
|| { echo "Response does not contain RStudio content"; cat /tmp/rstudio_response.html; exit 1; }
echo "RStudio is reachable and served IDE content"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# jupyter-rsession-proxy

[![TravisCI build status](https://img.shields.io/travis/com/jupyterhub/jupyter-rsession-proxy?logo=travis)](https://travis-ci.com/jupyterhub/jupyter-rsession-proxy)
[![Test](https://github.com/jrdnbradford/jupyter-rsession-proxy/actions/workflows/test.yaml/badge.svg)](https://github.com/jrdnbradford/jupyter-rsession-proxy/actions/workflows/test.yaml)
Comment thread
jrdnbradford marked this conversation as resolved.
Outdated

**jupyter-rsession-proxy** provides Jupyter server and notebook extensions to proxy RStudio.

Expand Down Expand Up @@ -59,7 +59,7 @@ Note: in this scenario, `jupyter-rsession-proxy` must still first be installed (
### Multiuser Considerations

This extension launches an RStudio server process from the Jupyter notebook server. This is fine in JupyterHub deployments where user servers are containerized since other users cannot connect to the RStudio server port. In non-containerized JupyterHub deployments, for example on multiuser systems running LocalSpawner or BatchSpawner, *this is not secure if Rstudio server is listening on a TCP port*. In that case, any user may connect to Rstudio server and run arbitrary code. *However, if Rstudio is listening on a unix port, the socket will be protected using unix file permissions*. Therefore, we recommend keeping the default configuration, which uses a unix socket and not a TCP port.

## Configuration with Environment Variables
The following behavior can be configured with environment variables:

Expand Down