[00:04:42] we have the ability to suppress them but that's only supposed to be used if you like, put someone's address in your application description [00:05:33] but yes, they can be disabled [00:48:39] @Gouvernathor "why is oauth so hard" is such a great question :-) [00:49:47] It's a good concept, but the spec is so needlessly complicated. [00:50:18] Does anyone know how the wikimedia commons API works ? [00:50:19] I'm trying to make (renovate actually) a toolforge tool where a user can oauth and have an image uploaded on Commons in their name. [00:50:19] I think I have the upload post request working (theoretically) but I don't understand how the authentication for that precise action works. The mediawiki page explains how to use a bot username and password through the login API request, but that's not what I want to do... [00:50:41] full of choices you have to make, and terms that are poorly defined. [00:51:14] I'm using the mwoauth python module, if that helps [00:51:33] so I have an acces_token returned by the mwoauth.complete function [00:51:50] a token which auths the user of my website [00:53:45] I use OAuth in my spi-tools. This example may or may not be of any use to you: https://github.com/roysmith/spi-tools/blob/2080f436d6aeb7d49346241c3dfa356d479b2d19/wiki_interface/wiki.py#L87 [00:55:06] I'm using flask, not django [00:55:32] If I had to do this all over again, I would use flask too :-) [00:56:31] but there's really nothing that's django-specific here [00:56:59] It does depend on mwclient, however, which is kind of unpopular these days. [00:57:46] hm, that's the one [00:58:00] it's not been updated since 2020, so... [00:59:24] yeah, it's pretty old. These days, most people use pywikibot, but I've always found that difficult to use. [00:59:59] It does too much, and touches too many things it shouldn't be touching as a stand-alone library. [01:05:08] I'm looking at https://pythonhosted.org/mwoauth/ [01:06:02] It's difficult because it's necessary. I had to create a PHP library from scratch to make mediawiki's oauth work (due to my stubbornness), but the process gave me several interesting insights. (re @wmtelegram_bot: (why is oauth so hard)) [01:13:35] (Tbh you shouldn't be rolling your own OAuth library) :) [01:20:08] I need to juggle with all of oauth, wmoauth, requests, some old PHP code that no longer works, and the mediawiki API, all while not sending spammy requests to Commons [01:22:02] well, it will certainly be clearer tomorrow (if anyone has experience with the MediaWiki API, do please tell, I'll see it on Telegram) [01:25:18] Idk... maybe I can help. Find me on telegram, so we dont spam this channel. (re @wmtelegram_bot: well, it will certainly be clearer tomorrow (if anyone has experience with the MediaWiki API, do please tell, I'l...) [12:59:45] !log melos@tools-bastion-13 tools.stewardbots Restarted StewardBot/StewardBot because of a connection loss [12:59:48] Logged the message at https://wikitech.wikimedia.org/wiki/Nova_Resource:Tools.stewardbots/SAL [13:00:32] !log melos@tools-bastion-13 tools.stewardbots SULWatcher/manage.sh restart # SULWatchers disconnected [13:00:33] Logged the message at https://wikitech.wikimedia.org/wiki/Nova_Resource:Tools.stewardbots/SAL [13:49:06] !log lucaswerkmeister@tools-bastion-13 tools.lexeme-forms deployed 48a5585566 (support opting out of Wikifunctions mode) [13:49:08] Logged the message at https://wikitech.wikimedia.org/wiki/Nova_Resource:Tools.lexeme-forms/SAL [13:59:01] Hey, it's me again... [13:59:43] I finally, probably, made the OAuth work, but I'm having permission problems when uploading a file on Commons [14:00:20] I'm having the permissiondenied error, with the following message "The action you have requested is limited to users in one of the groups: [[Commons:Users|Utilisateurs]], [[Commons:Autoconfirmed users|Utilisateurs autoconfirmés]], [[Commons:Administrators|Administrateurs]], [[Commons:Confirmed users|Utilisateurs confirmés]]." [14:01:58] You'll notice that some of that is in french, and I don't know if it's because of the file which is used in french-speaking pages, or because of my account which is possibly marked as french [14:02:30] in any case I don't see how I'm not a "User" [14:03:25] considering that I have a "User:" page https://commons.wikimedia.org/wiki/User:Gouvernathor [14:04:30] Did you select the upload permission when creating the oauth grant? [14:05:03] probably not [14:05:46] no, doesn’t look like it https://meta.wikimedia.org/w/index.php?title=Special:OAuthListConsumers/view/4ee1a0e6775faffdb01234a088cbc7ae&name=&publisher=Gouvernathor&stage=1 [14:06:18] the trouble is that in the form to edit that consumer, I don't find a way to add rights [14:06:33] (and I can't delete it, either [14:06:35] ) [14:06:37] yeah, it’s not possible after creating the consumer… you’ll have to create a new one AFAIK [14:06:41] (same name, version 1.1) [14:06:55] here’s another consumer with upload grants, for comparison: https://meta.wikimedia.org/wiki/Special:OAuthListConsumers/view/74a4d433d0ab9f9fad720e1c4eb8159a [14:08:40] SIGH [14:09:00] I hope I get the callback uri right, otherwise I'll be creating a third one [14:09:39] if you got as far as the permissiondenied error, then I assume the callback URL must have been right… [14:10:58] FWIW, I suspect you’ll want not just “upload new files” but also “create, edit and move pages” [14:11:20] I suspect if you had the one and not the other, you would still get an error because uploading a file requires creating a page for it [14:11:24] (but I’m not 100% sure) [14:12:01] yes, I got it right the first time, but I haven't written it somewhere in between and wikimedia doesn't show it back to me... and I'm testing it locally so it's not obvious ; anyway [14:12:15] Uh, I didn't check that, let's test without [14:12:23] the callback URL is shown at https://meta.wikimedia.org/wiki/Special:OAuthListConsumers/view/4ee1a0e6775faffdb01234a088cbc7ae [14:12:37] (https://parliamentdiagram-beta.toolforge.org/oauth-callback) [14:12:43] ah, great [14:13:59] my second consumer is not automatically approved, I guess that's expectable [14:14:21] the first one was, but it was probably due to the basic rights only [14:14:26] yeah, but you should still be able to use it with your own account [14:15:40] (even before it’s approved) [14:17:37] (I'll do that, I'm on pizza break) [14:31:21] Yep, still doesn't seem to work (with a slightly shorter error message this time : "The action you have requested is limited to users in one of the groups: *, [[Commons:Users|Utilisateurs]].") [14:31:30] I'll try with the edit create pages permission [14:41:50] Hmm, now it is "abusefilter-disallowed", because of "non autopatrolled users overwriting files" [14:42:16] that's probably normal behavior [14:42:38] I guess so, yeah [14:43:22] IT WORKED https://commons.wikimedia.org/wiki/File:Gouv_test_2024.svg [14:43:28] when creating a new file [14:43:36] awsm, thanks a lot [14:43:38] \o/ [14:44:43] and I'm not authorized to overwrite my own file... [14:44:53] well, that's Commons's problem [16:50:19] Is there a faster way of deleting from Commons a file that I created ? other than the {{speedydelete}} tag [16:55:31] not as far as I know [16:56:51] Poking a friendly commons admin (I'm not one) on IRC or discord etc may be quicker [16:58:11] I'm looking at disturbing things the least possible, so if it does require human intervention in any case, I'd rather have them pile up a bit and be removed all at once rather than someone being bothered every few hours [16:58:51] Depending on what you're doing, testing on a test wiki, especially where you can get rights to delete yourself may make sense [17:00:24] Yes but I'm looking into the specific permissions and return formats of Wikimedia Commons, which differ from the MediaWiki sandbox as far as I could see [17:00:51] And I'm testing the least possible, obviously I don't want to spam [17:12:22] I suggest using https://commons.wikimedia.beta.wmflabs.org if you need to test commons-specific workflows [17:15:22] Ok, I'll look into that [19:53:22] I am working on a task https://phabricator.wikimedia.org/T365579 https://github.com/wikimedia/mediawiki-extensions-ContentTranslation/compare/master...GergesShamon:mediawiki-extensions-ContentTranslation:master [19:53:22] Is what I did in my repository correct?