diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..6789083 --- /dev/null +++ b/README.md @@ -0,0 +1,56 @@ +# 4gCAPTCHA +4gcaptcha is a captcha server based on the one used in [4get](https://git.lolcat.ca/lolcat/4get) + +# Setup +Copy `.env.template` to `.env` and configure the variables accordingly + +- `FONT_PATH` is a path to a `.ttf` file + - The default font is [RedHat Mono Bold](https://github.com/RedHatOfficial/RedHatFont) licensed under OFL-1.1 +- `CAPTCHA_DIR` is a path to a directory of captcha images in the following format: +``` +captcha/ + birds/ + 1.png + 2.png + 3.png + anime/ + 1.png + 2.png +``` + +Requires [ImageMagick](https://imagemagick.org/) +``` +uv sync +uv run server.py +``` + + + +# API + + +## GET `/generate` +Generates a new CAPTCHA +```json +{ + "token": "<uuid>", + "image": "data:image/jpeg;base64,...", + "expires_in": 90 +} +``` + +## POST `/verify` +Check user submitted answers for the provided token. A token expires on failure + +The image grid is by default 4x4 mapped from 0 -> 15 +``` +0,1,2,3 +4,5,6,7 +8,9,10,11 +12,13,14,15 +``` + + +```json +{ "token": "<uuid>", "answers": [0, 3, 9] } +``` |
