3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 09:19:23 +01:00
Commit Graph

1058 Commits

Author SHA1 Message Date
James Lu
852c257e88 relay: remove use of re-entrant locks
This shouldn't be necessary anymore.
2018-12-27 11:58:39 -08:00
James Lu
bf9eb8d4ea relay: fix incorrect in-place changes of modedelta modes
This caused the database to be filled with extraneous "-modename" entries when removing modes from the previous modedelta.
2018-11-30 10:21:51 -08:00
James Lu
d01a9fe9b4 antispam: more lookalike chars for o, \, # 2018-11-10 23:21:54 -08:00
James Lu
aa5412712a antispam: more lookalike unicode chars
Courtesy of @nathan0
2018-11-10 10:20:41 -08:00
James Lu
32e9cc689e antispam: filter away Unicode lookalike characters when processing
Based off 56b48e4e51
2018-11-07 16:16:46 -08:00
James Lu
dac8410b63 relay: shortcut if the remote network is not ready 2018-10-10 22:49:10 -07:00
James Lu
0b3793380b relay: remove TCONDITION_TIMEOUT 2018-10-08 14:59:01 -07:00
James Lu
1ee93d2cc4 relay: remove world.started check, this shouldn't be needed anymore 2018-10-08 14:44:37 -07:00
James Lu
767ff15200 relay: add an explicit forcetag command
We used to be able to just /kill to forcetag, but with PyLink 2.0 kills actually get relayed.
2018-10-08 12:42:38 -07:00
James Lu
57faa1443a relay: rename nick_collide() to forcetag_nick() 2018-10-08 12:41:52 -07:00
James Lu
20b3a61cd6 relay: simplify is_relay_client() 2018-10-08 12:12:09 -07:00
James Lu
7fb4c8da04 automode: manage persistent channels on the right network 2018-10-06 23:46:49 -07:00
James Lu
a3e18081a6 relay: don't relay as text modes being set on netburst (#627) 2018-09-21 21:53:34 -07:00
James Lu
5838d88404 networks: reload shared modules used by protocol modules too 2018-08-23 02:57:03 -04:00
James Lu
12f6bb5e18 relay: don't relay kill->kick when remotechan is None 2018-07-18 18:45:49 -07:00
James Lu
a1783ed2be bots: "bots.joinclient" should be "bots.join" (matching the command name) 2018-07-11 22:16:05 -07:00
James Lu
f9611ef6bc relay: grant CHANDESC permissions to opers if allow_free_oper_links is true 2018-07-11 21:56:29 -07:00
James Lu
71a24b8b9f relay: remove noctcp, regdeaf, stripcolor from whitelisted umodes
Filter-type umodes don't work properly with relay yet.
2018-07-10 18:09:24 -07:00
James Lu
5ffc629bce plugins/example: update word wrap note
As of PyLink 2.0, long paragraphs are automatically word-wrapped by irc.reply().
2018-07-10 18:04:25 -07:00
James Lu
bba235bba2 Update GitHub repository address 2018-07-08 12:54:10 -07:00
James Lu
c1f37c2236 relay: don't allow servers to forward KILLs
Closes #621.
2018-07-08 12:49:30 -07:00
James Lu
086a5f4496 example-conf, relay, utils: replace 2.0-alpha4 references with 2.0-beta1 2018-06-26 14:44:07 -07:00
James Lu
c3bb0f7aca relay: rework kill->kick forwarding to send from the sender network's subservers
This makes the kick message a lot neater.

Before:
* net1.relay has kicked GL/net1 from #test ((net2.relay) KILL FWD from GL/net2: test)

After:
* net2.relay has kicked GL/net1 from #test (KILL FWD from GL/net2: test)
2018-06-14 14:48:54 -07:00
James Lu
76b58c4432 relay: log chandesc changes to INFO 2018-06-12 02:36:37 -07:00
James Lu
77fd9475b6 relay: show channel descriptions before "created by" info 2018-06-12 02:33:29 -07:00
James Lu
8c42825612 relay: allow disabling free link access for all opers 2018-06-12 00:26:24 -07:00
James Lu
1b68bfadc6 coremods, plugins, protocols: drop now redundant allowAuthed=False in is_oper() calls 2018-06-11 23:56:44 -07:00
James Lu
2e3317ce07 relay: explicitly mention forwarding in relayed kill messages (#520) 2018-06-11 19:26:52 -07:00
James Lu
7d56b30582 opercmds: skip verbose formatting of kill reasons for internal targets (#520) 2018-06-11 19:26:51 -07:00
James Lu
5ecbc2750e exec: fix textwrap error caused by passing the wrong type to reply() 2018-06-11 19:26:51 -07:00
James Lu
93fef9b923 relay: use match_text() to check forcetag_nicks globs 2018-06-11 18:51:30 -07:00
James Lu
73d0e153cf relay: support relaying kills (#520)
Instead of always bouncing, kills to a relay client are now handled as follows:

1) If the target and source networks are both in any killshare pool, relay the kill entirely
2) Otherwise, iterate over all channels the kill target is in:
    3) If the killer has claim access in a channel, forward the KILL as a kick
    4) Otherwise, bounce the kill (so far, silently)

TODO: kill messages are currently very cluttered, we should make our parser deliver more concise strings...
* GL|unreal has quit (Killed (chary.relay (KILL from GL/chary: Killed (GL (test)))))
2018-06-11 18:34:52 -07:00
James Lu
9466813ba1 relay: switch to a flexible, pool-based configuration scheme for IP sharing
This deprecates the "relay::show_ips" and network-specific "relay_no_ips" options, replacing it with the "relay::ip_share_pools" list.
2018-06-11 17:29:29 -07:00
James Lu
17ffd1f640 automode: log mass-removals to INFO as well 2018-06-10 14:36:40 -07:00
James Lu
372e7fb405 automode: send delacc confirmations from the right client
Also bold some parts of the output for easier viewing.
2018-06-10 14:31:56 -07:00
James Lu
8608c72b16 automode: allow removing entries by entry numbers
Closes #506.

This isn't the most efficient implementation because Automode entry lists are actually unordered...
So far we're relying on consistent sorting of entries between LISTACC and DELACC, and indrectly removing entries by comparing the entry list with remove_range's output.
2018-06-09 23:12:37 -07:00
James Lu
f8e3cfa346 antispam: strip IRC formatting by default before processing
Closes #615.
2018-06-09 16:22:14 -07:00
James Lu
ebf7443d97 antispam: add a "block" verb, and make textfilter use it by default
Closes #616.
2018-06-09 16:22:14 -07:00
James Lu
0ae7eb2563 relay_clientbot: allow overriding clientbot styles by network
Closes #455.
2018-06-08 19:15:47 -07:00
James Lu
b1248524a9 relay: raise an error when trying to delink a leaf channel from another leaf network
Previously this would (confusingly) delink the channel from the network the command was called on instead of the intended target.
2018-06-08 18:45:45 -07:00
James Lu
180da83b4e global: reply with a confirmation
We can also use this space to show the number of channels and networks announced to.
2018-06-08 18:28:41 -07:00
James Lu
f82ddb5336 global: allow configuring channels to exempt from announcements
Closes #453.
2018-06-08 18:25:23 -07:00
James Lu
0edbeb7fad global: do not allow sending empty messages 2018-06-08 18:25:23 -07:00
James Lu
6085b21e48 antispam: normalize logging format in handle_masshighlight 2018-06-08 17:54:32 -07:00
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
8cc838e5ca relay: allow "relay.link.force_ts" as an alternate permission to 'link --force' 2018-06-08 15:56:42 -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
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
b120e2d701 antispam: allow individual punishments to fail gracefully when not supported 2018-06-02 00:31:14 -07:00
James Lu
e65d84960a antispam: make punishments method-specific 2018-06-02 00:06:21 -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
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
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
ec3a94c4ca Move U:line checking into core as PyLinkNCWUtils.is_privileged_server()
Closes #604.
2018-05-26 00:14:04 -07:00
James Lu
73261a31bd opercmds: forbid killing the main PyLink client 2018-05-21 02:37:53 -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
0ac5d424d8 core: implement text wrapping in irc.msg()
Closes #153.
2018-05-11 14:38:21 -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
James Lu
fc275cfdca relay: remove service bots joined persistently when the home network disconnects 2018-05-11 13:21:16 -07:00
James Lu
aa4cedd945 relay: allow default LINKACL mode to be configured as an option (#394) 2018-05-11 13:09:54 -07:00
James Lu
fb6aa88d83 Merge branch 'relay-linkacl-whitelist' into devel
Closes #394.
2018-05-11 12:58:45 -07:00
James Lu
613e6412a2 networks.remote: properly error if the target service is not available on the target network
Closes #554.
2018-05-10 16:06:16 -07:00
James Lu
30c1980b59 relay: consistently use bold instead of repr in LINKACL output 2018-05-09 23:33:00 -07:00
James Lu
0ae4aea133 relay: add a whitelist mode for LINKACL (#394) 2018-05-09 23:29:56 -07:00
James Lu
64a98120bf relay: remove references to deprecated irc.proto 2018-05-09 22:44:17 -07:00
James Lu
b50ae89acc relay: check service bot status before remote user presence
add_persistent_channels() is usable regardless of whether the service bot is ready, so we do not need to break if the remote copy of the service bot doesn't exist.

Closes #606.
2018-05-09 21:44:04 -07:00
James Lu
f3c2149d7a relay: fix variable confusion when managing service bots
We should be checking for service bot presence locally, and applying changes on the *remote* network.
2018-05-09 21:34:17 -07:00
James Lu
0c19b3719e automode: clarify comments to main() slightly 2018-05-09 21:29:20 -07:00
James Lu
2f6c8d2938 Revert "relay: shortcut get_remote_user some more; only grab spawn lock if the user doesn't exist"
This seems to have caused sporadic duplicate user spawns once more (#602)

This reverts commit 0bc24c94b2.
2018-05-05 23:17:24 -07:00
James Lu
5a0cb9a4ff automode: add/remove persistent channels on set/del/clearacc 2018-05-05 21:51:27 -07:00
James Lu
8aa67b93fa automode: also rejoin DB channels on reload 2018-05-05 21:10:08 -07:00
James Lu
bf4863eb6d relay, ServiceBot: remove dead code 2018-05-05 13:20:55 -07:00
James Lu
72c2fa38e9 relay: consistently use "Channel delinked." as part message for service bots too 2018-05-05 13:19:57 -07:00
James Lu
61d7bf18d3 relay: also attempt to part the PyLink service bot on delink 2018-05-05 13:15:17 -07:00
James Lu
92be421fad relay: attempt to remove persistent channels on delink as well
Also, wrap remove_persistent_channel calls with a try/except when they may fail.
2018-05-05 12:57:17 -07:00
James Lu
8994811f54 relay: further fixes for persistent channels
Also, merge the 'relay_local' and 'relay_remote' namespaces into one.
2018-05-05 12:52:00 -07:00
James Lu
e9fe15bd7d [WIP] Further revise the persistent channels implementation
- Make dynamic_channels per plugin as well as per network to work around relay-service conflicts (#265)
- Introduce ServiceBot.(add|remove)_persistent_channel() to add/remove persistent channels and optionally join/part them
- Introduce ServiceBot.part(), which checks remaining persistent channels list and parts a channel only if it is still not marked persistent
- Refactor automode to autojoin channels on ENDBURST instead of plugin load
- Refactor relay to manage persistent channels on join/part/(de)init, both locally (namespace 'relay_local') and remotely (namespace 'relay_remote')
2018-05-04 22:52:26 -07:00
James Lu
af744123e6 automode: join channels regardless of whether they're empty 2018-04-20 19:35:06 -07:00
James Lu
281ac7aa31 antispam: add a workaround for clientbot support (#359) 2018-04-14 11:40:19 -07:00
James Lu
47052a3bba antispam: use kick+ban as default punishment 2018-04-13 22:18:41 -07:00
James Lu
3e07239db4 antispam: don't kill users if they quit after previous punishments 2018-04-13 22:18:03 -07:00
James Lu
dd8f9411b6 antispam: filter protection-triggering messages from reaching other plugins (#359) 2018-04-13 22:15:24 -07:00
James Lu
3825b93dee Initial pass of a mass-highlight blocking plugin (#359) 2018-04-13 22:08:37 -07:00
James Lu
4cdc19ac78 relay: fix is_internal_client call 2018-04-13 20:31:56 -07:00
James Lu
2f12a5b710 Initial work on dynamic service bot joining / parting (#265) 2018-04-12 12:45:33 -07:00
James Lu
2cb4a06e64 commands: report times in showuser, showchan in UTC
XXX: we could perhaps use abstraction to this since we're repetitively chaining commands
XXX: 'ts' is not type-safe yet, some protocol modules are storing it as a string?!
2018-04-12 10:58:09 -07:00
James Lu
f75b1eb356 Rename servers::<netname>::server_suffix -> servers::<netname>::relay_server_suffix 2018-04-03 17:43:02 -07:00
James Lu
9d21a5269f relay: speed up shutdowns by not manually splitting off every relay server
The connection will soon be gone anyways, so this is fairly pointless.
2018-03-30 12:06:45 -07:00
James Lu
c978e1c52f relay: fix a typo: CLIENTBOT_WHITELISTED_UMODES -> CLIENTBOT_WHITELISTED_CMODES 2018-03-30 12:01:38 -07:00
James Lu
0bc24c94b2 relay: shortcut get_remote_user some more; only grab spawn lock if the user doesn't exist 2018-03-24 00:31:15 -07:00
James Lu
bbb36cd956 relay: reuse get_relay_server_sid output when bursting groups of users 2018-03-24 00:25:05 -07:00
James Lu
ec8f744449 relay: only look up nick once in normalize_nick 2018-03-22 22:45:40 -07:00
James Lu
180bfa9917 relay: don't spam ulines with "notice failed" errors 2018-03-17 10:27:56 -07:00