From 1f7ddcdb330127f312bfd63f5a14603fee2927c2 Mon Sep 17 00:00:00 2001 From: redfast00 Date: Wed, 26 Jan 2022 07:51:33 +0100 Subject: [PATCH] Rip out Airbrake --- app/app.py | 25 ------------------------- app/config.example.py | 2 -- first-setup.sh | 8 -------- 3 files changed, 35 deletions(-) diff --git a/app/app.py b/app/app.py index 1070142..d1abfbc 100755 --- a/app/app.py +++ b/app/app.py @@ -6,10 +6,6 @@ from logging.handlers import TimedRotatingFileHandler import typing from datetime import datetime -try: - import airbrake -except ImportError: - airbrake = None from flask import Flask, render_template from flask_bootstrap import Bootstrap, StaticCDN from flask_debugtoolbar import DebugToolbarExtension @@ -28,7 +24,6 @@ from zeus import init_oauth def register_plugins(app: Flask) -> Manager: - "Register Airbrake and logrotation plugins" # pylint: disable=W0612 if not app.debug: timedFileHandler = TimedRotatingFileHandler( @@ -41,26 +36,6 @@ def register_plugins(app: Flask) -> Manager: loglogger.addHandler(timedFileHandler) app.logger.addHandler(timedFileHandler) - if app.config["AIRBRAKE_ID"]: - if airbrake is None: - raise Exception( - "Airbrake support was requested (AIRBRAKE_ID is present in config), " - "but could not import airbrake. Make sure `airbrake` is installed" - ) - - airbrakelogger = logging.getLogger("airbrake") - - airbrake_obj = airbrake.Airbrake( - project_id=app.config["AIRBRAKE_ID"], api_key=app.config["AIRBRAKE_KEY"] - ) - # Change URL in a hacky way to make this work for our errbit - airbrake_obj._api_url = "http://errbit.awesomepeople.tv/api/v3/projects/{}/notices".format( # pylint: disable=protected-access - airbrake_obj.project_id - ) - - airbrakelogger.addHandler(airbrake.AirbrakeHandler(airbrake=airbrake_obj)) - app.logger.addHandler(airbrake.AirbrakeHandler(airbrake=airbrake_obj)) - # Initialize SQLAlchemy db.init_app(app) diff --git a/app/config.example.py b/app/config.example.py index ea5a560..191ce24 100644 --- a/app/config.example.py +++ b/app/config.example.py @@ -13,5 +13,3 @@ class Configuration: LOGFILE = "haldis.log" ZEUS_KEY = "tomtest" ZEUS_SECRET = "blargh" - AIRBRAKE_ID = "" - AIRBRAKE_KEY = "" diff --git a/first-setup.sh b/first-setup.sh index 31e4c47..dbb4155 100755 --- a/first-setup.sh +++ b/first-setup.sh @@ -22,14 +22,6 @@ pip install pip-tools echo -e "${B} Downloading dependencies ${E}" pip-sync -echo -en "${B} Do you want to install support for the Airbrake API for error logging? If you don't have an Errbit server or Airbrake account, answer no. (y/N) ${E}" -read confirm -if [ "$confirm" = y ]; then - pip install airbrake -else - echo "Not installing airbrake" -fi - if [ ! -f app/config.py ]; then echo -e "${B} Copying config template. All custom config options can be set in the config.py file ${E}" cp app/config.example.py app/config.py