Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with gitea after upgrading to gitea version 1.15.0 #262

Open
w41l opened this issue Sep 6, 2021 · 1 comment
Open

Not working with gitea after upgrading to gitea version 1.15.0 #262

w41l opened this issue Sep 6, 2021 · 1 comment

Comments

@w41l
Copy link

w41l commented Sep 6, 2021

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: go-gitea/gitea#11755

It would be nice if GAD can works again with gitea.

@w41l
Copy link
Author

w41l commented Sep 6, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant