11991 Commits

Author SHA1 Message Date
James Lu
83d301c604 NickAuth: refer to "services accounts" instead of "nicks" in help
On modern networks, account names are usually separated from your current nick,
so the idea of registering "nicks" is confusing. For instance, you can be using
a grouped nick that is not your main account name, and WHOIS will only ever
show your main account name.

Also, the bot username is optional in the `add` and `remove` commands - update
the docs to reflect that.
2025-04-20 08:03:19 +02:00
Valentin Lorentz
c81ff28697 registry.Json: Fix broken test due to returning the internal state directly 2025-04-06 10:19:17 +02:00
Valentin Lorentz
c795cdc655 registry.Json: Fix serialization/deserialization points
self.value should be the deserialized value (because we set
'self.value = default' in registry.close()), so
setValue()/__call__() should return it as-is.

Doing otherwise failed serialization of the default, and crashed
with the same error as in https://github.com/progval/Limnoria/issues/1604
since 8ec873015aac3ba4193a2d498eb294975615b296
2025-04-06 09:00:25 +02:00
Valentin Lorentz
ccf26351f5 Make supybot.plugins.Web.urlWhitelist channel-specific 2025-03-29 22:38:04 +01:00
Valentin Lorentz
35731acd86 Log current version on startup
We recently got a bug report from someone running Limnoria in Docker, and it turned
out that a plugin's import was segfaulting and Docker silently restarted the process.

I wasted some time figuring out what happened because I didn't notice the process
was being restarted. This should make this more noticeable in the future.
2025-03-28 22:11:20 +01:00
Mattia Rizzolo
a558d1d95b Fix errors reported by msgfmt on Russian translations
gettext: locales/ru.po:1922: 'msgid' and 'msgstr' entries do not both begin with '\n'
locales/ru.po:1935: 'msgid' and 'msgstr' entries do not both begin with '\n'
msgfmt: found 2 fatal errors
gettext: plugins/Anonymous/locales/ru.po:101: 'msgid' and 'msgstr' entries do not both begin with '\n'
msgfmt: found 1 fatal error
gettext: plugins/NickAuth/locales/ru.po:29: 'msgid' and 'msgstr' entries do not both begin with '\n'
msgfmt: found 1 fatal error
gettext: plugins/PluginDownloader/locales/ru.po:84: 'msgid' and 'msgstr' entries do not both begin with '\n'
msgfmt: found 1 fatal error

Signed-off-by: Mattia Rizzolo <mattia@mapreri.org>
2025-03-17 11:07:44 +01:00
Valentin Lorentz
4f9734935a ChannelStats: Fix crash caused by expectation of __str__ being called before setValue
This assumption no longer true since
8ec873015aac3ba4193a2d498eb294975615b296.
2025-02-07 22:47:56 +01:00
Val Lorentz
e57f7ebc2a
Add support for Python 3.14.0-alpha1 master-2024-12-22 2024-12-20 07:58:40 +01:00
Val Lorentz
ab25c3e039
Clarify semantics of vhost/vhostv6 2024-12-20 07:57:41 +01:00
Val Lorentz
aaeab253a5
Fix interference of wrap() and internationalizeDocstring()
Most commands are decorated with @internationalizeDocstring then with wrap().
wrap() itself calls internationalizeDocstring(), so that plugins
wrapping with @internationalizeDocstring() is now optional; but many
still do it.

This means that docstrings went twice through the
_PluginInternationalization.

This fixes the bug that on the second run, it would try to translate
again the translated message, which fails (because the translated
message is not in English); and then fell back to the original string
(which is in English).

This commit changes the behavior to return the already-translated string
directly instead.
2024-12-20 07:57:23 +01:00
Valentin Lorentz
912e334f6b Math: Round trailing nines up in @convert 2024-12-19 21:34:28 +01:00
Valentin Lorentz
56e06a9ce8 i18n: Remove hacks for Python 2 2024-12-19 21:33:56 +01:00
Valentin Lorentz
467fd5472f Fix loading core locales on editable installs
On editable instances, ansi.py is in the src/ directory, so that's where i18n.py
looks for locales.
2024-12-19 21:33:40 +01:00
ssdaniel24
993cb2355c
Add --random flag for 'rss' command 2024-12-07 12:38:53 +01:00
Valentin Lorentz
941d3121eb Fix comment grammar 2024-12-06 12:49:00 +01:00
Valentin Lorentz
b76a6db1a9 Regenerate .pot files 2024-12-06 11:01:09 +01:00
Valentin Lorentz
4b79a64db6 Add support for negative integers options following getopt 2024-11-30 20:40:34 +01:00
Stathis Xantinidis
92a7b05e4c added spithash repo
My plugins repo. All of them are mine with an exception of DuckHunt in which I made an emoji enhancement.
2024-11-21 20:50:30 +01:00
Valentin Lorentz
fd42132771 Web: Fix <title> extraction in presence of nested <svg> 2024-11-16 10:50:15 +01:00
Claire
8ec873015a
registry: Fix some config values being reset when running upkeep
For example, with `supybot.protocols.http.proxy`:

When upkeep is being executed, it runs the flushers:

246f4d3e62/src/world.py (L148-L150)

In the main limnoria script, it registers a flusher that saves the registry to disk:

246f4d3e62/src/scripts/limnoria.py (L243-L252)

When saving the registry to disk, the code instantiates the class with its default value to print it out in the file:

246f4d3e62/src/registry.py (L149-L159)

Instantiating the class calls `setValue()` by default:

246f4d3e62/src/registry.py (L347-L348)

supybot.protocols.http.proxy uses a custom type that changes global state when `setValue()` is called:

246f4d3e62/src/conf.py (L1416-L1432)


Fixed GH-1349.
2024-10-23 20:19:37 +02:00
Valentin Lorentz
cb51940b42 Web: Remove debug print 2024-10-22 18:59:24 +02:00
Valentin Lorentz
246f4d3e62 ircdb: Fix hostmask conflict resolution in getUserId
When the first of the two conflicts comes from a transient hostmask set by NickAuth,
the first value in the 'ids' dict would be True, which causes a silly log message,
then Limnoria silently crashes to self.users[id].removeHostmask(hostmask) and then
does not remove the next hostmask which is responsible for the conflict.
2024-10-20 20:40:35 +02:00
Val Lorentz
54c0980978
CI: Replace Python 3.13.0-alpha.6 with 3.13.0 (#1598) master-2024-10-19 2024-10-19 08:51:27 +02:00
Valentin Lorentz
b13ebebc83 Web: Add workaround for minified Reddit URLs 2024-10-14 08:35:00 +02:00
Codimp
2aa1f916b0
Unix: Fix IPv6 formating of @ping command (#1595) 2024-10-04 20:00:07 +02:00
Valentin Lorentz
6f6f952338 Factoids: Fix search results when single key matched
1. Display the key itself (in addition to the values), because
   searching factoids makes little sense without returning the key
2. Display only matching values, instead of all other values,
   because some filters act on values
master-2024-08-28
2024-08-26 18:38:36 +02:00
ssdaniel24
6abf54103a
Updated russian translation based on updated messages.pot 2024-08-25 10:32:08 +02:00
Val Lorentz
603cb600aa
Fix NormalizedString serialization splitting within escape sequences.
Resolves #1589
2024-08-25 10:20:16 +02:00
Valentin Lorentz
b075a94396 Add config value supybot.reply.mores.instant.whenPrivate
This allows overriding supybot.reply.mores.instant for private messages, where
it is usually more tolerable to send multiple lines.

However, this still defaults to 1, in order to not be abusable by default.
2024-08-24 11:55:43 +02:00
Valentin Lorentz
04e0bd4271 plugin-doc: Prevent hyphenation of -- in command syntax 2024-08-24 09:48:38 +02:00
Valentin Lorentz
c56fc5aa81 Web: Add youtu.be to Youtube's domain list 2024-08-15 23:03:31 +02:00
Valentin Lorentz
72e90b6972 Use cProfile instead of profile
I can't open .prof files created with 'profile' using pyprof2calltree:

```
Traceback (most recent call last):
  File "/home/val/.local/bin/pyprof2calltree", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/val/.local/lib/python3.11/site-packages/pyprof2calltree.py", line 339, in main
    kg = CalltreeConverter(pstats.Stats(args.infile))
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/val/.local/lib/python3.11/site-packages/pyprof2calltree.py", line 178, in __init__
    self.entries = pstats2entries(profiling_data)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/val/.local/lib/python3.11/site-packages/pyprof2calltree.py", line 135, in pstats2entries
    cc, nc, tt, ct = call_info
    ^^^^^^^^^^^^^^
TypeError: cannot unpack non-iterable int object
```
2024-08-02 07:49:46 +02:00
Valentin Lorentz
bb120edbb1 Fix --profile
Broken by 0572d499883ba1f320a01f0125b00c5962fdc2cd
2024-08-01 22:39:56 +02:00
Val Lorentz
10a341c70c
Merge pull request #1546 from progval/account-ban
Add support for account-based channel bans
master-2024-07-25
2024-07-24 21:12:01 +02:00
ssdaniel24
f7b847091a
Added russian locale to limnoria (#1585)
Translated with lokalise.com
2024-07-24 21:06:09 +02:00
ssdaniel24
2f8e1e5dff Added russian locale to NickAuth plugin 2024-07-20 21:47:46 +02:00
Valentin Lorentz
d8115e6f3d dbi.FlatfileMapping: Fix listing records on Windows
All other methods open the file as UTF-8, but this one still used
the system's default.
2024-07-20 19:34:06 +02:00
Valentin Lorentz
be3dae3558 Add test the bot won't account-extban itself 2024-07-19 16:41:46 +02:00
Valentin Lorentz
917e3019bc Fall back to banning host instead of exact mask
This only happens on the newly introduced account extban (in case the user
does not have an account, or the server does not provide accounts)
so this does not change existing behavior.

Falling back to the host instead of the exact mask makes it less easy
to evade these bans
2024-07-19 16:41:14 +02:00
Valentin Lorentz
54f7b5a5b6 When only --account is provided, fallback to supybot.protocols.irc.banmask before exact mask 2024-07-19 13:34:18 +02:00
Valentin Lorentz
cf63674f7c Fix parenthesis in docstring 2024-07-19 13:20:28 +02:00
Valentin Lorentz
cf1231df4e Merge branch 'master' into account-ban 2024-07-19 13:18:08 +02:00
Valentin Lorentz
cadc8f93ab Cowardly refuse to ban oneself with an account extban 2024-07-19 13:11:56 +02:00
James Lu
bc852379f5 Remove adding force to builtins (#1535) 2024-07-17 22:05:48 +02:00
Val Lorentz
9fceb85c41
ci: Bump Pypy version (#1575)
* ci: Bump Pypy version

* Math: update test

* cryptography doesn't work on pypy3.10
2024-07-17 22:00:42 +02:00
Valentin Lorentz
b3f256681f Services: Fix crash in __call__
When a password is added for a nick that is not a valid config entry name,
this causes _getNickServPassword to raise an error; and __call__ needs
to catch it or the bot becomes unusable.
2024-07-11 16:57:41 +02:00
Pratyush Desai
01cdfee53e
Karma: ignore trailing chars, spaces, tabs (#1579)
Signed-off-by: Pratyush Desai <pratyush.desai@liberta.casa>
2024-06-27 19:05:11 -07:00
Valentin Lorentz
7ccaeb088a GPG: Import documentation removed from the Getting Started guide 2024-06-15 08:20:01 +02:00
ssdaniel24
bd4a85ba08
Aka, Anonymous, PluginDownloader, Seen, Todo: Add russian locale 2024-06-12 22:44:48 +02:00
Valentin Lorentz
f5302f0bfc safeEval: Fix support for Python 3.14 master-2024-05-31 2024-05-30 22:00:54 +02:00