|
@@ -11,7 +11,7 @@ from flask import jsonify, abort, request
|
|
|
from app import app
|
|
|
|
|
|
|
|
|
-secret = "JdFILOA1O7x6WTcsphlszmeQqU5ngoKZ"
|
|
|
+secret = 'JdFILOA1O7x6WTcsphlszmeQqU5ngoKZ'
|
|
|
|
|
|
|
|
|
@app.route('/')
|
|
@@ -24,11 +24,11 @@ def index():
|
|
|
def deploy():
|
|
|
"""Run deploy script"""
|
|
|
digest = hmac.new(secret, request.data, hashlib.sha1).hexdigest()
|
|
|
- signature = request.headers['X-Hub-Signature'].split('=', 1)
|
|
|
+ signature = request.headers['X-Gogs-Signature'].split('=', 1)
|
|
|
if (len(signature) < 2 or signature[0] != 'sha1'
|
|
|
or not hmac.compare_digest(signature[1], digest)):
|
|
|
abort(400, 'Invalid signature')
|
|
|
|
|
|
- call(["git", "pull"])
|
|
|
- call(["touch", "flask.wsgi"])
|
|
|
+ call(['git', 'pull'])
|
|
|
+ call(['touch', 'flask.wsgi'])
|
|
|
return jsonify(True)
|