Mercurial > kallithea
changeset 6377:d89d586b26ae
Merge stable
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Sat, 24 Dec 2016 00:34:38 +0100 |
parents | dc94e662ee74 (current diff) b4dd4c16c12d (diff) |
children | 1e80013ac8af |
files | development.ini kallithea/bin/template.ini.mako kallithea/config/deployment.ini_tmpl kallithea/config/middleware.py kallithea/lib/middleware/appenlight.py kallithea/lib/middleware/errormator.py kallithea/tests/test.ini scripts/generate-ini.py scripts/manifest |
diffstat | 9 files changed, 112 insertions(+), 112 deletions(-) [+] |
line wrap: on
line diff
--- 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] ###
--- 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> <%text>## ERROR HANDLING SYSTEMS ##</%text> <%text>############################</%text> <%text>####################</%text> -<%text>### [errormator] ###</%text> +<%text>### [appenlight] ###</%text> <%text>####################</%text> -<%text>## Errormator is tailored to work with Kallithea, see</%text> -<%text>## http://errormator.com for details how to obtain an account</%text> -<%text>## you must install python package `errormator_client` to make it work</%text> +<%text>## AppEnlight is tailored to work with Kallithea, see</%text> +<%text>## http://appenlight.com for details how to obtain an account</%text> +<%text>## you must install python package `appenlight_client` to make it work</%text> -<%text>## errormator enabled</%text> -errormator = false +<%text>## appenlight enabled</%text> +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> <%text>## enables 404 error logging (default False)</%text> -errormator.report_404 = false +appenlight.report_404 = false <%text>## time in seconds after request is considered being slow (default 1)</%text> -errormator.slow_request_time = 1 +appenlight.slow_request_time = 1 <%text>## record slow requests in application</%text> <%text>## (needs to be enabled for slow datastore recording and time tracking)</%text> -errormator.slow_requests = true +appenlight.slow_requests = true <%text>## enable hooking to application loggers</%text> -#errormator.logging = true +#appenlight.logging = true <%text>## minimum log level for log capture</%text> -#errormator.logging.level = WARNING +#appenlight.logging.level = WARNING <%text>## send logs only from erroneous/slow requests</%text> <%text>## (saves API quota for intensive logging)</%text> -errormator.logging_on_error = false +appenlight.logging_on_error = false <%text>## list of additional keywords that should be grabbed from environ object</%text> <%text>## can be string with comma separated list of words in lowercase</%text> <%text>## (by default client will always send following info:</%text> <%text>## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that</%text> <%text>## start with HTTP* this list be extended with additional keywords here</%text> -errormator.environ_keys_whitelist = +appenlight.environ_keys_whitelist = <%text>## list of keywords that should be blanked from request object</%text> <%text>## can be string with comma separated list of words in lowercase</%text> <%text>## (by default client will always blank keys that contain following words</%text> <%text>## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'</%text> <%text>## this list be extended with additional keywords set here</%text> -errormator.request_keys_blacklist = +appenlight.request_keys_blacklist = <%text>## list of namespaces that should be ignores when gathering log entries</%text> <%text>## can be string with comma separated list of namespaces</%text> -<%text>## (by default the client ignores own entries: errormator_client.client)</%text> -errormator.log_namespace_blacklist = +<%text>## (by default the client ignores own entries: appenlight_client.client)</%text> +appenlight.log_namespace_blacklist = %elif error_aggregation_service == 'sentry': <%text>################</%text>
--- 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] ###
--- 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)
--- /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 <http://www.gnu.org/licenses/>. +""" +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
--- 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 <http://www.gnu.org/licenses/>. -""" -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
--- 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] ###
--- 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'", ])
--- 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