# HG changeset patch # User Mads Kiilerich # Date 1598217261 -7200 # Node ID e85f5bf7ad74741b3b0630a3d890e84fd9e16077 # Parent 11ab74b7701bf83aeb4b10bea2714c2bee91a438 middleware: drop sentry support Our sentry support didn't seem to work with py3. It doesn't seem to ever have been tested on py3 - it failed already when installing. It seems like we used the 'legacy client': https://docs.sentry.io/clients/python/ and nowadays one is expected to use: https://docs.sentry.io/platforms/python/ which has integrations for Pyramid and other frameworks (but not TG2). There are Celery and SQLAlchemy integrations too. See also the migration guide: https://docs.sentry.io/platforms/python/migration/ . Also, there is not much essential code in the old sentry support, and it seems like it would be easier to reimplement from scratch. There is thus not much lost by dropping it. diff -r 11ab74b7701b -r e85f5bf7ad74 development.ini --- a/development.ini Tue Aug 18 22:36:45 2020 +0200 +++ b/development.ini Sun Aug 23 23:14:21 2020 +0200 @@ -346,7 +346,6 @@ get trace_errors.smtp_password = smtp_password get trace_errors.smtp_use_tls = smtp_use_tls - ################################## ## LOGVIEW CONFIG ## ################################## diff -r 11ab74b7701b -r e85f5bf7ad74 kallithea/lib/middleware/sentry.py --- a/kallithea/lib/middleware/sentry.py Tue Aug 18 22:36:45 2020 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +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.sentry -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -middleware to handle sentry/raven 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: September 18, 2012 -:author: marcink -:copyright: (c) 2013 RhodeCode GmbH, and others. -:license: GPLv3, see LICENSE.md for more details. -""" - - -try: - from raven.base import Client - from raven.contrib.pylons import list_from_setting - from raven.middleware import Sentry as Middleware -except ImportError: - Sentry = None -else: - class Sentry(Middleware): - def __init__(self, app, config, client_cls=Client): - client = client_cls( - dsn=config.get('sentry.dsn'), - servers=list_from_setting(config, 'sentry.servers'), - name=config.get('sentry.name'), - key=config.get('sentry.key'), - public_key=config.get('sentry.public_key'), - secret_key=config.get('sentry.secret_key'), - project=config.get('sentry.project'), - site=config.get('sentry.site'), - include_paths=list_from_setting(config, 'sentry.include_paths'), - exclude_paths=list_from_setting(config, 'sentry.exclude_paths'), - ) - super(Sentry, self).__init__(app, client) diff -r 11ab74b7701b -r e85f5bf7ad74 kallithea/lib/paster_commands/template.ini.mako --- a/kallithea/lib/paster_commands/template.ini.mako Tue Aug 18 22:36:45 2020 +0200 +++ b/kallithea/lib/paster_commands/template.ini.mako Sun Aug 23 23:14:21 2020 +0200 @@ -419,27 +419,6 @@ get trace_errors.smtp_password = smtp_password get trace_errors.smtp_use_tls = smtp_use_tls -%if error_aggregation_service == 'sentry': -<%text>################ -<%text>## [sentry] ## -<%text>################ - -<%text>## sentry is a alternative open source error aggregator -<%text>## you must install python packages `sentry` and `raven` to enable - -sentry.dsn = YOUR_DNS -sentry.servers = -sentry.name = -sentry.key = -sentry.public_key = -sentry.secret_key = -sentry.project = -sentry.site = -sentry.include_paths = -sentry.exclude_paths = - -%endif - <%text>################################## <%text>## LOGVIEW CONFIG ## <%text>##################################