Kruhlmann / gatekeeper

Fight club CAPTCHA bot
GNU General Public License v3.0
1 stars 4 forks source link

Database solution #11

Closed Kruhlmann closed 4 years ago

Kruhlmann commented 4 years ago

My thoughts are increasingly that this project needs a database since it's deviated somewhat from the initial idea.

One option is sqlite3, which is used in the classicdb_bot project and has usable code examples and migrations. This solution is significantly easier to implement but scales extremely poorly, which might not be a huge issue. Alternatively for a more scalable solution postgres could be used.

Discord user IDs could be stored with their cool down and there would no longer be a need to keep a hashed version of the answers with the actual captcha message. Instead this could be stored in the database.

Kruhlmann commented 4 years ago

gatekeeper.captchas

id user_id answer sent
INT or UUID STRING STRING DATETIME
Kruhlmann commented 4 years ago

image

It seems postgres 12 does not support my virtual machine architecture, so might have to settle for a lower version like 10 if sqlite isn't used instead.

Kruhlmann commented 4 years ago

Looks like postgres 11 is avaliable, which should serve the project well potentially together with https://github.com/salsita/node-pg-migrate for migration handling.

Kruhlmann commented 4 years ago

19 Now implements node-pg-migrate and has a working initial migration.

Kruhlmann commented 4 years ago

20 Now implements basic database connection