changeset 6576:b4c27fe6438c

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.
author Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
date Tue, 04 Apr 2017 22:23:20 +0200
parents 9eae297d3d5b
children 69cd0c056aa1
files development.ini kallithea/lib/paster_commands/template.ini.mako kallithea/tests/test.ini
diffstat 3 files changed, 39 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/development.ini	Fri Jan 27 20:49:01 2017 +0100
+++ b/development.ini	Tue Apr 04 22:23:20 2017 +0200
@@ -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 <kallithea-noreply@example.com>
-#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 @@
 ## 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] ###
 ####################
--- a/kallithea/lib/paster_commands/template.ini.mako	Fri Jan 27 20:49:01 2017 +0100
+++ b/kallithea/lib/paster_commands/template.ini.mako	Tue Apr 04 22:23:20 2017 +0200
@@ -38,23 +38,24 @@
 <%text>## Examples:</%text>
 #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>
-<%text>## Default:</%text>
-#error_email_from = pylons@yourapp.com
+<%text>## Default: (none)</%text>
 <%text>## Examples:</%text>
 #error_email_from = Kallithea Errors <kallithea-noreply@example.com>
-#error_email_from = paste_error@example.com
+#error_email_from = kallithea_errors@example.com
+error_email_from =
 
 <%text>## SMTP server settings</%text>
 <%text>## If specifying credentials, make sure to use secure connections.</%text>
 <%text>## Default: Send unencrypted unauthenticated mails to the specified smtp_server.</%text>
 <%text>## For "SSL", use smtp_use_ssl = true and smtp_port = 465.</%text>
 <%text>## For "STARTTLS", use smtp_use_tls = true and smtp_port = 587.</%text>
-#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 @@
 <%text>## ERROR HANDLING SYSTEMS ##</%text>
 <%text>############################</%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>
 <%text>### [appenlight] ###</%text>
 <%text>####################</%text>
--- a/kallithea/tests/test.ini	Fri Jan 27 20:49:01 2017 +0100
+++ b/kallithea/tests/test.ini	Tue Apr 04 22:23:20 2017 +0200
@@ -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 <kallithea-noreply@example.com>
-#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 @@
 ## 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] ###
 ####################