Thomas Lynch
353926f44d
fix captcha tests, update to support new captchaOptions format with font
2 years ago
Thomas Lynch
0fc87e752d
make captcha font apply to text AND grid
...
set a new default font which is common on linux, in debian repos, and has the chess characters
remove 24MB font file that came from i dont even remember where
2 years ago
Thomas Lynch
ff7db40f42
make font size of grid captcha scale roughly to the current ratio of 20-30:120
2 years ago
Thomas Lynch
fb5b9ddb1f
write the captchas to tmp in tests ref #469 !258
2 years ago
Thomas Lynch
fb57aa6fd5
Add captcha generators tests (doesnt write them to disk, but runs the generator function for catching issues like !255 ref #469
2 years ago
Thomas Lynch
b1751f1706
allow grid captcha yIconOffset=0
2 years ago
Thomas Lynch
06828da6c0
Refactor captcha generators and captcha model
...
Generators changes:
- take captchaoptions as argument, so no longer require config.get or captchas db imports
- return the captcha object (gm instance) and solution (whatever).
The model itself inserts the solution to db, gets captchaid for filename and cookie, and writes the image to disk.
Slightly cleaner imo, and makes the captcha generators more testable without requiring any mocking for DB/config.
2 years ago
Thomas Lynch
f0ae0691a4
Remove duplicate call to randomof and setting characters
...
Remove debug
ref #469
2 years ago
Thomas Lynch
c969814f54
First version of grid v2
2 years ago
Thomas Lynch
6e80af2eec
Fix another non integer argument to randomrange :^)
2 years ago
Thomas Lynch
8f74885ba2
Add noise and paint slider options to grid captcha
2 years ago
Thomas Lynch
6ec6b32ed5
Change "wave" and "paint" text effect captcha options from toggle to slider
...
Add "noise" text captcha effect slider
Add font lib to get list of system fonts
Add "font" text captcha option
ref #469
2 years ago
Thomas Lynch
c8ebf9a579
Improvement to grid v1 to allow customising, allowing for something like this.
...
-true characters
-false characters
-question text
Make optional (and add additional options for) some filters/effects
-paint
-line
-wave
2 years ago
Thomas Lynch
cc21f9390f
Replace randomRange with native crypto.randomInt close #464
...
Cleanup the captcha generators a bit, add comments, refactor duplicate getting distortions code to separate file.
2 years ago
Thomas Lynch
36ed7a8fc4
Update some scoped packages and switch to using published npm rather than off git+https to gitgud
2 years ago
Thomas Lynch
e047782249
eslint lib, migrations, db, models, test, schedules and root dir
2 years ago
Thomas Lynch
bb582c2de8
"helpers" -> "lib
...
god help anybody who gets serious merge conflicts from this
close #434
2 years ago
Thomas Lynch
4f525b6613
move, rename, reorganise "helpers" => "lib"
2 years ago