Commit Graph

11724 Commits

Author SHA1 Message Date
Valentin Lorentz
070090ffc5 LogToIrc: Honor the configured log level 2021-09-13 19:05:42 +02:00
Valentin Lorentz
76bd1c89bf Socket: Gracefully handle invalid lines with UTF8ONLY
Just skip the line, instead of crashing the whole loop (which
contains the next lines from the same server too)
2021-09-13 18:45:49 +02:00
Valentin Lorentz
ee9f0dc1bf STS: When persisting STS keys, use the actual port instead of the one from the policy
'Servers MAY send this key to securely connected clients, but it will be ignored.'
-- https://ircv3.net/specs/extensions/sts\#the-port-key
2021-09-03 20:15:18 +02:00
Valentin Lorentz
74073b2736 irclib: Log the server's error message on SASL failure. 2021-09-01 18:25:54 +02:00
Valentin Lorentz
e63858659a Fediverse: Better assertionerror messages 2021-08-28 23:48:19 +02:00
Valentin Lorentz
52a5cefd50 Move stripformatting from Format to Filter, for consistency 2021-08-28 23:37:21 +02:00
Valentin Lorentz
d593f84a66 Socket: disable charset heuristics when the server advertizes UTF8ONLY. 2021-08-27 19:03:18 +02:00
Valentin Lorentz
db05081ff6 commands: fix _checkUrl 2021-08-25 23:28:25 +02:00
Valentin Lorentz
0131cd0691 commands: Add converters for IRIs
Since the 'url' and 'httpUrl' converters no longer support them...
2021-08-25 21:55:31 +02:00
Valentin Lorentz
be88530fa4 commands: Disallow IRIs from 'url' and 'httpUrl' converters.
urllib doesn't support IRIs, and gives out a cryptic
'UnicodeEncodeError: 'ascii' codec can't encode character ...'
if we don't validate it.
2021-08-25 21:54:55 +02:00
Valentin Lorentz
62db3a92fc callbacks: Print unexpected commands 2021-08-25 21:29:19 +02:00
Valentin Lorentz
ca624d7ae6 RSS: Fix nondeterministic test failures
Caused by 'rss announce add' triggering headline announces, that would
delay the execution of the 'remove' commands.

Thanks to @mapreri and @Unit193 for help in reproducing the issue
and confirming the patch.
2021-08-22 19:23:05 +02:00
Valentin Lorentz
0c8e455b4e RSS: When deleting a named feed, preserve anonymous feed of the same URL. 2021-08-22 19:21:28 +02:00
Valentin Lorentz
cbd2b31d8f Add error message in case setuptools is not installed. 2021-08-12 21:32:24 +02:00
Ian Wienand
37ba0ef7be setup.py: switch import to setuptools
Switch to standard setuptools import, add suggested entries to
pyproject.toml.

Remove the --clean argument.  As the comment suggests I'm sure there
is history here, but having setup.py remove parts of the package does
not seem like something required at this point.

Also clean up the imports to remove unused and group them together at
the top.
2021-08-12 21:23:48 +02:00
Valentin Lorentz
49b9a9ab74 Add missing (optional) dependency, pyxmpp2-scram 2021-08-12 20:00:25 +02:00
James Lu
09392478e6
getUrlFd: chain the original exception so that plugins can handle them further (#1487) 2021-08-01 13:35:45 -07:00
Valentin Lorentz
db7ef3f025 all: Add generic 'The Limnoria Contributors' to copyright notices.
No need to bother with details (that are all outdated / out of sync
anyway), just look up the git history.
2021-08-01 21:54:49 +02:00
Valentin Lorentz
a86b2a62ab More verbose irctest logging.
trying to figure out why it freezes on the CI...
2021-07-31 17:57:53 +02:00
Valentin Lorentz
747ef77106 Fix tests when pyxmpp2_scram is not installed. 2021-07-31 14:40:44 +02:00
Valentin Lorentz
c008d1191c RSS: Fix crashes when the set of channels changed while iterating. 2021-07-31 14:33:34 +02:00
Valentin Lorentz
ade5a02457 Fix/update SASL tests, broken by the previous commit. 2021-07-31 13:05:39 +02:00
Valentin Lorentz
5e2c2122aa Add as scram-sha-256 prefered SASL mechanism. 2021-07-31 11:40:28 +02:00
Valentin Lorentz
406369d53f Expose standardSubstitute's var dictionary
So it can be reused by plugins if they want to use a different templating
engine.
2021-07-21 09:45:28 +02:00
Valentin Lorentz
8fe517f48a irclib: Fix previous commits so RPL_NAMREPLY actually works
Turns out irclib parses ISUPPORT PREFIX properly, so it's not just
a raw string; but I didn't test the change live...
2021-07-16 22:53:38 +02:00
Valentin Lorentz
45c7615f4a irclib: Properly populate nickToHostmasks on RPL_NAMREPLY
It used to set the nick instead of the hostmask as values...
2021-07-16 19:53:25 +02:00
Valentin Lorentz
d308329461 irclib: Fix support of power prefix chars in RPL_NAMREPLY
nickFromHostmask now (legitimately) complains when it's getting @ or !
at the beginning of a hostmask; so we need to strip them before passing
it to nickFromHostmask.

Then re-add them before calling c.addUser, because it uses them to
sort users in the right sets (ops/halfops/voices).

Additionally, this commit replaces the hardcoded set of prefix chars
(`@%+&~!`) with the one advertised in ISUPPORT when possible.
2021-07-16 19:50:13 +02:00
Valentin Lorentz
aa6bd7257d Deprecate Python 3.4 and 3.5. 2021-07-15 22:29:56 +02:00
Valentin Lorentz
bdb80b196a Switch from Travis-CI to Github Actions
Travis is dead now.

Closes GH-1481.
2021-07-15 22:19:03 +02:00
Valentin Lorentz
0f1011081e Socket: Fix cascading crash when Socket.run() crashes.
When a driver's run() method crashes, supybot.drivers.run() marks it
as dead and sets its 'irc' attribute to None.

This would be fine for "normal" independent drivers (like Socket used
to be), because this driver would never be called again.

But now that we use select(), some other thread may hold a reference
to this driver in a select() call frame, and call the dead driver's
'_read()' method when there is data to be read from the socket.

There is already a safeguard in '_read()' in the case the socket could
be read from, but this safeguard was missing from _handleSocketError.
This caused the "live" driver's select() to crash, which propagagated
to its run(), which caused the driver to be marked as dead, etc.

Eventually, all drivers could die, and we end up with the dreadful
"Schedule is the only remaining driver, why do we continue to live?"
in an infinite loop.
2021-07-14 23:55:31 +02:00
Valentin Lorentz
e19282a2d3 Actually parse weird hostmasks like RFC1459 recommends
Thanks to @Noisytoot for pointing out the RFC actually specific them
with this:

<user>       ::= <nonwhite> { <nonwhite> }
2021-07-14 23:43:11 +02:00
Valentin Lorentz
5baf87ddba ircutils: Improve robustness when faced with invalid hostmasks
eg. @ in nicks, which happened on pissnet earlier today.
2021-07-14 23:25:11 +02:00
Valentin Lorentz
0af4af16d3 RSS: Fix random test failure
Closes GH-1479
2021-07-04 10:46:51 +02:00
James Lu
64ae28c0b8 Remove references to my old nick 2021-07-03 16:42:13 -07:00
Valentin Lorentz
b8aa5aa33e User: Make @register automatically add the account tag
No need for '@nickauth nick add' right after registering anymore.
2021-06-30 21:28:17 +02:00
Valentin Lorentz
c23227cdc7 MessageParser: Show error when the action has a syntax error
Instead of being silent
2021-06-28 23:10:36 +02:00
Valentin Lorentz
6b72672a1e Poll: Fix typo in documentation 2021-06-28 23:10:36 +02:00
1952dae6f7 src/conf.py: fix typo in supybot.reply.error.withNotice
Co-authored-by: MetaNova <MetaNova@users.noreply.github.com>
Co-authored-by: Val Lorentz <progval+github@progval.net>
2021-06-26 01:23:36 +02:00
James Lu
a7216d290f Remove Spanish translations as requested by the author 2021-06-24 22:36:04 -07:00
Tim Gates
649048443e
Fix a few simple typos (#1476)
Closes #1475
2021-06-21 01:07:50 +02:00
Valentin Lorentz
65ab65cbb1 irclib: Fix crashes when ERROR is part of a batch. 2021-06-20 23:59:51 +02:00
Valentin Lorentz
a7c4c9bd78 Poll: Document usage. 2021-06-19 16:56:17 +02:00
Valentin Lorentz
936d7ebfea Poll Disallow 0 as poll id. 2021-06-19 16:48:40 +02:00
Valentin Lorentz
d919e2133d Poll: Initial commit with basic features. 2021-06-19 16:44:21 +02:00
Valentin Lorentz
3b25a94b46 Regenerate READMEs. 2021-06-19 16:44:21 +02:00
Valentin Lorentz
2293d1c129 Services: Update to the latest version of the draft/account-registration spec. 2021-06-15 20:35:55 +02:00
Clark Boylan
67a39a3adb
Fix joins to many channels (#1473)
* Fix joins to many channels

If you have enough channels that the 512 byte message limit on the JOIN
message is hit then limnoria was losing the channel that put it over the
limit and not including it in the next JOIN message. This resulted in
losing one channel for every JOIN message that pushed us over 512 bytes.

We fix this by generating the JOIN message immediately after resetting
the channels list to ensure we include the channel that pushed us over
the limit. Then the next time through our JOIN msg construction we'll
add subsequent channels without forgetting the one that pushed us over.

* Add test for channel join lists

This adds a test for the issue that is fixed in the previous commit. We
ensure that when JOINs are split over multiple messages we JOIN to all
channels that were part of the input list and don't forget any of them.
2021-06-14 23:15:43 +02:00
Valentin Lorentz
4b82934131 Services: Add @nickserv and @chanserv command, to message services directly
This is because the recommended method ('owner ircquote nickserv register mypassword bot@example.com')
does not work on charybdis, as Limnoria inserts a colon
before the trailing argument and Charybdis' m_alias module
does not parse commands using the IRC syntax, so it
considers the leading colon to be part of the email address.

The alternative would be to change the recommended command to:
'owner ircquote PRIVMSG nickserv :register mypassword bot@example.com'
but it is prone to typos, so I think we should avoid it.
2021-06-14 21:47:36 +02:00
Valentin Lorentz
c8053dad54 Socket: Silence TLS warning for Tor hidden services.
They are already end-to-end encrypted and don't need TLS.
2021-06-12 21:03:15 +02:00
Valentin Lorentz
69c948bd5f irclib: fix _getTarget when to= is given and self.private=True 2021-06-08 21:56:42 +02:00