From 6a7cc34e1b1ade9580e464570fc6b83a488e941f Mon Sep 17 00:00:00 2001 From: John Chilton Date: Mon, 22 Aug 2016 14:14:24 -0400 Subject: [PATCH 01/15] Bring Galaxy, reports, and shed run scripts in sync. - They now uniformly handle server option processing. - Reports and Tool Shed now respect many new and important options such as --skip_venv. - Reports and Tool Shed now do extra checking around Python version that Galaxy does. In addition to improving the reports and tool shed startup scripts and reducing cognative load with respect to option handling, this is an important pre-condition to us being able us to switch on uwsgi by default for all three services simultaneously without a bunch of copy and pasting. --- run.sh | 67 ++--------------------- run_reports.sh | 26 +++++---- run_tool_shed.sh | 24 +++------ scripts/common_startup_functions.sh | 84 +++++++++++++++++++++++++++++ 4 files changed, 109 insertions(+), 92 deletions(-) create mode 100644 scripts/common_startup_functions.sh diff --git a/run.sh b/run.sh index 6ad132d46d4..8c16c27fe64 100755 --- a/run.sh +++ b/run.sh @@ -2,6 +2,8 @@ cd "$(dirname "$0")" +. ./scripts/common_startup_functions.sh + # If there is a file that defines a shell environment specific to this # instance of Galaxy, source the file. if [ -z "$GALAXY_LOCAL_ENV_FILE" ]; @@ -14,72 +16,13 @@ then . $GALAXY_LOCAL_ENV_FILE fi -INITIALIZE_TOOL_DEPENDENCIES=1 # Install Conda if needed. -# Pop args meant for common_startup.sh -while : -do - case "$1" in - --skip-eggs|--skip-wheels|--skip-samples|--dev-wheels|--no-create-venv|--no-replace-pip|--replace-pip) - common_startup_args="$common_startup_args $1" - shift - ;; - --skip-tool-dependency-initialization) - INITIALIZE_TOOL_DEPENDENCIES=0 - shift - ;; - --skip-venv) - skip_venv=1 - common_startup_args="$common_startup_args $1" - shift - ;; - --stop-daemon) - common_startup_args="$common_startup_args $1" - paster_args="$paster_args $1" - stop_daemon_arg_set=1 - shift - ;; - --daemon|--restart|restart) - if [ "$1" = "--restart" ] - then - paster_args="$paster_args restart" - else - paster_args="$paster_args $1" - fi - - daemon_or_restart_arg_set=1 - shift - ;; - --wait) - wait_arg_set=1 - shift - ;; - "") - break - ;; - *) - paster_args="$paster_args $1" - shift - ;; - esac -done - ./scripts/common_startup.sh $common_startup_args || exit 1 -# If there is a .venv/ directory, assume it contains a virtualenv that we -# should run this instance in. -GALAXY_VIRTUAL_ENV="${GALAXY_VIRTUAL_ENV:-.venv}" -if [ -d "$GALAXY_VIRTUAL_ENV" -a -z "$skip_venv" ]; -then - [ -n "$PYTHONPATH" ] && { echo 'Unsetting $PYTHONPATH'; unset PYTHONPATH; } - echo "Activating virtualenv at $GALAXY_VIRTUAL_ENV" - . "$GALAXY_VIRTUAL_ENV/bin/activate" -fi +parse_common_args $@ -# If you are using --skip-venv we assume you know what you are doing but warn -# in case you don't. -[ -n "$PYTHONPATH" ] && echo 'WARNING: $PYTHONPATH is set, this can cause problems importing Galaxy dependencies' +run_common_start_up -python ./scripts/check_python.py || exit 1 +setup_python if [ ! -z "$GALAXY_RUN_WITH_TEST_TOOLS" ]; then diff --git a/run_reports.sh b/run_reports.sh index eb2de06ad97..ba50baa72ee 100755 --- a/run_reports.sh +++ b/run_reports.sh @@ -9,17 +9,22 @@ # argument to this will cause Galaxy's database and path parameters # from galaxy.ini to be copied over into reports.ini. -cd `dirname $0` +cd "$(dirname "$0")" -./scripts/common_startup.sh --skip-samples +. ./scripts/common_startup_functions.sh -: ${GALAXY_VIRTUAL_ENV:=.venv} - -if [ -d "$GALAXY_VIRTUAL_ENV" ]; +if [ "$1" = "--sync-config" ]; then - . "$GALAXY_VIRTUAL_ENV/bin/activate" + python ./scripts/sync_reports_config.py + shift fi +parse_common_args $@ + +run_common_start_up + +setup_python + if [ -z "$GALAXY_REPORTS_CONFIG" ]; then if [ -f reports_wsgi.ini ]; then GALAXY_REPORTS_CONFIG=reports_wsgi.ini @@ -40,11 +45,4 @@ if [ -n "$GALAXY_REPORTS_CONFIG_DIR" ]; then python ./scripts/build_universe_config.py "$GALAXY_REPORTS_CONFIG_DIR" "$GALAXY_REPORTS_CONFIG" fi - -if [ "$1" = "--sync-config" ]; -then - python ./scripts/sync_reports_config.py - shift -fi - -python ./scripts/paster.py serve "$GALAXY_REPORTS_CONFIG" --pid-file="$GALAXY_REPORTS_PID" --log-file="$GALAXY_REPORTS_LOG" $@ +python ./scripts/paster.py serve "$GALAXY_REPORTS_CONFIG" --pid-file="$GALAXY_REPORTS_PID" --log-file="$GALAXY_REPORTS_LOG" $paster_args diff --git a/run_tool_shed.sh b/run_tool_shed.sh index a69e08d8f78..099587b50a2 100755 --- a/run_tool_shed.sh +++ b/run_tool_shed.sh @@ -1,29 +1,21 @@ #!/bin/sh -cd `dirname $0` +cd "$(dirname "$0")" -: ${GALAXY_VIRTUAL_ENV:=.venv} +. ./scripts/common_startup_functions.sh -if [ -d "$GALAXY_VIRTUAL_ENV" ]; -then - . "$GALAXY_VIRTUAL_ENV/bin/activate" -fi +parse_common_args $@ -./scripts/common_startup.sh +run_common_start_up -: ${GALAXY_VIRTUAL_ENV:=.venv} - -if [ -d "$GALAXY_VIRTUAL_ENV" ]; -then - . "$GALAXY_VIRTUAL_ENV/bin/activate" -fi +setup_python -tool_shed=`./scripts/tool_shed/bootstrap_tool_shed/parse_run_sh_args.sh $@` -args=$@ +tool_shed=`./scripts/tool_shed/bootstrap_tool_shed/parse_run_sh_args.sh $parser_args` +args=$parser_args if [ $? -eq 0 ] ; then - bash ./scripts/tool_shed/bootstrap_tool_shed/bootstrap_tool_shed.sh $@ + bash ./scripts/tool_shed/bootstrap_tool_shed/bootstrap_tool_shed.sh $parser_args args=`echo $@ | sed "s#-\?-bootstrap_from_tool_shed $tool_shed##"` fi diff --git a/scripts/common_startup_functions.sh b/scripts/common_startup_functions.sh new file mode 100644 index 00000000000..767a6a26203 --- /dev/null +++ b/scripts/common_startup_functions.sh @@ -0,0 +1,84 @@ +#!/bin/sh + +parse_common_args() { + INITIALIZE_TOOL_DEPENDENCIES=1 + # Pop args meant for common_startup.sh + while : + do + case "$1" in + --skip-eggs|--skip-wheels|--skip-samples|--dev-wheels|--no-create-venv|--no-replace-pip|--replace-pip) + common_startup_args="$common_startup_args $1" + shift + ;; + --skip-tool-dependency-initialization) + INITIALIZE_TOOL_DEPENDENCIES=0 + shift + ;; + --skip-venv) + skip_venv=1 + common_startup_args="$common_startup_args $1" + shift + ;; + --stop-daemon) + common_startup_args="$common_startup_args $1" + paster_args="$paster_args $1" + uwsgi_args="$uwsgi_args --stop $PID_FILE" + stop_daemon_arg_set=1 + shift + ;; + --restart|restart) + if [ "$1" = "--restart" ] + then + paster_args="$paster_args restart" + else + paster_args="$paster_args $1" + fi + uwsgi_args="$uwsgi_args --reload $PID_FILE" + daemon_or_restart_arg_set=1 + shift + ;; + --daemon) + paster_args="$paster_args $1" + # --daemonize2 waits until after the application has loaded + # to daemonize, thus it stops if any errors are found + uwsgi_args="$uwsgi_args --daemonize2 $LOG_FILE --safe-pidfile $PID_FILE" + daemon_or_restart_arg_set=1 + shift + ;; + --wait) + wait_arg_set=1 + shift + ;; + "") + break + ;; + *) + paster_args="$paster_args $1" + uwsgi_args="$uwsgi_args $1" + shift + ;; + esac + done +} + +run_common_start_up() { + ./scripts/common_startup.sh $common_startup_args || exit 1 +} + +setup_python() { + # If there is a .venv/ directory, assume it contains a virtualenv that we + # should run this instance in. + GALAXY_VIRTUAL_ENV="${GALAXY_VIRTUAL_ENV:-.venv}" + if [ -d "$GALAXY_VIRTUAL_ENV" -a -z "$skip_venv" ]; + then + [ -n "$PYTHONPATH" ] && { echo 'Unsetting $PYTHONPATH'; unset PYTHONPATH; } + echo "Activating virtualenv at $GALAXY_VIRTUAL_ENV" + . "$GALAXY_VIRTUAL_ENV/bin/activate" + fi + + # If you are using --skip-venv we assume you know what you are doing but warn + # in case you don't. + [ -n "$PYTHONPATH" ] && echo 'WARNING: $PYTHONPATH is set, this can cause problems importing Galaxy dependencies' + + python ./scripts/check_python.py || exit 1 +} From 72e5a00ba0ad9c1a8e56ad9544bec23c843d900d Mon Sep 17 00:00:00 2001 From: John Chilton Date: Mon, 22 Aug 2016 23:42:42 -0400 Subject: [PATCH 02/15] Centralize launching server for reports and tool shed. Initial outline of allowing launch via uwsgi. --- run_reports.sh | 11 ++++--- run_tool_shed.sh | 9 +++++- scripts/common_startup_functions.sh | 45 +++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 5 deletions(-) diff --git a/run_reports.sh b/run_reports.sh index ba50baa72ee..6845d6add8c 100755 --- a/run_reports.sh +++ b/run_reports.sh @@ -11,6 +11,11 @@ cd "$(dirname "$0")" +GALAXY_REPORTS_PID=${GALAXY_REPORTS_PID:-reports_webapp.pid} +GALAXY_REPORTS_LOG=${GALAXY_REPORTS_LOG:-reports_webapp.log} +PID_FILE=$GALAXY_REPORTS_PID +LOG_FILE=$GALAXY_REPORTS_LOG + . ./scripts/common_startup_functions.sh if [ "$1" = "--sync-config" ]; @@ -38,11 +43,9 @@ if [ -z "$GALAXY_REPORTS_CONFIG" ]; then export GALAXY_REPORTS_CONFIG fi -GALAXY_REPORTS_PID=${GALAXY_REPORTS_PID:-reports_webapp.pid} -GALAXY_REPORTS_LOG=${GALAXY_REPORTS_LOG:-reports_webapp.log} - if [ -n "$GALAXY_REPORTS_CONFIG_DIR" ]; then python ./scripts/build_universe_config.py "$GALAXY_REPORTS_CONFIG_DIR" "$GALAXY_REPORTS_CONFIG" fi -python ./scripts/paster.py serve "$GALAXY_REPORTS_CONFIG" --pid-file="$GALAXY_REPORTS_PID" --log-file="$GALAXY_REPORTS_LOG" $paster_args +find_server $GALAXY_REPORTS_CONFIG +$run_server $server_args diff --git a/run_tool_shed.sh b/run_tool_shed.sh index 099587b50a2..992e2b90e85 100755 --- a/run_tool_shed.sh +++ b/run_tool_shed.sh @@ -2,6 +2,12 @@ cd "$(dirname "$0")" + +TOOL_SHED_PID=${TOOL_SHED_PID:-tool_shed_webapp.pid} +TOOL_SHED_LOG=${TOOL_SHED_LOG:-tool_shed_webapp.log} +PID_FILE=$TOOL_SHED_PID +LOG_FILE=$TOOL_SHED_LOG + . ./scripts/common_startup_functions.sh parse_common_args $@ @@ -30,4 +36,5 @@ if [ -z "$TOOL_SHED_CONFIG_FILE" ]; then export TOOL_SHED_CONFIG_FILE fi -python ./scripts/paster.py serve $TOOL_SHED_CONFIG_FILE --pid-file=tool_shed_webapp.pid --log-file=tool_shed_webapp.log $args +find_server $TOOL_SHED_CONFIG_FILE +$run_server $server_args diff --git a/scripts/common_startup_functions.sh b/scripts/common_startup_functions.sh index 767a6a26203..8deed854db5 100644 --- a/scripts/common_startup_functions.sh +++ b/scripts/common_startup_functions.sh @@ -1,5 +1,7 @@ #!/bin/sh +uwsgi_args="--master --pythonpath=lib" + parse_common_args() { INITIALIZE_TOOL_DEPENDENCIES=1 # Pop args meant for common_startup.sh @@ -82,3 +84,46 @@ setup_python() { python ./scripts/check_python.py || exit 1 } + +find_uwsgi() { + # Look for uwsgi + if [ -z "$skip_venv" -a -x $GALAXY_VIRTUAL_ENV/bin/uwsgi ]; then + UWSGI=$GALAXY_VIRTUAL_ENV/bin/uwsgi + elif command -v uwsgi >/dev/null 2>&1; then + UWSGI=uwsgi + else + echo 'ERROR: Could not find uwsgi executable' + exit 1 + fi +} + +find_server() { + server_config="$1" + server_config_style="ini-paste" + default_webserver="paste" + case "$server_config" in + *.y*ml*) + server_config_style="yaml" + default_webserver="uwsgi" # paste incapable of this + ;; + esac + + APP_WEBSERVER=${APP_WEBSERVER:-$default_webserver} + if [ "$APP_WEBSERVER" = "uwsgi" ]; + then + # Look for uwsgi + if [ -z "$skip_venv" -a -x $GALAXY_VIRTUAL_ENV/bin/uwsgi ]; then + UWSGI=$GALAXY_VIRTUAL_ENV/bin/uwsgi + elif command -v uwsgi >/dev/null 2>&1; then + UWSGI=uwsgi + else + echo 'ERROR: Could not find uwsgi executable' + exit 1 + fi + run_server="$UWSGI" + server_args="--$server_config_style $server_config $uwsgi_args" + else + run_server="python" + server_args="./scripts/paster.py serve $server_config $paster_args --pid-file $PID_FILE --log-file $LOG_FILE $paster_args" + fi +} From 1bdb99bbd76d0827cd3a7e617d288564584863ea Mon Sep 17 00:00:00 2001 From: John Chilton Date: Thu, 25 Aug 2016 17:13:57 -0400 Subject: [PATCH 03/15] Update galaxy.util.properties to allow YAML. --- lib/galaxy/dependencies/__init__.py | 2 +- lib/galaxy/util/properties.py | 44 ++++++++++++++++++------ lib/galaxy/web/framework/webapp.py | 22 ++++++++++++ lib/galaxy/webapps/tool_shed/buildapp.py | 4 +++ scripts/manage_tools.py | 2 +- 5 files changed, 61 insertions(+), 13 deletions(-) diff --git a/lib/galaxy/dependencies/__init__.py b/lib/galaxy/dependencies/__init__.py index 5d950c3fa16..e7a5869eb16 100644 --- a/lib/galaxy/dependencies/__init__.py +++ b/lib/galaxy/dependencies/__init__.py @@ -22,7 +22,7 @@ class ConditionalDependencies( object ): self.get_conditional_requirements() def parse_configs( self ): - self.config = load_app_properties( ini_file=self.config_file ) + self.config = load_app_properties( config_file=self.config_file ) job_conf_xml = self.config.get( "job_config_file", join( dirname( self.config_file ), 'job_conf.xml' ) ) diff --git a/lib/galaxy/util/properties.py b/lib/galaxy/util/properties.py index b5743dc0ef2..26ba8489108 100644 --- a/lib/galaxy/util/properties.py +++ b/lib/galaxy/util/properties.py @@ -6,6 +6,8 @@ import os import os.path import sys +import yaml + from six import iteritems from six.moves.configparser import ConfigParser @@ -35,21 +37,29 @@ def find_config_file(default, old_default, explicit, cwd=None): def load_app_properties( kwds={}, ini_file=None, - ini_section="app:main", + ini_section=None, + config_file=None, + config_section=None, config_prefix="GALAXY_CONFIG_" ): properties = kwds.copy() if kwds else {} - if ini_file: - defaults = { - 'here': os.path.dirname(os.path.abspath(ini_file)), - '__file__': os.path.abspath(ini_file) - } - parser = NicerConfigParser(ini_file, defaults=defaults) - parser.optionxform = str # Don't lower-case keys - with open(ini_file) as f: - parser.read_file(f) + if config_file is None: + config_file = ini_file + config_section = ini_section - properties.update( dict( parser.items( ini_section ) ) ) + if config_file: + if not config_file.endswith(".yml") and not config_file.endswith(".yml.sample"): + if config_section is None: + config_section = "app:main" + parser = nice_config_parser(config_file) + properties.update( dict( parser.items( config_section ) ) ) + else: + if config_section is None: + config_section = "galaxy" + + with open(config_file, "r") as f: + raw_properties = yaml.load(f) + properties = raw_properties[config_section] or {} override_prefix = "%sOVERRIDE_" % config_prefix for key in os.environ: @@ -64,6 +74,18 @@ def load_app_properties( return properties +def nice_config_parser(path): + defaults = { + 'here': os.path.dirname(os.path.abspath(path)), + '__file__': os.path.abspath(path) + } + parser = NicerConfigParser(path, defaults=defaults) + parser.optionxform = str # Don't lower-case keys + with open(path) as f: + parser.read_file(f) + return parser + + class NicerConfigParser(ConfigParser): def __init__(self, filename, *args, **kw): diff --git a/lib/galaxy/web/framework/webapp.py b/lib/galaxy/web/framework/webapp.py index 6e13934c0e6..28bb34ab485 100644 --- a/lib/galaxy/web/framework/webapp.py +++ b/lib/galaxy/web/framework/webapp.py @@ -27,6 +27,7 @@ from galaxy.exceptions import MessageException from galaxy import util from galaxy.util import asbool from galaxy.util import safe_str_cmp +from galaxy.util.postfork import process_is_uwsgi from galaxy.util.sanitize_html import sanitize_html from galaxy.managers import context @@ -954,6 +955,27 @@ class GalaxyWebTransaction( base.DefaultWebTransaction, return str(template) +def build_native_uwsgi_app( paste_factory, config_section ): + """uwsgi can load paste factories with --ini-paste, but this builds non-paste uwsgi apps. + + In particular these are useful with --yaml or --json for config.""" + if not process_is_uwsgi: + return None + else: + import uwsgi + uwsgi_opt = uwsgi.opt + config_file = uwsgi_opt.get("yaml") or uwsgi_opt.get("json") + if not config_file: + # Probably loaded via --ini-paste - expect paste app. + return None + + uwsgi_app = paste_factory(uwsgi.opt, load_app_kwds={ + "config_file": config_file, + "config_section": config_section, + }) + return uwsgi_app + + def build_url_map( app, global_conf, local_conf ): from paste.urlmap import URLMap from galaxy.web.framework.middleware.static import CacheableStaticURLParser as Static diff --git a/lib/galaxy/webapps/tool_shed/buildapp.py b/lib/galaxy/webapps/tool_shed/buildapp.py index 7090bc4c066..03e71335ad5 100644 --- a/lib/galaxy/webapps/tool_shed/buildapp.py +++ b/lib/galaxy/webapps/tool_shed/buildapp.py @@ -309,3 +309,7 @@ def _map_redirects( mapper ): mapper.redirect( "/repository/status_for_installed_repository", "/api/repositories/updates/", _redirect_code="301 Moved Permanently", conditions=dict( function=forward_qs ) ) return mapper + + +def uwsgi_app(): + return galaxy.web.framework.webapp.build_native_uwsgi_app( app_factory, "tool_shed" ) diff --git a/scripts/manage_tools.py b/scripts/manage_tools.py index 5d17e41347f..66d13f80da9 100644 --- a/scripts/manage_tools.py +++ b/scripts/manage_tools.py @@ -18,7 +18,7 @@ if not os.path.exists( config_file ): sys.exit( 1 ) repo = 'lib/tool_shed/galaxy_install/migrate' -properties = load_app_properties( ini_file=config_file ) +properties = load_app_properties( config_file=config_file ) cp = SafeConfigParser() cp.read( config_file ) From 8189a1f1e289e14d362fcb8871b9339c3355e8b2 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Fri, 26 Aug 2016 10:06:15 -0400 Subject: [PATCH 04/15] Scripts to manage configuration infrastructure. This has been rebased several times and includes a variety of fixes (some thanks to martenson). --- lib/galaxy/webapps/config_manage.py | 710 ++++++++++ scripts/config_sample_to_kwalify.py | 71 + .../1607_root_filters/config/galaxy.ini | 1240 +++++++++++++++++ .../1607_root_filters/config/tool_shed.ini | 188 +++ .../1607_root_samples/config/galaxy.ini | 1240 +++++++++++++++++ .../1607_root_samples/config/reports.ini | 94 ++ .../1607_root_samples/config/tool_shed.ini | 181 +++ test/unit/config/test_config_manage.py | 131 ++ 8 files changed, 3855 insertions(+) create mode 100644 lib/galaxy/webapps/config_manage.py create mode 100644 scripts/config_sample_to_kwalify.py create mode 100644 test/unit/config/1607_root_filters/config/galaxy.ini create mode 100644 test/unit/config/1607_root_filters/config/tool_shed.ini create mode 100644 test/unit/config/1607_root_samples/config/galaxy.ini create mode 100644 test/unit/config/1607_root_samples/config/reports.ini create mode 100644 test/unit/config/1607_root_samples/config/tool_shed.ini create mode 100644 test/unit/config/test_config_manage.py diff --git a/lib/galaxy/webapps/config_manage.py b/lib/galaxy/webapps/config_manage.py new file mode 100644 index 00000000000..83ade1c1075 --- /dev/null +++ b/lib/galaxy/webapps/config_manage.py @@ -0,0 +1,710 @@ +from __future__ import absolute_import +from __future__ import print_function + +import argparse +from collections import namedtuple +from collections import OrderedDict +import copy +import os +import shutil +import string +import sys +import tempfile +from textwrap import TextWrapper +import urllib2 + +import six +from six import StringIO + +import yaml + +try: + from pykwalify.core import Core +except ImportError: + Core = None + +if __name__ == '__main__': + sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))) + +from galaxy.util.properties import nice_config_parser +from galaxy.util import safe_makedirs + +DESCRIPTION = "Convert configuration files." + +APP_DESCRIPTION = """Application to target for operation (i.e. galaxy, tool_shed, or reports))""" +DRY_RUN_DESCRIPTION = """If this action modifies files, just print what would be the result and continue.""" +UNKNOWN_OPTION_MESSAGE = "Option [%s] not found in schema - either it is invalid or the Galaxy team hasn't documented it. If invalid, you should manually remove it. If the option is valid but undocumented, please file an issue with the Galaxy team." +USING_SAMPLE_MESSAGE = "Path [%s] not a file, using sample." +EXTRA_SERVER_MESSAGE = "Additional server section after [%s] encountered [%s], will be ignored." +MISSING_FILTER_TYPE_MESSAGE = "Missing filter type for section [%s], it will be ignored." +UNHANDLED_FILTER_TYPE_MESSAGE = "Unhandled filter type encountered [%s] for section [%s]." +NO_APP_MAIN_MESSAGE = "No app:main section found, using application defaults throughout." +YAML_COMMENT_WRAPPER = TextWrapper(initial_indent="# ", subsequent_indent="# ") +RST_DESCRIPTION_WRAPPER = TextWrapper(initial_indent=" ", subsequent_indent=" ") +UWSGI_SCHEMA_PATH = "lib/galaxy/webapps/uwsgi_schema.yml" + +App = namedtuple( + "App", + ["config_paths", "default_port", "expected_app_factories", "destination", "schema_path", "uwsgi_module"] +) + +UWSGI_OPTIONS = OrderedDict([ + ('http', { + 'desc': """The address and port on which to listen. By default, only listen to localhost ($app_name will not be accessible over the network). Use '0.0.0.0' to listen on all available network interfaces.""", + 'default': '127.0.0.1:$default_port', + 'type': 'str', + }), + ('threads', { + 'default': 8, + 'type': 'int', + }), + # ('route-uri', { + # 'default': '^/proxy/ goto:proxy' + # }), + # ('route', { + # 'default': '.* last:' + # }), + # ('route-label', { + # 'default': 'proxy' + # }), + # ('route-run', { + # 'default': 'rpcvar:TARGET_HOST galaxy_dynamic_proxy_mapper ${HTTP_HOST} ${cookie[galaxysession]}' + # }), + # ('route-run', { + # 'default': "['log:Proxy ${HTTP_HOST} to ${TARGET_HOST}', 'httpdumb:${TARGET_HOST}']", + # }), + ('http-raw-body', { + 'default': 'True' + }), + ('offload-threads', { + 'default': '8', + }), + ('module', { + 'default': '$uwsgi_module', + 'type': 'str', + }) +]) + +DROP_OPTION_VALUE = object() + + +class _OptionAction(object): + + def converted(self, args, app_desc, key, value): + pass + + def lint(self, args, app_desc, key, value): + pass + + +class _DeprecatedAndDroppedAction(_OptionAction): + + def converted(self, args, app_desc, key, value): + print("Option [%s] has been deprecated and dropped. It is not included in converted configuration." % key) + return DROP_OPTION_VALUE + + def lint(self, args, app_desc, key, value): + print("Option [%s] has been deprecated. Option should be dropped without replacement." % key) + + +class _PasteAppFactoryAction(_OptionAction): + + def converted(self, args, app_desc, key, value): + if value not in app_desc.expected_app_factories: + raise Exception("Ending convert process - unknown paste factory encountered [%s]" % value) + return DROP_OPTION_VALUE + + def lint(self, args, app_desc, key, value): + if value not in app_desc.expected_app_factories: + print("Problem - unknown paste app factory encountered [%s]" % value) + + +class _ProductionNotReady(_OptionAction): + + def __init__(self, unsafe_value): + self.unsafe_value = unsafe_value + + def lint(self, args, app_desc, key, value): + if str(value).lower() == str(self.unsafe_value).lower(): + template = "Problem - option [%s] should not be set to [%s] in production environments - it is unsafe." + message = template % (key, value) + print(message) + + +class _HandleFilterWithAction(_OptionAction): + + def converted(self, args, app_desc, key, value): + print("filter-with converted to prefixed module load of uwsgi module, dropping from converted configuration") + return DROP_OPTION_VALUE + + +OPTION_ACTIONS = { + 'use_beaker_session': _DeprecatedAndDroppedAction(), + 'session_type': _DeprecatedAndDroppedAction(), + 'session_data_dir': _DeprecatedAndDroppedAction(), + 'session_key': _DeprecatedAndDroppedAction(), + 'session_secret': _DeprecatedAndDroppedAction(), + 'paste.app_factory': _PasteAppFactoryAction(), + 'filter-with': _HandleFilterWithAction(), + 'debug': _ProductionNotReady(True), + 'serve_xss_vulnerable_mimetypes': _ProductionNotReady(True), + 'use_printdebug': _ProductionNotReady(True), + 'use_interactive': _ProductionNotReady(True), + 'id_secret': _ProductionNotReady('USING THE DEFAULT IS NOT SECURE!'), + 'master_api_key': _ProductionNotReady('changethis'), +} + + +def _app_name(self): + return os.path.splitext(os.path.basename(self.destination))[0] + + +def _sample_destination(self): + return self.destination + ".sample" + + +def _schema(self): + return AppSchema(self) + + +App.app_name = property(_app_name) +App.sample_destination = property(_sample_destination) +App.schema = property(_schema) + +OptionValue = namedtuple("OptionValue", ["name", "value", "option"] ) + + +UNKNOWN_OPTION = { + "type": "str", + "required": False, + "unknown_option": True, + "desc": "Unknown option, may want to remove or report to Galaxy team." +} + +OPTION_DEFAULTS = { + "type": "str", + "unknown_option": False, + "default": None, + "desc": None, +} + + +class Schema(object): + + def __init__(self, mapping): + self.app_schema = mapping + + def get_app_option(self, name): + try: + raw_option = self.app_schema[name] + except KeyError: + raw_option = UNKNOWN_OPTION + option = OPTION_DEFAULTS.copy() + option.update(raw_option) + return option + + +class AppSchema(Schema): + + def __init__(self, app_desc): + schema_path = app_desc.schema_path + app_name = app_desc.app_name + with open(schema_path, "r") as f: + config_all = _ordered_load(f) + self.raw_schema = config_all + app_schema = config_all["mapping"][app_name] + super(AppSchema, self).__init__(app_schema["mapping"]) + + def get_app_option(self, name): + try: + raw_option = self.app_schema[name] + except KeyError: + raw_option = UNKNOWN_OPTION + option = OPTION_DEFAULTS.copy() + option.update(raw_option) + return option + + +GALAXY_APP = App( + ["universe_wsgi.ini", "config/galaxy.ini"], + "8080", + ["galaxy.web.buildapp:app_factory"], # TODO: Galaxy could call factory a few different things and they'd all be fine. + "config/galaxy.yml", + "lib/galaxy/webapps/galaxy/config_schema.yml", + 'galaxy.webapps.galaxy.buildapp:uwsgi_app()', +) +SHED_APP = App( + ["tool_shed_wsgi.ini", "config/tool_shed.ini"], + "9009", + ["galaxy.webapps.tool_shed.buildapp:app_factory"], + "config/tool_shed.yml", + "lib/galaxy/webapps/tool_shed/config_schema.yml", + 'galaxy.webapps.tool_shed.buildapp:uwsgi_app()', +) +REPORTS_APP = App( + ["reports_wsgi.ini", "config/reports.ini"], + "9001", + ["galaxy.webapps.reports.buildapp:app_factory"], + "config/reports.yml", + "lib/galaxy/webapps/reports/config_schema.yml", + 'galaxy.webapps.reports.buildapp:uwsgi_app()', +) +APPS = {"galaxy": GALAXY_APP, "tool_shed": SHED_APP, "reports": REPORTS_APP} + + +def main(argv=None): + """Entry point for conversion process.""" + if argv is None: + argv = sys.argv[1:] + args = _arg_parser().parse_args(argv) + app_name = args.app + app_desc = APPS.get(app_name, None) + action = args.action + action_func = ACTIONS[action] + action_func(args, app_desc) + + +def _arg_parser(): + parser = argparse.ArgumentParser(description=DESCRIPTION) + parser.add_argument('action', metavar='ACTION', type=str, + choices=ACTIONS.keys(), + help='action to perform') + parser.add_argument('app', metavar='APP', type=str, nargs="?", + help=APP_DESCRIPTION) + parser.add_argument('--add-comments', default=False, action="store_true") + parser.add_argument('--dry-run', default=False, action="store_true", + help=DRY_RUN_DESCRIPTION) + parser.add_argument('--galaxy_root', default=".", type=str) + return parser + + +def _to_rst(args, app_desc, heading_level="~"): + rst = StringIO() + schema = app_desc.schema + for key, value in schema.app_schema.items(): + default = None if "default" not in value else value["default"] + option = schema.get_app_option(key) + option_value = OptionValue(key, default, option) + _write_option_rst(args, rst, key, heading_level, option_value) + print(rst.getvalue()) + + +def _write_option_rst(args, rst, key, heading_level, option_value): + title = "``%s``" % key + heading = heading_level * len(title) + rst.write("%s\n%s\n%s\n\n" % (heading, title, heading)) + option, value = _parse_option_value(option_value) + desc = option["desc"] + rst.write(":Description:\n") + rst.write("\n".join(RST_DESCRIPTION_WRAPPER.wrap(desc))) + rst.write("\n") + type = option.get("type", None) + default = option.get("default", "*null*") + rst.write(":Default: %s\n" % default) + if type: + rst.write(":Type: %s\n" % type) + rst.write("\n\n") + + +def _build_uwsgi_schema(args, app_desc): + req = urllib2.Request('https://raw.githubusercontent.com/unbit/uwsgi-docs/master/Options.rst') + response = urllib2.urlopen(req) + rst_options = response.read() + last_line = None + current_opt = None + + options = OrderedDict({}) + option = None + for line in rst_options.splitlines(): + line = line.strip() + dots = "*" * len(line) + if line and (line == dots): + current_opt = last_line + option = { + 'type': 'any', + } + options[current_opt] = option + + if line.startswith("``parser``"): + parser = line.split(":", 1)[1].strip() + if parser == "uwsgi_opt_set_int": + option["type"] = "int" + # TODO: disptch on parser... + elif line.startswith("``help``"): + option["desc"] = line.split(":", 1)[1] + + last_line = line + schema = { + "type": "map", + "desc": "uwsgi definition, see http://uwsgi-docs.readthedocs.io/en/latest/Options.html", + "mapping": options + } + path = os.path.join(args.galaxy_root, UWSGI_SCHEMA_PATH) + contents = _ordered_dump(schema) + _write_to_file(args, contents, path) + + +def _find_config(args, app_desc): + path = os.path.join(args.galaxy_root, app_desc.destination) + if not os.path.exists(path): + path = None + + for possible_ini_config_rel in app_desc.config_paths: + possible_ini_config = os.path.join(args.galaxy_root, possible_ini_config_rel) + if os.path.exists(possible_ini_config): + path = possible_ini_config + + if path is None: + _warn(USING_SAMPLE_MESSAGE % path) + path = os.path.join(args.galaxy_root, app_desc.sample_destination) + + return path + + +def _find_app_options(app_desc, path): + """Load app (as opposed to server) options from specified path. + + Supplied ``path`` may be either YAML or ini file. + """ + if _is_ini(path): + p = nice_config_parser(path) + app_items = _find_app_options_from_config_parser(p) + else: + raw_config = _order_load_path(path) + app_items = raw_config.get(app_desc.app_name, None) or {} + return app_items + + +def _find_app_options_from_config_parser(p): + if not p.has_section("app:main"): + _warn(NO_APP_MAIN_MESSAGE) + app_items = OrderedDict() + else: + app_items = OrderedDict(p.items("app:main")) + + return app_items + + +def _lint(args, app_desc): + path = _find_config(args, app_desc) + if not os.path.exists(path): + raise Exception("Expected configuration file [%s] not found." % path) + app_items = _find_app_options(app_desc, path) + for key, value in app_items.items(): + option_action = OPTION_ACTIONS.get(key) + if option_action is not None: + option_action.lint(args, app_desc, key, value) + + +def _validate(args, app_desc): + path = _find_config(args, app_desc) + with open(path, "r") as f: + # Allow empty mapping (not allowed by pykawlify) + raw_config = _order_load_path(f) + if raw_config.get(app_desc.app_name, None) is None: + raw_config[app_desc.app_name] = {} + config_p = tempfile.NamedTemporaryFile(delete=False, suffix=".yml") + _ordered_dump(raw_config, config_p) + config_p.flush() + path = config_p.name + + fp = tempfile.NamedTemporaryFile(delete=False, suffix=".yml") + _ordered_dump(app_desc.schema.raw_schema, fp) + fp.flush() + name = fp.name + if Core is None: + raise Exception("Cannot validate file, pykwalify is not installed.") + c = Core( + source_file=path, + schema_files=[name], + ) + c.validate() + + +class PrefixFilter(object): + + def __init__(self, name, prefix): + self.name = name + self.prefix = prefix + + +class GzipFilter(object): + + def __init__(self, name): + self.name = name + + +def _run_conversion(args, app_desc): + ini_config = _find_config(args, app_desc) + if ini_config and not _is_ini(ini_config): + _warn("Cannot convert YAML file %s, this option is only for ini config files." % ini_config) + sys.exit(1) + elif not ini_config: + _warn("Failed to find a config to convert - exiting without changes.") + sys.exit(1) + + p = nice_config_parser(ini_config) + server_section = None + filters = {} + for section in p.sections(): + if section.startswith("server:"): + if server_section: + _warn(EXTRA_SERVER_MESSAGE % (server_section, section)) + else: + server_section = section + + if section.startswith("filter:"): + filter_name = section[len("filter:"):] + filter_type = p.get(section, "use") + if filter_type is None: + MISSING_FILTER_TYPE_MESSAGE + message = EXTRA_SERVER_MESSAGE % section + _warn(message) + continue + + if filter_type == "egg:PasteDeploy#prefix": + prefix = p.get(section, "prefix") + filters[filter_name] = PrefixFilter(filter_name, prefix) + elif filter_type == "egg:Paste#gzip": + filters[filter_name] = GzipFilter(filter_name) + else: + message = UNHANDLED_FILTER_TYPE_MESSAGE % (filter_type, section) + _warn(message) + continue + + if not server_section: + _warn("No server section found, using default uwsgi server definition.") + server_config = OrderedDict() + else: + server_config = OrderedDict(p.items(server_section)) + + app_items = _find_app_options_from_config_parser(p) + applied_filters = [] + if filters: + for key, value in app_items.items(): + if key == "filter-with": + if value in filters: + applied_filters.append(filters[value]) + else: + _warn("Unknown filter found [%s], exiting..." % value) + sys.exit(1) + + uwsgi_dict = _server_paste_to_uwsgi(app_desc, server_config, applied_filters) + + app_dict = OrderedDict({}) + schema = app_desc.schema + for key, value in app_items.items(): + if key in ["__file__", "here"]: + continue + + if key in OPTION_ACTIONS: + option_action = OPTION_ACTIONS.get(key) + value = option_action.converted(args, app_desc, key, value) + + if value is DROP_OPTION_VALUE: + continue + + option = schema.get_app_option(key) + if option["unknown_option"]: + _warn(UNKNOWN_OPTION_MESSAGE % key) + + option_value = OptionValue(key, value, option) + app_dict[key] = option_value + + f = StringIO() + _write_section(args, f, "uwsgi", uwsgi_dict) + _write_section(args, f, app_desc.app_name, app_dict) + destination = os.path.join(args.galaxy_root, app_desc.destination) + _replace_file(args, f, app_desc, ini_config, destination) + + +def _is_ini(path): + return path.endswith(".ini") or path.endswith(".ini.sample") + + +def _replace_file(args, f, app_desc, from_path, to_path): + _write_to_file(args, f, to_path) + backup_path = "%s.backup" % from_path + print("Moving [%s] to [%s]" % (from_path, backup_path)) + if args.dry_run: + print("... skipping because --dry-run is enabled.") + else: + shutil.move(from_path, backup_path) + + +def _build_sample_yaml(args, app_desc): + schema = app_desc.schema + f = StringIO() + options = copy.deepcopy(UWSGI_OPTIONS) + for key, value in options.items(): + for field in ["desc", "default"]: + if field not in value: + continue + field_value = value[field] + if not isinstance(field_value, six.string_types): + continue + + new_field_value = string.Template(field_value).safe_substitute(**{ + 'default_port': str(app_desc.default_port), + 'app_name': app_desc.app_name, + 'uwsgi_module': app_desc.uwsgi_module, + }) + value[field] = new_field_value + _write_sample_section(args, f, 'uwsgi', Schema(options), as_comment=False) + _write_sample_section(args, f, app_desc.app_name, schema) + destination = os.path.join(args.galaxy_root, app_desc.sample_destination) + _write_to_file(args, f, destination) + + +def _write_to_file(args, f, path): + dry_run = args.dry_run + if hasattr(f, "getvalue"): + contents = f.getvalue() + else: + contents = f + contents_indented = "\n".join([" |%s" % l for l in contents.splitlines()]) + print("Writing the file contents:\n%s\nto %s" % (contents_indented, path)) + if dry_run: + print("... skipping because --dry-run is enabled.") + else: + safe_makedirs(os.path.dirname(path)) + with open(path, "w") as to_f: + to_f.write(contents) + + +def _order_load_path(path): + """Load (with ``_ordered_load``) on specified path (a YAML file).""" + with open(path, "r") as f: + # Allow empty mapping (not allowed by pykawlify) + raw_config = _ordered_load(f) + return raw_config + + +def _write_sample_section(args, f, section_header, schema, as_comment=True): + _write_header(f, section_header) + for key, value in schema.app_schema.items(): + default = None if "default" not in value else value["default"] + option = schema.get_app_option(key) + option_value = OptionValue(key, default, option) + _write_option(args, f, key, option_value, as_comment=as_comment) + + +def _write_section(args, f, section_header, section_dict): + _write_header(f, section_header) + for key, option_value in section_dict.items(): + _write_option(args, f, key, option_value) + + +def _write_header(f, section_header): + f.write("%s:\n\n" % section_header) + + +def _write_option(args, f, key, option_value, as_comment=False): + option, value = _parse_option_value(option_value) + desc = option["desc"] + comment = "" + if desc and args.add_comments: + comment = "\n".join(YAML_COMMENT_WRAPPER.wrap(desc)) + comment += "\n" + as_comment_str = "#" if as_comment else "" + key_val_str = yaml.dump({key: value}).lstrip("{").rstrip("\n}") + lines = "%s%s%s" % (comment, as_comment_str, key_val_str) + lines_idented = "\n".join([(" %s" % l) for l in lines.split("\n")]) + f.write("%s\n\n" % lines_idented) + + +def _parse_option_value(option_value): + if isinstance(option_value, OptionValue): + option = option_value.option + value = option_value.value + else: + value = option_value + option = OPTION_DEFAULTS + return option, value + + +def _server_paste_to_uwsgi(app_desc, server_config, applied_filters): + uwsgi_dict = OrderedDict() + port = server_config.get("port", app_desc.default_port) + host = server_config.get("host", "127.0.0.1") + + if server_config.get("use", "egg:Paste#http") != "egg:Paste#http": + raise Exception("Unhandled paste server 'use' value [%s], file must be manually migrate.") + + uwsgi_dict["http"] = "%s:%s" % (host, port) + # default changing from 10 to 8 + uwsgi_dict["threads"] = int(server_config.get("threadpool_workers", 8)) + # required for static... + uwsgi_dict["http-raw-body"] = True + uwsgi_dict["offload-threads"] = 8 + + # Handle paste filters during conversion. + prefix = None + for applied_filter in applied_filters: + if isinstance(applied_filter, PrefixFilter): + prefix = applied_filter.prefix + break + elif isinstance(applied_filter, GzipFilter): + uwsgi_dict["http-auto-gzip"] = True + + if prefix: + uwsgi_dict["mount"] = "%s=%s" % (prefix, app_desc.uwsgi_module) + uwsgi_dict["manage-script-name"] = True + else: + uwsgi_dict["module"] = app_desc.uwsgi_module + return uwsgi_dict + + +def _warn(message): + print("WARNING: %s" % message) + + +def _ordered_load(stream): + + class OrderedLoader(yaml.Loader): + + def __init__(self, stream): + self._root = os.path.split(stream.name)[0] + super(OrderedLoader, self).__init__(stream) + + def include(self, node): + filename = os.path.join(self._root, self.construct_scalar(node)) + with open(filename, 'r') as f: + return yaml.load(f, OrderedLoader) + + def construct_mapping(loader, node): + loader.flatten_mapping(node) + return OrderedDict(loader.construct_pairs(node)) + + OrderedLoader.add_constructor( + yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG, + construct_mapping) + OrderedLoader.add_constructor('!include', OrderedLoader.include) + + return yaml.load(stream, OrderedLoader) + + +def _ordered_dump(data, stream=None, Dumper=yaml.Dumper, **kwds): + class OrderedDumper(Dumper): + pass + + def _dict_representer(dumper, data): + return dumper.represent_mapping( + yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG, + data.items()) + OrderedDumper.add_representer(OrderedDict, _dict_representer) + return yaml.dump(data, stream, OrderedDumper, **kwds) + + +ACTIONS = { + "convert": _run_conversion, + "build_sample_yaml": _build_sample_yaml, + "validate": _validate, + "lint": _lint, + "build_uwsgi_yaml": _build_uwsgi_schema, + "build_rst": _to_rst, +} + + +if __name__ == '__main__': + main() diff --git a/scripts/config_sample_to_kwalify.py b/scripts/config_sample_to_kwalify.py new file mode 100644 index 00000000000..cc3236a366a --- /dev/null +++ b/scripts/config_sample_to_kwalify.py @@ -0,0 +1,71 @@ +from __future__ import print_function + +import sys + + +def main(): + """Entry point for conversion procedure.""" + found_app_main = False + current_section_desc = [] + current_section_options = [] + try: + sample = sys.argv[1] + except KeyError: + sample = "config/galaxy.ini.sample" + + for line in open(sample, "r"): + is_app_main = line.startswith('[app:main]') + if not found_app_main and not is_app_main: + continue + if is_app_main: + found_app_main = True + continue + + line = line.strip() + if not line.startswith("#"): + for section_option in current_section_options: + _dump_option(section_option, current_section_desc) + current_section_desc = [] + current_section_options = [] + if line.startswith("[galaxy_amqp]"): + break + + if line.startswith("# ") or "#" == line: + current_section_desc.append(line[2:]) + elif line.startswith("#"): + current_section_options.append(line) + + +def _dump_option(option, current_section_desc): + def print_line(line): + print((" " * 6) + line) + if "=" not in option: + print(option) + key, default = [s.strip() for s in option.split("=", 1)] + key = key[1:] # strip # + if default.strip().lower() in ["true", "false"]: + default = default.lower() + type = "bool" + elif default.isdigit(): + type = "int" + else: + try: + float(default) + type = "float" + except ValueError: + type = "str" + if default == "None": + default = None + print_line("%s:" % key) + print_line(" type: %s" % type) + if default is not None: + print_line(" default: %s" % default) + # print_line(" required: false") + print_line(" desc: |") + for line in current_section_desc: + print_line(" %s" % line) + print_line("") + + +if __name__ == "__main__": + main() diff --git a/test/unit/config/1607_root_filters/config/galaxy.ini b/test/unit/config/1607_root_filters/config/galaxy.ini new file mode 100644 index 00000000000..ac1a8af0b21 --- /dev/null +++ b/test/unit/config/1607_root_filters/config/galaxy.ini @@ -0,0 +1,1240 @@ +# +# Galaxy is configured by default to be usable in a single-user development +# environment. To tune the application for a multi-user production +# environment, see the documentation at: +# +# http://usegalaxy.org/production +# + +# Throughout this sample configuration file, except where stated otherwise, +# uncommented values override the default if left unset, whereas commented +# values are set to the default value. Relative paths are relative to the root +# Galaxy directory. +# +# Examples of many of these options are explained in more detail in the wiki: +# +# https://wiki.galaxyproject.org/Admin/Config +# +# Config hackers are encouraged to check there before asking for help. + +# ---- HTTP Server ---------------------------------------------------------- + +# Configuration of the internal HTTP server. + +[server:main] + +# The internal HTTP server to use. Currently only Paste is provided. This +# option is required. +use = egg:Paste#http + +# The port on which to listen. +#port = 8080 + +# The address on which to listen. By default, only listen to localhost (Galaxy +# will not be accessible over the network). Use '0.0.0.0' to listen on all +# available network interfaces. +#host = 127.0.0.1 + +# Use a threadpool for the web server instead of creating a thread for each +# request. +use_threadpool = True + +# Number of threads in the web server thread pool. +#threadpool_workers = 10 + +# Set the number of seconds a thread can work before you should kill it +# (assuming it will never finish) to 3 hours. Default is 600 (10 minutes). +threadpool_kill_thread_limit = 10800 + +# ---- Filters -------------------------------------------------------------- + +# Filters sit between Galaxy and the HTTP server. + +# These filters are disabled by default. They can be enabled with +# 'filter-with' in the [app:main] section below. + +# Define the gzip filter. +[filter:gzip] +use = egg:Paste#gzip + +# Define the proxy-prefix filter. +[filter:proxy-prefix] +use = egg:PasteDeploy#prefix +prefix = /galaxy + +# ---- Galaxy --------------------------------------------------------------- + +# Configuration of the Galaxy application. + +[app:main] + +# -- Application and filtering + +# The factory for the WSGI application. This should not be changed. +paste.app_factory = galaxy.web.buildapp:app_factory + +# If not running behind a proxy server, you may want to enable gzip compression +# to decrease the size of data transferred over the network. If using a proxy +# server, please enable gzip compression there instead. +#filter-with = gzip + +# If running behind a proxy server and Galaxy is served from a subdirectory, +# enable the proxy-prefix filter and set the prefix in the +# [filter:proxy-prefix] section above. +#filter-with = proxy-prefix + +# If proxy-prefix is enabled and you're running more than one Galaxy instance +# behind one hostname, you will want to set this to the same path as the prefix +# in the filter above. This value becomes the "path" attribute set in the +# cookie so the cookies from each instance will not clobber each other. +#cookie_path = None + +# -- Database + +# By default, Galaxy uses a SQLite database at 'database/universe.sqlite'. You +# may use a SQLAlchemy connection string to specify an external database +# instead. This string takes many options which are explained in detail in the +# config file documentation. +#database_connection = sqlite:///./database/universe.sqlite?isolation_level=IMMEDIATE + +# If the server logs errors about not having enough database pool connections, +# you will want to increase these values, or consider running more Galaxy +# processes. +#database_engine_option_pool_size = 5 +#database_engine_option_max_overflow = 10 + +# If using MySQL and the server logs the error "MySQL server has gone away", +# you will want to set this to some positive value (7200 should work). +#database_engine_option_pool_recycle = -1 + +# If large database query results are causing memory or response time issues in +# the Galaxy process, leave the result on the server instead. This option is +# only available for PostgreSQL and is highly recommended. +#database_engine_option_server_side_cursors = False + +# Log all database transactions, can be useful for debugging and performance +# profiling. Logging is done via Python's 'logging' module under the qualname +# 'galaxy.model.orm.logging_connection_proxy' +#database_query_profiling_proxy = False + +# By default, Galaxy will use the same database to track user data and +# tool shed install data. There are many situations in which it is +# valuable to separate these - for instance bootstrapping fresh Galaxy +# instances with pretested installs. The following option can be used to +# separate the tool shed install database (all other options listed above +# but prefixed with install_ are also available). +#install_database_connection = sqlite:///./database/universe.sqlite?isolation_level=IMMEDIATE + +# Setting the following option to true will cause Galaxy to automatically +# migrate the database forward after updates. This is not recommended for production +# use. +#database_auto_migrate = False + +# -- Files and directories + +# Dataset files are stored in this directory. +#file_path = database/files + +# Temporary files are stored in this directory. +#new_file_path = database/tmp + +# Tool config files, defines what tools are available in Galaxy. +# Tools can be locally developed or installed from Galaxy tool sheds. +# (config/tool_conf.xml.sample will be used if left unset and +# config/tool_conf.xml does not exist). +#tool_config_file = config/tool_conf.xml,config/shed_tool_conf.xml + +# Enable / disable checking if any tools defined in the above non-shed +# tool_config_files (i.e., tool_conf.xml) have been migrated from the Galaxy +# code distribution to the Tool Shed. This setting should generally be set to +# False only for development Galaxy environments that are often rebuilt from +# scratch where migrated tools do not need to be available in the Galaxy tool +# panel. If the following setting remains commented, the default setting will +# be True. +#check_migrate_tools = True + +# Tool config maintained by tool migration scripts. If you use the migration +# scripts to install tools that have been migrated to the tool shed upon a new +# release, they will be added to this tool config file. +#migrated_tools_config = config/migrated_tools_conf.xml + +# File that contains the XML section and tool tags from all tool panel config +# files integrated into a single file that defines the tool panel layout. This +# file can be changed by the Galaxy administrator to alter the layout of the +# tool panel. If not present, Galaxy will create it. +#integrated_tool_panel_config = integrated_tool_panel.xml + +# Default path to the directory containing the tools defined in tool_conf.xml. +# Other tool config files must include the tool_path as an attribute in the +# tag. +#tool_path = tools + +# -- Tool dependencies + +# Path to the directory in which tool dependencies are placed. This is used by +# the Tool Shed to install dependencies and can also be used by administrators +# to manually install or link to dependencies. For details, see: +# https://wiki.galaxyproject.org/Admin/Config/ToolDependencies +# Set the string to None to explicitly disable tool dependency handling. +# If this option is set to none or an invalid path, installing tools with dependencies +# from the Tool Shed will fail. +#tool_dependency_dir = database/dependencies + +# The dependency resolvers config file specifies an ordering and options for how +# Galaxy resolves tool dependencies (requirement tags in Tool XML). The default +# ordering is to the use the Tool Shed for tools installed that way, use local +# Galaxy packages, and then use Conda if available. +# See https://github.com/galaxyproject/galaxy/blob/dev/doc/source/admin/dependency_resolvers.rst +# for more information on these options. +#dependency_resolvers_config_file = config/dependency_resolvers_conf.xml + +# The following Conda dependency resolution options will change the defaults for +# all Conda resolvers, but multiple resolvers can be configured independently +# in dependency_resolvers_config_file and these options overridden. +# Location on the filesystem where Conda packages are installed + +# conda_prefix is the location on the filesystem where Conda packages and environments are installed +# IMPORTANT: Due to a current limitation in conda, the total length of the +# conda_prefix and the job_working_directory path should be less than 50 characters! +#conda_prefix = /_conda +# Override the Conda executable to use, it will default to the one on the +# PATH (if available) and then to /bin/conda +#conda_exec = +# Pass debug flag to conda commands. +#conda_debug = False +# conda channels to enable by default (http://conda.pydata.org/docs/custom-channels.html) +#conda_ensure_channels = r,bioconda,iuc +# Set to True to instruct Galaxy to look for and install missing tool +# dependencies before each job runs. +#conda_auto_install = False +# Set to True to perform additional checking of installed Conda environment +#conda_verbose_install_check=False +# Set to True to instruct Galaxy to install Conda from the web automatically +# if it cannot find a local copy and conda_exec is not configured. +#conda_auto_init = False + +# File containing the Galaxy Tool Sheds that should be made available to +# install from in the admin interface (.sample used if default does not exist). +#tool_sheds_config_file = config/tool_sheds_conf.xml + +# Set to True to enable monitoring of tools and tool directories +# listed in any tool config file specified in tool_config_file option. +# If changes are found, tools are automatically reloaded. Watchdog ( +# https://pypi.python.org/pypi/watchdog ) must be installed and +# available to Galaxy to use this option. Other options include 'auto' +# which will attempt to watch tools if the watchdog library is available +# but won't fail to load Galaxy if it is not and 'polling' which will use +# a less efficient monitoring scheme that may work in wider range of scenarios +# than the watchdog default. +#watch_tools = False + +# Enable automatic polling of relative tool sheds to see if any updates +# are available for installed repositories. Ideally only one Galaxy +# server process should be able to check for repository updates. The +# setting for hours_between_check should be an integer between 1 and 24. +#enable_tool_shed_check = False +#hours_between_check = 12 + +# Enable use of an in-memory registry with bi-directional relationships between +# repositories (i.e., in addition to lists of dependencies for a repository, +# keep an in-memory registry of dependent items for each repository. +#manage_dependency_relationships = False + +# XML config file that contains data table entries for the +# ToolDataTableManager. This file is manually # maintained by the Galaxy +# administrator (.sample used if default does not exist). +#tool_data_table_config_path = config/tool_data_table_conf.xml + +# XML config file that contains additional data table entries for the +# ToolDataTableManager. This file is automatically generated based on the +# current installed tool shed repositories that contain valid +# tool_data_table_conf.xml.sample files. At the time of installation, these +# entries are automatically added to the following file, which is parsed and +# applied to the ToolDataTableManager at server start up. +#shed_tool_data_table_config = config/shed_tool_data_table_conf.xml + +# Directory where data used by tools is located, see the samples in that +# directory and the wiki for help: +# https://wiki.galaxyproject.org/Admin/DataIntegration +#tool_data_path = tool-data + +# Directory where Tool Data Table related files will be placed +# when installed from a ToolShed. Defaults to tool_data_path. +#shed_tool_data_path = tool-data + +# File containing old-style genome builds +#builds_file_path = tool-data/shared/ucsc/builds.txt + +# Directory where chrom len files are kept, currently mainly used by trackster +#len_file_path = tool-data/shared/ucsc/chrom + +# Datatypes config file(s), defines what data (file) types are available in +# Galaxy (.sample is used if default does not exist). If a datatype appears in +# multiple files, the last definition is used (though the first sniffer is used +# so limit sniffer definitions to one file). +#datatypes_config_file = config/datatypes_conf.xml + +# Disable the 'Auto-detect' option for file uploads +#datatypes_disable_auto = False + +# Visualizations config directory: where to look for individual visualization +# plugins. The path is relative to the Galaxy root dir. To use an absolute +# path begin the path with '/'. This is a comma separated list. +# Defaults to "config/plugins/visualizations". +#visualization_plugins_directory = config/plugins/visualizations + +# Interactive environment plugins root directory: where to look for interactive +# environment plugins. By default none will be loaded. Set to +# config/plugins/interactive_environments to load Galaxy's stock plugins +# (currently just IPython). These will require Docker to be configured and +# have security considerations, so proceed with caution. The path is relative to the +# Galaxy root dir. To use an absolute path begin the path with '/'. This is a comma +# separated list. +#interactive_environment_plugins_directory = + +# Interactive tour directory: where to store interactive tour definition files. +# Galaxy ships with several basic interface tours enabled, though a different +# directory with custom tours can be specified here. The path is relative to the +# Galaxy root dir. To use an absolute path begin the path with '/'. This is a comma +# separated list. +#tour_config_dir = config/plugins/tours + +# Each job is given a unique empty directory as its current working directory. +# This option defines in what parent directory those directories will be +# created. +#job_working_directory = database/job_working_directory + +# If using a cluster, Galaxy will write job scripts and stdout/stderr to this +# directory. +#cluster_files_directory = database/pbs + +# Mako templates are compiled as needed and cached for reuse, this directory is +# used for the cache +#template_cache_path = database/compiled_templates + +# Set to false to disable various checks Galaxy will do to ensure it +# can run job scripts before attempting to execute or submit them. +#check_job_script_integrity = True +# Number of checks to execute if check_job_script_integrity is enabled. +#check_job_script_integrity_count = 35 +# Time to sleep between checks if check_job_script_integrity is enabled (in seconds). +#check_job_script_integrity_sleep = .25 + +# Set the default shell used by non-containerized jobs Galaxy-wide. This +# defaults to bash for all jobs and can be overidden at the destination +# level for heterogenous clusters. conda job resolution requires bash or zsh +# so if this is switched to /bin/sh for instance - conda resolution +# should be disabled. Containerized jobs always use /bin/sh - so more maximum +# portability tool authors should assume generated commands run in sh. +#default_job_shell = /bin/bash + +# Citation related caching. Tool citations information maybe fetched from +# external sources such as http://dx.doi.org/ by Galaxy - the following +# parameters can be used to control the caching used to store this information. +#citation_cache_type = file +#citation_cache_data_dir = database/citations/data +#citation_cache_lock_dir = database/citations/lock + +# External service types config file, defining what types of external_services +# configurations are available in Galaxy (.sample is used if default does not +# exist). +#external_service_type_config_file = config/external_service_types_conf.xml + +# Path to the directory containing the external_service_types defined in the +# config. +#external_service_type_path = external_service_types + +# Tools with a number of outputs not known until runtime can write these +# outputs to a directory for collection by Galaxy when the job is done. +# Previously, this directory was new_file_path, but using one global directory +# can cause performance problems, so using job_working_directory ('.' or cwd +# when a job is run) is encouraged. By default, both are checked to avoid +# breaking existing tools. +#collect_outputs_from = new_file_path,job_working_directory + +# -- Data Storage (Object Store) +# +# Configuration file for the object store +# If this is set and exists, it overrides any other objectstore settings. +# object_store_config_file = config/object_store_conf.xml + + +# -- Mail and notification + +# Galaxy sends mail for various things: subscribing users to the mailing list +# if they request it, password resets, notifications from the Galaxy Sample +# Tracking system, reporting dataset errors, and sending activation emails. +# To do this, it needs to send mail through an SMTP server, which you may +# define here (host:port). +# Galaxy will automatically try STARTTLS but will continue upon failure. +#smtp_server = None + +# If your SMTP server requires a username and password, you can provide them +# here (password in cleartext here, but if your server supports STARTTLS it +# will be sent over the network encrypted). +#smtp_username = None +#smtp_password = None + +# If your SMTP server requires SSL from the beginning of the connection +# smtp_ssl = False + +# On the user registration form, users may choose to join a mailing list. This +# is the address used to subscribe to the list. Uncomment and leave empty if you +# want to remove this option from the user registration form. +#mailing_join_addr = galaxy-announce-join@bx.psu.edu + +# Datasets in an error state include a link to report the error. Those reports +# will be sent to this address. Error reports are disabled if no address is +# set. Also this email is shown as a contact to user in case of Galaxy +# misconfiguration and other events user may encounter. +#error_email_to = None + +# Email address to use in the 'From' field when sending emails for +# account activations, workflow step notifications and password resets. +# We recommend using string in the following format: +# Galaxy Project +# If not configured, '' will be used. +#email_from = None + +# URL of the support resource for the galaxy instance. Used in activation +# emails. +#instance_resource_url = https://wiki.galaxyproject.org/ + +# E-mail domains blacklist is used for filtering out users that are using +# disposable email address during the registration. If their address domain +# matches any domain in the blacklist, they are refused the registration. +#blacklist_file = config/disposable_email_blacklist.conf + +# Registration warning message is used to discourage people from registering +# multiple accounts. Applies mostly for the main Galaxy instance. +# If no message specified the warning box will not be shown. +#registration_warning_message = Please register only one account - we provide this service free of charge and have limited computational resources. Multi-accounts are tracked and will be subjected to account termination and data deletion. + + +# -- Account activation + +# User account activation feature global flag. If set to "False", the rest of +# the Account activation configuration is ignored and user activation is +# disabled (i.e. accounts are active since registration). +# The activation is also not working in case the SMTP server is not defined. +#user_activation_on = False + +# Activation grace period (in hours). Activation is not forced (login is not +# disabled) until grace period has passed. Users under grace period can't run +# jobs. Enter 0 to disable grace period. +# Users with OpenID logins have grace period forever. +#activation_grace_period = 3 + +# Shown in warning box to users that were not activated yet. +# In use only if activation_grace_period is set. +#inactivity_box_content = Your account has not been activated yet. Feel free to browse around and see what's available, but you won't be able to upload data or run jobs until you have verified your email address. + +# Password expiration period (in days). Users are required to change their +# password every x days. Users will be redirected to the change password +# screen when they log in after their password expires. Enter 0 to disable +# password expiration. +#password_expiration_period = 0 + +# Galaxy Session Timeout +# This provides a timeout (in minutes) after which a user will have to log back in. +# A duration of 0 disables this feature. +#session_duration = 0 + + +# -- Analytics + +# You can enter tracking code here to track visitor's behavior +# through your Google Analytics account. Example: UA-XXXXXXXX-Y +#ga_code = None + +# -- Display sites + +# Galaxy can display data at various external browsers. These options specify +# which browsers should be available. URLs and builds available at these +# browsers are defined in the specifield files. + +# If use_remote_user = True, display application servers will be denied access +# to Galaxy and so displaying datasets in these sites will fail. +# display_servers contains a list of hostnames which should be allowed to +# bypass security to display datasets. Please be aware that there are security +# implications if this is allowed. More details (including required changes to +# the proxy server config) are available in the Apache proxy documentation on +# the wiki. +# +# The list of servers in this sample config are for the UCSC Main, Test and +# Archaea browsers, but the default if left commented is to not allow any +# display sites to bypass security (you must uncomment the line below to allow +# them). +#display_servers = hgw1.cse.ucsc.edu,hgw2.cse.ucsc.edu,hgw3.cse.ucsc.edu,hgw4.cse.ucsc.edu,hgw5.cse.ucsc.edu,hgw6.cse.ucsc.edu,hgw7.cse.ucsc.edu,hgw8.cse.ucsc.edu,lowepub.cse.ucsc.edu + +# To disable the old-style display applications that are hardcoded into +# datatype classes, set enable_old_display_applications = False. +# This may be desirable due to using the new-style, XML-defined, display +# applications that have been defined for many of the datatypes that have the +# old-style. +# There is also a potential security concern with the old-style applications, +# where a malicious party could provide a link that appears to reference the +# Galaxy server, but contains a redirect to a third-party server, tricking a +# Galaxy user to access said site. +#enable_old_display_applications = True + +# -- Next gen LIMS interface on top of existing Galaxy Sample/Request +# management code. + +use_nglims = False +nglims_config_file = tool-data/nglims.yaml + +# -- UI Localization + +# Show a message box under the masthead. +#message_box_visible = False +#message_box_content = None +#message_box_class = info + +# Append "/{brand}" to the "Galaxy" text in the masthead. +#brand = None + +# Format string used when showing date and time information. +# The string may contain: +# - the directives used by Python time.strftime() function (see +# https://docs.python.org/2/library/time.html#time.strftime ), +# - $locale (complete format string for the server locale), +# - $iso8601 (complete format string as specified by ISO 8601 international +# standard). +# pretty_datetime_format = $locale (UTC) + +# URL (with schema http/https) of the Galaxy instance as accessible within your +# local network - if specified used as a default by pulsar file staging and +# IPython Docker container for communicating back with Galaxy via the API. +#galaxy_infrastructure_url = http://localhost:8080 + +# If the above URL cannot be determined ahead of time in dynamic environments +# but the port which should be used to access Galaxy can be - this should be +# set to prevent Galaxy from having to guess. For example if Galaxy is sitting +# behind a proxy with REMOTE_USER enabled - infrastructure shouldn't talk to +# Python processes directly and this should be set to 80 or 443, etc... If +# unset this file will be read for a server block defining a port corresponding +# to the webapp. +#galaxy_infrastructure_web_port = 8080 + +# The URL of the page to display in Galaxy's middle pane when loaded. This can +# be an absolute or relative URL. +#welcome_url = /static/welcome.html + +# The URL linked by the "Galaxy/brand" text. +#logo_url = / + +# The URL linked by the "Wiki" link in the "Help" menu. +#wiki_url = https://wiki.galaxyproject.org/ + +# The URL linked by the "Support" link in the "Help" menu. +#support_url = https://wiki.galaxyproject.org/Support + +# The URL linked by the "How to Cite Galaxy" link in the "Help" menu. +#citation_url = https://wiki.galaxyproject.org/CitingGalaxy + +# The URL linked by the "Search" link in the "Help" menu. +#search_url = http://galaxyproject.org/search/usegalaxy/ + +# The URL linked by the "Mailing Lists" link in the "Help" menu. +#mailing_lists_url = https://wiki.galaxyproject.org/MailingLists + +# The URL linked by the "Videos" link in the "Help" menu. +#screencasts_url = https://vimeo.com/galaxyproject + +# The URL linked by the "Terms and Conditions" link in the "Help" menu, as well +# as on the user registration and login forms and in the activation emails. +#terms_url = None + +# The URL linked by the "Galaxy Q&A" link in the "Help" menu +# The Galaxy Q&A site is under development; when the site is done, this URL +# will be set and uncommented. +#qa_url = + +# Serve static content, which must be enabled if you're not serving it via a +# proxy server. These options should be self explanatory and so are not +# documented individually. You can use these paths (or ones in the proxy +# server) to point to your own styles. +#static_enabled = True +#static_cache_time = 360 +#static_dir = static/ +#static_images_dir = static/images +#static_favicon_dir = static/favicon.ico +#static_scripts_dir = static/scripts/ +#static_style_dir = static/june_2007_style/blue +#static_robots_txt = static/robots.txt + +# Incremental Display Options + +#display_chunk_size = 65536 + +# -- Advanced proxy features + +# For help on configuring the Advanced proxy features, see: +# http://usegalaxy.org/production + +# Apache can handle file downloads (Galaxy-to-user) via mod_xsendfile. Set +# this to True to inform Galaxy that mod_xsendfile is enabled upstream. +#apache_xsendfile = False + +# The same download handling can be done by nginx using X-Accel-Redirect. This +# should be set to the path defined in the nginx config as an internal redirect +# with access to Galaxy's data files (see documentation linked above). +#nginx_x_accel_redirect_base = False + +# nginx can make use of mod_zip to create zip files containing multiple library +# files. If using X-Accel-Redirect, this can be the same value as that option. +#nginx_x_archive_files_base = False + +# If using compression in the upstream proxy server, use this option to disable +# gzipping of library .tar.gz and .zip archives, since the proxy server will do +# it faster on the fly. +#upstream_gzip = False + +# The following default adds a header to web request responses that +# will cause modern web browsers to not allow Galaxy to be embedded in +# the frames of web applications hosted at other hosts - this can help +# prevent a class of attack called clickjacking +# (https://www.owasp.org/index.php/Clickjacking). If you configure a +# proxy in front of Galaxy - please ensure this header remains intact +# to protect your users. Uncomment and leave empty to not set the +# `X-Frame-Options` header. +#x_frame_options = SAMEORIGIN + +# nginx can also handle file uploads (user-to-Galaxy) via nginx_upload_module. +# Configuration for this is complex and explained in detail in the +# documentation linked above. The upload store is a temporary directory in +# which files uploaded by the upload module will be placed. +#nginx_upload_store = False + +# This value overrides the action set on the file upload form, e.g. the web +# path where the nginx_upload_module has been configured to intercept upload +# requests. +#nginx_upload_path = False + +# Galaxy can also use nginx_upload_module to receive files staged out upon job +# completion by remote job runners (i.e. Pulsar) that initiate staging +# operations on the remote end. See the Galaxy nginx documentation for the +# corresponding nginx configuration. +#nginx_upload_job_files_store = False +#nginx_upload_job_files_path = False + +# Have Galaxy manage dynamic proxy component for routing requests to other +# services based on Galaxy's session cookie. It will attempt to do this by +# default though you do need to install node+npm and do an npm install from +# `lib/galaxy/web/proxy/js`. It is generally more robust to configure this +# externally managing it however Galaxy is managed. If True Galaxy will only +# launch the proxy if it is actually going to be used (e.g. for IPython). +#dynamic_proxy_manage=True + +# As of 16.04 Galaxy supports multiple proxy types. The original NodeJS +# implementation, alongside a new Golang single-binary-no-dependencies +# version. Valid values are (node, golang) +#dynamic_proxy=node + +# The NodeJS dynamic proxy can use an SQLite database or a JSON file for IPC, +# set that here. +#dynamic_proxy_session_map=database/session_map.sqlite + +# Set the port and IP for the the dynamic proxy to bind to, this must match +# the external configuration if dynamic_proxy_manage is False. +#dynamic_proxy_bind_port=8800 +#dynamic_proxy_bind_ip=0.0.0.0 + +# Enable verbose debugging of Galaxy-managed dynamic proxy. +#dynamic_proxy_debug=False + +# The dynamic proxy is proxied by an external proxy (e.g. apache frontend to +# nodejs to wrap connections in SSL). +#dynamic_proxy_external_proxy=False + +# Additionally, when the dynamic proxy is proxied by an upstream server, you'll +# want to specify a prefixed URL so both Galaxy and the proxy reside under the +# same path that your cookies are under. This will result in a url like +# https://FQDN/galaxy-prefix/gie_proxy for proxying +#dynamic_proxy_prefix=gie_proxy + +# The Golang proxy also manages the docker containers more closely than the +# NodeJS proxy, so is able to expose more container management related options + +# This attribute governs the minimum length of time between consecutive HTTP/WS +# requests through the proxy, before the proxy considers a container as being +# inactive and kills it. +#dynamic_proxy_golang_noaccess = 60 + +# In order to kill containers, the golang proxy has to check at some interval +# for possibly dead containers. This is exposed as a configurable parameter, +# but the default value is probably fine. +#dynamic_proxy_golang_clean_interval = 10 + +# The golang proxy needs to know how to talk to your docker daemon. Currently +# TLS is not supported, that will come in an update. +#dynamic_proxy_golang_docker_address = unix:///var/run/docker.sock + +# The golang proxy uses a RESTful HTTP API for communication with Galaxy +# instead of a JSON or SQLite file for IPC. If you do not specify this, it will +# be set randomly for you. You should set this if you are managing the proxy +# manually. +#dynamic_proxy_golang_api_key = None + +# -- Logging and Debugging + +# If True, Galaxy will attempt to configure a simple root logger if a +# "loggers" section does not appear in this configuration file. +#auto_configure_logging = True + +# Verbosity of console log messages. Acceptable values can be found here: +# https://docs.python.org/2/library/logging.html#logging-levels +#log_level = DEBUG + +# Print database operations to the server log (warning, quite verbose!). +#database_engine_option_echo = False + +# Print database pool operations to the server log (warning, quite verbose!). +#database_engine_option_echo_pool = False + +# Turn on logging of application events and some user events to the database. +#log_events = True + +# Turn on logging of user actions to the database. Actions currently logged +# are grid views, tool searches, and use of "recently" used tools menu. The +# log_events and log_actions functionality will eventually be merged. +#log_actions = True + +# Fluentd configuration. Various events can be logged to the fluentd instance +# configured below by enabling fluent_log. +#fluent_log = False +#fluent_host = localhost +#fluent_port = 24224 + +# Sanitize all HTML tool output. By default, all tool output served as +# 'text/html' will be sanitized thoroughly. This can be disabled if you have +# special tools that require unaltered output. WARNING: disabling this does +# make the Galaxy instance susceptible to XSS attacks initiated by your users. +#sanitize_all_html = True + +# Whitelist sanitization file. +# Datasets created by tools listed in this file are trusted and will not have +# their HTML sanitized on display. This can be manually edited or manipulated +# through the Admin control panel -- see "Manage Display Whitelist" +#sanitize_whitelist_file = config/sanitize_whitelist.txt + +# By default Galaxy will serve non-HTML tool output that may potentially +# contain browser executable JavaScript content as plain text. This will for +# instance cause SVG datasets to not render properly and so may be disabled +# by setting the following option to True. +#serve_xss_vulnerable_mimetypes = False + +# Return a Access-Control-Allow-Origin response header that matches the Origin +# header of the request if that Origin hostname matches one of the strings or +# regular expressions listed here. This is a comma separated list of hostname +# strings or regular expressions beginning and ending with /. +# E.g. mysite.com,google.com,usegalaxy.org,/^[\w\.]*example\.com/ +# See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS +#allowed_origin_hostnames = None + +# Set the following to True to use IPython nbconvert to build HTML from IPython +# notebooks in Galaxy histories. This process may allow users to execute +# arbitrary code or serve arbitrary HTML. If enabled, IPython must be +# available and on Galaxy's PATH, to do this run +# `pip install jinja2 pygments ipython` in Galaxy's virtualenv. +#trust_ipython_notebook_conversion = False + +# Debug enables access to various config options useful for development and +# debugging: use_lint, use_profile, use_printdebug and use_interactive. It +# also causes the files used by PBS/SGE (submission script, output, and error) +# to remain on disk after the job is complete. +#debug = False + +# Check for WSGI compliance. +#use_lint = False + +# Run the Python profiler on each request. +#use_profile = False + +# Intercept print statements and show them on the returned page. +#use_printdebug = True + +# Enable live debugging in your browser. This should NEVER be enabled on a +# public site. Enabled in the sample config for development. +use_interactive = True + +# Write thread status periodically to 'heartbeat.log', (careful, uses disk +# space rapidly!). Useful to determine why your processes may be consuming a +# lot of CPU. +#use_heartbeat = False + +# Control the period (in seconds) between dumps. Use -1 to disable. Regardless +# of this setting, if use_heartbeat is enabled, you can send a Galaxy process +# (unless running with uWSGI) SIGUSR1 (`kill -USR1`) to force a dump. +#heartbeat_interval = 20 + +# Heartbeat log filename. Can accept the template variables {server_name} and +# {pid} +#heartbeat_log = heartbeat_{server_name}.log + +# Log to Sentry +# Sentry is an open source logging and error aggregation platform. Setting +# sentry_dsn will enable the Sentry middleware and errors will be sent to the +# indicated sentry instance. This connection string is available in your +# sentry instance under -> Settings -> API Keys. +#sentry_dsn = None + +# Log to statsd +# Statsd is an external statistics aggregator (https://github.com/etsy/statsd) +# Enabling the following options will cause galaxy to log request timing and +# other statistics to the configured statsd instance. The statsd_prefix is +# useful if you are running multiple Galaxy instances and want to segment +# statistics between them within the same aggregator. +#statsd_host= +#statsd_port=8125 +#statsd_prefix=galaxy + +# -- Data Libraries + +# These library upload options are described in much more detail in the wiki: +# https://wiki.galaxyproject.org/Admin/DataLibraries/UploadingLibraryFiles + +# Add an option to the library upload form which allows administrators to +# upload a directory of files. +#library_import_dir = None + +# Add an option to the library upload form which allows authorized +# non-administrators to upload a directory of files. The configured directory +# must contain sub-directories named the same as the non-admin user's Galaxy +# login ( email ). The non-admin user is restricted to uploading files or +# sub-directories of files contained in their directory. +#user_library_import_dir = None + +# Add an option to the admin library upload tool allowing admins to paste +# filesystem paths to files and directories in a box, and these paths will be +# added to a library. Set to True to enable. Please note the security +# implication that this will give Galaxy Admins access to anything your Galaxy +# user has access to. +#allow_library_path_paste = False + +# Users may choose to download multiple files from a library in an archive. By +# default, Galaxy allows users to select from a few different archive formats +# if testing shows that Galaxy is able to create files using these formats. +# Specific formats can be disabled with this option, separate more than one +# format with commas. Available formats are currently 'zip', 'gz', and 'bz2'. +#disable_library_comptypes = + +# Some sequencer integration features in beta allow you to automatically +# transfer datasets. This is done using a lightweight transfer manager which +# runs outside of Galaxy (but is spawned by it automatically). Galaxy will +# communicate with this manager over the port specified here. +#transfer_manager_port = 8163 + +# Search data libraries with whoosh +#enable_whoosh_library_search = True +# Whoosh indexes are stored in this directory. +#whoosh_index_dir = database/whoosh_indexes + +# Search data libraries with lucene +#enable_lucene_library_search = False +# maximum file size to index for searching, in MB +#fulltext_max_size = 500 +#fulltext_noindex_filetypes = bam,sam,wig,bigwig,fasta,fastq,fastqsolexa,fastqillumina,fastqsanger +# base URL of server providing search functionality using lucene +#fulltext_url = http://localhost:8081 + +# -- Toolbox Search + +# The following boosts are used to customize this instance's toolbox search. +# The higher the boost, the more importance the scoring algorithm gives to the +# given field. Section refers to the tool group in the tool panel. Rest of +# the fields are tool's attributes. +# tool_name_boost = 9 +# tool_section_boost = 3 +# tool_description_boost = 2 +# tool_label_boost = 1 +# tool_stub_boost = 5 +# tool_help_boost = 0.5 + +# Limits the number of results in toolbox search. Can be used to tweak how many +# results will appear. +# tool_search_limit = 20 + +# -- Users and Security + +# Galaxy encodes various internal values when these values will be output in +# some format (for example, in a URL or cookie). You should set a key to be +# used by the algorithm that encodes and decodes these values. It can be any +# string. If left unchanged, anyone could construct a cookie that would grant +# them access to others' sessions. +# One simple way to generate a value for this is with the shell command: +# python -c 'import time; print time.time()' | md5sum | cut -f 1 -d ' ' +#id_secret = USING THE DEFAULT IS NOT SECURE! + +# User authentication can be delegated to an upstream proxy server (usually +# Apache). The upstream proxy should set a REMOTE_USER header in the request. +# Enabling remote user disables regular logins. For more information, see: +# https://wiki.galaxyproject.org/Admin/Config/ApacheProxy +#use_remote_user = False + +# If use_remote_user is enabled and your external authentication +# method just returns bare usernames, set a default mail domain to be appended +# to usernames, to become your Galaxy usernames (email addresses). +#remote_user_maildomain = None + +# If use_remote_user is enabled, the header that the upstream proxy provides +# the remote username in defaults to HTTP_REMOTE_USER (the 'HTTP_' is prepended +# by WSGI). This option allows you to change the header. Note, you still need +# to prepend 'HTTP_' to the header in this option, but your proxy server should +# *not* include 'HTTP_' at the beginning of the header name. +#remote_user_header = HTTP_REMOTE_USER + +# If use_remote_user is enabled, anyone who can log in to the Galaxy host may +# impersonate any other user by simply sending the appropriate header. Thus a +# secret shared between the upstream proxy server, and Galaxy is required. +# If anyone other than the Galaxy user is using the server, then apache/nginx +# should pass a value in the header 'GX_SECRET' that is identical to the one +# below. +#remote_user_secret = USING THE DEFAULT IS NOT SECURE! + +# If use_remote_user is enabled, you can set this to a URL that will log your +# users out. +#remote_user_logout_href = None + +# If your proxy and/or authentication source does not normalize e-mail +# addresses or user names being passed to Galaxy - set the following option +# to True to force these to lower case. +#normalize_remote_user_email = False + +# If an e-mail address is specified here, it will hijack remote user mechanics +# (``use_remote_user``) and have the webapp inject a single fixed user. This +# has the effect of turning Galaxy into a single user application with no +# login or external proxy required. Such applications should not be exposed to +# the world. +#single_user = + +# Administrative users - set this to a comma-separated list of valid Galaxy +# users (email addresses). These users will have access to the Admin section +# of the server, and will have access to create users, groups, roles, +# libraries, and more. For more information, see: +# https://wiki.galaxyproject.org/Admin/Interface +#admin_users = None + +# Force everyone to log in (disable anonymous access). +#require_login = False + +# Show the site's welcome page (see welcome_url) alongside the login page +# (even if require_login is True) +#show_welcome_with_login = False + +# Allow unregistered users to create new accounts (otherwise, they will have to +# be created by an admin). +#allow_user_creation = True + +# Allow administrators to delete accounts. +#allow_user_deletion = False + +# Allow administrators to log in as other users (useful for debugging) +#allow_user_impersonation = False + +# Allow users to remove their datasets from disk immediately (otherwise, +# datasets will be removed after a time period specified by an administrator in +# the cleanup scripts run via cron) +#allow_user_dataset_purge = True + +# By default, users' data will be public, but setting this to True will cause +# it to be private. Does not affect existing users and data, only ones created +# after this option is set. Users may still change their default back to +# public. +#new_user_dataset_access_role_default_private = False + +# Expose user list. Setting this to True will expose the user list to +# authenticated users. This makes sharing datasets in smaller galaxy instances +# much easier as they can type a name/email and have the correct user show up. +# This makes less sense on large public Galaxy instances where that data +# shouldn't be exposed. For semi-public Galaxies, it may make sense to expose +# just the username and not email, or vice versa. +#expose_user_name = False +#expose_user_email = False + +# -- Beta features + +# Enable new run workflow form +#run_workflow_toolform_upgrade = True + +# Enable Galaxy to communicate directly with a sequencer +#enable_sequencer_communication = False + +# Enable the new interface for installing tools from Tool Shed +# via the API. Admin menu will list both if enabled. +#enable_beta_ts_api_install = False + +# Set the following to a number of threads greater than 1 to spawn +# a Python task queue for dealing with large tool submissions (either +# through the tool form or as part of an individual workflow step across +# large collection). The size of a "large" tool request is controlled by +# the second parameter below and defaults to 10. This affects workflow +# scheduling and web processes, not job handlers. +#tool_submission_burst_threads = 1 +#tool_submission_burst_at = 10 + +# Enable beta workflow modules that should not yet be considered part of Galaxy's +# stable API. +#enable_beta_workflow_modules = False + +# Force usage of Galaxy's beta workflow scheduler under certain circumstances - +# this workflow scheduling forces Galaxy to schedule workflows in the background +# so initial submission of the workflows is signficantly sped up. This does +# however force the user to refresh their history manually to see newly scheduled +# steps (for "normal" workflows - steps are still scheduled far in advance of +# them being queued and scheduling here doesn't refer to actual cluster job +# scheduling). +# Workflows containing more than the specified number of steps will always use +# the Galaxy's beta workflow scheduling. +#force_beta_workflow_scheduled_min_steps=250 +# Switch to using Galaxy's beta workflow scheduling for all workflows involving +# ccollections. +#force_beta_workflow_scheduled_for_collections=False + +# Enable authentication via OpenID. Allows users to log in to their Galaxy +# account by authenticating with an OpenID provider. +#enable_openid = False +# .sample used if default does not exist +#openid_config_file = config/openid_conf.xml +#openid_consumer_cache_path = database/openid_consumer_cache + +# XML config file that allows the use of different authentication providers +# (e.g. LDAP) instead or in addition to local authentication (.sample is used +# if default does not exist). +#auth_config_file = config/auth_conf.xml + +# Optional list of email addresses of API users who can make calls on behalf of +# other users. +#api_allow_run_as = None + +# Master key that allows many API admin actions to be used without actually +# having a defined admin user in the database/config. Only set this if you +# need to bootstrap Galaxy, you probably do not want to set this on public +# servers. +#master_api_key = changethis + +# Enable tool tags (associating tools with tags). This has its own option +# since its implementation has a few performance implications on startup for +# large servers. +#enable_tool_tags = False + +# Enable a feature when running workflows. When enabled, default datasets +# are selected for "Set at Runtime" inputs from the history such that the +# same input will not be selected twice, unless there are more inputs than +# compatible datasets in the history. +# When False, the most recently added compatible item in the history will +# be used for each "Set at Runtime" input, independent of others in the Workflow +#enable_unique_workflow_defaults = False + +# The URL to the myExperiment instance being used (omit scheme but include port) +#myexperiment_url = www.myexperiment.org:80 + +# Enable Galaxy's "Upload via FTP" interface. You'll need to install and +# configure an FTP server (we've used ProFTPd since it can use Galaxy's +# database for authentication) and set the following two options. + +# This should point to a directory containing subdirectories matching users' +# identifier (defaults to e-mail), where Galaxy will look for files. +#ftp_upload_dir = None + +# This should be the hostname of your FTP server, which will be provided to +# users in the help text. +#ftp_upload_site = None + +# User attribute to use as subdirectory in calculating default ftp_upload_dir +# pattern. By default this will be email so a user's FTP upload directory will be +# ${ftp_upload_dir}/${user.email}. Can set this to other attributes such as id or +# username though. +#ftp_upload_dir_identifier = email + +# Python string template used to determine an FTP upload directory for a +# particular user. +#ftp_upload_dir_template = ${ftp_upload_dir}/${ftp_upload_dir_identifier} + +# This should be set to False to prevent Galaxy from deleting uploaded FTP files +# as it imports them. +#ftp_upload_purge = True + +# Enable enforcement of quotas. Quotas can be set from the Admin interface. +#enable_quotas = False + +# This option allows users to see the full path of datasets via the "View +# Details" option in the history. Administrators can always see this. +#expose_dataset_path = False + +# Data manager configuration options +# Allow non-admin users to view available Data Manager options. +#enable_data_manager_user_view = False +# File where Data Managers are configured (.sample used if default does not +# exist). +#data_manager_config_file = config/data_manager_conf.xml +# File where Tool Shed based Data Managers are configured. +#shed_data_manager_config_file = config/shed_data_manager_conf.xml +# Directory to store Data Manager based tool-data; defaults to tool_data_path. +#galaxy_data_manager_data_path = tool-data + +# -- Job Execution + +# To increase performance of job execution and the web interface, you can +# separate Galaxy into multiple processes. There are more than one way to do +# this, and they are explained in detail in the documentation: +# +# https://wiki.galaxyproject.org/Admin/Config/Performance/Scaling + +# By default, Galaxy manages and executes jobs from within a single process and +# notifies itself of new jobs via in-memory queues. Jobs are run locally on +# the system on which Galaxy is started. Advanced job running capabilities can +# be configured through the job configuration file. +#job_config_file = config/job_conf.xml + +# In multiprocess configurations, notification between processes about new jobs +# must be done via the database. In single process configurations, this can be +# done in memory, which is a bit quicker. +#track_jobs_in_database = True + +# This enables splitting of jobs into tasks, if specified by the particular tool +# config. +# This is a new feature and not recommended for production servers yet. +#use_tasked_jobs = False +#local_task_queue_workers = 2 + +# Enable job recovery (if Galaxy is restarted while cluster jobs are running, +# it can "recover" them when it starts). This is not safe to use if you are +# running more than one Galaxy server using the same database. +#enable_job_recovery = True + +# Although it is fairly reliable, setting metadata can occasionally fail. In +# these instances, you can choose to retry setting it internally or leave it in +# a failed state (since retrying internally may cause the Galaxy process to be +# unresponsive). If this option is set to False, the user will be given the +# option to retry externally, or set metadata manually (when possible). +#retry_metadata_internally = True + +# Very large metadata values can cause Galaxy crashes. This will allow +# limiting the maximum metadata key size (in bytes used in memory, not the end +# result database value size) Galaxy will attempt to save with a dataset. Use +# 0 to disable this feature. The default is 5MB, but as low as 1MB seems to be +# a reasonable size. +#max_metadata_value_size = 5242880 + +# If (for example) you run on a cluster and your datasets (by default, +# database/files/) are mounted read-only, this option will override tool output +# paths to write outputs to the working directory instead, and the job manager +# will move the outputs to their proper place in the dataset directory on the +# Galaxy server after the job completes. +#outputs_to_working_directory = False + +# If your network filesystem's caching prevents the Galaxy server from seeing +# the job's stdout and stderr files when it completes, you can retry reading +# these files. The job runner will retry the number of times specified below, +# waiting 1 second between tries. For NFS, you may want to try the -noac mount +# option (Linux) or -actimeo=0 (Solaris). +#retry_job_output_collection = 0 + +# Clean up various bits of jobs left on the filesystem after completion. These +# bits include the job working directory, external metadata temporary files, +# and DRM stdout and stderr files (if using a DRM). Possible values are: +# always, onsuccess, never +#cleanup_job = always + +# For sites where all users in Galaxy match users on the system on which Galaxy +# runs, the DRMAA job runner can be configured to submit jobs to the DRM as the +# actual user instead of as the user running the Galaxy server process. For +# details on these options, see the documentation at: +# +# https://wiki.galaxyproject.org/Admin/Config/Performance/Cluster +# +#drmaa_external_runjob_script = scripts/drmaa_external_runner.py +#drmaa_external_killjob_script = scripts/drmaa_external_killer.py +#external_chown_script = scripts/external_chown_script.py + +# File to source to set up the environment when running jobs. By default, the +# environment in which the Galaxy server starts is used when running jobs +# locally, and the environment set up per the DRM's submission method and +# policy is used when running jobs on a cluster (try testing with `qsub` on the +# command line). environment_setup_file can be set to the path of a file on +# the cluster that should be sourced by the user to set up the environment +# prior to running tools. This can be especially useful for running jobs as +# the actual user, to remove the need to configure each user's environment +# individually. +#environment_setup_file = None + +# Optional file containing job resource data entry fields definition. +# These fields will be presented to users in the tool forms and allow them to +# overwrite default job resources such as number of processors, memory and +# walltime. +#job_resource_params_file = config/job_resource_params_conf.xml + +# If using job concurrency limits (configured in job_config_file), several +# extra database queries must be performed to determine the number of jobs a +# user has dispatched to a given destination. By default, these queries will +# happen for every job that is waiting to run, but if cache_user_job_count is +# set to True, it will only happen once per iteration of the handler queue. +# Although better for performance due to reduced queries, the tradeoff is a +# greater possibility that jobs will be dispatched past the configured limits +# if running many handlers. +#cache_user_job_count = False + +# -- ToolBox filtering + +# Modules from lib/galaxy/tools/toolbox/filters/ can be specified in +# the following lines. tool_* filters will be applied for all users +# and can not be changed by them. user_tool_* filters will be shown +# under user preferences and can be toggled on and off at +# runtime. Example shown below are not real defaults (no custom +# filters are applied by default), but can be enabled by renaming the +# example.py.sample in the filters directory to example.py. + +#tool_filters = +#tool_label_filters = +#tool_section_filters = +#user_tool_filters = examples:restrict_upload_to_admins, examples:restrict_encode +#user_tool_section_filters = examples:restrict_text +#user_tool_label_filters = examples:restrict_upload_to_admins, examples:restrict_encode + +# The base modules that are searched for modules as described above +# can be modified and modules external to Galaxy can be searched by +# modifying the following option. +#toolbox_filter_base_modules = galaxy.tools.toolbox.filters,galaxy.tools.filters + +# -- Galaxy Application Internal Message Queue + +# Galaxy uses AMQP internally TODO more documentation on what for. +# For examples, see http://ask.github.io/kombu/userguide/connections.html +# +# Without specifying anything here, galaxy will first attempt to use your +# specified database_connection above. If that's not specified either, Galaxy +# will automatically create and use a separate sqlite database located in your +# /database folder (indicated in the commented out line below). + +#amqp_internal_connection = sqlalchemy+sqlite:///./database/control.sqlite?isolation_level=IMMEDIATE + +# Galaxy real time communication server settings +#enable_communication_server = False +#communication_server_host = http://localhost +#communication_server_port = 7070 +# persistent_communication_rooms is a comma-separated list of rooms that should be always available. +#persistent_communication_rooms = + + +# ---- Galaxy External Message Queue ------------------------------------------------- + +# Galaxy uses Advanced Message Queuing Protocol (AMQP) to receive messages from +# external sources like barcode scanners. Galaxy has been tested against +# RabbitMQ AMQP implementation. For Galaxy to receive messages from a message +# queue, the RabbitMQ server has to be set up with a user account and other +# parameters listed below. The 'host' and 'port' fields should point to where +# the RabbitMQ server is running. + +[galaxy_amqp] + +#host = 127.0.0.1 +#port = 5672 +#userid = galaxy +#password = galaxy +#virtual_host = galaxy_messaging_engine +#queue = galaxy_queue +#exchange = galaxy_exchange +#routing_key = bar_code_scanner +#rabbitmqctl_path = /path/to/rabbitmqctl diff --git a/test/unit/config/1607_root_filters/config/tool_shed.ini b/test/unit/config/1607_root_filters/config/tool_shed.ini new file mode 100644 index 00000000000..259cff85fb5 --- /dev/null +++ b/test/unit/config/1607_root_filters/config/tool_shed.ini @@ -0,0 +1,188 @@ +# ---- HTTP Server ---------------------------------------------------------- + +[server:main] + +use = egg:Paste#http +port = 9009 + +# The address on which to listen. By default, only listen to localhost +# (the Tool Shed will not be accessible over the network). +# Use '0.0.0.0' to listen on all available network interfaces. +#host = 0.0.0.0 +host = 127.0.0.1 + +use_threadpool = true +threadpool_workers = 10 +# Set the number of seconds a thread can work before you should kill it +# (assuming it will never finish) to 3 hours. +threadpool_kill_thread_limit = 10800 + +# Define the proxy-prefix filter. +[filter:proxy-prefix] +use = egg:PasteDeploy#prefix +prefix = /shed + +# ---- Galaxy Tool Shed ----------------------------------------------------- + +[app:main] + +filter-with = proxy-prefix + +# Specifies the factory for the universe WSGI application +paste.app_factory = galaxy.webapps.tool_shed.buildapp:app_factory + +# Verbosity of console log messages. Acceptable values can be found here: +# https://docs.python.org/2/library/logging.html#logging-levels +#log_level = DEBUG + +# By default, the Tool Shed uses a SQLite database at 'database/community.sqlite'. You +# may use a SQLAlchemy connection string to specify an external database +# instead. This string takes many options which are explained in detail in the +# config file documentation. +#database_connection = sqlite:///./database/community.sqlite?isolation_level=IMMEDIATE + +# Where the hgweb.config file is stored. +# The default is the Galaxy installation directory. +#hgweb_config_dir = None + +# Where tool shed repositories are stored. +#file_path = database/community_files + +# Temporary storage for additional datasets, +# this should be shared through the cluster +#new_file_path = database/tmp + +# File containing old-style genome builds +#builds_file_path = tool-data/shared/ucsc/builds.txt + +# Format string used when showing date and time information. +# The string may contain: +# - the directives used by Python time.strftime() function (see +# https://docs.python.org/2/library/time.html#time.strftime ), +# - $locale (complete format string for the server locale), +# - $iso8601 (complete format string as specified by ISO 8601 international +# standard). +#pretty_datetime_format = $locale (UTC) + +# -- Repository and Tool search +# Using the script located at scripts/build_ts_whoosh_index.py +# you can generate search index and allow full text API searching over +# the repositories and tools within the Tool Shed given that you specify +# the following two config options. +#toolshed_search_on = True +#whoosh_index_dir = database/toolshed_whoosh_indexes + +# The following boosts are used to customize this instance's TS search. +# The higher the boost, the more importance the scoring algorithm gives to the +# given field. + +# For searching repositories at /api/repositories: +#repo_name_boost = 0.9 +#repo_description_boost = 0.6 +#repo_long_description_boost = 0.5 +#repo_homepage_url_boost = 0.3 +#repo_remote_repository_url_boost = 0.2 +#repo_owner_username_boost = 0.3 + +# For searching tools at /api/tools +#tool_name_boost = 1.2 +#tool_description_boost = 0.6 +#tool_help_boost = 0.4 +#tool_repo_owner_username = 0.3 + +# -- Analytics + +# You can enter tracking code here to track visitor's behavior +# through your Google Analytics account. Example: UA-XXXXXXXX-Y +#ga_code = None + +# -- Users and Security + +# The Tool Shed encodes various internal values when these values will be output in +# some format (for example, in a URL or cookie). You should set a key to be +# used by the algorithm that encodes and decodes these values. It can be any +# string. If left unchanged, anyone could construct a cookie that would grant +# them access to others' sessions. +# One simple way to generate a value for this is with the shell command: +# python -c 'import time; print time.time()' | md5sum | cut -f 1 -d ' ' +#id_secret = changethisinproductiontoo + +# User authentication can be delegated to an upstream proxy server (usually +# Apache). The upstream proxy should set a REMOTE_USER header in the request. +# Enabling remote user disables regular logins. For more information, see: +# https://wiki.galaxyproject.org/Admin/Config/ApacheProxy +#use_remote_user = False + +# If use_remote_user is enabled, anyone who can log in to the Galaxy host may +# impersonate any other user by simply sending the appropriate header. Thus a +# secret shared between the upstream proxy server, and Galaxy is required. +# If anyone other than the Galaxy user is using the server, then apache/nginx +# should pass a value in the header 'GX_SECRET' that is identical the one below +#remote_user_secret = changethisinproductiontoo + +# 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 + +# NEVER enable this on a public site (even test or QA) +#use_interactive = 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 users, groups, roles, +# libraries, and more. +#admin_users = None + +# Force everyone to log in (disable anonymous access) +#require_login = False + +# For use by email messages sent from the tool shed +#smtp_server = smtp.your_tool_shed_server +#email_from = your_tool_shed_email@server + +# If your SMTP server requires a username and password, you can provide them +# here (password in cleartext here, but if your server supports STARTTLS it +# will be sent over the network encrypted). +#smtp_username = None +#smtp_password = None + +# If your SMTP server requires SSL from the beginning of the connection +#smtp_ssl = False + +# The URL linked by the "Support" link in the "Help" menu. +#support_url = https://wiki.galaxyproject.org/Support + +# Address to join mailing list +#mailing_join_addr = galaxy-announce-join@bx.psu.edu + +# Write thread status periodically to 'heartbeat.log' (careful, uses 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 + +# Show a message box under the masthead. +#message_box_visible = False +#message_box_content = None +#message_box_class = info + +# Serving static files (needed if running standalone) +#static_enabled = True +#static_cache_time = 360 +#static_dir = static/ +#static_images_dir = static/images +#static_favicon_dir = static/favicon.ico +#static_scripts_dir = static/scripts/ +#static_style_dir = static/style/blue + +# Sentry (getsentry.com) DSN for catching bugs. +#sentry_dsn = None \ No newline at end of file diff --git a/test/unit/config/1607_root_samples/config/galaxy.ini b/test/unit/config/1607_root_samples/config/galaxy.ini new file mode 100644 index 00000000000..ac1a8af0b21 --- /dev/null +++ b/test/unit/config/1607_root_samples/config/galaxy.ini @@ -0,0 +1,1240 @@ +# +# Galaxy is configured by default to be usable in a single-user development +# environment. To tune the application for a multi-user production +# environment, see the documentation at: +# +# http://usegalaxy.org/production +# + +# Throughout this sample configuration file, except where stated otherwise, +# uncommented values override the default if left unset, whereas commented +# values are set to the default value. Relative paths are relative to the root +# Galaxy directory. +# +# Examples of many of these options are explained in more detail in the wiki: +# +# https://wiki.galaxyproject.org/Admin/Config +# +# Config hackers are encouraged to check there before asking for help. + +# ---- HTTP Server ---------------------------------------------------------- + +# Configuration of the internal HTTP server. + +[server:main] + +# The internal HTTP server to use. Currently only Paste is provided. This +# option is required. +use = egg:Paste#http + +# The port on which to listen. +#port = 8080 + +# The address on which to listen. By default, only listen to localhost (Galaxy +# will not be accessible over the network). Use '0.0.0.0' to listen on all +# available network interfaces. +#host = 127.0.0.1 + +# Use a threadpool for the web server instead of creating a thread for each +# request. +use_threadpool = True + +# Number of threads in the web server thread pool. +#threadpool_workers = 10 + +# Set the number of seconds a thread can work before you should kill it +# (assuming it will never finish) to 3 hours. Default is 600 (10 minutes). +threadpool_kill_thread_limit = 10800 + +# ---- Filters -------------------------------------------------------------- + +# Filters sit between Galaxy and the HTTP server. + +# These filters are disabled by default. They can be enabled with +# 'filter-with' in the [app:main] section below. + +# Define the gzip filter. +[filter:gzip] +use = egg:Paste#gzip + +# Define the proxy-prefix filter. +[filter:proxy-prefix] +use = egg:PasteDeploy#prefix +prefix = /galaxy + +# ---- Galaxy --------------------------------------------------------------- + +# Configuration of the Galaxy application. + +[app:main] + +# -- Application and filtering + +# The factory for the WSGI application. This should not be changed. +paste.app_factory = galaxy.web.buildapp:app_factory + +# If not running behind a proxy server, you may want to enable gzip compression +# to decrease the size of data transferred over the network. If using a proxy +# server, please enable gzip compression there instead. +#filter-with = gzip + +# If running behind a proxy server and Galaxy is served from a subdirectory, +# enable the proxy-prefix filter and set the prefix in the +# [filter:proxy-prefix] section above. +#filter-with = proxy-prefix + +# If proxy-prefix is enabled and you're running more than one Galaxy instance +# behind one hostname, you will want to set this to the same path as the prefix +# in the filter above. This value becomes the "path" attribute set in the +# cookie so the cookies from each instance will not clobber each other. +#cookie_path = None + +# -- Database + +# By default, Galaxy uses a SQLite database at 'database/universe.sqlite'. You +# may use a SQLAlchemy connection string to specify an external database +# instead. This string takes many options which are explained in detail in the +# config file documentation. +#database_connection = sqlite:///./database/universe.sqlite?isolation_level=IMMEDIATE + +# If the server logs errors about not having enough database pool connections, +# you will want to increase these values, or consider running more Galaxy +# processes. +#database_engine_option_pool_size = 5 +#database_engine_option_max_overflow = 10 + +# If using MySQL and the server logs the error "MySQL server has gone away", +# you will want to set this to some positive value (7200 should work). +#database_engine_option_pool_recycle = -1 + +# If large database query results are causing memory or response time issues in +# the Galaxy process, leave the result on the server instead. This option is +# only available for PostgreSQL and is highly recommended. +#database_engine_option_server_side_cursors = False + +# Log all database transactions, can be useful for debugging and performance +# profiling. Logging is done via Python's 'logging' module under the qualname +# 'galaxy.model.orm.logging_connection_proxy' +#database_query_profiling_proxy = False + +# By default, Galaxy will use the same database to track user data and +# tool shed install data. There are many situations in which it is +# valuable to separate these - for instance bootstrapping fresh Galaxy +# instances with pretested installs. The following option can be used to +# separate the tool shed install database (all other options listed above +# but prefixed with install_ are also available). +#install_database_connection = sqlite:///./database/universe.sqlite?isolation_level=IMMEDIATE + +# Setting the following option to true will cause Galaxy to automatically +# migrate the database forward after updates. This is not recommended for production +# use. +#database_auto_migrate = False + +# -- Files and directories + +# Dataset files are stored in this directory. +#file_path = database/files + +# Temporary files are stored in this directory. +#new_file_path = database/tmp + +# Tool config files, defines what tools are available in Galaxy. +# Tools can be locally developed or installed from Galaxy tool sheds. +# (config/tool_conf.xml.sample will be used if left unset and +# config/tool_conf.xml does not exist). +#tool_config_file = config/tool_conf.xml,config/shed_tool_conf.xml + +# Enable / disable checking if any tools defined in the above non-shed +# tool_config_files (i.e., tool_conf.xml) have been migrated from the Galaxy +# code distribution to the Tool Shed. This setting should generally be set to +# False only for development Galaxy environments that are often rebuilt from +# scratch where migrated tools do not need to be available in the Galaxy tool +# panel. If the following setting remains commented, the default setting will +# be True. +#check_migrate_tools = True + +# Tool config maintained by tool migration scripts. If you use the migration +# scripts to install tools that have been migrated to the tool shed upon a new +# release, they will be added to this tool config file. +#migrated_tools_config = config/migrated_tools_conf.xml + +# File that contains the XML section and tool tags from all tool panel config +# files integrated into a single file that defines the tool panel layout. This +# file can be changed by the Galaxy administrator to alter the layout of the +# tool panel. If not present, Galaxy will create it. +#integrated_tool_panel_config = integrated_tool_panel.xml + +# Default path to the directory containing the tools defined in tool_conf.xml. +# Other tool config files must include the tool_path as an attribute in the +# tag. +#tool_path = tools + +# -- Tool dependencies + +# Path to the directory in which tool dependencies are placed. This is used by +# the Tool Shed to install dependencies and can also be used by administrators +# to manually install or link to dependencies. For details, see: +# https://wiki.galaxyproject.org/Admin/Config/ToolDependencies +# Set the string to None to explicitly disable tool dependency handling. +# If this option is set to none or an invalid path, installing tools with dependencies +# from the Tool Shed will fail. +#tool_dependency_dir = database/dependencies + +# The dependency resolvers config file specifies an ordering and options for how +# Galaxy resolves tool dependencies (requirement tags in Tool XML). The default +# ordering is to the use the Tool Shed for tools installed that way, use local +# Galaxy packages, and then use Conda if available. +# See https://github.com/galaxyproject/galaxy/blob/dev/doc/source/admin/dependency_resolvers.rst +# for more information on these options. +#dependency_resolvers_config_file = config/dependency_resolvers_conf.xml + +# The following Conda dependency resolution options will change the defaults for +# all Conda resolvers, but multiple resolvers can be configured independently +# in dependency_resolvers_config_file and these options overridden. +# Location on the filesystem where Conda packages are installed + +# conda_prefix is the location on the filesystem where Conda packages and environments are installed +# IMPORTANT: Due to a current limitation in conda, the total length of the +# conda_prefix and the job_working_directory path should be less than 50 characters! +#conda_prefix = /_conda +# Override the Conda executable to use, it will default to the one on the +# PATH (if available) and then to /bin/conda +#conda_exec = +# Pass debug flag to conda commands. +#conda_debug = False +# conda channels to enable by default (http://conda.pydata.org/docs/custom-channels.html) +#conda_ensure_channels = r,bioconda,iuc +# Set to True to instruct Galaxy to look for and install missing tool +# dependencies before each job runs. +#conda_auto_install = False +# Set to True to perform additional checking of installed Conda environment +#conda_verbose_install_check=False +# Set to True to instruct Galaxy to install Conda from the web automatically +# if it cannot find a local copy and conda_exec is not configured. +#conda_auto_init = False + +# File containing the Galaxy Tool Sheds that should be made available to +# install from in the admin interface (.sample used if default does not exist). +#tool_sheds_config_file = config/tool_sheds_conf.xml + +# Set to True to enable monitoring of tools and tool directories +# listed in any tool config file specified in tool_config_file option. +# If changes are found, tools are automatically reloaded. Watchdog ( +# https://pypi.python.org/pypi/watchdog ) must be installed and +# available to Galaxy to use this option. Other options include 'auto' +# which will attempt to watch tools if the watchdog library is available +# but won't fail to load Galaxy if it is not and 'polling' which will use +# a less efficient monitoring scheme that may work in wider range of scenarios +# than the watchdog default. +#watch_tools = False + +# Enable automatic polling of relative tool sheds to see if any updates +# are available for installed repositories. Ideally only one Galaxy +# server process should be able to check for repository updates. The +# setting for hours_between_check should be an integer between 1 and 24. +#enable_tool_shed_check = False +#hours_between_check = 12 + +# Enable use of an in-memory registry with bi-directional relationships between +# repositories (i.e., in addition to lists of dependencies for a repository, +# keep an in-memory registry of dependent items for each repository. +#manage_dependency_relationships = False + +# XML config file that contains data table entries for the +# ToolDataTableManager. This file is manually # maintained by the Galaxy +# administrator (.sample used if default does not exist). +#tool_data_table_config_path = config/tool_data_table_conf.xml + +# XML config file that contains additional data table entries for the +# ToolDataTableManager. This file is automatically generated based on the +# current installed tool shed repositories that contain valid +# tool_data_table_conf.xml.sample files. At the time of installation, these +# entries are automatically added to the following file, which is parsed and +# applied to the ToolDataTableManager at server start up. +#shed_tool_data_table_config = config/shed_tool_data_table_conf.xml + +# Directory where data used by tools is located, see the samples in that +# directory and the wiki for help: +# https://wiki.galaxyproject.org/Admin/DataIntegration +#tool_data_path = tool-data + +# Directory where Tool Data Table related files will be placed +# when installed from a ToolShed. Defaults to tool_data_path. +#shed_tool_data_path = tool-data + +# File containing old-style genome builds +#builds_file_path = tool-data/shared/ucsc/builds.txt + +# Directory where chrom len files are kept, currently mainly used by trackster +#len_file_path = tool-data/shared/ucsc/chrom + +# Datatypes config file(s), defines what data (file) types are available in +# Galaxy (.sample is used if default does not exist). If a datatype appears in +# multiple files, the last definition is used (though the first sniffer is used +# so limit sniffer definitions to one file). +#datatypes_config_file = config/datatypes_conf.xml + +# Disable the 'Auto-detect' option for file uploads +#datatypes_disable_auto = False + +# Visualizations config directory: where to look for individual visualization +# plugins. The path is relative to the Galaxy root dir. To use an absolute +# path begin the path with '/'. This is a comma separated list. +# Defaults to "config/plugins/visualizations". +#visualization_plugins_directory = config/plugins/visualizations + +# Interactive environment plugins root directory: where to look for interactive +# environment plugins. By default none will be loaded. Set to +# config/plugins/interactive_environments to load Galaxy's stock plugins +# (currently just IPython). These will require Docker to be configured and +# have security considerations, so proceed with caution. The path is relative to the +# Galaxy root dir. To use an absolute path begin the path with '/'. This is a comma +# separated list. +#interactive_environment_plugins_directory = + +# Interactive tour directory: where to store interactive tour definition files. +# Galaxy ships with several basic interface tours enabled, though a different +# directory with custom tours can be specified here. The path is relative to the +# Galaxy root dir. To use an absolute path begin the path with '/'. This is a comma +# separated list. +#tour_config_dir = config/plugins/tours + +# Each job is given a unique empty directory as its current working directory. +# This option defines in what parent directory those directories will be +# created. +#job_working_directory = database/job_working_directory + +# If using a cluster, Galaxy will write job scripts and stdout/stderr to this +# directory. +#cluster_files_directory = database/pbs + +# Mako templates are compiled as needed and cached for reuse, this directory is +# used for the cache +#template_cache_path = database/compiled_templates + +# Set to false to disable various checks Galaxy will do to ensure it +# can run job scripts before attempting to execute or submit them. +#check_job_script_integrity = True +# Number of checks to execute if check_job_script_integrity is enabled. +#check_job_script_integrity_count = 35 +# Time to sleep between checks if check_job_script_integrity is enabled (in seconds). +#check_job_script_integrity_sleep = .25 + +# Set the default shell used by non-containerized jobs Galaxy-wide. This +# defaults to bash for all jobs and can be overidden at the destination +# level for heterogenous clusters. conda job resolution requires bash or zsh +# so if this is switched to /bin/sh for instance - conda resolution +# should be disabled. Containerized jobs always use /bin/sh - so more maximum +# portability tool authors should assume generated commands run in sh. +#default_job_shell = /bin/bash + +# Citation related caching. Tool citations information maybe fetched from +# external sources such as http://dx.doi.org/ by Galaxy - the following +# parameters can be used to control the caching used to store this information. +#citation_cache_type = file +#citation_cache_data_dir = database/citations/data +#citation_cache_lock_dir = database/citations/lock + +# External service types config file, defining what types of external_services +# configurations are available in Galaxy (.sample is used if default does not +# exist). +#external_service_type_config_file = config/external_service_types_conf.xml + +# Path to the directory containing the external_service_types defined in the +# config. +#external_service_type_path = external_service_types + +# Tools with a number of outputs not known until runtime can write these +# outputs to a directory for collection by Galaxy when the job is done. +# Previously, this directory was new_file_path, but using one global directory +# can cause performance problems, so using job_working_directory ('.' or cwd +# when a job is run) is encouraged. By default, both are checked to avoid +# breaking existing tools. +#collect_outputs_from = new_file_path,job_working_directory + +# -- Data Storage (Object Store) +# +# Configuration file for the object store +# If this is set and exists, it overrides any other objectstore settings. +# object_store_config_file = config/object_store_conf.xml + + +# -- Mail and notification + +# Galaxy sends mail for various things: subscribing users to the mailing list +# if they request it, password resets, notifications from the Galaxy Sample +# Tracking system, reporting dataset errors, and sending activation emails. +# To do this, it needs to send mail through an SMTP server, which you may +# define here (host:port). +# Galaxy will automatically try STARTTLS but will continue upon failure. +#smtp_server = None + +# If your SMTP server requires a username and password, you can provide them +# here (password in cleartext here, but if your server supports STARTTLS it +# will be sent over the network encrypted). +#smtp_username = None +#smtp_password = None + +# If your SMTP server requires SSL from the beginning of the connection +# smtp_ssl = False + +# On the user registration form, users may choose to join a mailing list. This +# is the address used to subscribe to the list. Uncomment and leave empty if you +# want to remove this option from the user registration form. +#mailing_join_addr = galaxy-announce-join@bx.psu.edu + +# Datasets in an error state include a link to report the error. Those reports +# will be sent to this address. Error reports are disabled if no address is +# set. Also this email is shown as a contact to user in case of Galaxy +# misconfiguration and other events user may encounter. +#error_email_to = None + +# Email address to use in the 'From' field when sending emails for +# account activations, workflow step notifications and password resets. +# We recommend using string in the following format: +# Galaxy Project +# If not configured, '' will be used. +#email_from = None + +# URL of the support resource for the galaxy instance. Used in activation +# emails. +#instance_resource_url = https://wiki.galaxyproject.org/ + +# E-mail domains blacklist is used for filtering out users that are using +# disposable email address during the registration. If their address domain +# matches any domain in the blacklist, they are refused the registration. +#blacklist_file = config/disposable_email_blacklist.conf + +# Registration warning message is used to discourage people from registering +# multiple accounts. Applies mostly for the main Galaxy instance. +# If no message specified the warning box will not be shown. +#registration_warning_message = Please register only one account - we provide this service free of charge and have limited computational resources. Multi-accounts are tracked and will be subjected to account termination and data deletion. + + +# -- Account activation + +# User account activation feature global flag. If set to "False", the rest of +# the Account activation configuration is ignored and user activation is +# disabled (i.e. accounts are active since registration). +# The activation is also not working in case the SMTP server is not defined. +#user_activation_on = False + +# Activation grace period (in hours). Activation is not forced (login is not +# disabled) until grace period has passed. Users under grace period can't run +# jobs. Enter 0 to disable grace period. +# Users with OpenID logins have grace period forever. +#activation_grace_period = 3 + +# Shown in warning box to users that were not activated yet. +# In use only if activation_grace_period is set. +#inactivity_box_content = Your account has not been activated yet. Feel free to browse around and see what's available, but you won't be able to upload data or run jobs until you have verified your email address. + +# Password expiration period (in days). Users are required to change their +# password every x days. Users will be redirected to the change password +# screen when they log in after their password expires. Enter 0 to disable +# password expiration. +#password_expiration_period = 0 + +# Galaxy Session Timeout +# This provides a timeout (in minutes) after which a user will have to log back in. +# A duration of 0 disables this feature. +#session_duration = 0 + + +# -- Analytics + +# You can enter tracking code here to track visitor's behavior +# through your Google Analytics account. Example: UA-XXXXXXXX-Y +#ga_code = None + +# -- Display sites + +# Galaxy can display data at various external browsers. These options specify +# which browsers should be available. URLs and builds available at these +# browsers are defined in the specifield files. + +# If use_remote_user = True, display application servers will be denied access +# to Galaxy and so displaying datasets in these sites will fail. +# display_servers contains a list of hostnames which should be allowed to +# bypass security to display datasets. Please be aware that there are security +# implications if this is allowed. More details (including required changes to +# the proxy server config) are available in the Apache proxy documentation on +# the wiki. +# +# The list of servers in this sample config are for the UCSC Main, Test and +# Archaea browsers, but the default if left commented is to not allow any +# display sites to bypass security (you must uncomment the line below to allow +# them). +#display_servers = hgw1.cse.ucsc.edu,hgw2.cse.ucsc.edu,hgw3.cse.ucsc.edu,hgw4.cse.ucsc.edu,hgw5.cse.ucsc.edu,hgw6.cse.ucsc.edu,hgw7.cse.ucsc.edu,hgw8.cse.ucsc.edu,lowepub.cse.ucsc.edu + +# To disable the old-style display applications that are hardcoded into +# datatype classes, set enable_old_display_applications = False. +# This may be desirable due to using the new-style, XML-defined, display +# applications that have been defined for many of the datatypes that have the +# old-style. +# There is also a potential security concern with the old-style applications, +# where a malicious party could provide a link that appears to reference the +# Galaxy server, but contains a redirect to a third-party server, tricking a +# Galaxy user to access said site. +#enable_old_display_applications = True + +# -- Next gen LIMS interface on top of existing Galaxy Sample/Request +# management code. + +use_nglims = False +nglims_config_file = tool-data/nglims.yaml + +# -- UI Localization + +# Show a message box under the masthead. +#message_box_visible = False +#message_box_content = None +#message_box_class = info + +# Append "/{brand}" to the "Galaxy" text in the masthead. +#brand = None + +# Format string used when showing date and time information. +# The string may contain: +# - the directives used by Python time.strftime() function (see +# https://docs.python.org/2/library/time.html#time.strftime ), +# - $locale (complete format string for the server locale), +# - $iso8601 (complete format string as specified by ISO 8601 international +# standard). +# pretty_datetime_format = $locale (UTC) + +# URL (with schema http/https) of the Galaxy instance as accessible within your +# local network - if specified used as a default by pulsar file staging and +# IPython Docker container for communicating back with Galaxy via the API. +#galaxy_infrastructure_url = http://localhost:8080 + +# If the above URL cannot be determined ahead of time in dynamic environments +# but the port which should be used to access Galaxy can be - this should be +# set to prevent Galaxy from having to guess. For example if Galaxy is sitting +# behind a proxy with REMOTE_USER enabled - infrastructure shouldn't talk to +# Python processes directly and this should be set to 80 or 443, etc... If +# unset this file will be read for a server block defining a port corresponding +# to the webapp. +#galaxy_infrastructure_web_port = 8080 + +# The URL of the page to display in Galaxy's middle pane when loaded. This can +# be an absolute or relative URL. +#welcome_url = /static/welcome.html + +# The URL linked by the "Galaxy/brand" text. +#logo_url = / + +# The URL linked by the "Wiki" link in the "Help" menu. +#wiki_url = https://wiki.galaxyproject.org/ + +# The URL linked by the "Support" link in the "Help" menu. +#support_url = https://wiki.galaxyproject.org/Support + +# The URL linked by the "How to Cite Galaxy" link in the "Help" menu. +#citation_url = https://wiki.galaxyproject.org/CitingGalaxy + +# The URL linked by the "Search" link in the "Help" menu. +#search_url = http://galaxyproject.org/search/usegalaxy/ + +# The URL linked by the "Mailing Lists" link in the "Help" menu. +#mailing_lists_url = https://wiki.galaxyproject.org/MailingLists + +# The URL linked by the "Videos" link in the "Help" menu. +#screencasts_url = https://vimeo.com/galaxyproject + +# The URL linked by the "Terms and Conditions" link in the "Help" menu, as well +# as on the user registration and login forms and in the activation emails. +#terms_url = None + +# The URL linked by the "Galaxy Q&A" link in the "Help" menu +# The Galaxy Q&A site is under development; when the site is done, this URL +# will be set and uncommented. +#qa_url = + +# Serve static content, which must be enabled if you're not serving it via a +# proxy server. These options should be self explanatory and so are not +# documented individually. You can use these paths (or ones in the proxy +# server) to point to your own styles. +#static_enabled = True +#static_cache_time = 360 +#static_dir = static/ +#static_images_dir = static/images +#static_favicon_dir = static/favicon.ico +#static_scripts_dir = static/scripts/ +#static_style_dir = static/june_2007_style/blue +#static_robots_txt = static/robots.txt + +# Incremental Display Options + +#display_chunk_size = 65536 + +# -- Advanced proxy features + +# For help on configuring the Advanced proxy features, see: +# http://usegalaxy.org/production + +# Apache can handle file downloads (Galaxy-to-user) via mod_xsendfile. Set +# this to True to inform Galaxy that mod_xsendfile is enabled upstream. +#apache_xsendfile = False + +# The same download handling can be done by nginx using X-Accel-Redirect. This +# should be set to the path defined in the nginx config as an internal redirect +# with access to Galaxy's data files (see documentation linked above). +#nginx_x_accel_redirect_base = False + +# nginx can make use of mod_zip to create zip files containing multiple library +# files. If using X-Accel-Redirect, this can be the same value as that option. +#nginx_x_archive_files_base = False + +# If using compression in the upstream proxy server, use this option to disable +# gzipping of library .tar.gz and .zip archives, since the proxy server will do +# it faster on the fly. +#upstream_gzip = False + +# The following default adds a header to web request responses that +# will cause modern web browsers to not allow Galaxy to be embedded in +# the frames of web applications hosted at other hosts - this can help +# prevent a class of attack called clickjacking +# (https://www.owasp.org/index.php/Clickjacking). If you configure a +# proxy in front of Galaxy - please ensure this header remains intact +# to protect your users. Uncomment and leave empty to not set the +# `X-Frame-Options` header. +#x_frame_options = SAMEORIGIN + +# nginx can also handle file uploads (user-to-Galaxy) via nginx_upload_module. +# Configuration for this is complex and explained in detail in the +# documentation linked above. The upload store is a temporary directory in +# which files uploaded by the upload module will be placed. +#nginx_upload_store = False + +# This value overrides the action set on the file upload form, e.g. the web +# path where the nginx_upload_module has been configured to intercept upload +# requests. +#nginx_upload_path = False + +# Galaxy can also use nginx_upload_module to receive files staged out upon job +# completion by remote job runners (i.e. Pulsar) that initiate staging +# operations on the remote end. See the Galaxy nginx documentation for the +# corresponding nginx configuration. +#nginx_upload_job_files_store = False +#nginx_upload_job_files_path = False + +# Have Galaxy manage dynamic proxy component for routing requests to other +# services based on Galaxy's session cookie. It will attempt to do this by +# default though you do need to install node+npm and do an npm install from +# `lib/galaxy/web/proxy/js`. It is generally more robust to configure this +# externally managing it however Galaxy is managed. If True Galaxy will only +# launch the proxy if it is actually going to be used (e.g. for IPython). +#dynamic_proxy_manage=True + +# As of 16.04 Galaxy supports multiple proxy types. The original NodeJS +# implementation, alongside a new Golang single-binary-no-dependencies +# version. Valid values are (node, golang) +#dynamic_proxy=node + +# The NodeJS dynamic proxy can use an SQLite database or a JSON file for IPC, +# set that here. +#dynamic_proxy_session_map=database/session_map.sqlite + +# Set the port and IP for the the dynamic proxy to bind to, this must match +# the external configuration if dynamic_proxy_manage is False. +#dynamic_proxy_bind_port=8800 +#dynamic_proxy_bind_ip=0.0.0.0 + +# Enable verbose debugging of Galaxy-managed dynamic proxy. +#dynamic_proxy_debug=False + +# The dynamic proxy is proxied by an external proxy (e.g. apache frontend to +# nodejs to wrap connections in SSL). +#dynamic_proxy_external_proxy=False + +# Additionally, when the dynamic proxy is proxied by an upstream server, you'll +# want to specify a prefixed URL so both Galaxy and the proxy reside under the +# same path that your cookies are under. This will result in a url like +# https://FQDN/galaxy-prefix/gie_proxy for proxying +#dynamic_proxy_prefix=gie_proxy + +# The Golang proxy also manages the docker containers more closely than the +# NodeJS proxy, so is able to expose more container management related options + +# This attribute governs the minimum length of time between consecutive HTTP/WS +# requests through the proxy, before the proxy considers a container as being +# inactive and kills it. +#dynamic_proxy_golang_noaccess = 60 + +# In order to kill containers, the golang proxy has to check at some interval +# for possibly dead containers. This is exposed as a configurable parameter, +# but the default value is probably fine. +#dynamic_proxy_golang_clean_interval = 10 + +# The golang proxy needs to know how to talk to your docker daemon. Currently +# TLS is not supported, that will come in an update. +#dynamic_proxy_golang_docker_address = unix:///var/run/docker.sock + +# The golang proxy uses a RESTful HTTP API for communication with Galaxy +# instead of a JSON or SQLite file for IPC. If you do not specify this, it will +# be set randomly for you. You should set this if you are managing the proxy +# manually. +#dynamic_proxy_golang_api_key = None + +# -- Logging and Debugging + +# If True, Galaxy will attempt to configure a simple root logger if a +# "loggers" section does not appear in this configuration file. +#auto_configure_logging = True + +# Verbosity of console log messages. Acceptable values can be found here: +# https://docs.python.org/2/library/logging.html#logging-levels +#log_level = DEBUG + +# Print database operations to the server log (warning, quite verbose!). +#database_engine_option_echo = False + +# Print database pool operations to the server log (warning, quite verbose!). +#database_engine_option_echo_pool = False + +# Turn on logging of application events and some user events to the database. +#log_events = True + +# Turn on logging of user actions to the database. Actions currently logged +# are grid views, tool searches, and use of "recently" used tools menu. The +# log_events and log_actions functionality will eventually be merged. +#log_actions = True + +# Fluentd configuration. Various events can be logged to the fluentd instance +# configured below by enabling fluent_log. +#fluent_log = False +#fluent_host = localhost +#fluent_port = 24224 + +# Sanitize all HTML tool output. By default, all tool output served as +# 'text/html' will be sanitized thoroughly. This can be disabled if you have +# special tools that require unaltered output. WARNING: disabling this does +# make the Galaxy instance susceptible to XSS attacks initiated by your users. +#sanitize_all_html = True + +# Whitelist sanitization file. +# Datasets created by tools listed in this file are trusted and will not have +# their HTML sanitized on display. This can be manually edited or manipulated +# through the Admin control panel -- see "Manage Display Whitelist" +#sanitize_whitelist_file = config/sanitize_whitelist.txt + +# By default Galaxy will serve non-HTML tool output that may potentially +# contain browser executable JavaScript content as plain text. This will for +# instance cause SVG datasets to not render properly and so may be disabled +# by setting the following option to True. +#serve_xss_vulnerable_mimetypes = False + +# Return a Access-Control-Allow-Origin response header that matches the Origin +# header of the request if that Origin hostname matches one of the strings or +# regular expressions listed here. This is a comma separated list of hostname +# strings or regular expressions beginning and ending with /. +# E.g. mysite.com,google.com,usegalaxy.org,/^[\w\.]*example\.com/ +# See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS +#allowed_origin_hostnames = None + +# Set the following to True to use IPython nbconvert to build HTML from IPython +# notebooks in Galaxy histories. This process may allow users to execute +# arbitrary code or serve arbitrary HTML. If enabled, IPython must be +# available and on Galaxy's PATH, to do this run +# `pip install jinja2 pygments ipython` in Galaxy's virtualenv. +#trust_ipython_notebook_conversion = False + +# Debug enables access to various config options useful for development and +# debugging: use_lint, use_profile, use_printdebug and use_interactive. It +# also causes the files used by PBS/SGE (submission script, output, and error) +# to remain on disk after the job is complete. +#debug = False + +# Check for WSGI compliance. +#use_lint = False + +# Run the Python profiler on each request. +#use_profile = False + +# Intercept print statements and show them on the returned page. +#use_printdebug = True + +# Enable live debugging in your browser. This should NEVER be enabled on a +# public site. Enabled in the sample config for development. +use_interactive = True + +# Write thread status periodically to 'heartbeat.log', (careful, uses disk +# space rapidly!). Useful to determine why your processes may be consuming a +# lot of CPU. +#use_heartbeat = False + +# Control the period (in seconds) between dumps. Use -1 to disable. Regardless +# of this setting, if use_heartbeat is enabled, you can send a Galaxy process +# (unless running with uWSGI) SIGUSR1 (`kill -USR1`) to force a dump. +#heartbeat_interval = 20 + +# Heartbeat log filename. Can accept the template variables {server_name} and +# {pid} +#heartbeat_log = heartbeat_{server_name}.log + +# Log to Sentry +# Sentry is an open source logging and error aggregation platform. Setting +# sentry_dsn will enable the Sentry middleware and errors will be sent to the +# indicated sentry instance. This connection string is available in your +# sentry instance under -> Settings -> API Keys. +#sentry_dsn = None + +# Log to statsd +# Statsd is an external statistics aggregator (https://github.com/etsy/statsd) +# Enabling the following options will cause galaxy to log request timing and +# other statistics to the configured statsd instance. The statsd_prefix is +# useful if you are running multiple Galaxy instances and want to segment +# statistics between them within the same aggregator. +#statsd_host= +#statsd_port=8125 +#statsd_prefix=galaxy + +# -- Data Libraries + +# These library upload options are described in much more detail in the wiki: +# https://wiki.galaxyproject.org/Admin/DataLibraries/UploadingLibraryFiles + +# Add an option to the library upload form which allows administrators to +# upload a directory of files. +#library_import_dir = None + +# Add an option to the library upload form which allows authorized +# non-administrators to upload a directory of files. The configured directory +# must contain sub-directories named the same as the non-admin user's Galaxy +# login ( email ). The non-admin user is restricted to uploading files or +# sub-directories of files contained in their directory. +#user_library_import_dir = None + +# Add an option to the admin library upload tool allowing admins to paste +# filesystem paths to files and directories in a box, and these paths will be +# added to a library. Set to True to enable. Please note the security +# implication that this will give Galaxy Admins access to anything your Galaxy +# user has access to. +#allow_library_path_paste = False + +# Users may choose to download multiple files from a library in an archive. By +# default, Galaxy allows users to select from a few different archive formats +# if testing shows that Galaxy is able to create files using these formats. +# Specific formats can be disabled with this option, separate more than one +# format with commas. Available formats are currently 'zip', 'gz', and 'bz2'. +#disable_library_comptypes = + +# Some sequencer integration features in beta allow you to automatically +# transfer datasets. This is done using a lightweight transfer manager which +# runs outside of Galaxy (but is spawned by it automatically). Galaxy will +# communicate with this manager over the port specified here. +#transfer_manager_port = 8163 + +# Search data libraries with whoosh +#enable_whoosh_library_search = True +# Whoosh indexes are stored in this directory. +#whoosh_index_dir = database/whoosh_indexes + +# Search data libraries with lucene +#enable_lucene_library_search = False +# maximum file size to index for searching, in MB +#fulltext_max_size = 500 +#fulltext_noindex_filetypes = bam,sam,wig,bigwig,fasta,fastq,fastqsolexa,fastqillumina,fastqsanger +# base URL of server providing search functionality using lucene +#fulltext_url = http://localhost:8081 + +# -- Toolbox Search + +# The following boosts are used to customize this instance's toolbox search. +# The higher the boost, the more importance the scoring algorithm gives to the +# given field. Section refers to the tool group in the tool panel. Rest of +# the fields are tool's attributes. +# tool_name_boost = 9 +# tool_section_boost = 3 +# tool_description_boost = 2 +# tool_label_boost = 1 +# tool_stub_boost = 5 +# tool_help_boost = 0.5 + +# Limits the number of results in toolbox search. Can be used to tweak how many +# results will appear. +# tool_search_limit = 20 + +# -- Users and Security + +# Galaxy encodes various internal values when these values will be output in +# some format (for example, in a URL or cookie). You should set a key to be +# used by the algorithm that encodes and decodes these values. It can be any +# string. If left unchanged, anyone could construct a cookie that would grant +# them access to others' sessions. +# One simple way to generate a value for this is with the shell command: +# python -c 'import time; print time.time()' | md5sum | cut -f 1 -d ' ' +#id_secret = USING THE DEFAULT IS NOT SECURE! + +# User authentication can be delegated to an upstream proxy server (usually +# Apache). The upstream proxy should set a REMOTE_USER header in the request. +# Enabling remote user disables regular logins. For more information, see: +# https://wiki.galaxyproject.org/Admin/Config/ApacheProxy +#use_remote_user = False + +# If use_remote_user is enabled and your external authentication +# method just returns bare usernames, set a default mail domain to be appended +# to usernames, to become your Galaxy usernames (email addresses). +#remote_user_maildomain = None + +# If use_remote_user is enabled, the header that the upstream proxy provides +# the remote username in defaults to HTTP_REMOTE_USER (the 'HTTP_' is prepended +# by WSGI). This option allows you to change the header. Note, you still need +# to prepend 'HTTP_' to the header in this option, but your proxy server should +# *not* include 'HTTP_' at the beginning of the header name. +#remote_user_header = HTTP_REMOTE_USER + +# If use_remote_user is enabled, anyone who can log in to the Galaxy host may +# impersonate any other user by simply sending the appropriate header. Thus a +# secret shared between the upstream proxy server, and Galaxy is required. +# If anyone other than the Galaxy user is using the server, then apache/nginx +# should pass a value in the header 'GX_SECRET' that is identical to the one +# below. +#remote_user_secret = USING THE DEFAULT IS NOT SECURE! + +# If use_remote_user is enabled, you can set this to a URL that will log your +# users out. +#remote_user_logout_href = None + +# If your proxy and/or authentication source does not normalize e-mail +# addresses or user names being passed to Galaxy - set the following option +# to True to force these to lower case. +#normalize_remote_user_email = False + +# If an e-mail address is specified here, it will hijack remote user mechanics +# (``use_remote_user``) and have the webapp inject a single fixed user. This +# has the effect of turning Galaxy into a single user application with no +# login or external proxy required. Such applications should not be exposed to +# the world. +#single_user = + +# Administrative users - set this to a comma-separated list of valid Galaxy +# users (email addresses). These users will have access to the Admin section +# of the server, and will have access to create users, groups, roles, +# libraries, and more. For more information, see: +# https://wiki.galaxyproject.org/Admin/Interface +#admin_users = None + +# Force everyone to log in (disable anonymous access). +#require_login = False + +# Show the site's welcome page (see welcome_url) alongside the login page +# (even if require_login is True) +#show_welcome_with_login = False + +# Allow unregistered users to create new accounts (otherwise, they will have to +# be created by an admin). +#allow_user_creation = True + +# Allow administrators to delete accounts. +#allow_user_deletion = False + +# Allow administrators to log in as other users (useful for debugging) +#allow_user_impersonation = False + +# Allow users to remove their datasets from disk immediately (otherwise, +# datasets will be removed after a time period specified by an administrator in +# the cleanup scripts run via cron) +#allow_user_dataset_purge = True + +# By default, users' data will be public, but setting this to True will cause +# it to be private. Does not affect existing users and data, only ones created +# after this option is set. Users may still change their default back to +# public. +#new_user_dataset_access_role_default_private = False + +# Expose user list. Setting this to True will expose the user list to +# authenticated users. This makes sharing datasets in smaller galaxy instances +# much easier as they can type a name/email and have the correct user show up. +# This makes less sense on large public Galaxy instances where that data +# shouldn't be exposed. For semi-public Galaxies, it may make sense to expose +# just the username and not email, or vice versa. +#expose_user_name = False +#expose_user_email = False + +# -- Beta features + +# Enable new run workflow form +#run_workflow_toolform_upgrade = True + +# Enable Galaxy to communicate directly with a sequencer +#enable_sequencer_communication = False + +# Enable the new interface for installing tools from Tool Shed +# via the API. Admin menu will list both if enabled. +#enable_beta_ts_api_install = False + +# Set the following to a number of threads greater than 1 to spawn +# a Python task queue for dealing with large tool submissions (either +# through the tool form or as part of an individual workflow step across +# large collection). The size of a "large" tool request is controlled by +# the second parameter below and defaults to 10. This affects workflow +# scheduling and web processes, not job handlers. +#tool_submission_burst_threads = 1 +#tool_submission_burst_at = 10 + +# Enable beta workflow modules that should not yet be considered part of Galaxy's +# stable API. +#enable_beta_workflow_modules = False + +# Force usage of Galaxy's beta workflow scheduler under certain circumstances - +# this workflow scheduling forces Galaxy to schedule workflows in the background +# so initial submission of the workflows is signficantly sped up. This does +# however force the user to refresh their history manually to see newly scheduled +# steps (for "normal" workflows - steps are still scheduled far in advance of +# them being queued and scheduling here doesn't refer to actual cluster job +# scheduling). +# Workflows containing more than the specified number of steps will always use +# the Galaxy's beta workflow scheduling. +#force_beta_workflow_scheduled_min_steps=250 +# Switch to using Galaxy's beta workflow scheduling for all workflows involving +# ccollections. +#force_beta_workflow_scheduled_for_collections=False + +# Enable authentication via OpenID. Allows users to log in to their Galaxy +# account by authenticating with an OpenID provider. +#enable_openid = False +# .sample used if default does not exist +#openid_config_file = config/openid_conf.xml +#openid_consumer_cache_path = database/openid_consumer_cache + +# XML config file that allows the use of different authentication providers +# (e.g. LDAP) instead or in addition to local authentication (.sample is used +# if default does not exist). +#auth_config_file = config/auth_conf.xml + +# Optional list of email addresses of API users who can make calls on behalf of +# other users. +#api_allow_run_as = None + +# Master key that allows many API admin actions to be used without actually +# having a defined admin user in the database/config. Only set this if you +# need to bootstrap Galaxy, you probably do not want to set this on public +# servers. +#master_api_key = changethis + +# Enable tool tags (associating tools with tags). This has its own option +# since its implementation has a few performance implications on startup for +# large servers. +#enable_tool_tags = False + +# Enable a feature when running workflows. When enabled, default datasets +# are selected for "Set at Runtime" inputs from the history such that the +# same input will not be selected twice, unless there are more inputs than +# compatible datasets in the history. +# When False, the most recently added compatible item in the history will +# be used for each "Set at Runtime" input, independent of others in the Workflow +#enable_unique_workflow_defaults = False + +# The URL to the myExperiment instance being used (omit scheme but include port) +#myexperiment_url = www.myexperiment.org:80 + +# Enable Galaxy's "Upload via FTP" interface. You'll need to install and +# configure an FTP server (we've used ProFTPd since it can use Galaxy's +# database for authentication) and set the following two options. + +# This should point to a directory containing subdirectories matching users' +# identifier (defaults to e-mail), where Galaxy will look for files. +#ftp_upload_dir = None + +# This should be the hostname of your FTP server, which will be provided to +# users in the help text. +#ftp_upload_site = None + +# User attribute to use as subdirectory in calculating default ftp_upload_dir +# pattern. By default this will be email so a user's FTP upload directory will be +# ${ftp_upload_dir}/${user.email}. Can set this to other attributes such as id or +# username though. +#ftp_upload_dir_identifier = email + +# Python string template used to determine an FTP upload directory for a +# particular user. +#ftp_upload_dir_template = ${ftp_upload_dir}/${ftp_upload_dir_identifier} + +# This should be set to False to prevent Galaxy from deleting uploaded FTP files +# as it imports them. +#ftp_upload_purge = True + +# Enable enforcement of quotas. Quotas can be set from the Admin interface. +#enable_quotas = False + +# This option allows users to see the full path of datasets via the "View +# Details" option in the history. Administrators can always see this. +#expose_dataset_path = False + +# Data manager configuration options +# Allow non-admin users to view available Data Manager options. +#enable_data_manager_user_view = False +# File where Data Managers are configured (.sample used if default does not +# exist). +#data_manager_config_file = config/data_manager_conf.xml +# File where Tool Shed based Data Managers are configured. +#shed_data_manager_config_file = config/shed_data_manager_conf.xml +# Directory to store Data Manager based tool-data; defaults to tool_data_path. +#galaxy_data_manager_data_path = tool-data + +# -- Job Execution + +# To increase performance of job execution and the web interface, you can +# separate Galaxy into multiple processes. There are more than one way to do +# this, and they are explained in detail in the documentation: +# +# https://wiki.galaxyproject.org/Admin/Config/Performance/Scaling + +# By default, Galaxy manages and executes jobs from within a single process and +# notifies itself of new jobs via in-memory queues. Jobs are run locally on +# the system on which Galaxy is started. Advanced job running capabilities can +# be configured through the job configuration file. +#job_config_file = config/job_conf.xml + +# In multiprocess configurations, notification between processes about new jobs +# must be done via the database. In single process configurations, this can be +# done in memory, which is a bit quicker. +#track_jobs_in_database = True + +# This enables splitting of jobs into tasks, if specified by the particular tool +# config. +# This is a new feature and not recommended for production servers yet. +#use_tasked_jobs = False +#local_task_queue_workers = 2 + +# Enable job recovery (if Galaxy is restarted while cluster jobs are running, +# it can "recover" them when it starts). This is not safe to use if you are +# running more than one Galaxy server using the same database. +#enable_job_recovery = True + +# Although it is fairly reliable, setting metadata can occasionally fail. In +# these instances, you can choose to retry setting it internally or leave it in +# a failed state (since retrying internally may cause the Galaxy process to be +# unresponsive). If this option is set to False, the user will be given the +# option to retry externally, or set metadata manually (when possible). +#retry_metadata_internally = True + +# Very large metadata values can cause Galaxy crashes. This will allow +# limiting the maximum metadata key size (in bytes used in memory, not the end +# result database value size) Galaxy will attempt to save with a dataset. Use +# 0 to disable this feature. The default is 5MB, but as low as 1MB seems to be +# a reasonable size. +#max_metadata_value_size = 5242880 + +# If (for example) you run on a cluster and your datasets (by default, +# database/files/) are mounted read-only, this option will override tool output +# paths to write outputs to the working directory instead, and the job manager +# will move the outputs to their proper place in the dataset directory on the +# Galaxy server after the job completes. +#outputs_to_working_directory = False + +# If your network filesystem's caching prevents the Galaxy server from seeing +# the job's stdout and stderr files when it completes, you can retry reading +# these files. The job runner will retry the number of times specified below, +# waiting 1 second between tries. For NFS, you may want to try the -noac mount +# option (Linux) or -actimeo=0 (Solaris). +#retry_job_output_collection = 0 + +# Clean up various bits of jobs left on the filesystem after completion. These +# bits include the job working directory, external metadata temporary files, +# and DRM stdout and stderr files (if using a DRM). Possible values are: +# always, onsuccess, never +#cleanup_job = always + +# For sites where all users in Galaxy match users on the system on which Galaxy +# runs, the DRMAA job runner can be configured to submit jobs to the DRM as the +# actual user instead of as the user running the Galaxy server process. For +# details on these options, see the documentation at: +# +# https://wiki.galaxyproject.org/Admin/Config/Performance/Cluster +# +#drmaa_external_runjob_script = scripts/drmaa_external_runner.py +#drmaa_external_killjob_script = scripts/drmaa_external_killer.py +#external_chown_script = scripts/external_chown_script.py + +# File to source to set up the environment when running jobs. By default, the +# environment in which the Galaxy server starts is used when running jobs +# locally, and the environment set up per the DRM's submission method and +# policy is used when running jobs on a cluster (try testing with `qsub` on the +# command line). environment_setup_file can be set to the path of a file on +# the cluster that should be sourced by the user to set up the environment +# prior to running tools. This can be especially useful for running jobs as +# the actual user, to remove the need to configure each user's environment +# individually. +#environment_setup_file = None + +# Optional file containing job resource data entry fields definition. +# These fields will be presented to users in the tool forms and allow them to +# overwrite default job resources such as number of processors, memory and +# walltime. +#job_resource_params_file = config/job_resource_params_conf.xml + +# If using job concurrency limits (configured in job_config_file), several +# extra database queries must be performed to determine the number of jobs a +# user has dispatched to a given destination. By default, these queries will +# happen for every job that is waiting to run, but if cache_user_job_count is +# set to True, it will only happen once per iteration of the handler queue. +# Although better for performance due to reduced queries, the tradeoff is a +# greater possibility that jobs will be dispatched past the configured limits +# if running many handlers. +#cache_user_job_count = False + +# -- ToolBox filtering + +# Modules from lib/galaxy/tools/toolbox/filters/ can be specified in +# the following lines. tool_* filters will be applied for all users +# and can not be changed by them. user_tool_* filters will be shown +# under user preferences and can be toggled on and off at +# runtime. Example shown below are not real defaults (no custom +# filters are applied by default), but can be enabled by renaming the +# example.py.sample in the filters directory to example.py. + +#tool_filters = +#tool_label_filters = +#tool_section_filters = +#user_tool_filters = examples:restrict_upload_to_admins, examples:restrict_encode +#user_tool_section_filters = examples:restrict_text +#user_tool_label_filters = examples:restrict_upload_to_admins, examples:restrict_encode + +# The base modules that are searched for modules as described above +# can be modified and modules external to Galaxy can be searched by +# modifying the following option. +#toolbox_filter_base_modules = galaxy.tools.toolbox.filters,galaxy.tools.filters + +# -- Galaxy Application Internal Message Queue + +# Galaxy uses AMQP internally TODO more documentation on what for. +# For examples, see http://ask.github.io/kombu/userguide/connections.html +# +# Without specifying anything here, galaxy will first attempt to use your +# specified database_connection above. If that's not specified either, Galaxy +# will automatically create and use a separate sqlite database located in your +# /database folder (indicated in the commented out line below). + +#amqp_internal_connection = sqlalchemy+sqlite:///./database/control.sqlite?isolation_level=IMMEDIATE + +# Galaxy real time communication server settings +#enable_communication_server = False +#communication_server_host = http://localhost +#communication_server_port = 7070 +# persistent_communication_rooms is a comma-separated list of rooms that should be always available. +#persistent_communication_rooms = + + +# ---- Galaxy External Message Queue ------------------------------------------------- + +# Galaxy uses Advanced Message Queuing Protocol (AMQP) to receive messages from +# external sources like barcode scanners. Galaxy has been tested against +# RabbitMQ AMQP implementation. For Galaxy to receive messages from a message +# queue, the RabbitMQ server has to be set up with a user account and other +# parameters listed below. The 'host' and 'port' fields should point to where +# the RabbitMQ server is running. + +[galaxy_amqp] + +#host = 127.0.0.1 +#port = 5672 +#userid = galaxy +#password = galaxy +#virtual_host = galaxy_messaging_engine +#queue = galaxy_queue +#exchange = galaxy_exchange +#routing_key = bar_code_scanner +#rabbitmqctl_path = /path/to/rabbitmqctl diff --git a/test/unit/config/1607_root_samples/config/reports.ini b/test/unit/config/1607_root_samples/config/reports.ini new file mode 100644 index 00000000000..8a3a3dd8d90 --- /dev/null +++ b/test/unit/config/1607_root_samples/config/reports.ini @@ -0,0 +1,94 @@ +# ---- HTTP Server ---------------------------------------------------------- + +[server:main] + +use = egg:Paste#http +port = 9001 +host = 127.0.0.1 +use_threadpool = true +threadpool_workers = 10 + +# ---- Filters -------------------------------------------------------------- + +# Filters sit between Galaxy and the HTTP server. + +# These filters are disabled by default. They can be enabled with +# 'filter-with' in the [app:main] section below. + +# Define the proxy-prefix filter. +[filter:proxy-prefix] +use = egg:PasteDeploy#prefix +prefix = /reports + +# ---- Galaxy Reports ------------------------------------------------------ + +[app:main] + +# -- Application and filtering + +# If running behind a proxy server and Galaxy is served from a subdirectory, +# enable the proxy-prefix filter and set the prefix in the +# [filter:proxy-prefix] section above. +#filter-with = proxy-prefix + +# If proxy-prefix is enabled and you're running more than one Galaxy instance +# behind one hostname, you will want to set this to the same path as the prefix +# in the filter above. This value becomes the "path" attribute set in the +# cookie so the cookies from each instance will not clobber each other. +#cookie_path = None + +# Specifies the factory for the universe WSGI application +paste.app_factory = galaxy.webapps.reports.buildapp:app_factory +log_level = DEBUG + +# Database connection +# Galaxy reports are intended for production Galaxy instances, so sqlite is not supported. +# You may use a SQLAlchemy connection string to specify an external database. +#database_connection = postgres:///galaxy_test?user=postgres&password=postgres + +# Where dataset files are saved +#file_path = database/files +# Temporary storage for additional datasets, this should be shared through the cluster +#new_file_path = database/tmp + +# Mako templates are compiled as needed and cached for reuse, this directory is +# used for the cache +#template_cache_path = database/compiled_templates/reports + +# Session support (beaker) +use_beaker_session = True +session_type = memory +session_data_dir = %(here)s/database/beaker_sessions +session_key = galaxysessions +session_secret = changethisinproduction + +# Configuration for debugging middleware +#debug = False + +# Check for WSGI compliance. +#use_lint = False + +# NEVER enable this on a public site (even test or QA) +#use_interactive = true + +# 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 +#error_email_to = your_bugs@bx.psu.edu + +# Serving static files (needed if running standalone) +# static_enabled = True +# static_cache_time = 360 +# static_dir = %(here)s/static/ +# static_images_dir = %(here)s/static/images +# static_favicon_dir = %(here)s/static/favicon.ico +# static_scripts_dir = %(here)s/static/scripts/ +# static_style_dir = %(here)s/static/june_2007_style/blue + +# Sentry (getsentry.com) DSN for catching bugs. +#sentry_dsn = None \ No newline at end of file diff --git a/test/unit/config/1607_root_samples/config/tool_shed.ini b/test/unit/config/1607_root_samples/config/tool_shed.ini new file mode 100644 index 00000000000..9b069898132 --- /dev/null +++ b/test/unit/config/1607_root_samples/config/tool_shed.ini @@ -0,0 +1,181 @@ +# ---- HTTP Server ---------------------------------------------------------- + +[server:main] + +use = egg:Paste#http +port = 9009 + +# The address on which to listen. By default, only listen to localhost +# (the Tool Shed will not be accessible over the network). +# Use '0.0.0.0' to listen on all available network interfaces. +#host = 0.0.0.0 +host = 127.0.0.1 + +use_threadpool = true +threadpool_workers = 10 +# Set the number of seconds a thread can work before you should kill it +# (assuming it will never finish) to 3 hours. +threadpool_kill_thread_limit = 10800 + +# ---- Galaxy Tool Shed ----------------------------------------------------- + +[app:main] + +# Specifies the factory for the universe WSGI application +paste.app_factory = galaxy.webapps.tool_shed.buildapp:app_factory + +# Verbosity of console log messages. Acceptable values can be found here: +# https://docs.python.org/2/library/logging.html#logging-levels +#log_level = DEBUG + +# By default, the Tool Shed uses a SQLite database at 'database/community.sqlite'. You +# may use a SQLAlchemy connection string to specify an external database +# instead. This string takes many options which are explained in detail in the +# config file documentation. +#database_connection = sqlite:///./database/community.sqlite?isolation_level=IMMEDIATE + +# Where the hgweb.config file is stored. +# The default is the Galaxy installation directory. +#hgweb_config_dir = None + +# Where tool shed repositories are stored. +#file_path = database/community_files + +# Temporary storage for additional datasets, +# this should be shared through the cluster +#new_file_path = database/tmp + +# File containing old-style genome builds +#builds_file_path = tool-data/shared/ucsc/builds.txt + +# Format string used when showing date and time information. +# The string may contain: +# - the directives used by Python time.strftime() function (see +# https://docs.python.org/2/library/time.html#time.strftime ), +# - $locale (complete format string for the server locale), +# - $iso8601 (complete format string as specified by ISO 8601 international +# standard). +#pretty_datetime_format = $locale (UTC) + +# -- Repository and Tool search +# Using the script located at scripts/build_ts_whoosh_index.py +# you can generate search index and allow full text API searching over +# the repositories and tools within the Tool Shed given that you specify +# the following two config options. +#toolshed_search_on = True +#whoosh_index_dir = database/toolshed_whoosh_indexes + +# The following boosts are used to customize this instance's TS search. +# The higher the boost, the more importance the scoring algorithm gives to the +# given field. + +# For searching repositories at /api/repositories: +#repo_name_boost = 0.9 +#repo_description_boost = 0.6 +#repo_long_description_boost = 0.5 +#repo_homepage_url_boost = 0.3 +#repo_remote_repository_url_boost = 0.2 +#repo_owner_username_boost = 0.3 + +# For searching tools at /api/tools +#tool_name_boost = 1.2 +#tool_description_boost = 0.6 +#tool_help_boost = 0.4 +#tool_repo_owner_username = 0.3 + +# -- Analytics + +# You can enter tracking code here to track visitor's behavior +# through your Google Analytics account. Example: UA-XXXXXXXX-Y +#ga_code = None + +# -- Users and Security + +# The Tool Shed encodes various internal values when these values will be output in +# some format (for example, in a URL or cookie). You should set a key to be +# used by the algorithm that encodes and decodes these values. It can be any +# string. If left unchanged, anyone could construct a cookie that would grant +# them access to others' sessions. +# One simple way to generate a value for this is with the shell command: +# python -c 'import time; print time.time()' | md5sum | cut -f 1 -d ' ' +#id_secret = changethisinproductiontoo + +# User authentication can be delegated to an upstream proxy server (usually +# Apache). The upstream proxy should set a REMOTE_USER header in the request. +# Enabling remote user disables regular logins. For more information, see: +# https://wiki.galaxyproject.org/Admin/Config/ApacheProxy +#use_remote_user = False + +# If use_remote_user is enabled, anyone who can log in to the Galaxy host may +# impersonate any other user by simply sending the appropriate header. Thus a +# secret shared between the upstream proxy server, and Galaxy is required. +# If anyone other than the Galaxy user is using the server, then apache/nginx +# should pass a value in the header 'GX_SECRET' that is identical the one below +#remote_user_secret = changethisinproductiontoo + +# 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 + +# NEVER enable this on a public site (even test or QA) +#use_interactive = 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 users, groups, roles, +# libraries, and more. +#admin_users = None + +# Force everyone to log in (disable anonymous access) +#require_login = False + +# For use by email messages sent from the tool shed +#smtp_server = smtp.your_tool_shed_server +#email_from = your_tool_shed_email@server + +# If your SMTP server requires a username and password, you can provide them +# here (password in cleartext here, but if your server supports STARTTLS it +# will be sent over the network encrypted). +#smtp_username = None +#smtp_password = None + +# If your SMTP server requires SSL from the beginning of the connection +#smtp_ssl = False + +# The URL linked by the "Support" link in the "Help" menu. +#support_url = https://wiki.galaxyproject.org/Support + +# Address to join mailing list +#mailing_join_addr = galaxy-announce-join@bx.psu.edu + +# Write thread status periodically to 'heartbeat.log' (careful, uses 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 + +# Show a message box under the masthead. +#message_box_visible = False +#message_box_content = None +#message_box_class = info + +# Serving static files (needed if running standalone) +#static_enabled = True +#static_cache_time = 360 +#static_dir = static/ +#static_images_dir = static/images +#static_favicon_dir = static/favicon.ico +#static_scripts_dir = static/scripts/ +#static_style_dir = static/style/blue + +# Sentry (getsentry.com) DSN for catching bugs. +#sentry_dsn = None \ No newline at end of file diff --git a/test/unit/config/test_config_manage.py b/test/unit/config/test_config_manage.py new file mode 100644 index 00000000000..9477b0e21d0 --- /dev/null +++ b/test/unit/config/test_config_manage.py @@ -0,0 +1,131 @@ + +import os +import shutil +import tempfile + +import yaml + +from galaxy.webapps.config_manage import main + +THIS_DIR = os.path.dirname(__file__) + + +def test_reports_conversion_1607_sample(): + with _config_directory("1607_root_samples") as config_dir: + config_dir.manage_cli(["convert", "reports"]) + config_dir.assert_not_exists("config/reports.ini") + config_dir.assert_is_yaml("config/reports.yml") + config_dir.assert_moved("config/reports.ini", "config/reports.ini.backup") + with config_dir.open("config/reports.yml") as f: + config = yaml.load(f) + assert "reports" in config + reports_config = config["reports"] or {} + assert "use_beaker_session" not in reports_config + + assert "uwsgi" in config + uwsgi_config = config["uwsgi"] + assert uwsgi_config["module"] == "galaxy.webapps.reports.buildapp:uwsgi_app()" + + +def test_reports_build_sample(): + with _config_directory("1607_root_samples") as config_dir: + config_dir.assert_not_exists("config/reports.yml.sample") + config_dir.manage_cli(["build_sample_yaml", "reports", "--add-comments"]) + config_dir.assert_is_yaml("config/reports.yml.sample") + + +def test_shed_conversion_1607_sample(): + with _config_directory("1607_root_samples") as config_dir: + config_dir.manage_cli(["convert", "tool_shed"]) + config_dir.assert_not_exists("config/tool_shed.ini") + config_dir.assert_is_yaml("config/tool_shed.yml") + config_dir.assert_moved("config/tool_shed.ini", "config/tool_shed.ini.backup") + + +def test_shed_build_sample(): + with _config_directory("1607_root_samples") as config_dir: + config_dir.assert_not_exists("config/tool_shed.yml.sample") + config_dir.manage_cli(["build_sample_yaml", "tool_shed", "--add-comments"]) + config_dir.assert_is_yaml("config/tool_shed.yml.sample") + + +def test_shed_conversion_1607_prefix(): + with _config_directory("1607_root_filters") as config_dir: + config_dir.manage_cli(["convert", "tool_shed"]) + config_dir.assert_not_exists("config/tool_shed.ini") + config_dir.assert_is_yaml("config/tool_shed.yml") + config_dir.assert_moved("config/tool_shed.ini", "config/tool_shed.ini.backup") + with config_dir.open("config/tool_shed.yml") as f: + config = yaml.load(f) + assert "uwsgi" in config + uwsgi_config = config["uwsgi"] + assert "module" not in uwsgi_config + assert uwsgi_config["mount"].startswith("/shed=galaxy.") + + +def test_reports_conversion_1607_gzip(): + with _config_directory("1607_root_filters") as config_dir: + config_dir.manage_cli(["convert", "reports"]) + config_dir.assert_not_exists("config/reports.ini") + config_dir.assert_is_yaml("config/reports.yml") + config_dir.assert_moved("config/reports.ini", "config/reports.ini.backup") + with config_dir.open("config/reports.yml") as f: + config = yaml.load(f) + assert "uwsgi" in config + uwsgi_config = config["uwsgi"] + print uwsgi_config + assert uwsgi_config["http-auto-gzip"] is True, uwsgi_config + + +def test_build_uwsgi_yaml(): + with _config_directory("1607_root_samples") as config_dir: + config_dir.manage_cli(["build_uwsgi_yaml"]) + + +class _TestConfigDirectory(object): + + def __init__(self, base_name): + temp_directory = tempfile.mkdtemp() + os.removedirs(temp_directory) + source_dir = os.path.join(THIS_DIR, base_name) + shutil.copytree(source_dir, temp_directory) + self.source_dir = source_dir + self.temp_directory = temp_directory + + def __enter__(self): + return self + + def __exit__(self, type, value, tb): + shutil.rmtree(self.temp_directory) + + def assert_exists(self, path): + assert os.path.exists(os.path.join(self.temp_directory, path)) + + def assert_not_exists(self, path): + assert not os.path.exists(os.path.join(self.temp_directory, path)) + + def assert_is_yaml(self, path): + self.assert_exists(path) + with self.open(path, "r") as f: + return yaml.load(f) + + def open(self, path, *args): + return open(os.path.join(self.temp_directory, path), *args) + + def assert_moved(self, from_path, to_path): + with open(os.path.join(self.source_dir, from_path), "r") as f: + source_contents = f.read() + + with self.open(to_path, "r") as f: + dest_contents = f.read() + + assert source_contents == dest_contents + + def manage_cli(self, argv): + real_argv = ["--galaxy_root", self.temp_directory] + real_argv.extend(argv) + main(real_argv) + + +def _config_directory(base_name): + return _TestConfigDirectory(base_name) From 7973a914e0beef9680475d54947bd953c0b062cd Mon Sep 17 00:00:00 2001 From: John Chilton Date: Fri, 26 Aug 2016 13:22:31 -0400 Subject: [PATCH 05/15] Add uwsgi_schema.yml. --- lib/galaxy/webapps/uwsgi_schema.yml | 1742 +++++++++++++++++++++++++++ 1 file changed, 1742 insertions(+) create mode 100644 lib/galaxy/webapps/uwsgi_schema.yml diff --git a/lib/galaxy/webapps/uwsgi_schema.yml b/lib/galaxy/webapps/uwsgi_schema.yml new file mode 100644 index 00000000000..0ebbc9af34a --- /dev/null +++ b/lib/galaxy/webapps/uwsgi_schema.yml @@ -0,0 +1,1742 @@ +desc: uwsgi definition, see http://uwsgi-docs.readthedocs.io/en/latest/Options.html +mapping: + socket: {desc: ' bind to the specified UNIX/TCP socket using default protocol', + type: any} + uwsgi-socket: {desc: ' bind to the specified UNIX/TCP socket using uwsgi protocol', + type: any} + suwsgi-socket: {desc: ' bind to the specified UNIX/TCP socket using uwsgi protocol + over SSL', type: any} + ssl-socket: {desc: ' bind to the specified UNIX/TCP socket using uwsgi protocol + over SSL', type: any} + http-socket: {desc: ' bind to the specified UNIX/TCP socket using HTTP protocol', + type: any} + http-socket-modifier1: {desc: ' force the specified modifier1 when using HTTP protocol', + type: any} + http-socket-modifier2: {desc: ' force the specified modifier2 when using HTTP protocol', + type: any} + http11-socket: {desc: ' bind to the specified UNIX/TCP socket using HTTP 1.1 (Keep-Alive) + protocol', type: any} + https-socket: {desc: ' bind to the specified UNIX/TCP socket using HTTPS protocol', + type: any} + https-socket-modifier1: {desc: ' force the specified modifier1 when using HTTPS + protocol', type: any} + https-socket-modifier2: {desc: ' force the specified modifier2 when using HTTPS + protocol', type: any} + fastcgi-socket: {desc: ' bind to the specified UNIX/TCP socket using FastCGI protocol', + type: any} + fastcgi-nph-socket: {desc: ' bind to the specified UNIX/TCP socket using FastCGI + protocol (nph mode)', type: any} + fastcgi-modifier1: {desc: ' force the specified modifier1 when using FastCGI protocol', + type: any} + fastcgi-modifier2: {desc: ' force the specified modifier2 when using FastCGI protocol', + type: any} + scgi-socket: {desc: ' bind to the specified UNIX/TCP socket using SCGI protocol', + type: any} + scgi-nph-socket: {desc: ' bind to the specified UNIX/TCP socket using SCGI protocol + (nph mode)', type: any} + scgi-modifier1: {desc: ' force the specified modifier1 when using SCGI protocol', + type: any} + scgi-modifier2: {desc: ' force the specified modifier2 when using SCGI protocol', + type: any} + raw-socket: {desc: ' bind to the specified UNIX/TCP socket using RAW protocol', + type: any} + raw-modifier1: {desc: ' force the specified modifier1 when using RAW protocol', + type: any} + raw-modifier2: {desc: ' force the specified modifier2 when using RAW protocol', + type: any} + puwsgi-socket: {desc: ' bind to the specified UNIX/TCP socket using persistent uwsgi + protocol (puwsgi)', type: any} + protocol: {desc: ' force the specified protocol for default sockets', type: any} + socket-protocol: {desc: ' force the specified protocol for default sockets', type: any} + shared-socket: {desc: ' create a shared socket for advanced jailing or ipc', type: any} + undeferred-shared-socket: {desc: ' create a shared socket for advanced jailing or + ipc (undeferred mode)', type: any} + processes: {desc: ' spawn the specified number of workers/processes', type: int} + workers: {desc: ' spawn the specified number of workers/processes', type: int} + thunder-lock: {desc: ' serialize accept() usage (if possible)', type: any} + harakiri: {desc: ' set harakiri timeout', type: int} + harakiri-verbose: {desc: ' enable verbose mode for harakiri', type: any} + harakiri-no-arh: {desc: ' do not enable harakiri during after-request-hook', type: any} + no-harakiri-arh: {desc: ' do not enable harakiri during after-request-hook', type: any} + no-harakiri-after-req-hook: {desc: ' do not enable harakiri during after-request-hook', + type: any} + backtrace-depth: {desc: ' set backtrace depth', type: int} + mule-harakiri: {desc: ' set harakiri timeout for mule tasks', type: int} + xmlconfig: {desc: ' load config from xml file', type: any} + xml: {desc: ' load config from xml file', type: any} + config: {desc: ' load configuration using the pluggable system', type: any} + fallback-config: {desc: ' re-exec uwsgi with the specified config when exit code + is 1', type: any} + strict: {desc: ' enable strict mode (placeholder cannot be used)', type: any} + skip-zero: {desc: ' skip check of file descriptor 0', type: any} + skip-atexit: {desc: ' skip atexit teardown (ignored by the master)', type: any} + set: {desc: ' set a placeholder or an option', type: any} + set-placeholder: {desc: ' set a placeholder', type: any} + set-ph: {desc: ' set a placeholder', type: any} + get: {desc: ' print the specified option value and exit', type: any} + declare-option: {desc: ' declare a new uWSGI custom option', type: any} + declare-option2: {desc: ' declare a new uWSGI custom option (non-immediate)', type: any} + resolve: {desc: ' place the result of a dns query in the specified placeholder, + sytax: placeholder=name (immediate option)', type: any} + for: {desc: ' (opt logic) for cycle', type: any} + for-glob: {desc: ' (opt logic) for cycle (expand glob)', type: any} + for-times: {desc: ' (opt logic) for cycle (expand the specified num to a list starting + from 1)', type: any} + for-readline: {desc: ' (opt logic) for cycle (expand the specified file to a list + of lines)', type: any} + endfor: {desc: ' (opt logic) end for cycle', type: any} + end-for: {desc: ' (opt logic) end for cycle', type: any} + if-opt: {desc: ' (opt logic) check for option', type: any} + if-not-opt: {desc: ' (opt logic) check for option', type: any} + if-env: {desc: ' (opt logic) check for environment variable', type: any} + if-not-env: {desc: ' (opt logic) check for environment variable', type: any} + ifenv: {desc: ' (opt logic) check for environment variable', type: any} + if-reload: {desc: ' (opt logic) check for reload', type: any} + if-not-reload: {desc: ' (opt logic) check for reload', type: any} + if-hostname: {desc: ' (opt logic) check for hostname', type: any} + if-not-hostname: {desc: ' (opt logic) check for hostname', type: any} + if-hostname-match: {desc: ' (opt logic) try to match hostname against a regular + expression', type: any} + if-not-hostname-match: {desc: ' (opt logic) try to match hostname against a regular + expression', type: any} + if-exists: {desc: ' (opt logic) check for file/directory existance', type: any} + if-not-exists: {desc: ' (opt logic) check for file/directory existance', type: any} + ifexists: {desc: ' (opt logic) check for file/directory existance', type: any} + if-plugin: {desc: ' (opt logic) check for plugin', type: any} + if-not-plugin: {desc: ' (opt logic) check for plugin', type: any} + ifplugin: {desc: ' (opt logic) check for plugin', type: any} + if-file: {desc: ' (opt logic) check for file existance', type: any} + if-not-file: {desc: ' (opt logic) check for file existance', type: any} + if-dir: {desc: ' (opt logic) check for directory existance', type: any} + if-not-dir: {desc: ' (opt logic) check for directory existance', type: any} + ifdir: {desc: ' (opt logic) check for directory existance', type: any} + if-directory: {desc: ' (opt logic) check for directory existance', type: any} + endif: {desc: ' (opt logic) end if', type: any} + end-if: {desc: ' (opt logic) end if', type: any} + blacklist: {desc: ' set options blacklist context', type: any} + end-blacklist: {desc: ' clear options blacklist context', type: any} + whitelist: {desc: ' set options whitelist context', type: any} + end-whitelist: {desc: ' clear options whitelist context', type: any} + ignore-sigpipe: {desc: ' do not report (annoying) SIGPIPE', type: any} + ignore-write-errors: {desc: ' do not report (annoying) write()/writev() errors', + type: any} + write-errors-tolerance: {desc: ' set the maximum number of allowed write errors + (default: no tolerance)', type: any} + write-errors-exception-only: {desc: ' only raise an exception on write errors giving + control to the app itself', type: any} + disable-write-exception: {desc: ' disable exception generation on write()/writev()', + type: any} + inherit: {desc: ' use the specified file as config template', type: any} + include: {desc: ' include the specified file as immediate configuration', type: any} + inject-before: {desc: ' inject a text file before the config file (advanced templating)', + type: any} + inject-after: {desc: ' inject a text file after the config file (advanced templating)', + type: any} + daemonize: {desc: ' daemonize uWSGI', type: any} + daemonize2: {desc: ' daemonize uWSGI after app loading', type: any} + stop: {desc: ' stop an instance', type: any} + reload: {desc: ' reload an instance', type: any} + pause: {desc: ' pause an instance', type: any} + suspend: {desc: ' suspend an instance', type: any} + resume: {desc: ' resume an instance', type: any} + connect-and-read: {desc: ' connect to a socket and wait for data from it', type: any} + extract: {desc: ' fetch/dump any supported address to stdout', type: any} + listen: {desc: ' set the socket listen queue size', type: int} + max-vars: {desc: ' set the amount of internal iovec/vars structures', type: any} + max-apps: {desc: ' set the maximum number of per-worker applications', type: int} + buffer-size: {desc: ' set internal buffer size', type: any} + memory-report: {desc: ' enable memory report', type: any} + profiler: {desc: ' enable the specified profiler', type: any} + cgi-mode: {desc: ' force CGI-mode for plugins supporting it', type: any} + abstract-socket: {desc: ' force UNIX socket in abstract mode (Linux only)', type: any} + chmod-socket: {desc: ' chmod-socket', type: any} + chmod: {desc: ' chmod-socket', type: any} + chown-socket: {desc: ' chown unix sockets', type: any} + umask: {desc: ' set umask', type: any} + freebind: {desc: ' put socket in freebind mode', type: any} + map-socket: {desc: ' map sockets to specific workers', type: any} + enable-threads: {desc: ' enable threads', type: any} + no-threads-wait: {desc: ' do not wait for threads cancellation on quit/reload', + type: any} + auto-procname: {desc: ' automatically set processes name to something meaningful', + type: any} + procname-prefix: {desc: ' add a prefix to the process names', type: any} + procname-prefix-spaced: {desc: ' add a spaced prefix to the process names', type: any} + procname-append: {desc: ' append a string to process names', type: any} + procname: {desc: ' set process names', type: any} + procname-master: {desc: ' set master process name', type: any} + single-interpreter: {desc: ' do not use multiple interpreters (where available)', + type: any} + need-app: {desc: ' exit if no app can be loaded', type: any} + master: {desc: ' enable master process', type: any} + honour-stdin: {desc: ' do not remap stdin to /dev/null', type: any} + emperor: {desc: ' run the Emperor', type: any} + emperor-proxy-socket: {desc: ' force the vassal to became an Emperor proxy', type: any} + emperor-wrapper: {desc: ' set a binary wrapper for vassals', type: any} + emperor-nofollow: {desc: ' do not follow symlinks when checking for mtime', type: any} + emperor-procname: {desc: ' set the Emperor process name', type: any} + emperor-freq: {desc: ' set the Emperor scan frequency (default 3 seconds)', type: int} + emperor-required-heartbeat: {desc: ' set the Emperor tolerance about heartbeats', + type: int} + emperor-curse-tolerance: {desc: ' set the Emperor tolerance about cursed vassals', + type: int} + emperor-pidfile: {desc: ' write the Emperor pid in the specified file', type: any} + emperor-tyrant: {desc: ' put the Emperor in Tyrant mode', type: any} + emperor-tyrant-nofollow: {desc: ' do not follow symlinks when checking for uid/gid + in Tyrant mode', type: any} + emperor-tyrant-initgroups: {desc: ' add additional groups set via initgroups() in + Tyrant mode', type: any} + emperor-stats: {desc: ' run the Emperor stats server', type: any} + emperor-stats-server: {desc: ' run the Emperor stats server', type: any} + early-emperor: {desc: ' spawn the emperor as soon as possibile', type: any} + emperor-broodlord: {desc: ' run the emperor in BroodLord mode', type: int} + emperor-throttle: {desc: ' set throttling level (in milliseconds) for bad behaving + vassals (default 1000)', type: int} + emperor-max-throttle: {desc: ' set max throttling level (in milliseconds) for bad + behaving vassals (default 3 minutes)', type: int} + emperor-magic-exec: {desc: ' prefix vassals config files with exec:// if they have + the executable bit', type: any} + emperor-on-demand-extension: {desc: ' search for text file (vassal name + extension) + containing the on demand socket name', type: any} + emperor-on-demand-ext: {desc: ' search for text file (vassal name + extension) containing + the on demand socket name', type: any} + emperor-on-demand-directory: {desc: ' enable on demand mode binding to the unix + socket in the specified directory named like the vassal + .socket', type: any} + emperor-on-demand-dir: {desc: ' enable on demand mode binding to the unix socket + in the specified directory named like the vassal + .socket', type: any} + emperor-on-demand-exec: {desc: ' use the output of the specified command as on demand + socket name (the vassal name is passed as the only argument)', type: any} + emperor-extra-extension: {desc: ' allows the specified extension in the Emperor + (vassal will be called with --config)', type: any} + emperor-extra-ext: {desc: ' allows the specified extension in the Emperor (vassal + will be called with --config)', type: any} + emperor-no-blacklist: {desc: ' disable Emperor blacklisting subsystem', type: any} + emperor-use-clone: {desc: ' use clone() instead of fork() passing the specified + unshare() flags', type: any} + emperor-use-fork-server: {desc: ' connect to the specified fork server instead of + using plain fork() for new vassals', type: any} + vassal-fork-base: {desc: ' use plain fork() for the specified vassal (instead of + a fork-server)', type: any} + emperor-subreaper: {desc: ' force the Emperor to be a sub-reaper (if supported)', + type: any} + emperor-cap: {desc: ' set vassals capability', type: any} + vassals-cap: {desc: ' set vassals capability', type: any} + vassal-cap: {desc: ' set vassals capability', type: any} + emperor-collect-attribute: {desc: ' collect the specified vassal attribute from + imperial monitors', type: any} + emperor-collect-attr: {desc: ' collect the specified vassal attribute from imperial + monitors', type: any} + emperor-fork-server-attr: {desc: ' set the vassal''s attribute to get when checking + for fork-server', type: any} + emperor-wrapper-attr: {desc: ' set the vassal''s attribute to get when checking + for fork-wrapper', type: any} + emperor-chdir-attr: {desc: ' set the vassal''s attribute to get when checking for + chdir', type: any} + imperial-monitor-list: {desc: ' list enabled imperial monitors', type: any} + imperial-monitors-list: {desc: ' list enabled imperial monitors', type: any} + vassals-inherit: {desc: ' add config templates to vassals config (uses --inherit)', + type: any} + vassals-include: {desc: ' include config templates to vassals config (uses --include + instead of --inherit)', type: any} + vassals-inherit-before: {desc: ' add config templates to vassals config (uses --inherit, + parses before the vassal file)', type: any} + vassals-include-before: {desc: ' include config templates to vassals config (uses + --include instead of --inherit, parses before the vassal file)', type: any} + vassals-start-hook: {desc: ' run the specified command before each vassal starts', + type: any} + vassals-stop-hook: {desc: ' run the specified command after vassal''s death', type: any} + vassal-sos: {desc: ' ask emperor for reinforcement when overloaded', type: int} + vassal-sos-backlog: {desc: ' ask emperor for sos if backlog queue has more items + than the value specified', type: int} + vassals-set: {desc: ' automatically set the specified option (via --set) for every + vassal', type: any} + vassal-set: {desc: ' automatically set the specified option (via --set) for every + vassal', type: any} + heartbeat: {desc: ' announce healthiness to the emperor', type: int} + zeus: {desc: ' enable Zeus mode', type: any} + reload-mercy: {desc: ' set the maximum time (in seconds) we wait for workers and + other processes to die during reload/shutdown', type: int} + worker-reload-mercy: {desc: ' set the maximum time (in seconds) a worker can take + to reload/shutdown (default is 60)', type: int} + mule-reload-mercy: {desc: ' set the maximum time (in seconds) a mule can take to + reload/shutdown (default is 60)', type: int} + exit-on-reload: {desc: ' force exit even if a reload is requested', type: any} + die-on-term: {desc: ' exit instead of brutal reload on SIGTERM (no more needed)', + type: any} + force-gateway: {desc: ' force the spawn of the first registered gateway without + a master', type: any} + help: {desc: ' show this help', type: any} + usage: {desc: ' show this help', type: any} + print-sym: {desc: ' print content of the specified binary symbol', type: any} + print-symbol: {desc: ' print content of the specified binary symbol', type: any} + reaper: {desc: ' call waitpid(-1,...) after each request to get rid of zombies', + type: any} + max-requests: {desc: ' reload workers after the specified amount of managed requests', + type: any} + max-requests-delta: {desc: ' add (worker_id * delta) to the max_requests value of + each worker', type: any} + min-worker-lifetime: {desc: ' number of seconds worker must run before being reloaded + (default is 60)', type: any} + max-worker-lifetime: {desc: ' reload workers after the specified amount of seconds + (default is disabled)', type: any} + socket-timeout: {desc: ' set internal sockets timeout', type: int} + no-fd-passing: {desc: ' disable file descriptor passing', type: any} + locks: {desc: ' create the specified number of shared locks', type: int} + lock-engine: {desc: ' set the lock engine', type: any} + ftok: {desc: ' set the ipcsem key via ftok() for avoiding duplicates', type: any} + persistent-ipcsem: {desc: ' do not remove ipcsem''s on shutdown', type: any} + sharedarea: {desc: ' create a raw shared memory area of specified pages (note: it + supports keyval too)', type: any} + safe-fd: {desc: ' do not close the specified file descriptor', type: any} + fd-safe: {desc: ' do not close the specified file descriptor', type: any} + cache: {desc: ' create a shared cache containing given elements', type: any} + cache-blocksize: {desc: ' set cache blocksize', type: any} + cache-store: {desc: ' enable persistent cache to disk', type: any} + cache-store-sync: {desc: ' set frequency of sync for persistent cache', type: int} + cache-no-expire: {desc: ' disable auto sweep of expired items', type: any} + cache-expire-freq: {desc: ' set the frequency of cache sweeper scans (default 3 + seconds)', type: int} + cache-report-freed-items: {desc: ' constantly report the cache item freed by the + sweeper (use only for debug)', type: any} + cache-udp-server: {desc: ' bind the cache udp server (used only for set/update/delete) + to the specified socket', type: any} + cache-udp-node: {desc: ' send cache update/deletion to the specified cache udp server', + type: any} + cache-sync: {desc: ' copy the whole content of another uWSGI cache server on server + startup', type: any} + cache-use-last-modified: {desc: ' update last_modified_at timestamp on every cache + item modification (default is disabled)', type: any} + add-cache-item: {desc: ' add an item in the cache', type: any} + load-file-in-cache: {desc: ' load a static file in the cache', type: any} + load-file-in-cache-gzip: {desc: ' load a static file in the cache with gzip compression', + type: any} + cache2: {desc: ' create a new generation shared cache (keyval syntax)', type: any} + queue: {desc: ' enable shared queue', type: int} + queue-blocksize: {desc: ' set queue blocksize', type: int} + queue-store: {desc: ' enable persistent queue to disk', type: any} + queue-store-sync: {desc: ' set frequency of sync for persistent queue', type: int} + spooler: {desc: ' run a spooler on the specified directory', type: any} + spooler-external: {desc: ' map spoolers requests to a spooler directory managed + by an external instance', type: any} + spooler-ordered: {desc: ' try to order the execution of spooler tasks', type: any} + spooler-chdir: {desc: ' chdir() to specified directory before each spooler task', + type: any} + spooler-processes: {desc: ' set the number of processes for spoolers', type: int} + spooler-quiet: {desc: ' do not be verbose with spooler tasks', type: any} + spooler-max-tasks: {desc: ' set the maximum number of tasks to run before recycling + a spooler', type: int} + spooler-harakiri: {desc: ' set harakiri timeout for spooler tasks', type: int} + spooler-frequency: {desc: ' set spooler frequency, default 30 seconds', type: int} + spooler-freq: {desc: ' set spooler frequency, default 30 seconds', type: int} + mule: {desc: ' add a mule', type: any} + mules: {desc: ' add the specified number of mules', type: any} + farm: {desc: ' add a mule farm', type: any} + mule-msg-size: {desc: ' set mule message buffer size', type: int} + signal: {desc: ' send a uwsgi signal to a server', type: any} + signal-bufsize: {desc: ' set buffer size for signal queue', type: int} + signals-bufsize: {desc: ' set buffer size for signal queue', type: int} + signal-timer: {desc: ' add a timer (syntax: )', type: any} + timer: {desc: ' add a timer (syntax: )', type: any} + signal-rbtimer: {desc: ' add a redblack timer (syntax: )', type: any} + rbtimer: {desc: ' add a redblack timer (syntax: )', type: any} + rpc-max: {desc: ' maximum number of rpc slots (default: 64)', type: any} + disable-logging: {desc: ' disable request logging', type: any} + flock: {desc: ' lock the specified file before starting, exit if locked', type: any} + flock-wait: {desc: ' lock the specified file before starting, wait if locked', type: any} + flock2: {desc: ' lock the specified file after logging/daemon setup, exit if locked', + type: any} + flock-wait2: {desc: ' lock the specified file after logging/daemon setup, wait if + locked', type: any} + pidfile: {desc: ' create pidfile (before privileges drop)', type: any} + pidfile2: {desc: ' create pidfile (after privileges drop)', type: any} + safe-pidfile: {desc: ' create safe pidfile (before privileges drop)', type: any} + safe-pidfile2: {desc: ' create safe pidfile (after privileges drop)', type: any} + chroot: {desc: ' chroot() to the specified directory', type: any} + pivot-root: {desc: ' pivot_root() to the specified directories (new_root and put_old + must be separated with a space)', type: any} + pivot_root: {desc: ' pivot_root() to the specified directories (new_root and put_old + must be separated with a space)', type: any} + uid: {desc: ' setuid to the specified user/uid', type: any} + gid: {desc: ' setgid to the specified group/gid', type: any} + add-gid: {desc: ' add the specified group id to the process credentials', type: any} + immediate-uid: {desc: ' setuid to the specified user/uid IMMEDIATELY', type: any} + immediate-gid: {desc: ' setgid to the specified group/gid IMMEDIATELY', type: any} + no-initgroups: {desc: ' disable additional groups set via initgroups()', type: any} + cap: {desc: ' set process capability', type: any} + unshare: {desc: ' unshare() part of the processes and put it in a new namespace', + type: any} + unshare2: {desc: ' unshare() part of the processes and put it in a new namespace + after rootfs change', type: any} + setns-socket: {desc: ' expose a unix socket returning namespace fds from /proc/self/ns', + type: any} + setns-socket-skip: {desc: ' skip the specified entry when sending setns file descriptors', + type: any} + setns-skip: {desc: ' skip the specified entry when sending setns file descriptors', + type: any} + setns: {desc: ' join a namespace created by an external uWSGI instance', type: any} + setns-preopen: {desc: ' open /proc/self/ns as soon as possible and cache fds', type: any} + fork-socket: {desc: ' suspend the execution after early initialization and fork() + at every unix socket connection', type: any} + fork-server: {desc: ' suspend the execution after early initialization and fork() + at every unix socket connection', type: any} + jailed: {desc: ' mark the instance as jailed (force the execution of post_jail hooks)', + type: any} + jail: {desc: ' put the instance in a FreeBSD jail', type: any} + jail-ip4: {desc: ' add an ipv4 address to the FreeBSD jail', type: any} + jail-ip6: {desc: ' add an ipv6 address to the FreeBSD jail', type: any} + jidfile: {desc: ' save the jid of a FreeBSD jail in the specified file', type: any} + jid-file: {desc: ' save the jid of a FreeBSD jail in the specified file', type: any} + jail2: {desc: ' add an option to the FreeBSD jail', type: any} + libjail: {desc: ' add an option to the FreeBSD jail', type: any} + jail-attach: {desc: ' attach to the FreeBSD jail', type: any} + refork: {desc: ' fork() again after privileges drop. Useful for jailing systems', + type: any} + re-fork: {desc: ' fork() again after privileges drop. Useful for jailing systems', + type: any} + refork-as-root: {desc: ' fork() again before privileges drop. Useful for jailing + systems', type: any} + re-fork-as-root: {desc: ' fork() again before privileges drop. Useful for jailing + systems', type: any} + refork-post-jail: {desc: ' fork() again after jailing. Useful for jailing systems', + type: any} + re-fork-post-jail: {desc: ' fork() again after jailing. Useful for jailing systems', + type: any} + hook-asap: {desc: ' run the specified hook as soon as possible', type: any} + hook-pre-jail: {desc: ' run the specified hook before jailing', type: any} + hook-post-jail: {desc: ' run the specified hook after jailing', type: any} + hook-in-jail: {desc: ' run the specified hook in jail after initialization', type: any} + hook-as-root: {desc: ' run the specified hook before privileges drop', type: any} + hook-as-user: {desc: ' run the specified hook after privileges drop', type: any} + hook-as-user-atexit: {desc: ' run the specified hook before app exit and reload', + type: any} + hook-pre-app: {desc: ' run the specified hook before app loading', type: any} + hook-post-app: {desc: ' run the specified hook after app loading', type: any} + hook-post-fork: {desc: ' run the specified hook after each fork', type: any} + hook-accepting: {desc: ' run the specified hook after each worker enter the accepting + phase', type: any} + hook-accepting1: {desc: ' run the specified hook after the first worker enters the + accepting phase', type: any} + hook-accepting-once: {desc: ' run the specified hook after each worker enter the + accepting phase (once per-instance)', type: any} + hook-accepting1-once: {desc: ' run the specified hook after the first worker enters + the accepting phase (once per instance)', type: any} + hook-master-start: {desc: ' run the specified hook when the Master starts', type: any} + hook-touch: {desc: ' run the specified hook when the specified file is touched (syntax: + )', type: any} + hook-emperor-start: {desc: ' run the specified hook when the Emperor starts', type: any} + hook-emperor-stop: {desc: ' run the specified hook when the Emperor send a stop + message', type: any} + hook-emperor-reload: {desc: ' run the specified hook when the Emperor send a reload + message', type: any} + hook-emperor-lost: {desc: ' run the specified hook when the Emperor connection is + lost', type: any} + hook-as-vassal: {desc: ' run the specified hook before exec()ing the vassal', type: any} + hook-as-emperor: {desc: ' run the specified hook in the emperor after the vassal + has been started', type: any} + hook-as-on-demand-vassal: {desc: ' run the specified hook whenever a vassal enters + on-demand mode', type: any} + hook-as-on-config-vassal: {desc: ' run the specified hook whenever the emperor detects + a config change for an on-demand vassal', type: any} + hook-as-emperor-before-vassal: {desc: ' run the specified hook before the new vassal + is spawned', type: any} + hook-as-vassal-before-drop: {desc: ' run the specified hook into vassal, before + dropping its privileges', type: any} + hook-as-emperor-setns: {desc: ' run the specified hook in the emperor entering vassal + namespace', type: any} + hook-as-mule: {desc: ' run the specified hook in each mule', type: any} + hook-as-gateway: {desc: ' run the specified hook in each gateway', type: any} + after-request-hook: {desc: ' run the specified function/symbol after each request', + type: any} + after-request-call: {desc: ' run the specified function/symbol after each request', + type: any} + exec-asap: {desc: ' run the specified command as soon as possible', type: any} + exec-pre-jail: {desc: ' run the specified command before jailing', type: any} + exec-post-jail: {desc: ' run the specified command after jailing', type: any} + exec-in-jail: {desc: ' run the specified command in jail after initialization', + type: any} + exec-as-root: {desc: ' run the specified command before privileges drop', type: any} + exec-as-user: {desc: ' run the specified command after privileges drop', type: any} + exec-as-user-atexit: {desc: ' run the specified command before app exit and reload', + type: any} + exec-pre-app: {desc: ' run the specified command before app loading', type: any} + exec-post-app: {desc: ' run the specified command after app loading', type: any} + exec-as-vassal: {desc: ' run the specified command before exec()ing the vassal', + type: any} + exec-as-emperor: {desc: ' run the specified command in the emperor after the vassal + has been started', type: any} + mount-asap: {desc: ' mount filesystem as soon as possible', type: any} + mount-pre-jail: {desc: ' mount filesystem before jailing', type: any} + mount-post-jail: {desc: ' mount filesystem after jailing', type: any} + mount-in-jail: {desc: ' mount filesystem in jail after initialization', type: any} + mount-as-root: {desc: ' mount filesystem before privileges drop', type: any} + mount-as-vassal: {desc: ' mount filesystem before exec()ing the vassal', type: any} + mount-as-emperor: {desc: ' mount filesystem in the emperor after the vassal has + been started', type: any} + umount-asap: {desc: ' unmount filesystem as soon as possible', type: any} + umount-pre-jail: {desc: ' unmount filesystem before jailing', type: any} + umount-post-jail: {desc: ' unmount filesystem after jailing', type: any} + umount-in-jail: {desc: ' unmount filesystem in jail after initialization', type: any} + umount-as-root: {desc: ' unmount filesystem before privileges drop', type: any} + umount-as-vassal: {desc: ' unmount filesystem before exec()ing the vassal', type: any} + umount-as-emperor: {desc: ' unmount filesystem in the emperor after the vassal has + been started', type: any} + wait-for-interface: {desc: ' wait for the specified network interface to come up + before running root hooks', type: any} + wait-for-interface-timeout: {desc: ' set the timeout for wait-for-interface', type: int} + wait-interface: {desc: ' wait for the specified network interface to come up before + running root hooks', type: any} + wait-interface-timeout: {desc: ' set the timeout for wait-for-interface', type: int} + wait-for-iface: {desc: ' wait for the specified network interface to come up before + running root hooks', type: any} + wait-for-iface-timeout: {desc: ' set the timeout for wait-for-interface', type: int} + wait-iface: {desc: ' wait for the specified network interface to come up before + running root hooks', type: any} + wait-iface-timeout: {desc: ' set the timeout for wait-for-interface', type: int} + wait-for-fs: {desc: ' wait for the specified filesystem item to appear before running + root hooks', type: any} + wait-for-file: {desc: ' wait for the specified file to appear before running root + hooks', type: any} + wait-for-dir: {desc: ' wait for the specified directory to appear before running + root hooks', type: any} + wait-for-mountpoint: {desc: ' wait for the specified mountpoint to appear before + running root hooks', type: any} + wait-for-fs-timeout: {desc: ' set the timeout for wait-for-fs/file/dir', type: int} + call-asap: {desc: ' call the specified function as soon as possible', type: any} + call-pre-jail: {desc: ' call the specified function before jailing', type: any} + call-post-jail: {desc: ' call the specified function after jailing', type: any} + call-in-jail: {desc: ' call the specified function in jail after initialization', + type: any} + call-as-root: {desc: ' call the specified function before privileges drop', type: any} + call-as-user: {desc: ' call the specified function after privileges drop', type: any} + call-as-user-atexit: {desc: ' call the specified function before app exit and reload', + type: any} + call-pre-app: {desc: ' call the specified function before app loading', type: any} + call-post-app: {desc: ' call the specified function after app loading', type: any} + call-as-vassal: {desc: ' call the specified function() before exec()ing the vassal', + type: any} + call-as-vassal1: {desc: ' call the specified function before exec()ing the vassal', + type: any} + call-as-vassal3: {desc: ' call the specified function(char *, uid_t, gid_t) before + exec()ing the vassal', type: any} + call-as-emperor: {desc: ' call the specified function() in the emperor after the + vassal has been started', type: any} + call-as-emperor1: {desc: ' call the specified function in the emperor after the + vassal has been started', type: any} + call-as-emperor2: {desc: ' call the specified function(char *, pid_t) in the emperor + after the vassal has been started', type: any} + call-as-emperor4: {desc: ' call the specified function(char *, pid_t, uid_t, gid_t) + in the emperor after the vassal has been started', type: any} + ini: {desc: ' load config from ini file', type: any} + yaml: {desc: ' load config from yaml file', type: any} + yml: {desc: ' load config from yaml file', type: any} + json: {desc: ' load config from json file', type: any} + js: {desc: ' load config from json file', type: any} + weight: {desc: ' weight of the instance (used by clustering/lb/subscriptions)', + type: any} + auto-weight: {desc: ' set weight of the instance (used by clustering/lb/subscriptions) + automatically', type: any} + no-server: {desc: ' force no-server mode', type: any} + command-mode: {desc: ' force command mode', type: any} + no-defer-accept: {desc: ' disable deferred-accept on sockets', type: any} + tcp-nodelay: {desc: ' enable TCP NODELAY on each request', type: any} + so-keepalive: {desc: ' enable TCP KEEPALIVEs', type: any} + so-send-timeout: {desc: ' set SO_SNDTIMEO', type: int} + socket-send-timeout: {desc: ' set SO_SNDTIMEO', type: int} + so-write-timeout: {desc: ' set SO_SNDTIMEO', type: int} + socket-write-timeout: {desc: ' set SO_SNDTIMEO', type: int} + socket-sndbuf: {desc: ' set SO_SNDBUF', type: any} + socket-rcvbuf: {desc: ' set SO_RCVBUF', type: any} + limit-as: {desc: ' limit processes address space/vsz', type: any} + limit-nproc: {desc: ' limit the number of spawnable processes', type: int} + reload-on-as: {desc: ' reload if address space is higher than specified megabytes', + type: any} + reload-on-rss: {desc: ' reload if rss memory is higher than specified megabytes', + type: any} + evil-reload-on-as: {desc: ' force the master to reload a worker if its address space + is higher than specified megabytes', type: any} + evil-reload-on-rss: {desc: ' force the master to reload a worker if its rss memory + is higher than specified megabytes', type: any} + reload-on-fd: {desc: ' reload if the specified file descriptor is ready', type: any} + brutal-reload-on-fd: {desc: ' brutal reload if the specified file descriptor is + ready', type: any} + ksm: {desc: ' enable Linux KSM', type: int} + pcre-jit: {desc: ' enable pcre jit (if available)', type: any} + never-swap: {desc: ' lock all memory pages avoiding swapping', type: any} + touch-reload: {desc: ' reload uWSGI if the specified file is modified/touched', + type: any} + touch-workers-reload: {desc: ' trigger reload of (only) workers if the specified + file is modified/touched', type: any} + touch-chain-reload: {desc: ' trigger chain reload if the specified file is modified/touched', + type: any} + touch-logrotate: {desc: ' trigger logrotation if the specified file is modified/touched', + type: any} + touch-logreopen: {desc: ' trigger log reopen if the specified file is modified/touched', + type: any} + touch-exec: {desc: ' run command when the specified file is modified/touched (syntax: + file command)', type: any} + touch-signal: {desc: ' signal when the specified file is modified/touched (syntax: + file signal)', type: any} + fs-reload: {desc: ' graceful reload when the specified filesystem object is modified', + type: any} + fs-brutal-reload: {desc: ' brutal reload when the specified filesystem object is + modified', type: any} + fs-signal: {desc: ' raise a uwsgi signal when the specified filesystem object is + modified (syntax: file signal)', type: any} + check-mountpoint: {desc: ' destroy the instance if a filesystem is no more reachable + (useful for reliable Fuse management)', type: any} + mountpoint-check: {desc: ' destroy the instance if a filesystem is no more reachable + (useful for reliable Fuse management)', type: any} + check-mount: {desc: ' destroy the instance if a filesystem is no more reachable + (useful for reliable Fuse management)', type: any} + mount-check: {desc: ' destroy the instance if a filesystem is no more reachable + (useful for reliable Fuse management)', type: any} + propagate-touch: {desc: ' over-engineering option for system with flaky signal management', + type: any} + limit-post: {desc: ' limit request body', type: any} + no-orphans: {desc: ' automatically kill workers if master dies (can be dangerous + for availability)', type: any} + prio: {desc: ' set processes/threads priority', type: any} + cpu-affinity: {desc: ' set cpu affinity', type: int} + post-buffering: {desc: ' enable post buffering', type: any} + post-buffering-bufsize: {desc: ' set buffer size for read() in post buffering mode', + type: any} + body-read-warning: {desc: ' set the amount of allowed memory allocation (in megabytes) + for request body before starting printing a warning', type: any} + upload-progress: {desc: ' enable creation of .json files in the specified directory + during a file upload', type: any} + no-default-app: {desc: ' do not fallback to default app', type: any} + manage-script-name: {desc: ' automatically rewrite SCRIPT_NAME and PATH_INFO', type: any} + ignore-script-name: {desc: ' ignore SCRIPT_NAME', type: any} + catch-exceptions: {desc: ' report exception as http output (discouraged, use only + for testing)', type: any} + reload-on-exception: {desc: ' reload a worker when an exception is raised', type: any} + reload-on-exception-type: {desc: ' reload a worker when a specific exception type + is raised', type: any} + reload-on-exception-value: {desc: ' reload a worker when a specific exception value + is raised', type: any} + reload-on-exception-repr: {desc: ' reload a worker when a specific exception type+value + (language-specific) is raised', type: any} + exception-handler: {desc: ' add an exception handler', type: any} + enable-metrics: {desc: ' enable metrics subsystem', type: any} + metric: {desc: ' add a custom metric', type: any} + metric-threshold: {desc: ' add a metric threshold/alarm', type: any} + metric-alarm: {desc: ' add a metric threshold/alarm', type: any} + alarm-metric: {desc: ' add a metric threshold/alarm', type: any} + metrics-dir: {desc: ' export metrics as text files to the specified directory', + type: any} + metrics-dir-restore: {desc: ' restore last value taken from the metrics dir', type: any} + metric-dir: {desc: ' export metrics as text files to the specified directory', type: any} + metric-dir-restore: {desc: ' restore last value taken from the metrics dir', type: any} + metrics-no-cores: {desc: ' disable generation of cores-related metrics', type: any} + udp: {desc: ' run the udp server on the specified address', type: any} + stats: {desc: ' enable the stats server on the specified address', type: any} + stats-server: {desc: ' enable the stats server on the specified address', type: any} + stats-http: {desc: ' prefix stats server json output with http headers', type: any} + stats-minified: {desc: ' minify statistics json output', type: any} + stats-min: {desc: ' minify statistics json output', type: any} + stats-push: {desc: ' push the stats json to the specified destination', type: any} + stats-pusher-default-freq: {desc: ' set the default frequency of stats pushers', + type: int} + stats-pushers-default-freq: {desc: ' set the default frequency of stats pushers', + type: int} + stats-no-cores: {desc: ' disable generation of cores-related stats', type: any} + stats-no-metrics: {desc: ' do not include metrics in stats output', type: any} + multicast: {desc: ' subscribe to specified multicast group', type: any} + multicast-ttl: {desc: ' set multicast ttl', type: int} + multicast-loop: {desc: ' set multicast loop (default 1)', type: int} + master-fifo: {desc: ' enable the master fifo', type: any} + notify-socket: {desc: ' enable the notification socket', type: any} + subscription-notify-socket: {desc: ' set the notification socket for subscriptions', + type: any} + subscription-mountpoints: {desc: ' enable mountpoints support for subscription system', + type: any} + subscription-mountpoint: {desc: ' enable mountpoints support for subscription system', + type: any} + legion: {desc: ' became a member of a legion', type: any} + legion-mcast: {desc: ' became a member of a legion (shortcut for multicast)', type: any} + legion-node: {desc: ' add a node to a legion', type: any} + legion-freq: {desc: ' set the frequency of legion packets', type: int} + legion-tolerance: {desc: ' set the tolerance of legion subsystem', type: int} + legion-death-on-lord-error: {desc: ' declare itself as a dead node for the specified + amount of seconds if one of the lord hooks fails', type: int} + legion-skew-tolerance: {desc: ' set the clock skew tolerance of legion subsystem + (default 30 seconds)', type: int} + legion-lord: {desc: ' action to call on Lord election', type: any} + legion-unlord: {desc: ' action to call on Lord dismiss', type: any} + legion-setup: {desc: ' action to call on legion setup', type: any} + legion-death: {desc: ' action to call on legion death (shutdown of the instance)', + type: any} + legion-join: {desc: ' action to call on legion join (first time quorum is reached)', + type: any} + legion-node-joined: {desc: ' action to call on new node joining legion', type: any} + legion-node-left: {desc: ' action to call node leaving legion', type: any} + legion-quorum: {desc: ' set the quorum of a legion', type: any} + legion-scroll: {desc: ' set the scroll of a legion', type: any} + legion-scroll-max-size: {desc: ' set max size of legion scroll buffer', type: any} + legion-scroll-list-max-size: {desc: ' set max size of legion scroll list buffer', + type: any} + subscriptions-sign-check: {desc: ' set digest algorithm and certificate directory + for secured subscription system', type: any} + subscriptions-sign-check-tolerance: {desc: ' set the maximum tolerance (in seconds) + of clock skew for secured subscription system', type: int} + subscriptions-sign-skip-uid: {desc: ' skip signature check for the specified uid + when using unix sockets credentials', type: any} + subscriptions-credentials-check: {desc: ' add a directory to search for subscriptions + key credentials', type: any} + subscriptions-use-credentials: {desc: ' enable management of SCM_CREDENTIALS in + subscriptions UNIX sockets', type: any} + subscription-algo: {desc: ' set load balancing algorithm for the subscription system', + type: any} + subscription-dotsplit: {desc: ' try to fallback to the next part (dot based) in + subscription key', type: any} + subscribe-to: {desc: ' subscribe to the specified subscription server', type: any} + st: {desc: ' subscribe to the specified subscription server', type: any} + subscribe: {desc: ' subscribe to the specified subscription server', type: any} + subscribe2: {desc: ' subscribe to the specified subscription server using advanced + keyval syntax', type: any} + subscribe-freq: {desc: ' send subscription announce at the specified interval', + type: int} + subscription-tolerance: {desc: ' set tolerance for subscription servers', type: int} + unsubscribe-on-graceful-reload: {desc: ' force unsubscribe request even during graceful + reload', type: any} + start-unsubscribed: {desc: ' configure subscriptions but do not send them (useful + with master fifo)', type: any} + subscribe-with-modifier1: {desc: ' force the specififed modifier1 when subscribing', + type: any} + snmp: {desc: ' enable the embedded snmp server', type: any} + snmp-community: {desc: ' set the snmp community string', type: any} + ssl-verbose: {desc: ' be verbose about SSL errors', type: any} + ssl-sessions-use-cache: {desc: ' use uWSGI cache for ssl sessions storage', type: any} + ssl-session-use-cache: {desc: ' use uWSGI cache for ssl sessions storage', type: any} + ssl-sessions-timeout: {desc: ' set SSL sessions timeout (default: 300 seconds)', + type: int} + ssl-session-timeout: {desc: ' set SSL sessions timeout (default: 300 seconds)', + type: int} + sni: {desc: ' add an SNI-governed SSL context', type: any} + sni-dir: {desc: ' check for cert/key/client_ca file in the specified directory and + create a sni/ssl context on demand', type: any} + sni-dir-ciphers: {desc: ' set ssl ciphers for sni-dir option', type: any} + ssl-enable3: {desc: ' enable SSLv3 (insecure)', type: any} + ssl-option: {desc: ' set a raw ssl option (numeric value)', type: any} + sni-regexp: {desc: ' add an SNI-governed SSL context (the key is a regexp)', type: any} + ssl-tmp-dir: {desc: ' store ssl-related temp files in the specified directory', + type: any} + check-interval: {desc: ' set the interval (in seconds) of master checks', type: int} + forkbomb-delay: {desc: ' sleep for the specified number of seconds when a forkbomb + is detected', type: int} + binary-path: {desc: ' force binary path', type: any} + privileged-binary-patch: {desc: ' patch the uwsgi binary with a new command (before + privileges drop)', type: any} + unprivileged-binary-patch: {desc: ' patch the uwsgi binary with a new command (after + privileges drop)', type: any} + privileged-binary-patch-arg: {desc: ' patch the uwsgi binary with a new command + and arguments (before privileges drop)', type: any} + unprivileged-binary-patch-arg: {desc: ' patch the uwsgi binary with a new command + and arguments (after privileges drop)', type: any} + async: {desc: ' enable async mode with specified cores', type: int} + disable-async-warn-on-queue-full: {desc: ' Disable printing ''async queue is full'' + warning messages.', type: any} + max-fd: {desc: ' set maximum number of file descriptors (requires root privileges)', + type: int} + logto: {desc: ' set logfile/udp address', type: any} + logto2: {desc: ' log to specified file or udp address after privileges drop', type: any} + log-format: {desc: ' set advanced format for request logging', type: any} + logformat: {desc: ' set advanced format for request logging', type: any} + logformat-strftime: {desc: ' apply strftime to logformat output', type: any} + log-format-strftime: {desc: ' apply strftime to logformat output', type: any} + logfile-chown: {desc: ' chown logfiles', type: any} + logfile-chmod: {desc: ' chmod logfiles', type: any} + log-syslog: {desc: ' log to syslog', type: any} + log-socket: {desc: ' send logs to the specified socket', type: any} + req-logger: {desc: ' set/append a request logger', type: any} + logger-req: {desc: ' set/append a request logger', type: any} + logger: {desc: ' set/append a logger', type: any} + logger-list: {desc: ' list enabled loggers', type: any} + loggers-list: {desc: ' list enabled loggers', type: any} + threaded-logger: {desc: ' offload log writing to a thread', type: any} + log-encoder: {desc: ' add an item in the log encoder chain', type: any} + log-req-encoder: {desc: ' add an item in the log req encoder chain', type: any} + log-drain: {desc: ' drain (do not show) log lines matching the specified regexp', + type: any} + log-filter: {desc: ' show only log lines matching the specified regexp', type: any} + log-route: {desc: ' log to the specified named logger if regexp applied on logline + matches', type: any} + log-req-route: {desc: ' log requests to the specified named logger if regexp applied + on logline matches', type: any} + use-abort: {desc: ' call abort() on segfault/fpe, could be useful for generating + a core dump', type: any} + alarm: {desc: ' create a new alarm, syntax: ', type: any} + alarm-cheap: {desc: ' use main alarm thread rather than create dedicated threads + for curl-based alarms', type: any} + alarm-freq: {desc: ' tune the anti-loop alam system (default 3 seconds)', type: int} + alarm-fd: {desc: ' raise the specified alarm when an fd is read for read (by default + it reads 1 byte, set 8 for eventfd)', type: any} + alarm-segfault: {desc: ' raise the specified alarm when the segmentation fault handler + is executed', type: any} + segfault-alarm: {desc: ' raise the specified alarm when the segmentation fault handler + is executed', type: any} + alarm-backlog: {desc: ' raise the specified alarm when the socket backlog queue + is full', type: any} + backlog-alarm: {desc: ' raise the specified alarm when the socket backlog queue + is full', type: any} + lq-alarm: {desc: ' raise the specified alarm when the socket backlog queue is full', + type: any} + alarm-lq: {desc: ' raise the specified alarm when the socket backlog queue is full', + type: any} + alarm-listen-queue: {desc: ' raise the specified alarm when the socket backlog queue + is full', type: any} + listen-queue-alarm: {desc: ' raise the specified alarm when the socket backlog queue + is full', type: any} + log-alarm: {desc: ' raise the specified alarm when a log line matches the specified + regexp, syntax: [,alarm...] ', type: any} + alarm-log: {desc: ' raise the specified alarm when a log line matches the specified + regexp, syntax: [,alarm...] ', type: any} + not-log-alarm: {desc: ' skip the specified alarm when a log line matches the specified + regexp, syntax: [,alarm...] ', type: any} + not-alarm-log: {desc: ' skip the specified alarm when a log line matches the specified + regexp, syntax: [,alarm...] ', type: any} + alarm-list: {desc: ' list enabled alarms', type: any} + alarms-list: {desc: ' list enabled alarms', type: any} + alarm-msg-size: {desc: ' set the max size of an alarm message (default 8192)', type: any} + log-master: {desc: ' delegate logging to master process', type: any} + log-master-bufsize: {desc: ' set the buffer size for the master logger. bigger log + messages will be truncated', type: any} + log-master-stream: {desc: ' create the master logpipe as SOCK_STREAM', type: any} + log-master-req-stream: {desc: ' create the master requests logpipe as SOCK_STREAM', + type: any} + log-reopen: {desc: ' reopen log after reload', type: any} + log-truncate: {desc: ' truncate log on startup', type: any} + log-maxsize: {desc: ' set maximum logfile size', type: any} + log-backupname: {desc: ' set logfile name after rotation', type: any} + logdate: {desc: ' prefix logs with date or a strftime string', type: any} + log-date: {desc: ' prefix logs with date or a strftime string', type: any} + log-prefix: {desc: ' prefix logs with a string', type: any} + log-zero: {desc: ' log responses without body', type: any} + log-slow: {desc: ' log requests slower than the specified number of milliseconds', + type: int} + log-4xx: {desc: ' log requests with a 4xx response', type: any} + log-5xx: {desc: ' log requests with a 5xx response', type: any} + log-big: {desc: ' log requestes bigger than the specified size', type: any} + log-sendfile: {desc: ' log sendfile requests', type: any} + log-ioerror: {desc: ' log requests with io errors', type: any} + log-micros: {desc: ' report response time in microseconds instead of milliseconds', + type: any} + log-x-forwarded-for: {desc: ' use the ip from X-Forwarded-For header instead of + REMOTE_ADDR', type: any} + master-as-root: {desc: ' leave master process running as root', type: any} + drop-after-init: {desc: ' run privileges drop after plugin initialization', type: any} + drop-after-apps: {desc: ' run privileges drop after apps loading', type: any} + force-cwd: {desc: ' force the initial working directory to the specified value', + type: any} + binsh: {desc: ' override /bin/sh (used by exec hooks, it always fallback to /bin/sh)', + type: any} + chdir: {desc: ' chdir to specified directory before apps loading', type: any} + chdir2: {desc: ' chdir to specified directory after apps loading', type: any} + lazy: {desc: ' set lazy mode (load apps in workers instead of master)', type: any} + lazy-apps: {desc: ' load apps in each worker instead of the master', type: any} + cheap: {desc: ' set cheap mode (spawn workers only after the first request)', type: any} + cheaper: {desc: ' set cheaper mode (adaptive process spawning)', type: int} + cheaper-initial: {desc: ' set the initial number of processes to spawn in cheaper + mode', type: int} + cheaper-algo: {desc: ' choose to algorithm used for adaptive process spawning', + type: any} + cheaper-step: {desc: ' number of additional processes to spawn at each overload', + type: int} + cheaper-overload: {desc: ' increase workers after specified overload', type: any} + cheaper-idle: {desc: ' decrease workers after specified idle (algo: spare2) (default: + 10)', type: int} + cheaper-algo-list: {desc: ' list enabled cheapers algorithms', type: any} + cheaper-algos-list: {desc: ' list enabled cheapers algorithms', type: any} + cheaper-list: {desc: ' list enabled cheapers algorithms', type: any} + cheaper-rss-limit-soft: {desc: ' don''t spawn new workers if total resident memory + usage of all workers is higher than this limit', type: any} + cheaper-rss-limit-hard: {desc: ' if total workers resident memory usage is higher + try to stop workers', type: any} + idle: {desc: ' set idle mode (put uWSGI in cheap mode after inactivity)', type: int} + die-on-idle: {desc: ' shutdown uWSGI when idle', type: any} + mount: {desc: ' load application under mountpoint', type: any} + worker-mount: {desc: ' load application under mountpoint in the specified worker + or after workers spawn', type: any} + threads: {desc: ' run each worker in prethreaded mode with the specified number + of threads', type: int} + thread-stacksize: {desc: ' set threads stacksize', type: int} + threads-stacksize: {desc: ' set threads stacksize', type: int} + thread-stack-size: {desc: ' set threads stacksize', type: int} + threads-stack-size: {desc: ' set threads stacksize', type: int} + vhost: {desc: ' enable virtualhosting mode (based on SERVER_NAME variable)', type: any} + vhost-host: {desc: ' enable virtualhosting mode (based on HTTP_HOST variable)', + type: any} + route: {desc: ' add a route', type: any} + route-host: {desc: ' add a route based on Host header', type: any} + route-uri: {desc: ' add a route based on REQUEST_URI', type: any} + route-qs: {desc: ' add a route based on QUERY_STRING', type: any} + route-remote-addr: {desc: ' add a route based on REMOTE_ADDR', type: any} + route-user-agent: {desc: ' add a route based on HTTP_USER_AGENT', type: any} + route-remote-user: {desc: ' add a route based on REMOTE_USER', type: any} + route-referer: {desc: ' add a route based on HTTP_REFERER', type: any} + route-label: {desc: ' add a routing label (for use with goto)', type: any} + route-if: {desc: ' add a route based on condition', type: any} + route-if-not: {desc: ' add a route based on condition (negate version)', type: any} + route-run: {desc: ' always run the specified route action', type: any} + final-route: {desc: ' add a final route', type: any} + final-route-status: {desc: ' add a final route for the specified status', type: any} + final-route-host: {desc: ' add a final route based on Host header', type: any} + final-route-uri: {desc: ' add a final route based on REQUEST_URI', type: any} + final-route-qs: {desc: ' add a final route based on QUERY_STRING', type: any} + final-route-remote-addr: {desc: ' add a final route based on REMOTE_ADDR', type: any} + final-route-user-agent: {desc: ' add a final route based on HTTP_USER_AGENT', type: any} + final-route-remote-user: {desc: ' add a final route based on REMOTE_USER', type: any} + final-route-referer: {desc: ' add a final route based on HTTP_REFERER', type: any} + final-route-label: {desc: ' add a final routing label (for use with goto)', type: any} + final-route-if: {desc: ' add a final route based on condition', type: any} + final-route-if-not: {desc: ' add a final route based on condition (negate version)', + type: any} + final-route-run: {desc: ' always run the specified final route action', type: any} + error-route: {desc: ' add an error route', type: any} + error-route-status: {desc: ' add an error route for the specified status', type: any} + error-route-host: {desc: ' add an error route based on Host header', type: any} + error-route-uri: {desc: ' add an error route based on REQUEST_URI', type: any} + error-route-qs: {desc: ' add an error route based on QUERY_STRING', type: any} + error-route-remote-addr: {desc: ' add an error route based on REMOTE_ADDR', type: any} + error-route-user-agent: {desc: ' add an error route based on HTTP_USER_AGENT', type: any} + error-route-remote-user: {desc: ' add an error route based on REMOTE_USER', type: any} + error-route-referer: {desc: ' add an error route based on HTTP_REFERER', type: any} + error-route-label: {desc: ' add an error routing label (for use with goto)', type: any} + error-route-if: {desc: ' add an error route based on condition', type: any} + error-route-if-not: {desc: ' add an error route based on condition (negate version)', + type: any} + error-route-run: {desc: ' always run the specified error route action', type: any} + response-route: {desc: ' add a response route', type: any} + response-route-status: {desc: ' add a response route for the specified status', + type: any} + response-route-host: {desc: ' add a response route based on Host header', type: any} + response-route-uri: {desc: ' add a response route based on REQUEST_URI', type: any} + response-route-qs: {desc: ' add a response route based on QUERY_STRING', type: any} + response-route-remote-addr: {desc: ' add a response route based on REMOTE_ADDR', + type: any} + response-route-user-agent: {desc: ' add a response route based on HTTP_USER_AGENT', + type: any} + response-route-remote-user: {desc: ' add a response route based on REMOTE_USER', + type: any} + response-route-referer: {desc: ' add a response route based on HTTP_REFERER', type: any} + response-route-label: {desc: ' add a response routing label (for use with goto)', + type: any} + response-route-if: {desc: ' add a response route based on condition', type: any} + response-route-if-not: {desc: ' add a response route based on condition (negate + version)', type: any} + response-route-run: {desc: ' always run the specified response route action', type: any} + router-list: {desc: ' list enabled routers', type: any} + routers-list: {desc: ' list enabled routers', type: any} + error-page-403: {desc: ' add an error page (html) for managed 403 response', type: any} + error-page-404: {desc: ' add an error page (html) for managed 404 response', type: any} + error-page-500: {desc: ' add an error page (html) for managed 500 response', type: any} + websockets-ping-freq: {desc: ' set the frequency (in seconds) of websockets automatic + ping packets', type: int} + websocket-ping-freq: {desc: ' set the frequency (in seconds) of websockets automatic + ping packets', type: int} + websockets-pong-tolerance: {desc: ' set the tolerance (in seconds) of websockets + ping/pong subsystem', type: int} + websocket-pong-tolerance: {desc: ' set the tolerance (in seconds) of websockets + ping/pong subsystem', type: int} + websockets-max-size: {desc: ' set the max allowed size of websocket messages (in + Kbytes, default 1024)', type: any} + websocket-max-size: {desc: ' set the max allowed size of websocket messages (in + Kbytes, default 1024)', type: any} + chunked-input-limit: {desc: ' set the max size of a chunked input part (default + 1MB, in bytes)', type: any} + chunked-input-timeout: {desc: ' set default timeout for chunked input', type: int} + clock: {desc: ' set a clock source', type: any} + clock-list: {desc: ' list enabled clocks', type: any} + clocks-list: {desc: ' list enabled clocks', type: any} + add-header: {desc: ' automatically add HTTP headers to response', type: any} + rem-header: {desc: ' automatically remove specified HTTP header from the response', + type: any} + del-header: {desc: ' automatically remove specified HTTP header from the response', + type: any} + collect-header: {desc: ' store the specified response header in a request var (syntax: + header var)', type: any} + response-header-collect: {desc: ' store the specified response header in a request + var (syntax: header var)', type: any} + pull-header: {desc: ' store the specified response header in a request var and remove + it from the response (syntax: header var)', type: any} + check-static: {desc: ' check for static files in the specified directory', type: any} + check-static-docroot: {desc: ' check for static files in the requested DOCUMENT_ROOT', + type: any} + static-check: {desc: ' check for static files in the specified directory', type: any} + 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-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', + type: any} + static-cache-paths: {desc: ' put resolved paths in the uWSGI cache for the specified + amount of seconds', type: int} + static-cache-paths-name: {desc: ' use the specified cache for static paths', type: any} + mimefile: {desc: ' set mime types file path (default /etc/mime.types)', type: any} + mime-file: {desc: ' set mime types file path (default /etc/mime.types)', type: any} + static-expires-type: {desc: ' set the Expires header based on content type', type: any} + static-expires-type-mtime: {desc: ' set the Expires header based on content type + and file mtime', type: any} + static-expires: {desc: ' set the Expires header based on filename regexp', type: any} + static-expires-mtime: {desc: ' set the Expires header based on filename regexp and + file mtime', type: any} + static-expires-uri: {desc: ' set the Expires header based on REQUEST_URI regexp', + type: any} + static-expires-uri-mtime: {desc: ' set the Expires header based on REQUEST_URI regexp + and file mtime', type: any} + static-expires-path-info: {desc: ' set the Expires header based on PATH_INFO regexp', + type: any} + static-expires-path-info-mtime: {desc: ' set the Expires header based on PATH_INFO + regexp and file mtime', type: any} + static-gzip: {desc: ' if the supplied regexp matches the static file translation + it will search for a gzip version', type: any} + static-gzip-all: {desc: ' check for a gzip version of all requested static files', + type: any} + static-gzip-dir: {desc: ' check for a gzip version of all requested static files + in the specified dir/prefix', type: any} + static-gzip-prefix: {desc: ' check for a gzip version of all requested static files + in the specified dir/prefix', type: any} + static-gzip-ext: {desc: ' check for a gzip version of all requested static files + with the specified ext/suffix', type: any} + static-gzip-suffix: {desc: ' check for a gzip version of all requested static files + with the specified ext/suffix', type: any} + honour-range: {desc: ' enable support for the HTTP Range header', type: any} + offload-threads: {desc: ' set the number of offload threads to spawn (per-worker, + default 0)', type: int} + offload-thread: {desc: ' set the number of offload threads to spawn (per-worker, + default 0)', type: int} + file-serve-mode: {desc: ' set static file serving mode', type: any} + fileserve-mode: {desc: ' set static file serving mode', type: any} + disable-sendfile: {desc: ' disable sendfile() and rely on boring read()/write()', + type: any} + check-cache: {desc: ' check for response data in the specified cache (empty for + default cache)', type: any} + close-on-exec: {desc: ' set close-on-exec on connection sockets (could be required + for spawning processes in requests)', type: any} + close-on-exec2: {desc: ' set close-on-exec on server sockets (could be required + for spawning processes in requests)', type: any} + mode: {desc: ' set uWSGI custom mode', type: any} + env: {desc: ' set environment variable', type: any} + ienv: {desc: ' set environment variable (IMMEDIATE version)', type: any} + envdir: {desc: ' load a daemontools compatible envdir', type: any} + early-envdir: {desc: ' load a daemontools compatible envdir ASAP', type: any} + unenv: {desc: ' unset environment variable', type: any} + vacuum: {desc: ' try to remove all of the generated file/sockets', type: any} + file-write: {desc: ' write the specified content to the specified file (syntax: + file=value) before privileges drop', type: any} + cgroup: {desc: ' put the processes in the specified cgroup', type: any} + cgroup-opt: {desc: ' set value in specified cgroup option', type: any} + cgroup-dir-mode: {desc: ' set permission for cgroup directory (default is 700)', + type: any} + namespace: {desc: ' run in a new namespace under the specified rootfs', type: any} + namespace-keep-mount: {desc: ' keep the specified mountpoint in your namespace', + type: any} + ns: {desc: ' run in a new namespace under the specified rootfs', type: any} + namespace-net: {desc: ' add network namespace', type: any} + ns-net: {desc: ' add network namespace', type: any} + enable-proxy-protocol: {desc: ' enable PROXY1 protocol support (only for http parsers)', + type: any} + reuse-port: {desc: ' enable REUSE_PORT flag on socket (BSD only)', type: any} + tcp-fast-open: {desc: ' enable TCP_FASTOPEN flag on TCP sockets with the specified + qlen value', type: int} + tcp-fastopen: {desc: ' enable TCP_FASTOPEN flag on TCP sockets with the specified + qlen value', type: int} + tcp-fast-open-client: {desc: ' use sendto(..., MSG_FASTOPEN, ...) instead of connect() + if supported', type: any} + tcp-fastopen-client: {desc: ' use sendto(..., MSG_FASTOPEN, ...) instead of connect() + if supported', type: any} + zerg: {desc: ' attach to a zerg server', type: any} + zerg-fallback: {desc: ' fallback to normal sockets if the zerg server is not available', + type: any} + zerg-server: {desc: ' enable the zerg server on the specified UNIX socket', type: any} + cron: {desc: ' add a cron task', type: any} + cron2: {desc: ' add a cron task (key=val syntax)', type: any} + unique-cron: {desc: ' add a unique cron task', type: any} + cron-harakiri: {desc: ' set the maximum time (in seconds) we wait for cron command + to complete', type: int} + legion-cron: {desc: ' add a cron task runnable only when the instance is a lord + of the specified legion', type: any} + cron-legion: {desc: ' add a cron task runnable only when the instance is a lord + of the specified legion', type: any} + unique-legion-cron: {desc: ' add a unique cron task runnable only when the instance + is a lord of the specified legion', type: any} + unique-cron-legion: {desc: ' add a unique cron task runnable only when the instance + is a lord of the specified legion', type: any} + loop: {desc: ' select the uWSGI loop engine', type: any} + loop-list: {desc: ' list enabled loop engines', type: any} + loops-list: {desc: ' list enabled loop engines', type: any} + worker-exec: {desc: ' run the specified command as worker', type: any} + worker-exec2: {desc: ' run the specified command as worker (after post_fork hook)', + type: any} + attach-daemon: {desc: ' attach a command/daemon to the master process (the command + has to not go in background)', type: any} + attach-control-daemon: {desc: ' attach a command/daemon to the master process (the + command has to not go in background), when the daemon dies, the master dies + too', type: any} + smart-attach-daemon: {desc: ' attach a command/daemon to the master process managed + by a pidfile (the command has to daemonize)', type: any} + smart-attach-daemon2: {desc: ' attach a command/daemon to the master process managed + by a pidfile (the command has to NOT daemonize)', type: any} + legion-attach-daemon: {desc: ' same as --attach-daemon but daemon runs only on legion + lord node', type: any} + legion-smart-attach-daemon: {desc: ' same as --smart-attach-daemon but daemon runs + only on legion lord node', type: any} + legion-smart-attach-daemon2: {desc: ' same as --smart-attach-daemon2 but daemon + runs only on legion lord node', type: any} + daemons-honour-stdin: {desc: ' do not change the stdin of external daemons to /dev/null', + type: any} + attach-daemon2: {desc: ' attach-daemon keyval variant (supports smart modes too)', + type: any} + plugins: {desc: ' load uWSGI plugins', type: any} + plugin: {desc: ' load uWSGI plugins', type: any} + need-plugins: {desc: ' load uWSGI plugins (exit on error)', type: any} + need-plugin: {desc: ' load uWSGI plugins (exit on error)', type: any} + plugins-dir: {desc: ' add a directory to uWSGI plugin search path', type: any} + plugin-dir: {desc: ' add a directory to uWSGI plugin search path', type: any} + plugins-list: {desc: ' list enabled plugins', type: any} + plugin-list: {desc: ' list enabled plugins', type: any} + autoload: {desc: ' try to automatically load plugins when unknown options are found', + type: any} + dlopen: {desc: ' blindly load a shared library', type: any} + allowed-modifiers: {desc: ' comma separated list of allowed modifiers', type: any} + remap-modifier: {desc: ' remap request modifier from one id to another', type: any} + dump-options: {desc: ' dump the full list of available options', type: any} + show-config: {desc: ' show the current config reformatted as ini', type: any} + binary-append-data: {desc: ' return the content of a resource to stdout for appending + to a uwsgi binary (for data:// usage)', type: any} + print: {desc: ' simple print', type: any} + iprint: {desc: ' simple print (immediate version)', type: any} + exit: {desc: ' force exit() of the instance', type: any} + cflags: {desc: ' report uWSGI CFLAGS (useful for building external plugins)', type: any} + dot-h: {desc: ' dump the uwsgi.h used for building the core (useful for building + external plugins)', type: any} + config-py: {desc: ' dump the uwsgiconfig.py used for building the core (useful + for building external plugins)', type: any} + build-plugin: {desc: ' build a uWSGI plugin for the current binary', type: any} + version: {desc: ' print uWSGI version', type: any} + asyncio: {desc: ' a shortcut enabling asyncio loop engine with the specified number + of async cores and optimal parameters', type: any} + carbon: {desc: ' push statistics to the specified carbon server', type: any} + carbon-timeout: {desc: ' set carbon connection timeout in seconds (default 3)', + type: int} + carbon-freq: {desc: ' set carbon push frequency in seconds (default 60)', type: int} + carbon-id: {desc: ' set carbon id', type: any} + carbon-no-workers: {desc: ' disable generation of single worker metrics', type: any} + carbon-max-retry: {desc: ' set maximum number of retries in case of connection errors + (default 1)', type: int} + carbon-retry-delay: {desc: ' set connection retry delay in seconds (default 7)', + type: int} + carbon-root: {desc: ' set carbon metrics root node (default ''uwsgi'')', type: any} + carbon-hostname-dots: {desc: ' set char to use as a replacement for dots in hostname + (dots are not replaced by default)', type: any} + carbon-name-resolve: {desc: ' allow using hostname as carbon server address (default + disabled)', type: any} + carbon-resolve-names: {desc: ' allow using hostname as carbon server address (default + disabled)', type: any} + carbon-idle-avg: {desc: ' average values source during idle period (no requests), + can be "last", "zero", "none" (default is last)', type: any} + carbon-use-metrics: {desc: ' don''t compute all statistics, use metrics subsystem + data instead (warning! key names will be different)', type: any} + cgi: {desc: ' add a cgi mountpoint/directory/script', type: any} + cgi-map-helper: {desc: ' add a cgi map-helper', type: any} + cgi-helper: {desc: ' add a cgi map-helper', type: any} + cgi-from-docroot: {desc: ' blindly enable cgi in DOCUMENT_ROOT', type: any} + cgi-buffer-size: {desc: ' set cgi buffer size', type: any} + cgi-timeout: {desc: ' set cgi script timeout', type: int} + cgi-index: {desc: ' add a cgi index file', type: any} + cgi-allowed-ext: {desc: ' cgi allowed extension', type: any} + cgi-unset: {desc: ' unset specified environment variables', type: any} + cgi-loadlib: {desc: ' load a cgi shared library/optimizer', type: any} + cgi-optimize: {desc: ' enable cgi realpath() optimizer', type: any} + cgi-optimized: {desc: ' enable cgi realpath() optimizer', type: any} + cgi-path-info: {desc: ' disable PATH_INFO management in cgi scripts', type: any} + cgi-do-not-kill-on-error: {desc: ' do not send SIGKILL to cgi script on errors', + type: any} + cgi-async-max-attempts: {desc: ' max waitpid() attempts in cgi async mode (default + 10)', type: int} + coroae: {desc: ' a shortcut enabling Coro::AnyEvent loop engine with the specified + number of async cores and optimal parameters', type: any} + curl-cron: {desc: ' add a cron task invoking the specified url via CURL', type: any} + cron-curl: {desc: ' add a cron task invoking the specified url via CURL', type: any} + legion-curl-cron: {desc: ' add a cron task invoking the specified url via CURL runnable + only when the instance is a lord of the specified legion', type: any} + legion-cron-curl: {desc: ' add a cron task invoking the specified url via CURL runnable + only when the instance is a lord of the specified legion', type: any} + curl-cron-legion: {desc: ' add a cron task invoking the specified url via CURL runnable + only when the instance is a lord of the specified legion', type: any} + cron-curl-legion: {desc: ' add a cron task invoking the specified url via CURL runnable + only when the instance is a lord of the specified legion', type: any} + dumbloop-modifier1: {desc: ' set the modifier1 for the code_string', type: int} + dumbloop-code: {desc: ' set the script to load for the code_string', type: any} + dumbloop-function: {desc: ' set the function to run for the code_string', type: any} + fastrouter: {desc: ' run the fastrouter on the specified port', type: any} + fastrouter-processes: {desc: ' prefork the specified number of fastrouter processes', + type: int} + fastrouter-workers: {desc: ' prefork the specified number of fastrouter processes', + type: int} + fastrouter-zerg: {desc: ' attach the fastrouter to a zerg server', type: any} + fastrouter-use-cache: {desc: ' use uWSGI cache as hostname->server mapper for the + fastrouter', type: any} + fastrouter-use-pattern: {desc: ' use a pattern for fastrouter hostname->server mapping', + type: any} + fastrouter-use-base: {desc: ' use a base dir for fastrouter hostname->server mapping', + type: any} + fastrouter-fallback: {desc: ' fallback to the specified node in case of error', + type: any} + fastrouter-use-code-string: {desc: ' use code string as hostname->server mapper + for the fastrouter', type: any} + fastrouter-use-socket: {desc: ' forward request to the specified uwsgi socket', + type: any} + fastrouter-to: {desc: ' forward requests to the specified uwsgi server (you can + specify it multiple times for load balancing)', type: any} + fastrouter-gracetime: {desc: ' retry connections to dead static nodes after the + specified amount of seconds', type: int} + fastrouter-events: {desc: ' set the maximum number of concurrent events', type: int} + fastrouter-quiet: {desc: ' do not report failed connections to instances', type: any} + fastrouter-cheap: {desc: ' run the fastrouter in cheap mode', type: any} + fastrouter-subscription-server: {desc: ' run the fastrouter subscription server + on the specified address', type: any} + fastrouter-subscription-slot: {desc: ' *** deprecated ***', type: any} + fastrouter-timeout: {desc: ' set fastrouter timeout', type: int} + fastrouter-post-buffering: {desc: ' enable fastrouter post buffering', type: any} + fastrouter-post-buffering-dir: {desc: ' put fastrouter buffered files to the specified + directory (noop, use TMPDIR env)', type: any} + fastrouter-stats: {desc: ' run the fastrouter stats server', type: any} + fastrouter-stats-server: {desc: ' run the fastrouter stats server', type: any} + fastrouter-ss: {desc: ' run the fastrouter stats server', type: any} + fastrouter-harakiri: {desc: ' enable fastrouter harakiri', type: int} + fastrouter-uid: {desc: ' drop fastrouter privileges to the specified uid', type: any} + fastrouter-gid: {desc: ' drop fastrouter privileges to the specified gid', type: any} + fastrouter-resubscribe: {desc: ' forward subscriptions to the specified subscription + server', type: any} + fastrouter-resubscribe-bind: {desc: ' bind to the specified address when re-subscribing', + type: any} + fastrouter-buffer-size: {desc: ' set internal buffer size (default: page size)', + type: any} + fastrouter-fallback-on-no-key: {desc: ' move to fallback node even if a subscription + key is not found', type: any} + fastrouter-force-key: {desc: ' skip uwsgi parsing and directly set a key', type: any} + fiber: {desc: ' enable ruby fiber as suspend engine', type: any} + forkptyrouter: {desc: ' run the forkptyrouter on the specified address', type: any} + forkpty-router: {desc: ' run the forkptyrouter on the specified address', type: any} + forkptyurouter: {desc: ' run the forkptyrouter on the specified address', type: any} + forkpty-urouter: {desc: ' run the forkptyrouter on the specified address', type: any} + forkptyrouter-command: {desc: ' run the specified command on every connection (default: + /bin/sh)', type: any} + forkpty-router-command: {desc: ' run the specified command on every connection (default: + /bin/sh)', type: any} + forkptyrouter-cmd: {desc: ' run the specified command on every connection (default: + /bin/sh)', type: any} + forkpty-router-cmd: {desc: ' run the specified command on every connection (default: + /bin/sh)', type: any} + forkptyrouter-rows: {desc: ' set forkptyrouter default pty window rows', type: any} + forkptyrouter-cols: {desc: ' set forkptyrouter default pty window cols', type: any} + forkptyrouter-processes: {desc: ' prefork the specified number of forkptyrouter + processes', type: int} + forkptyrouter-workers: {desc: ' prefork the specified number of forkptyrouter processes', + type: int} + forkptyrouter-zerg: {desc: ' attach the forkptyrouter to a zerg server', type: any} + forkptyrouter-fallback: {desc: ' fallback to the specified node in case of error', + type: any} + forkptyrouter-events: {desc: ' set the maximum number of concufptyent events', type: int} + forkptyrouter-cheap: {desc: ' run the forkptyrouter in cheap mode', type: any} + forkptyrouter-timeout: {desc: ' set forkptyrouter timeout', type: int} + forkptyrouter-stats: {desc: ' run the forkptyrouter stats server', type: any} + forkptyrouter-stats-server: {desc: ' run the forkptyrouter stats server', type: any} + forkptyrouter-ss: {desc: ' run the forkptyrouter stats server', type: any} + forkptyrouter-harakiri: {desc: ' enable forkptyrouter harakiri', type: int} + go-load: {desc: ' load a go shared library in the process address space, eventually + patching main.main and __go_init_main', type: any} + gccgo-load: {desc: ' load a go shared library in the process address space, eventually + patching main.main and __go_init_main', type: any} + go-args: {desc: ' set go commandline arguments', type: any} + gccgo-args: {desc: ' set go commandline arguments', type: any} + goroutines: {desc: ' a shortcut setting optimal options for goroutine-based apps, + takes the number of max goroutines to spawn as argument', type: any} + geoip-country: {desc: ' load the specified geoip country database', type: any} + geoip-city: {desc: ' load the specified geoip city database', type: any} + geoip-use-disk: {desc: ' do not cache geoip databases in memory', type: any} + gevent: {desc: ' a shortcut enabling gevent loop engine with the specified number + of async cores and optimal parameters', type: any} + gevent-monkey-patch: {desc: ' call gevent.monkey.patch_all() automatically on startup', + type: any} + gevent-early-monkey-patch: {desc: ' call gevent.monkey.patch_all() automatically + before app loading', type: any} + gevent-wait-for-hub: {desc: ' wait for gevent hub''s death instead of the control + greenlet', type: any} + glusterfs-mount: {desc: ' virtual mount the specified glusterfs volume in a uri', + type: any} + glusterfs-timeout: {desc: ' timeout for glusterfs async mode', type: int} + greenlet: {desc: ' enable greenlet as suspend engine', type: any} + gridfs-mount: {desc: ' mount a gridfs db on the specified mountpoint', type: any} + gridfs-debug: {desc: ' report gridfs mountpoint and itemname for each request (debug)', + type: any} + http: {desc: ' add an http router/server on the specified address', type: any} + httprouter: {desc: ' add an http router/server on the specified address', type: any} + https: {desc: ' add an https router/server on the specified address with specified + certificate and key', type: any} + https2: {desc: ' add an https/spdy router/server using keyval options', type: any} + https-export-cert: {desc: ' export uwsgi variable HTTPS_CC containing the raw client + certificate', type: any} + https-session-context: {desc: ' set the session id context to the specified value', + type: any} + http-to-https: {desc: ' add an http router/server on the specified address and redirect + all of the requests to https', type: any} + http-processes: {desc: ' set the number of http processes to spawn', type: int} + http-workers: {desc: ' set the number of http processes to spawn', type: int} + http-var: {desc: ' add a key=value item to the generated uwsgi packet', type: any} + http-to: {desc: ' forward requests to the specified node (you can specify it multiple + time for lb)', type: any} + http-zerg: {desc: ' attach the http router to a zerg server', type: any} + http-fallback: {desc: ' fallback to the specified node in case of error', type: any} + http-modifier1: {desc: ' set uwsgi protocol modifier1', type: int} + http-modifier2: {desc: ' set uwsgi protocol modifier2', type: int} + http-use-cache: {desc: ' use uWSGI cache as key->value virtualhost mapper', type: any} + http-use-pattern: {desc: ' use the specified pattern for mapping requests to unix + sockets', type: any} + http-use-base: {desc: ' use the specified base for mapping requests to unix sockets', + type: any} + http-events: {desc: ' set the number of concurrent http async events', type: int} + http-subscription-server: {desc: ' enable the subscription server', type: any} + http-timeout: {desc: ' set internal http socket timeout', type: int} + http-manage-expect: {desc: ' manage the Expect HTTP request header (optionally checking + for Content-Length)', type: any} + http-keepalive: {desc: ' HTTP 1.1 keepalive support (non-pipelined) requests', type: int} + http-auto-chunked: {desc: ' automatically transform output to chunked encoding during + HTTP 1.1 keepalive (if needed)', type: any} + http-auto-gzip: {desc: ' automatically gzip content if uWSGI-Encoding header is + set to gzip, but content size (Content-Length/Transfer-Encoding) and Content-Encoding + are not specified', type: any} + http-raw-body: {desc: ' blindly send HTTP body to backends (required for WebSockets + and Icecast support in backends)', type: any} + http-websockets: {desc: ' automatically detect websockets connections and put the + session in raw mode', type: any} + http-chunked-input: {desc: ' automatically detect chunked input requests and put + the session in raw mode', type: any} + http-use-code-string: {desc: ' use code string as hostname->server mapper for the + http router', type: any} + http-use-socket: {desc: ' forward request to the specified uwsgi socket', type: any} + http-gracetime: {desc: ' retry connections to dead static nodes after the specified + amount of seconds', type: int} + http-quiet: {desc: ' do not report failed connections to instances', type: any} + http-cheap: {desc: ' run the http router in cheap mode', type: any} + http-stats: {desc: ' run the http router stats server', type: any} + http-stats-server: {desc: ' run the http router stats server', type: any} + http-ss: {desc: ' run the http router stats server', type: any} + http-harakiri: {desc: ' enable http router harakiri', type: int} + http-stud-prefix: {desc: ' expect a stud prefix (1byte family + 4/16 bytes address) + on connections from the specified address', type: any} + http-uid: {desc: ' drop http router privileges to the specified uid', type: any} + http-gid: {desc: ' drop http router privileges to the specified gid', type: any} + http-resubscribe: {desc: ' forward subscriptions to the specified subscription server', + type: any} + http-buffer-size: {desc: ' set internal buffer size (default: page size)', type: any} + http-server-name-as-http-host: {desc: ' force SERVER_NAME to HTTP_HOST', type: any} + http-headers-timeout: {desc: ' set internal http socket timeout for headers', type: int} + http-connect-timeout: {desc: ' set internal http socket timeout for backend connections', + type: int} + http-manage-source: {desc: ' manage the SOURCE HTTP method placing the session in + raw mode', type: any} + http-enable-proxy-protocol: {desc: ' manage PROXY protocol requests', type: any} + http-backend-http: {desc: ' use plain http protocol instead of uwsgi for backend + nodes', type: any} + http-manage-rtsp: {desc: ' manage RTSP sessions', type: any} + '0x1f': {desc: ' 0', type: any} + jvm-main-class: {desc: ' load the specified class and call its main() function', + type: any} + jvm-opt: {desc: ' add the specified jvm option', type: any} + jvm-class: {desc: ' load the specified class', type: any} + jvm-classpath: {desc: ' add the specified directory to the classpath', type: any} + jwsgi: {desc: ' load the specified JWSGI application (syntax class:method)', type: any} + ldap: {desc: ' load configuration from ldap server', type: any} + ldap-schema: {desc: ' dump uWSGI ldap schema', type: any} + ldap-schema-ldif: {desc: ' dump uWSGI ldap schema in ldif format', type: any} + log-zeromq: {desc: ' send logs to a zeromq server', type: any} + lua: {desc: ' load lua wsapi app', type: any} + lua-load: {desc: ' load a lua file', type: any} + lua-shell: {desc: ' run the lua interactive shell (debug.debug())', type: any} + luashell: {desc: ' run the lua interactive shell (debug.debug())', type: any} + lua-gc-freq: {desc: ' set the lua gc frequency (default: 0, runs after every request)', + type: int} + zeromq: {desc: ' create a mongrel2/zeromq pub/sub pair', type: any} + zmq: {desc: ' create a mongrel2/zeromq pub/sub pair', type: any} + zeromq-socket: {desc: ' create a mongrel2/zeromq pub/sub pair', type: any} + zmq-socket: {desc: ' create a mongrel2/zeromq pub/sub pair', type: any} + mongrel2: {desc: ' create a mongrel2/zeromq pub/sub pair', type: any} + mono-app: {desc: ' load a Mono asp.net app from the specified directory', type: any} + mono-gc-freq: {desc: ' run the Mono GC every requests (default: run after every + request)', type: any} + mono-key: {desc: ' select the ApplicationHost based on the specified CGI var', type: any} + mono-version: {desc: ' set the Mono jit version', type: any} + mono-config: {desc: ' set the Mono config file', type: any} + mono-assembly: {desc: ' load the specified main assembly (default: uwsgi.dll)', + type: any} + mono-exec: {desc: ' exec the specified assembly just before app loading', type: any} + mono-index: {desc: ' add an asp.net index file', type: any} + nagios: {desc: ' nagios check', type: any} + notfound-log: {desc: ' log requests to the notfound plugin', type: any} + pam: {desc: ' set the pam service name to use', type: any} + pam-user: {desc: ' set a fake user for pam', type: any} + php-ini: {desc: ' set php.ini path', type: any} + php-config: {desc: ' set php.ini path', type: any} + php-ini-append: {desc: ' set php.ini path (append mode)', type: any} + php-config-append: {desc: ' set php.ini path (append mode)', type: any} + php-set: {desc: ' set a php config directive', type: any} + php-index: {desc: ' list the php index files', type: any} + php-docroot: {desc: ' force php DOCUMENT_ROOT', type: any} + php-allowed-docroot: {desc: ' list the allowed document roots', type: any} + php-allowed-ext: {desc: ' list the allowed php file extensions', type: any} + php-allowed-script: {desc: ' list the allowed php scripts (require absolute path)', + type: any} + php-server-software: {desc: ' force php SERVER_SOFTWARE', type: any} + php-app: {desc: ' force the php file to run at each request', type: any} + php-app-qs: {desc: ' when in app mode force QUERY_STRING to the specified value + + REQUEST_URI', type: any} + php-fallback: {desc: ' run the specified php script when the request one does not + exist', type: any} + php-app-bypass: {desc: ' if the regexp matches the uri the --php-app is bypassed', + type: any} + php-var: {desc: ' add/overwrite a CGI variable at each request', type: any} + php-dump-config: {desc: ' dump php config (if modified via --php-set or append options)', + type: any} + php-exec-before: {desc: ' run specified php code before the requested script', type: any} + php-exec-begin: {desc: ' run specified php code before the requested script', type: any} + php-exec-after: {desc: ' run specified php code after the requested script', type: any} + php-exec-end: {desc: ' run specified php code after the requested script', type: any} + php-sapi-name: {desc: ' hack the sapi name (required for enabling zend opcode cache)', + type: any} + early-php: {desc: ' initialize an early perl interpreter shared by all loaders', + type: any} + early-php-sapi-name: {desc: ' hack the sapi name (required for enabling zend opcode + cache)', type: any} + ping: {desc: ' ping specified uwsgi host', type: any} + ping-timeout: {desc: ' set ping timeout', type: int} + psgi: {desc: ' load a psgi app', type: any} + psgi-enable-psgix-io: {desc: ' enable psgix.io support', type: any} + perl-no-die-catch: {desc: ' do not catch $SIG{__DIE__}', type: any} + perl-local-lib: {desc: ' set perl locallib path', type: any} + perl-version: {desc: ' print perl version', type: any} + perl-args: {desc: ' add items (space separated) to @ARGV', type: any} + perl-arg: {desc: ' add an item to @ARGV', type: any} + perl-exec: {desc: ' exec the specified perl file before fork()', type: any} + perl-exec-post-fork: {desc: ' exec the specified perl file after fork()', type: any} + perl-auto-reload: {desc: ' enable perl auto-reloader with the specified frequency', + type: int} + perl-auto-reload-ignore: {desc: ' ignore the specified files when auto-reload is + enabled', type: any} + plshell: {desc: ' run a perl interactive shell', type: any} + plshell-oneshot: {desc: ' run a perl interactive shell (one shot)', type: any} + perl-no-plack: {desc: ' force the use of do instead of Plack::Util::load_psgi', + type: any} + early-perl: {desc: ' initialize an early perl interpreter shared by all loaders', + type: any} + early-psgi: {desc: ' load a psgi app soon after uWSGI initialization', type: any} + early-perl-exec: {desc: ' load a perl script soon after uWSGI initialization', type: any} + pty-socket: {desc: ' bind the pty server on the specified address', type: any} + pty-log: {desc: ' send stdout/stderr to the log engine too', type: any} + pty-input: {desc: ' read from original stdin in addition to pty', type: any} + pty-connect: {desc: ' connect the current terminal to a pty server', type: any} + pty-uconnect: {desc: ' connect the current terminal to a pty server (using uwsgi + protocol)', type: any} + pty-no-isig: {desc: ' disable ISIG terminal attribute in client mode', type: any} + pty-exec: {desc: ' run the specified command soon after the pty thread is spawned', + type: any} + pypy-lib: {desc: ' set the path/name of the pypy library', type: any} + pypy-setup: {desc: ' set the path of the python setup script', type: any} + pypy-home: {desc: ' set the home of pypy library', type: any} + pypy-wsgi: {desc: ' load a WSGI module', type: any} + pypy-wsgi-file: {desc: ' load a WSGI/mod_wsgi file', type: any} + pypy-ini-paste: {desc: ' load a paste.deploy config file containing uwsgi section', + type: any} + pypy-paste: {desc: ' load a paste.deploy config file', type: any} + pypy-eval: {desc: ' evaluate pypy code before fork()', type: any} + pypy-eval-post-fork: {desc: ' evaluate pypy code soon after fork()', type: any} + pypy-exec: {desc: ' execute pypy code from file before fork()', type: any} + pypy-exec-post-fork: {desc: ' execute pypy code from file soon after fork()', type: any} + pypy-pp: {desc: ' add an item to the pythonpath', type: any} + pypy-python-path: {desc: ' add an item to the pythonpath', type: any} + pypy-pythonpath: {desc: ' add an item to the pythonpath', type: any} + wsgi-file: {desc: ' load .wsgi file', type: any} + file: {desc: ' load .wsgi file', type: any} + eval: {desc: ' eval python code', type: any} + module: {desc: ' load a WSGI module', type: any} + wsgi: {desc: ' load a WSGI module', type: any} + callable: {desc: ' set default WSGI callable name', type: any} + test: {desc: ' test a module import', type: any} + home: {desc: ' set PYTHONHOME/virtualenv', type: any} + virtualenv: {desc: ' set PYTHONHOME/virtualenv', type: any} + venv: {desc: ' set PYTHONHOME/virtualenv', type: any} + pyhome: {desc: ' set PYTHONHOME/virtualenv', type: any} + py-programname: {desc: ' set python program name', type: any} + py-program-name: {desc: ' set python program name', type: any} + pythonpath: {desc: ' add directory (or glob) to pythonpath', type: any} + python-path: {desc: ' add directory (or glob) to pythonpath', type: any} + pp: {desc: ' add directory (or glob) to pythonpath', type: any} + pymodule-alias: {desc: ' add a python alias module', type: any} + post-pymodule-alias: {desc: ' add a python module alias after uwsgi module initialization', + type: any} + import: {desc: ' import a python module', type: any} + pyimport: {desc: ' import a python module', type: any} + py-import: {desc: ' import a python module', type: any} + python-import: {desc: ' import a python module', type: any} + shared-import: {desc: ' import a python module in all of the processes', type: any} + shared-pyimport: {desc: ' import a python module in all of the processes', type: any} + shared-py-import: {desc: ' import a python module in all of the processes', type: any} + shared-python-import: {desc: ' import a python module in all of the processes', + type: any} + pyargv: {desc: ' manually set sys.argv', type: any} + optimize: {desc: ' set python optimization level', type: int} + pecan: {desc: ' load a pecan config file', type: any} + paste: {desc: ' load a paste.deploy config file', type: any} + paste-logger: {desc: ' enable paste fileConfig logger', type: any} + web3: {desc: ' load a web3 app', type: any} + pump: {desc: ' load a pump app', type: any} + wsgi-lite: {desc: ' load a wsgi-lite app', type: any} + ini-paste: {desc: ' load a paste.deploy config file containing uwsgi section', type: any} + ini-paste-logged: {desc: ' load a paste.deploy config file containing uwsgi section + (load loggers too)', type: any} + reload-os-env: {desc: ' force reload of os.environ at each request', type: any} + no-site: {desc: ' do not import site module', type: any} + pyshell: {desc: ' run an interactive python shell in the uWSGI environment', type: any} + pyshell-oneshot: {desc: ' run an interactive python shell in the uWSGI environment + (one-shot variant)', type: any} + python: {desc: ' run a python script in the uWSGI environment', type: any} + py: {desc: ' run a python script in the uWSGI environment', type: any} + pyrun: {desc: ' run a python script in the uWSGI environment', type: any} + py-tracebacker: {desc: ' enable the uWSGI python tracebacker', type: any} + py-auto-reload: {desc: ' monitor python modules mtime to trigger reload (use only + in development)', type: int} + py-autoreload: {desc: ' monitor python modules mtime to trigger reload (use only + in development)', type: int} + python-auto-reload: {desc: ' monitor python modules mtime to trigger reload (use + only in development)', type: int} + python-autoreload: {desc: ' monitor python modules mtime to trigger reload (use + only in development)', type: int} + py-auto-reload-ignore: {desc: ' ignore the specified module during auto-reload scan + (can be specified multiple times)', type: any} + wsgi-env-behaviour: {desc: ' set the strategy for allocating/deallocating the WSGI + env', type: any} + wsgi-env-behavior: {desc: ' set the strategy for allocating/deallocating the WSGI + env', type: any} + start_response-nodelay: {desc: ' send WSGI http headers as soon as possible (PEP + violation)', type: any} + wsgi-strict: {desc: ' try to be fully PEP compliant disabling optimizations', type: any} + wsgi-accept-buffer: {desc: ' accept CPython buffer-compliant objects as WSGI response + in addition to string/bytes', type: any} + wsgi-accept-buffers: {desc: ' accept CPython buffer-compliant objects as WSGI response + in addition to string/bytes', type: any} + python-version: {desc: ' report python version', type: any} + python-raw: {desc: ' load a python file for managing raw requests', type: any} + py-sharedarea: {desc: ' create a sharedarea from a python bytearray object of the + specified size', type: any} + py-call-osafterfork: {desc: ' enable child processes running cpython to trap OS + signals', type: any} + early-python: {desc: ' load the python VM as soon as possible (useful for the fork + server)', type: any} + early-pyimport: {desc: ' import a python module in the early phase', type: any} + early-python-import: {desc: ' import a python module in the early phase', type: any} + early-pythonpath: {desc: ' add directory (or glob) to pythonpath (immediate version)', + type: any} + early-python-path: {desc: ' add directory (or glob) to pythonpath (immediate version)', + type: any} + rails: {desc: ' load a rails <= 2.x app', type: any} + rack: {desc: ' load a rack app', type: any} + ruby-gc-freq: {desc: ' set ruby GC frequency', type: int} + rb-gc-freq: {desc: ' set ruby GC frequency', type: int} + rb-lib: {desc: ' add a directory to the ruby libdir search path', type: any} + ruby-lib: {desc: ' add a directory to the ruby libdir search path', type: any} + rb-require: {desc: ' import/require a ruby module/script', type: any} + ruby-require: {desc: ' import/require a ruby module/script', type: any} + rbrequire: {desc: ' import/require a ruby module/script', type: any} + rubyrequire: {desc: ' import/require a ruby module/script', type: any} + require: {desc: ' import/require a ruby module/script', type: any} + shared-rb-require: {desc: ' import/require a ruby module/script (shared)', type: any} + shared-ruby-require: {desc: ' import/require a ruby module/script (shared)', type: any} + shared-rbrequire: {desc: ' import/require a ruby module/script (shared)', type: any} + shared-rubyrequire: {desc: ' import/require a ruby module/script (shared)', type: any} + shared-require: {desc: ' import/require a ruby module/script (shared)', type: any} + gemset: {desc: ' load the specified gemset (rvm)', type: any} + rvm: {desc: ' load the specified gemset (rvm)', type: any} + rvm-path: {desc: ' search for rvm in the specified directory', type: any} + rbshell: {desc: ' run a ruby/irb shell', type: any} + rbshell-oneshot: {desc: ' set ruby/irb shell (one shot)', type: any} + rados-mount: {desc: ' virtual mount the specified rados volume in a uri', type: any} + rados-timeout: {desc: ' timeout for async operations', type: int} + rawrouter: {desc: ' run the rawrouter on the specified port', type: any} + rawrouter-processes: {desc: ' prefork the specified number of rawrouter processes', + type: int} + rawrouter-workers: {desc: ' prefork the specified number of rawrouter processes', + type: int} + rawrouter-zerg: {desc: ' attach the rawrouter to a zerg server', type: any} + rawrouter-use-cache: {desc: ' use uWSGI cache as hostname->server mapper for the + rawrouter', type: any} + rawrouter-use-pattern: {desc: ' use a pattern for rawrouter hostname->server mapping', + type: any} + rawrouter-use-base: {desc: ' use a base dir for rawrouter hostname->server mapping', + type: any} + rawrouter-fallback: {desc: ' fallback to the specified node in case of error', type: any} + rawrouter-use-code-string: {desc: ' use code string as hostname->server mapper for + the rawrouter', type: any} + rawrouter-use-socket: {desc: ' forward request to the specified uwsgi socket', type: any} + rawrouter-to: {desc: ' forward requests to the specified uwsgi server (you can specify + it multiple times for load balancing)', type: any} + rawrouter-gracetime: {desc: ' retry connections to dead static nodes after the specified + amount of seconds', type: int} + rawrouter-events: {desc: ' set the maximum number of concurrent events', type: int} + rawrouter-max-retries: {desc: ' set the maximum number of retries/fallbacks to other + nodes', type: int} + rawrouter-quiet: {desc: ' do not report failed connections to instances', type: any} + rawrouter-cheap: {desc: ' run the rawrouter in cheap mode', type: any} + rawrouter-subscription-server: {desc: ' run the rawrouter subscription server on + the spcified address', type: any} + rawrouter-subscription-slot: {desc: ' *** deprecated ***', type: any} + rawrouter-timeout: {desc: ' set rawrouter timeout', type: int} + rawrouter-stats: {desc: ' run the rawrouter stats server', type: any} + rawrouter-stats-server: {desc: ' run the rawrouter stats server', type: any} + rawrouter-ss: {desc: ' run the rawrouter stats server', type: any} + rawrouter-harakiri: {desc: ' enable rawrouter harakiri', type: int} + rawrouter-xclient: {desc: ' use the xclient protocol to pass the client address', + type: any} + rawrouter-buffer-size: {desc: ' set internal buffer size (default: page size)', + type: any} + rbthreads: {desc: ' enable ruby native threads', type: any} + rb-threads: {desc: ' enable ruby native threads', type: any} + rbthread: {desc: ' enable ruby native threads', type: any} + rb-thread: {desc: ' enable ruby native threads', type: any} + ring-load: {desc: ' load the specified clojure script', type: any} + clojure-load: {desc: ' load the specified clojure script', type: any} + ring-app: {desc: ' map the specified ring application (syntax namespace:function)', + type: any} + rrdtool: {desc: ' store rrd files in the specified directory', type: any} + rrdtool-freq: {desc: ' set collect frequency', type: int} + rrdtool-lib: {desc: ' set the name of rrd library (default: librrd.so)', type: any} + rsyslog-packet-size: {desc: ' set maximum packet size for syslog messages (default + 1024) WARNING! using packets > 1024 breaks RFC 3164 (#4.1)', type: int} + rsyslog-split-messages: {desc: ' split big messages into multiple chunks if they + are bigger than allowed packet size (default is false)', type: any} + sqlite3: {desc: ' load config from sqlite3 db', type: any} + sqlite: {desc: ' load config from sqlite3 db', type: any} + sslrouter: {desc: ' run the sslrouter on the specified port', type: any} + sslrouter2: {desc: ' run the sslrouter on the specified port (key-value based)', + type: any} + sslrouter-session-context: {desc: ' set the session id context to the specified + value', type: any} + sslrouter-processes: {desc: ' prefork the specified number of sslrouter processes', + type: int} + sslrouter-workers: {desc: ' prefork the specified number of sslrouter processes', + type: int} + sslrouter-zerg: {desc: ' attach the sslrouter to a zerg server', type: any} + sslrouter-use-cache: {desc: ' use uWSGI cache as hostname->server mapper for the + sslrouter', type: any} + sslrouter-use-pattern: {desc: ' use a pattern for sslrouter hostname->server mapping', + type: any} + sslrouter-use-base: {desc: ' use a base dir for sslrouter hostname->server mapping', + type: any} + sslrouter-fallback: {desc: ' fallback to the specified node in case of error', type: any} + sslrouter-use-code-string: {desc: ' use code string as hostname->server mapper for + the sslrouter', type: any} + sslrouter-use-socket: {desc: ' forward request to the specified uwsgi socket', type: any} + sslrouter-to: {desc: ' forward requests to the specified uwsgi server (you can specify + it multiple times for load balancing)', type: any} + sslrouter-gracetime: {desc: ' retry connections to dead static nodes after the specified + amount of seconds', type: int} + sslrouter-events: {desc: ' set the maximum number of concurrent events', type: int} + sslrouter-max-retries: {desc: ' set the maximum number of retries/fallbacks to other + nodes', type: int} + sslrouter-quiet: {desc: ' do not report failed connections to instances', type: any} + sslrouter-cheap: {desc: ' run the sslrouter in cheap mode', type: any} + sslrouter-subscription-server: {desc: ' run the sslrouter subscription server on + the spcified address', type: any} + sslrouter-timeout: {desc: ' set sslrouter timeout', type: int} + sslrouter-stats: {desc: ' run the sslrouter stats server', type: any} + sslrouter-stats-server: {desc: ' run the sslrouter stats server', type: any} + sslrouter-ss: {desc: ' run the sslrouter stats server', type: any} + sslrouter-harakiri: {desc: ' enable sslrouter harakiri', type: int} + sslrouter-sni: {desc: ' use SNI to route requests', type: any} + sslrouter-buffer-size: {desc: ' set internal buffer size (default: page size)', + type: any} + stackless: {desc: ' use stackless as suspend engine', type: any} + symcall: {desc: ' load the specified C symbol as the symcall request handler (supports + too)', type: any} + symcall-use-next: {desc: ' use RTLD_NEXT when searching for symbols', type: any} + symcall-register-rpc: {desc: ' load the specified C symbol as an RPC function (syntax: + name function)', type: any} + symcall-post-fork: {desc: ' call the specified C symbol after each fork()', type: any} + tornado: {desc: ' a shortcut enabling tornado loop engine with the specified number + of async cores and optimal parameters', type: any} + tuntap-router: {desc: ' run the tuntap router (syntax: [stats] + [gateway])', type: any} + tuntap-device: {desc: ' add a tuntap device to the instance (syntax: [ ])', + type: any} + tuntap-use-credentials: {desc: ' enable check of SCM_CREDENTIALS for tuntap client/server', + type: any} + tuntap-router-firewall-in: {desc: ' add a firewall rule to the tuntap router (syntax: + )', type: any} + tuntap-router-firewall-out: {desc: ' add a firewall rule to the tuntap router (syntax: + )', type: any} + tuntap-router-route: {desc: ' add a routing rule to the tuntap router (syntax: + )', type: any} + tuntap-router-stats: {desc: ' run the tuntap router stats server', type: any} + tuntap-device-rule: {desc: ' add a tuntap device rule (syntax: + [target])', type: any} + ugreen: {desc: ' enable ugreen coroutine subsystem', type: any} + ugreen-stacksize: {desc: ' set ugreen stack size in pages', type: int} + v8-load: {desc: ' load a javascript file', type: any} + v8-preemptive: {desc: ' put v8 in preemptive move (single isolate) with the specified + frequency', type: int} + v8-gc-freq: {desc: ' set the v8 garbage collection frequency', type: any} + v8-module-path: {desc: ' set the v8 modules search path', type: any} + v8-jsgi: {desc: ' load the specified JSGI 3.0 application', type: any} + webdav-mount: {desc: ' map a filesystem directory as a webdav store', type: any} + webdav-css: {desc: ' add a css url for automatic webdav directory listing', type: any} + webdav-javascript: {desc: ' add a javascript url for automatic webdav directory + listing', type: any} + webdav-js: {desc: ' add a javascript url for automatic webdav directory listing', + type: any} + webdav-class-directory: {desc: ' set the css directory class for automatic webdav + directory listing', type: any} + webdav-div: {desc: ' set the div id for automatic webdav directory listing', type: any} + webdav-lock-cache: {desc: ' set the cache to use for webdav locking', type: any} + webdav-principal-base: {desc: ' enable WebDAV Current Principal Extension using + the specified base', type: any} + webdav-add-option: {desc: ' add a WebDAV standard to the OPTIONS response', type: any} + webdav-add-prop: {desc: ' add a WebDAV property to all resources', type: any} + webdav-add-collection-prop: {desc: ' add a WebDAV property to all collections', + type: any} + webdav-add-object-prop: {desc: ' add a WebDAV property to all objects', type: any} + webdav-add-prop-href: {desc: ' add a WebDAV property to all resources (href value)', + type: any} + webdav-add-collection-prop-href: {desc: ' add a WebDAV property to all collections + (href value)', type: any} + webdav-add-object-prop-href: {desc: ' add a WebDAV property to all objects (href + value)', type: any} + webdav-add-prop-comp: {desc: ' add a WebDAV property to all resources (xml value)', + type: any} + webdav-add-collection-prop-comp: {desc: ' add a WebDAV property to all collections + (xml value)', type: any} + webdav-add-object-prop-comp: {desc: ' add a WebDAV property to all objects (xml + value)', type: any} + webdav-add-rtype-prop: {desc: ' add a WebDAV resourcetype property to all resources', + type: any} + webdav-add-rtype-collection-prop: {desc: ' add a WebDAV resourcetype property to + all collections', type: any} + webdav-add-rtype-object-prop: {desc: ' add a WebDAV resourcetype property to all + objects', type: any} + webdav-skip-prop: {desc: ' do not add the specified prop if available in resource + xattr', type: any} + xslt-docroot: {desc: ' add a document_root for xslt processing', type: any} + xslt-ext: {desc: ' search for xslt stylesheets with the specified extension', type: any} + xslt-var: {desc: ' get the xslt stylesheet path from the specified request var', + type: any} + xslt-stylesheet: {desc: ' if no xslt stylesheet file can be found, use the specified + one', type: any} + xslt-content-type: {desc: ' set the content-type for the xslt rsult (default: text/html)', + type: any} + zabbix-template: {desc: ' print (or store to a file) the zabbix template for the + current metrics setup', type: any} + zergpool: {desc: ' start a zergpool on specified address for specified address', + type: any} + zerg-pool: {desc: ' start a zergpool on specified address for specified address', + type: any} +type: map From 90e899d68fbf21effad1cf309efbd786c54be556 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Tue, 23 Aug 2016 14:52:40 -0400 Subject: [PATCH 06/15] Update tool shed to use newer configuration schema. - Implement kwalify schema to validate/define the schema. - Replace ini configuration with YAML (completely backward compatible). - Rebuild a sample configuration from the schema (config/tool_shed.yml.sample). --- config/tool_shed.ini.sample | 178 -------- config/tool_shed.yml.sample | 208 ++++++++++ lib/galaxy/webapps/tool_shed/buildapp.py | 5 +- .../webapps/tool_shed/config_schema.yml | 387 ++++++++++++++++++ lib/galaxy/webapps/tool_shed/uwsgi_schema.yml | 1 + run_tool_shed.sh | 4 +- 6 files changed, 602 insertions(+), 181 deletions(-) delete mode 100644 config/tool_shed.ini.sample create mode 100644 config/tool_shed.yml.sample create mode 100644 lib/galaxy/webapps/tool_shed/config_schema.yml create mode 120000 lib/galaxy/webapps/tool_shed/uwsgi_schema.yml diff --git a/config/tool_shed.ini.sample b/config/tool_shed.ini.sample deleted file mode 100644 index 7f377e268fe..00000000000 --- a/config/tool_shed.ini.sample +++ /dev/null @@ -1,178 +0,0 @@ -# ---- HTTP Server ---------------------------------------------------------- - -[server:main] - -use = egg:Paste#http -port = 9009 - -# The address on which to listen. By default, only listen to localhost -# (the Tool Shed will not be accessible over the network). -# Use '0.0.0.0' to listen on all available network interfaces. -#host = 0.0.0.0 -host = 127.0.0.1 - -use_threadpool = true -threadpool_workers = 10 -# Set the number of seconds a thread can work before you should kill it -# (assuming it will never finish) to 3 hours. -threadpool_kill_thread_limit = 10800 - -# ---- Galaxy Tool Shed ----------------------------------------------------- - -[app:main] - -# Specifies the factory for the universe WSGI application -paste.app_factory = galaxy.webapps.tool_shed.buildapp:app_factory - -# Verbosity of console log messages. Acceptable values can be found here: -# https://docs.python.org/2/library/logging.html#logging-levels -#log_level = DEBUG - -# By default, the Tool Shed uses a SQLite database at 'database/community.sqlite'. You -# may use a SQLAlchemy connection string to specify an external database -# instead. This string takes many options which are explained in detail in the -# config file documentation. -#database_connection = sqlite:///./database/community.sqlite?isolation_level=IMMEDIATE - -# Where the hgweb.config file is stored. -# The default is the Galaxy installation directory. -#hgweb_config_dir = None - -# Where tool shed repositories are stored. -#file_path = database/community_files - -# Temporary storage for additional datasets, -# this should be shared through the cluster -#new_file_path = database/tmp - -# File containing old-style genome builds -#builds_file_path = tool-data/shared/ucsc/builds.txt - -# Format string used when showing date and time information. -# The string may contain: -# - the directives used by Python time.strftime() function (see -# https://docs.python.org/2/library/time.html#time.strftime ), -# - $locale (complete format string for the server locale), -# - $iso8601 (complete format string as specified by ISO 8601 international -# standard). -#pretty_datetime_format = $locale (UTC) - -# -- Repository and Tool search -# Using the script located at scripts/build_ts_whoosh_index.py -# you can generate search index and allow full text API searching over -# the repositories and tools within the Tool Shed given that you specify -# the following two config options. -#toolshed_search_on = True -#whoosh_index_dir = database/toolshed_whoosh_indexes - -# The following boosts are used to customize this instance's TS search. -# The higher the boost, the more importance the scoring algorithm gives to the -# given field. - -# For searching repositories at /api/repositories: -#repo_name_boost = 0.9 -#repo_description_boost = 0.6 -#repo_long_description_boost = 0.5 -#repo_homepage_url_boost = 0.3 -#repo_remote_repository_url_boost = 0.2 -#repo_owner_username_boost = 0.3 - -# For searching tools at /api/tools -#tool_name_boost = 1.2 -#tool_description_boost = 0.6 -#tool_help_boost = 0.4 -#tool_repo_owner_username = 0.3 - -# -- Analytics - -# You can enter tracking code here to track visitor's behavior -# through your Google Analytics account. Example: UA-XXXXXXXX-Y -#ga_code = None - -# -- Users and Security - -# The Tool Shed encodes various internal values when these values will be output in -# some format (for example, in a URL or cookie). You should set a key to be -# used by the algorithm that encodes and decodes these values. It can be any -# string. If left unchanged, anyone could construct a cookie that would grant -# them access to others' sessions. -# One simple way to generate a value for this is with the shell command: -# python -c 'import time; print time.time()' | md5sum | cut -f 1 -d ' ' -#id_secret = changethisinproductiontoo - -# User authentication can be delegated to an upstream proxy server (usually -# Apache). The upstream proxy should set a REMOTE_USER header in the request. -# Enabling remote user disables regular logins. For more information, see: -# https://wiki.galaxyproject.org/Admin/Config/ApacheProxy -#use_remote_user = False - -# If use_remote_user is enabled, anyone who can log in to the Galaxy host may -# impersonate any other user by simply sending the appropriate header. Thus a -# secret shared between the upstream proxy server, and Galaxy is required. -# If anyone other than the Galaxy user is using the server, then apache/nginx -# should pass a value in the header 'GX_SECRET' that is identical the one below -#remote_user_secret = changethisinproductiontoo - -# Configuration for debugging middleware -#debug = False - -# Check for WSGI compliance. -#use_lint = False - -# NEVER enable this on a public site (even test or QA) -#use_interactive = 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 users, groups, roles, -# libraries, and more. -#admin_users = None - -# Force everyone to log in (disable anonymous access) -#require_login = False - -# For use by email messages sent from the tool shed -#smtp_server = smtp.your_tool_shed_server -#email_from = your_tool_shed_email@server - -# If your SMTP server requires a username and password, you can provide them -# here (password in cleartext here, but if your server supports STARTTLS it -# will be sent over the network encrypted). -#smtp_username = None -#smtp_password = None - -# If your SMTP server requires SSL from the beginning of the connection -#smtp_ssl = False - -# The URL linked by the "Support" link in the "Help" menu. -#support_url = https://wiki.galaxyproject.org/Support - -# Address to join mailing list -#mailing_join_addr = galaxy-announce-join@bx.psu.edu - -# Write thread status periodically to 'heartbeat.log' (careful, uses 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 - -# Show a message box under the masthead. -#message_box_visible = False -#message_box_content = None -#message_box_class = info - -# Serving static files (needed if running standalone) -#static_enabled = True -#static_cache_time = 360 -#static_dir = static/ -#static_images_dir = static/images -#static_favicon_dir = static/favicon.ico -#static_scripts_dir = static/scripts/ -#static_style_dir = static/style/blue - -# Sentry (getsentry.com) DSN for catching bugs. -#sentry_dsn = None diff --git a/config/tool_shed.yml.sample b/config/tool_shed.yml.sample new file mode 100644 index 00000000000..3a9d6a46eec --- /dev/null +++ b/config/tool_shed.yml.sample @@ -0,0 +1,208 @@ +uwsgi: + + # The address and port on which to listen. By default, only listen to + # localhost (tool_shed will not be accessible over the network). Use + # '0.0.0.0' to listen on all available network interfaces. + http: 127.0.0.1:9009 + + threads: 8 + + http-raw-body: True + + offload-threads: 8 + + module: galaxy.webapps.tool_shed.buildapp:uwsgi_app() + +tool_shed: + + # Verbosity of console log messages. Acceptable values can be found + # here: https://docs.python.org/2/library/logging.html#logging-levels + #log_level: DEBUG + + # By default, the Tool Shed uses a SQLite database at + # 'database/community.sqlite'. You may use a SQLAlchemy connection + # string to specify an external database instead. This string takes + # many options which are explained in detail in the config file + # documentation. + #database_connection: sqlite:///./database/community.sqlite?isolation_level=IMMEDIATE + + # Where the hgweb.config file is stored. The default is the Galaxy + # installation directory. + #hgweb_config_dir: None + + # Where tool shed repositories are stored. + #file_path: database/community_files + + # Temporary storage for additional datasets, this should be shared + # through the cluster + #new_file_path: database/tmp + + # File containing old-style genome builds + #builds_file_path: tool-data/shared/ucsc/builds.txt + + # Format string used when showing date and time information. The + # string may contain: - the directives used by Python time.strftime() + # function (see + # https://docs.python.org/2/library/time.html#time.strftime ), - + # $locale (complete format string for the server locale), - $iso8601 + # (complete format string as specified by ISO 8601 international + # standard). + #pretty_datetime_format: $locale (UTC) + + # -- Repository and Tool search Using the script located at + # scripts/build_ts_whoosh_index.py you can generate search index and + # allow full text API searching over the repositories and tools within + # the Tool Shed given that you specify the following two config + # options. + #toolshed_search_on: True + + # -- Repository and Tool search Using the script located at + # scripts/build_ts_whoosh_index.py you can generate search index and + # allow full text API searching over the repositories and tools within + # the Tool Shed given that you specify the following two config + # options. + #whoosh_index_dir: database/toolshed_whoosh_indexes + + # For searching repositories at /api/repositories: + #repo_name_boost: 0.9 + + # For searching repositories at /api/repositories: + #repo_description_boost: 0.6 + + # For searching repositories at /api/repositories: + #repo_long_description_boost: 0.5 + + # For searching repositories at /api/repositories: + #repo_homepage_url_boost: 0.3 + + # For searching repositories at /api/repositories: + #repo_remote_repository_url_boost: 0.2 + + # For searching repositories at /api/repositories: + #repo_owner_username_boost: 0.3 + + # For searching tools at /api/tools + #tool_name_boost: 1.2 + + # For searching tools at /api/tools + #tool_description_boost: 0.6 + + # For searching tools at /api/tools + #tool_help_boost: 0.4 + + # For searching tools at /api/tools + #tool_repo_owner_username: 0.3 + + # You can enter tracking code here to track visitor's behavior through + # your Google Analytics account. Example: UA-XXXXXXXX-Y + #ga_code: None + + # The Tool Shed encodes various internal values when these values will + # be output in some format (for example, in a URL or cookie). You + # should set a key to be used by the algorithm that encodes and + # decodes these values. It can be any string. If left unchanged, + # anyone could construct a cookie that would grant them access to + # others' sessions. One simple way to generate a value for this is + # with the shell command: python -c 'import time; print time.time()' + # | md5sum | cut -f 1 -d ' ' + #id_secret: changethisinproductiontoo + + # User authentication can be delegated to an upstream proxy server + # (usually Apache). The upstream proxy should set a REMOTE_USER + # header in the request. Enabling remote user disables regular logins. + # For more information, see: + # https://wiki.galaxyproject.org/Admin/Config/ApacheProxy + #use_remote_user: False + + # If use_remote_user is enabled, anyone who can log in to the Galaxy + # host may impersonate any other user by simply sending the + # appropriate header. Thus a secret shared between the upstream proxy + # server, and Galaxy is required. If anyone other than the Galaxy user + # is using the server, then apache/nginx should pass a value in the + # header 'GX_SECRET' that is identical the one below + #remote_user_secret: changethisinproductiontoo + + # Configuration for debugging middleware + #debug: False + + # Check for WSGI compliance. + #use_lint: False + + # NEVER enable this on a public site (even test or QA) + #use_interactive: 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 + # users, groups, roles, libraries, and more. + #admin_users: None + + # Force everyone to log in (disable anonymous access) + #require_login: False + + # For use by email messages sent from the tool shed + #smtp_server: smtp.your_tool_shed_server + + # For use by email messages sent from the tool shed + #email_from: your_tool_shed_email@server + + # If your SMTP server requires a username and password, you can + # provide them here (password in cleartext here, but if your server + # supports STARTTLS it will be sent over the network encrypted). + #smtp_username: None + + # If your SMTP server requires a username and password, you can + # provide them here (password in cleartext here, but if your server + # supports STARTTLS it will be sent over the network encrypted). + #smtp_password: None + + # If your SMTP server requires SSL from the beginning of the + # connection + #smtp_ssl: False + + # The URL linked by the "Support" link in the "Help" menu. + #support_url: https://wiki.galaxyproject.org/Support + + # Address to join mailing list + #mailing_join_addr: galaxy-announce-join@bx.psu.edu + + # Write thread status periodically to 'heartbeat.log' (careful, uses + # 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 + + # Show a message box under the masthead. + #message_box_visible: False + + # Show a message box under the masthead. + #message_box_content: None + + # Show a message box under the masthead. + #message_box_class: info + + # Serving static files (needed if running standalone) + #static_enabled: True + + # Serving static files (needed if running standalone) + #static_cache_time: 360 + + # Serving static files (needed if running standalone) + #static_dir: static/ + + # Serving static files (needed if running standalone) + #static_images_dir: static/images + + # Serving static files (needed if running standalone) + #static_favicon_dir: static/favicon.ico + + # Serving static files (needed if running standalone) + #static_scripts_dir: static/scripts/ + + # Serving static files (needed if running standalone) + #static_style_dir: static/style/blue + diff --git a/lib/galaxy/webapps/tool_shed/buildapp.py b/lib/galaxy/webapps/tool_shed/buildapp.py index 03e71335ad5..b1904dc9fa5 100644 --- a/lib/galaxy/webapps/tool_shed/buildapp.py +++ b/lib/galaxy/webapps/tool_shed/buildapp.py @@ -53,12 +53,13 @@ def add_ui_controllers( webapp, app ): webapp.add_ui_controller( name, T( app ) ) -def app_factory( global_conf, **kwargs ): +def app_factory( global_conf, load_app_kwds={}, **kwargs ): """Return a wsgi application serving the root object""" # Create the Galaxy tool shed application unless passed in kwargs = load_app_properties( kwds=kwargs, - config_prefix='TOOL_SHED_CONFIG_' + config_prefix='TOOL_SHED_CONFIG_', + **load_app_kwds ) if 'app' in kwargs: app = kwargs.pop( 'app' ) diff --git a/lib/galaxy/webapps/tool_shed/config_schema.yml b/lib/galaxy/webapps/tool_shed/config_schema.yml new file mode 100644 index 00000000000..0aa906c329f --- /dev/null +++ b/lib/galaxy/webapps/tool_shed/config_schema.yml @@ -0,0 +1,387 @@ +type: map +mapping: + uwsgi: !include uwsgi_schema.yml + tool_shed: + type: map + required: true + desc: | + Tool Shed configuration options. + mapping: + log_level: + type: str + default: DEBUG + required: false + desc: | + Verbosity of console log messages. Acceptable values can be found here: + https://docs.python.org/2/library/logging.html#logging-levels + + database_connection: + type: str + default: sqlite:///./database/community.sqlite?isolation_level=IMMEDIATE + required: false + desc: | + By default, the Tool Shed uses a SQLite database at 'database/community.sqlite'. You + may use a SQLAlchemy connection string to specify an external database + instead. This string takes many options which are explained in detail in the + config file documentation. + + hgweb_config_dir: + type: str + required: false + desc: | + Where the hgweb.config file is stored. + The default is the Galaxy installation directory. + + file_path: + type: str + default: database/community_files + required: false + desc: | + Where tool shed repositories are stored. + + new_file_path: + type: str + default: database/tmp + required: false + desc: | + Temporary storage for additional datasets, + this should be shared through the cluster + + builds_file_path: + type: str + default: tool-data/shared/ucsc/builds.txt + required: false + desc: | + File containing old-style genome builds + + pretty_datetime_format: + type: str + default: $locale (UTC) + required: false + desc: | + Format string used when showing date and time information. + The string may contain: + - the directives used by Python time.strftime() function (see + https://docs.python.org/2/library/time.html#time.strftime ), + - $locale (complete format string for the server locale), + - $iso8601 (complete format string as specified by ISO 8601 international + standard). + + toolshed_search_on: + type: bool + default: true + required: false + desc: | + -- Repository and Tool search + Using the script located at scripts/build_ts_whoosh_index.py + you can generate search index and allow full text API searching over + the repositories and tools within the Tool Shed given that you specify + the following two config options. + + whoosh_index_dir: + type: str + default: database/toolshed_whoosh_indexes + required: false + desc: | + -- Repository and Tool search + Using the script located at scripts/build_ts_whoosh_index.py + you can generate search index and allow full text API searching over + the repositories and tools within the Tool Shed given that you specify + the following two config options. + + repo_name_boost: + type: float + default: 0.9 + required: false + desc: | + For searching repositories at /api/repositories: + + repo_description_boost: + type: float + default: 0.6 + required: false + desc: | + For searching repositories at /api/repositories: + + repo_long_description_boost: + type: float + default: 0.5 + required: false + desc: | + For searching repositories at /api/repositories: + + repo_homepage_url_boost: + type: float + default: 0.3 + required: false + desc: | + For searching repositories at /api/repositories: + + repo_remote_repository_url_boost: + type: float + default: 0.2 + required: false + desc: | + For searching repositories at /api/repositories: + + repo_owner_username_boost: + type: float + default: 0.3 + required: false + desc: | + For searching repositories at /api/repositories: + + tool_name_boost: + type: float + default: 1.2 + required: false + desc: | + For searching tools at /api/tools + + tool_description_boost: + type: float + default: 0.6 + required: false + desc: | + For searching tools at /api/tools + + tool_help_boost: + type: float + default: 0.4 + required: false + desc: | + For searching tools at /api/tools + + tool_repo_owner_username: + type: float + default: 0.3 + required: false + desc: | + For searching tools at /api/tools + + ga_code: + type: str + required: false + desc: | + You can enter tracking code here to track visitor's behavior + through your Google Analytics account. Example: UA-XXXXXXXX-Y + + id_secret: + type: str + default: changethisinproductiontoo + required: false + desc: | + The Tool Shed encodes various internal values when these values will be output in + some format (for example, in a URL or cookie). You should set a key to be + used by the algorithm that encodes and decodes these values. It can be any + string. If left unchanged, anyone could construct a cookie that would grant + them access to others' sessions. + One simple way to generate a value for this is with the shell command: + python -c 'import time; print time.time()' | md5sum | cut -f 1 -d ' ' + + use_remote_user: + type: bool + default: false + required: false + desc: | + User authentication can be delegated to an upstream proxy server (usually + Apache). The upstream proxy should set a REMOTE_USER header in the request. + Enabling remote user disables regular logins. For more information, see: + https://wiki.galaxyproject.org/Admin/Config/ApacheProxy + + remote_user_secret: + type: str + default: changethisinproductiontoo + required: false + desc: | + If use_remote_user is enabled, anyone who can log in to the Galaxy host may + impersonate any other user by simply sending the appropriate header. Thus a + secret shared between the upstream proxy server, and Galaxy is required. + If anyone other than the Galaxy user is using the server, then apache/nginx + should pass a value in the header 'GX_SECRET' that is identical the one below + + 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. + + use_interactive: + type: bool + default: true + required: false + desc: | + NEVER enable this on a public site (even test or QA) + + admin_users: + type: str + required: false + desc: | + 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 users, groups, roles, + libraries, and more. + + require_login: + type: bool + default: false + required: false + desc: | + Force everyone to log in (disable anonymous access) + + smtp_server: + type: str + default: smtp.your_tool_shed_server + required: false + desc: | + For use by email messages sent from the tool shed + + email_from: + type: str + default: your_tool_shed_email@server + required: false + desc: | + For use by email messages sent from the tool shed + + smtp_username: + type: str + required: false + desc: | + If your SMTP server requires a username and password, you can provide them + here (password in cleartext here, but if your server supports STARTTLS it + will be sent over the network encrypted). + + smtp_password: + type: str + required: false + desc: | + If your SMTP server requires a username and password, you can provide them + here (password in cleartext here, but if your server supports STARTTLS it + will be sent over the network encrypted). + + smtp_ssl: + type: bool + default: false + required: false + desc: | + If your SMTP server requires SSL from the beginning of the connection + + support_url: + type: str + default: https://wiki.galaxyproject.org/Support + required: false + desc: | + The URL linked by the "Support" link in the "Help" menu. + + mailing_join_addr: + type: str + default: galaxy-announce-join@bx.psu.edu + required: false + desc: | + Address to join mailing list + + use_heartbeat: + type: bool + default: true + required: false + desc: | + 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 + required: false + desc: | + Enable creation of Galaxy flavor Docker Image + + message_box_visible: + type: bool + default: false + required: false + desc: | + Show a message box under the masthead. + + message_box_content: + type: str + required: false + desc: | + Show a message box under the masthead. + + message_box_class: + type: str + default: info + required: false + desc: | + Show a message box under the masthead. + + static_enabled: + type: bool + default: true + required: false + desc: | + Serving static files (needed if running standalone) + + static_cache_time: + type: int + default: 360 + required: false + desc: | + Serving static files (needed if running standalone) + + static_dir: + type: str + default: static/ + required: false + desc: | + Serving static files (needed if running standalone) + + static_images_dir: + type: str + default: static/images + required: false + desc: | + Serving static files (needed if running standalone) + + static_favicon_dir: + type: str + default: static/favicon.ico + required: false + desc: | + Serving static files (needed if running standalone) + + static_scripts_dir: + type: str + default: static/scripts/ + required: false + desc: | + Serving static files (needed if running standalone) + + static_style_dir: + type: str + default: static/style/blue + required: false + desc: | + Serving static files (needed if running standalone) diff --git a/lib/galaxy/webapps/tool_shed/uwsgi_schema.yml b/lib/galaxy/webapps/tool_shed/uwsgi_schema.yml new file mode 120000 index 00000000000..7d0729284c9 --- /dev/null +++ b/lib/galaxy/webapps/tool_shed/uwsgi_schema.yml @@ -0,0 +1 @@ +../uwsgi_schema.yml \ No newline at end of file diff --git a/run_tool_shed.sh b/run_tool_shed.sh index 992e2b90e85..a05226f173a 100755 --- a/run_tool_shed.sh +++ b/run_tool_shed.sh @@ -30,8 +30,10 @@ if [ -z "$TOOL_SHED_CONFIG_FILE" ]; then TOOL_SHED_CONFIG_FILE=tool_shed_wsgi.ini elif [ -f config/tool_shed.ini ]; then TOOL_SHED_CONFIG_FILE=config/tool_shed.ini + elif [ -f config/tool_shed.yml ]; then + TOOL_SHED_CONFIG_FILE=config/tool_shed.yml else - TOOL_SHED_CONFIG_FILE=config/tool_shed.ini.sample + TOOL_SHED_CONFIG_FILE=config/tool_shed.yml.sample fi export TOOL_SHED_CONFIG_FILE fi From 102566dd5e1c5903726057f1077a1d7fc614b815 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Fri, 26 Aug 2016 13:25:02 -0400 Subject: [PATCH 07/15] Update Galaxy Reports to use newer configuration schema. - Implement kwalify schema to validate/define the schema. - Replace ini configuration with YAML (completely backward compatible). - Rebuild a sample configuration from the schema (config/reports.yml.sample). --- config/reports.ini.sample | 91 ---------------- config/reports.yml.sample | 73 +++++++++++++ lib/galaxy/webapps/reports/buildapp.py | 9 +- lib/galaxy/webapps/reports/config_schema.yml | 103 +++++++++++++++++++ lib/galaxy/webapps/reports/uwsgi_schema.yml | 1 + run_reports.sh | 4 +- 6 files changed, 187 insertions(+), 94 deletions(-) delete mode 100644 config/reports.ini.sample create mode 100644 config/reports.yml.sample create mode 100644 lib/galaxy/webapps/reports/config_schema.yml create mode 120000 lib/galaxy/webapps/reports/uwsgi_schema.yml diff --git a/config/reports.ini.sample b/config/reports.ini.sample deleted file mode 100644 index d9227d0366a..00000000000 --- a/config/reports.ini.sample +++ /dev/null @@ -1,91 +0,0 @@ -# ---- HTTP Server ---------------------------------------------------------- - -[server:main] - -use = egg:Paste#http -port = 9001 -host = 127.0.0.1 -use_threadpool = true -threadpool_workers = 10 - -# ---- Filters -------------------------------------------------------------- - -# Filters sit between Galaxy and the HTTP server. - -# These filters are disabled by default. They can be enabled with -# 'filter-with' in the [app:main] section below. - -# Define the proxy-prefix filter. -[filter:proxy-prefix] -use = egg:PasteDeploy#prefix -prefix = /reports - -# ---- Galaxy Reports ------------------------------------------------------ - -[app:main] - -# -- Application and filtering - -# If running behind a proxy server and Galaxy is served from a subdirectory, -# enable the proxy-prefix filter and set the prefix in the -# [filter:proxy-prefix] section above. -#filter-with = proxy-prefix - -# If proxy-prefix is enabled and you're running more than one Galaxy instance -# behind one hostname, you will want to set this to the same path as the prefix -# in the filter above. This value becomes the "path" attribute set in the -# cookie so the cookies from each instance will not clobber each other. -#cookie_path = None - -# Specifies the factory for the universe WSGI application -paste.app_factory = galaxy.webapps.reports.buildapp:app_factory - -# Verbosity of console log messages. Acceptable values can be found here: -# https://docs.python.org/2/library/logging.html#logging-levels -#log_level = DEBUG - -# Database connection -# Galaxy reports are intended for production Galaxy instances, so sqlite (and the default value -# below) is not supported. An SQLAlchemy connection string should be used specify an external -# database. -#database_connection = sqlite:///./database/universe.sqlite?isolation_level=IMMEDIATE - -# Where dataset files are saved -#file_path = database/files -# Temporary storage for additional datasets, this should be shared through the cluster -#new_file_path = database/tmp - -# Mako templates are compiled as needed and cached for reuse, this 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 - -# NEVER enable this on a public site (even test or QA) -#use_interactive = true - -# 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 -#error_email_to = your_bugs@bx.psu.edu - -# Serving static files (needed if running standalone) -# static_enabled = True -# static_cache_time = 360 -# static_dir = %(here)s/static/ -# static_images_dir = %(here)s/static/images -# static_favicon_dir = %(here)s/static/favicon.ico -# static_scripts_dir = %(here)s/static/scripts/ -# static_style_dir = %(here)s/static/june_2007_style/blue - -# Sentry (getsentry.com) DSN for catching bugs. -#sentry_dsn = None diff --git a/config/reports.yml.sample b/config/reports.yml.sample new file mode 100644 index 00000000000..eb56f778143 --- /dev/null +++ b/config/reports.yml.sample @@ -0,0 +1,73 @@ +uwsgi: + + # The address and port on which to listen. By default, only listen to + # localhost (reports will not be accessible over the network). Use + # '0.0.0.0' to listen on all available network interfaces. + http: 127.0.0.1:9001 + + threads: 8 + + http-raw-body: True + + offload-threads: 8 + + module: galaxy.webapps.reports.buildapp:uwsgi_app() + +reports: + + # If running behind a proxy server and Galaxy is served from a + # subdirectory, enable the proxy-prefix filter and set the prefix in + # the [filter:proxy-prefix] section above. + #filter-with: proxy-prefix + + # If proxy-prefix is enabled and you're running more than one Galaxy + # instance behind one hostname, you will want to set this to the same + # path as the prefix in the filter above. This value becomes the + # "path" attribute set in the cookie so the cookies from each instance + # will not clobber each other. + #cookie_path: None + + # Verbosity of console log messages. Acceptable values can be found + # here: https://docs.python.org/2/library/logging.html#logging-levels + #log_level: DEBUG + + # Database connection Galaxy reports are intended for production + # Galaxy instances, so sqlite (and the default value below) is not + # supported. An SQLAlchemy connection string should be used specify an + # external database. + #database_connection: sqlite:///./database/universe.sqlite?isolation_level=IMMEDIATE + + # Where dataset files are saved Temporary storage for additional + # datasets, this should be shared through the cluster + #file_path: database/files + + # Where dataset files are saved Temporary storage for additional + # datasets, this should be shared through the cluster + #new_file_path: database/tmp + + # Mako templates are compiled as needed and cached for reuse, this + # 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 + + # NEVER enable this on a public site (even test or QA) + #use_interactive: True + + # 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 + + # Mail + #error_email_to: your_bugs@bx.psu.edu + diff --git a/lib/galaxy/webapps/reports/buildapp.py b/lib/galaxy/webapps/reports/buildapp.py index e2e6317b742..ea32356da71 100644 --- a/lib/galaxy/webapps/reports/buildapp.py +++ b/lib/galaxy/webapps/reports/buildapp.py @@ -51,11 +51,12 @@ def add_ui_controllers( webapp, app ): webapp.add_ui_controller( name, T( app ) ) -def app_factory( global_conf, **kwargs ): +def app_factory( global_conf, load_app_kwds={}, **kwargs ): """Return a wsgi application serving the root object""" # Create the Galaxy application unless passed in kwargs = load_app_properties( - kwds=kwargs + kwds=kwargs, + **load_app_kwds ) if 'app' in kwargs: app = kwargs.pop( 'app' ) @@ -149,3 +150,7 @@ def wrap_in_middleware( app, global_conf, application_stack, **local_conf ): def wrap_in_static( app, global_conf, **local_conf ): urlmap, _ = galaxy.web.framework.webapp.build_url_map( app, global_conf, local_conf ) return urlmap + + +def uwsgi_app(): + return galaxy.web.framework.webapp.build_native_uwsgi_app( app_factory, "reports" ) diff --git a/lib/galaxy/webapps/reports/config_schema.yml b/lib/galaxy/webapps/reports/config_schema.yml new file mode 100644 index 00000000000..a8a582825a6 --- /dev/null +++ b/lib/galaxy/webapps/reports/config_schema.yml @@ -0,0 +1,103 @@ +type: map +mapping: + uwsgi: !include uwsgi_schema.yml + reports: + type: map + required: true + desc: | + Galaxy Reports configuration options. + mapping: + filter-with: + type: str + default: proxy-prefix + desc: | + If running behind a proxy server and Galaxy is served from a subdirectory, + enable the proxy-prefix filter and set the prefix in the + [filter:proxy-prefix] section above. + + cookie_path: + type: str + desc: | + If proxy-prefix is enabled and you're running more than one Galaxy instance + behind one hostname, you will want to set this to the same path as the prefix + in the filter above. This value becomes the "path" attribute set in the + cookie so the cookies from each instance will not clobber each other. + + log_level: + type: str + default: DEBUG + desc: | + Verbosity of console log messages. Acceptable values can be found here: + https://docs.python.org/2/library/logging.html#logging-levels + + database_connection: + type: str + default: sqlite:///./database/universe.sqlite?isolation_level=IMMEDIATE + desc: | + Database connection + Galaxy reports are intended for production Galaxy instances, so sqlite (and the default value + below) is not supported. An SQLAlchemy connection string should be used specify an external + database. + + file_path: + type: str + default: database/files + desc: | + Where dataset files are saved + Temporary storage for additional datasets, this should be shared through the cluster + + new_file_path: + type: str + default: database/tmp + desc: | + Where dataset files are saved + Temporary storage for additional datasets, this should be shared through the cluster + + template_cache_path: + type: str + default: database/compiled_templates/reports + desc: | + 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_interactive: + type: bool + default: true + desc: | + NEVER enable this on a public site (even test or QA) + + 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 + desc: | + Mail + + error_email_to: + type: str + default: your_bugs@bx.psu.edu + desc: | + Mail diff --git a/lib/galaxy/webapps/reports/uwsgi_schema.yml b/lib/galaxy/webapps/reports/uwsgi_schema.yml new file mode 120000 index 00000000000..7d0729284c9 --- /dev/null +++ b/lib/galaxy/webapps/reports/uwsgi_schema.yml @@ -0,0 +1 @@ +../uwsgi_schema.yml \ No newline at end of file diff --git a/run_reports.sh b/run_reports.sh index 6845d6add8c..93da90847c8 100755 --- a/run_reports.sh +++ b/run_reports.sh @@ -37,8 +37,10 @@ if [ -z "$GALAXY_REPORTS_CONFIG" ]; then GALAXY_REPORTS_CONFIG=config/reports_wsgi.ini elif [ -f config/reports.ini ]; then GALAXY_REPORTS_CONFIG=config/reports.ini + elif [ -f config/reports.yml ]; then + GALAXY_REPORTS_CONFIG=config/reports.yml else - GALAXY_REPORTS_CONFIG=config/reports.ini.sample + GALAXY_REPORTS_CONFIG=config/reports.yml.sample fi export GALAXY_REPORTS_CONFIG fi From 50d426ed2b9ae2aff8b243143478ce84c7731816 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Fri, 26 Aug 2016 15:03:11 -0400 Subject: [PATCH 08/15] Add reports documentation to ``doc/``. - Automatically generate RST docs from config schema. - Describe older functionality as well as new YAML-based configuration. - Replace https://wiki.galaxyproject.org/Admin/UsageReports. --- doc/source/admin/reports.rst | 57 ++++++++++ doc/source/admin/reports_options.rst | 156 +++++++++++++++++++++++++++ 2 files changed, 213 insertions(+) create mode 100644 doc/source/admin/reports.rst create mode 100644 doc/source/admin/reports_options.rst diff --git a/doc/source/admin/reports.rst b/doc/source/admin/reports.rst new file mode 100644 index 00000000000..bac451a7a4a --- /dev/null +++ b/doc/source/admin/reports.rst @@ -0,0 +1,57 @@ +Galaxy Reports +======================================== + +Overview +---------------------------- + +For admins wishing to have more information on the usage of a Galaxy instance, +one can configure and use the Galaxy Reports application. This is a separate +application that can run beside Galaxy and must target the same database. + +The Galaxy Reports application's easy to use web interface will give you information on the +following (and more): + +- Jobs + + - Today's jobs + - Jobs per day this month + - Jobs in error per day this month + - All unfinished jobs + - Jobs per month + - Jobs in error per month + - Jobs per user + - Jobs per tool + +- Workflows + + - Workflows per month + - Workflows per user + +- Users + + - Registered users + - Date of last login + - User disk usage + +- System + + - Disk space maintenance + + +Configuration +---------------------------- + +- Configure ``config/reports.yml`` in the same manner as your main galaxy instance (i.e., same database connection, but different port). This is a uwsgi YAML configuration file and should contain a reports section with app-specific configuration (options described below). + + - The default port for the reports application is ``9001``, and like Galaxy it only binds to localhost by default. + - ``database_connection`` should match the value used in your Galaxy configuration + - ``database_connection`` should point at a Postgres database, experimental support for MySQL is available but sqlite is not supported at all. + +- Run reports in a uWSGI server with ``sh run_reports.sh`` +- Use a web browser and go to the address you configured in ``reports.yml`` (defaults to http://localhost:9001/) + +---------------------------- +Configuration Options +---------------------------- + +.. include:: reports_options.rst diff --git a/doc/source/admin/reports_options.rst b/doc/source/admin/reports_options.rst new file mode 100644 index 00000000000..90557f7c844 --- /dev/null +++ b/doc/source/admin/reports_options.rst @@ -0,0 +1,156 @@ +~~~~~~~~~~~~~~~ +``filter-with`` +~~~~~~~~~~~~~~~ + +:Description: + If running behind a proxy server and Galaxy is served from a + subdirectory, enable the proxy-prefix filter and set the prefix in + the [filter:proxy-prefix] section above. +:Default: proxy-prefix +:Type: str + + +~~~~~~~~~~~~~~~ +``cookie_path`` +~~~~~~~~~~~~~~~ + +:Description: + If proxy-prefix is enabled and you're running more than one Galaxy + instance behind one hostname, you will want to set this to the + same path as the prefix in the filter above. This value becomes + the "path" attribute set in the cookie so the cookies from each + instance will not clobber each other. +:Default: None +:Type: str + + +~~~~~~~~~~~~~ +``log_level`` +~~~~~~~~~~~~~ + +:Description: + Verbosity of console log messages. Acceptable values can be found + here: https://docs.python.org/2/library/logging.html#logging- + levels +:Default: DEBUG +:Type: str + + +~~~~~~~~~~~~~~~~~~~~~~~ +``database_connection`` +~~~~~~~~~~~~~~~~~~~~~~~ + +:Description: + Database connection Galaxy reports are intended for production + Galaxy instances, so sqlite (and the default value below) is not + supported. An SQLAlchemy connection string should be used specify + an external database. +:Default: sqlite:///./database/universe.sqlite?isolation_level=IMMEDIATE +:Type: str + + +~~~~~~~~~~~~~ +``file_path`` +~~~~~~~~~~~~~ + +:Description: + Where dataset files are saved Temporary storage for additional + datasets, this should be shared through the cluster +:Default: database/files +:Type: str + + +~~~~~~~~~~~~~~~~~ +``new_file_path`` +~~~~~~~~~~~~~~~~~ + +:Description: + Where dataset files are saved Temporary storage for additional + datasets, this should be shared through the cluster +:Default: database/tmp +:Type: str + + +~~~~~~~~~~~~~~~~~~~~~~~ +``template_cache_path`` +~~~~~~~~~~~~~~~~~~~~~~~ + +:Description: + Mako templates are compiled as needed and cached for reuse, this + directory is used for the cache +:Default: database/compiled_templates/reports +:Type: str + + +~~~~~~~~~ +``debug`` +~~~~~~~~~ + +:Description: + Configuration for debugging middleware +:Default: False +:Type: bool + + +~~~~~~~~~~~~ +``use_lint`` +~~~~~~~~~~~~ + +:Description: + Check for WSGI compliance. +:Default: False +:Type: bool + + +~~~~~~~~~~~~~~~~~~~ +``use_interactive`` +~~~~~~~~~~~~~~~~~~~ + +:Description: + NEVER enable this on a public site (even test or QA) +:Default: True +:Type: bool + + +~~~~~~~~~~~~~~~~~ +``use_heartbeat`` +~~~~~~~~~~~~~~~~~ + +:Description: + Write thread status periodically to 'heartbeat.log' (careful, uses + disk space rapidly!) +:Default: True +:Type: bool + + +~~~~~~~~~~~~~~~ +``use_profile`` +~~~~~~~~~~~~~~~ + +:Description: + Profiling middleware (cProfile based) +:Default: True +:Type: bool + + +~~~~~~~~~~~~~~~ +``smtp_server`` +~~~~~~~~~~~~~~~ + +:Description: + Mail +:Default: yourserver@yourfacility.edu +:Type: str + + +~~~~~~~~~~~~~~~~~~ +``error_email_to`` +~~~~~~~~~~~~~~~~~~ + +:Description: + Mail +:Default: your_bugs@bx.psu.edu +:Type: str + + + From 4945f55e4fe28842b58c025b37c4d6c96a07028f Mon Sep 17 00:00:00 2001 From: John Chilton Date: Fri, 26 Aug 2016 10:32:23 -0400 Subject: [PATCH 09/15] Makefile shortcuts for configuration script. --- Makefile | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/Makefile b/Makefile index 87d09af22f6..771c933e6b5 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ MY_UPSTREAM:=origin VENV?=.venv # Source virtualenv to execute command (flake8, sphinx, twine, etc...) IN_VENV=if [ -f $(VENV)/bin/activate ]; then . $(VENV)/bin/activate; fi; +CONFIG_MANAGE=$(IN_VENV) python lib/galaxy/webapps/config_manage.py PROJECT_URL?=https://github.com/galaxyproject/galaxy GRUNT_DOCKER_NAME:=galaxy/client-builder:16.01 GRUNT_EXEC?=node_modules/grunt-cli/bin/grunt @@ -52,6 +53,42 @@ open-project: ## open project on github lint: ## check style using tox and flake8 for Python 2 and Python 3 $(IN_VENV) tox -e py27-lint && tox -e py34-lint +uwsgi-rebuild-validation: ## rebuild uwsgi_config.yml kwalify schema against latest uwsgi master. + $(CONFIG_MANAGE) build_uwsgi_yaml + +tool-shed-config-validate: ## validate tool shed YAML configuration file + $(CONFIG_MANAGE) validate tool_shed + +tool-shed-config-lint: ## lint tool shed YAML configuration file + $(CONFIG_MANAGE) lint tool_shed + +tool-shed-config-convert-dry-run: ## convert old style tool shed ini to yaml (dry run) + $(CONFIG_MANAGE) convert tool_shed --dry-run + +tool-shed-config-convert: ## convert old style tool shed ini to yaml + $(CONFIG_MANAGE) convert tool_shed + +tool-shed-config-rebuild-sample: ## Rebuild sample tool shed yaml file from schema + $(CONFIG_MANAGE) build_sample_yaml tool_shed --add-comments + +reports-config-validate: ## validate reports YAML configuration file + $(CONFIG_MANAGE) validate reports + +reports-config-convert-dry-run: ## convert old style reports ini to yaml (dry run) + $(CONFIG_MANAGE) convert reports --dry-run + +reports-config-convert: ## convert old style reports ini to yaml + $(CONFIG_MANAGE) convert reports + +reports-config-rebuild-sample: ## Rebuild sample reports yaml file from schema + $(CONFIG_MANAGE) build_sample_yaml reports --add-comments + +reports-config-lint: ## lint reports YAML configuration file + $(CONFIG_MANAGE) lint reports + +reports-config-rebuild-rst: ## Rebuild sample reports RST docs + $(CONFIG_MANAGE) build_rst reports > doc/source/admin/reports_options.rst + release-ensure-upstream: ## Ensure upstream branch for release commands setup ifeq (shell git remote -v | grep $(RELEASE_UPSTREAM), ) git remote add $(RELEASE_UPSTREAM) git@github.com:galaxyproject/galaxy.git From ef46a60a829e3dae44d935f6f886feef39b873e3 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Fri, 26 Aug 2016 15:55:24 -0400 Subject: [PATCH 10/15] Add required dependency on uwsgi. Required for the new out-of-the-box configuration of tool shed and reports. --- lib/galaxy/dependencies/pinned-requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/galaxy/dependencies/pinned-requirements.txt b/lib/galaxy/dependencies/pinned-requirements.txt index f37913b84a6..b331bd6081a 100644 --- a/lib/galaxy/dependencies/pinned-requirements.txt +++ b/lib/galaxy/dependencies/pinned-requirements.txt @@ -6,6 +6,7 @@ SQLAlchemy==1.0.15 mercurial==3.7.3 numpy==1.9.2 pycrypto==2.6.1 +pyuwsgi==2.1.dev0+gx1.c6ee1f6 # Install python_lzo if you want to support indexed access to lzo-compressed # locally cached maf files via bx-python From 8191fd492819214b12c0aa28b35e5b6c4ea7bfa1 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Thu, 15 Sep 2016 16:09:59 -0400 Subject: [PATCH 11/15] Add pykwalify as dependency for the new config validation stuff. xref https://github.com/galaxyproject/starforge/pull/110 --- lib/galaxy/dependencies/pinned-requirements.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/galaxy/dependencies/pinned-requirements.txt b/lib/galaxy/dependencies/pinned-requirements.txt index b331bd6081a..942d7ab0986 100644 --- a/lib/galaxy/dependencies/pinned-requirements.txt +++ b/lib/galaxy/dependencies/pinned-requirements.txt @@ -33,6 +33,11 @@ Whoosh==2.7.4 testfixtures==4.10.0 galaxy_sequence_utils==1.0.2 +# pykwalify and dependencies +pykwalify==1.5.1 +python-dateutil==2.5.3 +docopt==0.6.2 + # Cheetah and dependencies Cheetah==2.4.4 Markdown==2.6.3 From ffe295e96dbd82615c987a2b9ba9bd15ea253826 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Wed, 16 Nov 2016 12:43:09 -0500 Subject: [PATCH 12/15] Fix Python 3 linting problem with test_config_manage.py. --- test/unit/config/test_config_manage.py | 1 - 1 file changed, 1 deletion(-) diff --git a/test/unit/config/test_config_manage.py b/test/unit/config/test_config_manage.py index 9477b0e21d0..14c0cf42e4c 100644 --- a/test/unit/config/test_config_manage.py +++ b/test/unit/config/test_config_manage.py @@ -73,7 +73,6 @@ def test_reports_conversion_1607_gzip(): config = yaml.load(f) assert "uwsgi" in config uwsgi_config = config["uwsgi"] - print uwsgi_config assert uwsgi_config["http-auto-gzip"] is True, uwsgi_config From 1ce93ccfdf7b54ec1efcf08b04c9f28b67ab0615 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Mon, 13 Mar 2017 14:07:42 -0400 Subject: [PATCH 13/15] Pin version of uWSGI to freshly released 2.0.15 available on wheels.galaxyproject.org. --- lib/galaxy/dependencies/pinned-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/dependencies/pinned-requirements.txt b/lib/galaxy/dependencies/pinned-requirements.txt index 942d7ab0986..55c1277e5d5 100644 --- a/lib/galaxy/dependencies/pinned-requirements.txt +++ b/lib/galaxy/dependencies/pinned-requirements.txt @@ -6,7 +6,7 @@ SQLAlchemy==1.0.15 mercurial==3.7.3 numpy==1.9.2 pycrypto==2.6.1 -pyuwsgi==2.1.dev0+gx1.c6ee1f6 +uWSGI==2.0.15 # Install python_lzo if you want to support indexed access to lzo-compressed # locally cached maf files via bx-python From 539a62f642ada1f2d832f1f88ab339cafe672c1f Mon Sep 17 00:00:00 2001 From: John Chilton Date: Thu, 6 Apr 2017 15:25:58 -0400 Subject: [PATCH 14/15] Fix ORM scripts for #3179. --- lib/galaxy/model/orm/scripts.py | 28 +++++++++++++++++----------- lib/galaxy/util/properties.py | 21 +++++++++++++++------ 2 files changed, 32 insertions(+), 17 deletions(-) diff --git a/lib/galaxy/model/orm/scripts.py b/lib/galaxy/model/orm/scripts.py index a7a922341cd..f49dc0d7b46 100644 --- a/lib/galaxy/model/orm/scripts.py +++ b/lib/galaxy/model/orm/scripts.py @@ -3,6 +3,7 @@ Code to support database helper scripts (create_db.py, manage_db.py, etc...). """ import logging +from galaxy.util import listify from galaxy.util.properties import find_config_file, load_app_properties @@ -16,22 +17,23 @@ DATABASE = { "galaxy": { 'repo': 'lib/galaxy/model/migrate', - 'old_config_file': 'universe_wsgi.ini', + 'old_config_files': ['universe_wsgi.ini'], 'default_sqlite_file': './database/universe.sqlite', 'config_override': 'GALAXY_CONFIG_', }, "tool_shed": { 'repo': 'lib/galaxy/webapps/tool_shed/model/migrate', - 'config_file': 'config/tool_shed.ini', - 'old_config_file': 'tool_shed_wsgi.ini', + 'config_file': 'config/tool_shed.yml', + 'old_config_files': ['config/tool_shed.ini', 'tool_shed_wsgi.ini'], 'default_sqlite_file': './database/community.sqlite', 'config_override': 'TOOL_SHED_CONFIG_', + 'config_section': 'tool_shed', }, "install": { 'repo': 'lib/galaxy/model/tool_shed_install/migrate', - 'old_config_file': 'universe_wsgi.ini', + 'old_config_files': ['universe_wsgi.ini'], 'config_prefix': 'install_', 'default_sqlite_file': './database/install.sqlite', 'config_override': 'GALAXY_INSTALL_CONFIG_', @@ -39,14 +41,14 @@ DATABASE = { } -def read_config_file_arg( argv, default, old_default, cwd=None ): +def read_config_file_arg( argv, default, old_defaults, cwd=None ): config_file = None if '-c' in argv: pos = argv.index( '-c' ) argv.pop(pos) config_file = argv.pop( pos ) - - return find_config_file( default, old_default, config_file, cwd=cwd ) + old_defaults = listify(old_defaults) + return find_config_file( default, old_defaults, config_file, cwd=cwd ) def get_config( argv, cwd=None ): @@ -83,14 +85,18 @@ def get_config( argv, cwd=None ): database_defaults = DATABASE[ database ] default = database_defaults.get( 'config_file', DEFAULT_CONFIG_FILE ) - old_default = database_defaults.get( 'old_config_file' ) - config_file = read_config_file_arg( argv, default, old_default, cwd=cwd ) + old_defaults = database_defaults.get( 'old_config_files' ) + config_file = read_config_file_arg( argv, default, old_defaults, cwd=cwd ) repo = database_defaults[ 'repo' ] config_prefix = database_defaults.get( 'config_prefix', DEFAULT_CONFIG_PREFIX ) config_override = database_defaults.get( 'config_override', 'GALAXY_CONFIG_' ) default_sqlite_file = database_defaults[ 'default_sqlite_file' ] - - properties = load_app_properties( ini_file=config_file, config_prefix=config_override ) + if config_file.endswith(".yml") or config_file.endswith(".yml.sample"): + config_section = database_defaults.get( 'config_section', None ) + else: + # An .ini file - just let load_app_properties find app:main. + config_section = None + properties = load_app_properties( config_file=config_file, config_prefix=config_override, config_section=config_section ) if ("%sdatabase_connection" % config_prefix) in properties: db_url = properties[ "%sdatabase_connection" % config_prefix ] diff --git a/lib/galaxy/util/properties.py b/lib/galaxy/util/properties.py index 26ba8489108..10ca13f412d 100644 --- a/lib/galaxy/util/properties.py +++ b/lib/galaxy/util/properties.py @@ -11,11 +11,15 @@ import yaml from six import iteritems from six.moves.configparser import ConfigParser +from galaxy.util import listify -def find_config_file(default, old_default, explicit, cwd=None): + +def find_config_file(default, old_defaults, explicit, cwd=None): + old_defaults = listify(old_defaults) if cwd is not None: default = os.path.join(cwd, default) - old_default = os.path.join(cwd, old_default) + for i in range(len(old_defaults)): + old_defaults[i] = os.path.join(cwd, old_defaults[i]) if explicit is not None: explicit = os.path.join(cwd, explicit) @@ -25,12 +29,17 @@ def find_config_file(default, old_default, explicit, cwd=None): else: raise Exception("Problem determining Galaxy's configuration - the specified configuration file cannot be found.") else: - if not os.path.exists( default ) and os.path.exists( old_default ): - config_file = old_default - elif os.path.exists( default ): + config_file = None + if os.path.exists(default): config_file = default - else: + if config_file is None: + for old_default in old_defaults: + if os.path.exists(old_default): + config_file = old_default + + if config_file is None: config_file = default + ".sample" + return config_file From 98ca8ce7a68d18533f3bf85097490c5b66e9f876 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Tue, 11 Apr 2017 13:13:32 -0400 Subject: [PATCH 15/15] Update config overhaul branch for introduction of galaxy.web.stack package. --- lib/galaxy/web/framework/webapp.py | 24 ++++++++++-------------- lib/galaxy/webapps/galaxy/buildapp.py | 2 ++ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/lib/galaxy/web/framework/webapp.py b/lib/galaxy/web/framework/webapp.py index 28bb34ab485..4e093441bdb 100644 --- a/lib/galaxy/web/framework/webapp.py +++ b/lib/galaxy/web/framework/webapp.py @@ -27,7 +27,6 @@ from galaxy.exceptions import MessageException from galaxy import util from galaxy.util import asbool from galaxy.util import safe_str_cmp -from galaxy.util.postfork import process_is_uwsgi from galaxy.util.sanitize_html import sanitize_html from galaxy.managers import context @@ -959,21 +958,18 @@ def build_native_uwsgi_app( paste_factory, config_section ): """uwsgi can load paste factories with --ini-paste, but this builds non-paste uwsgi apps. In particular these are useful with --yaml or --json for config.""" - if not process_is_uwsgi: + import uwsgi + uwsgi_opt = uwsgi.opt + config_file = uwsgi_opt.get("yaml") or uwsgi_opt.get("json") + if not config_file: + # Probably loaded via --ini-paste - expect paste app. return None - else: - import uwsgi - uwsgi_opt = uwsgi.opt - config_file = uwsgi_opt.get("yaml") or uwsgi_opt.get("json") - if not config_file: - # Probably loaded via --ini-paste - expect paste app. - return None - uwsgi_app = paste_factory(uwsgi.opt, load_app_kwds={ - "config_file": config_file, - "config_section": config_section, - }) - return uwsgi_app + uwsgi_app = paste_factory(uwsgi.opt, load_app_kwds={ + "config_file": config_file, + "config_section": config_section, + }) + return uwsgi_app def build_url_map( app, global_conf, local_conf ): diff --git a/lib/galaxy/webapps/galaxy/buildapp.py b/lib/galaxy/webapps/galaxy/buildapp.py index b425d89f870..12937cdafac 100644 --- a/lib/galaxy/webapps/galaxy/buildapp.py +++ b/lib/galaxy/webapps/galaxy/buildapp.py @@ -157,6 +157,8 @@ def paste_app_factory( global_conf, **kwargs ): def uwsgi_app_factory(): + # TODO: synchronize with galaxy.web.framework.webapp.build_native_uwsgi_app - should + # at least be using nice_config_parser for instance. import uwsgi root = os.path.abspath(uwsgi.opt.get('galaxy_root', os.getcwd())) config_file = uwsgi.opt.get('galaxy_config_file', os.path.join(root, 'config', 'galaxy.ini'))