From 420f43645af9b37c32eb126f89c4266f36f6edb0 Mon Sep 17 00:00:00 2001 From: Martin Cech Date: Wed, 19 Sep 2018 11:52:35 -0400 Subject: [PATCH 1/2] map the favicon in uwsgi config --- config/galaxy.yml.sample | 3 +++ config/reports.yml.sample | 3 +++ config/tool_shed.yml.sample | 3 +++ lib/galaxy/webapps/config_manage.py | 6 ++++++ lib/galaxy/webapps/uwsgi_schema.yml | 1 + scripts/get_uwsgi_args.py | 3 ++- 6 files changed, 18 insertions(+), 1 deletion(-) diff --git a/config/galaxy.yml.sample b/config/galaxy.yml.sample index 8830d718925..3fd8f62d22e 100644 --- a/config/galaxy.yml.sample +++ b/config/galaxy.yml.sample @@ -47,6 +47,9 @@ uwsgi: # Mapping to serve the remainder of the static content. static-map: /static=static + # Mapping to serve the favicon. + static-map: /favicon.ico=static/favicon.ico + # Enable the master process manager. Disabled by default for maximum # compatibility with CTRL+C, but should be enabled for use with # --daemon and/or production deployments. diff --git a/config/reports.yml.sample b/config/reports.yml.sample index 17c9c51664f..aa6fc445e21 100644 --- a/config/reports.yml.sample +++ b/config/reports.yml.sample @@ -29,6 +29,9 @@ uwsgi: # Mapping to serve the remainder of the static content. static-map: /static=static + # Mapping to serve the favicon. + static-map: /favicon.ico=static/favicon.ico + # Enable the master process manager. Disabled by default for maximum # compatibility with CTRL+C, but should be enabled for use with # --daemon and/or production deployments. diff --git a/config/tool_shed.yml.sample b/config/tool_shed.yml.sample index 303932bee96..ea86936c839 100644 --- a/config/tool_shed.yml.sample +++ b/config/tool_shed.yml.sample @@ -29,6 +29,9 @@ uwsgi: # Mapping to serve the remainder of the static content. static-map: /static=static + # Mapping to serve the favicon. + static-map: /favicon.ico=static/favicon.ico + # Enable the master process manager. Disabled by default for maximum # compatibility with CTRL+C, but should be enabled for use with # --daemon and/or production deployments. diff --git a/lib/galaxy/webapps/config_manage.py b/lib/galaxy/webapps/config_manage.py index b39a6d6b6d4..3bd5dbc3dbe 100644 --- a/lib/galaxy/webapps/config_manage.py +++ b/lib/galaxy/webapps/config_manage.py @@ -85,6 +85,12 @@ UWSGI_OPTIONS = OrderedDict([ 'default': '/static=static', 'type': 'str', }), + ('static-map.3', { + 'key': 'static-map', + 'desc': """Mapping to serve the favicon.""", + 'default': '/favicon.ico=static/favicon.ico', + 'type': 'str', + }), ('master', { 'desc': """Enable the master process manager. Disabled by default for maximum compatibility with CTRL+C, but should be enabled for use with --daemon and/or production deployments.""", 'default': False, diff --git a/lib/galaxy/webapps/uwsgi_schema.yml b/lib/galaxy/webapps/uwsgi_schema.yml index 303a0d08813..2100884fc3d 100644 --- a/lib/galaxy/webapps/uwsgi_schema.yml +++ b/lib/galaxy/webapps/uwsgi_schema.yml @@ -966,6 +966,7 @@ mapping: static-map: {desc: ' map mountpoint to static directory (or file)', type: any} static-map2: {desc: ' like static-map but completely appending the requested resource to the docroot', type: any} + static-map3: {desc: ' like static-map but only mapping favicon to bare root', type: any} static-skip-ext: {desc: ' skip specified extension from staticfile checks', type: any} static-index: {desc: ' search for specified file if a directory is requested', type: any} static-safe: {desc: ' skip security checks if the file is under the specified path', diff --git a/scripts/get_uwsgi_args.py b/scripts/get_uwsgi_args.py index a915741e41f..5768a406ea0 100644 --- a/scripts/get_uwsgi_args.py +++ b/scripts/get_uwsgi_args.py @@ -91,7 +91,8 @@ def _get_uwsgi_args(cliargs, kwargs): 'buffer-size': '16384', # https://github.com/galaxyproject/galaxy/issues/1530 'http': 'localhost:{port}'.format(port=DEFAULT_PORTS[cliargs.app]), 'static-map': ('/static/style={here}/static/style/blue'.format(here=os.getcwd()), - '/static={here}/static'.format(here=os.getcwd())), + '/static={here}/static'.format(here=os.getcwd()), + '/favicon.ico={here}/static/favicon.ico'.format(here=os.getcwd())), 'static-safe': ('{here}/config/plugins/visualizations'.format(here=os.getcwd()), '{here}/config/plugins/interactive_environments'.format(here=os.getcwd())), 'die-on-term': True, From 33eb06c9b872f75fd22e06297a2043f8685d1df2 Mon Sep 17 00:00:00 2001 From: Martin Cech Date: Wed, 19 Sep 2018 12:33:15 -0400 Subject: [PATCH 2/2] remove something that should have never been where it was look at me, I do not know what I am doing --- lib/galaxy/webapps/uwsgi_schema.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/galaxy/webapps/uwsgi_schema.yml b/lib/galaxy/webapps/uwsgi_schema.yml index 2100884fc3d..303a0d08813 100644 --- a/lib/galaxy/webapps/uwsgi_schema.yml +++ b/lib/galaxy/webapps/uwsgi_schema.yml @@ -966,7 +966,6 @@ mapping: static-map: {desc: ' map mountpoint to static directory (or file)', type: any} static-map2: {desc: ' like static-map but completely appending the requested resource to the docroot', type: any} - static-map3: {desc: ' like static-map but only mapping favicon to bare root', type: any} static-skip-ext: {desc: ' skip specified extension from staticfile checks', type: any} static-index: {desc: ' search for specified file if a directory is requested', type: any} static-safe: {desc: ' skip security checks if the file is under the specified path',