diff --git a/Dockerfile b/Dockerfile index c046180..4ad1232 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,8 +4,14 @@ ENV DEBIAN_FRONTEND="noninteractive" COPY ./config.json /tmp/config.json 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' \; \ && 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" "{}" \; \ - && 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/* \ No newline at end of file diff --git a/build/mediawiki_extensions/AdvancedSearch.tar.gz b/build/mediawiki_extensions/AdvancedSearch.tar.gz new file mode 100644 index 0000000..af08515 Binary files /dev/null and b/build/mediawiki_extensions/AdvancedSearch.tar.gz differ diff --git a/build/mediawiki_extensions/CirrusSearch.tar.gz b/build/mediawiki_extensions/CirrusSearch.tar.gz new file mode 100644 index 0000000..0eb0468 Binary files /dev/null and b/build/mediawiki_extensions/CirrusSearch.tar.gz differ diff --git a/build/mediawiki_extensions/Elastica.tar.gz b/build/mediawiki_extensions/Elastica.tar.gz new file mode 100644 index 0000000..6ec3a46 Binary files /dev/null and b/build/mediawiki_extensions/Elastica.tar.gz differ diff --git a/build/mediawiki_extensions/MonacoEditor.tar.gz b/build/mediawiki_extensions/MonacoEditor.tar.gz index 14f4e4f..a23d191 100644 Binary files a/build/mediawiki_extensions/MonacoEditor.tar.gz and b/build/mediawiki_extensions/MonacoEditor.tar.gz differ diff --git a/build/mediawiki_extensions/Mpdf.tar.gz b/build/mediawiki_extensions/Mpdf.tar.gz new file mode 100644 index 0000000..a69f9ee Binary files /dev/null and b/build/mediawiki_extensions/Mpdf.tar.gz differ diff --git a/build/mediawiki_extensions/PageImages.tar.gz b/build/mediawiki_extensions/PageImages.tar.gz new file mode 100644 index 0000000..3024d90 Binary files /dev/null and b/build/mediawiki_extensions/PageImages.tar.gz differ diff --git a/build/mediawiki_extensions/Popups.tar.gz b/build/mediawiki_extensions/Popups.tar.gz new file mode 100644 index 0000000..eb60387 Binary files /dev/null and b/build/mediawiki_extensions/Popups.tar.gz differ diff --git a/build/mediawiki_extensions/TextExtracts.tar.gz b/build/mediawiki_extensions/TextExtracts.tar.gz new file mode 100644 index 0000000..5609fbb Binary files /dev/null and b/build/mediawiki_extensions/TextExtracts.tar.gz differ diff --git a/build/mediawiki_override/LocalSettings.php b/build/mediawiki_override/LocalSettings.php index d147907..9e4eab8 100644 --- a/build/mediawiki_override/LocalSettings.php +++ b/build/mediawiki_override/LocalSettings.php @@ -163,22 +163,26 @@ $extensions = [ // "CharInsert", // "TemplateStyles", "TimedMediaHandler", - // "AdvancedSearch", // "RevisionSlider", - // "Scribunto", - // "Mpdf", + "Scribunto", // "ExpandableContent", "MonacoEditor", // "Spoilers", // "AutoCreateCategoryPages", // "CiteThisPage", - // "TextExtracts", // "TitleBlacklist", // "Disambiguator", "OATHAuth", // "EmbedVideo", "UserFunctions", - "DynamicSidebar", + "DynamicSidebar", + "Mpdf", + "Elastica", + "CirrusSearch", + "AdvancedSearch", + "PageImages", + "TextExtracts", + "Popups", ]; foreach($extensions as $extension){ $json_file = "$wgExtensionDirectory/$extension/extension.json"; @@ -190,11 +194,13 @@ foreach($extensions as $extension){ } // END: load extensions -// $wgScribuntoDefaultEngine = 'luastandalone'; +$wgScribuntoDefaultEngine = 'luastandalone'; // $wgMaxShellMemory = 204800; # in KB // $wgScribuntoEngineConf['luastandalone']['memoryLimit'] = 209715200; # bytes // $wgScribuntoEngineConf['luastandalone']['errorFile'] = "$IP/err.log"; // $wgScribuntoEngineConf['luastandalone']['luaPath'] = '/usr/bin/lua5.1'; +$wgScribuntoUseGeSHi = true; +$wgScribuntoUseCodeEditor = true; // Hide user toolbar settings $wgHiddenPrefs[] = 'usebetatoolbar'; @@ -259,6 +265,9 @@ $wgUFAllowedNamespaces = [ $wgPFEnableStringFunctions = true; +//$wgMpdfTab = true; +$wgMpdfToolboxLink = true; + // $wgObjectCaches['redis'] = [ // 'class' => 'RedisBagOStuff', // 'servers' => [ '127.0.0.1:6379' ], @@ -294,4 +303,4 @@ $wgPFEnableStringFunctions = true; //$wgWhitelistRead = [ // "Main Page", "MediaWiki:Common.css", "MediaWiki:Common.js" -//]; +//]; \ No newline at end of file diff --git a/build/mediawiki_override/extensions/AdvancedSearch/includes/SearchnamespaceTokenModule.php b/build/mediawiki_override/extensions/AdvancedSearch/includes/SearchnamespaceTokenModule.php new file mode 100644 index 0000000..484f793 --- /dev/null +++ b/build/mediawiki_override/extensions/AdvancedSearch/includes/SearchnamespaceTokenModule.php @@ -0,0 +1,56 @@ +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'; + } + +}