def configure_app(app, archive, debug):
app.debug = debug
if app.debug:
print("WARNING: DEBUG MODE IS ENABLED!")
app.config["PROPAGATE_EXCEPTIONS"] = True
path = extract_archive(archive)
user_data = get_users(path)
channel_data = get_channels(path)
channels = compile_channels(path, user_data, channel_data)
top = flask._app_ctx_stack
top.channels = channels