Skip to content

Commit

Permalink
Revert "[PORT] Replace old IPIntel with IPIntel from TG (BlueMoon-Lab…
Browse files Browse the repository at this point in the history
…s#1430)"

This reverts commit 7b41902.
  • Loading branch information
Phoenix4O4 committed Dec 11, 2024
1 parent 3d320ad commit 7c419fb
Show file tree
Hide file tree
Showing 14 changed files with 4 additions and 427 deletions.
31 changes: 0 additions & 31 deletions SQL/bluemoon_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -80,34 +80,3 @@ DELIMITER ;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;


--
-- Table structure for table `ipintel`
--

DROP TABLE IF EXISTS `ipintel`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ipintel` (
`ip` int(10) unsigned NOT NULL,
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`intel` double NOT NULL DEFAULT '0',
PRIMARY KEY (`ip`),
KEY `idx_ipintel` (`ip`,`intel`,`date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ipintel_whitelist`
--

DROP TABLE IF EXISTS `ipintel_whitelist`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ipintel_whitelist` (
`ckey` varchar(32) NOT NULL,
`admin_ckey` varchar(32) NOT NULL,
PRIMARY KEY (`ckey`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
3 changes: 0 additions & 3 deletions code/_BLUEMOONCODE/_HELPERS/time.dm

This file was deleted.

15 changes: 0 additions & 15 deletions code/__BLUEMOONCODE/_DEFINES/ipintel.dm

This file was deleted.

2 changes: 0 additions & 2 deletions code/controllers/configuration/entries/connections.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

/datum/config_entry/flag/check_randomizer

/* BLUEMOON EDIT:START IPINTEL FROM TG
/datum/config_entry/string/ipintel_email

/datum/config_entry/string/ipintel_email/ValidateAndSet(str_val)
Expand All @@ -59,7 +58,6 @@

/datum/config_entry/string/ipintel_domain
default = "check.getipintel.net"
*/ // BLUEMOON EDIT:END IPINTEL FROM TG

/datum/config_entry/flag/aggressive_changelog

Expand Down
3 changes: 1 addition & 2 deletions code/controllers/subsystem/ipintel.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* // BLUEMOON EDIT:START IPINTEL FROM TG
SUBSYSTEM_DEF(ipintel)
name = "XKeyScore"
init_order = INIT_ORDER_XKEYSCORE
Expand All @@ -12,4 +11,4 @@ SUBSYSTEM_DEF(ipintel)
/datum/controller/subsystem/ipintel/Initialize(timeofday, zlevel)
enabled = TRUE
. = ..()
*/ // BLUEMOON EDIT:END IPINTEL FROM TG

2 changes: 0 additions & 2 deletions code/modules/admin/ipintel.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* // BLUEMOON EDIT:START IPINTEL FROM TG
/datum/ipintel
var/ip
var/intel = 0
Expand Down Expand Up @@ -135,4 +134,3 @@
/proc/log_ipintel(text)
log_game("IPINTEL: [text]")
debug_admins("IPINTEL: [text]")
*/ // BLUEMOON EDIT:END IPINTEL FROM TG
7 changes: 2 additions & 5 deletions code/modules/client/client_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -607,14 +607,13 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
qdel(query_client_in_db)
return

var/client_is_in_db = query_client_in_db.NextRow() // BLUEMOON EDIT: IPINTEL FROM TG
//If we aren't an admin, and the flag is set
if(CONFIG_GET(flag/panic_bunker) && !holder && !GLOB.deadmins[ckey] && !(ckey in GLOB.bunker_passthrough))
var/living_recs = CONFIG_GET(number/panic_bunker_living)
//var/vpn_living_recs = CONFIG_GET(number/panic_bunker_living_vpn)
var/vpn_living_recs = CONFIG_GET(number/panic_bunker_living_vpn)
//Relies on pref existing, but this proc is only called after that occurs, so we're fine.
var/minutes = get_exp_living(pure_numeric = TRUE)
if((living_recs == 0 && !client_is_in_db) || living_recs >= minutes) // BLUEMOON EDIT: IPINTEL FROM TG //if((minutes <= living_recs) || (IsVPN() && (minutes < vpn_living_recs)))
if((minutes <= living_recs) || (IsVPN() && (minutes < vpn_living_recs)))
var/reject_message = "Failed Login: [key] - Account attempting to connect during panic bunker, but they do not have the required living time [minutes]/[living_recs]"
log_access(reject_message)
message_admins("<span class='adminnotice'>[reject_message]</span>")
Expand Down Expand Up @@ -873,15 +872,13 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
create_message("note", key, system_ckey, message, null, null, 0, 0, null, 0, 0)


/*// BLUEMOON EDIT:START IPINTEL FROM TG
/client/proc/check_ip_intel()
set waitfor = 0 //we sleep when getting the intel, no need to hold up the client connection while we sleep
if (CONFIG_GET(string/ipintel_email))
var/datum/ipintel/res = get_ip_intel(address)
if (res.intel >= CONFIG_GET(number/ipintel_rating_bad))
message_admins("<span class='adminnotice'>Proxy Detection: [key_name_admin(src)] IP intel rated [res.intel*100]% likely to be a Proxy/VPN.</span>")
ip_intel = res.intel
*/ // BLUEMOON EDIT:END IPINTEL FROM TG

/client/Click(atom/object, atom/location, control, params, ignore_spam = FALSE, extra_info)
if(last_click > world.time - world.tick_lag)
Expand Down
2 changes: 0 additions & 2 deletions code/modules/client/client_vpn_detect.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* BLUEMOON EDIT:START IPINTEL FROM TG
/client/proc/IsVPN()
var/datum/ipintel/res = get_ip_intel(address)
return res.intel >= CONFIG_GET(number/ipintel_rating_bad)
*/ //BLUEMOON EDIT:END IPINTEL FROM TG
22 changes: 0 additions & 22 deletions config/bluemoon/ipintel.txt

This file was deleted.

3 changes: 1 addition & 2 deletions config/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,5 @@ $include splurt/donator.txt
$include splurt/autocryo.txt

# Bluemoon stuff!
$include entries/bluemoon.txt
$include bluemoon/ipintel.txt
$include bluemoon/bluemoon.txt
$include bluemoon/discord.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,3 @@
/// Defines whether the server uses the legacy mentor system with mentors.txt or the SQL system.
/datum/config_entry/flag/mentor_legacy_system
protection = CONFIG_ENTRY_LOCKED

/datum/config_entry/string/ipintel_base
default = "check.getipintel.net"

/datum/config_entry/string/ipintel_email

/datum/config_entry/string/ipintel_email/ValidateAndSet(str_val)
return str_val != "[email protected]" && (!length(str_val) || findtext(str_val, "@")) && ..()

/datum/config_entry/number/ipintel_rating_bad
default = 1
integer = FALSE
min_val = 0
max_val = 1

/datum/config_entry/flag/ipintel_reject_rate_limited
default = FALSE

/datum/config_entry/flag/ipintel_reject_bad
default = FALSE

/datum/config_entry/flag/ipintel_reject_unknown
default = FALSE

/datum/config_entry/number/ipintel_rate_minute
default = 15
min_val = 0

/datum/config_entry/number/ipintel_cache_length
default = 7
min_val = 0

/datum/config_entry/number/ipintel_exempt_playtime_living
default = 5
min_val = 0
Loading

0 comments on commit 7c419fb

Please sign in to comment.