Commit Graph

149 Commits

Author SHA1 Message Date
hrj
d797acdcac FilterChallenge: adjust difficult based on parameter 2022-04-02 23:07:38 +05:30
hrj
cc8addb0c7 filter challenge: scale font height based on image size 2022-04-02 22:51:45 +05:30
hrj
d7c1f9a4cc handle exceptions thrown by captcha provider 2022-04-02 22:51:19 +05:30
hrj
4f3bec0bc6 each challenge provider now respects the size parameter when construction image 2022-03-01 23:03:43 +05:30
hrj
edd211fb52 respect size and level parameters
* Add size and level parameters to ChallengeProvider.returnChallenge()
* Add size column to challenge table
* Pass size and level parameters to all relevant calls
* Add size field to demo app
2022-03-01 22:51:38 +05:30
hrj
f0659da3eb add a welcome message to root path 2022-03-01 19:11:13 +05:30
hrj
c8db914cfd minor simplification 2022-03-01 17:21:30 +05:30
hrj
a54947cfc2 shutdown server gracefully 2022-03-01 13:23:29 +05:30
hrj
cb0c244779 in background task, divide total required by number of combinations, and create in multiple iterations
Signed-off-by: hrj <harshad.rj@gmail.com>
2022-03-01 09:37:33 +05:30
hrj
8316084ee7 create equal number of captchas for each parameter combination in background task
Signed-off-by: hrj <harshad.rj@gmail.com>
2022-03-01 09:37:33 +05:30
hrj
e44a1df22e select random captchas
Signed-off-by: hrj <harshad.rj@gmail.com>
2022-03-01 09:37:33 +05:30
hrj
52b071d680 renamed Captcha to CaptchaManager
Signed-off-by: hrj <harshad.rj@gmail.com>
2022-02-24 20:12:58 +05:30
hrj
497b88f0d3 simplify logic for background task
Signed-off-by: hrj <harshad.rj@gmail.com>
2022-02-24 20:12:58 +05:30
Scala Steward
dbe0692b8b Reformat with scalafmt 3.3.2 2022-01-20 05:36:07 +01:00
Rahul Rudragoudar
5072926bfc Refactor: lambda to fn
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2022-01-09 22:34:33 +05:30
Rahul Rudragoudar
d5cf860629 Extract and read from configField case class
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2022-01-09 21:37:13 +05:30
Rahul Rudragoudar
8e66f3fa8e WIP: Add config case class to avoid type change
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2022-01-09 01:18:33 +05:30
Rahul Rudragoudar
fabd5dd7ec Convert playgroundEnabled: bool to string
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2022-01-08 02:16:03 +05:30
Rahul Rudragoudar
8e39505644 Make config parameters optional with defaults
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2022-01-08 01:59:22 +05:30
hrj
3e99c0d38b update to scala 3
Signed-off-by: hrj <harshad.rj@gmail.com>
2022-01-03 18:56:06 +05:30
Rahul Rudragoudar
5e15ca6c35 Improve imports
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2021-12-26 22:04:02 +05:30
Rahul Rudragoudar
632eb49fd3 Add config option for maxAttempts field
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2021-12-26 22:04:02 +05:30
Scala Steward
f463b487eb Reformat with scalafmt 3.0.8 2021-12-15 22:54:41 +01:00
hrj
51a1f0a710 update h2 to 2.0.202
Note that this version is NOT backwards compatible with 1.x version

Hence, we use a new DB path "captcha2". The contents in the old DB can be reused
by following instructions in
https://github.com/h2database/h2database/releases/tag/version-2.0.202
2021-12-10 00:01:35 +05:30
jacobp
99ee7c55b5 Added configuration to disable serving the playground webpage and configuration to set Access-Control-Allow-Origin header value on responses.
Signed-off-by: JacobPozaic <jacobpozaic@gmail.com>
2021-12-09 11:02:43 -05:00
hrj
8f606da92f Merge pull request #96 from rr83019/image-dpi
Set Image DPI for captcha providers
2021-09-02 16:37:00 +05:30
Rahul Rudragoudar
b46f6795ce Set DPI for FilterCaptcha provider
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2021-09-02 14:53:58 +05:30
Rahul Rudragoudar
f83289514b Rename DPISetter to PngImageWritter
Make fn static

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2021-09-01 22:57:26 +05:30
Rahul Rudragoudar
26d86bca4c Set DPI for captcha providers
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2021-08-31 15:43:58 +05:30
vinceh121
bbe7c8b858 Log listen address
Signed-off-by: vinceh121 <contact@vinceh121.me>
2021-05-19 14:32:06 +02:00
vinceh121
b5a33d2e42 Listen address in config
Signed-off-by: vinceh121 <contact@vinceh121.me>
2021-05-19 14:32:02 +02:00
Rahul Rudragoudar
ecff4087ad Convert objects to classes
Update references

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2021-05-02 16:58:14 +05:30
Rahul Rudragoudar
6f38a77c2f Support to specify config file
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2021-05-02 16:57:12 +05:30
Rahul Rudragoudar
04755c0a07 Add method to set seed
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2021-04-24 20:44:20 +05:30
Rahul Rudragoudar
30bb26473e Update random generator reference
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2021-04-24 19:37:44 +05:30
Rahul Rudragoudar
0d33f51f9e Move random number generator to HelperFunctions
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2021-04-24 19:36:48 +05:30
Rahul Rudragoudar
d62951fa51 Minor fix
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2021-04-21 14:56:58 +05:30
Rahul Rudragoudar
aa5e7da0bc Merge branch 'BT-captcha' of github.com:rr83019/lc-core into BT-captcha 2021-04-21 14:45:42 +05:30
Rahul Rudragoudar
e38c3b680a Reformat:Scalafmt
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2021-04-21 14:43:00 +05:30
Rahul Rudragoudar
98c304ccd4 Pick a random captcha provider instead of params
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2021-04-21 14:39:20 +05:30
Rahul Rudragoudar
241be1631c Minor fix
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2021-04-21 13:53:35 +05:30
Rahul Rudragoudar
8f0f29c579 Minor fix
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2021-04-20 13:53:08 +05:30
Rahul Rudragoudar
3682b2cb7d Randomize captcha generation
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2021-04-20 03:06:47 +05:30
Rahul Rudragoudar
ef31ee8a57 Move random number generator to config
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
2021-04-20 03:05:13 +05:30
hrj
c362ed5cb0 renamed GifCaptcha to PoppingCharactersCaptcha 2021-04-19 17:26:09 +05:30
hrj
d2ef8c5259 Use port number from config file (fixes regression)
Signed-off-by: hrj <harshad.rj@gmail.com>
2021-04-19 15:13:52 +05:30
hrj
46012b2ce3 default config: randomize seed used by randomizer
Signed-off-by: hrj <harshad.rj@gmail.com>
2021-04-19 13:29:41 +05:30
hrj
523805263a Default config: larger throttle setting
Signed-off-by: hrj <harshad.rj@gmail.com>
2021-04-19 13:29:15 +05:30
hrj
6189ffce89 add a simple browser based demo
Signed-off-by: hrj <harshad.rj@gmail.com>
2021-04-19 13:14:36 +05:30
hrj
2885decb56 ensure fresh captchas are served by sorting on attempted
Signed-off-by: hrj <harshad.rj@gmail.com>
2021-04-19 09:26:49 +05:30