# HG changeset patch # User Thomas De Schampheleire # Date 2017-01-27 21:31:37 # Node ID fc6b1b0e1096382fc14dd36a22dac6b2bcd05a53 # Parent be56b2426b90fa8aba568aebb046da911e799805 ini: set 'debug' only in one place In Pylons-based Kallithea, the 'debug' option was set first in [DEFAULTS] and then overridden with 'set debug = X' in [app:main]. Even when the value under [DEFAULTS] was commented out, the use of the 'set' keyword (providing override semantics) was required, because a default value for the global 'debug' was provided in the framework. The presence of these two debug assignments is confusing. Moreover, TurboGears2 makes the situation more easy and does not expect 'debug' to be in [DEFAULTS] nor does it provide a default at that level. As a result, we can simple use 'debug = X' under [app:main]. Additionally, clarify the Big Fat Warning: the wording 'the line below' is ambiguous and could be misunderstood in an ini file that had previously been changed. diff --git a/development.ini b/development.ini --- a/development.ini +++ b/development.ini @@ -4,7 +4,7 @@ # listening on *:5000 # # sqlite and kallithea.db # # initial_repo_scan = true # -# set debug = true # +# debug = true # # verbose and colorful logging # # # # The %(here)s variable will be replaced with the parent directory of this file# @@ -12,7 +12,6 @@ ################################################################################ [DEFAULT] -debug = true ################################################################################ ## Email settings ## @@ -466,12 +465,12 @@ sentry.include_paths = sentry.exclude_paths = ################################################################################ -## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ## +## WARNING: *DEBUG MODE MUST BE OFF IN A PRODUCTION ENVIRONMENT* ## ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ## ## execute malicious code after an exception is raised. ## ################################################################################ -#set debug = false -set debug = true +#debug = false +debug = true ################################## ### LOGVIEW CONFIG ### 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 @@ -6,7 +6,6 @@ <%text>################################################################################ [DEFAULT] -debug = true <%text>################################################################################ <%text>## Email settings ## @@ -467,11 +466,11 @@ sentry.exclude_paths = %endif <%text>################################################################################ -<%text>## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ## +<%text>## WARNING: *DEBUG MODE MUST BE OFF IN A PRODUCTION ENVIRONMENT* ## <%text>## Debug mode will enable the interactive debugging tool, allowing ANYONE to ## <%text>## execute malicious code after an exception is raised. ## <%text>################################################################################ -set debug = false +debug = false <%text>################################## <%text>### LOGVIEW CONFIG ### diff --git a/kallithea/tests/test.ini b/kallithea/tests/test.ini --- a/kallithea/tests/test.ini +++ b/kallithea/tests/test.ini @@ -10,7 +10,6 @@ ################################################################################ [DEFAULT] -debug = true ################################################################################ ## Email settings ## @@ -471,11 +470,11 @@ sentry.include_paths = sentry.exclude_paths = ################################################################################ -## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ## +## WARNING: *DEBUG MODE MUST BE OFF IN A PRODUCTION ENVIRONMENT* ## ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ## ## execute malicious code after an exception is raised. ## ################################################################################ -set debug = false +debug = false ################################## ### LOGVIEW CONFIG ### diff --git a/scripts/generate-ini.py b/scripts/generate-ini.py --- a/scripts/generate-ini.py +++ b/scripts/generate-ini.py @@ -72,7 +72,7 @@ ini_files = [ listening on *:5000 sqlite and kallithea.db initial_repo_scan = true - set debug = true + debug = true verbose and colorful logging The %(here)s variable will be replaced with the parent directory of this file @@ -83,7 +83,7 @@ ini_files = [ }, '[app:main]': { 'initial_repo_scan': 'true', - 'set debug': 'true', + 'debug': 'true', 'app_instance_uuid': 'development-not-secret', 'beaker.session.secret': 'development-not-secret', },