tsuki

tsuki is a captcha service written in go that generates puzzles from vivid/stasis. it has a very simple api, and can be scaled horizontally (if you share your database).

api structure

tsuki has three main endpoints:

/v0/captcha/generate

this endpoint generates a captcha. it accepts GET requests, should be called by the client, and returns json. the json it returns has two keys: id and image. id is the uuid of the captcha, and image is the image that the client should display for the user to solve the captcha.

/v0/captcha/valid

this endpoint checks if a captcha's solution is correct. it accepts POST requests, should be called by the server, and returns a boolean in json. this endpoint takes in a json object with two keys: id and answer. if the captcha was correct, `true` is returned and the captcha is deleted, otherwise `false`.

/v0/images/{id}.png

this endpoint returns an image for a specific captcha. it accepts GET requests, should be called by the client, and returns a png image. this image should be displayed on the client along with a prompt for solving the captcha.

ref

changelog:

https://codeberg.org/sillies/tsuki