disable geoip by default
parent
3d6bdfb159
commit
7af2b5a206
|
@ -184,7 +184,7 @@ bookmark {
|
|||
actor.name = bookmark
|
||||
}
|
||||
geoip {
|
||||
file = "data/GeoLite2-City.mmdb"
|
||||
file = ""
|
||||
cache_ttl = 20 minutes
|
||||
}
|
||||
security {
|
||||
|
|
|
@ -10,14 +10,16 @@ import lila.common.IpAddress
|
|||
final class GeoIP(config: GeoIP.Config) {
|
||||
|
||||
private lazy val geoIp: Option[MaxMindIpGeo] =
|
||||
try {
|
||||
val m = MaxMindIpGeo(config.file, 0)
|
||||
logger.info("MaxMindIpGeo is enabled")
|
||||
m.some
|
||||
} catch {
|
||||
case e: java.io.FileNotFoundException =>
|
||||
logger.info(s"MaxMindIpGeo is disabled: $e")
|
||||
none
|
||||
config.file.nonEmpty ?? {
|
||||
try {
|
||||
val m = MaxMindIpGeo(config.file, 0)
|
||||
logger.info("MaxMindIpGeo is enabled")
|
||||
m.some
|
||||
} catch {
|
||||
case e: java.io.FileNotFoundException =>
|
||||
logger.info(s"MaxMindIpGeo is disabled: $e")
|
||||
none
|
||||
}
|
||||
}
|
||||
|
||||
private val cache: LoadingCache[IpAddress, Option[Location]] =
|
||||
|
|
Loading…
Reference in New Issue