Install plugins

This commit is contained in:
Illya Marchenko 2022-12-30 13:49:41 +02:00
parent 7547bc11df
commit d4af5f4621
11 changed files with 79 additions and 8 deletions

@ -4,8 +4,14 @@ ENV DEBIAN_FRONTEND="noninteractive"
COPY ./config.json /tmp/config.json COPY ./config.json /tmp/config.json
COPY ./build /tmp COPY ./build /tmp
RUN apt update && apt install --yes wget gpg \
&& wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg \
&& echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main" | tee /etc/apt/sources.list.d/elastic-8.x.list \
&& apt update && apt install elasticsearch
RUN find /tmp/mediawiki_extensions -name "*.tar.gz" -exec sh -c 'tar -xzf {} -C /var/www/html/extensions' \; \ RUN find /tmp/mediawiki_extensions -name "*.tar.gz" -exec sh -c 'tar -xzf {} -C /var/www/html/extensions' \; \
&& find /tmp/mediawiki_skins -name "*.tar.gz" -exec sh -c 'tar -xzf {} -C /var/www/html/skins' \; \ && find /tmp/mediawiki_skins -name "*.tar.gz" -exec sh -c 'tar -xzf {} -C /var/www/html/skins' \; \
&& find /tmp/mediawiki_override -type f -exec php /tmp/scripts/config_placeholder_replace.php "/tmp/config.json" "{}" \; \ && find /tmp/mediawiki_override -type f -exec php /tmp/scripts/config_placeholder_replace.php "/tmp/config.json" "{}" \; \
&& mv /tmp/mediawiki_override/* /var/www/html \ && cp -R /tmp/mediawiki_override/* /var/www/html \
&& chown www-data:www-data /var/www/html/extensions/ -R \
&& rm -R /tmp/* && rm -R /tmp/*

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -163,22 +163,26 @@ $extensions = [
// "CharInsert", // "CharInsert",
// "TemplateStyles", // "TemplateStyles",
"TimedMediaHandler", "TimedMediaHandler",
// "AdvancedSearch",
// "RevisionSlider", // "RevisionSlider",
// "Scribunto", "Scribunto",
// "Mpdf",
// "ExpandableContent", // "ExpandableContent",
"MonacoEditor", "MonacoEditor",
// "Spoilers", // "Spoilers",
// "AutoCreateCategoryPages", // "AutoCreateCategoryPages",
// "CiteThisPage", // "CiteThisPage",
// "TextExtracts",
// "TitleBlacklist", // "TitleBlacklist",
// "Disambiguator", // "Disambiguator",
"OATHAuth", "OATHAuth",
// "EmbedVideo", // "EmbedVideo",
"UserFunctions", "UserFunctions",
"DynamicSidebar", "DynamicSidebar",
"Mpdf",
"Elastica",
"CirrusSearch",
"AdvancedSearch",
"PageImages",
"TextExtracts",
"Popups",
]; ];
foreach($extensions as $extension){ foreach($extensions as $extension){
$json_file = "$wgExtensionDirectory/$extension/extension.json"; $json_file = "$wgExtensionDirectory/$extension/extension.json";
@ -190,11 +194,13 @@ foreach($extensions as $extension){
} }
// END: load extensions // END: load extensions
// $wgScribuntoDefaultEngine = 'luastandalone'; $wgScribuntoDefaultEngine = 'luastandalone';
// $wgMaxShellMemory = 204800; # in KB // $wgMaxShellMemory = 204800; # in KB
// $wgScribuntoEngineConf['luastandalone']['memoryLimit'] = 209715200; # bytes // $wgScribuntoEngineConf['luastandalone']['memoryLimit'] = 209715200; # bytes
// $wgScribuntoEngineConf['luastandalone']['errorFile'] = "$IP/err.log"; // $wgScribuntoEngineConf['luastandalone']['errorFile'] = "$IP/err.log";
// $wgScribuntoEngineConf['luastandalone']['luaPath'] = '/usr/bin/lua5.1'; // $wgScribuntoEngineConf['luastandalone']['luaPath'] = '/usr/bin/lua5.1';
$wgScribuntoUseGeSHi = true;
$wgScribuntoUseCodeEditor = true;
// Hide user toolbar settings // Hide user toolbar settings
$wgHiddenPrefs[] = 'usebetatoolbar'; $wgHiddenPrefs[] = 'usebetatoolbar';
@ -259,6 +265,9 @@ $wgUFAllowedNamespaces = [
$wgPFEnableStringFunctions = true; $wgPFEnableStringFunctions = true;
//$wgMpdfTab = true;
$wgMpdfToolboxLink = true;
// $wgObjectCaches['redis'] = [ // $wgObjectCaches['redis'] = [
// 'class' => 'RedisBagOStuff', // 'class' => 'RedisBagOStuff',
// 'servers' => [ '127.0.0.1:6379' ], // 'servers' => [ '127.0.0.1:6379' ],

@ -0,0 +1,56 @@
<?php
namespace AdvancedSearch;
use ResourceLoaderContext;
use ResourceLoaderModule;
use ResourceLoaderWikiModule;
use Xml;
/**
* ResourceLoader module providing the users "searchnamespace" token.
*/
class SearchnamespaceTokenModule extends ResourceLoaderWikiModule {
/**
* @var int
*/
protected $origin = self::ORIGIN_CORE_INDIVIDUAL;
/**
* @var string[]
*/
protected $targets = [ 'desktop', 'mobile' ];
/**
* @param ResourceLoaderContext $context
*
* @return string JavaScript code
*/
public function getScript( ResourceLoaderContext $context ) {
$user = $context->getUserObj();
// Use FILTER_NOMIN annotation to prevent needless minification and caching (T84960).
return ResourceLoader::FILTER_NOMIN .
Xml::encodeJsCall(
'mw.user.tokens.set',
[ 'searchnamespaceToken', $user->getEditToken( 'searchnamespace' ) ],
(bool)ResourceLoader::inDebugMode()
);
}
/**
* @return bool
*/
public function supportsURLLoading() {
return false;
}
/**
* @return string
*/
public function getGroup() {
// Private modules can not be loaded as a dependency, only via OutputPage::addModules().
return 'private';
}
}