oftc / oftc-ircservices

OFTC's IRC Services
https://www.oftc.net/CodingProjects/
GNU General Public License v2.0
32 stars 22 forks source link

GanneffServ: make it possible to not kill irccloud #50

Open jsoref opened 2 years ago

jsoref commented 2 years ago

Without this, anyone using irccloud (or a similar service) can get all other users k:lined by tripping on a trap (J).

Goal: they should be treated like a tor user (getting themselves killed).


Background: I'm an irccloud user, and today someone managed to trip on a J trap which got my connection to oftc k:lined.

@dwfreed said that we could add some sort of pattern/mask support to enable users like me not to suffer when other irccloud users do harmless stupid things.

Implementation:

  1. This adds an extra sql table (I'm not an expert in any of this -- SQL, Ruby, Services, IRCD, so obviously my code should be carefully reviewed)
  2. This adds two commands PROTECT and UNPROTECT -- I'm not attached to the command names (or anything else really). Both take irc masks or regular expressions (the former being converted into the latter).
  3. Some extra state variables are added, and when a akill is called, after checking if the user is on tor, the code tries to check to see if the host would match a protected pattern -- if so, the kill is downgraded to the user just as for tor users.