Commit Graph

213 Commits

Author SHA1 Message Date
Mark Veidemanis 82a98c9539 Don't deduplicate global messages (NICK/QUIT) 2020-10-31 16:51:24 +00:00
Mark Veidemanis 45f02c323b Improve authentication detection
Add a negative check in the event we are authenticated and registered,
but not confirmed, as this fools other checks.
2020-10-31 16:49:37 +00:00
Mark Veidemanis bdb3d059e3 Use zero-padded numbers to maximise usuable ports 2020-10-31 00:13:59 +00:00
Mark Veidemanis e403852778 Error checking in testing for registration message 2020-10-31 00:13:09 +00:00
Mark Veidemanis f3dd102096 Deauth bot when disconnected and lowercase user 2020-10-31 00:12:06 +00:00
Mark Veidemanis 1fec14d759 Clarify error message to be more helpful 2020-10-31 00:11:28 +00:00
Mark Veidemanis b67eee42c1 Implement another level of logging for tracing 2020-10-31 00:10:33 +00:00
Mark Veidemanis 9e6dd5e03d Note that arguments to list are optional 2020-10-31 00:06:35 +00:00
Mark Veidemanis 77e8ef4c16 Implement authentication checking on connection 2020-10-28 22:50:12 +00:00
Mark Veidemanis c879caa9d7 Add checks in dedup for time-less messages 2020-10-28 22:46:22 +00:00
Mark Veidemanis db7e5677d3 Fix decoding issue with some Redis keys 2020-10-28 22:30:49 +00:00
Mark Veidemanis f848b5afd6 Provision users with lowercase names 2020-10-28 22:30:04 +00:00
Mark Veidemanis 3bc65f8456 Add the time field to some notifications 2020-10-28 22:26:41 +00:00
Mark Veidemanis 95ee63e399 Fix circular import in ChanKeep/provisioning modules 2020-10-28 18:38:27 +00:00
Mark Veidemanis a1e045793c
Start implementing prefixes 2020-07-09 19:43:47 +01:00
Mark Veidemanis f50a40d207
Fixes to auth detection and message parsing
* don't check authentication if the network doesn't need to
  register
* don't pass through muser for ZNC type messages
* avoid duplicate message for queries containing highlights
* make a copy of the cast for metadata analysis to avoid poisoning it
* set up callback for when the instance is authenticated, so we can
  request a LIST immediately if so desired
* separate out seeding functions to populate CHANLIMIT to ease future
  work involving other options, such as PREFIX
2020-06-07 17:26:53 +01:00
Mark Veidemanis 4c08225a50
Remove condition-based monitoring system 2020-06-07 15:31:43 +01:00
Mark Veidemanis 11f15ac960
Fix various bugs in the event system
Squash many bugs in the event notification system and simplify the
code.
2020-06-02 21:34:15 +01:00
Mark Veidemanis 8103c16253
Fix syntax error in redis query 2020-05-31 21:54:43 +01:00
Mark Veidemanis 45070b06e2
Implement authentication detection
* pending command to see which instances have never authenticated
* authcheck command to see which instances are not currently
  authenticated
2020-05-31 21:52:56 +01:00
Mark Veidemanis 12db2f349e
Add help for pending command 2020-05-31 16:40:51 +01:00
Mark Veidemanis 40e1f38508
Add additional error handling in user queries 2020-05-31 13:44:34 +01:00
Mark Veidemanis 63c97db12e
Function to select and merge IRC network defs 2020-05-31 13:23:09 +01:00
Mark Veidemanis 91885170f1
Check registration status before joining channels
Do not join channels if any relay for a network is unregistered.
2020-05-31 13:09:58 +01:00
Mark Veidemanis 7c23766763
Allow sending LIST to all networks at once 2020-05-31 13:08:00 +01:00
Mark Veidemanis 9e62ac62bc
Add confirm command
Confirm command to check which relays need manual
confirmation.
2020-05-31 12:32:12 +01:00
Mark Veidemanis 014de9f958
Remove leftover irc.json file 2020-05-30 21:42:26 +01:00
Mark Veidemanis f90f2fdef7
Implement registration and confirmation of nicks 2020-05-30 21:40:10 +01:00
Mark Veidemanis e0549cdd30
Restructure provisioning into fewer functions 2020-05-30 21:37:22 +01:00
Mark Veidemanis a78229a288
Add irc.json to gitignore 2020-05-30 21:35:50 +01:00
Mark Veidemanis 918d410927
Fix variable scope in LIST error handling 2020-04-21 23:32:17 +01:00
Mark Veidemanis bc4d5cba8e
Separate provisioning into user and auth info 2019-12-28 17:51:03 +00:00
Mark Veidemanis 376d1bd911
Add IRC network definitions 2019-12-28 17:50:38 +00:00
Mark Veidemanis 778690ae3a
Add more comments and remove obsolete code 2019-12-07 16:35:29 +00:00
Mark Veidemanis 9c4ea94ebd Add requirements file 2019-11-17 18:52:47 +00:00
Mark Veidemanis a20fcdb8fc Remove some debugging code from ChanKeep 2019-10-31 15:54:07 +00:00
Mark Veidemanis 7ffb6125aa Fix various bugs uncovered by the LIST system
* Work around Twisted's broken handling of spaces
* Work around Twisted's broken line decoding
* Don't run signedOn twice for relays
* Improved detection of whether the endpoint is connected to ZNC
* Delay a LIST until all configured relays are online
* Discard a LIST if there are no callbacks for it
* Get rid of some double-negative ternary blocks
2019-10-31 15:44:59 +00:00
Mark Veidemanis b4fa747853 Fix LIST handling and message parsing
* Always use simple LIST syntax if it succeeded once after a failed
complex query
* Reject asking for a LIST twice
* Quickly discard any ISUPPORT messages that don't contain things we
need to use
* Detect the server name and drop any messages from the server
2019-10-20 16:44:33 +01:00
Mark Veidemanis f34de8940f Improve performance in userinfo
* Implement a nick -> user mapping, preventing a superfluous SSCAN on
the entire dataset for when networks are disconnected
* Use one thread for all channels when a network instance is
disconnected, instead of one thread per channel
* Made returns comprising of only a list into tuples
2019-10-17 20:19:35 +01:00
Mark Veidemanis a64765121a Allow multiple arguments for the logging functions 2019-10-13 12:40:16 +01:00
Mark Veidemanis 5777ef0cfe Improve ZNC error message detection 2019-10-13 12:38:44 +01:00
Mark Veidemanis b97ebe43ab Only start one relay with the auto command
We only need one initial relay, as ChanKeep will automatically add as
many as it needs when receiving a LIST response.
2019-10-13 12:37:01 +01:00
Mark Veidemanis 6ad6d6dc50 Fix channel allocation when relays are provisioned
Fix a bug where the channel allocation algorithm failed due to
necessary relays not having been provisioned yet.
Passed the newly created relay numbers to the allocation function
and assumed their CHANMAX would be the same as all other relays for
the same network.
2019-10-12 21:40:50 +01:00
Mark Veidemanis 0321651c20 Implement fair channel allocation in ChanKeep
* Allocate channels to relays only if they have free space based on
their chanlimit value
* Minify channels by removing ones that are already covered before
passing them off to be joined
2019-10-12 21:05:55 +01:00
Mark Veidemanis 7a6e3338c0 Implement ChanKeep joining functions
* Low-key channel joining with incrementally increasing delay
* Spin up needed instances to be able to cover a certain channel space
* Fix provisioning functions to prevent race conditions with lots of
relays being created at once
* Tweakable switchover from covering all channels to only covering
channels with more users than the mean of the cumulative user count
2019-10-11 13:07:57 +01:00
Mark Veidemanis c3d0cb04b6 Pass all arguments from debug into print
Allows for multi-argument debug() statements without ugly + or %s
operators.
2019-10-11 13:04:58 +01:00
Mark Veidemanis 324af04de0 Don't return the same thing twice
The add_relay and provisionRelay functions both returned the alias.
Only use the output from one function.
2019-10-11 13:02:39 +01:00
Mark Veidemanis f9619a5bc4 Remove help entry for del 2019-10-08 21:12:06 +01:00
Mark Veidemanis 31c9e64790 Implement function to set up multiple relays 2019-10-08 21:11:04 +01:00
Mark Veidemanis 33cb173db6 Switch to using Redis for LIST storage 2019-10-08 21:10:42 +01:00