3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-17 17:39:43 +01:00
Commit Graph

160 Commits

Author SHA1 Message Date
Pragmatic Software
7f49321e29
Commands/Factoids: fix unsetting locked on factoids with cap-override 2024-11-05 16:55:53 -08:00
Pragmatic Software
650bf40a24
Disallow invoking of commands with requires_cap from unlocked factoids
As a security measure to prevent users from creating or modifying factoids to
sneak in commands to trick chanops/admins/botowners/etc into executing those
commands, the command interpreter will now check if the command has been
invoked in the context of a factoid. If so, the factoid must be locked.
2024-11-05 16:48:59 -08:00
Pragmatic Software
9ebc77f4da
Replace preserve_whitespace metadata with condense-whitespace
PBot now preserves whitespace by default. The `preserve_whitespace`
metadata field is now redundant. It has now been replaced with
`condense-whitespace`, which when set to a true value will collapse
adjacent whitespace to a single space.
2024-11-04 00:25:36 -08:00
Pragmatic Software
4c866d39b6
Fix white-space handling; add suppress-no-output 2024-11-03 19:26:56 -08:00
Pragmatic Software
1f232a9455
Applets: Add $context->{interpreted} to exit interpreter loop 2024-11-03 19:22:45 -08:00
Pragmatic Software
b58b778648
Applets: execute_applet() returns defined value to end interpreter loop
Due to recent changes to support continued processing of empty string command
results, ProcessManager::execute_process() now returns undefined value, which
causes Interpreter::interpret() to continue looping through registered command
interpreters after successfully handling a command.

This causes some plugins, i.e. Plugin/Date.pm, to continue the interpret() loop
after successfully handling a command, which causes additional interpreters to
handle the command, leading to both a built-in command an a factoid command
being invoked if they share the same name.

Applets::execute_applet() now returns the defined empty string to let the
interpreter loop know that the command has been handled.
2024-11-03 12:05:39 -08:00
Pragmatic Software
02a0d8ecfb
Commands/Factoids: Fix 4-arg form of factmove; add factcopy
`factmove` arguments now behave more sensibly in that:

* `factmove #channel keyword global keyword` now properly moves/renames
factoids to global channel

* `factmove #channel keyword #channel global` renames the factoid to `global`

* `factmove #channel keyword newname` renames the factoid to `newname`
2024-11-02 18:27:51 -07:00
Pragmatic Software
73c4ed465d
Factoid/Variables: minor refactor, no semantic changes 2024-11-02 17:58:14 -07:00
Pragmatic Software
c6f6823df9
Fix misc white-spacing issues
* func sed no longer trims leading whitespace
* quoted text no longer trims leading whitespace
* no longer convert tabs to spaces in output
* no longer condense adjacent whitespace together in output
2024-11-02 17:57:19 -07:00
Pragmatic Software
af2d9844b8
Interpreter: allow processing of empty result
This fixes .e.g.:

    <pragma-> !echo foo &{echo bar | { sed s/bar// }} baz

such that it produces the output "foo  baz" instead of no output at all.
2024-11-02 17:53:37 -07:00
Pragmatic Software
d8a284e9c1
Core/Interpreter: preserve newlines in commands 2024-10-30 16:37:20 -07:00
Pragmatic Software
f4caf44eb0
split_line(): Remove no longer used next_ch/last_ch 2024-10-29 12:49:19 -07:00
Pragmatic Software
4287cb9fa2
Fix split_line() quoting to be more sh-like
E.g.:

<pragma-> show testcargs
   <PBot> [global] testcargs: /code c11 printf("/say args: " ); while (*++argv) printf("[%s] " , *argv);
<pragma-> testcargs 'hello''world' 'how are 'you today
   <PBot> args: [helloworld] [how are you] [today]

Previously, adjacent 'foo''bar' would end up as 2 args like [foo] [bar]. Now
they are properly concatenated into one [foobar] argument.

This also fixes the cases of whitespace being inserted after quoted arguments.
2024-10-29 10:19:46 -07:00
Pragmatic Software
f542cc0cf2
Core/Factoids: top20: show only defined edited-by for edited sub-command 2024-10-23 22:32:27 -07:00
Pragmatic Software
4345b0a75c
Core/Factoids: update edit-by when factadd -f; add edited to top20 2024-10-23 21:36:21 -07:00
Pragmatic Software
755d7bd6c0
Bug fixes
general.debugcontext: filter out cmdlist and arglist

Core/Applets: log applet start/stop and duration

Core/ProcessManager: fix potential race-condition with $context object

Core/Interpreter:

    * expand pronouns before command-substitution
    * attempt to find current channel's factoid instance for metadata
    * remove duplication of command history in command-substition
    * terminate pipe/substitution processing when protecting self

Core/Factoids: limit -url contents to 250kb
2024-10-22 09:50:10 -07:00
Pragmatic Software
521e8850b0
Core/IgnoreList: allow specifying nickname as channel argument to ignore private messages 2024-10-15 20:05:24 -07:00
Pragmatic Software
597820c053
Core/Factoids: properly restore invalid $variable expansions 2024-10-15 19:56:04 -07:00
Pragmatic Software
646a7f8e7f
Factoids: move /code to after action processing 2024-10-04 22:34:02 -07:00
Pragmatic Software
a453518fab
AntiFlood: add some missing nickserv account case normalization 2024-09-28 12:19:37 -07:00
Pragmatic Software
85c3f1f9f2
AntiFlood: relax default flood values 2024-09-19 13:57:08 -07:00
Pragmatic Software
e39c9ea3ad
WebPaste: sprunge.us dead 2024-09-19 13:56:23 -07:00
Pragmatic Software
6722fd7f8d
Store user passwords as salted hash digests
This was way overdue. User passwords are no longer stored as cleartext.

When PBot is restarted after applying this commit, all stored passwords will
be converted to salted hash digests.

The `useradd`, `userset` and `my` commands will now hash passwords.

Why did it take me so long to finally get around to hashing passwords
properly, you might ask. The reason why this wasn't done sooner is because
all of my users used hostmask-based `autologin`. The passwords that PBot
randomly generated were ignored and never used.

I do regret that it took me so long to get around to this, for those of you
who might be using custom passwords instead of hostmask-based `autologin`.
2024-06-22 22:38:15 -07:00
Pragmatic Software
04209e4b7e
Interpreter: restore preserve_escapes in make_args() to fix sed
Update factoids
2024-06-03 09:07:53 -07:00
Pragmatic Software
80f9ea1acd
Interpreter: escaped spaces behave better 2024-05-26 17:44:59 -07:00
Pragmatic Software
c62b6b9a75
Functions: fix help function signature 2024-05-09 16:10:06 -07:00
Pragmatic Software
5d3f188a09
Multiple bugfixes
* obtain bot nick from connection details instead of registry where appropriate

* irc.random_nick works again

* record own hostmask when connecting

* fix web-paste truncation by subtracting length of own hostmask from message length

* set irc.max_msg_len back to 510

* updated IRC numeric 378 to whoishost

* add sprunge.us to WebPaste
2024-04-07 20:55:04 -07:00
Pragmatic Software
09aed30893
pbot-vm: add PBOTVM_ADDR env var to set address of vm-server 2024-03-31 17:36:36 -07:00
Pragmatic Software
5d3507421e
Plugin/Wordle: fix not detecting duplicate letters 2024-03-09 20:29:25 -08:00
Pragmatic Software
7347fef521
EventQueue: minor whitespace correction 2023-11-14 10:44:43 -08:00
Pragmatic Software
afa124e0d3
Commands/ChanOp: Group multiple unbans/unmutes together into one command 2023-11-14 10:42:16 -08:00
Pragmatic Software
2096df16d6
Factoids: process regex factoids when implicitly invoked 2023-09-24 11:24:20 -07:00
Pragmatic Software
5ffde32d46
Factoids: disregard error messages when not explicitly invoked 2023-09-23 13:52:10 -07:00
Pragmatic Software
fe3e7c80cb
Interpreter: disallow /msg from vm-client 2023-08-19 16:36:26 -07:00
Pragmatic Software
64b4d8a53c Handlers/Server: fix constant look-up (was previously moved from hash to constant) 2023-07-30 16:46:04 -07:00
Pragmatic Software
d4cc3bf7f2 Plugin/ActionTrigger: handle QUIT triggers per-channel 2023-07-19 00:23:54 -07:00
Pragmatic Software
f3ad345340 Core/Interpreter: require whitespace in front of bot name for suffix-trigger 2023-05-21 16:16:06 -07:00
Pragmatic Software
8934936658 Perform anti-flood checking on NOTICEs to channels 2023-05-14 15:56:17 -07:00
Pragmatic Software
48daaa91ca Core/Handlers: Do not auto-reply to NOTICEs 2023-05-14 15:38:51 -07:00
Pragmatic Software
2b36286c22 Interpreter: extract_bracketed: missed a state change 2023-05-11 11:02:16 -07:00
Pragmatic Software
bc05915905 Interpreter: improve parsing of embedded commands 2023-05-11 08:08:38 -07:00
Pragmatic Software
bd6af472e8 Interpreter: remove left-over malformed section 2023-05-11 06:08:26 -07:00
Pragmatic Software
329c8db33c Factoids: fix factrem/forget
Somehow I missed the `remove()` subroutine when converting
to subroutine signatures...
2023-05-07 13:47:25 -07:00
Pragmatic Software
097c657f0c Commands/ChanOp: minor code-formatting clean-up 2023-05-05 18:59:35 -07:00
Pragmatic Software
1bb5fe031d Use quietlist when setting mutes 2023-05-04 16:30:35 -07:00
Pragmatic Software
b04c06f396 Refactor ban/unmute commands 2023-05-04 16:03:24 -07:00
Pragmatic Software
8555e8f00e Core/BanList: correct ban_user() arguments 2023-04-28 00:46:22 -07:00
Pragmatic Software
2c3f8fb9fe Fix some inconsistent arguments 2023-04-21 15:56:43 -07:00
Pragmatic Software
860a6be156 Fix some inconsistent arguments 2023-04-17 10:33:02 -07:00
Pragmatic Software
7ddb32ea16 Update core to use subroutine signatures 2023-04-13 21:04:12 -07:00