diff --git a/lib/galaxy/config/config_manage.py b/lib/galaxy/config/config_manage.py index aacfea0c046..f88eff40452 100644 --- a/lib/galaxy/config/config_manage.py +++ b/lib/galaxy/config/config_manage.py @@ -101,6 +101,12 @@ UWSGI_OPTIONS = OrderedDict([ 'default': '/favicon.ico=static/favicon.ico', 'type': 'str', }), + ('static-safe', { + 'key': 'static-safe', + 'desc': """Allow serving images out of `client`. Most modern Galaxy interfaces bundle all of this, but some older pages still serve these via symlink, requiring this rule.""", + 'default': 'client/galaxy/images', + '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/config/sample/galaxy.yml.sample b/lib/galaxy/config/sample/galaxy.yml.sample index eccf4c67895..9fa6e76623f 100644 --- a/lib/galaxy/config/sample/galaxy.yml.sample +++ b/lib/galaxy/config/sample/galaxy.yml.sample @@ -50,6 +50,11 @@ uwsgi: # Mapping to serve the favicon. static-map: /favicon.ico=static/favicon.ico + # Allow serving images out of `client`. Most modern Galaxy interfaces + # bundle all of this, but some older pages still serve these via + # symlink, requiring this rule. + static-safe: client/galaxy/images + # 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/config/sample/reports.yml.sample b/lib/galaxy/config/sample/reports.yml.sample index a0d21cbc3a0..b207fd53bd7 100644 --- a/lib/galaxy/config/sample/reports.yml.sample +++ b/lib/galaxy/config/sample/reports.yml.sample @@ -32,6 +32,11 @@ uwsgi: # Mapping to serve the favicon. static-map: /favicon.ico=static/favicon.ico + # Allow serving images out of `client`. Most modern Galaxy interfaces + # bundle all of this, but some older pages still serve these via + # symlink, requiring this rule. + static-safe: client/galaxy/images + # 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/config/sample/tool_shed.yml.sample b/lib/galaxy/config/sample/tool_shed.yml.sample index b8e5b169221..236e4b7430c 100644 --- a/lib/galaxy/config/sample/tool_shed.yml.sample +++ b/lib/galaxy/config/sample/tool_shed.yml.sample @@ -32,6 +32,11 @@ uwsgi: # Mapping to serve the favicon. static-map: /favicon.ico=static/favicon.ico + # Allow serving images out of `client`. Most modern Galaxy interfaces + # bundle all of this, but some older pages still serve these via + # symlink, requiring this rule. + static-safe: client/galaxy/images + # 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/config/script.py b/lib/galaxy/config/script.py index f8bcb54cd66..03cfc0cd22f 100644 --- a/lib/galaxy/config/script.py +++ b/lib/galaxy/config/script.py @@ -37,6 +37,7 @@ DEFAULT_DB_CONN = 'sqlite:///./database/universe.sqlite?isolation_level=IMMEDIAT SAMPLES_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), 'sample')) GALAXY_CONFIG_TEMPLATE_FILE = os.path.join(SAMPLES_PATH, 'galaxy.yml.sample') STATIC_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, 'web', 'framework', 'static')) +CLIENT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir, 'client')) MSG_CONFIG_SUMMARY = """ For help on configuring Galaxy, consult the documentation at: \n {} @@ -55,6 +56,7 @@ GALAXY_CONFIG_SUBSTITUTIONS = { ' static-map: /static/style=static/style/blue': ' static-map: /static=${static_path}/style/blue', ' static-map: /static=static': ' static-map: /static=${static_path}', ' static-map: /favicon.ico=static/favicon.ico': ' static-map: /static=${static_path}/favicon.ico', + ' static-safe: client/galaxy/images': ' ${client_path}/galaxy/images', ' virtualenv: .venv': ' #venv: .venv # not used when running installed', ' pythonpath: lib': ' #pythonpath: lib # not used when running installed', ' #config_dir: false': ' config_dir: ${config_dir}', @@ -147,6 +149,7 @@ def _handle_galaxy_yml(args, config_dir, data_dir): uwsgi_transport=uwsgi_transport, config_dir=config_dir, data_dir=data_dir, + client_dir=CLIENT_PATH, static_path=STATIC_PATH, database_connection=args.db_conn, )