Closed beeb closed 1 year ago
First time I write elixir, it's probably not great, comments are welcome!
Thanks for the very insightful comments! I went through and fixed the code accordingly.
@wmnnd let me know if anything else is needed for this to be merged. Thanks
How can I try this patch if I'm using docker version of Keila?
Sorry because my 'noobish' question but that will be my first time doing that way (privacy always matters for us) :)
Hey @beeb, thanks again for contributing this PR and for implementing the changes I proposed in my review. I have changed some things around a little bit to keep all captcha-related logic in the captcha module. Other than that, great job!
If you want, it would be great if you could also update the website docs at https://github.com/pentacent/keila-web to make sure the new way of configuring captchas is visible to everyone :smiley:
FriendlyCaptcha is a nice and privacy-preserving alternative to hCaptcha that doesn't require tedious actions by the user.
This PR adds support for FriendlyCaptcha as an alternative to hCaptcha. The choice is done with a new variable
CAPTCHA_PROVIDER
with valueshcatpcha
(default) andfriendly_captcha
being acceptable.All references to hCaptcha have been renamed to Captcha where relevant. Notably, the following environment variables should be used for configuration:
CAPTCHA_PROVIDER
CAPTCHA_SITE_KEY
CAPTCHA_SECRET_KEY
CAPTCHA_URL
For backwards compatiblity, the current variables (
HCAPTCHA_SITE_KEY
, etc) are checked in case the above variants are not provided.Documentation should probably be updated to reflect this. The default value for the API url when using FriendlyCaptcha is
https://api.friendlycaptcha.com/api/v1/siteverify
.This PR closes https://github.com/pentacent/keila/issues/205