mirror of
https://github.com/YunoHost/webhooks.git
synced 2024-09-03 19:56:54 +02:00
[mod] load secret on startup to avoid runtime error
This commit is contained in:
parent
acf2c52d7f
commit
e56e285e54
1 changed files with 2 additions and 2 deletions
|
@ -8,6 +8,8 @@ from sanic.exceptions import abort
|
|||
|
||||
app = Sanic()
|
||||
|
||||
secret = open("./github_webhook_secret", "r").read().strip()
|
||||
|
||||
other_chans = {
|
||||
"doc": "doc",
|
||||
}
|
||||
|
@ -25,8 +27,6 @@ def notify(message, chan="dev"):
|
|||
|
||||
@app.route("/github", methods=['POST'])
|
||||
async def github(request):
|
||||
secret = open("./github_webhook_secret", "r").read().strip()
|
||||
|
||||
# Only SHA1 is supported
|
||||
header_signature = request.headers.get('X-Hub-Signature')
|
||||
if header_signature is None:
|
||||
|
|
Loading…
Add table
Reference in a new issue