diff --git a/config/plugins/interactive_environments/rstudio/config/allowed_images.yml.sample b/config/plugins/interactive_environments/rstudio/config/allowed_images.yml.sample index 0c97c0cf26e..6c9e7691b53 100644 --- a/config/plugins/interactive_environments/rstudio/config/allowed_images.yml.sample +++ b/config/plugins/interactive_environments/rstudio/config/allowed_images.yml.sample @@ -6,7 +6,7 @@ # appropriate `apt-get/pip install` statements. --- - - image: erasche/docker-rstudio-notebook:16.10 + image: erasche/docker-rstudio-notebook:17.01 description: | If you've ever done R analysis, you probably used RStudio. This familiar R analysis software suite will let you explore your datasets diff --git a/config/plugins/interactive_environments/rstudio/config/rstudio.ini.sample b/config/plugins/interactive_environments/rstudio/config/rstudio.ini.sample index 0f2b3fa14bb..695ee5c6e9f 100644 --- a/config/plugins/interactive_environments/rstudio/config/rstudio.ini.sample +++ b/config/plugins/interactive_environments/rstudio/config/rstudio.ini.sample @@ -20,7 +20,7 @@ password_auth = True # The image argument was moved to "allowed_images.yml.sample" # Additional arguments that are passed to the `docker run` command. -#command_inject = --sig-proxy=true -e DEBUG=false +#command_inject = --sig-proxy=true -e DEBUG=false -e DEFAULT_CONTAINER_RUNTIME=120 # URL to access the Galaxy API with from the spawn Docker containter, if empty # this falls back to galaxy.ini's galaxy_infrastructure_url and finally to the diff --git a/config/plugins/interactive_environments/rstudio/static/js/rstudio.js b/config/plugins/interactive_environments/rstudio/static/js/rstudio.js index 38764d84567..8e52c3fa522 100644 --- a/config/plugins/interactive_environments/rstudio/static/js/rstudio.js +++ b/config/plugins/interactive_environments/rstudio/static/js/rstudio.js @@ -14,11 +14,11 @@ function message_failed_connection(){ * @param {String} notebook_access_url: the URL embeded in the page and loaded * */ -function load_notebook(notebook_login_url, notebook_access_url, notebook_pubkey_url, username){ +function load_notebook(notebook_login_url, notebook_access_url, notebook_pubkey_url){ // Test notebook_login_url for accessibility, executing the login+load function whenever // we've successfully connected to the IE. test_ie_availability(notebook_pubkey_url, function(){ - var payload = username + "\n" + ie_password; + var payload = "rstudio\nrstudio"; $.ajax({ type: 'GET', url: notebook_pubkey_url, @@ -32,7 +32,6 @@ function load_notebook(notebook_login_url, notebook_access_url, notebook_pubkey_ console.log("Found " + exp +" and " + mod); var rsa = new RSAKey(); rsa.setPublic(mod, exp); - console.log("Encrypting '" + username + "', '" + ie_password + "'"); var enc_hex = rsa.encrypt(payload); var encrypted = hex2b64(enc_hex); console.log("E: " + encrypted); @@ -58,7 +57,10 @@ function load_notebook(notebook_login_url, notebook_access_url, notebook_pubkey_ append_notebook(notebook_access_url); }, error: function(jqxhr, status, error){ - message_failed_connection(); + // TODO: Uncomment when rstudio / nginx play nicely and + // don't return http when we asked for HTTPS, thereby + // issuing a mixed-content warning. + //message_failed_connection(); // Do we want to try and load the notebook anyway? Just in case? append_notebook(notebook_access_url); } diff --git a/config/plugins/interactive_environments/rstudio/templates/rstudio.mako b/config/plugins/interactive_environments/rstudio/templates/rstudio.mako index c9b472c6f98..1277c4c34ce 100644 --- a/config/plugins/interactive_environments/rstudio/templates/rstudio.mako +++ b/config/plugins/interactive_environments/rstudio/templates/rstudio.mako @@ -1,4 +1,5 @@ -<%namespace file="ie.mako" name="ie"/> +<%namespace name="ie" file="ie.mako"/> + <% import os import shutil @@ -7,46 +8,42 @@ import time # Sets ID and sets up a lot of other variables ie_request.load_deploy_config() ie_request.attr.docker_port = 80 -# Create tempdir in galaxy -temp_dir = ie_request.temp_dir PASSWORD = "rstudio" USERNAME = "rstudio" # Then override it again ie_request.notebook_pw = "rstudio" -# Did the user give us an RData file? -if hda.datatype.__class__.__name__ == "RData": - shutil.copy( hda.file_name, os.path.join(temp_dir, '.RData') ) +DATASET_HID = hda.hid +# Add all environment variables collected from Galaxy's IE infrastructure ie_request.launch( image=trans.request.params.get('image_tag', None), additional_ids=trans.request.params.get('additional_dataset_ids', None), env_override={ 'notebook_username': USERNAME, 'notebook_password': PASSWORD, + 'dataset_hid': DATASET_HID, } ) ## General IE specific # Access URLs for the notebook from within galaxy. -# TODO: Make this work without pointing directly to IE. Currently does not work -# through proxy. -notebook_pubkey_url = ie_request.url_template('${PROXY_URL}/rstudio/auth-public-key') notebook_access_url = ie_request.url_template('${PROXY_URL}/rstudio/') -notebook_login_url = ie_request.url_template('${PROXY_URL}/rstudio/auth-do-sign-in') +notebook_login_url = ie_request.url_template('${PROXY_URL}/rstudio/auth-do-sign-in') +notebook_pubkey_url = ie_request.url_template('${PROXY_URL}/rstudio/auth-public-key') %>
${ ie.load_default_js() } - + + -