use ne sentry sdk instead of raven

This commit is contained in:
ziirish 2020-01-05 16:44:25 +01:00
parent e0416ceacd
commit df0982dd80
No known key found for this signature in database
GPG key ID: 72DB229A64B54E46
4 changed files with 8 additions and 36 deletions

View file

@ -128,8 +128,13 @@ def create_app(conf=None, verbose=0, logfile=None, **kwargs):
SENTRY_AVAILABLE = False
if app.demo:
try:
from .ext.sentry import sentry
sentry.init_app(app, dsn=app.config['BUI_DSN'])
import sentry_sdk
from sentry_sdk.integrations.flask import FlaskIntegration
sentry_sdk.init(
dsn=app.config['BUI_DSN'],
integrations=[FlaskIntegration()]
)
SENTRY_AVAILABLE = True
except ImportError:
pass
@ -425,14 +430,4 @@ def create_app(conf=None, verbose=0, logfile=None, **kwargs):
session_manager.delete_session()
return response
if app.demo and SENTRY_AVAILABLE:
@app.errorhandler(500)
def internal_server_error(error):
from .ext.sentry import sentry
return render_template(
'500_sentry.html',
event_id=g.sentry_event_id,
public_dsn=sentry.client.get_public_dsn('https')
)
return app

View file

@ -1,12 +0,0 @@
# -*- coding: utf8 -*-
"""
.. module:: burpui.ext.sentry
:platform: Unix
:synopsis: Burp-UI external Sentry module.
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
"""
from raven.contrib.flask import Sentry
sentry = Sentry()

View file

@ -1,11 +0,0 @@
<!-- Sentry JS SDK 2.1.+ required -->
<script src="https://cdn.ravenjs.com/2.3.0/raven.min.js"></script>
{% if event_id %}
<script>
Raven.showReportDialog({
eventId: '{{ event_id }}',
dsn: '{{ public_dsn }}'
});
</script>
{% endif %}