IP reputation checking

This commit is contained in:
Aronai Sieyes
2020-01-15 14:30:41 -05:00
parent 7169e2869c
commit e67419d8cc
4 changed files with 132 additions and 3 deletions

View File

@@ -104,6 +104,13 @@ var/list/gamemode_cache = list()
var/panic_bunker = 0
var/paranoia_logging = 0
var/ip_reputation = FALSE //Should we query IPs to get scores? Generates HTTP traffic to an API service.
var/ipr_email //Left null because you MUST specify one otherwise you're making the internet worse.
var/ipr_block_bad_ips = FALSE //Should we block anyone who meets the minimum score below? Otherwise we just log it (If paranoia logging is on, visibly in chat).
var/ipr_bad_score = 1 //The API returns a value between 0 and 1 (inclusive), with 1 being 'definitely VPN/Tor/Proxy'. Values equal/above this var are considered bad.
var/ipr_allow_existing = FALSE //Should we allow known players to use VPNs/Proxies? If the player is already banned then obviously they still can't connect.
var/ipr_minimum_age = 5 //How many days before a player is considered 'fine' for the purposes of allowing them to use VPNs.
var/serverurl
var/server
var/banappeals
@@ -806,6 +813,24 @@ var/list/gamemode_cache = list()
if ("paranoia_logging")
config.paranoia_logging = 1
if("ip_reputation")
config.ip_reputation = 1
if("ipr_email")
config.ipr_email = value
if("ipr_block_bad_ips")
config.ipr_block_bad_ips = 1
if("ipr_bad_score")
config.ipr_bad_score = text2num(value)
if("ipr_allow_existing")
config.ipr_allow_existing = 1
if("ipr_minimum_age")
config.ipr_minimum_age = text2num(value)
if("random_submap_orientation")
config.random_submap_orientation = 1