[12:10:57] andre__: Do you have some free time now? It would be nice, if you could take a look at my patch :) [12:11:39] Ooos, wrong channel [12:11:46] Sorry [14:52:44] Hello, I'm trying to login to a private MediaWiki by API [14:52:50] I'm using Python 2.7 and requests module [14:53:12] And this https://pastebin.com/qVMs1QWa [14:53:18] Throws {"error":{"code":"readapidenied","info":"You need read permission to use this module","*":"See https://wiki.wikimedia.cz/mw/api.php for API usage"}} [14:53:44] How can I login if I need read access to the api for getting read access to the api? [14:54:03] MW version: 1.26.3 [14:54:07] Urbanecm: Get the syadmin to fix the permissions? [14:54:19] Reedy, I'm the sysadmin... [14:54:54] I guess $wgGroupPermissions['*']['read'] = false; has been set? [14:55:19] Yes [14:55:27] obvious if it is a private wiki [14:55:54] Nothing is every obvious [14:55:56] But this shouldn't prevent me (or anybody else with valid account) using the API, should it? [14:56:08] You're trying to make a read request... when not authenticated [14:56:19] reedy@tin:~$ mwscript eval.php officewiki [14:56:19] > var_dump( $wgGroupPermissions['*']['read'] ); [14:56:20] bool(false) [14:56:24] ^ private wiki, it's not true [14:56:31] https://office.wikimedia.org/w/api.php works [14:56:49] Reedy, okay, so how can I authenticate? [14:57:31] By fixing your wiki permissions? [14:57:35] https://office.wikimedia.org/w/api.php?action=query&meta=tokens&type=csrf&format=jsonfm works for example [14:57:46] Okay. So https://wiki.wikimedia.cz/mw/api.php?action=query&meta=tokens&type=csrf&format=json works [14:58:01] ['*']['writeapi'] = true; ? [14:58:08] In browser [14:58:16] Urbanecm: Probably because you've logged in via the gui [14:58:19] I get [14:58:20] {"error":{"code":"readapidenied","info":"You need read permission to use this module","*":"See https://wiki.wikimedia.cz/mw/api.php for API usage"}} [14:58:25] As completely anonyous [14:58:27] *anonymous [14:59:03] Reedy, thanks, that's moving me forward! In inkognito window it do not work for me as well [14:59:50] 'wgWhitelistRead' => [ [14:59:50] 'private' => [ 'Main Page', 'Special:UserLogin', 'Special:UserLogout' ], [15:00:04] https://wiki.wikimedia.cz/mw/api.php works for me [15:00:34] Reedy, that should fix it? [15:00:38] No [15:00:47] I'm just looking how we have it setup for wmf wikis [15:00:53] Reedy, ok. [15:01:00] 'private' => [ [15:01:00] '*' => [ [15:01:01] 'read' => false, [15:01:01] 'edit' => false, [15:01:01] 'createaccount' => false [15:01:02] ], [15:01:06] That... doesn't match [15:01:32] Oh, yeah, it does [15:01:48] Reedy, how's writeapi set? [15:01:56] true [15:01:59] Confusingly [15:02:02] that's the point [15:02:17] action=query isn't a write action [15:02:18] I guess writeapi should be useapi [15:03:40] Hauskatze, useapi do not exist, does it? [15:03:52] No [15:03:53] * $wgEnableAPI and $wgEnableWriteAPI are now deprecated and will be removed in [15:03:53] a future version. The API is now considered to be stable, secure and [15:03:54] essential. [15:03:56] in 1.31 [15:04:01] But they're the globals lol [15:04:09] BTW this https://ctrlv.cz/BbLc is the settings of permissions [15:04:33] Urbanecm: Of course, you're also running an unsupported version of MW [15:04:33] ;) [15:04:50] Urbanecm, no, it does not exist, only writeapi which seems to be the one that gave you access already? [15:04:51] btw [15:04:55] { [15:04:55] "error": { [15:04:55] "code": "readapidenied", [15:04:56] "info": "You need read permission to use this module.", [15:04:56] "*": "See https://office.wikimedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes." [15:05:00] }, [15:05:01] "servedby": "mw1224" [15:05:04] } [15:05:18] so action=query is treated as writeapi Reedy apparently [15:05:32] Hauskatze, but writeapi is true... [15:05:32] but to see the output you need the [read] permission? [15:06:07] permissions have some overlap [15:06:17] Reedy, I know, just force myself to do the update :D [15:06:21] to use the API for writing, you need (at a minimum): read, edit, writeapi [15:06:34] (assuming you wish to use the API for editing pages) [15:06:55] Skizzerz, I want to login with my credentials and then do some editing [15:07:05] and I want the wiki to stay private of course [15:07:27] ok, the login action in the API doesn't require read access, so you should be able to login to the API, and then execute queries normally [15:07:50] Skizzerz, ehm... We're getting to start. The login method wants a token [15:07:58] yep [15:08:02] And tokens should be generated by action=query [15:08:06] what version of mediawiki are you running? [15:08:10] 1.26.3 [15:08:17] that's.... old [15:08:32] Force myself to do the update :D [15:08:51] Urbanecm: the login API was overhauled in 1.27 [15:09:00] and you no longer get tokens via action=query in that version and beyond [15:09:11] you should upgrade, which would also fix your issue [15:09:22] :) [15:09:35] oh wait [15:09:37] Skizzerz, thanks! I will :D [15:09:38] I misread [15:09:46] in 1.27+ do DO get tokens via action=query [15:10:05] in 1.26 and lower you get tokens by calling action=login without a token, and it gives you the token to use in the error message result [15:10:14] * Hauskatze forces Urbanecm to use update.php [15:10:36] Hauskatze, are you sure that this will solve all potencial update-relevant issues? :D [15:10:40] 1.27+ also introduces Special:BotPasswords so you can give whatever script is using the API limited permissions instead of full action to your account [15:10:52] Urbanecm, nope :) [15:11:09] but breaking the wikis is such fun :P [15:12:11] Urbanecm: if you want another reason to upgrade, I can guarantee you that there's some unpatched security vulnerabilities in 1.26 :) [15:12:47] Skizzerz, I'm just writing a mail to our maillist about updating (to avoid mails like 'it do not work, is readonly etc.') and then will start with the updating :D [15:13:20] Hahah [15:13:26] There's more than some in 1.26 I bet [15:13:50] including the recent composer one if you installed from git, most likely [15:14:03] well, phpunit one technically [15:14:26] heh [15:14:42] It's ok, phpunit doesn't believe in security, as it's a developer tool [15:15:10] and composer doesn't believe in giving you only required deps if you run it with no args, instead of giving you world+dog [15:52:21] Skizzerz, Hauskatze, Reedy: Ok, update should be dune [15:52:22] done [15:52:29] But there's an exception which breaks the wiki... [15:52:30] https://wiki.wikimedia.cz/wiki/ [15:52:44] Kritická výjimka typu means Critical exception type [15:52:46] fun [15:52:54] Anyone know how can I fix it? :D [15:53:26] Hauskatze, not fun from my point of view ;) [15:53:28] Chyba povolení [15:53:28] Přejít na: navigace, hledání [15:53:29] Z následujícího důvodu nemáte oprávnění přečíst tuto stránku (nezapomněli jste se přihlásit?): [15:53:29] Požadovanou činnost smějí provádět jen uživatelé ve skupinách Roboti, Členi. [15:53:40] apparently some sort of permission error [15:54:24] Hauskatze, I don't see an permission error [15:54:44] https://wiki.wikimedia.cz/wiki/ is what it gives to me [15:54:48] I'm getting https://ctrlv.cz/nR15 [15:54:50] what I pasted I mean [15:54:52] At the same URL [15:55:16] Hauskatze ^^^^ [15:55:23] I cannot access that [15:55:24] INET_E_RESOURCE_NOT_FOUND [15:56:17] You mean the ctrlv.cz link? [15:56:36] https://pastebin.com/Dy53Czmi [15:56:39] Copy&paste [15:56:52] https://ctrlv.cz/nR15 works for me. [15:57:26] probably they've blocked the DNS of my source [15:58:17] Urbanecm, looks like a problem with temporary userrights? [15:58:37] https://www.mediawiki.org/wiki/Topic:Tye8bmq845eyhpnc comes to my mind. [15:58:43] https://github.com/wikimedia/mediawiki/blob/master/maintenance/archives/patch-user_groups-ug_expiry.sql basically. [15:59:01] Thanks [15:59:13] oh, was I right? [16:01:14] andre__, applied manually [16:01:16] Another exception [16:01:21] See https://wiki.wikimedia.cz/wiki/Hlavn%C3%AD_strana [16:02:11] while logged off I see no exceptions [16:02:27] ... [16:02:30] Forgotted [16:02:45] https://pastebin.com/UMA57uv1 [16:03:29] hmm, echo [16:03:51] Echo, I think, yeah. [16:03:59] andre__, yeah, but why? :) [16:04:32] BTW you can log in with test/test123 now, I'll delete the account when this problem will be resolved [16:04:34] ¯\_(ツ)_/¯ [16:04:55] Reedy ^^^ [16:06:41] Danny_B, ^^ [16:06:43] Anyone else :D [16:08:25] Anyone know how to submit a package to packagist in the wikimedia namespace? [16:08:36] maybe legoktm knows? [16:09:09] I think i need whomever owns wikimedia to approve it, but I don't know who that is [16:11:39] hmm, https://www.mediawiki.org/wiki/Manual:Developing_libraries#Packagist_guidelines suggests I need an owner in the wikimedia github org to set it up [16:13:10] bawolff, Wikimedia is owned by the Board, eh :) [16:13:21] Hauskatze: different type of owner :) [16:14:03] Urbanecm: thanks but I've no experience with this :( [16:14:23] Just did it myself, it works now :D [16:14:26] Thanks for your effort [16:14:30] good :D [16:14:37] np, happy to help when/if I can [16:14:55] Looks like I might be able to ask reedy or addshore (This is about https://github.com/wikimedia/mediawiki-tools-phan-SecurityCheckPlugin ) [16:16:36] hi ba [16:16:37] bawolff: [16:16:53] hi [16:17:15] https://github.com/orgs/wikimedia/people <-- I think these are the owners? [16:17:26] Hauskatze: yes, that's correct [16:17:33] ooh, whats that plugin do? [16:17:52] addshore: It does static analysis to try and find xss/sql injection [16:18:22] I intend to send an email to wikitech-l about it once its in packagist and easy to install [16:20:59] It also helps finding cases where i18n messages have the wrong format [16:23:30] Anyways, according to https://www.mediawiki.org/wiki/Manual:Developing_libraries#Packagist_guidelines I have to "Ask an owner in the Wikimedia GitHub organization to set up a Packagist.org service hook in the GitHub repo." [16:44:51] bawolff: are we using it in CI yet? [16:45:02] i guess we should probably wait for it to be on packagist first... [16:45:34] addshore: No. And its probably not going to be a CI thing because it does have false positives in certain circumstances which we wouldn't want to block commit on [16:45:46] bawolff: could be a non voting CI thing? [16:46:03] phan is already using the docker hosts for CI too so it wont be making anything slower [16:46:08] That might make sense. It'd certainly be useful to know if a commit increased the number of issues [16:46:18] Its a lot slower than phan, and kind of memory hungry [16:46:27] oooh, post commit? [16:46:27] mediawiki core tags about 3 minutes to run [16:46:38] and 2GB of mem on my laptop [16:47:17] hmm, we could give it a go and see [16:47:26] phan takes 2 mins in CI currently (including code checkout) [16:55:21] bawolff: I would definitely want to make this voting/part of CI. As long as there's a way to suppress false positives (e.g. @codeCoverageIgnoreLine) then I think it'll be ok [17:04:57] We'd definitely need to get the number of false positives for mw-core under control first (currently around 250) [17:08:32] although false positive rate should be low for extensions. Most of the false positives are very specific regions of mw core [18:49:00] Reedy: So the phan plugin thing is https://github.com/wikimedia/mediawiki-tools-phan-SecurityCheckPlugin [19:02:56] Is there a way to search mediawiki without bringing up translation pages ? (MediaWiki 1.28.2) [19:04:05] kunda_: explain please? [19:05:44] kunda_: So the search options are going to vary depending on what search extensions you have installed [19:05:56] CirrusSearch (what wikimedia uses) has very different options from mediawiki default [19:06:20] so lets say I put a search term in, the result is that many pages that have been translated with said term also appear. I'm wanting to search only in english in this example [19:06:30] but generally speaking, the Translation: namespace can be easily excluded, but the subpages are harder [19:06:45] I assume we're talking about translations made by Extension:Translate [19:06:47] The current wiki I'm referring to is https://www.freecadweb.org/wiki [19:07:03] yes, I think that is what we're running [19:07:06] how can i check ? [19:07:27] https://www.mediawiki.org/wiki/Help:CirrusSearch has some info on the advanced search options that apply only to CirrusSearch [19:07:34] If you go to Special:Version on your wiki [19:08:47] Looks like you're just using the default search, which has much less advanced options [19:09:11] Translate 2016-10-28 (5addec5) 08:26, 13 February 2017 [19:10:14] bawolff: so you recommend doing what ? [19:10:33] honestly, I don't think its possible to filter out translations with the default search [19:11:23] as opposed to cirrusSearch ? [19:13:50] bawolff: so your recommendation is cirrussearch, correct ? [19:14:50] I think https://www.mediawiki.org/wiki/Help:CirrusSearch#Inlanguage is what you're looking for [19:14:52] so yes [19:14:59] CirrusSearch is not the easiest ext to install [19:16:29] Yes, Inlanguage is what I'm looking for [19:18:50] Looks like Elastica requires Composer which is a PHP dependency manager [19:19:35] Its possible to install without composer, but compser is probably the best way [19:19:49] For example, with the mediawiki/vendor.git repo [19:19:53] How do you install without composer ? [19:20:07] or mediawiki/core/vendor.git Can never remember which one it is [19:20:14] you have to manually install all the dependencies [19:21:00] is there a list of deps that I can look at ? [19:21:26] its in the composer.json file. but you have to recursively look at each one [19:22:09] ok.. thanks a lot bawolff [19:22:16] kunda_: if in your mediawiki directory, you do [19:22:28] git clone https://gerrit.wikimedia.org/r/p/mediawiki/vendor.git vendor [19:22:44] This will pull all of Wikimedia's dependencies, which might be enough to install cirrus without composer [19:22:52] you'd have to first remove the existing vendor repo [19:23:39] Note, that using the mediawiki/vendor.git repo isn't officially supported, so ymmv in the long term, but it will probably work fine as long as you remember to use the right branch that corresponds with your mediawiki version, and keep it in sync with your mediawiki version [19:27:08] thanks bawolff :) [20:04:41] Does anyone know what's up with the restbase server for Math? [20:07:23] what's up with "what's up"? [20:07:53] It's down, giving a 503. https://api.formulasearchengine.com/v1/ [20:08:49] I dunno if this falls under the wikimedia umbrella or if it's more of a shut up and wait till it's better situation, was just curious