# HG changeset patch # User Thomas De Schampheleire # Date 2017-04-04 22:23:20 # Node ID b4c27fe6438c262ba95bd26a0e1c2c7ac9b1dbbb # Parent 9eae297d3d5b85cc9b717e315b33636b17a500ef TurboGears2 migration: update ini files for error email settings Error emails are now handled by backlash, which is configured through TurboGears2's ErrorReporter. ErrorReporter expects different configuration key names than Pylons did, moreover under a new 'trace_errors' namespace. Since some of the email-related settings are shared between application and error emails, we cannot just rename the existing settings (it would be very odd to have application settings under a 'trace_errors' namespace). Requiring the user to duplicate its settings is also undesirable. Instead, use 'get' to populate the trace_errors namespace based on the existing settings we already had. Unfortunately, 'get' expects the setting to be actually present, so we need to provide an out-of-the-box value for the error-related email settings or there will be an error at startup. We use empty values because there is no realistic default value we can provide. diff --git a/development.ini b/development.ini --- a/development.ini +++ b/development.ini @@ -44,23 +44,24 @@ ## Examples: #email_to = admin@example.com #email_to = admin@example.com another_admin@example.com +email_to = ## 'From' header for error emails. You can optionally add a name. -## Default: -#error_email_from = pylons@yourapp.com +## Default: (none) ## Examples: #error_email_from = Kallithea Errors -#error_email_from = paste_error@example.com +#error_email_from = kallithea_errors@example.com +error_email_from = ## SMTP server settings ## If specifying credentials, make sure to use secure connections. ## Default: Send unencrypted unauthenticated mails to the specified smtp_server. ## For "SSL", use smtp_use_ssl = true and smtp_port = 465. ## For "STARTTLS", use smtp_use_tls = true and smtp_port = 587. -#smtp_server = smtp.example.com +smtp_server = #smtp_username = #smtp_password = -#smtp_port = 25 +smtp_port = #smtp_use_ssl = false #smtp_use_tls = false @@ -391,6 +392,13 @@ beaker.session.secret = development-not- ## ERROR HANDLING SYSTEMS ## ############################ +# Propagate email settings to ErrorReporter of TurboGears2 +# You do not normally need to change these lines +get trace_errors.error_email = email_to +get trace_errors.smtp_server = smtp_server +get trace_errors.smtp_port = smtp_port +get trace_errors.from_address = error_email_from + #################### ### [appenlight] ### #################### diff --git a/kallithea/lib/paster_commands/template.ini.mako b/kallithea/lib/paster_commands/template.ini.mako --- a/kallithea/lib/paster_commands/template.ini.mako +++ b/kallithea/lib/paster_commands/template.ini.mako @@ -38,23 +38,24 @@ <%text>## Examples: #email_to = admin@example.com #email_to = admin@example.com another_admin@example.com +email_to = <%text>## 'From' header for error emails. You can optionally add a name. -<%text>## Default: -#error_email_from = pylons@yourapp.com +<%text>## Default: (none) <%text>## Examples: #error_email_from = Kallithea Errors -#error_email_from = paste_error@example.com +#error_email_from = kallithea_errors@example.com +error_email_from = <%text>## SMTP server settings <%text>## If specifying credentials, make sure to use secure connections. <%text>## Default: Send unencrypted unauthenticated mails to the specified smtp_server. <%text>## For "SSL", use smtp_use_ssl = true and smtp_port = 465. <%text>## For "STARTTLS", use smtp_use_tls = true and smtp_port = 587. -#smtp_server = smtp.example.com +smtp_server = #smtp_username = #smtp_password = -#smtp_port = 25 +smtp_port = #smtp_use_ssl = false #smtp_use_tls = false @@ -390,6 +391,13 @@ beaker.session.secret = ${uuid()} <%text>## ERROR HANDLING SYSTEMS ## <%text>############################ +# Propagate email settings to ErrorReporter of TurboGears2 +# You do not normally need to change these lines +get trace_errors.error_email = email_to +get trace_errors.smtp_server = smtp_server +get trace_errors.smtp_port = smtp_port +get trace_errors.from_address = error_email_from + <%text>#################### <%text>### [appenlight] ### <%text>#################### diff --git a/kallithea/tests/test.ini b/kallithea/tests/test.ini --- a/kallithea/tests/test.ini +++ b/kallithea/tests/test.ini @@ -42,23 +42,24 @@ ## Examples: #email_to = admin@example.com #email_to = admin@example.com another_admin@example.com +email_to = ## 'From' header for error emails. You can optionally add a name. -## Default: -#error_email_from = pylons@yourapp.com +## Default: (none) ## Examples: #error_email_from = Kallithea Errors -#error_email_from = paste_error@example.com +#error_email_from = kallithea_errors@example.com +error_email_from = ## SMTP server settings ## If specifying credentials, make sure to use secure connections. ## Default: Send unencrypted unauthenticated mails to the specified smtp_server. ## For "SSL", use smtp_use_ssl = true and smtp_port = 465. ## For "STARTTLS", use smtp_use_tls = true and smtp_port = 587. -#smtp_server = smtp.example.com +smtp_server = #smtp_username = #smtp_password = -#smtp_port = 25 +smtp_port = #smtp_use_ssl = false #smtp_use_tls = false @@ -396,6 +397,13 @@ beaker.session.secret = {74e0cd75-b339-4 ## ERROR HANDLING SYSTEMS ## ############################ +# Propagate email settings to ErrorReporter of TurboGears2 +# You do not normally need to change these lines +get trace_errors.error_email = email_to +get trace_errors.smtp_server = smtp_server +get trace_errors.smtp_port = smtp_port +get trace_errors.from_address = error_email_from + #################### ### [appenlight] ### ####################