improve firewall

pull/83/head
Thibault Duplessis 2012-09-20 18:33:33 +02:00
parent 2925b4138f
commit 3c9252d0a5
3 changed files with 9 additions and 1 deletions

View File

@ -68,7 +68,7 @@ trait AuthImpl {
protected def restoreUser(req: RequestHeader): Option[User] = for {
sessionId req.session.get("sessionId")
if env.security.firewall accepts req
if env.security.firewall acceptsOrLog req
username env.security.store.getUsername(sessionId)
user (env.user.userRepo byId username).unsafePerformIO
} yield user

View File

@ -37,6 +37,13 @@ final class Firewall(
def accepts(req: RequestHeader): Boolean = !blocks(req)
def acceptsOrLog(req: RequestHeader): Boolean =
if (accepts(req)) true
else {
logBlock(req)
false
}
def refresh { ips = fetch }
def blockIp(ip: String) {

1
todo
View File

@ -52,3 +52,4 @@ send lobby new forum posts html through websockets
in table, hide lichess_control when it's empty (watcher mode)
BUG tournament idle resign: based on 20 seconds added time! can make black resign by playing after 19s
tournament join, sometimes withdraws by cron
tournament: no cheater