Skip to content

Commit

Permalink
Merge pull request galaxyproject#14965 from jmchilton/remove_no_longe…
Browse files Browse the repository at this point in the history
…r_useful_wsgi_middleware

Remove old WSGI middleware that is no longer useful.
  • Loading branch information
jmchilton authored Nov 10, 2022
2 parents b11c18e + 92a885e commit 1a2a534
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 149 deletions.
30 changes: 0 additions & 30 deletions doc/source/admin/reports_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,6 @@
:Type: str


~~~~~~~~~
``debug``
~~~~~~~~~

:Description:
Configuration for debugging middleware
:Default: ``false``
:Type: bool


~~~~~~~~~~~~
``use_lint``
~~~~~~~~~~~~

:Description:
Check for WSGI compliance.
:Default: ``false``
:Type: bool


~~~~~~~~~~~~~~~~~
``use_heartbeat``
~~~~~~~~~~~~~~~~~
Expand All @@ -84,16 +64,6 @@
:Type: bool


~~~~~~~~~~~~~~~
``use_profile``
~~~~~~~~~~~~~~~

:Description:
Profiling middleware (cProfile based)
:Default: ``true``
:Type: bool


~~~~~~~~~~~~~~~
``smtp_server``
~~~~~~~~~~~~~~~
Expand Down
6 changes: 4 additions & 2 deletions lib/galaxy/config/config_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,11 @@ def lint(self, args, app_desc, key, value) -> None:
"session_secret": _DeprecatedAndDroppedAction(),
"paste.app_factory": _PasteAppFactoryAction(),
"filter-with": _HandleFilterWithAction(),
"debug": _ProductionUnsafe(True),
"debug": _DeprecatedAndDroppedAction(),
"serve_xss_vulnerable_mimetypes": _ProductionUnsafe(True),
"use_printdebug": _ProductionUnsafe(True),
"use_printdebug": _DeprecatedAndDroppedAction(),
"use_lint": _DeprecatedAndDroppedAction(),
"use_profile": _DeprecatedAndDroppedAction(),
"id_secret": _ProductionUnsafe("USING THE DEFAULT IS NOT SECURE!"),
"master_api_key": _RenameAction("bootstrap_admin_api_key"),
"bootstrap_admin_api_key": _ProductionUnsafe("changethis"),
Expand Down
9 changes: 0 additions & 9 deletions lib/galaxy/config/sample/reports.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,10 @@ reports:
# directory is used for the cache
#template_cache_path: database/compiled_templates/reports

# Configuration for debugging middleware
#debug: false

# Check for WSGI compliance.
#use_lint: false

# Write thread status periodically to 'heartbeat.log' (careful, uses
# disk space rapidly!)
#use_heartbeat: true

# Profiling middleware (cProfile based)
#use_profile: true

# Mail
#smtp_server: yourserver@yourfacility.edu

Expand Down
12 changes: 0 additions & 12 deletions lib/galaxy/config/sample/tool_shed.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,6 @@ tool_shed:
# log your users out.
#remote_user_logout_href: null

# Configuration for debugging middleware
#debug: false

# Check for WSGI compliance.
#use_lint: false

# Intercept print statements and show them on the returned page.
#use_printdebug: true

# Administrative users - set this to a comma-separated list of valid
# Tool Shed users (email addresses). These users will have access to
# the Admin section of the server, and will have access to create
Expand Down Expand Up @@ -201,9 +192,6 @@ tool_shed:
# disk space rapidly!)
#use_heartbeat: true

# Profiling middleware (cProfile based)
#use_profile: true

# Enable creation of Galaxy flavor Docker Image
#enable_galaxy_flavor_docker_image: false

Expand Down
18 changes: 0 additions & 18 deletions lib/galaxy/config/schemas/reports_config_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,30 +42,12 @@ mapping:
Mako templates are compiled as needed and cached for reuse, this directory is
used for the cache
debug:
type: bool
default: false
desc: |
Configuration for debugging middleware
use_lint:
type: bool
default: false
desc: |
Check for WSGI compliance.
use_heartbeat:
type: bool
default: true
desc: |
Write thread status periodically to 'heartbeat.log' (careful, uses disk space rapidly!)
use_profile:
type: bool
default: true
desc: |
Profiling middleware (cProfile based)
smtp_server:
type: str
default: yourserver@yourfacility.edu
Expand Down
28 changes: 0 additions & 28 deletions lib/galaxy/config/schemas/tool_shed_config_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,27 +259,6 @@ mapping:
If use_remote_user is enabled, you can set this to a URL that will log your
users out.
debug:
type: bool
default: false
required: false
desc: |
Configuration for debugging middleware
use_lint:
type: bool
default: false
required: false
desc: |
Check for WSGI compliance.
use_printdebug:
type: bool
default: true
required: false
desc: |
Intercept print statements and show them on the returned page.
admin_users:
type: str
required: false
Expand Down Expand Up @@ -371,13 +350,6 @@ mapping:
Write thread status periodically to 'heartbeat.log' (careful, uses disk
space rapidly!)
use_profile:
type: bool
default: true
required: false
desc: |
Profiling middleware (cProfile based)
enable_galaxy_flavor_docker_image:
type: bool
default: false
Expand Down
15 changes: 0 additions & 15 deletions lib/galaxy/webapps/galaxy/buildapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,6 @@ def wrap_in_middleware(app, global_conf, application_stack, **local_conf):
# Merge the global and local configurations
conf = global_conf.copy()
conf.update(local_conf)
debug = asbool(conf.get("debug", False))
# First put into place httpexceptions, which must be most closely
# wrapped around the application (it can interact poorly with
# other middleware):
Expand Down Expand Up @@ -1325,20 +1324,6 @@ def wrap_in_middleware(app, global_conf, application_stack, **local_conf):
from sentry_sdk.integrations.wsgi import SentryWsgiMiddleware

app = wrap_if_allowed(app, stack, SentryWsgiMiddleware)
# Various debug middleware that can only be turned on if the debug
# flag is set, either because they are insecure or greatly hurt
# performance
if debug:
# Middleware to check for WSGI compliance
if asbool(conf.get("use_lint", False)):
from paste import lint

app = wrap_if_allowed(app, stack, lint.make_middleware, name="paste.lint", args=(conf,))
# Middleware to run the python profiler on each request
if asbool(conf.get("use_profile", False)):
from paste.debug import profile

app = wrap_if_allowed(app, stack, profile.ProfileMiddleware, args=(conf,))
# Error middleware
app = wrap_if_allowed(app, stack, ErrorMiddleware, args=(conf,))
# Transaction logging (apache access.log style)
Expand Down
22 changes: 1 addition & 21 deletions lib/galaxy/webapps/reports/buildapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ def wrap_in_middleware(app, global_conf, application_stack, **local_conf):
# Merge the global and local configurations
conf = global_conf.copy()
conf.update(local_conf)
debug = asbool(conf.get("debug", False))
# First put into place httpexceptions, which must be most closely
# wrapped around the application (it can interact poorly with
# other middleware):
Expand All @@ -90,26 +89,7 @@ def wrap_in_middleware(app, global_conf, application_stack, **local_conf):
from paste import recursive

app = wrap_if_allowed(app, stack, recursive.RecursiveMiddleware, args=(conf,))
# Various debug middleware that can only be turned on if the debug
# flag is set, either because they are insecure or greatly hurt
# performance
if debug:
# Middleware to check for WSGI compliance
if asbool(conf.get("use_lint", True)):
from paste import lint

app = wrap_if_allowed(app, stack, lint.make_middleware, name="paste.lint", args=(conf,))
# Middleware to run the python profiler on each request
if asbool(conf.get("use_profile", False)):
import profile

app = wrap_if_allowed(app, stack, profile.ProfileMiddleware, args=(conf,))
# Middleware that intercepts print statements and shows them on the
# returned page
if asbool(conf.get("use_printdebug", True)):
from paste.debug import prints

app = wrap_if_allowed(app, stack, prints.PrintDebugMiddleware, args=(conf,))

# Error middleware
import galaxy.web.framework.middleware.error

Expand Down
14 changes: 0 additions & 14 deletions lib/tool_shed/webapp/buildapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ def wrap_in_middleware(app, global_conf, application_stack, **local_conf):
# Merge the global and local configurations
conf = global_conf.copy()
conf.update(local_conf)
debug = asbool(conf.get("debug", False))
# First put into place httpexceptions, which must be most closely
# wrapped around the application (it can interact poorly with
# other middleware):
Expand Down Expand Up @@ -280,20 +279,7 @@ def wrap_in_middleware(app, global_conf, application_stack, **local_conf):
from galaxy.web.framework.middleware.xforwardedhost import XForwardedHostMiddleware

app = wrap_if_allowed(app, stack, XForwardedHostMiddleware)
# Various debug middleware that can only be turned on if the debug
# flag is set, either because they are insecure or greatly hurt
# performance.
if debug:
# Middleware to check for WSGI compliance
if asbool(conf.get("use_lint", True)):
from paste import lint

app = wrap_if_allowed(app, stack, lint.make_middleware, name="paste.lint", args=(conf,))
# Middleware to run the python profiler on each request
if asbool(conf.get("use_profile", False)):
from paste.debug import profile

app = wrap_if_allowed(app, stack, profile.ProfileMiddleware, args=(conf,))
# Error middleware
import galaxy.web.framework.middleware.error

Expand Down

0 comments on commit 1a2a534

Please sign in to comment.