Undocumented and contradictory hostmask support in owner
and admins
settings
#2587
Labels
Documentation
Housekeeping
Code cleanup, removal of deprecated stuff, etc.
Long-term Planning
Things that need to happen at some point in the future, but need to NOT happen soon.
Milestone
There is a contradiction between Sopel's docs for the
core.owner
andcore.admins
settings, and how those values are actually used.What's wrong?
According to the docs, under both "The [core] configuration section" and "Core Config Section" pages, examples show only nicknames under both of these settings. But internally, a
Trigger
can treat them asuser@host
regex patterns, too:sopel/sopel/trigger.py
Lines 548 to 563 in 6fc9eee
This ability doesn't appear anywhere in the documentation, perhaps because it breaks intended usage of the setting values in other places.
core.owner
, for example, is used incoretasks
and third-party plugins as the target for important messages about the bot's configuration or errors. That value must be a nickname, not auser@host
regex, for those uses to work.How should we fix it?
We already have
owner_account
andadmin_accounts
, which are used if the server supportsaccount-tag
or otherwise attaches a services account name to messages in a way that Sopel can parse.As a middle ground, there should exist
owner_host
andadmin_hosts
settings. The names are subject to revision, but their function is clear: Stricter controls on owner/admin identification beyond simple nickname matching, where account matching isn't available.I propose a tiered enforcement system like this, described for
owner
but applied to both (just to save me some typing):owner
set: Match on nickname@
or other nick-invalid characters in one of theowner
oradmins
values.owner
andowner_host
set: Match onuser@host
owner
andowner_account
set: Match on account nameowner
,owner_host
, andowner_account
set: Match account nameIn summary, if either
host
oraccount
settings exist, nickname matching is ignored, period. Theaccount
always takes priority, same as it does now; if the IRCd has services accounts, we defer to its authorization mechanism(s).But what about admins?
Yes, I said that the above would apply to admins, but there's another consideration: Sopel can have only one owner, but multiple admins. We might need to validate the configuration by comparing the length of
admins
andadmin_accounts
, though there are plenty of cases I could see whereadmin_accounts
oradmin_hosts
would not be the same length as anadmins
list based on nicks only. (Grouped nicks and common host cloaks are just two of many possibilities.)The text was updated successfully, but these errors were encountered: