]> git.aero2k.de Git - urlbot-v3.git/commit
Add runtime plugin toggle: "bot: plugin activate/deactivate <name>"
authorThorsten <mail@aero2k.de>
Fri, 11 Sep 2026 10:42:33 +0000 (12:42 +0200)
committerThorsten <mail@aero2k.de>
Fri, 11 Sep 2026 10:42:33 +0000 (12:42 +0200)
commit5e90ce4e98a107cdf79230ddf2c393c86915c2d4
treebda81566e85c999f097a2a8fc3ba63df31e3c1ae
parent5e4eb96f030ec358ab08a5e5ba239cea98f9b820
Add runtime plugin toggle: "bot: plugin activate/deactivate <name>"

Worker.callback() now skips parse_body() when plugins.<name>.enabled is
False in persistent_config.ini; the thread and subscription stay up and
history-aware plugins keep recording, so reactivation is instant. The
help plugin implements the (previously stubbed) activate/deactivate
command, restricted to nicks listed in the new "admins" local config key
and refusing to deactivate itself.

Since the gate runs once per delivered message per worker, Config() now
shares one parsed store per process, reloaded only when an ini file's
mtime/size changes. get() no longer merge()s local into the runtime
store - with a shared store that would have leaked credentials into
persistent_config.ini on the next write.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KJp2rEnVtsgbH7FLj3jubx
deploy/roles/urlbot/tasks/main.yml
src/distbot/bot/worker.py
src/distbot/common/config.py
src/distbot/common/config/local_config.ini.spec
src/distbot/common/config/persistent_config.ini.spec
src/distbot/plugins/plugin_help.py
tests/test_unit/test_config.py [new file with mode: 0644]
tests/test_unit/test_plugin_toggle.py [new file with mode: 0644]
tests/test_unit/test_worker_callback.py