This repo provides the endpoint for user registration. If the more then 3 user tries to register from the same IP, then the google recaptcha will be shown to end user. Once the user verify the captcha and submit the registration detials, the reponse of the captcha will be verified against the google site verification endpoint. Local cache is used for storing the no of registration against any client IP address which can be replaced via some more robost caching backend like redis or memcache. The validity of the cache is set as 1 day by default.
- python3
- mongodb
- flask
- pymongo
- click
- requests
- flask-caching (redis-optional)
-
Clone the repo to your local system
git clone https://github.com/manassolanki/captcha.git
-
Install the dependancy using the pipenv
pipenv install
-
Export the environment variables
export FLASK_APP=captcha
export SECRET_KEY=<some-secret-key>
export DATABASE=<database-uri>
export SITE_SECRET=<site-secret-for-recaptcha-verification>
-
Run the flask server
flask run