Git-Auto-Deploy
Git-Auto-Deploy copied to clipboard
Not working with gitea after upgrading to gitea version 1.15.0
Gitea has deprecated plaintext secret in webhook payload in version 1.15.0 and now I had to disabled secret-token in repository configuration
Error log
2021-09-06 10:38:55,260 [ERROR] File "/usr/lib64/python3.9/site-packages/gitautodeploy/parsers/github.py", line 37, in validate_request
2021-09-06 10:38:55,260 [ERROR] if not self.verify_signature(repo_config['secret-token'], request_body, request_headers['x-hub-signature']):
2021-09-06 10:38:55,260 [ERROR]
2021-09-06 10:38:55,260 [ERROR] File "/usr/lib64/python3.9/site-packages/gitautodeploy/parsers/github.py", line 47, in verify_signature
2021-09-06 10:38:55,260 [ERROR] result = "sha1=" + hmac.new(str(token), body, hashlib.sha1).hexdigest()
2021-09-06 10:38:55,261 [ERROR]
2021-09-06 10:38:55,261 [ERROR] File "/usr/lib64/python3.9/hmac.py", line 170, in new
2021-09-06 10:38:55,261 [ERROR] return HMAC(key, msg, digestmod)
2021-09-06 10:38:55,261 [ERROR]
2021-09-06 10:38:55,261 [ERROR] File "/usr/lib64/python3.9/hmac.py", line 53, in __init__
2021-09-06 10:38:55,261 [ERROR] raise TypeError("key: expected bytes or bytearray, but got %r" % type(key).__name__)
2021-09-06 10:38:55,261 [ERROR]
2021-09-06 10:38:55,261 [ERROR] TypeError: key: expected bytes or bytearray, but got 'str'
Gitea issue url: https://github.com/go-gitea/gitea/issues/11755
It would be nice if GAD can works again with gitea.
Workaround: Change x-hub-signature
to X-Hub-Signature
in https://github.com/olipo186/Git-Auto-Deploy/blob/master/gitautodeploy/parsers/github.py fix the problem