Page MenuHomePhabricator

Error: URL hostname is not whitelisted: wikiraw:///Fertility-csv
Open, Needs TriagePublic


I run a test wiki at running:

I have copied example to the wiki and adjusted data source paths to wikiraw:///Fertility-csv and wikiraw:///WorldMap-iso3-json respectively.
Both data files have been copied from the to the respective shortened names and

However, I keep getting "Error: URL hostname is not whitelisted: wikiraw:///Fertility-csv" on the console.


$wgGraphAllowedDomains = [ 'wikiraw' => [ '' ] ];
wfLoadExtension( "Graph" );

does not seem to help.

When I have added

$wgGraphAllowedDomains = [ 'wikiraw' => [ '' ], 'http' => [ '' ] ];

I started getting XHR error, since it tried getting

(my wiki lives in a subdirectory).

What is a proper way to whitelist 'wikiraw' pseudo-protocol?

How can run the wiki in a subdirectory and still use the wikiraw protocol?

Event Timeline

saper created this task.Sep 17 2016, 11:37 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 17 2016, 11:37 PM
Yurik added a subscriber: Yurik.EditedSep 18 2016, 2:49 AM

@saper, this is the correct way to configure it:

$wgGraphAllowedDomains = [ 'wikiraw' => [ '' ], 'http' => [ '' ] ];

What do you mean by "my wiki lives in a subdirectory"?
I see you have as the endpoint. Sadly, at this point the Graph extension is hardcoded to use /w/api.php. The quick hack is to change graph2.compiled.js file line 432 to use your api endpoint. Eventually, I should make it possible to configure non-default api endpoint in the settings.

@Yurik thank you very much, I forgot to add my workaround here:

One thing which wondered me when trying "wikiraw:" protocol is that internal MediaWiki functions are not used in case of "this" wiki. This way any strange MediaWiki configuration could be easily supported. What about T145977 to change this?

Also it was pretty confusing to need to add "http" in the configuration next to the "wikiraw" protocol. Technically this makes sense, since we go via http API, but maybe after T145977 we would need to.

saper added a comment.EditedSep 18 2016, 6:40 PM

One more thing, the documentation at the extension page listed some probably obsolete variables, which I have removed. Is this okay?

@saper see my explanation why the protocols were designed this way in T145977#2647013. Of course suggestions on how to make it better are welcome :) The documentation definitely need some love, and I will be very grateful for your help :)