diff --git a/doc/source/admin/galaxy_options.rst b/doc/source/admin/galaxy_options.rst index a4d1cfd449e..c160e1aabb9 100644 --- a/doc/source/admin/galaxy_options.rst +++ b/doc/source/admin/galaxy_options.rst @@ -1282,10 +1282,10 @@ :Description: 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. + account activations, workflow step notifications, password resets, + and tool error reports. We recommend using a string in the + following format: Galaxy Project . If + not configured, '' will be used. :Default: ``None`` :Type: str @@ -1734,6 +1734,16 @@ :Type: str +~~~~~~~~~~~~~ +``quota_url`` +~~~~~~~~~~~~~ + +:Description: + The URL linked for quota information in the UI. +:Default: ``https://galaxyproject.org/support/account-quotas/`` +:Type: str + + ~~~~~~~~~~~~~~~ ``support_url`` ~~~~~~~~~~~~~~~ diff --git a/lib/galaxy/config/sample/galaxy.yml.sample b/lib/galaxy/config/sample/galaxy.yml.sample index a984cfeb109..403492ae33e 100644 --- a/lib/galaxy/config/sample/galaxy.yml.sample +++ b/lib/galaxy/config/sample/galaxy.yml.sample @@ -723,10 +723,10 @@ galaxy: #error_email_to: null # 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. + # account activations, workflow step notifications, password resets, + # and tool error reports. We recommend using a string in the + # following format: Galaxy Project . If + # not configured, '' will be used. #email_from: null # URL of the support resource for the galaxy instance. Used in @@ -928,6 +928,9 @@ galaxy: # The URL linked by the "Wiki" link in the "Help" menu. #wiki_url: https://galaxyproject.org/ + # The URL linked for quota information in the UI. + #quota_url: https://galaxyproject.org/support/account-quotas/ + # The URL linked by the "Support" link in the "Help" menu. #support_url: https://galaxyproject.org/support/ diff --git a/lib/galaxy/security/validate_user_input.py b/lib/galaxy/security/validate_user_input.py index ef016330032..d33907afc20 100644 --- a/lib/galaxy/security/validate_user_input.py +++ b/lib/galaxy/security/validate_user_input.py @@ -28,12 +28,13 @@ PASSWORD_MIN_LEN = 6 def validate_email_str(email): """Validates a string containing an email address.""" - message = '' + if not email: + return "No email address was provided." if not(VALID_EMAIL_RE.match(email)): - message = "The format of the email address is not correct." + return "The format of the email address is not correct." elif len(email) > EMAIL_MAX_LEN: - message = "Email address cannot be more than %d characters in length." % EMAIL_MAX_LEN - return message + return "Email address cannot be more than %d characters in length." % EMAIL_MAX_LEN + return "" def validate_password_str(password): diff --git a/lib/galaxy/tools/errors.py b/lib/galaxy/tools/errors.py index 126c6211212..4e63dab16ee 100644 --- a/lib/galaxy/tools/errors.py +++ b/lib/galaxy/tools/errors.py @@ -10,6 +10,7 @@ from galaxy import ( util, web ) +from galaxy.security.validate_user_input import validate_email_str from galaxy.util import unicodify error_report_template = """ @@ -237,23 +238,18 @@ class EmailErrorReporter(ErrorReporter): def _send_report(self, user, email=None, message=None, **kwd): smtp_server = self.app.config.smtp_server assert smtp_server, ValueError("Mail is not configured for this Galaxy instance") - to_address = self.app.config.error_email_to - assert to_address, ValueError("Error reporting has been disabled for this Galaxy instance") + to = self.app.config.error_email_to + assert to, ValueError("Error reporting has been disabled for this Galaxy instance") - frm = to_address - # Check email a bit - email = email or '' - email = email.strip() - parts = email.split() - if len(parts) == 1 and len(email) > 0 and self._can_access_dataset(user): - to = to_address + ", " + email - else: - to = to_address + frm = self.app.config.email_from + error_msg = validate_email_str(email) + if not error_msg and self._can_access_dataset(user): + to += ', ' + email.strip() subject = "Galaxy tool error report from %s" % email try: - subject = "{} ({})".format(subject, self.app.toolbox.get_tool(self.job.tool_id, self.job.tool_version).old_id) + subject = "{} ({})".format( + subject, self.app.toolbox.get_tool(self.job.tool_id, self.job.tool_version).old_id) except Exception: pass - # Send it return util.send_mail(frm, to, subject, self.report, self.app.config, html=self.html_report) diff --git a/lib/galaxy/webapps/galaxy/config_schema.yml b/lib/galaxy/webapps/galaxy/config_schema.yml index 52224bcfe02..3062d2b9fcd 100644 --- a/lib/galaxy/webapps/galaxy/config_schema.yml +++ b/lib/galaxy/webapps/galaxy/config_schema.yml @@ -922,9 +922,9 @@ mapping: required: false desc: | 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 + account activations, workflow step notifications, password resets, and + tool error reports. We recommend using a string in the following format: + Galaxy Project . If not configured, '' will be used. instance_resource_url: