Admin & Staff adjustments (#2529)

Features:

 Removal of BOREALIS (python module) as it's not used.
 Removes ToR ban feature in lieu of IPIntel.
 New BOREALIS config to alert staff if server starts as hidden.
 Adminhelps now inform admins on discord if dibsed (when they were sent to discord anyways).
 Adds hub visibility to the server access control panel.
 Adds mirror ban spotting via ban panel. It now redirects to the linked ban if one is found.
 CCIAA now get alerted as to how many of them are online and active when receiving faxes and emergency messages via Discord.
 Removed unused C/C++ libraries. The socket_talk module is a generic UDP shipper, of which Arrow implemented a better version. lib nudge is not even compiled for use. lib_nudge module is uncompiled and no longer used, as we use cURL for the bot.
 Removed depracted APIs and config settings related to the previous point.
 Whitelisted jobs now appear properly in the job selection window as [WHITELISTED].
 Job ban reasons can now be viewed from player preferences window.
 Await admin approval for final CCIAA requests and implement. RIP CCIAA.
 Fix age bans for jobs and antags (dynamic ones, ofc).
 Implement https://forums.aurorastation.org/viewtopic.php?f=18&t=8283
This commit is contained in:
skull132
2017-06-13 01:37:44 +03:00
committed by GitHub
parent c8e8710b41
commit e4423761ef
49 changed files with 312 additions and 1455 deletions
+8 -4
View File
@@ -205,10 +205,14 @@
update_connection_data(C, conn_info)
if (ding_bannu)
log_and_message_admins("[C.ckey] from [C.address]-[C.computer_id] was caught bandodging. Mirror applied for ban #[ding_bannu], kicking shortly.")
apply_ban_mirror(C.ckey, C.address, C.computer_id, ding_bannu)
spawn(20)
del(C)
if (!C.holder)
log_and_message_admins("[C.ckey] from [C.address]-[C.computer_id] was caught bandodging. Mirror applied for ban #[ding_bannu], kicking shortly.")
apply_ban_mirror(C.ckey, C.address, C.computer_id, ding_bannu)
spawn(20)
del(C)
else
// Stop kicking me off my test server, fuck.
log_and_message_admins("[C.ckey] is a staff but was caught bandodging! Ban ID: #[ding_bannu].")
return
+42 -9
View File
@@ -387,30 +387,27 @@
var/alcolor = "#eeeeff" // auto-unbanned light
var/adcolor = "#ddddff" // auto-unbanned dark
output += "<table width='90%' bgcolor='#e3e3e3' cellpadding='5' cellspacing='0' align='center'>"
output += "<tr>"
output += "<th width='25%'><b>TYPE</b></th>"
output += "<th width='20%'><b>CKEY</b></th>"
output += "<th width='20%'><b>TIME APPLIED</b></th>"
output += "<th width='20%'><b>ADMIN</b></th>"
output += "<th width='15%'><b>OPTIONS</b></th>"
output += "</tr>"
var/adminsearch = ""
var/playersearch = ""
var/ipsearch = ""
var/cidsearch = ""
var/bantypesearch = ""
var/mirror_player = ""
var/mirror_ip = ""
var/mirror_cid = ""
if(!match)
if(adminckey)
adminsearch = "AND a_ckey = '[adminckey]' "
if(playerckey)
playersearch = "AND ckey = '[playerckey]' "
mirror_player = "AND mirrors.player_ckey = '[playerckey]' "
if(playerip)
ipsearch = "AND ip = '[playerip]' "
mirror_ip = "AND mirrors.ban_mirror_ip = '[playerip]' "
if(playercid)
cidsearch = "AND computerid = '[playercid]' "
mirror_cid = "AND mirrors.ban_mirror_computerid = '[playercid]'"
else
if(adminckey && lentext(adminckey) >= 3)
adminsearch = "AND a_ckey LIKE '[adminckey]%' "
@@ -434,6 +431,42 @@
else
bantypesearch += "'PERMABAN' "
/**
* Do mirror checks first! Basically find active mirrors and add those to the output before we proceed onto finding bans.
*/
if (!match)
var/DBQuery/mirror_query = dbcon.NewQuery({"SELECT DISTINCT(mirrors.ban_id), bans.ckey FROM ss13_ban_mirrors mirrors
JOIN ss13_ban bans ON mirrors.ban_id = bans.id
WHERE (1 [mirror_player] [mirror_ip] [mirror_cid])
AND (
ISNULL(bans.unbanned) AND (
(bans.bantype = 'PERMABAN')
OR
(bans.bantype = 'TEMPBAN' AND bans.expiration_time > NOW())
)
)"})
mirror_query.Execute()
var/mirror_count = 0
var/mirror_data = "<br>"
while (mirror_query.NextRow())
mirror_data += "Active mirror for #[mirror_query.item[1]] (<a href='?src=\ref[src];dbsearchckey=[mirror_query.item[2]];'>View Ban</a>)<br>"
mirror_count++
if (mirror_count)
output += "<div style=\"text-align:center\"><b>[mirror_count] Active Mirrors Found!</b><br>"
output += mirror_data
output += "<br>"
output += "<table width='90%' bgcolor='#e3e3e3' cellpadding='5' cellspacing='0' align='center'>"
output += "<tr>"
output += "<th width='25%'><b>TYPE</b></th>"
output += "<th width='20%'><b>CKEY</b></th>"
output += "<th width='20%'><b>TIME APPLIED</b></th>"
output += "<th width='20%'><b>ADMIN</b></th>"
output += "<th width='15%'><b>OPTIONS</b></th>"
output += "</tr>"
var/DBQuery/select_query = dbcon.NewQuery("SELECT id, bantime, bantype, reason, job, duration, expiration_time, ckey, a_ckey, unbanned, unbanned_ckey, unbanned_datetime, unbanned_reason, edits, ip, computerid FROM ss13_ban WHERE 1 [playersearch] [adminsearch] [ipsearch] [cidsearch] [bantypesearch] ORDER BY bantime DESC LIMIT 100")
select_query.Execute()
-10
View File
@@ -10,17 +10,7 @@ world/IsBanned(key,address,computer_id)
message_admins("<span class='notice'>Failed Login: [key] - Guests not allowed</span>")
return list("reason"="guest", "desc"="\nReason: Guests not allowed. Please sign in with a byond account.")
//check if the IP address is a known TOR node
if(config && config.ToRban && ToRban_isbanned(address))
log_access("Failed Login: [src] - Banned: ToR",ckey=key_name(src))
message_admins("<span class='notice'>Failed Login: [src] - Banned: ToR</span>")
//ban their computer_id and ckey for posterity
AddBan(ckey(key), computer_id, "Use of ToR", "Automated Ban", 0, 0)
return list("reason"="Using ToR", "desc"="\nReason: The network you are using to connect has been banned.\nIf you believe this is a mistake, please request help at [config.banappeals]")
if(config.ban_legacy_system)
//Ban Checking
. = CheckBan( ckey(key), computer_id, address )
if(.)
-88
View File
@@ -1,88 +0,0 @@
//By Carnwennan
//fetches an external list and processes it into a list of ip addresses.
//It then stores the processed list into a savefile for later use
#define TORFILE "data/ToR_ban.bdb"
#define TOR_UPDATE_INTERVAL 216000 //~6 hours
/proc/ToRban_isbanned(var/ip_address)
var/savefile/F = new(TORFILE)
if(F)
if( ip_address in F.dir )
return 1
return 0
/proc/ToRban_autoupdate()
var/savefile/F = new(TORFILE)
if(F)
var/last_update
F["last_update"] >> last_update
if((last_update + TOR_UPDATE_INTERVAL) < world.realtime) //we haven't updated for a while
ToRban_update()
return
/proc/ToRban_update()
spawn(0)
log_misc("Downloading updated ToR data...")
var/http[] = world.Export("https://check.torproject.org/exit-addresses")
var/list/rawlist = file2list(http["CONTENT"])
if(rawlist.len)
fdel(TORFILE)
var/savefile/F = new(TORFILE)
for( var/line in rawlist )
if(!line) continue
if( copytext(line,1,12) == "ExitAddress" )
var/cleaned = copytext(line,13,length(line)-19)
if(!cleaned) continue
F[cleaned] << 1
F["last_update"] << world.realtime
log_misc("ToR data updated!")
if(usr) usr << "ToRban updated."
return 1
log_misc("ToR data update aborted: no data.")
return 0
/client/proc/ToRban(task in list("update","toggle","show","remove","remove all","find"))
set name = "ToRban"
set category = "Server"
if(!holder) return
switch(task)
if("update")
ToRban_update()
if("toggle")
if(config)
if(config.ToRban)
config.ToRban = 0
message_admins("<font color='red'>ToR banning disabled.</font>")
else
config.ToRban = 1
message_admins("<font colot='green'>ToR banning enabled.</font>")
if("show")
var/savefile/F = new(TORFILE)
var/dat
if( length(F.dir) )
for( var/i=1, i<=length(F.dir), i++ )
dat += "<tr><td>#[i]</td><td> [F.dir[i]]</td></tr>"
dat = "<table width='100%'>[dat]</table>"
else
dat = "No addresses in list."
src << browse(dat,"window=ToRban_show")
if("remove")
var/savefile/F = new(TORFILE)
var/choice = input(src,"Please select an IP address to remove from the ToR banlist:","Remove ToR ban",null) as null|anything in F.dir
if(choice)
F.dir.Remove(choice)
src << "<b>Address removed</b>"
if("remove all")
src << "<b>[TORFILE] was [fdel(TORFILE)?"":"not "]removed.</b>"
if("find")
var/input = input(src,"Please input an IP address to search for:","Find ToR ban",null) as null|text
if(input)
if(ToRban_isbanned(input))
src << "<font color='green'><b>Address is a known ToR address</b></font>"
else
src << "<font color='red'><b>Address is not a known ToR address</b></font>"
return
#undef TORFILE
#undef TOR_UPDATE_INTERVAL
+2 -2
View File
@@ -742,11 +742,11 @@ proc/admin_notice(var/message, var/rights)
set desc="Globally Toggles Hub Visibility"
set name="Toggle Hub Visibility"
if(!check_rights(R_ADMIN))
if(!check_rights(R_SERVER))
return
world.visibility = !(world.visibility)
var/long_message = " toggled hub visibility. The server is now [world.visibility ? "visible" : "invisible"] ([world.visibility])."
var/long_message = " toggled hub visibility. The server is now [world.visibility ? "visible" : "invisible"] ([world.visibility])."
discord_bot.send_to_admins("[key_name(src)]" + long_message)
message_admins("[key_name_admin(usr)]" + long_message, 1)
+2 -4
View File
@@ -63,7 +63,6 @@ var/list/admin_verbs_admin = list(
/datum/admins/proc/toggledsay, //toggles dsay on/off for everyone,
/client/proc/game_panel, //game panel, allows to change game-mode etc,
/client/proc/cmd_admin_say, //admin-only ooc chat,
/datum/admins/proc/togglehubvisibility, //toggles visibility on the BYOND Hub,
/datum/admins/proc/PlayerNotes,
/client/proc/cmd_mod_say,
/datum/admins/proc/show_player_info,
@@ -148,7 +147,6 @@ var/list/admin_verbs_spawn = list(
var/list/admin_verbs_server = list(
/datum/admins/proc/capture_map,
/client/proc/Set_Holiday,
/client/proc/ToRban,
/datum/admins/proc/startnow,
/datum/admins/proc/restart,
/datum/admins/proc/delay,
@@ -171,7 +169,8 @@ var/list/admin_verbs_server = list(
/client/proc/toggle_recursive_explosions,
/client/proc/restart_controller,
/client/proc/cmd_ss_panic,
/client/proc/configure_access_control
/client/proc/configure_access_control,
/datum/admins/proc/togglehubvisibility //toggles visibility on the BYOND Hub
)
var/list/admin_verbs_debug = list(
/client/proc/getruntimelog, // allows us to access runtime logs to somebody,
@@ -275,7 +274,6 @@ var/list/admin_verbs_hideable = list(
/client/proc/toggle_random_events,
/client/proc/cmd_admin_add_random_ai_law,
/client/proc/Set_Holiday,
/client/proc/ToRban,
/datum/admins/proc/startnow,
/datum/admins/proc/restart,
/datum/admins/proc/delay,
+6 -2
View File
@@ -113,9 +113,13 @@ var/list/jobban_keylist = list() // Global jobban list.
if (ckey)
if (guest_jobbans(rank))
if (config.guest_jobban && IsGuestKey(ckey))
return "Guest Job-ban"
return "GUEST JOB-BAN"
if (config.usewhitelist && ismob(player) && !check_whitelist(player))
return "No Whitelist"
return "WHITELISTED"
var/age_whitelist = player_old_enough_for_role(player, rank)
if (age_whitelist)
return "AGE WHITELISTED"
var/static/list/antag_bantypes
+5 -1
View File
@@ -1594,12 +1594,16 @@
usr << "<span class='danger'>Player not found!</span>"
return
if (C.adminhelped == 2)
if (C.adminhelped >= 2)
log_and_message_admins("has called <font color='red'>dibs</font> on [key_name_admin(C)]'s adminhelp!")
usr << "<font color='blue'><b>You have taken over [key_name_admin(C)]'s adminhelp.</b></font>'"
usr << "[get_options_bar(C, 2, 1, 1)]"
C << "<font color='red'><b>Your adminhelp will be tended [usr.client.holder.fakekey ? "shortly" : "by [key_name(usr, 0, 0)]"]. Please allow the staff member a minute or two to write up a response.</b></font>"
if (C.adminhelped == 3)
discord_bot.send_to_admins("Request for Help from [key_name(C)] is being tended to by [key_name(usr)].")
C.adminhelped = 1
else
usr << "<font color='red'><b>The adminhelp has already been claimed!</b></font>"
+6 -1
View File
@@ -12,13 +12,16 @@
data += "They must be reset every single time the server restarts.<br>"
data += "<b>If you do not know what these do, you shouldn't be touching them!</b><hr>"
data += "<h2>Hub Visibility Setting:</h2><br>"
data += "Currently [world.visibility ? "<font color='green'>VISIBLE</font>" : "<font color='red'>HIDDEN</font>"]. <a href='?_src_=holder;access_control=hub'>Toggle</a><br><hr>"
data += "<h2>IP Intel Settings:</h2><br><ul>"
data += "<li>Current warning level: [config.ipintel_rating_bad ? "[config.ipintel_rating_bad]" : "<font color='red'>DISABLED</font>"]. <a href='?_src_=holder;access_control=intel_bad'>Edit</a></li>"
data += "<li>Current kick level: [config.ipintel_rating_kick ? "[config.ipintel_rating_kick]" : "<font color='red'>DISABLED</font>"]. <a href='?_src_=holder;access_control=intel_kick'>Edit</a></li>"
data += "</ul><hr>"
data += "<h2>Player Age Settings:</h2><br><ul>"
data += "<li>New players: [config.access_deny_new_players ? "<font color='green'>ALLOWED</font>" : "<font color='red'>DENIED</font>"]. <a href='?_src_=holder;access_control=new_players;'>Toggle</a></li>"
data += "<li>New players: [config.access_deny_new_players ? "<font color='red'>DENIED</font>" : "<font color='green'>ALLOWED</font>"]. <a href='?_src_=holder;access_control=new_players;'>Toggle</a></li>"
data += "<li>Account age restriction: [config.access_deny_new_accounts == -1 ? "<font color='red'>DISABLED</font>" : "[config.access_deny_new_accounts] DAYS"]. <a href='?_src_=holder;access_control=new_accounts;'>Edit</a></li>"
data += "</ul><hr>"
@@ -93,6 +96,8 @@
log_and_message_admins("has set players with [config.access_deny_vms] positive identifiers out of 2 for VM usage to be warned.")
else
log_and_message_admins("has disabled warnings based on potential VM usage.")
if ("hub")
togglehubvisibility()
else
to_chat(usr, "<span class='danger'>Unknown control message sent. Cancelling.</span>")
+3 -1
View File
@@ -18,6 +18,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","
adminhelped = 2 //Determines if they get the message to reply by clicking the name.
/*A wee bit of an update here: we're using the following table for adminhelped values:
3 - Adminhelp has not been claimed and was sent to discord as well.
2 - Adminhelp has not been claimed by anyone.
1 - Adminhelp has been claimed, initial message has not been sent.
0 - Adminhelp has been claimed, initial message has been sent.
@@ -118,6 +119,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","
var/admin_number_active = admin_number_present - admin_number_afk
log_admin("HELP: [key_name(src)]: [original_msg] - heard by [admin_number_present] non-AFK admins.",admin_key=key_name(src))
if(admin_number_active <= 0)
discord_bot.send_to_admins("@everyone Request for Help from [key_name(src)]: [html_decode(original_msg)] - !![admin_number_afk ? "All admins AFK ([admin_number_afk])" : "No admins online"]!!")
discord_bot.send_to_admins("@here Request for Help from [key_name(src)]: [html_decode(original_msg)] - !![admin_number_afk ? "All admins AFK ([admin_number_afk])" : "No admins online"]!!")
adminhelped = 3
feedback_add_details("admin_verb","AH") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return
+17 -2
View File
@@ -29,17 +29,32 @@
//log_admin("HELP: [key_name(src)]: [msg]")
/proc/Centcomm_announce(var/msg, var/mob/Sender, var/iamessage)
discord_bot.send_to_cciaa("Emergency message from the station: `[msg]`, sent by [Sender]!")
var/msg_cciaa = "<span class='notice'><b><font color=orange>[uppertext(boss_short)][iamessage ? " IA" : ""]:</font>[key_name(Sender, 1)] (<A HREF='?_src_=holder;CentcommReply=\ref[Sender]'>RPLY</A>):</b> [msg]</span>"
msg = "<span class='notice'><b><font color=orange>[uppertext(boss_short)]M[iamessage ? " IA" : ""]:</font>[key_name(Sender, 1)] (<A HREF='?_src_=holder;adminplayeropts=\ref[Sender]'>PP</A>) (<A HREF='?_src_=vars;Vars=\ref[Sender]'>VV</A>) (<A HREF='?_src_=holder;subtlemessage=\ref[Sender]'>SM</A>) ([admin_jump_link(Sender, src)]) (<A HREF='?_src_=holder;secretsadmin=check_antagonist'>CA</A>) (<A HREF='?_src_=holder;BlueSpaceArtillery=\ref[Sender]'>BSA</A>) (<A HREF='?_src_=holder;CentcommReply=\ref[Sender]'>RPLY</A>):</b> [msg]</span>"
var/cciaa_present = 0
var/cciaa_afk = 0
for(var/client/C in admins)
if(R_ADMIN & C.holder.rights)
C << msg
else if (R_CCIAA & C.holder.rights)
cciaa_present++
if (C.is_afk())
cciaa_afk++
C << msg_cciaa
discord_bot.send_to_cciaa("Emergency message from the station: `[msg]`, sent by [Sender]!")
var/discord_msg = "[cciaa_present] agents online."
if (cciaa_present)
if ((cciaa_present - cciaa_afk) <= 0)
discord_msg += " **All AFK!**"
else
discord_msg += " [cciaa_afk] AFK."
discord_bot.send_to_cciaa(discord_msg)
/proc/Syndicate_announce(var/msg, var/mob/Sender)
msg = "<span class='notice'><b><font color=crimson>ILLEGAL:</font>[key_name(Sender, 1)] (<A HREF='?_src_=holder;adminplayeropts=\ref[Sender]'>PP</A>) (<A HREF='?_src_=vars;Vars=\ref[Sender]'>VV</A>) (<A HREF='?_src_=holder;subtlemessage=\ref[Sender]'>SM</A>) ([admin_jump_link(Sender, src)]) (<A HREF='?_src_=holder;secretsadmin=check_antagonist'>CA</A>) (<A HREF='?_src_=holder;BlueSpaceArtillery=\ref[Sender]'>BSA</A>) (<A HREF='?_src_=holder;SyndicateReply=\ref[Sender]'>RPLY</A>):</b> [msg]</span>"
for(var/client/C in admins)