Page MenuHomePhabricator

Offline Content Generator functionality with private wiki?
Closed, ResolvedPublic

Description

Hi,

I've been setting up MW 1.26 with Parsoid, Collection, OCG and Visual Editor. I'm having a few problems, but here's one I would appreciate a little help with.

When I make the wiki private by modifying LocalSettings.php with:

# Disable reading by anonymous users - private wiki
$wgGroupPermissions['*']['read'] = false;
# reading by anonymous users enabled 13/02/2015
# and changed 4/11/2015

# code snippet to help VisualEditor out
# as instructions seem to be a bit problematic
# for private wikis
if ( $_SERVER['REMOTE_ADDR'] == '127.0.0.1' ) {
 $wgGroupPermissions['*']['read'] = true;
 $wgGroupPermissions['*']['edit'] = true;
}

I've also separately enabled NetworkAuth, created a user called parsoid and at the same time included the following in LocalSettings.php:

# NetworkAuth
require_once "$IP/extensions/NetworkAuth/NetworkAuth.php";
$wgNetworkAuthUsers[] = array(
        'iprange'               => array('127.0.0.1/32'),
        'user'                  => 'parsoid');

When I comment out

$wgGroupPermissions['*']['read'] = false;

I can no longer generate a PDF of any pages using OCG. I get the following error.

[2015-12-06T03:26:42.174Z]  INFO: mw-ocg-service/7106 on lamp: [0%]
Fetching wiki configuration: http://52.62.34.216/html/mediawiki (channel=backend.bundler.bin, details="")
  job: {
    "id": "55cff608a8064f01c5011d76f0a5ebffe89efed5",                                                                 
    "writer": "rdf2latex"                                                                                             
  }                                                                                                                   
Cannot read property 'repos' of undefined
[2015-12-06T03:26:42.847Z] ERROR: mw-ocg-service/7106 on lamp:  (channel=backend.bundler.bin, details="")
  TypeError: Cannot read property 'repos' of undefined
      at /var/local/OCG/mw-ocg-bundler/lib/metabook.js:254:15                                                         
      at run (/var/local/OCG/mw-ocg-bundler/node_modules/core-js/modules/es6.promise.js:89:39)                        
      at /var/local/OCG/mw-ocg-bundler/node_modules/core-js/modules/es6.promise.js:100:28                             
      at doNTCallback0 (node.js:430:9)                                                                                
      at process._tickCallback (node.js:359:13)                                                                       
  --
  job: {
    "id": "55cff608a8064f01c5011d76f0a5ebffe89efed5",
    "writer": "rdf2latex"
  }
[2015-12-06T03:26:42.932Z] ERROR: mw-ocg-service/7106 on lamp: Bundling process died with non zero code: 1 (channel=backend.bundler.error)                                                                                                      
  BundlerError: Bundling process died with non zero code: 1
      at /var/local/OCG/mw-ocg-service/lib/threads/backend.js:560:11                                                  
      at run (/var/local/OCG/mw-ocg-service/node_modules/core-js/modules/es6.promise.js:89:39)                        
      at /var/local/OCG/mw-ocg-service/node_modules/core-js/modules/es6.promise.js:100:28                             
      at doNTCallback0 (node.js:430:9)                                                                                
      at process._tickCallback (node.js:359:13)                                                                       
  --                                                                                                                  
  job: {                                                                                                              
    "id": "55cff608a8064f01c5011d76f0a5ebffe89efed5",                                                                 
    "writer": "rdf2latex"                                                                                             
  }

Is this a known bug? Should I be able to generate a PDF on a private wiki using the OCG?
VE works just fine with this configuration and yet the error appears to be associated with an authentication failure to the MW API.Happy to provide further details...

Event Timeline

Dan.mulholland raised the priority of this task from to Needs Triage.
Dan.mulholland updated the task description. (Show Details)
Dan.mulholland added a subscriber: Dan.mulholland.

A little more information. This is a TurnkeyLinux machine running Debian 8.2 on a LAMP installation.

Also, the error shown on the web page when making the PDF is:

Generation of the document file has failed.

Status: Bundling process died with non zero code: 1

Also, here is my LocalSettings.php after the default database options etc. with all extensions installed.

# End of automatically generated settings.
# Add more configuration options below.

# Math extension
require_once "$IP/extensions/Math/Math.php";
// Set Mathoid as default rendering option;
$wgDefaultUserOptions['math'] = 'mathml';

# Visual Editor and Parsoid
require_once "$IP/extensions/UniversalLanguageSelector/UniversalLanguageSelector.php";
require_once "$IP/extensions/VisualEditor/VisualEditor.php";
// Enable by default for everybody
#$wgDefaultUserOptions['visualeditor-enable'] = 1;
// Don't allow users to disable it
#$wgHiddenPrefs[] = 'visualeditor-enable';
// OPTIONAL: Enable VisualEditor's experimental code features
#$wgDefaultUserOptions['visualeditor-enable-experimental'] = 1;
// URL to the Parsoid instance
// MUST NOT end in a slash due to Parsoid bug
// Use port 8142 if you use the Debian package
$wgVisualEditorParsoidURL = 'http://localhost:8142';
# only use local media
$wgUseInstantCommons = false;

// Forward users' Cookie: headers to Parsoid. Required for private wikis (login required to read).
// If the wiki is not private (i.e. $wgGroupPermissions['*']['read'] is true) this configuration
// variable will be ignored.
//
// This feature requires a non-locking session store. The default session store will not work and
// will cause deadlocks (connection timeouts from Parsoid) when trying to use this feature.
# $wgSessionsInObjectCache = true;

// WARNING: ONLY enable this on private wikis and ONLY IF you understand the SECURITY IMPLICATIONS
// of sending Cookie headers to Parsoid over HTTP. For security reasons, it is strongly recommended
// that $wgVisualRestConfig['modules']['parsoid']['url'] be pointed to localhost if this setting is enabled.
# $wgVirtualRestConfig['modules']['parsoid']['forwardCookies'] = true;

$wgVirtualRestConfig['modules']['parsoid'] = array(
  // URL to the Parsoid instance
  // Use port 8142 if you use the Debian package
  'url' => 'http://localhost:8142',
  // Parsoid "domain", see below (optional)
  'domain' => 'localhost',
  // Parsoid "prefix", see below (optional)
  'prefix' => 'localhost'
);


// Collection extension
require_once("$IP/extensions/Collection/Collection.php");
// configuration borrowed from wmf-config/CommonSettings.php
// in operations/mediawiki-config
$wgCollectionFormatToServeURL['rdf2latex'] = 'http://localhost:17080';
$wgCollectionFormatToServeURL['rdf2text'] = 'http://localhost:17080';
// MediaWiki namespace is not a good default
$wgCommunityCollectionNamespace = NS_PROJECT;
// Sidebar cache doesn't play nice with this
$wgEnableSidebarCache = false;
$wgCollectionFormats = array(
        'rdf2latex' => 'PDF',
        'rdf2text' => 'Plain text',
);
$wgLicenseURL = "http://creativecommons.org/licenses/by-sa/3.0/";
$wgCollectionPortletFormats = array( 'rdf2latex', 'rdf2text' );

# disable Print On Demand:
$wgCollectionPODPartners = false;
# allow saving of books to personal and community space:
$wgGroupPermissions['user']['collectionsaveascommunitypage'] = true;
$wgGroupPermissions['user']['collectionsaveasuserpage']      = true;

# START HERE

# MobileFrontend
# require_once "$IP/extensions/MobileFrontend/MobileFrontend.php";
# $wgMFAutodetectMobileView = true;

# SemanticBundle
require_once( "$IP/extensions/SemanticBundle/SemanticBundleSettings.php" );
require_once( "$IP/extensions/SemanticBundle/SemanticBundle.php" );

# CategoryTree
$wgUseAjax = true;
require_once "$IP/extensions/CategoryTree/CategoryTree.php";

# CheckUser
wfLoadExtension( 'CheckUser' );

# MassMessage
wfLoadExtension( 'MassMessage' );

# NewestPages
require_once "$IP/extensions/NewestPages/NewestPages.php";

# SVG Support:
$wgFileExtensions[] = 'svg';
$wgAllowTitlesInSVG = true;
$wgSVGConverters = array(
        'ImageMagick' => '$path/convert -background white -thumbnail $widthx$height\! $input PNG:$output',
        'sodipodi' => '$path/sodipodi -z -w $width -f $input -e $output',
        'inkscape' => '$path/inkscape -z -w $width -f $input -e $output',
        'batik' => 'java -Djava.awt.headless=true -jar $path/batik-rasterizer.jar -w $width -d '. '$output $input',
        'rsvg' => '$path/rsvg -w $width -h $height $input $output',
        'imgserv' => '$path/imgserv-wrapper -i svg -o png -w$width $input $output',
        'ImagickExt' => array( 'SvgHandler::rasterizeImagickExt' ),
);
$wgSVGConverter = 'inkscape';
$wgMaxImageArea = 100 * 1000 * 1000;
$wgMaxShellMemory = 10000000;
# Not sure if these last two still necessary

# Dynamic Page List
require_once("$IP/extensions/intersection/DynamicPageList.php");

# Contribution Credits
require_once("$IP/extensions/ContributionCredits/ContributionCredits.php");
$wgContributionCreditsHeader = "==Contributors==\n";

# Parser Functions and in particular UNC links
$wgPFEnableStringFunctions = true;
array_push($wgUrlProtocols, "file://");

# Thanks
require_once "$IP/extensions/Thanks/Thanks.php";

# WikiLove
#require_once "$IP/extensions/WikiLove/WikiLove.php";
#$wgUseInstantCommons = true;
# allows user to opt-out
$wgDefaultUserOptions['wikilove-enabled'] = 1;
# does not allow use to opt-out $wgWikiLoveGlobal  = true;

# Central Notice
require_once( "$IP/extensions/CentralNotice/CentralNotice.php" );

# DismissableSiteNotice
require_once("$IP/extensions/DismissableSiteNotice/DismissableSiteNotice.php");

# User Merge
require_once("$IP/extensions/UserMerge/UserMerge.php");
// By default nobody can use this function, enable for bureaucrat?
$wgGroupPermissions['bureaucrat']['usermerge'] = true;
$wgGroupPermissions['admin']['usermerge'] = true;
// optional: default is array( 'sysop' )
// $wgUserMergeProtectedGroups = array( 'sysop' );

# RecentPages
require_once("$IP/extensions/RecentPages/RecentPages.php");

# SimpleChanges
require_once("$IP/extensions/SimpleChanges/SimpleChanges.php");

# BetaFeatures
wfLoadExtension( 'BetaFeatures' );

# CommonsMetadata
wfLoadExtension( 'CommonsMetadata' );

# MultimediaViewer
wfLoadExtension( 'BetaFeatures' );
wfLoadExtension( 'CommonsMetadata' );
require_once("$IP/extensions/MultimediaViewer/MultimediaViewer.php");
$wgMediaViewerIsInBeta = true; 
$wgMediaViewerEnableByDefault = true;
$wgMediaViewerEnableByDefaultForAnonymous = true;
# This will improve performance when enabled, but can be fragile depending on how the wiki is set up (it will probably work f$
$wgMediaViewerUseThumbnailGuessing = true;

# FlaggedRevs
require_once("$IP/extensions/FlaggedRevs/FlaggedRevs.php");
$wgFlaggedRevsStatsAge = false;

# InviteSignup
require_once "$IP/extensions/InviteSignup/InviteSignup.php";
$wgGroupPermissions['sysop']['invitesignup'] = true;

# Allow Oversighters and Sysops to suppress revisions and log entries
$wgGroupPermissions['sysop']['deleterevision'] = true;
$wgGroupPermissions['sysop']['deletelogentry'] = true;
$wgGroupPermissions['oversight']['suppressrevision'] = true;
$wgGroupPermissions['oversight']['suppressionlog'] = true;

wfLoadExtension( 'PdfHandler' );

$wgPdfProcessor = '/usr/bin/gs';
$wgPdfPostProcessor = $wgImageMagickConvertCommand; // if defined via ImageMagick
// $wgPdfPostProcessor = '/usr/bin/convert';  // if not defined via ImageMagick
$wgPdfInfo = '/usr/bin/pdfinfo';
$wgPdftoText = '/usr/bin/pdftotext';

# RecentChangesCleanup
require_once "$IP/extensions/RecentChangesCleanup/RecentChangesCleanup.php";
$wgAvailableRights[] = 'recentchangescleanup';
$wgGroupPermissions['sysop']['recentchangescleanup'] = true;
$wgGroupPermissions['recentchangescleanup']['recentchangescleanup'] = true;

# ConfirmAccount
require_once "$IP/extensions/ConfirmAccount/ConfirmAccount.php";
$wgInvalidUsernameCharacters = '#{};';
$wgConfirmAccountRequestFormItems = array(
        'UserName'        => array( 'enabled' => true ),
        'RealName'        => array( 'enabled' => false ),
        'Biography'       => array( 'enabled' => false, 'minWords' => 50 ),
        'AreasOfInterest' => array( 'enabled' => false ),
        'CV'              => array( 'enabled' => false ),
        'Notes'           => array( 'enabled' => true ),
        'Links'           => array( 'enabled' => false ),
        'TermsOfService'  => array( 'enabled' => false ),
 );

$wgAccountRequestMinWords = 10;
$wgWhitelistRead = array( 'Special:RequestAccount', 'Terms of Service' );
$wgConfirmAccountContact = 'daniel.mulholland@transpower.co.nz';
$wgMakeUserPageFromBio = false;
$wgAutoWelcomeNewUsers = false;
$wgAccountRequestExtraInfo = false;
$wgAccountRequestFiles = false;
$wgAccountRequestToS = false;
$wgUseRealNamesOnly = false;

$wgPasswordSender     = "admin-do-not-reply@tpwiki.com";
$wgPasswordSenderName = "Transpower Wiki Administrator";

# Set Default Timezone
$wgLocaltimezone = "Pacific/Auckland";
date_default_timezone_set( $wgLocaltimezone );

# Add extensions to allow Excel spreadsheets
$wgFileExtensions[] = 'xls';
$wgFileExtensions[] = 'xlsx';
$wgFileExtensions[] = 'xlsm';
$wgFileExtensions[] = 'xlsb';

# Allow PDFs
$wgFileExtensions[] = 'pdf';


# Enables use of WikiEditor by default but still allow users to disable it in preferences 
$wgDefaultUserOptions['usebetatoolbar'] = 1;
$wgDefaultUserOptions['usebetatoolbar-cgd'] = 1;
# Displays the Preview and Changes tabs 
$wgDefaultUserOptions['wikieditor-preview'] = 1;
# Displays the Publish and Cancel buttons on the top right side 
$wgDefaultUserOptions['wikieditor-publish'] = 1;

# Disable reading by anonymous users - private wiki
$wgGroupPermissions['*']['read'] = false;
# reading by anonymous users enabled 13/02/2015
# and changed 4/11/2015

# code snippet to help VisualEditor out
# as instructions seem to be a bit problematic
# for private wikis
if ( $_SERVER['REMOTE_ADDR'] == '127.0.0.1' ) {
 $wgGroupPermissions['*']['read'] = true;
 $wgGroupPermissions['*']['edit'] = true;
}

# But allow them to access the login page or else there will be no way to log in!
# [You also might want to add access to "Main Page", "Wikipedia:Help", etc.)
$wgWhitelistRead = array ("Special:Userlogin");
# reading by anonymous users enabled 13/02/2015
# and changed 4/11/2015
# Disable anonymous editing
$wgGroupPermissions['*']['edit'] = false;

# Prevent new user registrations except by sysops
$wgGroupPermissions['*']['createaccount'] = false;
# allow people to register enabled 13/02/2015
# and removed 4/11/2015

# Prevent new user registrations except by sysops
# $wgGroupPermissions['*']['createaccount'] = false;
# reading by anonymous users enabled 13/02/2015

# Requires that a user be registered before they can edit.
$wgGroupPermissions['*']['edit'] = false;

# Logo
$wgLogo = "{$wgScriptPath}/logo.png";

# Icon
$wgFavicon = "{$wgScriptPath}/favicon.ico";

# How do I remove the "Create an Account or Login" link at the top right of the screen?
$wgHooks['PersonalUrls'][] = 'lfRemoveLoginLink';
function lfRemoveLoginLink( &$personal_urls, $title ) {
        # unset( $personal_urls['login'] );
        # unset( $personal_urls['anonlogin'] );
        unset( $personal_urls['createaccount'] );
        return true;
}

# Added Caching: 
# - see https://www.mediawiki.org/wiki/Manual:Cache
# - see https://www.mediawiki.org/wiki/User:Aaron_Schulz/How_to_make_MediaWiki_fast
# Shared memory settings
$wgMainCacheType = CACHE_ACCEL;
$wgMessageCacheType = CACHE_ACCEL;
# ## already set
$wgCacheDirectory = '/var/lib/mediawiki/cache';
$wgUseLocalMessageCache = true;
$wgParserCacheType = CACHE_ACCEL;
$wgMemCachedServers = array();
$wgUseGzip = true;
# XX conflicts above
#$wgEnableSidebarCache = true;

# NO DB HITS!
$wgDisableCounters = true;
$wgMiserMode = true;

# Text cache
$wgCompressRevisions = true; // use with care (see talk page)
$wgRevisionCacheExpiry = 3*24*3600;
$wgParserCacheExpireTime = 14*24*3600;

# Multi Upload and drag-and-drop support
require_once "$IP/extensions/MsUpload/MsUpload.php";
$wgMSU_showAutoCat = true; // If true, files uploaded while editing a category will be added to that category
$wgMSU_checkAutoCat = true; // Whether the checkbox for the above mentioned case is checked by default
$wgMSU_imgParams = '800px'; // The default parameters for inserted images
$wgMSU_useDragDrop = true; // Should the drag & drop area be shown?
$wgMSU_useMsLinks = false; // Should we allow to insert links in the style of the Extension:MsLinks?

# END HERE

# NetworkAuth
require_once "$IP/extensions/NetworkAuth/NetworkAuth.php";
$wgNetworkAuthUsers[] = array(
        'iprange'               => array('127.0.0.1/32'),
        'user'                  => 'parsoid');

And also `settings.js``` for Parsoid:

/*
 * This is a sample configuration file.
 *
 * Copy this file to localsettings.js and edit that file to fit your needs.
 *
 * Also see:
 * - api/server.js for more information about passing config files via
 *   the commandline.
 * - lib/mediawiki.ParsoidConfig.js all the properties
 *   that you can configure here. Not all properties are
 *   documented here.
 */
'use strict';

exports.setup = function(parsoidConfig) {
	// Set your own user-agent string
	// Otherwise, defaults to "Parsoid/<current-version-defined-in-package.json>"
	//parsoidConfig.userAgent = "My-User-Agent-String";

	// The URL of your MediaWiki API endpoint.
	parsoidConfig.setMwApi({ prefix: 'localhost', uri: 'http://localhost/html/mediawiki/api.php', domain: 'localhost' });
	// To specify a proxy (or proxy headers) specific to this prefix (which
	// overrides defaultAPIProxyURI) use:
	/*
	parsoidConfig.setMwApi({
		prefix: 'localhost',
		uri: 'http://localhost/w/api.php',
		// set `proxy` to `null` to override and force no proxying.
		proxy: {
			uri: 'http://my.proxy:1234/',
			headers: { 'X-Forwarded-Proto': 'https' } // headers are optional
		}
	});
	*/

	// We pre-define wikipedias as 'enwiki', 'dewiki' etc. Similarly
	// for other projects: 'enwiktionary', 'enwikiquote', 'enwikibooks',
	// 'enwikivoyage' etc. (default true)
	//parsoidConfig.loadWMF = false;

	// A default proxy to connect to the API endpoints.
	// Default: undefined (no proxying).
	// Overridden by per-wiki proxy config in setMwApi.
	//parsoidConfig.defaultAPIProxyURI = 'http://proxy.example.org:8080';

	// Enable debug mode (prints extra debugging messages)
	//parsoidConfig.debug = true;

	// Use the PHP preprocessor to expand templates via the MW API (default true)
	//parsoidConfig.usePHPPreProcessor = false;

	// Use selective serialization (default false)
	parsoidConfig.useSelser = true;

	// Allow cross-domain requests to the API (default '*')
	// Sets Access-Control-Allow-Origin header
	// disable:
	//parsoidConfig.allowCORS = false;
	// restrict:
	//parsoidConfig.allowCORS = 'some.domain.org';

	// Set to true for using the default performance metrics reporting to statsd
	// If true, provide the statsd host/port values
	/*
	parsoidConfig.useDefaultPerformanceTimer = true;
	parsoidConfig.txstatsdHost = 'statsd.domain.org';
	parsoidConfig.txstatsdPort = 8125;
	*/

	// Alternatively, define performanceTimer as follows:
	/*
	parsoidConfig.performanceTimer = {
		timing: function(metricName, time) { }, // do-something-with-it
		count: function(metricName, value) { }, // do-something-with-it
	};
	*/

	// How often should we emit a heap sample? Time in ms.
	// This setting is only relevant if you have enabled
	// performance monitoring either via the default metrics
	// OR by defining your own performanceTimer properties
	//parsoidConfig.heapUsageSampleInterval = 5 * 60 * 1000;

	// Allow override of port/interface:
	// parsoidConfig.serverPort = 8142;
	//parsoidConfig.serverInterface = '127.0.0.1';

	// The URL of your LintBridge API endpoint
	//parsoidConfig.linterAPI = 'http://lintbridge.wmflabs.org/add';

	// Require SSL certificates to be valid (default true)
	// Set to false when using self-signed SSL certificates
	//parsoidConfig.strictSSL = false;

	// Use a different server for CSS style modules.
	// Set to true to use bits.wikimedia.org, or to a string with the URI.
	// Leaving it undefined (the default) will use the same URI as the MW API,
	// changing api.php for load.php.
	//parsoidConfig.modulesLoadURI = true;

	// Suppress some warnings from the Mediawiki API
	// (defaults to suppressing warnings which the Parsoid team knows to
	// be harmless)
	//parsoidConfig.suppressMwApiWarnings = /annoying warning|other warning/;
};

Initially I thought I had overlooked some of the Collection documentation associated with mwlib (http://mwlib.readthedocs.org/en/latest/collection.html#password-protected-wikis) and that if wgCollectionMWServeCredentials was set it would help, however this had no impact.

Possibly T73849 is a duplicate and in particular this comment below may help, but I'm not sure exactly how. I've tried adding http://user@pw:localhost to the parsoid configuration file and while VE still works, Collection works no better. I'm inclined to think the problem here is not parsoid as VE seems to be fine.

Is the concrete feature request here that we support HTTP authentication (basic? digest?) when contacting the wiki's api.php endpoint?

Have you tried using the 'http://username:password@host/...' format when configuring the API endpoint URL?

Is it possible to add any kind of bug-bounty?

I realise this is "Low" priority for Wikimedia, for me it may be important in the near future. I presently lack either skills/time/energy to resolve this myself and am totally OK with this being categorised to meet wikimedia strategic objectives but am looking for a way forward for myself.

I didn't notice anything about bug bounties in the etiquette document and I also don't know of a good crowd-sourcing platform for random bugs.

There are several bug bounty pages out there and mw:Professional development and consulting. Wikimedia itself offers no bug bounties.

I would like to subscribe to this, since I am having the exact same issue with a private wiki.
Also, Dan, did you ever find a workaround?

Looks to me like the problem is right here:

[2015-12-06T03:26:42.174Z]  INFO: mw-ocg-service/7106 on lamp: [0%]
Fetching wiki configuration: http://52.62.34.216/html/mediawiki (channel=backend.bundler.bin, details="")
  job: {

You've configured mediawiki to bypass the read restrictions when the connection is to local host (127.0.0.1), but you've got OCG configured to use the non-localhost IP address of your server.

Look in your configuration for 52.62.34.216 and you'll probably find the source of your problem.

I'll note that you didn't post the localsettings.js you are using for OCG; that might be where the 52.62.34.216 IP is coming from. Its possible this is coming from the Collection extension, though, in which case we'd need to override the MW API url which OCG is using (probably in OCG's localsettings.js).

That seems to be the case!
Mine actually fetches the subdomain http://wiki.example.com, but I am failing where exactly it gets this information from.

As far as I can see, only
$wgServer in the wiki LocalSettings is set as that.

I am still searching where that information is fetched from. Might be Parsoid? Collection?

Could it be from the case that the bundler falls back to the data provided by the API:Siteinfo as:

...
"server": "http://wiki.example.com",
"servername": "wiki.example.com",
...

in order to connect to localhost?

cause in index.js there seems to be an indication to me (I dont know Java at all)

	return Promise.resolve()
	// Stage 1
		.then(function() {
			status.createStage(
				2 * (metabook.wikis.length + 1),
				'Fetching wiki configuration'
			);
		})
		.then(repairMetabook)
		.then(mkOutputDir)
		.then(mkModuleDir)
		.then(openDatabases)
                .then(fetchSiteInfo)  // <--- here?

Is there a way to explicity state the server?

Dan.mulholland claimed this task.

Hi @Mehmet.ali.anil

Based on what Scott said

Looks to me like the problem is right here:

[2015-12-06T03:26:42.174Z]  INFO: mw-ocg-service/7106 on lamp: [0%]
Fetching wiki configuration: http://52.62.34.216/html/mediawiki (channel=backend.bundler.bin, details="")
  job: {

You've configured mediawiki to bypass the read restrictions when the connection is to local host (127.0.0.1), but you've got OCG configured to use the non-localhost IP address of your server.

Look in your configuration for 52.62.34.216 and you'll probably find the source of your problem.

I had a go at simply whitelisting the server public IP: by using the following in LocalSettings.php:

if ( @$_SERVER['REMOTE_ADDR'] == '52.62.34.216' || @$_SERVER['REMOTE_ADDR'] == '127.0.0.1' ) {
  $wgGroupPermissions['*']['read'] = true;
}

This removed the errors I had with bundler and allowed PDFs to be rendered and downloaded while keeping the wiki private. Thanks @cscott!

I feel fairly confident that the same sort of thing using the array specified with NetworkAuth would also do the trick.

The Collection installation instructions are fairly nightmarish. I have added a little to https://wikitech.wikimedia.org/wiki/OCG#Installing_a_development_instance to clarify what I did to make this work on a private wiki.

JFYI it seems from recent discussions that consideration of producing PDFs from a headless browser may be getting more traction than improvements to Collection/OCG which doesn't appear to have had a lot of development in quite some time and doesn't support some core mediawiki syntax (e.g. tables) very well.