Rip out Airbrake

This commit is contained in:
redfast00 2022-01-26 07:51:33 +01:00
parent 36b55c5171
commit 1f7ddcdb33
No known key found for this signature in database
GPG key ID: 5946E0E34FD0553C
3 changed files with 0 additions and 35 deletions

View file

@ -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)

View file

@ -13,5 +13,3 @@ class Configuration:
LOGFILE = "haldis.log"
ZEUS_KEY = "tomtest"
ZEUS_SECRET = "blargh"
AIRBRAKE_ID = ""
AIRBRAKE_KEY = ""

View file

@ -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