diff --git a/requestbin/__init__.py b/requestbin/__init__.py index 4115634..fa12f6c 100644 --- a/requestbin/__init__.py +++ b/requestbin/__init__.py @@ -40,17 +40,18 @@ def callback(status, headers, exc_info=None): app.secret_key = config.FLASK_SESSION_SECRET_KEY app.root_path = os.path.abspath(os.path.dirname(__file__)) -import bugsnag -from bugsnag.flask import handle_exceptions -bugsnag.configure( - api_key="58db8ba0ea5f19fa6dae397cba8e7900", - project_root=app.root_path, - # 'production' is a magic string for bugsnag, rest are arbitrary - release_stage = config.REALM.replace("prod", "production"), - notify_release_stages=["production", "test"], - use_ssl = True -) -handle_exceptions(app) +if config.BUGSNAG_KEY: + import bugsnag + from bugsnag.flask import handle_exceptions + bugsnag.configure( + api_key=config.BUGSNAG_KEY, + project_root=app.root_path, + # 'production' is a magic string for bugsnag, rest are arbitrary + release_stage = config.REALM.replace("prod", "production"), + notify_release_stages=["production", "test"], + use_ssl = True + ) + handle_exceptions(app) from filters import * app.jinja_env.filters['status_class'] = status_class diff --git a/requestbin/config.py b/requestbin/config.py index 7760135..75a3632 100644 --- a/requestbin/config.py +++ b/requestbin/config.py @@ -23,6 +23,8 @@ REDIS_PREFIX = "requestbin" +BUGSNAG_KEY = "" + if REALM == 'prod': DEBUG = True ROOT_URL = "http://requestb.in" @@ -38,6 +40,8 @@ REDIS_PASSWORD = url_parts.password REDIS_DB = url_parts.fragment + BUGSNAG_KEY = os.environ.get("BUGSNAG_KEY", BUGSNAG_KEY) + IGNORE_HEADERS = """ X-Varnish X-Forwarded-For