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

using reCAPTCHA globally #6818

Closed
2 of 7 tasks
BillSJC opened this issue May 1, 2019 · 1 comment · Fixed by #6820
Closed
2 of 7 tasks

using reCAPTCHA globally #6818

BillSJC opened this issue May 1, 2019 · 1 comment · Fixed by #6820
Labels
type/enhancement An improvement of existing functionality
Milestone

Comments

@BillSJC
Copy link

BillSJC commented May 1, 2019

  • Gitea version (or commit ref): 1.8.0
  • Git version: 2.17.1
  • Operating system: Ubuntu 18.04
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

Thanks for the support of the reCAPTCHA, and i found its config here.

However, here is the problem that some region cannot access google domain google.com(such as China),so the reCAPTCHA cannot be used in these region. Currently I can only disable reCAPTCHA to make the website available for registration.

The official solution is replace www.google.com to www.recaptcha.net (see as recaptcha offical doc can-i-use-recaptcha-globally)

here are the doc

Can I use reCAPTCHA globally?

Yes, please use "www.recaptcha.net" in your code in circumstances when "www.google.com" is not accessible.

First, replace <script src="https://www.google.com/recaptcha/api.js" async defer></script> with <script src="https://www.recaptcha.net/recaptcha/api.js" async defer></script>
After that, apply the same to everywhere else that uses "www.google.com/recaptcha/" on your site.

Possible solution

Maybe a line can be added to the configuration file, such as

;Use www.google.com as default domain
;In some region which cannot access google.com, using www.recaptcha.net to get access
RECAPTCHA_DOMAIN = www.google.com

If u need replace the domain, just change it

;Use www.google.com as default domain
;In some region which cannot access google.com, using www.recaptcha.net to get access
RECAPTCHA_DOMAIN = www.recaptcha.net

Screenshots

@lafriks lafriks added the type/enhancement An improvement of existing functionality label May 1, 2019
jonasfranz added a commit to zeripath/gitea that referenced this issue May 2, 2019
@lafriks lafriks added this to the 1.9.0 milestone May 2, 2019
@BillSJC
Copy link
Author

BillSJC commented Oct 24, 2019

It doesn't seem to been completely resolved

This change do fix the question that user cannot acces js files in some region. However, when i try to verify the whole login process, i found the request domain on gitea SERVER still be www.google.com when js file is from www.recaptcha.net . Then i still FAIL to finish the process.

If it's possible, request domain on gitea server can be configured as same as the js file's domain

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants