Use MediaWiki-Vagrant or a similar system to automate provisioning and configuring a local development environment for IABot.
IABot code: https://github.com/cyberpower678/Cyberbot_II
Use MediaWiki-Vagrant or a similar system to automate provisioning and configuring a local development environment for IABot.
IABot code: https://github.com/cyberpower678/Cyberbot_II
Project | Branch | Lines +/- | Subject | |
---|---|---|---|---|
mediawiki/vagrant | master | +338 -1 | InternetArchiveBot role |
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | Cyberpower678 | T120433 Migrate dead external links to archives | |||
Resolved | Cyberpower678 | T140377 Build robust testing framework for InternetArchiveBot (epic) | |||
Resolved | bd808 | T141799 Create automated install/repeatable dev environment for IABot | |||
Resolved | MusikAnimal | T141797 Figure out how to setup local dev environment for testing IAbot |
Change 302350 had a related patch set uploaded (by BryanDavis):
[WIP] InternetArchiveBot role
@bd808: I get 2 warnings when I provision this role:
default: Warning: Scope(Class[Role::Iabot]): Could not look up qualified variable '::mediawiki::server_url'; class ::mediawiki has not been evaluated default: Warning: Scope(Class[Role::Iabot]): Could not look up qualified variable '::mediawiki::server_url'; class ::mediawiki has not been evaluated
right after:
default: Info: Loading facts in /vagrant/puppet/modules/stdlib/lib/facter/root_home.rb
Is there something else I need to configure first. I haven't seen this with other roles I've enabled.
No, that was just forgetting to make the dependency on ::role::mediawiki explicit. Hopefully https://gerrit.wikimedia.org/r/#/c/302350/8 will fix that.
No warnings now, but if I try to go to http://127.0.0.1:8080/wiki/User:InternetArchiveBot, it says: User account "InternetArchiveBot" is not registered.
@bd808: Running the deadlink.php script gives me the following error:
ERROR: Invalid identify response: {"error":"mwoauth-oauth-exception","message":"An error occurred in the OAuth protocol: Invalid signature"}
I can reproduce that locally with e961e43 (Update IABot to v1.2beta) checked out. I'll see if I can figure out what has changed in the code and needs to be updated in the generated config.
This regression should be fixed now. I'm not sure how I messed up the 6 magic numbers that make up the OAuth grant keys, but recreating them from scratch seems to have fixed things. I also converted the on-wiki config page to the new js/json format.
This time I got the following error when trying to provision the role:
Error: Could not find dependency Mediawiki::Maintenance[Pass 0 of CentralAuth] for Mediawiki::Maintenance[migrate_user_VagrantInternetArchiveBot_to_centralauth] at /vagrant/puppet/modules/role/manifests/centralauth/migrate_user.pp:21
Blerg. That sounds like my check for CA being enabled is not written correctly. I'll look into it.
@Cyberpower678 https://gerrit.wikimedia.org/r/#/c/302350/ is a patch to add a role to the MediaWiki-Vagrant project that clones the Cyberbot_II repo and sets up configuration for IABot and the local wiki in the Vagrant manged virtual machine. You can test it out by installing MediaWiki-Vagrant, applying the patch, and running vagrant roles apply iabot; vagrant up. After Vagrant is done running you can ssh into the virtual machine and run the bot:
$ vagrant ssh $ cd /vagrant/srv/iabot/IABot/ $ php deadlink.php
Hmm, now it's back to giving me:
Logging on as VagrantInternetArchiveBot...Failed!! ERROR: Invalid identify response: {"error":"mwoauth-oauth-exception","message":"An error occurred in the OAuth protocol: Invalid signature"}
That's with patchset 12 and a fresh reprovision.
I'm pretty sure that this is caused by T143448: Unconditionally setting $wgOAuthSecretKey in MWOAuthHooks::onExtensionRegistration breaks LocalSettings.php override. I'll see if I can fix that bug and then retest.
The problems with OAuth signatures not working were caused by a change in the configuration layer of the OAuth extension (https://gerrit.wikimedia.org/r/#/c/305739/). I should have tracked this down when the original configuration data stopped working. That should be fixed in master now, but you will need to run vagrant git-update or manually update your mediawiki/extensions/OAuth clone.
Now I just get the rather generic error...
Logging on as VagrantInternetArchiveBot...Failed!! ERROR: Missing authorization or authorization failed
Started from a totally clean VM and got the following error...
PHP Warning: mysqli_connect(): (HY000/1045): Access denied for user 'iabot'@'localhost' (using password: YES) in /Users/kaldari/Sites/vagrant/srv/iabot/IABot/DB.php on line 442 Warning: mysqli_connect(): (HY000/1045): Access denied for user 'iabot'@'localhost' (using password: YES) in /Users/kaldari/Sites/vagrant/srv/iabot/IABot/DB.php on line 442