From 5659d016863b07ec6e37884b3b0d1cc517e13463 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Thu, 25 Oct 2018 20:49:18 +0100 Subject: [PATCH] Add webhook secret config and logging --- app/config.py | 3 +++ app/server.py | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 app/config.py diff --git a/app/config.py b/app/config.py new file mode 100644 index 0000000..284f54d --- /dev/null +++ b/app/config.py @@ -0,0 +1,3 @@ +import os + +GITHUB_WEBHOOK_SECRET = os.environ.get("GITHUB_WEBHOOK_SECRET") diff --git a/app/server.py b/app/server.py index 097a278..835d569 100644 --- a/app/server.py +++ b/app/server.py @@ -1,9 +1,15 @@ #!/usr/bin/env python3 +import logging + from flask import Flask from github_webhook import Webhook +import config + +logging.basicConfig(level=logging.INFO) + app = Flask(__name__) -webhook = Webhook(app) +webhook = Webhook(app, secret=config.GITHUB_WEBHOOK_SECRET) if __name__ == "__main__": app.run(host="0.0.0.0")