Jump to content

Extension talk:Collection/2018

Add topic
From mediawiki.org
Latest comment: 7 years ago by BluAlien in topic Bad base_url


Bad base_url

[edit]

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


I'm trying to setup a render server on a Ubuntu 17.10 server, MediaWiki is 1.30 and Collection extension is the one in snapshot ba6fa49 for MediaWiki REL1_30. Render server is a separate server.

My LocalSettings is configured as:

//Extension Collection

require_once "$IP/extensions/Collection/Collection.php";

$wgCollectionPODPartners = false;

$wgCollectionFormats = array(

   'rl' => 'PDF', # enabled by default

   'odf' => 'ODT',

   'epub' => 'e-book (EPUB)',

);

$wgGroupPermissions['user']['collectionsaveascommunitypage'] = true;

$wgGroupPermissions['user']['collectionsaveasuserpage']      = true;

$wgCollectionMWServeCredentials = "Myuser:MyPassword";

$wgCollectionMWServeURL = "http://myRenderServer:8899";

I checked my render server against Wikipedia Article with

mw-zip -c :en -o test.zip Acdc Number

mw-render -c test.zip -o test.pdf -w rl

and also with MyWiki Article with

mw-zip --username="Myuser" --password="MyPassword" -c http://myIPAddress/w -o test.zip TestPage

mw-render -c test.zip -o test.pdf -w rl

in both cases the Article was rendered correctly, but when I try to render the same Article from inside MyWiki I got the error reported down here. I checked and re-checked, the base_url path is correct. I saw and old bug about this, but It was solved since REL_1.27. Any Idea ?

new-collection 1        'http://myIPAddress/w'        'rl'

2018-01-31T02:01:08 mwlib.serve.bad >> bad base_url: 'http://myIPAddress/w'

myIPAddress - - [2018-01-31 02:01:08] "POST /cache HTTP/1.0" 200 283 0.005379

Thanks in advance. BluAlien (talk) 01:39, 31 January 2018 (UTC)Reply

Solved, again the old issue with "localhost" and "192.168". I supposed that the issue was removed, but I was wrong.
There is a check for the incoming addres in file nserve.py at around line 286 which returns False il the calling server (media wiki collection addredd) starts with 192.168 or is localhos.
Comment the statement or set its return to True. Done. BluAlien (talk) 21:41, 2 February 2018 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.