Last modified: 2013-05-06 09:55:33 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T34219, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 32219 - Make $wgUseInstantCommons protocol relative
Make $wgUseInstantCommons protocol relative
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
1.18.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: easy
Depends on:
Blocks: 20342
  Show dependency treegraph
 
Reported: 2011-11-05 19:18 UTC by Umherirrender
Modified: 2013-05-06 09:55 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Umherirrender 2011-11-05 19:18:50 UTC
$wgUseInstantCommons uses at the moment a link to http://commons.wikimedia.org/w/api.php, it is possible to change this to a protocol relative url?

Thanks.
Comment 1 Chad H. 2011-11-05 22:34:04 UTC
Tweaking component, has nothing to do with installation.
Comment 2 Bryan Tong Minh 2011-11-05 22:36:16 UTC
This just requires a small tweak in Setup.php.
Comment 3 Chad H. 2011-11-05 22:39:56 UTC
(In reply to comment #2)
> This just requires a small tweak in Setup.php.

Right now we use apibase with an http:// url. I'm not quite sure how curl/fopen will react to using that when we're getting the metadata.

There should be a way to configure the "This description is from {foo url}" bit without changing the API calls.
Comment 4 Umherirrender 2011-11-06 00:33:30 UTC
(In reply to comment #3)
> There should be a way to configure the "This description is from {foo url}" bit
> without changing the API calls.
It is not alone the link to the description. With a https apibase the images are also loaded with https. The images should load also with a protocol relative url, but prop=imageinfo&iiprop=url is giving a explicit protocol. Maybe add an other iiprop which returns a protocol relative url, if the repo wiki support that.

Maybe this can also corrupt the internal cache of api calls.
Comment 5 Chad H. 2011-11-06 01:19:30 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > There should be a way to configure the "This description is from {foo url}" bit
> > without changing the API calls.
> It is not alone the link to the description. With a https apibase the images
> are also loaded with https. The images should load also with a protocol
> relative url, but prop=imageinfo&iiprop=url is giving a explicit protocol.
> Maybe add an other iiprop which returns a protocol relative url, if the repo
> wiki support that.
> 
> Maybe this can also corrupt the internal cache of api calls.

The thumbnails are requested by the server, not by the client (unless you're manually configuring $wgForeignFileRepos, but the bug says $wgUseInstantCommons).
Comment 6 Brion Vibber 2011-11-07 18:31:42 UTC
I'd recommend simply using https unconditionally here -- an SSL image on a non-SSL page should be perfectly legit.
Comment 7 Chad H. 2011-11-10 17:00:18 UTC
(In reply to comment #6)
> I'd recommend simply using https unconditionally here -- an SSL image on a
> non-SSL page should be perfectly legit.

I'm not opposed to this, as long as ops says the https setup can take the load :)
Comment 8 Roan Kattouw 2011-11-11 12:27:48 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > I'd recommend simply using https unconditionally here -- an SSL image on a
> > non-SSL page should be perfectly legit.
> 
> I'm not opposed to this, as long as ops says the https setup can take the load
> :)
Ryan, what are your thoughts on this? It's proposed that starting with MW 1.19 (or 1.20 as the case may be), 3rd-party wikis using InstantCommons will load metadata (api.php on Commons), thumbnails and images (upload.wm.o) over HTTPS unconditionally (right now they're always loaded over HTTP).
Comment 9 Bryan Tong Minh 2011-11-11 13:58:24 UTC
What is exactly the usefulness of this? As far as I know thumbnails are cached on the local server, and passed by it to the user. So regardless whether $wgInstantCommons fetches thumbnails over http or https, the user will still get the images over the same protocol as the the rest of the page.
Comment 10 Roan Kattouw 2011-11-11 13:59:55 UTC
(In reply to comment #9)
> What is exactly the usefulness of this? As far as I know thumbnails are cached
> on the local server, and passed by it to the user. So regardless whether
> $wgInstantCommons fetches thumbnails over http or https, the user will still
> get the images over the same protocol as the the rest of the page.
Hmm, true. This would be useful for direct thumbnail fetches but you're right that it would not be useful for direct server-to-server requests.
Comment 11 Chad H. 2011-11-11 20:52:09 UTC
(In reply to comment #10)
> (In reply to comment #9)
> > What is exactly the usefulness of this? As far as I know thumbnails are cached
> > on the local server, and passed by it to the user. So regardless whether
> > $wgInstantCommons fetches thumbnails over http or https, the user will still
> > get the images over the same protocol as the the rest of the page.
> Hmm, true. This would be useful for direct thumbnail fetches but you're right
> that it would not be useful for direct server-to-server requests.

Right, assuming you're using $wgUseInstantCommons and not configuring $wgForeignFileRepos yourself, the direct thumb fetches won't happen (hence my comment above about it only affecting the description urls).
Comment 12 Ryan Lane 2011-11-11 21:04:31 UTC
Well, it should be configurable, at least. If a site is using instant commons, and is https-only, then it's possible the http connection between the site and commons could be used as an attack vector.

From a load perspective, I think it'll be totally fine. The ssl servers are completely bored right now.
Comment 13 db [inactive,noenotif] 2011-12-22 19:06:16 UTC
See r107042
Comment 14 Chad H. 2012-01-02 14:38:36 UTC
Done properly in r107833.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links