# HG changeset patch # User Mads Kiilerich # Date 1482536078 -3600 # Node ID d89d586b26ae2ffe1127af1cb5d174adbccbfefa # Parent dc94e662ee74dc16d14327621286adc1a2459039# Parent b4dd4c16c12d8932d99a2182c7e8ed0f456fb85f Merge stable diff -r dc94e662ee74 -r d89d586b26ae development.ini --- a/development.ini Fri Dec 23 23:39:36 2016 +0100 +++ b/development.ini Sat Dec 24 00:34:38 2016 +0100 @@ -391,59 +391,59 @@ ############################ #################### -### [errormator] ### +### [appenlight] ### #################### -## Errormator is tailored to work with Kallithea, see -## http://errormator.com for details how to obtain an account -## you must install python package `errormator_client` to make it work +## AppEnlight is tailored to work with Kallithea, see +## http://appenlight.com for details how to obtain an account +## you must install python package `appenlight_client` to make it work -## errormator enabled -errormator = false +## appenlight enabled +appenlight = false -errormator.server_url = https://api.errormator.com -errormator.api_key = YOUR_API_KEY +appenlight.server_url = https://api.appenlight.com +appenlight.api_key = YOUR_API_KEY ## TWEAK AMOUNT OF INFO SENT HERE ## enables 404 error logging (default False) -errormator.report_404 = false +appenlight.report_404 = false ## time in seconds after request is considered being slow (default 1) -errormator.slow_request_time = 1 +appenlight.slow_request_time = 1 ## record slow requests in application ## (needs to be enabled for slow datastore recording and time tracking) -errormator.slow_requests = true +appenlight.slow_requests = true ## enable hooking to application loggers -#errormator.logging = true +#appenlight.logging = true ## minimum log level for log capture -#errormator.logging.level = WARNING +#appenlight.logging.level = WARNING ## send logs only from erroneous/slow requests ## (saves API quota for intensive logging) -errormator.logging_on_error = false +appenlight.logging_on_error = false ## list of additional keywords that should be grabbed from environ object ## can be string with comma separated list of words in lowercase ## (by default client will always send following info: ## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that ## start with HTTP* this list be extended with additional keywords here -errormator.environ_keys_whitelist = +appenlight.environ_keys_whitelist = ## list of keywords that should be blanked from request object ## can be string with comma separated list of words in lowercase ## (by default client will always blank keys that contain following words ## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf' ## this list be extended with additional keywords set here -errormator.request_keys_blacklist = +appenlight.request_keys_blacklist = ## list of namespaces that should be ignores when gathering log entries ## can be string with comma separated list of namespaces -## (by default the client ignores own entries: errormator_client.client) -errormator.log_namespace_blacklist = +## (by default the client ignores own entries: appenlight_client.client) +appenlight.log_namespace_blacklist = ################ ### [sentry] ### diff -r dc94e662ee74 -r d89d586b26ae kallithea/bin/template.ini.mako --- a/kallithea/bin/template.ini.mako Fri Dec 23 23:39:36 2016 +0100 +++ b/kallithea/bin/template.ini.mako Sat Dec 24 00:34:38 2016 +0100 @@ -383,65 +383,65 @@ #beaker.session.sa.url = postgresql://postgres:qwe@localhost/kallithea #beaker.session.table_name = db_session -%if error_aggregation_service == 'errormator': +%if error_aggregation_service == 'appenlight': <%text>############################ <%text>## ERROR HANDLING SYSTEMS ## <%text>############################ <%text>#################### -<%text>### [errormator] ### +<%text>### [appenlight] ### <%text>#################### -<%text>## Errormator is tailored to work with Kallithea, see -<%text>## http://errormator.com for details how to obtain an account -<%text>## you must install python package `errormator_client` to make it work +<%text>## AppEnlight is tailored to work with Kallithea, see +<%text>## http://appenlight.com for details how to obtain an account +<%text>## you must install python package `appenlight_client` to make it work -<%text>## errormator enabled -errormator = false +<%text>## appenlight enabled +appenlight = false -errormator.server_url = https://api.errormator.com -errormator.api_key = YOUR_API_KEY +appenlight.server_url = https://api.appenlight.com +appenlight.api_key = YOUR_API_KEY <%text>## TWEAK AMOUNT OF INFO SENT HERE <%text>## enables 404 error logging (default False) -errormator.report_404 = false +appenlight.report_404 = false <%text>## time in seconds after request is considered being slow (default 1) -errormator.slow_request_time = 1 +appenlight.slow_request_time = 1 <%text>## record slow requests in application <%text>## (needs to be enabled for slow datastore recording and time tracking) -errormator.slow_requests = true +appenlight.slow_requests = true <%text>## enable hooking to application loggers -#errormator.logging = true +#appenlight.logging = true <%text>## minimum log level for log capture -#errormator.logging.level = WARNING +#appenlight.logging.level = WARNING <%text>## send logs only from erroneous/slow requests <%text>## (saves API quota for intensive logging) -errormator.logging_on_error = false +appenlight.logging_on_error = false <%text>## list of additional keywords that should be grabbed from environ object <%text>## can be string with comma separated list of words in lowercase <%text>## (by default client will always send following info: <%text>## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that <%text>## start with HTTP* this list be extended with additional keywords here -errormator.environ_keys_whitelist = +appenlight.environ_keys_whitelist = <%text>## list of keywords that should be blanked from request object <%text>## can be string with comma separated list of words in lowercase <%text>## (by default client will always blank keys that contain following words <%text>## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf' <%text>## this list be extended with additional keywords set here -errormator.request_keys_blacklist = +appenlight.request_keys_blacklist = <%text>## list of namespaces that should be ignores when gathering log entries <%text>## can be string with comma separated list of namespaces -<%text>## (by default the client ignores own entries: errormator_client.client) -errormator.log_namespace_blacklist = +<%text>## (by default the client ignores own entries: appenlight_client.client) +appenlight.log_namespace_blacklist = %elif error_aggregation_service == 'sentry': <%text>################ diff -r dc94e662ee74 -r d89d586b26ae kallithea/config/deployment.ini_tmpl --- a/kallithea/config/deployment.ini_tmpl Fri Dec 23 23:39:36 2016 +0100 +++ b/kallithea/config/deployment.ini_tmpl Sat Dec 24 00:34:38 2016 +0100 @@ -384,59 +384,59 @@ ############################ #################### -### [errormator] ### +### [appenlight] ### #################### -## Errormator is tailored to work with Kallithea, see -## http://errormator.com for details how to obtain an account -## you must install python package `errormator_client` to make it work +## AppEnlight is tailored to work with Kallithea, see +## http://appenlight.com for details how to obtain an account +## you must install python package `appenlight_client` to make it work -## errormator enabled -errormator = false +## appenlight enabled +appenlight = false -errormator.server_url = https://api.errormator.com -errormator.api_key = YOUR_API_KEY +appenlight.server_url = https://api.appenlight.com +appenlight.api_key = YOUR_API_KEY ## TWEAK AMOUNT OF INFO SENT HERE ## enables 404 error logging (default False) -errormator.report_404 = false +appenlight.report_404 = false ## time in seconds after request is considered being slow (default 1) -errormator.slow_request_time = 1 +appenlight.slow_request_time = 1 ## record slow requests in application ## (needs to be enabled for slow datastore recording and time tracking) -errormator.slow_requests = true +appenlight.slow_requests = true ## enable hooking to application loggers -#errormator.logging = true +#appenlight.logging = true ## minimum log level for log capture -#errormator.logging.level = WARNING +#appenlight.logging.level = WARNING ## send logs only from erroneous/slow requests ## (saves API quota for intensive logging) -errormator.logging_on_error = false +appenlight.logging_on_error = false ## list of additional keywords that should be grabbed from environ object ## can be string with comma separated list of words in lowercase ## (by default client will always send following info: ## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that ## start with HTTP* this list be extended with additional keywords here -errormator.environ_keys_whitelist = +appenlight.environ_keys_whitelist = ## list of keywords that should be blanked from request object ## can be string with comma separated list of words in lowercase ## (by default client will always blank keys that contain following words ## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf' ## this list be extended with additional keywords set here -errormator.request_keys_blacklist = +appenlight.request_keys_blacklist = ## list of namespaces that should be ignores when gathering log entries ## can be string with comma separated list of namespaces -## (by default the client ignores own entries: errormator_client.client) -errormator.log_namespace_blacklist = +## (by default the client ignores own entries: appenlight_client.client) +appenlight.log_namespace_blacklist = ################ ### [sentry] ### diff -r dc94e662ee74 -r d89d586b26ae kallithea/config/middleware.py --- a/kallithea/config/middleware.py Fri Dec 23 23:39:36 2016 +0100 +++ b/kallithea/config/middleware.py Sat Dec 24 00:34:38 2016 +0100 @@ -69,9 +69,9 @@ if asbool(full_stack): from kallithea.lib.middleware.sentry import Sentry - from kallithea.lib.middleware.errormator import Errormator - if Errormator and asbool(config['app_conf'].get('errormator')): - app = Errormator(app, config) + from kallithea.lib.middleware.appenlight import AppEnlight + if AppEnlight and asbool(config['app_conf'].get('appenlight')): + app = AppEnlight(app, config) elif Sentry: app = Sentry(app, config) diff -r dc94e662ee74 -r d89d586b26ae kallithea/lib/middleware/appenlight.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kallithea/lib/middleware/appenlight.py Sat Dec 24 00:34:38 2016 +0100 @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +""" +kallithea.lib.middleware.appenlight +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +middleware to handle appenlight publishing of errors + +This file was forked by the Kallithea project in July 2014. +Original author and date, and relevant copyright and licensing information is below: +:created_on: October 18, 2012 +:author: marcink +:copyright: (c) 2013 RhodeCode GmbH, and others. +:license: GPLv3, see LICENSE.md for more details. +""" + + +try: + from appenlight_client import make_appenlight_middleware +except ImportError: + AppEnlight = None +else: + AppEnlight = make_appenlight_middleware diff -r dc94e662ee74 -r d89d586b26ae kallithea/lib/middleware/errormator.py --- a/kallithea/lib/middleware/errormator.py Fri Dec 23 23:39:36 2016 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -# -*- coding: utf-8 -*- -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -""" -kallithea.lib.middleware.errormator -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -middleware to handle errormator publishing of errors - -This file was forked by the Kallithea project in July 2014. -Original author and date, and relevant copyright and licensing information is below: -:created_on: October 18, 2012 -:author: marcink -:copyright: (c) 2013 RhodeCode GmbH, and others. -:license: GPLv3, see LICENSE.md for more details. -""" - - -try: - from errormator_client import make_errormator_middleware -except ImportError: - Errormator = None -else: - Errormator = make_errormator_middleware diff -r dc94e662ee74 -r d89d586b26ae kallithea/tests/test.ini --- a/kallithea/tests/test.ini Fri Dec 23 23:39:36 2016 +0100 +++ b/kallithea/tests/test.ini Sat Dec 24 00:34:38 2016 +0100 @@ -396,59 +396,59 @@ ############################ #################### -### [errormator] ### +### [appenlight] ### #################### -## Errormator is tailored to work with Kallithea, see -## http://errormator.com for details how to obtain an account -## you must install python package `errormator_client` to make it work +## AppEnlight is tailored to work with Kallithea, see +## http://appenlight.com for details how to obtain an account +## you must install python package `appenlight_client` to make it work -## errormator enabled -errormator = false +## appenlight enabled +appenlight = false -errormator.server_url = https://api.errormator.com -errormator.api_key = YOUR_API_KEY +appenlight.server_url = https://api.appenlight.com +appenlight.api_key = YOUR_API_KEY ## TWEAK AMOUNT OF INFO SENT HERE ## enables 404 error logging (default False) -errormator.report_404 = false +appenlight.report_404 = false ## time in seconds after request is considered being slow (default 1) -errormator.slow_request_time = 1 +appenlight.slow_request_time = 1 ## record slow requests in application ## (needs to be enabled for slow datastore recording and time tracking) -errormator.slow_requests = true +appenlight.slow_requests = true ## enable hooking to application loggers -#errormator.logging = true +#appenlight.logging = true ## minimum log level for log capture -#errormator.logging.level = WARNING +#appenlight.logging.level = WARNING ## send logs only from erroneous/slow requests ## (saves API quota for intensive logging) -errormator.logging_on_error = false +appenlight.logging_on_error = false ## list of additional keywords that should be grabbed from environ object ## can be string with comma separated list of words in lowercase ## (by default client will always send following info: ## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that ## start with HTTP* this list be extended with additional keywords here -errormator.environ_keys_whitelist = +appenlight.environ_keys_whitelist = ## list of keywords that should be blanked from request object ## can be string with comma separated list of words in lowercase ## (by default client will always blank keys that contain following words ## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf' ## this list be extended with additional keywords set here -errormator.request_keys_blacklist = +appenlight.request_keys_blacklist = ## list of namespaces that should be ignores when gathering log entries ## can be string with comma separated list of namespaces -## (by default the client ignores own entries: errormator_client.client) -errormator.log_namespace_blacklist = +## (by default the client ignores own entries: appenlight_client.client) +appenlight.log_namespace_blacklist = ################ ### [sentry] ### diff -r dc94e662ee74 -r d89d586b26ae scripts/generate-ini.py --- a/scripts/generate-ini.py Fri Dec 23 23:39:36 2016 +0100 +++ b/scripts/generate-ini.py Sat Dec 24 00:34:38 2016 +0100 @@ -14,7 +14,7 @@ selected_mako_conditionals = set([ "database_engine == 'sqlite'", "http_server == 'waitress'", - "error_aggregation_service == 'errormator'", + "error_aggregation_service == 'appenlight'", "error_aggregation_service == 'sentry'", ]) diff -r dc94e662ee74 -r d89d586b26ae scripts/manifest --- a/scripts/manifest Fri Dec 23 23:39:36 2016 +0100 +++ b/scripts/manifest Sat Dec 24 00:34:38 2016 +0100 @@ -337,7 +337,7 @@ kallithea/lib/markup_renderer.py kallithea/lib/middleware/ kallithea/lib/middleware/__init__.py -kallithea/lib/middleware/errormator.py +kallithea/lib/middleware/appenlight.py kallithea/lib/middleware/https_fixup.py kallithea/lib/middleware/pygrack.py kallithea/lib/middleware/sentry.py