[12:05:52] Krinkle: For the QuickSurveys ResourceLoader module, the audience affected is all users and anons, who will receive configuration and messages for every survey unless I'm able to vary the cache or otherwise change the architecture. I'm setting this approach aside for now, but am interested in learning enough to take another look soon. Payloads are ~2kB per survey, minified. [12:06:29] I'll track the work as T254977, fyi. [12:07:02] T254977: Server-side survey configuration filtering - https://phabricator.wikimedia.org/T254977 [15:50:46] TimStarling, do you know by chance how one can send a non-string stream to the MW Rest API. I could not find any examples with the codesearch tool https://phabricator.wikimedia.org/T255782 [15:54:29] It's 2am for him ;P [15:57:06] ok. thank you. I was assuming that he would be around San Francisco [15:59:42] He's never lived in SF afaik :) [16:02:45] Tim is an Aussie [16:14:12] Maybe I will find out myself prior to his sunrise;-) I found https://docs.guzzlephp.org/en/5.3/streams.html might be helpful [16:34:49] physikerwelt: are you looking for RequestInterface::getBody()? [16:37:34] ...I guess you want the opposite direction, based on that task [16:38:32] yes, but I am unexperienced with streams in PHP so I was searching for some code that uses Stream class [16:40:16] I was running find usages in my IDE but I could not find anything also the mediawiki codesearch tool did not help [16:42:45] the class was introduced in https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/508972/ but I have not fully understood what was the intention of adding the class in that commit [16:49:04] physikerwelt: I don't think there's anything wrong with how you use the MediaWiki class [16:49:15] the problem is with the underlying stream [16:49:46] I mean the stream resource that the Stream object wraps [16:53:18] tgr, yes probably... but I need to find at least one example of a stream that has no problems. I was thinking that php://memory might be the simplest example [16:53:42] I'd guess stream_copy doesn't work on a closed stream? [16:55:15] https://3v4l.org/DjuP9 vs https://3v4l.org/FQBfN [16:57:45] Thank you. I see some output [16:59:36] the solution was not to close the stream [17:02:00] eventually I see my image. Thank you soo much [17:02:03] ideally, the raw stream would be handled internally by the Stream class [17:02:39] e.g. you could define a FileStream which takes a filename argument and opens a stream, and closes it when destructed [17:04:11] should this FileStream be in core or in the Math extension [17:10:52] I just found out that I can create a fake string that is the image. While not really intuitive it does the job [17:21:44] t would make sense to have it in core, IMO. Eventually we'll need for the thumbnail API at least. [17:23:26] Hi, I'm trying to install Mediawiki in my system, Followed gerrit tutorial and mediawiki documentation. [17:23:50] I'm facing error stating [17:23:52] The MediaWiki logoMediaWiki 1.35 internal errorInstalling some external dependencies (e.g. via composer) is required.External dependenciesMediaWiki also has some external dependencies that need to be installed via composer or from a separate git repo. Please see mediawiki.org for help on installing the required components. [17:24:27] Also reffered many mediawiki pages, talk pages, installed composer and also vendor nothing solving my issue. Any hints ? [17:29:51] tgr you could use the same string trick [17:30:03] Error is displayed here https://ibb.co/vHPV743 [17:30:42] you want to stream the file without reading it in memory first, if the size is non-trivial [17:31:41] using strings kind of defeats the point, avoiding unnecessary memory use is the exact purpose streams were invented for [17:33:04] you open a pointer to the file, pass it to the API framework, which stream_copies it to php://out, which in essence makes the OS copy file data to a socket without it having to go through PHP [17:33:08] ok if you don't have the data in memory anyhow, you are right... in my case there is already a bit array [17:33:38] yeah, in that case there's not much point [17:34:58] user69: you need to run composer. Where exactly are you stuck with that? [17:34:59] to my eyes the $stream_obj->write(chr($byte)); looks even more ugly than the fake string method [17:35:52] where does the byte array come from? [17:36:18] tgr I installed composer in my /core/ and also ran composer update --no-dev but nothing working to move forward to the next step to install properly [17:36:51] user69: what's the composer output? [17:36:52] tgr, it depends either from a response or WANobject cache [17:37:45] so if it's from a response body, you can just pass that, it's also a stream [17:38:32] in general the point of streams is to decouple your transformation code from environment details [17:38:59] so it does not have to know whether it is operating on a string, a file, a socket... [17:39:18] tgr you could, but in that case it is wrapped into a json object... https://github.com/wikimedia/mathoid/blob/master/lib/math.js#L178 [17:39:56] that's not very restful :) [17:41:03] anyway, there is certainly nothing wrong with using with using strings. It will degrade for large data sizes but that's not a problem Math has to deal with. [17:43:55] cool. Anyhow, for now I won't add a FileStream class and if we make progress on T247697 the PNG images will be generated differently anyhow [17:43:55] T247697: Rethink mathoids SVG to PNG conversion - https://phabricator.wikimedia.org/T247697 [17:45:54] phab auto links <3 [17:53:17] user69: Are you sure you have installed phpmbstring and other required dependencies ? [17:54:28] Because I also faced similar issues when I installed mediawiki and finally I figured out that I missed these installations, So finally resolved them recently :) [17:57:44] If you execute `composer update --no-dev` that has to list all those problems. [19:41:49] Struggling with the LDAPGroups extension. Been using the default /etc/mediawiki/ldapprovider.json location for LDAPProvider, but when I try using the maintenance script SyncGroups I get an error 'No section groupsync found in configuration for domain XXXX.XXX' [19:42:48] I do have the groupsync section populated in that json file, using the MappedGroups::factory mechanism, and with a mapping entry for my editors group [19:44:15] does the LDAPGroups extension and/or LDAPProvider expect that this configuration is in PHP format, not JSON and in the LocalSettings.php file instead of /etc/mediawiki/ldapprovider.json [19:50:09] It would seem odd [19:50:10] "DomainConfigs": { [19:50:11] "value": "/etc/mediawiki/ldapprovider.json", [19:56:10] perhaps I just have a misconfigured yet valid json file? [19:57:20] I honestly have no practical experience of this extensin [19:57:35] I very well could be barking up the wrong tree [19:58:04] testing upgrades from antiquated versions with deprecated extensions to current LTS [19:59:18] I assumed from my reading that I needed to use the LDAPGroups extension to control who can edit pages by way of LDAP Groups [20:00:17] authentication and authorization extensions are in use as well, and seem to be working fine, then I went on to test whether or not I could add my testuser to my editors group [20:01:01] testuser is not showing as a member when I check the user permissions, like it was unable to sync the group from LDAP [20:06:20] if someone has a sec to checkout my ldapprovider config, let me know if I did something stupid -- https://pastebin.com/yLPND9NX [20:08:09] yeah, that's not valid json [20:09:39] should be a } after the ] in authorization [20:10:01] And two } after groupsync mapping [] probably want removing [20:10:51] https://pastebin.com/9fMn48cU [20:11:40] which still isn't valid.. [20:11:51] jsonlint disagrees with you, but I wont [20:12:06] thanks for taking a peek, I'll muck with it somemore [20:12:31] oh, is it just bad indneting? [20:12:42] yeah, looks to be [20:12:51] whitespace is important for readability [20:14:20] I would say this looks odd too [20:14:20] "options": [{ [20:14:21] "LDAP_OPT_DEREF": 1 [20:14:21] }], [20:14:33] but it's valid [20:16:15] * Reedy wonders why you'd just not use object, rather than an array of objects [20:18:41] https://www.mediawiki.org/wiki/Extension:LDAPProvider#Static_JSON_file [20:18:45] https://www.mediawiki.org/wiki/Extension:LDAPProvider#Dynamic_PHP_array [20:18:50] That json and PHP aren't equivalent [20:18:50] Ever heard the phrase "Monkeys with guns"? [20:20:30] I'm feeling awfully a lot like a monkey at the moment [20:21:28] to respond to your wonderment though, it would be because it is referenced that way in almost every example config I came across [20:22:54] It's possible the code handles it [20:22:59] But it just looks pretty odd [20:23:22] I filed https://phabricator.wikimedia.org/T255827 to at least log it [20:23:43] Similar in your mapping [20:24:30] https://pastebin.com/LSNrEH91 [20:24:39] That fixes those two weirdnesses and the indenting [20:25:17] Also... [20:25:31] https://www.mediawiki.org/wiki/Extension:LDAPGroups#Domain_config_settings [20:25:45] I don't think groupsync should be under authorization [20:27:21] which makes https://pastebin.com/efxJrzhJ [20:32:23] closer [20:32:46] the SyncGroups script doesn't blow up in my face now, but ... it doesn't show any updates either [20:33:16] formatting was appreciated, didn't realize how ugly it was -- thanks [20:33:41] it's one of those, if you don't touch json normally, it probably doesn't look so bad [20:33:46] When you do, you notice stuff :D [20:34:15] ya, I'll admit being a dinosaur [20:37:22] huzzah [20:38:20] "mechanism": "mappedgroups" ! "Mediawiki\\Extension\\LDAPGroups\\Sync..." [20:39:06] I confused myself between the extension config, many example configs setup like I had it, and the domain config documentation [20:39:20] thanks much Reedy, buy yourself a beer and pretend I paid for it [20:39:45] haha [20:39:58] Hopefully the maintainers will get the docs fixed soon [20:40:53] I won't hold my breath, project has existed for a very long time, it's expected to have dead and decaying documentation lying around [20:41:41] at least I understand it's normal for documentation to be in this state, for a project like this [20:42:07] really appreciate you taking a look though, rarely resort to IRC, it was a last ditch effort before I rage quit [20:53:58] ...heh, and back to square 1 [20:54:22] apparently it fails to handle groups of groups, but if its a direct member it works [20:54:50] thinking it's the grouprequest method [21:00:19] fuzzy: I think that's https://phabricator.wikimedia.org/T214145 [21:05:47] the diff shows that I have the 'fixed' version [21:06:53] Hmm [22:17:55] sorted out [22:18:53] old database had the domains in the ldap_domains table all lowercase, the new testuser added used the updated ldapprovider.json file which listed the domain in all caps [22:19:18] nested groups do indeed work [22:20:54] quick sql update stopped the backtraces that were occurring on pre-existing users post-upgrade, and both direct group membership and membership via subgroups = winning [22:21:50] troubleshooting section notes for the LDAPProvider extension nudged me in the right direction