Skip to content

Commit 9dd3d15

Browse files
committed
Changes to webhooks
1 parent 406ee36 commit 9dd3d15

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

config.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"github_ips_only": false,
3+
"enforce_secret": "7dff20e9837781425f1f2ffeee8653cbd78c1dfd401e841d",
4+
"return_scripts_info": true
5+
}

webhooks.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
application = Flask(__name__)
3636

3737

38-
@application.route('/', methods=['GET', 'POST'])
38+
@application.route('/gh_webhook/', methods=['GET', 'POST'])
3939
def index():
4040
"""
4141
Main WSGI application entry.
@@ -79,7 +79,7 @@ def index():
7979
abort(501)
8080

8181
# HMAC requires the key to be bytes, but data is string
82-
mac = hmac.new(str(secret), msg=request.data, digestmod='sha1')
82+
mac = hmac.new(str(secret), msg=request.data, digestmod=sha1)
8383

8484
# Python prior to 2.7.7 does not have hmac.compare_digest
8585
if hexversion >= 0x020707F0:
@@ -200,4 +200,4 @@ def index():
200200

201201

202202
if __name__ == '__main__':
203-
application.run(debug=True, host='0.0.0.0')
203+
application.run(debug=True, host='127.0.0.1', port=7777)

wsgi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from webhooks import application
22

33
if __name__ == "__main__":
4-
application.run(debug=False, host='0.0.0.0')
4+
application.run(debug=True, host='127.0.0.1')

0 commit comments

Comments
 (0)