Integrate with mCaptcha
- There's a deep motivation for this pull request that requires some explanation(feel free to skip reading this). In recent events, it was once again pointed out that Codeberg is using a captcha that isn't accessible to blind and visually impaired people, currently Gitea doesn't offer a captcha that is accessible to those kind of people. After a public meeting was hold by Codeberg to discuss the issue and look into solutions, I came to a conclusion that mCaptcha is a good solution to solve Codeberg's accessibility problem. So therefor this PR.
- This PR adds a fourth captcha type, mCaptcha. It uses a small library to interact with the mCaptcha instance. The javascript code uses the official glue code (vanilla-variant) provided by mCaptcha themselves. The remaining code is basically boilerplate that also exists for the other captchas.
I don't understand though... I thought the point of mCaptcha was that it was supposed to be a drop-in replacement for recaptcha/hcaptcha?
Can't you just put an mCaptcha url in as the recaptcha url?
xCaptcha drop-in replacement
Already using a captcha solution? No worries, our APIs are compatible with reCaptcha and hCaptcha!
If not can we change our recaptcha and/or hcaptcha modules to make them a little more configurable so that they could handle mCaptcha or whatever other captcha solution comes in the future?
I don't understand though... I thought the point of mCaptcha was that it was supposed to be a drop-in replacement for recaptcha/hcaptcha?
Can't you just put an mCaptcha url in as the recaptcha url?
xCaptcha drop-in replacement
Already using a captcha solution? No worries, our APIs are compatible with reCaptcha and hCaptcha!
The website is out of date. I started out with the goal of building an identitical interface but hCaptcha and reCAPTCHA APIs have attributes that are irrelevant for mCaptcha.
Current interface is similar but not identitical. Will update the website this week.
Codecov Report
:exclamation: No coverage uploaded for pull request base (
main@eaf653f). Click here to learn what that means. The diff coverage is18.42%.
:exclamation: Current head f4e417b differs from pull request most recent head 4ea9eb4. Consider uploading reports for the commit 4ea9eb4 to get more accurate results
@@ Coverage Diff @@
## main #20458 +/- ##
=======================================
Coverage ? 46.64%
=======================================
Files ? 979
Lines ? 135514
Branches ? 0
=======================================
Hits ? 63216
Misses ? 64553
Partials ? 7745
| Impacted Files | Coverage Δ | |
|---|---|---|
| modules/mcaptcha/mcaptcha.go | 0.00% <0.00%> (ø) |
|
| modules/setting/setting.go | 48.46% <ø> (ø) |
|
| routers/web/auth/linkaccount.go | 0.00% <0.00%> (ø) |
|
| routers/web/auth/openid.go | 0.00% <0.00%> (ø) |
|
| services/forms/user_form.go | 45.36% <ø> (ø) |
|
| services/forms/user_form_auth_openid.go | 0.00% <ø> (ø) |
|
| routers/web/auth/auth.go | 27.16% <66.66%> (ø) |
|
| modules/setting/service.go | 72.54% <100.00%> (ø) |
Help us with your feedback. Take ten seconds to tell us how you rate us.
Blocking, due to fixed width, this doesn't work great on mobile.
Blocked by https://github.com/mCaptcha/glue/pull/12 & https://github.com/mCaptcha/mCaptcha/pull/35
PRs are merged on mCaptcha. https://github.com/go-gitea/gitea/pull/20458/commits/c866103203575c193fdfb3095b55a8c3a83f2073 + https://github.com/go-gitea/gitea/pull/20458/commits/0789b3311d8ea1cdb768efa13a6ee050d76fbf1d fixes the issue on mobile.