mirror of
https://github.com/librecaptcha/lc-core.git
synced 2025-05-24 10:56:08 -04:00
* Migrate to Fibry Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com> * Improve error handling Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com> * Update models and fields Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com> * Enable fibry server Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com> * Update .gitignore Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com> * Convert captcha class to object Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com> * Rollback error handling Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com> * Update models Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com> * Migrate to sun http server Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com> * Refactor: Linter and formatter Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com> * Remove redundant dependancy Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
34 lines
944 B
Scala
34 lines
944 B
Scala
package lc
|
|
|
|
import lc.core.CaptchaProviders
|
|
import lc.server.Server
|
|
import lc.background.BackgroundTask
|
|
import lc.core.Config
|
|
|
|
object LCFramework {
|
|
def main(args: scala.Array[String]): Unit = {
|
|
val backgroundTask = new BackgroundTask(
|
|
throttle = Config.throttle,
|
|
timeLimit = Config.captchaExpiryTimeLimit
|
|
)
|
|
backgroundTask.beginThread(delay = Config.threadDelay)
|
|
val server = new Server(port = Config.port)
|
|
server.start()
|
|
}
|
|
}
|
|
|
|
object MakeSamples {
|
|
def main(args: scala.Array[String]): Unit = {
|
|
val samples = CaptchaProviders.generateChallengeSamples()
|
|
samples.foreach {
|
|
case (key, sample) =>
|
|
val extensionMap = Map("image/png" -> "png", "image/gif" -> "gif")
|
|
println(key + ": " + sample)
|
|
|
|
val outStream = new java.io.FileOutputStream("samples/" + key + "." + extensionMap(sample.contentType))
|
|
outStream.write(sample.content)
|
|
outStream.close
|
|
}
|
|
}
|
|
}
|