A simple CAPTCHA service implementation.
Go to file
2022-08-19 02:09:01 +04:00
bin Initial commit with a fully working program, lel. 2022-06-24 23:09:46 +04:00
build/archlinux A version increased to 1.1.1. And a version now is being passed from ldflags in a Makefile. 2022-08-17 21:49:57 +04:00
cmd/justcaptchad A version increased to 1.1.1. And a version now is being passed from ldflags in a Makefile. 2022-08-17 21:49:57 +04:00
init/systemd Changed a description in systemd service file. 2022-08-17 21:53:31 +04:00
internal captchaDb is now of type CaptchaDB interface. Use a constructor for InMemoryCaptchaDB. 2022-08-19 02:09:01 +04:00
pkg Image now passed by a pointer instead of value. Hope it will help with memory consumption a little. 2022-08-17 21:47:27 +04:00
.gitignore Initial commit with a fully working program, lel. 2022-06-24 23:09:46 +04:00
go.mod Removed unneded dependency on github.com/pkg/errors. 2022-06-26 23:24:10 +04:00
go.sum Removed unneded dependency on github.com/pkg/errors. 2022-06-26 23:24:10 +04:00
LICENSE Initial commit with a fully working program, lel. 2022-06-24 23:09:46 +04:00
Makefile A version increased to 1.1.1. And a version now is being passed from ldflags in a Makefile. 2022-08-17 21:49:57 +04:00
README.md A version increased to 1.1.1. And a version now is being passed from ldflags in a Makefile. 2022-08-17 21:49:57 +04:00

justcaptcha ver. 1.1.1

A simple CAPTCHA service implementation.

Usage

justcaptchad -expiry 5m -listen /var/run/justcaptchad/j.sock

-expiry takes time for CAPTCHA to be valid for in format XX{s,m,h}.

-listen is ip:port or /path/to/unix.sock to listen on.

API

Get a new captcha

GET /

It will return an ID of a new captcha in plaintext.

HTTP codes

  • 200 if created

Get an image for a captcha

GET /:captcha_id/image?style=

Responds with an image (e.g. in PNG format).

An optional query parameter style= could be supplied if captcha implementation support different styles.

HTTP codes

  • 200 if exists
  • 404 if doesn't exist
  • 500 if for some reason Image wasn't created

Submit an answer

POST /:captcha_id

It takes one form-data parameter answer=123456.

Responds with empty body and one of HTTP codes.

HTTP codes

  • 200 if solved
  • 403 if not solved
  • 404 if doesn't exist

Check if captcha is solved

GET /:captcha_id

Responds with empty body and one of HTTP codes.

HTTP codes

  • 200 if solved
  • 403 if not solved
  • 404 if doesn't exist