I don't know but many years ago I ran an admin bot on a non-WMF wiki.
A separate sysopnames variable was used to specify a user with admin
credentials. Sysopnames was removed from pywikibot and whereas I've
never used it, the theory is that now you have only a single bot user
as defined in usernames. Pywikibot uses that user for normal actions
and for admin actions. If admin privilege is needed, I think it first
checks if the user has the required privilege. Some info on what I'm
saying is at
https://www.mail-archive.com/pywikibot@lists.wikimedia.org/msg00712.html
So if you had
usernames['wikisource']['de'] = 'Example'
where Example has the bot and sysop flags, it should work. Try a
simple script to delete a junk user subpage and report what happens. I
don't know if it's possible with MediaWiki, but it's conceivable that
pywikibot does not give itself admin credentials unless required
(which might explain your debug results).
Johnuniq
On Tue, Sep 6, 2022 at 3:43 AM Erik Sommer <ersotech(a)posteo.de> wrote:
>
> No worries,
>
> I do software dev for a living. It's all local and no one is checking in
credentials. But that wasn't really the question here.
>
> On 05.09.22 17:21, Roy Smith wrote:
>
> I'm a total newbie at pywikibot, but let me address the general issue of putting
credentials in config files.
>
> Be very wary of how you store credentials. You should make sure they're in a
file which is read-protected, and not in source control. Otherwise the entire world will
have access to your secret credentials.
>
>
>
> On Sep 5, 2022, at 10:14 AM, Erik Sommer <ersotech(a)posteo.de> wrote:
>
> Hi list,
>
> I operate currently a bot on the German Wikisource. The bot was granted both groups,
admin and bot. It is intended to be used as automated protection bot. I'm having
trouble to put the right credentials in my user-config.py.
>
> It is currently coded like following pseudo-code:
>
> # -*- coding: utf-8 -*-
>
> family = 'wikisource'
> mylang = 'de'
> usernames['wikisource']['de'] = '******'
>
> authenticate['de.wikisource.org'] = (....*****.....)
>
> the problem with this is that the framework only detect my bot as bot not as
sysadmin. Groups taken from the debugging output: ['bot', '*',
'user', 'autoconfirmed']
>
> What do I have to add to my config, that the bot also get picket up as sysadmin? I
already read (
https://www.mediawiki.org/wiki/Manual:Pywikibot/user-config.py) but
doesn't make sense for me. It will not change anything if add the botname a second
time to the usernames dictionary.
>
> Best Regards
>
> Erik Sommer
>
> _______________________________________________
> pywikibot mailing list -- pywikibot(a)lists.wikimedia.org
> To unsubscribe send an email to pywikibot-leave(a)lists.wikimedia.org
>
>
>
> _______________________________________________
> pywikibot mailing list -- pywikibot(a)lists.wikimedia.org
> To unsubscribe send an email to pywikibot-leave(a)lists.wikimedia.org
>
> _______________________________________________
> pywikibot mailing list -- pywikibot(a)lists.wikimedia.org
> To unsubscribe send an email to pywikibot-leave(a)lists.wikimedia.org