Add webhook secret config and logging
This commit is contained in:
parent
08fcf339f1
commit
5659d01686
2 changed files with 10 additions and 1 deletions
3
app/config.py
Normal file
3
app/config.py
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
import os
|
||||||
|
|
||||||
|
GITHUB_WEBHOOK_SECRET = os.environ.get("GITHUB_WEBHOOK_SECRET")
|
|
@ -1,9 +1,15 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
import logging
|
||||||
|
|
||||||
from flask import Flask
|
from flask import Flask
|
||||||
from github_webhook import Webhook
|
from github_webhook import Webhook
|
||||||
|
|
||||||
|
import config
|
||||||
|
|
||||||
|
logging.basicConfig(level=logging.INFO)
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
webhook = Webhook(app)
|
webhook = Webhook(app, secret=config.GITHUB_WEBHOOK_SECRET)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
app.run(host="0.0.0.0")
|
app.run(host="0.0.0.0")
|
||||||
|
|
Reference in a new issue