3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-26 04:32:51 +01:00
Commit Graph

3462 Commits

Author SHA1 Message Date
James Lu
18bc1942e5 antispam: implement text filters with optional PM spam checks
Also refactor the _punish code to account for events without a channel attached.

Closes #359.
2018-06-08 17:49:26 -07:00
James Lu
b0188dab92 get_friendly_name: strip STATUSMSG prefixes before checking is_channel 2018-06-08 17:26:25 -07:00
James Lu
7b744655ee Merge branch 'devel' into wip/antispam-textfilters 2018-06-08 15:57:40 -07:00
James Lu
8cc838e5ca relay: allow "relay.link.force_ts" as an alternate permission to 'link --force' 2018-06-08 15:56:42 -07:00
James Lu
6f3813d3a4 UserMapping: add in missing reference to the parent irc instance 2018-06-08 15:54:06 -07:00
James Lu
06d57a5b28 relay: rename 'link --force' to 'link --force-ts' to better reflect its purpose
Also mention explicitly that this option does not bypass LINKACL and other channel restrictions (e.g. the Clientbot one)
2018-06-07 13:48:38 -07:00
James Lu
88bd9b2791 relay: oops, the op check in 'link' should be specific to clientbot
(cherry picked from commit d4bf407c5d)
2018-06-07 13:46:01 -07:00
James Lu
d4bf407c5d relay: oops, the op check in 'link' should be specific to clientbot 2018-06-07 13:44:37 -07:00
James Lu
b202954be4 relay: check permissions before clientbot op status to prevent arbitrary join triggering
This mirrors the fix in 1.x: commit 141e941fcd
2018-06-07 13:39:16 -07:00
James Lu
fee64ece04 relay: fix clientbot op requirement not being checked if the sender is in the target channel
Also, show a slightly different error when using the command with 'remote', since the clientbot client gets overridden to be the message sender.

This mirrors the fix in 1.x: commit 9578fd5ac3
2018-06-07 13:38:52 -07:00
James Lu
141e941fcd relay: check permissions before clientbot op status to prevent arbitrary join triggers 2018-06-07 13:20:30 -07:00
James Lu
9578fd5ac3 relay: fix clientbot op requirement not being checked if the sender is in the target channel 2018-06-07 13:19:53 -07:00
James Lu
1e0b0dbc70 relay: part the PyLink service bot after relaying other parts on 'delink'
This prevents these messages from being overriden by the "Clientbot was force parted" one if the IRCd responds too quickly.
2018-06-07 13:07:51 -07:00
James Lu
e76c48f24c Initial config skeleton for antispam text filters (#359) 2018-06-02 01:05:00 -07:00
James Lu
5b94a10c67 example-conf: rewrap antispam section, typo fix
[skip ci]
2018-06-02 00:57:26 -07:00
James Lu
b120e2d701 antispam: allow individual punishments to fail gracefully when not supported 2018-06-02 00:31:14 -07:00
James Lu
186b73c72d example-conf: more wording tweaks 2018-06-02 00:15:26 -07:00
James Lu
df6562dcff example-conf: add antispam to the available plugins list 2018-06-02 00:09:52 -07:00
James Lu
cb774ac3da example-conf: document antispam::exempt_level 2018-06-02 00:07:20 -07:00
James Lu
e65d84960a antispam: make punishments method-specific 2018-06-02 00:06:21 -07:00
James Lu
8cc4527ff7 example-conf: initial documentation for the antispam plugin 2018-06-01 23:50:50 -07:00
James Lu
83aa3d262c antispam: allow masshighlight blocking to be disabled 2018-06-01 23:48:22 -07:00
James Lu
62fcdf880c relay: support setting freeform channel descriptions for LINKED
Closes #576.
2018-06-01 23:03:31 -07:00
James Lu
32acc27967 relay: tweak the "wrong network" error message for claim, modedelta 2018-06-01 22:48:13 -07:00
James Lu
c8b2a676fd relay: rename CHANNEL_DELINKED_PARTMSG -> CHANNEL_DELINKED_MSG 2018-05-30 12:45:20 -07:00
James Lu
08a7b5c837 relay: remove our persistent channels on unload 2018-05-30 12:43:59 -07:00
James Lu
5ac283f018 ServiceBot: introduce clear_persistent_channels() to clear all persistent channels in a namespace 2018-05-30 12:43:51 -07:00
James Lu
1ab5d614c0 protocols: convert user TS to an int when receiving new users (#594) 2018-05-26 16:26:14 -07:00
James Lu
e3a935d0b7 classes: make User, Channel TS a property for type-safety (#594) 2018-05-26 02:30:25 -07:00
James Lu
f20fa5e995 Add User.get_fields(), and rework plugins to fix $nick broken expansions
User.nick is no longer a writable attribute since a085aed924, so it won't show up in __dict__ now.

get_fields() replaces the User.__dict__ hack various plugins used and also provides some new expansion variables:
- $sid and $server expand to the server ID and name respectively
- $modes and $channels are now preformatted strings
- $netname expands to the network name

$manipulatable and $_irc were removed since their values aren't quite meaningful as strings
2018-05-26 02:12:38 -07:00
James Lu
108d4b86d9 login: fix login for legacy accounts (#590) 2018-05-26 01:27:12 -07:00
James Lu
2df3dc280c commands.showuser: show home server and TS as "N/A" if they are spoofed values 2018-05-26 01:14:32 -07:00
James Lu
b72420a8aa Revert "NetworkCore: return the server in get_server if the arg was a server"
The complete implementation of is_privileged_service() in ec3a94c4ca explicitly checks the entity ID type, so this strange hack is not needed.

This reverts commit 9113b34b46.
2018-05-26 01:14:32 -07:00
James Lu
ec3a94c4ca Move U:line checking into core as PyLinkNCWUtils.is_privileged_server()
Closes #604.
2018-05-26 00:14:04 -07:00
James Lu
9e936f1612 Rewrite login handling (Closes #590)
* Move identify command and login helpers into coremods.login
   - corecommands._login -> login._irc_try_login
* Add login._get_account() function to consistently fetch login block info
* Rename functions in coremods.login to snake case:
   - checkLogin -> check_login
   - verifyHash -> verify_hash
* Replace explicit returns in login checks with raising utils.NotAuthorizedError()
2018-05-25 23:50:55 -07:00
James Lu
73261a31bd opercmds: forbid killing the main PyLink client 2018-05-21 02:37:53 -07:00
James Lu
b9f782868c inspircd: remove users from the state immediately when sending a kill
This matches Anope and Atheme's behaviours.

Closes #607.
2018-05-21 00:33:13 -07:00
James Lu
a66a9b6336 core: demote KeyError logging in _remove_client to DEBUG
This is needed for #607.
2018-05-21 00:28:16 -07:00
James Lu
c9c937e7a7 relay: block networks not on the claim list from merging in modes when relinking
This can cause channels to be inadvertently set modes that it shouldn't be on a relink (e.g. modes set by services DEFCON), since relay ignores modes from defined u-lines instead of bouncing them.
2018-05-21 00:09:57 -07:00
James Lu
1fb2a90580 relay: log rejected links due to LINKACL to WARNING
Closes #609.
2018-05-20 22:17:23 -07:00
James Lu
20bbf531e6 wrap_message: fall back to bufsize=510 on protocols declaring S2S_BUFSIZE to be 0 (unlimited) 2018-05-18 19:09:06 -07:00
James Lu
559b262db8 core: break attempts to read from a socket if no data is available 2018-05-18 19:08:37 -07:00
James Lu
f87e646f35 core: use the most recent UID if we have an unresolved nick collision / desync
This is the one most likely to be correct, assuming IRCds deals with nick collisions properly on their own.
2018-05-18 18:17:04 -07:00
James Lu
73322bd9ba wrap_message: expand UID targets into nicks before processing (#153) 2018-05-11 14:47:27 -07:00
James Lu
244c4fe0eb classes: return valid channels as-is in get_friendly_name()
This makes it safe to use when processing message targets. (ref #153)
2018-05-11 14:47:18 -07:00
James Lu
0ac5d424d8 core: implement text wrapping in irc.msg()
Closes #153.
2018-05-11 14:38:21 -07:00
James Lu
5d098f57d7 example-conf: relay::tag_nicks = false is no longer experimental
We've been using this in production with 2.0 for quite some time.

[skip ci]
2018-05-11 14:01:27 -07:00
James Lu
13c315c9a2 example-conf: fix a typo (enable_default_claim -> relay_enable_default_claim) 2018-05-11 13:28:57 -07:00
James Lu
28862281fe example-conf: rework some relay config descriptions for consistent style 2018-05-11 13:26:37 -07:00
James Lu
741e2c8ece relay: allow claim to be disabled by default on new channels
Closes #581.
2018-05-11 13:26:13 -07:00