diff --git a/doc/source/admin/galaxy_options.rst b/doc/source/admin/galaxy_options.rst index 4bcf2989ee2..b79f5ee62d8 100644 --- a/doc/source/admin/galaxy_options.rst +++ b/doc/source/admin/galaxy_options.rst @@ -1707,13 +1707,25 @@ :Type: bool +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +``interactivetools_upstream_proxy`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +:Description: + Set this to false to redirect users of Interacitve tools directly + to the Interactive tools proxy. `interactivetools_upstream_proxy` + should only be set to false in development. +:Default: ``true`` +:Type: bool + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``interactivetools_proxy_host`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Description: - Proxy host - assumed to just be hosted on the same hostname and - port as Galaxy by default. + Hostname and port of Interactive tools proxy. It is assumed to be + hosted on the same hostname and port as Galaxy by default. :Default: ``None`` :Type: str diff --git a/lib/galaxy/config/sample/galaxy.yml.sample b/lib/galaxy/config/sample/galaxy.yml.sample index 3017f8b4926..1ed5f5a5ab0 100644 --- a/lib/galaxy/config/sample/galaxy.yml.sample +++ b/lib/galaxy/config/sample/galaxy.yml.sample @@ -921,8 +921,13 @@ galaxy: # Enable InteractiveTools. #interactivetools_enable: false - # Proxy host - assumed to just be hosted on the same hostname and port - # as Galaxy by default. + # Set this to false to redirect users of Interacitve tools directly to + # the Interactive tools proxy. `interactivetools_upstream_proxy` + # should only be set to false in development. + #interactivetools_upstream_proxy: true + + # Hostname and port of Interactive tools proxy. It is assumed to be + # hosted on the same hostname and port as Galaxy by default. #interactivetools_proxy_host: null # Base path for interactive tools running at a subpath without a diff --git a/lib/galaxy/config/schemas/config_schema.yml b/lib/galaxy/config/schemas/config_schema.yml index 9a488e92337..3ffff2b93c3 100644 --- a/lib/galaxy/config/schemas/config_schema.yml +++ b/lib/galaxy/config/schemas/config_schema.yml @@ -1231,11 +1231,19 @@ mapping: desc: | Enable InteractiveTools. + interactivetools_upstream_proxy: + type: bool + default: true + required: false + desc: + Set this to false to redirect users of Interacitve tools directly to the Interactive tools proxy. + `interactivetools_upstream_proxy` should only be set to false in development. + interactivetools_proxy_host: type: str required: false desc: | - Proxy host - assumed to just be hosted on the same hostname and port as + Hostname and port of Interactive tools proxy. It is assumed to be hosted on the same hostname and port as Galaxy by default. interactivetools_base_path: diff --git a/lib/galaxy/managers/interactivetool.py b/lib/galaxy/managers/interactivetool.py index df3b83ab97c..47d15147e97 100644 --- a/lib/galaxy/managers/interactivetool.py +++ b/lib/galaxy/managers/interactivetool.py @@ -253,6 +253,8 @@ class InteractiveToolManager: def target_if_active(self, trans, entry_point): if entry_point.active and not entry_point.deleted: request_host = trans.request.host + if not self.app.config.interactivetools_upstream_proxy and self.app.config.interactivetools_proxy_host: + request_host = self.app.config.interactivetools_proxy_host protocol = trans.request.host_url.split('//', 1)[0] if entry_point.requires_domain: rval = f'{protocol}//{self.get_entry_point_subdomain(trans, entry_point)}.{request_host}/'