OpenSourceBrain / redmine

This is a customised version of redmine for the Open Source Brain website
http://www.opensourcebrain.org
5 stars 3 forks source link

Disable reCaptcha if redmine is installed locally with docker-compose for testing #326

Closed pgleeson closed 3 years ago

pgleeson commented 4 years ago

So that test users can be registered.

@zsinnema found this also. @sanjayankur31 will look into this

sanjayankur31 commented 4 years ago

@pgleeson @zsinnema: could you give me steps to reproduce this issue when you have a minute please?

pgleeson commented 4 years ago

Go to http://localhost:10083/account/register, try to register and you'll get an error with recaptcha:

Screenshot 2020-05-19 at 14 09 14

So you could check is localhost is in the hostname, and if so, don't show the recaptch, but let anyone register (for testing).

sanjayankur31 commented 4 years ago

It's simpler to add "localhost" to the list of supported domains, and set up a different key for the captcha for this:

https://developers.google.com/recaptcha/docs/faq#localhost_support

There's no documentation on the plugin in use about disabling the plugin for a particular origin, so disabling it for localhost is not trivial in the redmine code.

sanjayankur31 commented 3 years ago

Found an easier workaround:

https://developers.google.com/recaptcha/docs/faq#id-like-to-run-automated-tests-with-recaptcha.-what-should-i-do

There are keys mentioned there that will allow all verifications to proceed. Works well for localhost:

Site key: 6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI
Secret key: 6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe

Closing.

pgleeson commented 3 years ago

Great, thanks!