Sunday, May 07, 2017

No site key specified. recaptcha rails

In recaptcha gem version 3.3.0, the credential names was:

RECAPTCHA_PRIVATE_KEY
RECAPTCHA_PUBLIC_KEY

In recaptcha gem version 4.3.1, they are called:

export RECAPTCHA_SITE_KEY= '6Lc6BAAAAAAAAChqRbQZcn_yyyyyyyyyyyyyyyyy'
export RECAPTCHA_SECRET_KEY='6Lc6BAAAAAAAAKN3DRm6VA_xxxxxxxxxxxxxxxxx'

So:

RECAPTCHA_PUBLIC_KEY is now called RECAPTCHA_SITE_KEY and RECAPTCHA_PRIVATE_KEY is now called RECAPTCHA_SECRET_KEY.

You can set these environment variables in the .profile file in the home folder of your production server.

Since the recaptcha gem does not have any release notes, you have to compare different releases and look at the diff:

https://github.com/ambethia/recaptcha/compare/v3.4.0...v4.0.0

Comparing different versions I created a release notes on the wiki:

  • 4.0.0 : Name of the credentials environment variable names changed
  • 4.1.0 : Add Invisible reCAPTCHA implementation feature
  • 4.2.0 : Make URLs configurable
  • 4.3.0 : Allow random attributes to be rendered for invisible captcha button
  • 4.3.1 : Add site key back to data attributes