Add External Data extension, with config for SnipeIT

This commit is contained in:
Adam Goldsmith 2020-07-05 02:01:32 -04:00
parent 83fd0348ce
commit fb10510dc4
2 changed files with 19 additions and 0 deletions

View File

@ -67,3 +67,8 @@ RUN git clone --depth 1 -b $MEDIAWIKI_BRANCH \
RUN git clone --depth 1 -b $MEDIAWIKI_BRANCH \
https://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateData \
/var/www/html/extensions/TemplateData
# https://www.mediawiki.org/wiki/Extension:External_Data
RUN git clone --depth 1 \
https://gerrit.wikimedia.org/r/mediawiki/extensions/ExternalData \
/var/www/html/extensions/ExternalData

View File

@ -227,3 +227,17 @@ $wgVirtualRestConfig['modules']['parsoid'] = array(
wfLoadExtension( 'TemplateData' );
require_once "$IP/extensions/Widgets/Widgets.php";
wfLoadExtension( 'ExternalData' );
$edgStringReplacements['SNIPEIT_URL'] = 'https://inventory.claremontmakerspace.org';
$edgAllowExternalDataFrom = 'SNIPEIT_URL';
// TODO: Use ExternalDataBeforeWebCall to set the headers only for
// snipeit API calls. Only matters if other domains are added to
// the whitelist.
$edgHTTPOptions = [
'headers' => [
'Accept' => 'application/json',
'Content-Type' => 'application/json',
'Authorization' => 'Bearer '.$secrets['SnipeITAPIKey']
]
];