diff --git a/app.py b/app.py index 768e80e..9b011a1 100755 --- a/app.py +++ b/app.py @@ -26,7 +26,7 @@ gerrit = GerritServer(app.config['GERRIT_URL']) extras_data = json.loads(open(app.config['EXTRAS_BLOB'], "r").read()) - +blacklist = json.loads(open(app.config['BLACKLIST'], 'r').read()) ########################## # Metrics! ########################## @@ -151,6 +151,8 @@ def get_device_version(device): #cached via memoize on get_build_types def index(device, romtype, incrementalversion): #pylint: disable=unused-argument + if incrementalversion in blacklist: + return jsonify({'response': []}) after = request.args.get("after") version = request.args.get("version") diff --git a/blacklist.json b/blacklist.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/blacklist.json @@ -0,0 +1 @@ +[] diff --git a/config.py b/config.py index 0e5a393..e212e37 100644 --- a/config.py +++ b/config.py @@ -12,3 +12,4 @@ class Config(object): UPSTREAM_URL = os.environ.get('UPSTREAM_URL', '') DOWNLOAD_BASE_URL = os.environ.get('DOWNLOAD_BASE_URL', 'https://mirrorbits.lineageos.org') EXTRAS_BLOB = os.environ.get('EXTRAS_BLOB', 'extras.json') + BLACKLIST = os.environ.get('BLACKLIST', 'blacklist.json')