From 5ff50f31516bb67da39d91d8e6a7c929d22015f4 Mon Sep 17 00:00:00 2001 From: Yaron Koren Date: Thu, 7 Sep 2023 14:56:37 -0400 Subject: [PATCH 01/78] Add TemplateSandbox extension Fixes #240 --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index 8c65cc7c..025dd78d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -519,6 +519,10 @@ RUN set -x; \ && git clone https://github.com/ProfessionalWiki/SubPageList $MW_HOME/extensions/SubPageList \ && cd $MW_HOME/extensions/SubPageList \ && git checkout -q c016dcdb7866f20319731e6497b48fd43756505e \ + # TemplateSandbox + && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-TemplateSandbox $MW_HOME/extensions/TemplateSandbox \ + && cd $MW_HOME/extensions/TemplateSandbox \ + && git checkout -q 8af94cedc41cbe6c54614714ced6ce4128555ce4 \ # TemplateStyles && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-TemplateStyles $MW_HOME/extensions/TemplateStyles \ && cd $MW_HOME/extensions/TemplateStyles \ From bf3a6f5776ebc9fd0b70efd62d691ca8a104c932 Mon Sep 17 00:00:00 2001 From: Chenhao Liu Date: Fri, 29 Sep 2023 06:52:51 -0700 Subject: [PATCH 02/78] Canasta 2.0 adding wiki farm support (#295) Canasta 2.0 adding wiki farm support --- Dockerfile | 12 +- _sources/canasta/CanastaDefaultSettings.php | 33 ++- _sources/canasta/FarmConfigLoader.php | 153 ++++++++++++ _sources/canasta/canasta_img.php | 234 ++++++++++++++++++ _sources/canasta/getMediawikiSettings.php | 2 +- _sources/configs/.htaccess | 4 +- _sources/scripts/config-subdir-wikis.sh | 32 +++ _sources/scripts/create-storage-dirs.sh | 21 ++ .../maintenance-scripts/mw_job_runner.sh | 55 +++- .../maintenance-scripts/mw_transcoder.sh | 40 ++- _sources/scripts/run-apache.sh | 19 +- 11 files changed, 574 insertions(+), 31 deletions(-) create mode 100644 _sources/canasta/FarmConfigLoader.php create mode 100644 _sources/canasta/canasta_img.php create mode 100644 _sources/scripts/config-subdir-wikis.sh create mode 100644 _sources/scripts/create-storage-dirs.sh diff --git a/Dockerfile b/Dockerfile index 471d3d73..cfaf21c3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -53,6 +53,7 @@ RUN set x; \ php7.4-gd \ php7.4-mbstring \ php7.4-xml \ + php7.4-mysql \ php7.4-intl \ php7.4-opcache \ php7.4-apcu \ @@ -60,6 +61,7 @@ RUN set x; \ php7.4-curl \ php7.4-zip \ php7.4-fpm \ + php7.4-yaml \ libapache2-mod-fcgid \ && aptitude clean \ && rm -rf /var/lib/apt/lists/* @@ -663,11 +665,11 @@ RUN set -x; \ # Generate sample files for installing extensions and skins in LocalSettings.php RUN set -x; \ cd $MW_HOME/extensions \ - && for i in $(ls -d */); do echo "#wfLoadExtension('${i%%/}');"; done > $MW_ORIGIN_FILES/installedExtensions.txt \ + && for i in $(ls -d */); do echo "#wfLoadExtension('${i%%/}');"; done > $MW_ORIGIN_FILES/installedExtensions.txt \ # Dirty hack for Semantic MediaWiki && sed -i "s/#wfLoadExtension('SemanticMediaWiki');/#enableSemantics('localhost');/g" $MW_ORIGIN_FILES/installedExtensions.txt \ && cd $MW_HOME/skins \ - && for i in $(ls -d */); do echo "#wfLoadSkin('${i%%/}');"; done > $MW_ORIGIN_FILES/installedSkins.txt \ + && for i in $(ls -d */); do echo "#wfLoadSkin('${i%%/}');"; done > $MW_ORIGIN_FILES/installedSkins.txt \ # Load Vector skin by default in the sample file && sed -i "s/#wfLoadSkin('Vector');/wfLoadSkin('Vector');/" $MW_ORIGIN_FILES/installedSkins.txt @@ -729,8 +731,9 @@ COPY _sources/scripts/*.php $MW_HOME/maintenance/ COPY _sources/configs/robots.txt $WWW_ROOT/ COPY _sources/configs/.htaccess $WWW_ROOT/ COPY _sources/images/favicon.ico $WWW_ROOT/ -COPY _sources/canasta/LocalSettings.php _sources/canasta/CanastaUtils.php _sources/canasta/CanastaDefaultSettings.php $MW_HOME/ +COPY _sources/canasta/LocalSettings.php _sources/canasta/CanastaUtils.php _sources/canasta/CanastaDefaultSettings.php _sources/canasta/FarmConfigLoader.php $MW_HOME/ COPY _sources/canasta/getMediawikiSettings.php / +COPY _sources/canasta/canasta_img.php $MW_HOME/ COPY _sources/configs/mpm_event.conf /etc/apache2/mods-available/mpm_event.conf RUN set -x; \ @@ -745,6 +748,9 @@ RUN set -x; \ && sed -i 's/MW_CONFIG_FILE/CANASTA_CONFIG_FILE/g' "$MW_HOME/includes/CanastaNoLocalSettings.php" \ # Modify config && sed -i '//,/<\/Directory>/ s/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf \ + && sed -i '//i RewriteCond %{THE_REQUEST} \\s(.*?)\\s\nRewriteRule ^ - [E=ORIGINAL_URL:%{REQUEST_SCHEME}://%{HTTP_HOST}%1]' /etc/apache2/apache2.conf \ + && echo "Alias /w/images/ /var/www/mediawiki/w/canasta_img.php/" >> /etc/apache2/apache2.conf \ + && echo "Alias /w/images /var/www/mediawiki/w/canasta_img.php" >> /etc/apache2/apache2.conf \ && a2enmod expires \ && a2disconf other-vhosts-access-log \ # Enable environment variables for FPM workers diff --git a/_sources/canasta/CanastaDefaultSettings.php b/_sources/canasta/CanastaDefaultSettings.php index 193542b2..08ebfc07 100644 --- a/_sources/canasta/CanastaDefaultSettings.php +++ b/_sources/canasta/CanastaDefaultSettings.php @@ -5,13 +5,15 @@ exit; } -require_once "$IP/CanastaUtils.php"; +require_once "{$IP}/CanastaUtils.php"; $canastaLocalSettingsFilePath = getenv( 'MW_VOLUME' ) . '/config/LocalSettings.php'; +$canastaCommonSettingsFilePath = getenv( 'MW_VOLUME' ) . '/config/CommonSettings.php'; + if ( defined( 'MW_CONFIG_CALLBACK' ) ) { // Called from WebInstaller or similar entry point - if ( !file_exists( $canastaLocalSettingsFilePath ) ) { + if ( !file_exists( $canastaLocalSettingsFilePath ) && !file_exists( $canastaCommonSettingsFilePath ) ) { // Remove all variables, WebInstaller should decide that "$IP/LocalSettings.php" does not exist. $vars = array_keys( get_defined_vars() ); foreach ( $vars as $v => $k ) { @@ -24,7 +26,7 @@ // WebStart entry point // Check that user's LocalSettings.php exists -if ( !is_readable( $canastaLocalSettingsFilePath ) ) { +if ( !is_readable( $canastaLocalSettingsFilePath ) && !is_readable( $canastaCommonSettingsFilePath ) ) { // Emulate that "$IP/LocalSettings.php" does not exist // Set CANASTA_CONFIG_FILE for NoLocalSettings template work correctly in includes/CanastaNoLocalSettings.php @@ -70,10 +72,27 @@ $wgCdnServersNoPurge[] = '172.16.0.0/12'; // 172.16.0.0 – 172.31.255.255 $wgCdnServersNoPurge[] = '192.168.0.0/16'; // 192.168.0.0 – 192.168.255.255 +# Include user defined CommonSettings.php file +if ( file_exists( $canastaCommonSettingsFilePath ) ) { + require_once "$canastaCommonSettingsFilePath"; +} + # Include user defined LocalSettings.php file -require_once "$canastaLocalSettingsFilePath"; +if ( file_exists( $canastaLocalSettingsFilePath ) ) { + require_once "$canastaLocalSettingsFilePath"; +} + +$filenames = glob( getenv( 'MW_VOLUME' ) . '/config/settings/*.php' ); + +if ( $filenames !== false && is_array( $filenames ) ) { + sort( $filenames ); + + foreach ( $filenames as $filename ) { + require_once "$filename"; + } +} -# Include all php files in config/settings directory -foreach (glob(getenv( 'MW_VOLUME' ) . '/config/settings/*.php') as $filename) { - require_once $filename; +# Include the FarmConfig +if ( file_exists( getenv( 'MW_VOLUME' ) . '/config/wikis.yaml' ) ) { + require_once "$IP/FarmConfigLoader.php"; } diff --git a/_sources/canasta/FarmConfigLoader.php b/_sources/canasta/FarmConfigLoader.php new file mode 100644 index 00000000..2df410ac --- /dev/null +++ b/_sources/canasta/FarmConfigLoader.php @@ -0,0 +1,153 @@ + 0 ) { + $firstDirectory = $pathParts[0]; + } + + // If the first directory is not "wiki" or "w", store it in the variable $path + if ( $firstDirectory != "wiki" && $firstDirectory != "w" ) { + $path = $firstDirectory; + } +} + +// Parse the YAML configuration file containing the wiki information +$wikiConfigurations = null; + +try { + // Get the file path of the YAML configuration file + $file = getenv( 'MW_VOLUME' ) . '/config/wikis.yaml'; + + // Check if the configuration file exists, else throw an exception + if ( !file_exists( $file ) ) { + throw new Exception( 'The configuration file does not exist' ); + } + + // Parse the configuration file + $wikiConfigurations = yaml_parse_file( $file ); + + // Check if file parsing was successful, else throw an exception + if ( $wikiConfigurations === false ) { + throw new Exception( 'Error parsing the configuration file' ); + } +} catch ( Exception $e ) { + die( 'Caught exception: ' . $e->getMessage() ); +} + +$wikiIdToConfigMap = []; +$urlToWikiIdMap = []; + +// Populate the arrays with data from the configuration file +if ( isset( $wikiConfigurations ) && isset( $wikiConfigurations['wikis'] ) && is_array( $wikiConfigurations['wikis'] ) ) { + foreach ( $wikiConfigurations['wikis'] as $wiki ) { + // Check if 'url' and 'id' are set before using them + if ( isset( $wiki['url'] ) && isset( $wiki['id'] ) ) { + $urlToWikiIdMap[$wiki['url']] = $wiki['id']; + $wikiIdToConfigMap[$wiki['id']] = $wiki; + } else { + throw new Exception( 'Error: The wiki configuration is missing either the url or id attribute.' ); + } + } +} else { + throw new Exception( 'Error: Invalid wiki configurations.' ); +} + +// Prepare the key using the server name and the path +if ( empty( $path ) ) { + $key = $serverName; +} else { + $key = $serverName . '/' . $path; +} + +// Retrieve the wikiID if available +$wikiID = defined( 'MW_WIKI_NAME' ) ? MW_WIKI_NAME : null; + +// Check if the key is null or if it exists in the urlToWikiIdMap, else throw an exception +if ( $key === null ) { + throw new Exception( "Error: Key is null." ); +} elseif ( $wikiID === null && array_key_exists( $key, $urlToWikiIdMap ) ) { + $wikiID = $urlToWikiIdMap[$key]; +} elseif ( $wikiID === null ) { + throw new Exception( "Error: $key does not exist in urlToWikiIdMap." ); +} + +// Get the configuration for the selected wiki +$selectedWikiConfig = $wikiIdToConfigMap[$wikiID] ?? null; + +// Check if a matching configuration was found. If so, configure the wiki database, else terminate execution +if ( !empty( $selectedWikiConfig ) ) { + // Set database name to the wiki ID + $wgDBname = $wikiID; + + // Set site name and meta namespace from the configuration, or use the wiki ID if 'name' is not set + $wgSitename = isset( $selectedWikiConfig['name'] ) ? $selectedWikiConfig['name'] : $wikiID; + $wgMetaNamespace = isset( $selectedWikiConfig['name'] ) ? $selectedWikiConfig['name'] : $wikiID; +} else { + die( 'Unknown wiki.' ); +} + +// Configure the wiki server and URL paths +$wgServer = "https://$serverName"; +$wgScriptPath = !empty( $path ) + ? "/$path/w" + : "/w"; + +$wgArticlePath = !empty( $path ) + ? "/$path/wiki/$1" + : "/wiki/$1"; +$wgCacheDirectory = "$IP/cache/$wikiID"; +$wgUploadDirectory = "$IP/images/$wikiID"; + +// Load additional configuration files specific to the wiki ID +$files = glob( getenv( 'MW_VOLUME' ) . "/config/{$wikiID}/*.php" ); + +$wgEnableUploads = true; + +// Check if the glob function was successful, else continue with the execution +if ( $files !== false && is_array( $files ) ) { + // Sort the files + sort( $files ); + + // Include each file + foreach ( $files as $filename ) { + require_once "$filename"; + } +} diff --git a/_sources/canasta/canasta_img.php b/_sources/canasta/canasta_img.php new file mode 100644 index 00000000..4ab7ad61 --- /dev/null +++ b/_sources/canasta/canasta_img.php @@ -0,0 +1,234 @@ +doPostOutputShutdown(); + +function wfImageAuthMain() { + global $wgImgAuthUrlPathMap, $wgScriptPath, $wgImgAuthPath, $wikiID; + + $services = \MediaWiki\MediaWikiServices::getInstance(); + $permissionManager = $services->getPermissionManager(); + + $request = RequestContext::getMain()->getRequest(); + $publicWiki = in_array( 'read', $permissionManager->getGroupPermissions( [ '*' ] ), true ); + + // Find the path assuming the request URL is relative to the local public zone URL + $baseUrl = $services->getRepoGroup()->getLocalRepo()->getZoneUrl( 'public' ); + if ( $baseUrl[0] === '/' ) { + $basePath = $baseUrl; + } else { + $basePath = parse_url( $baseUrl, PHP_URL_PATH ); + } + $path = WebRequest::getRequestPathSuffix( $basePath ); + + if ( $path === false ) { + // Try instead assuming canasta_img.php is the base path + $basePath = $wgImgAuthPath ?: "$wgScriptPath/canasta_img.php"; + $path = WebRequest::getRequestPathSuffix( $basePath ); + } + + if ( $path === false ) { + wfForbidden( 'img-auth-accessdenied', 'img-auth-notindir' ); + return; + } + + if ( $path === '' || $path[0] !== '/' ) { + // Make sure $path has a leading / + $path = "/" . $path; + } + + if ( isset( $wikiID ) && !empty( $wikiID ) ) { + // Replace "/images" | "/canasta_img.php" with "/images/$wikiID" | "/canasta_img.php/$wikiID" in the path. + $path = str_replace_last( "/images", "/images/$wikiID", $path ); + $path = str_replace_last( "/canasta_img.php", "/canasta_img.php/$wikiID", $path ); + } else { + error_log( 'Warning: wikiID is not set or empty' ); + } + + $user = RequestContext::getMain()->getUser(); + + // Various extensions may have their own backends that need access. + // Check if there is a special backend and storage base path for this file. + foreach ( $wgImgAuthUrlPathMap as $prefix => $storageDir ) { + $prefix = rtrim( $prefix, '/' ) . '/'; // implicit trailing slash + if ( strpos( $path, $prefix ) === 0 ) { + $be = $services->getFileBackendGroup()->backendFromPath( $storageDir ); + $filename = $storageDir . substr( $path, strlen( $prefix ) ); // strip prefix + // Check basic user authorization + $isAllowedUser = $permissionManager->userHasRight( $user, 'read' ); + if ( !$isAllowedUser ) { + wfForbidden( 'img-auth-accessdenied', 'img-auth-noread', $path ); + return; + } + if ( $be->fileExists( [ 'src' => $filename ] ) ) { + wfDebugLog( 'canasta_img', "Streaming `" . $filename . "`." ); + $be->streamFile( [ + 'src' => $filename, + 'headers' => [ 'Cache-Control: private', 'Vary: Cookie' ] + ] ); + } else { + wfForbidden( 'img-auth-accessdenied', 'img-auth-nofile', $path ); + } + return; + } + } + + // Get the local file repository + $repo = $services->getRepoGroup()->getRepo( 'local' ); + $zone = strstr( ltrim( $path, '/' ), '/', true ); + + // Get the full file storage path and extract the source file name. + // (e.g. 120px-Foo.png => Foo.png or page2-120px-Foo.png => Foo.png). + // This only applies to thumbnails/transcoded, and each of them should + // be under a folder that has the source file name. + if ( $zone === 'thumb' || $zone === 'transcoded' ) { + $name = wfBaseName( dirname( $path ) ); + $filename = $repo->getZonePath( $zone ) . substr( $path, strlen( "/" . $zone ) ); + // Check to see if the file exists + if ( !$repo->fileExists( $filename ) ) { + wfForbidden( 'img-auth-accessdenied', 'img-auth-nofile', $filename ); + return; + } + } else { + $name = wfBaseName( $path ); // file is a source file + $filename = $repo->getZonePath( 'public' ) . $path; + // Check to see if the file exists and is not deleted + $bits = explode( '!', $name, 2 ); + if ( substr( $path, 0, 9 ) === '/archive/' && count( $bits ) == 2 ) { + $file = $repo->newFromArchiveName( $bits[1], $name ); + } else { + $file = $repo->newFile( $name ); + } + if ( !$file->exists() || $file->isDeleted( File::DELETED_FILE ) ) { + wfForbidden( 'img-auth-accessdenied', 'img-auth-nofile', $filename ); + return; + } + } + + $headers = []; // extra HTTP headers to send + + $title = Title::makeTitleSafe( NS_FILE, $name ); + + if ( !$publicWiki ) { + // For private wikis, run extra auth checks and set cache control headers + $headers['Cache-Control'] = 'private'; + $headers['Vary'] = 'Cookie'; + + if ( !$title instanceof Title ) { // files have valid titles + wfForbidden( 'img-auth-accessdenied', 'img-auth-badtitle', $name ); + return; + } + + // Run hook for extension authorization plugins + /** @var array $result */ + $result = null; + if ( !Hooks::runner()->onImgAuthBeforeStream( $title, $path, $name, $result ) ) { + wfForbidden( $result[0], $result[1], array_slice( $result, 2 ) ); + return; + } + + // Check user authorization for this title + // Checks Whitelist too + + if ( !$permissionManager->userCan( 'read', $user, $title ) ) { + wfForbidden( 'img-auth-accessdenied', 'img-auth-noread', $name ); + return; + } + } + + if ( isset( $_SERVER['HTTP_RANGE'] ) ) { + $headers['Range'] = $_SERVER['HTTP_RANGE']; + } + if ( isset( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ) { + $headers['If-Modified-Since'] = $_SERVER['HTTP_IF_MODIFIED_SINCE']; + } + + if ( $request->getCheck( 'download' ) ) { + $headers['Content-Disposition'] = 'attachment'; + } + + // Allow modification of headers before streaming a file + Hooks::runner()->onImgAuthModifyHeaders( $title->getTitleValue(), $headers ); + + // Stream the requested file + list( $headers, $options ) = HTTPFileStreamer::preprocessHeaders( $headers ); + wfDebugLog( 'canasta_img', "Streaming `" . $filename . "`." ); + $repo->streamFileWithStatus( $filename, $headers, $options ); +} + +/** + * Issue a standard HTTP 403 Forbidden header ($msg1-a message index, not a message) and an + * error message ($msg2, also a message index), (both required) then end the script + * subsequent arguments to $msg2 will be passed as parameters only for replacing in $msg2 + * @param string $msg1 + * @param string $msg2 + * @param mixed ...$args To pass as params to wfMessage() with $msg2. Either variadic, or a single + * array argument. + */ +function wfForbidden( $msg1, $msg2, ...$args ) { + global $wgImgAuthDetails; + + $args = ( isset( $args[0] ) && is_array( $args[0] ) ) ? $args[0] : $args; + + $msgHdr = wfMessage( $msg1 )->text(); + $detailMsgKey = $wgImgAuthDetails ? $msg2 : 'badaccess-group0'; + $detailMsg = wfMessage( $detailMsgKey, $args )->text(); + + wfDebugLog( 'canasta_img', + "wfForbidden Hdr: " . wfMessage( $msg1 )->inLanguage( 'en' )->text() . " Msg: " . + wfMessage( $msg2, $args )->inLanguage( 'en' )->text() + ); + + HttpStatus::header( 403 ); + header( 'Cache-Control: no-cache' ); + header( 'Content-Type: text/html; charset=utf-8' ); + $templateParser = new TemplateParser(); + echo $templateParser->processTemplate( 'ImageAuthForbidden', [ + 'msgHdr' => $msgHdr, + 'detailMsg' => $detailMsg, + ] ); +} + +function str_replace_last( $search, $replace, $subject ) { + if ( ( $pos = strrpos( $subject, $search ) ) !== false ) { + $subject = substr_replace( $subject, $replace, $pos, strlen( $search ) ); + } + return $subject; +} diff --git a/_sources/canasta/getMediawikiSettings.php b/_sources/canasta/getMediawikiSettings.php index 30881017..2aaee3cf 100644 --- a/_sources/canasta/getMediawikiSettings.php +++ b/_sources/canasta/getMediawikiSettings.php @@ -4,7 +4,7 @@ $mwHome = getenv( 'MW_HOME' ); -if ( !defined( 'MW_CONFIG_FILE' ) && !file_exists( "$mwHome/LocalSettings.php" ) ) { +if ( !defined( 'MW_CONFIG_FILE' ) && !file_exists( "$mwHome/LocalSettings.php" ) && !file_exists( "$mwHome/CommonSettings.php" ) ) { return; } diff --git a/_sources/configs/.htaccess b/_sources/configs/.htaccess index d6a7ea6a..eb316fe3 100644 --- a/_sources/configs/.htaccess +++ b/_sources/configs/.htaccess @@ -9,8 +9,8 @@ Options -Indexes # VisualEditor support RewriteRule ^/?w/rest.php/ - [L] -# Image authorization support -RewriteRule ^/?w/img_auth.php/ - [L] +# Redirects requests to canasta_img.php for handling image authorization in Canasta. +RewriteRule ^/?w/canasta_img.php/ - [L] # Redirect / to Main Page RewriteRule ^/*$ %{DOCUMENT_ROOT}/w/index.php [L] diff --git a/_sources/scripts/config-subdir-wikis.sh b/_sources/scripts/config-subdir-wikis.sh new file mode 100644 index 00000000..5d80b916 --- /dev/null +++ b/_sources/scripts/config-subdir-wikis.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# Parse the YAML file and get wiki paths +wiki_paths=$(awk -F'/' '/url: .*/ {split($2, arr, "/"); if (arr[length(arr)] != "") print arr[length(arr)]}' $MW_VOLUME/config/wikis.yaml) + +# An associative array to keep track of processed paths +declare -A processed_paths + +# Loop through the paths +for path in $wiki_paths; do + if [[ -z ${processed_paths[$path]} ]]; then + # Mark this path as processed + processed_paths[$path]=1 + + # Create directory if it doesn't exist + mkdir -p $WWW_ROOT/$path + + # Create symbolic link to MediaWiki + ln -sf $MW_HOME $WWW_ROOT/$path + + # Modify .htaccess file + sed -e "s|w/rest.php/|$path/w/rest.php/|g" \ + -e "s|w/canasta_img.php/|$path/w/canasta_img.php/|g" \ + -e "s|^/*$ %{DOCUMENT_ROOT}/w/index.php|/*$ %{DOCUMENT_ROOT}/$path/w/index.php|" \ + -e "s|^\\(.*\\)$ %{DOCUMENT_ROOT}/w/index.php|\\1$ %{DOCUMENT_ROOT}/$path/w/index.php|" \ + $WWW_ROOT/.htaccess > $WWW_ROOT/$path/.htaccess + + # Modify apache2.conf file for canasta_img.php + echo "Alias /$path/w/images/ /var/www/mediawiki/w/canasta_img.php/" >> /etc/apache2/apache2.conf + echo "Alias /$path/w/images /var/www/mediawiki/w/canasta_img.php" >> /etc/apache2/apache2.conf + fi +done diff --git a/_sources/scripts/create-storage-dirs.sh b/_sources/scripts/create-storage-dirs.sh new file mode 100644 index 00000000..b4f38e8e --- /dev/null +++ b/_sources/scripts/create-storage-dirs.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Parse the YAML file and get wiki ids +wiki_ids=$(awk -F': ' '/id: .*/ {print $2}' $MW_VOLUME/config/wikis.yaml) + +# Read the ids into an array +readarray -t ids <<< "$wiki_ids" + +# Loop through the ids +for db_name in "${ids[@]}"; do + # Create the cache and images directories if they don't exist + mkdir -p $MW_VOLUME/cache/$db_name + mkdir -p $MW_VOLUME/images/$db_name + + # Change the permissions of these directories + chown -R $WWW_USER:$WWW_GROUP $MW_VOLUME/cache/$db_name + chown -R $WWW_USER:$WWW_GROUP $MW_VOLUME/images/$db_name +done + +# Protect Images Directory from Internet Access +echo "Deny from All" >> $MW_VOLUME/images/.htaccess diff --git a/_sources/scripts/maintenance-scripts/mw_job_runner.sh b/_sources/scripts/maintenance-scripts/mw_job_runner.sh index 101b7e6b..32993344 100755 --- a/_sources/scripts/maintenance-scripts/mw_job_runner.sh +++ b/_sources/scripts/maintenance-scripts/mw_job_runner.sh @@ -3,12 +3,49 @@ RJ=$MW_HOME/maintenance/runJobs.php echo Starting job runner... + # Wait 10 seconds after the server starts up to give other processes time to get started sleep 10 -echo Job runner started. -while true; do - # Job types that need to be run ASAP mo matter how many of them are in the queue - # Those jobs should be very "cheap" to run + +# Check if wikis.yaml file exists +if [ -f "$MW_VOLUME/config/wikis.yaml" ]; then + # Get all wiki ids and URLs from the YAML file using PHP + wikis=$(php -r '$wikis = yaml_parse_file("'$MW_VOLUME/config/wikis.yaml'")["wikis"]; foreach ($wikis as $wiki) { echo $wiki["id"] . "," . $wiki["url"] . " "; }') + + for wiki_data in $wikis; do + # Split the id and url data into separate variables + IFS=',' read -r wiki_id wiki_url <<< "$wiki_data" + + echo "$wiki_id job runner started" + + { + while true; do + # Job types that need to be run ASAP no matter how many of them are in the queue + # Those jobs should be very "cheap" to run + php $RJ --type="enotifNotify" --server="https://$wiki_url" --wiki="$wiki_id" + sleep 1 + php $RJ --type="createPage" --server="https://$wiki_url" --wiki="$wiki_id" + sleep 1 + php $RJ --type="refreshLinks" --server="https://$wiki_url" --wiki="$wiki_id" + sleep 1 + php $RJ --type="htmlCacheUpdate" --maxjobs=500 --server="https://$wiki_url" --wiki="$wiki_id" + sleep 1 + # Everything else, limit the number of jobs on each batch + # The --wait parameter will pause the execution here until new jobs are added, + # to avoid running the loop without anything to do + php $RJ --maxjobs=10 --server="https://$wiki_url" --wiki="$wiki_id" + + # Wait some seconds to let the CPU do other things, like handling web requests, etc + echo mwjobrunner waits for "$MW_JOB_RUNNER_PAUSE" seconds... + sleep "$MW_JOB_RUNNER_PAUSE" + done + } & + done +else + # wikis.yaml file does not exist. Skip parsing and running specific wiki jobs. + echo "Warning: wikis.yaml does not exist. Running general jobs." + + # Place your general (non-wiki-specific) job run commands here. php $RJ --type="enotifNotify" sleep 1 php $RJ --type="createPage" @@ -17,12 +54,8 @@ while true; do sleep 1 php $RJ --type="htmlCacheUpdate" --maxjobs=500 sleep 1 - # Everything else, limit the number of jobs on each batch - # The --wait parameter will pause the execution here until new jobs are added, - # to avoid running the loop without anything to do php $RJ --maxjobs=10 +fi - # Wait some seconds to let the CPU do other things, like handling web requests, etc - echo mwjobrunner waits for "$MW_JOB_RUNNER_PAUSE" seconds... - sleep "$MW_JOB_RUNNER_PAUSE" -done +# Wait for all background jobs to finish +wait diff --git a/_sources/scripts/maintenance-scripts/mw_transcoder.sh b/_sources/scripts/maintenance-scripts/mw_transcoder.sh index 50ca211a..789a0731 100755 --- a/_sources/scripts/maintenance-scripts/mw_transcoder.sh +++ b/_sources/scripts/maintenance-scripts/mw_transcoder.sh @@ -1,16 +1,44 @@ #!/bin/bash RJ=$MW_HOME/maintenance/runJobs.php + echo Starting transcoder... + # Wait three minutes after the server starts up to give other processes time to get started sleep 180 -echo Transcoder started. -while true; do - php $RJ --type webVideoTranscodePrioritized --maxjobs=10 - sleep 1 - php $RJ --type webVideoTranscode --maxjobs=1 +# Get all wiki ids and URLs from the YAML file using PHP +if [ -f "$MW_VOLUME/config/wikis.yaml" ]; then + # Get all wiki ids and URLs from the YAML file using PHP + wikis=$(php -r 'foreach (yaml_parse_file("'$MW_VOLUME/config/wikis.yaml'")["wikis"] as $wiki) echo $wiki["id"] . "," . $wiki["url"] . " ";') + + for wiki in $wikis; do + # Extract wiki id and url + IFS=', ' read -r -a wiki_data <<< "$wiki" + wiki_id=${wiki_data[0]} + wiki_url=${wiki_data[1]} + echo "$wiki_id transcoder started." + { + while true; do + php $RJ --type=webVideoTranscodePrioritized --maxjobs=10 --wiki="$wiki_id" --server="https://$wiki_url" + sleep 1 + php $RJ --type=webVideoTranscode --maxjobs=1 --wiki="$wiki_id" --server="https://$wiki_url" + + # Wait some seconds to let the CPU do other things, like handling web requests, etc + echo mwtranscoder waits for "$MW_JOB_TRANSCODER_PAUSE" seconds... + sleep "$MW_JOB_TRANSCODER_PAUSE" + done + } & + done +else + echo "Warning: wikis.yaml does not exist. Starting the general transcoder." + php $RJ --type=webVideoTranscodePrioritized --maxjobs=10 + sleep 1 + php $RJ --type=webVideoTranscode --maxjobs=1 # Wait some seconds to let the CPU do other things, like handling web requests, etc echo mwtranscoder waits for "$MW_JOB_TRANSCODER_PAUSE" seconds... sleep "$MW_JOB_TRANSCODER_PAUSE" -done +fi + +# Wait for all background jobs to finish +wait diff --git a/_sources/scripts/run-apache.sh b/_sources/scripts/run-apache.sh index 0db6e3cf..5a92f1bb 100755 --- a/_sources/scripts/run-apache.sh +++ b/_sources/scripts/run-apache.sh @@ -147,6 +147,18 @@ run_autoupdate () { echo "Auto-update completed" } +config_subdir_wikis() { + echo "Configuring subdirectory wikis..." + /config-subdir-wikis.sh + echo "Configured subdirectory wikis..." +} + +create_storage_dirs() { + echo "Creating cache and images dirs..." + /create-storage-dirs.sh + echo "Created cache and images dirs..." +} + check_mount_points () { # Check for $MW_HOME/user-extensions presence and bow out if it's not in place if [ ! -d "$MW_HOME/user-extensions" ]; then @@ -176,14 +188,19 @@ cd "$MW_HOME" || exit ########## Run maintenance scripts ########## echo "Checking for LocalSettings..." -if [ -e "$MW_VOLUME/config/LocalSettings.php" ]; then +if [ -e "$MW_VOLUME/config/LocalSettings.php" ] || [ -e "$MW_VOLUME/config/CommonSettings.php" ]; then # Run auto-update run_autoupdate + if [ -e "$MW_VOLUME/config/wikis.yaml" ]; then + config_subdir_wikis + create_storage_dirs + fi fi echo "Starting services..." run_maintenance_scripts & +inotifywait & # Running php-fpm /run-php-fpm.sh & From c2149e42b388411648a108f8f8787e72cd0a8ab7 Mon Sep 17 00:00:00 2001 From: Yaron Koren Date: Mon, 2 Oct 2023 09:29:01 -0400 Subject: [PATCH 03/78] Change "chameleon" skin directory to be all lowercase (#306) * Change "chameleon" skin directory to be all lowercase Fixes #304. * Update composer.canasta.json --- Dockerfile | 4 ++-- _sources/configs/composer.canasta.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 471d3d73..1e53c275 100644 --- a/Dockerfile +++ b/Dockerfile @@ -101,8 +101,8 @@ RUN set -x; \ RUN set -x; \ cd $MW_HOME/skins \ # Chameleon (v. 4.2.1) - && git clone https://github.com/ProfessionalWiki/chameleon $MW_HOME/skins/Chameleon \ - && cd $MW_HOME/skins/Chameleon \ + && git clone https://github.com/ProfessionalWiki/chameleon $MW_HOME/skins/chameleon \ + && cd $MW_HOME/skins/chameleon \ && git checkout -q f34a56528ada14ac07e1b03beda41f775ef27606 \ # CologneBlue && git clone -b $MW_VERSION --single-branch https://github.com/wikimedia/mediawiki-skins-CologneBlue $MW_HOME/skins/CologneBlue \ diff --git a/_sources/configs/composer.canasta.json b/_sources/configs/composer.canasta.json index 913f5858..b8bc3553 100644 --- a/_sources/configs/composer.canasta.json +++ b/_sources/configs/composer.canasta.json @@ -23,7 +23,7 @@ "extensions/SemanticMediaWiki/composer.json", "extensions/SemanticResultFormats/composer.json", "extensions/WSOAuth/composer.json", - "skins/Chameleon/composer.json" + "skins/chameleon/composer.json" ] } } From 266d0d001f46acade0748ba2cf35b67d750c21fd Mon Sep 17 00:00:00 2001 From: Vedmaka Date: Fri, 13 Oct 2023 23:30:29 +0400 Subject: [PATCH 04/78] Upgrades MassMessageEmail extension to the latest REL1_39 commit (#311) --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1e53c275..15e5a7ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -374,7 +374,7 @@ RUN set -x; \ # MassMessageEmail && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-MassMessageEmail $MW_HOME/extensions/MassMessageEmail \ && cd $MW_HOME/extensions/MassMessageEmail \ - && git checkout -q edd96f14c6d108d56bcecb18b5bb7b3355437732 \ + && git checkout -q bd1f3413dbe8242b4294892a7f9803ea22364eae \ # MediaUploader && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-MediaUploader $MW_HOME/extensions/MediaUploader \ && cd $MW_HOME/extensions/MediaUploader \ From 1cd285f621feb8e49637c7bdf9e0e4838cfaca0f Mon Sep 17 00:00:00 2001 From: Yaron Koren Date: Sun, 15 Oct 2023 11:45:33 -0400 Subject: [PATCH 05/78] Update Echo revision to work better for 1.39 DB update Fixes #309 . --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 15e5a7ae..514a701d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -242,7 +242,7 @@ RUN set -x; \ # Echo && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-Echo $MW_HOME/extensions/Echo \ && cd $MW_HOME/extensions/Echo \ - && git checkout -q fdbc2cafdc412dc60d4345511defe9ee393efecf \ + && git checkout -q 7ae3c1059a5f4fd1f96f23fa8674bb1705f5e10d \ # EditAccount && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-EditAccount.git $MW_HOME/extensions/EditAccount \ && cd $MW_HOME/extensions/EditAccount \ From 7c831ea74787d2f88c44ae6601d60263173ae6ee Mon Sep 17 00:00:00 2001 From: Vedmaka Date: Wed, 1 Nov 2023 23:54:45 +0400 Subject: [PATCH 06/78] Adds MassMessageEmail to composer file (#312) --- _sources/configs/composer.canasta.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_sources/configs/composer.canasta.json b/_sources/configs/composer.canasta.json index b8bc3553..8135cd45 100644 --- a/_sources/configs/composer.canasta.json +++ b/_sources/configs/composer.canasta.json @@ -23,7 +23,8 @@ "extensions/SemanticMediaWiki/composer.json", "extensions/SemanticResultFormats/composer.json", "extensions/WSOAuth/composer.json", - "skins/chameleon/composer.json" + "skins/chameleon/composer.json", + "extensions/MassMessageEmail/composer.json" ] } } From 5f468c1ebb43176b45524db0ba12626fc7716ecf Mon Sep 17 00:00:00 2001 From: Greg Rundlett Date: Fri, 3 Nov 2023 12:26:38 -0400 Subject: [PATCH 07/78] Minor wording change to indicate we are updating etc/hosts (#316) Co-authored-by: Greg Rundlett --- _sources/scripts/update-docker-gateway.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_sources/scripts/update-docker-gateway.sh b/_sources/scripts/update-docker-gateway.sh index b44d2033..191bf8ac 100644 --- a/_sources/scripts/update-docker-gateway.sh +++ b/_sources/scripts/update-docker-gateway.sh @@ -42,7 +42,7 @@ if [ -n "$WG_SITE_SERVER" ]; then elif [[ $MW_SITE_HOST =~ ^[0-9]+.[0-9]+.[0-9]+.[0-9]+$ ]]; then echo "MW_SITE_HOST is IP address '$MW_SITE_HOST'" else - echo "Add MW_SITE_HOST '$DOCKER_GATEWAY $MW_SITE_HOST' to /etc/hosts" + echo "Adding MW_SITE_HOST '$DOCKER_GATEWAY $MW_SITE_HOST' to /etc/hosts" echo "$DOCKER_GATEWAY $MW_SITE_HOST # MW_SITE_HOST" >> ~/hosts.new fi fi From 24cfb4e718f91dccae628779a3a234b0ad12016b Mon Sep 17 00:00:00 2001 From: Yaron Koren Date: Mon, 6 Nov 2023 10:40:26 -0500 Subject: [PATCH 08/78] Update WatchAnalytics extension to v. 4.1.2 Fixes #298 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 514a701d..5b2d9a6e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -579,10 +579,10 @@ RUN set -x; \ && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-VoteNY $MW_HOME/extensions/VoteNY \ && cd $MW_HOME/extensions/VoteNY \ && git checkout -q 11c103f4b9167a8d8d5e850d8a781c6f49b249c1 \ - # WatchAnalytics (v. 4.1.0) + # WatchAnalytics (v. 4.1.2) && git clone --single-branch -b master https://github.com/wikimedia/mediawiki-extensions-WatchAnalytics $MW_HOME/extensions/WatchAnalytics \ && cd $MW_HOME/extensions/WatchAnalytics \ - && git checkout -q 793a03b21992c63bc431e3bf0835351958315fb8 \ + && git checkout -q 72b70a667a26bbde0a3cf93fc79747aae08fca32 \ # WhoIsWatching && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-WhoIsWatching $MW_HOME/extensions/WhoIsWatching \ && cd $MW_HOME/extensions/WhoIsWatching \ From 3db379c7da760aa8284f1b63db738287d75fbcde Mon Sep 17 00:00:00 2001 From: Pavel Astakhov Date: Wed, 15 Nov 2023 01:12:21 +0600 Subject: [PATCH 09/78] Update ContributionScores to fixed version (#320) Fixes #319 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5b2d9a6e..6af76cfd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -210,7 +210,7 @@ RUN set -x; \ # ContributionScores && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-ContributionScores $MW_HOME/extensions/ContributionScores \ && cd $MW_HOME/extensions/ContributionScores \ - && git checkout -q e307850555ef313f623dde6e2f1d5d2a43663730 \ + && git checkout -q 0c08d338a1150c76e74ae490cd4d5f5b9f6daa5f \ # CookieWarning && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-CookieWarning $MW_HOME/extensions/CookieWarning \ && cd $MW_HOME/extensions/CookieWarning \ From 8b265c367d03153604759f4f9928b4dda8e8e2a4 Mon Sep 17 00:00:00 2001 From: Pavel Astakhov Date: Tue, 21 Nov 2023 23:34:48 +0600 Subject: [PATCH 10/78] Add configurable fpm/pool.d/www.conf file\ Environment variables: * PM_MAX_CHILDREN = 25 * PM_START_SERVERS = 10 * PM_MIN_SPARE_SERVERS = 5 * PM_MAX_SPARE_SERVERS = 15 * PM_MAX_REQUESTS = 2500 --- Dockerfile | 8 +- _sources/configs/php-fpm-www.conf | 439 ++++++++++++++++++++++++++++++ 2 files changed, 446 insertions(+), 1 deletion(-) create mode 100644 _sources/configs/php-fpm-www.conf diff --git a/Dockerfile b/Dockerfile index 6af76cfd..4456db7f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -494,7 +494,7 @@ RUN set -x; \ # SimpleBatchUpload (v. 2.0.0) && git clone https://github.com/ProfessionalWiki/SimpleBatchUpload $MW_HOME/extensions/SimpleBatchUpload \ && cd $MW_HOME/extensions/SimpleBatchUpload \ - && git checkout -q 3b9e248b49d7fbeb81d7da32078db7040809e724 \ + && git checkout -q 3b9e248b49d7fbeb81d7da32078db7040809e724 \ # SimpleChanges && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-SimpleChanges $MW_HOME/extensions/SimpleChanges \ && cd $MW_HOME/extensions/SimpleChanges \ @@ -713,6 +713,11 @@ ENV MW_ENABLE_JOB_RUNNER=true \ PHP_MAX_INPUT_VARS=1000 \ PHP_MAX_EXECUTION_TIME=60 \ PHP_MAX_INPUT_TIME=60 \ + PM_MAX_CHILDREN = 25 \ + PM_START_SERVERS = 10 \ + PM_MIN_SPARE_SERVERS = 5 \ + PM_MAX_SPARE_SERVERS = 15 \ + PM_MAX_REQUESTS = 2500 \ LOG_FILES_COMPRESS_DELAY=3600 \ LOG_FILES_REMOVE_OLDER_THAN_DAYS=10 @@ -723,6 +728,7 @@ COPY _sources/configs/php_error_reporting.ini _sources/configs/php_upload_max_fi COPY _sources/configs/php_error_reporting.ini _sources/configs/php_upload_max_filesize.ini /etc/php/7.4/fpm/conf.d/ COPY _sources/configs/php_max_input_vars.ini _sources/configs/php_max_input_vars.ini /etc/php/7.4/fpm/conf.d/ COPY _sources/configs/php_timeouts.ini /etc/php/7.4/fpm/conf.d/ +COPY _sources/configs/php-fpm-www.conf /etc/php/7.4/fpm/pool.d/www.conf COPY _sources/scripts/*.sh / COPY _sources/scripts/maintenance-scripts/*.sh /maintenance-scripts/ COPY _sources/scripts/*.php $MW_HOME/maintenance/ diff --git a/_sources/configs/php-fpm-www.conf b/_sources/configs/php-fpm-www.conf new file mode 100644 index 00000000..cc4391dd --- /dev/null +++ b/_sources/configs/php-fpm-www.conf @@ -0,0 +1,439 @@ +; Start a new pool named 'www'. +; the variable $pool can be used in any directive and will be replaced by the +; pool name ('www' here) +[www] + +; Per pool prefix +; It only applies on the following directives: +; - 'access.log' +; - 'slowlog' +; - 'listen' (unixsocket) +; - 'chroot' +; - 'chdir' +; - 'php_values' +; - 'php_admin_values' +; When not set, the global prefix (or /usr) applies instead. +; Note: This directive can also be relative to the global prefix. +; Default Value: none +;prefix = /path/to/pools/$pool + +; Unix user/group of processes +; Note: The user is mandatory. If the group is not set, the default user's group +; will be used. +user = $WWW_USER +group = $WWW_GROUP + +; The address on which to accept FastCGI requests. +; Valid syntaxes are: +; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on +; a specific port; +; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on +; a specific port; +; 'port' - to listen on a TCP socket to all addresses +; (IPv6 and IPv4-mapped) on a specific port; +; '/path/to/unix/socket' - to listen on a unix socket. +; Note: This value is mandatory. +listen = /run/php/php7.4-fpm.sock + +; Set listen(2) backlog. +; Default Value: 511 (-1 on FreeBSD and OpenBSD) +;listen.backlog = 511 + +; Set permissions for unix socket, if one is used. In Linux, read/write +; permissions must be set in order to allow connections from a web server. Many +; BSD-derived systems allow connections regardless of permissions. The owner +; and group can be specified either by name or by their numeric IDs. +; Default Values: user and group are set as the running user +; mode is set to 0660 +listen.owner = $WWW_USER +listen.group = $WWW_GROUP +;listen.mode = 0660 +; When POSIX Access Control Lists are supported you can set them using +; these options, value is a comma separated list of user/group names. +; When set, listen.owner and listen.group are ignored +;listen.acl_users = +;listen.acl_groups = + +; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. +; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original +; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address +; must be separated by a comma. If this value is left blank, connections will be +; accepted from any ip address. +; Default Value: any +;listen.allowed_clients = 127.0.0.1 + +; Specify the nice(2) priority to apply to the pool processes (only if set) +; The value can vary from -19 (highest priority) to 20 (lower priority) +; Note: - It will only work if the FPM master process is launched as root +; - The pool processes will inherit the master process priority +; unless it specified otherwise +; Default Value: no set +; process.priority = -19 + +; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user +; or group is differrent than the master process user. It allows to create process +; core dump and ptrace the process for the pool user. +; Default Value: no +; process.dumpable = yes + +; Choose how the process manager will control the number of child processes. +; Possible Values: +; static - a fixed number (pm.max_children) of child processes; +; dynamic - the number of child processes are set dynamically based on the +; following directives. With this process management, there will be +; always at least 1 children. +; pm.max_children - the maximum number of children that can +; be alive at the same time. +; pm.start_servers - the number of children created on startup. +; pm.min_spare_servers - the minimum number of children in 'idle' +; state (waiting to process). If the number +; of 'idle' processes is less than this +; number then some children will be created. +; pm.max_spare_servers - the maximum number of children in 'idle' +; state (waiting to process). If the number +; of 'idle' processes is greater than this +; number then some children will be killed. +; ondemand - no children are created at startup. Children will be forked when +; new requests will connect. The following parameter are used: +; pm.max_children - the maximum number of children that +; can be alive at the same time. +; pm.process_idle_timeout - The number of seconds after which +; an idle process will be killed. +; Note: This value is mandatory. +pm = dynamic + +; The number of child processes to be created when pm is set to 'static' and the +; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. +; This value sets the limit on the number of simultaneous requests that will be +; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. +; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP +; CGI. The below defaults are based on a server without much resources. Don't +; forget to tweak pm.* to fit your needs. +; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' +; Note: This value is mandatory. +pm.max_children = $PM_MAX_CHILDREN + +; The number of child processes created on startup. +; Note: Used only when pm is set to 'dynamic' +; Default Value: (min_spare_servers + max_spare_servers) / 2 +pm.start_servers = $PM_START_SERVERS + +; The desired minimum number of idle server processes. +; Note: Used only when pm is set to 'dynamic' +; Note: Mandatory when pm is set to 'dynamic' +pm.min_spare_servers = $PM_MIN_SPARE_SERVERS + +; The desired maximum number of idle server processes. +; Note: Used only when pm is set to 'dynamic' +; Note: Mandatory when pm is set to 'dynamic' +pm.max_spare_servers = $PM_MAX_SPARE_SERVERS + +; The number of seconds after which an idle process will be killed. +; Note: Used only when pm is set to 'ondemand' +; Default Value: 10s +;pm.process_idle_timeout = 10s; + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. For +; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default Value: 0 +pm.max_requests = $PM_MAX_REQUESTS + +; The URI to view the FPM status page. If this value is not set, no URI will be +; recognized as a status page. It shows the following informations: +; pool - the name of the pool; +; process manager - static, dynamic or ondemand; +; start time - the date and time FPM has started; +; start since - number of seconds since FPM has started; +; accepted conn - the number of request accepted by the pool; +; listen queue - the number of request in the queue of pending +; connections (see backlog in listen(2)); +; max listen queue - the maximum number of requests in the queue +; of pending connections since FPM has started; +; listen queue len - the size of the socket queue of pending connections; +; idle processes - the number of idle processes; +; active processes - the number of active processes; +; total processes - the number of idle + active processes; +; max active processes - the maximum number of active processes since FPM +; has started; +; max children reached - number of times, the process limit has been reached, +; when pm tries to start more children (works only for +; pm 'dynamic' and 'ondemand'); +; Value are updated in real time. +; Example output: +; pool: www +; process manager: static +; start time: 01/Jul/2011:17:53:49 +0200 +; start since: 62636 +; accepted conn: 190460 +; listen queue: 0 +; max listen queue: 1 +; listen queue len: 42 +; idle processes: 4 +; active processes: 11 +; total processes: 15 +; max active processes: 12 +; max children reached: 0 +; +; By default the status page output is formatted as text/plain. Passing either +; 'html', 'xml' or 'json' in the query string will return the corresponding +; output syntax. Example: +; http://www.foo.bar/status +; http://www.foo.bar/status?json +; http://www.foo.bar/status?html +; http://www.foo.bar/status?xml +; +; By default the status page only outputs short status. Passing 'full' in the +; query string will also return status for each pool process. +; Example: +; http://www.foo.bar/status?full +; http://www.foo.bar/status?json&full +; http://www.foo.bar/status?html&full +; http://www.foo.bar/status?xml&full +; The Full status returns for each process: +; pid - the PID of the process; +; state - the state of the process (Idle, Running, ...); +; start time - the date and time the process has started; +; start since - the number of seconds since the process has started; +; requests - the number of requests the process has served; +; request duration - the duration in µs of the requests; +; request method - the request method (GET, POST, ...); +; request URI - the request URI with the query string; +; content length - the content length of the request (only with POST); +; user - the user (PHP_AUTH_USER) (or '-' if not set); +; script - the main script called (or '-' if not set); +; last request cpu - the %cpu the last request consumed +; it's always 0 if the process is not in Idle state +; because CPU calculation is done when the request +; processing has terminated; +; last request memory - the max amount of memory the last request consumed +; it's always 0 if the process is not in Idle state +; because memory calculation is done when the request +; processing has terminated; +; If the process is in Idle state, then informations are related to the +; last request the process has served. Otherwise informations are related to +; the current request being served. +; Example output: +; ************************ +; pid: 31330 +; state: Running +; start time: 01/Jul/2011:17:53:49 +0200 +; start since: 63087 +; requests: 12808 +; request duration: 1250261 +; request method: GET +; request URI: /test_mem.php?N=10000 +; content length: 0 +; user: - +; script: /home/fat/web/docs/php/test_mem.php +; last request cpu: 0.00 +; last request memory: 0 +; +; Note: There is a real-time FPM status monitoring sample web page available +; It's available in: /usr/share/php/7.4/fpm/status.html +; +; Note: The value must start with a leading slash (/). The value can be +; anything, but it may not be a good idea to use the .php extension or it +; may conflict with a real PHP file. +; Default Value: not set +;pm.status_path = /status + +; The ping URI to call the monitoring page of FPM. If this value is not set, no +; URI will be recognized as a ping page. This could be used to test from outside +; that FPM is alive and responding, or to +; - create a graph of FPM availability (rrd or such); +; - remove a server from a group if it is not responding (load balancing); +; - trigger alerts for the operating team (24/7). +; Note: The value must start with a leading slash (/). The value can be +; anything, but it may not be a good idea to use the .php extension or it +; may conflict with a real PHP file. +; Default Value: not set +;ping.path = /ping + +; This directive may be used to customize the response of a ping request. The +; response is formatted as text/plain with a 200 response code. +; Default Value: pong +;ping.response = pong + +; The access log file +; Default: not set +;access.log = log/$pool.access.log + +; The access log format. +; The following syntax is allowed +; %%: the '%' character +; %C: %CPU used by the request +; it can accept the following format: +; - %{user}C for user CPU only +; - %{system}C for system CPU only +; - %{total}C for user + system CPU (default) +; %d: time taken to serve the request +; it can accept the following format: +; - %{seconds}d (default) +; - %{miliseconds}d +; - %{mili}d +; - %{microseconds}d +; - %{micro}d +; %e: an environment variable (same as $_ENV or $_SERVER) +; it must be associated with embraces to specify the name of the env +; variable. Some exemples: +; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e +; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e +; %f: script filename +; %l: content-length of the request (for POST request only) +; %m: request method +; %M: peak of memory allocated by PHP +; it can accept the following format: +; - %{bytes}M (default) +; - %{kilobytes}M +; - %{kilo}M +; - %{megabytes}M +; - %{mega}M +; %n: pool name +; %o: output header +; it must be associated with embraces to specify the name of the header: +; - %{Content-Type}o +; - %{X-Powered-By}o +; - %{Transfert-Encoding}o +; - .... +; %p: PID of the child that serviced the request +; %P: PID of the parent of the child that serviced the request +; %q: the query string +; %Q: the '?' character if query string exists +; %r: the request URI (without the query string, see %q and %Q) +; %R: remote IP address +; %s: status (response code) +; %t: server time the request was received +; it can accept a strftime(3) format: +; %d/%b/%Y:%H:%M:%S %z (default) +; The strftime(3) format must be encapsuled in a %{}t tag +; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t +; %T: time the log has been written (the request has finished) +; it can accept a strftime(3) format: +; %d/%b/%Y:%H:%M:%S %z (default) +; The strftime(3) format must be encapsuled in a %{}t tag +; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t +; %u: remote user +; +; Default: "%R - %u %t \"%m %r\" %s" +;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" + +; The log file for slow requests +; Default Value: not set +; Note: slowlog is mandatory if request_slowlog_timeout is set +;slowlog = log/$pool.log.slow + +; The timeout for serving a single request after which a PHP backtrace will be +; dumped to the 'slowlog' file. A value of '0s' means 'off'. +; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) +; Default Value: 0 +;request_slowlog_timeout = 0 + +; Depth of slow log stack trace. +; Default Value: 20 +;request_slowlog_trace_depth = 20 + +; The timeout for serving a single request after which the worker process will +; be killed. This option should be used when the 'max_execution_time' ini option +; does not stop script execution for some reason. A value of '0' means 'off'. +; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) +; Default Value: 0 +;request_terminate_timeout = 0 + +; The timeout set by 'request_terminate_timeout' ini option is not engaged after +; application calls 'fastcgi_finish_request' or when application has finished and +; shutdown functions are being called (registered via register_shutdown_function). +; This option will enable timeout limit to be applied unconditionally +; even in such cases. +; Default Value: no +;request_terminate_timeout_track_finished = no + +; Set open file descriptor rlimit. +; Default Value: system defined value +;rlimit_files = 1024 + +; Set max core size rlimit. +; Possible Values: 'unlimited' or an integer greater or equal to 0 +; Default Value: system defined value +;rlimit_core = 0 + +; Chroot to this directory at the start. This value must be defined as an +; absolute path. When this value is not set, chroot is not used. +; Note: you can prefix with '$prefix' to chroot to the pool prefix or one +; of its subdirectories. If the pool prefix is not set, the global prefix +; will be used instead. +; Note: chrooting is a great security feature and should be used whenever +; possible. However, all PHP paths will be relative to the chroot +; (error_log, sessions.save_path, ...). +; Default Value: not set +;chroot = + +; Chdir to this directory at the start. +; Note: relative path can be used. +; Default Value: current directory or / when chroot +;chdir = /var/www + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environement, this can cause some delay in the page +; process time (several ms). +; Default Value: no +;catch_workers_output = yes + +; Decorate worker output with prefix and suffix containing information about +; the child that writes to the log and if stdout or stderr is used as well as +; log level and time. This options is used only if catch_workers_output is yes. +; Settings to "no" will output data as written to the stdout or stderr. +; Default value: yes +;decorate_workers_output = no + +; Clear environment in FPM workers +; Prevents arbitrary environment variables from reaching FPM worker processes +; by clearing the environment in workers before env vars specified in this +; pool configuration are added. +; Setting to "no" will make all environment variables available to PHP code +; via getenv(), $_ENV and $_SERVER. +; Default Value: yes +clear_env = no + +; Limits the extensions of the main script FPM will allow to parse. This can +; prevent configuration mistakes on the web server side. You should only limit +; FPM to .php extensions to prevent malicious users to use other extensions to +; execute php code. +; Note: set an empty value to allow all extensions. +; Default Value: .php +;security.limit_extensions = .php .php3 .php4 .php5 .php7 + +; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from +; the current environment. +; Default Value: clean env +;env[HOSTNAME] = $HOSTNAME +;env[PATH] = /usr/local/bin:/usr/bin:/bin +;env[TMP] = /tmp +;env[TMPDIR] = /tmp +;env[TEMP] = /tmp + +; Additional php.ini defines, specific to this pool of workers. These settings +; overwrite the values previously defined in the php.ini. The directives are the +; same as the PHP SAPI: +; php_value/php_flag - you can set classic ini defines which can +; be overwritten from PHP call 'ini_set'. +; php_admin_value/php_admin_flag - these directives won't be overwritten by +; PHP call 'ini_set' +; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. + +; Defining 'extension' will load the corresponding shared extension from +; extension_dir. Defining 'disable_functions' or 'disable_classes' will not +; overwrite previously defined php.ini values, but will append the new value +; instead. + +; Note: path INI options can be relative and will be expanded with the prefix +; (pool, global or /usr) + +; Default Value: nothing is defined by default except the values in php.ini and +; specified at startup with the -d argument +;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com +;php_flag[display_errors] = off +;php_admin_value[error_log] = /var/log/fpm-php.www.log +;php_admin_flag[log_errors] = on +;php_admin_value[memory_limit] = 32M From 03a757c8a282b1860ee80aa17c0a77494afcd68b Mon Sep 17 00:00:00 2001 From: Pavel Astakhov Date: Wed, 22 Nov 2023 00:03:19 +0600 Subject: [PATCH 11/78] Use the "name=value" form for the env variables --- Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4456db7f..3af7652a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -713,11 +713,11 @@ ENV MW_ENABLE_JOB_RUNNER=true \ PHP_MAX_INPUT_VARS=1000 \ PHP_MAX_EXECUTION_TIME=60 \ PHP_MAX_INPUT_TIME=60 \ - PM_MAX_CHILDREN = 25 \ - PM_START_SERVERS = 10 \ - PM_MIN_SPARE_SERVERS = 5 \ - PM_MAX_SPARE_SERVERS = 15 \ - PM_MAX_REQUESTS = 2500 \ + PM_MAX_CHILDREN=25 \ + PM_START_SERVERS=10 \ + PM_MIN_SPARE_SERVERS=5 \ + PM_MAX_SPARE_SERVERS=15 \ + PM_MAX_REQUESTS=2500 \ LOG_FILES_COMPRESS_DELAY=3600 \ LOG_FILES_REMOVE_OLDER_THAN_DAYS=10 From 473be6416654bea2bec938ea926b1403c39d0040 Mon Sep 17 00:00:00 2001 From: Pavel Astakhov Date: Wed, 22 Nov 2023 23:48:51 +0600 Subject: [PATCH 12/78] Use "${VARIABLE_NAME}" form --- _sources/configs/php-fpm-www.conf | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/_sources/configs/php-fpm-www.conf b/_sources/configs/php-fpm-www.conf index cc4391dd..7ef7afc5 100644 --- a/_sources/configs/php-fpm-www.conf +++ b/_sources/configs/php-fpm-www.conf @@ -20,8 +20,8 @@ ; Unix user/group of processes ; Note: The user is mandatory. If the group is not set, the default user's group ; will be used. -user = $WWW_USER -group = $WWW_GROUP +user = "${WWW_USER}" +group = "${WWW_GROUP}" ; The address on which to accept FastCGI requests. ; Valid syntaxes are: @@ -45,8 +45,8 @@ listen = /run/php/php7.4-fpm.sock ; and group can be specified either by name or by their numeric IDs. ; Default Values: user and group are set as the running user ; mode is set to 0660 -listen.owner = $WWW_USER -listen.group = $WWW_GROUP +listen.owner = "${WWW_USER}" +listen.group = "${WWW_GROUP}" ;listen.mode = 0660 ; When POSIX Access Control Lists are supported you can set them using ; these options, value is a comma separated list of user/group names. @@ -111,22 +111,22 @@ pm = dynamic ; forget to tweak pm.* to fit your needs. ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' ; Note: This value is mandatory. -pm.max_children = $PM_MAX_CHILDREN +pm.max_children = "${PM_MAX_CHILDREN}" ; The number of child processes created on startup. ; Note: Used only when pm is set to 'dynamic' ; Default Value: (min_spare_servers + max_spare_servers) / 2 -pm.start_servers = $PM_START_SERVERS +pm.start_servers = "${PM_START_SERVERS}" ; The desired minimum number of idle server processes. ; Note: Used only when pm is set to 'dynamic' ; Note: Mandatory when pm is set to 'dynamic' -pm.min_spare_servers = $PM_MIN_SPARE_SERVERS +pm.min_spare_servers = "${PM_MIN_SPARE_SERVERS}" ; The desired maximum number of idle server processes. ; Note: Used only when pm is set to 'dynamic' ; Note: Mandatory when pm is set to 'dynamic' -pm.max_spare_servers = $PM_MAX_SPARE_SERVERS +pm.max_spare_servers = "${PM_MAX_SPARE_SERVERS}" ; The number of seconds after which an idle process will be killed. ; Note: Used only when pm is set to 'ondemand' @@ -137,7 +137,7 @@ pm.max_spare_servers = $PM_MAX_SPARE_SERVERS ; This can be useful to work around memory leaks in 3rd party libraries. For ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. ; Default Value: 0 -pm.max_requests = $PM_MAX_REQUESTS +pm.max_requests = "${PM_MAX_REQUESTS}" ; The URI to view the FPM status page. If this value is not set, no URI will be ; recognized as a status page. It shows the following informations: From b0160a52dcb6c4f9f34a6c2331a056ac58f6578e Mon Sep 17 00:00:00 2001 From: Vedmaka Date: Wed, 29 Nov 2023 19:53:36 +0400 Subject: [PATCH 13/78] Add sitemap directory permission checks (#326) The update includes the addition of permission checks for sitemap directory to the run-apache.sh script. If necessary, it adjusts the permissions to ensure the correct access levels --- _sources/scripts/run-apache.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/_sources/scripts/run-apache.sh b/_sources/scripts/run-apache.sh index 0db6e3cf..71c5862d 100755 --- a/_sources/scripts/run-apache.sh +++ b/_sources/scripts/run-apache.sh @@ -92,6 +92,14 @@ else chmod -R g=rwX $APACHE_LOG_DIR fi +echo "Checking permissions of $MW_VOLUME/sitemap..." +if dir_is_writable "$MW_VOLUME/sitemap"; then + echo "Permissions are OK!" +else + chown -R "$WWW_GROUP":"$WWW_GROUP" $MW_VOLUME/sitemap + chmod -R g=rwX $MW_VOLUME/sitemap +fi + run_maintenance_scripts() { # Iterate through all the .sh files in /maintenance-scripts/ directory for maintenance_script in $(find /maintenance-scripts/ -maxdepth 1 -mindepth 1 -type f -name "*.sh"); do @@ -110,7 +118,7 @@ run_maintenance_scripts() { # Naming convention: # Scripts with names starting with "mw_" have corresponding enable variables. -# The enable variable is formed by converting the script's name to uppercase and replacing the first underscore with "_ENABLE_". +# The enable variable is formed by converting the script's name to uppercase and replacing the first underscore with "_ENABLE_". # For example, the enable variable for "mw_sitemap_generator.sh" would be "MW_ENABLE_SITEMAP_GENERATOR". run_mw_script() { From f5f8c9f26e427b16b205c2eb521dbeee15eb4b08 Mon Sep 17 00:00:00 2001 From: Yaron Koren Date: Wed, 29 Nov 2023 12:26:04 -0500 Subject: [PATCH 14/78] Add AWS extension (#329) * Add AWS extension Partial fix for #229 * Fix for clone call --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index 6af76cfd..14d23cc7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -155,6 +155,10 @@ RUN set -x; \ && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-Arrays $MW_HOME/extensions/Arrays \ && cd $MW_HOME/extensions/Arrays \ && git checkout -q 338f661bf0ab377f70e029079f2c5c5b370219df \ + # AWS (v. 0.12.0) + && git clone --single-branch -b master https://github.com/edwardspec/mediawiki-aws-s3 $MW_HOME/extensions/AWS \ + && cd $MW_HOME/extensions/AWS \ + && git checkout -q d75873a1f594ac3777b17047c9905b2521debb8b \ # BetaFeatures && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-BetaFeatures $MW_HOME/extensions/BetaFeatures \ && cd $MW_HOME/extensions/BetaFeatures \ From 0f348dcadf4407a4bf2909c942bfd4bc79e0d553 Mon Sep 17 00:00:00 2001 From: Yaron Koren Date: Wed, 29 Nov 2023 13:08:25 -0500 Subject: [PATCH 15/78] Add JWTAuth extension (#330) * Add JWTAuth extension Partial fix for #229 * Fix version number --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index 14d23cc7..8aa7fdce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -315,6 +315,10 @@ RUN set -x; \ && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-HTMLTags $MW_HOME/extensions/HTMLTags \ && cd $MW_HOME/extensions/HTMLTags \ && git checkout -q b8cb3131c5e76f5c037c8474fe14e51f2e877f03 \ + # JWTAuth (v. 2.0.0) + && git clone --single-branch -b master https://github.com/wikimedia/mediawiki-extensions-JWTAuth $MW_HOME/extensions/JWTAuth \ + && cd $MW_HOME/extensions/JWTAuth \ + && git checkout -q a61d2c62e55b70d4442d0397c04ba8f429ae1c7d \ # LabeledSectionTransclusion && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-LabeledSectionTransclusion $MW_HOME/extensions/LabeledSectionTransclusion \ && cd $MW_HOME/extensions/LabeledSectionTransclusion \ From cff172d2dd2129e75c9c390d4b5fb3294a71614d Mon Sep 17 00:00:00 2001 From: Vedmaka Date: Thu, 7 Dec 2023 21:50:26 +0400 Subject: [PATCH 16/78] Upgrades MsUpload to newer version [METHW-177] (#331) * Upgrades MsUpload to newer version Commit `8c2403b09186f5f25f0c28369e6aff3c285047df` * Fixes a branch name for MsUpload * Fixes branch for the MsUpload * Fixes commit typo * Reverts accidental MobileFrontend commit change --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8aa7fdce..f13e4289 100644 --- a/Dockerfile +++ b/Dockerfile @@ -400,9 +400,9 @@ RUN set -x; \ && cd $MW_HOME/extensions/MobileFrontend \ && git checkout -q f0bed5588f76b827038fb9af73fb9677e5804077 \ # MsUpload - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-MsUpload $MW_HOME/extensions/MsUpload \ + && git clone https://github.com/wikimedia/mediawiki-extensions-MsUpload $MW_HOME/extensions/MsUpload \ && cd $MW_HOME/extensions/MsUpload \ - && git checkout -q dac2376a2fac6ddf4b2038db9b4bc06092ecaa15 \ + && git checkout -q 8c2403b09186f5f25f0c28369e6aff3c285047df \ # MyVariables && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-MyVariables $MW_HOME/extensions/MyVariables \ && cd $MW_HOME/extensions/MyVariables \ @@ -502,7 +502,7 @@ RUN set -x; \ # SimpleBatchUpload (v. 2.0.0) && git clone https://github.com/ProfessionalWiki/SimpleBatchUpload $MW_HOME/extensions/SimpleBatchUpload \ && cd $MW_HOME/extensions/SimpleBatchUpload \ - && git checkout -q 3b9e248b49d7fbeb81d7da32078db7040809e724 \ + && git checkout -q 3b9e248b49d7fbeb81d7da32078db7040809e724 \ # SimpleChanges && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-SimpleChanges $MW_HOME/extensions/SimpleChanges \ && cd $MW_HOME/extensions/SimpleChanges \ From 4418831d3a67942a9d975c394cea5ae2835f170c Mon Sep 17 00:00:00 2001 From: Vedmaka Date: Thu, 7 Dec 2023 21:52:17 +0400 Subject: [PATCH 17/78] Adds SemanticWatchlist v 1.3.0 (#299) * Adds SemanticWatchlist v 1.3.0 * Fixes a typo --- Dockerfile | 10 ++++++++++ _sources/configs/composer.canasta.json | 1 + ....417851c22c25f3e33fb654f4138c760c53051b9a.patch | 14 ++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 _sources/patches/SemanticWatchList.417851c22c25f3e33fb654f4138c760c53051b9a.patch diff --git a/Dockerfile b/Dockerfile index f13e4289..2efba42a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -499,6 +499,10 @@ RUN set -x; \ && git clone https://github.com/WikiTeq/SemanticTasks.git $MW_HOME/extensions/SemanticTasks \ && cd $MW_HOME/extensions/SemanticTasks \ && git checkout -q 70ddd8cf6090139ce5ee6fdf1e7f3a9f2c68d5d3 \ + # SemanticWatchlist (v. 1.3.0) + && git clone https://github.com/SemanticMediaWiki/SemanticWatchlist.git $MW_HOME/extensions/SemanticWatchlist \ + && cd $MW_HOME/extensions/SemanticWatchlist \ + && git checkout -q 417851c22c25f3e33fb654f4138c760c53051b9a \ # SimpleBatchUpload (v. 2.0.0) && git clone https://github.com/ProfessionalWiki/SimpleBatchUpload $MW_HOME/extensions/SimpleBatchUpload \ && cd $MW_HOME/extensions/SimpleBatchUpload \ @@ -634,6 +638,12 @@ RUN set -x; \ cd $MW_HOME/extensions/SemanticResultFormats \ && git apply /tmp/semantic-result-formats-composer-reqs.patch +# SemanticWatchlist +COPY _sources/patches/SemanticWatchList.417851c22c25f3e33fb654f4138c760c53051b9a.patch /tmp/SemanticWatchList.417851c22c25f3e33fb654f4138c760c53051b9a.patch +RUN set -x; \ + cd $MW_HOME/extensions/SemanticWatchlist \ + && git apply /tmp/SemanticWatchList.417851c22c25f3e33fb654f4138c760c53051b9a.patch + # Composer dependencies COPY _sources/configs/composer.canasta.json $MW_HOME/composer.local.json RUN set -x; \ diff --git a/_sources/configs/composer.canasta.json b/_sources/configs/composer.canasta.json index 8135cd45..f51854c7 100644 --- a/_sources/configs/composer.canasta.json +++ b/_sources/configs/composer.canasta.json @@ -22,6 +22,7 @@ "extensions/SemanticBreadcrumbLinks/composer.json", "extensions/SemanticMediaWiki/composer.json", "extensions/SemanticResultFormats/composer.json", + "extensions/SemanticWatchlist/composer.json", "extensions/WSOAuth/composer.json", "skins/chameleon/composer.json", "extensions/MassMessageEmail/composer.json" diff --git a/_sources/patches/SemanticWatchList.417851c22c25f3e33fb654f4138c760c53051b9a.patch b/_sources/patches/SemanticWatchList.417851c22c25f3e33fb654f4138c760c53051b9a.patch new file mode 100644 index 00000000..116699d6 --- /dev/null +++ b/_sources/patches/SemanticWatchList.417851c22c25f3e33fb654f4138c760c53051b9a.patch @@ -0,0 +1,14 @@ +diff --git a/composer.json b/composer.json +index 1f05843..6ccb6b7 100644 +--- a/composer.json ++++ b/composer.json +@@ -26,8 +26,7 @@ + }, + "require": { + "php": ">=7.3", +- "composer/installers": "1.*,>=1.0.1", +- "mediawiki/semantic-media-wiki": "~3.0|~4.0" ++ "composer/installers": "1.*,>=1.0.1" + }, + "extra": { + "branch-alias": { From a8aefbb6ce5ec2abc375d1f5bc7afc0d4fab6375 Mon Sep 17 00:00:00 2001 From: Vedmaka Date: Fri, 8 Dec 2023 23:38:30 +0400 Subject: [PATCH 18/78] Upgrades SemanticWatchlist to commit `ecea17097874d16cd240ce35bd20692a67c5064b` (#336) This commit includes fix for MailAddress calls, otherwise SWL is unable to send emails at 1.39+ --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2efba42a..14d6712a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -502,7 +502,7 @@ RUN set -x; \ # SemanticWatchlist (v. 1.3.0) && git clone https://github.com/SemanticMediaWiki/SemanticWatchlist.git $MW_HOME/extensions/SemanticWatchlist \ && cd $MW_HOME/extensions/SemanticWatchlist \ - && git checkout -q 417851c22c25f3e33fb654f4138c760c53051b9a \ + && git checkout -q ecea17097874d16cd240ce35bd20692a67c5064b \ # SimpleBatchUpload (v. 2.0.0) && git clone https://github.com/ProfessionalWiki/SimpleBatchUpload $MW_HOME/extensions/SimpleBatchUpload \ && cd $MW_HOME/extensions/SimpleBatchUpload \ From fbb7c7518b6395525c84ef0cd9f44a1cab11bf51 Mon Sep 17 00:00:00 2001 From: Jeffrey Wang Date: Mon, 11 Dec 2023 00:33:30 -0800 Subject: [PATCH 19/78] Update VERSION to 2.0.0 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 126f4f30..227cea21 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.3.1-pre +2.0.0 From 2594dc0c780efc10fe07934ecce4cb3c71066fae Mon Sep 17 00:00:00 2001 From: Yaron Koren Date: Mon, 2 Oct 2023 09:29:01 -0400 Subject: [PATCH 20/78] Change "chameleon" skin directory to be all lowercase (#306) * Change "chameleon" skin directory to be all lowercase Fixes #304. * Update composer.canasta.json --- Dockerfile | 4 ++-- _sources/configs/composer.canasta.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index cfaf21c3..a5626c18 100644 --- a/Dockerfile +++ b/Dockerfile @@ -103,8 +103,8 @@ RUN set -x; \ RUN set -x; \ cd $MW_HOME/skins \ # Chameleon (v. 4.2.1) - && git clone https://github.com/ProfessionalWiki/chameleon $MW_HOME/skins/Chameleon \ - && cd $MW_HOME/skins/Chameleon \ + && git clone https://github.com/ProfessionalWiki/chameleon $MW_HOME/skins/chameleon \ + && cd $MW_HOME/skins/chameleon \ && git checkout -q f34a56528ada14ac07e1b03beda41f775ef27606 \ # CologneBlue && git clone -b $MW_VERSION --single-branch https://github.com/wikimedia/mediawiki-skins-CologneBlue $MW_HOME/skins/CologneBlue \ diff --git a/_sources/configs/composer.canasta.json b/_sources/configs/composer.canasta.json index 913f5858..b8bc3553 100644 --- a/_sources/configs/composer.canasta.json +++ b/_sources/configs/composer.canasta.json @@ -23,7 +23,7 @@ "extensions/SemanticMediaWiki/composer.json", "extensions/SemanticResultFormats/composer.json", "extensions/WSOAuth/composer.json", - "skins/Chameleon/composer.json" + "skins/chameleon/composer.json" ] } } From 9fb4f6924f873de285b9323eb9a88aaf98b89945 Mon Sep 17 00:00:00 2001 From: Vedmaka Date: Fri, 13 Oct 2023 23:30:29 +0400 Subject: [PATCH 21/78] Upgrades MassMessageEmail extension to the latest REL1_39 commit (#311) --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a5626c18..a8437d21 100644 --- a/Dockerfile +++ b/Dockerfile @@ -376,7 +376,7 @@ RUN set -x; \ # MassMessageEmail && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-MassMessageEmail $MW_HOME/extensions/MassMessageEmail \ && cd $MW_HOME/extensions/MassMessageEmail \ - && git checkout -q edd96f14c6d108d56bcecb18b5bb7b3355437732 \ + && git checkout -q bd1f3413dbe8242b4294892a7f9803ea22364eae \ # MediaUploader && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-MediaUploader $MW_HOME/extensions/MediaUploader \ && cd $MW_HOME/extensions/MediaUploader \ From bfa0382ba4e25c6fd23e3e3aa8e95dace3051c78 Mon Sep 17 00:00:00 2001 From: Vedmaka Date: Wed, 1 Nov 2023 23:54:45 +0400 Subject: [PATCH 22/78] Adds MassMessageEmail to composer file (#312) --- _sources/configs/composer.canasta.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_sources/configs/composer.canasta.json b/_sources/configs/composer.canasta.json index b8bc3553..8135cd45 100644 --- a/_sources/configs/composer.canasta.json +++ b/_sources/configs/composer.canasta.json @@ -23,7 +23,8 @@ "extensions/SemanticMediaWiki/composer.json", "extensions/SemanticResultFormats/composer.json", "extensions/WSOAuth/composer.json", - "skins/chameleon/composer.json" + "skins/chameleon/composer.json", + "extensions/MassMessageEmail/composer.json" ] } } From 83614752f897e3a317a4da7e019f88188837c4a2 Mon Sep 17 00:00:00 2001 From: Yaron Koren Date: Sun, 15 Oct 2023 11:45:33 -0400 Subject: [PATCH 23/78] Update Echo revision to work better for 1.39 DB update Fixes #309 . --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a8437d21..90fef090 100644 --- a/Dockerfile +++ b/Dockerfile @@ -244,7 +244,7 @@ RUN set -x; \ # Echo && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-Echo $MW_HOME/extensions/Echo \ && cd $MW_HOME/extensions/Echo \ - && git checkout -q fdbc2cafdc412dc60d4345511defe9ee393efecf \ + && git checkout -q 7ae3c1059a5f4fd1f96f23fa8674bb1705f5e10d \ # EditAccount && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-EditAccount.git $MW_HOME/extensions/EditAccount \ && cd $MW_HOME/extensions/EditAccount \ From c130a1c3e1ee06f84ce27a30243523c6b86048ad Mon Sep 17 00:00:00 2001 From: Greg Rundlett Date: Fri, 3 Nov 2023 12:26:38 -0400 Subject: [PATCH 24/78] Minor wording change to indicate we are updating etc/hosts (#316) Co-authored-by: Greg Rundlett --- _sources/scripts/update-docker-gateway.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_sources/scripts/update-docker-gateway.sh b/_sources/scripts/update-docker-gateway.sh index b44d2033..191bf8ac 100644 --- a/_sources/scripts/update-docker-gateway.sh +++ b/_sources/scripts/update-docker-gateway.sh @@ -42,7 +42,7 @@ if [ -n "$WG_SITE_SERVER" ]; then elif [[ $MW_SITE_HOST =~ ^[0-9]+.[0-9]+.[0-9]+.[0-9]+$ ]]; then echo "MW_SITE_HOST is IP address '$MW_SITE_HOST'" else - echo "Add MW_SITE_HOST '$DOCKER_GATEWAY $MW_SITE_HOST' to /etc/hosts" + echo "Adding MW_SITE_HOST '$DOCKER_GATEWAY $MW_SITE_HOST' to /etc/hosts" echo "$DOCKER_GATEWAY $MW_SITE_HOST # MW_SITE_HOST" >> ~/hosts.new fi fi From 491b0cd99b0aed0ee8d02703dfbdbb664fc3265b Mon Sep 17 00:00:00 2001 From: Yaron Koren Date: Mon, 6 Nov 2023 10:40:26 -0500 Subject: [PATCH 25/78] Update WatchAnalytics extension to v. 4.1.2 Fixes #298 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 90fef090..878c8fc3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -581,10 +581,10 @@ RUN set -x; \ && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-VoteNY $MW_HOME/extensions/VoteNY \ && cd $MW_HOME/extensions/VoteNY \ && git checkout -q 11c103f4b9167a8d8d5e850d8a781c6f49b249c1 \ - # WatchAnalytics (v. 4.1.0) + # WatchAnalytics (v. 4.1.2) && git clone --single-branch -b master https://github.com/wikimedia/mediawiki-extensions-WatchAnalytics $MW_HOME/extensions/WatchAnalytics \ && cd $MW_HOME/extensions/WatchAnalytics \ - && git checkout -q 793a03b21992c63bc431e3bf0835351958315fb8 \ + && git checkout -q 72b70a667a26bbde0a3cf93fc79747aae08fca32 \ # WhoIsWatching && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-WhoIsWatching $MW_HOME/extensions/WhoIsWatching \ && cd $MW_HOME/extensions/WhoIsWatching \ From aeabbe07fb7c0b57ceba825eda6c978d4aeb4cbc Mon Sep 17 00:00:00 2001 From: Pavel Astakhov Date: Wed, 15 Nov 2023 01:12:21 +0600 Subject: [PATCH 26/78] Update ContributionScores to fixed version (#320) Fixes #319 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 878c8fc3..865fa411 100644 --- a/Dockerfile +++ b/Dockerfile @@ -212,7 +212,7 @@ RUN set -x; \ # ContributionScores && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-ContributionScores $MW_HOME/extensions/ContributionScores \ && cd $MW_HOME/extensions/ContributionScores \ - && git checkout -q e307850555ef313f623dde6e2f1d5d2a43663730 \ + && git checkout -q 0c08d338a1150c76e74ae490cd4d5f5b9f6daa5f \ # CookieWarning && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-CookieWarning $MW_HOME/extensions/CookieWarning \ && cd $MW_HOME/extensions/CookieWarning \ From e1077e7c7e83f53d1e2f9e0db969e36954f51589 Mon Sep 17 00:00:00 2001 From: Vedmaka Date: Wed, 29 Nov 2023 19:53:36 +0400 Subject: [PATCH 27/78] Add sitemap directory permission checks (#326) The update includes the addition of permission checks for sitemap directory to the run-apache.sh script. If necessary, it adjusts the permissions to ensure the correct access levels --- _sources/scripts/run-apache.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/_sources/scripts/run-apache.sh b/_sources/scripts/run-apache.sh index 5a92f1bb..900467b8 100755 --- a/_sources/scripts/run-apache.sh +++ b/_sources/scripts/run-apache.sh @@ -92,6 +92,14 @@ else chmod -R g=rwX $APACHE_LOG_DIR fi +echo "Checking permissions of $MW_VOLUME/sitemap..." +if dir_is_writable "$MW_VOLUME/sitemap"; then + echo "Permissions are OK!" +else + chown -R "$WWW_GROUP":"$WWW_GROUP" $MW_VOLUME/sitemap + chmod -R g=rwX $MW_VOLUME/sitemap +fi + run_maintenance_scripts() { # Iterate through all the .sh files in /maintenance-scripts/ directory for maintenance_script in $(find /maintenance-scripts/ -maxdepth 1 -mindepth 1 -type f -name "*.sh"); do @@ -110,7 +118,7 @@ run_maintenance_scripts() { # Naming convention: # Scripts with names starting with "mw_" have corresponding enable variables. -# The enable variable is formed by converting the script's name to uppercase and replacing the first underscore with "_ENABLE_". +# The enable variable is formed by converting the script's name to uppercase and replacing the first underscore with "_ENABLE_". # For example, the enable variable for "mw_sitemap_generator.sh" would be "MW_ENABLE_SITEMAP_GENERATOR". run_mw_script() { From 540e7525511ecd2c961c5b7d799fec19c01fa39c Mon Sep 17 00:00:00 2001 From: Yaron Koren Date: Wed, 29 Nov 2023 12:26:04 -0500 Subject: [PATCH 28/78] Add AWS extension (#329) * Add AWS extension Partial fix for #229 * Fix for clone call --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index 865fa411..14428f76 100644 --- a/Dockerfile +++ b/Dockerfile @@ -157,6 +157,10 @@ RUN set -x; \ && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-Arrays $MW_HOME/extensions/Arrays \ && cd $MW_HOME/extensions/Arrays \ && git checkout -q 338f661bf0ab377f70e029079f2c5c5b370219df \ + # AWS (v. 0.12.0) + && git clone --single-branch -b master https://github.com/edwardspec/mediawiki-aws-s3 $MW_HOME/extensions/AWS \ + && cd $MW_HOME/extensions/AWS \ + && git checkout -q d75873a1f594ac3777b17047c9905b2521debb8b \ # BetaFeatures && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-BetaFeatures $MW_HOME/extensions/BetaFeatures \ && cd $MW_HOME/extensions/BetaFeatures \ From 7622b524ef26fc6169b52887b8c2589c61f65979 Mon Sep 17 00:00:00 2001 From: Yaron Koren Date: Wed, 29 Nov 2023 13:08:25 -0500 Subject: [PATCH 29/78] Add JWTAuth extension (#330) * Add JWTAuth extension Partial fix for #229 * Fix version number --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index 14428f76..ab7c1afa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -317,6 +317,10 @@ RUN set -x; \ && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-HTMLTags $MW_HOME/extensions/HTMLTags \ && cd $MW_HOME/extensions/HTMLTags \ && git checkout -q b8cb3131c5e76f5c037c8474fe14e51f2e877f03 \ + # JWTAuth (v. 2.0.0) + && git clone --single-branch -b master https://github.com/wikimedia/mediawiki-extensions-JWTAuth $MW_HOME/extensions/JWTAuth \ + && cd $MW_HOME/extensions/JWTAuth \ + && git checkout -q a61d2c62e55b70d4442d0397c04ba8f429ae1c7d \ # LabeledSectionTransclusion && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-LabeledSectionTransclusion $MW_HOME/extensions/LabeledSectionTransclusion \ && cd $MW_HOME/extensions/LabeledSectionTransclusion \ From 93516f645086c7cd0449b91290fa9ef0999319b3 Mon Sep 17 00:00:00 2001 From: Vedmaka Date: Thu, 7 Dec 2023 21:50:26 +0400 Subject: [PATCH 30/78] Upgrades MsUpload to newer version [METHW-177] (#331) * Upgrades MsUpload to newer version Commit `8c2403b09186f5f25f0c28369e6aff3c285047df` * Fixes a branch name for MsUpload * Fixes branch for the MsUpload * Fixes commit typo * Reverts accidental MobileFrontend commit change --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index ab7c1afa..8edeeb9d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -402,9 +402,9 @@ RUN set -x; \ && cd $MW_HOME/extensions/MobileFrontend \ && git checkout -q f0bed5588f76b827038fb9af73fb9677e5804077 \ # MsUpload - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-MsUpload $MW_HOME/extensions/MsUpload \ + && git clone https://github.com/wikimedia/mediawiki-extensions-MsUpload $MW_HOME/extensions/MsUpload \ && cd $MW_HOME/extensions/MsUpload \ - && git checkout -q dac2376a2fac6ddf4b2038db9b4bc06092ecaa15 \ + && git checkout -q 8c2403b09186f5f25f0c28369e6aff3c285047df \ # MyVariables && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-MyVariables $MW_HOME/extensions/MyVariables \ && cd $MW_HOME/extensions/MyVariables \ @@ -504,7 +504,7 @@ RUN set -x; \ # SimpleBatchUpload (v. 2.0.0) && git clone https://github.com/ProfessionalWiki/SimpleBatchUpload $MW_HOME/extensions/SimpleBatchUpload \ && cd $MW_HOME/extensions/SimpleBatchUpload \ - && git checkout -q 3b9e248b49d7fbeb81d7da32078db7040809e724 \ + && git checkout -q 3b9e248b49d7fbeb81d7da32078db7040809e724 \ # SimpleChanges && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-SimpleChanges $MW_HOME/extensions/SimpleChanges \ && cd $MW_HOME/extensions/SimpleChanges \ From 14ccae9380e1625fd030c53f656e5f9476f8296f Mon Sep 17 00:00:00 2001 From: Vedmaka Date: Thu, 7 Dec 2023 21:52:17 +0400 Subject: [PATCH 31/78] Adds SemanticWatchlist v 1.3.0 (#299) * Adds SemanticWatchlist v 1.3.0 * Fixes a typo --- Dockerfile | 10 ++++++++++ _sources/configs/composer.canasta.json | 1 + ....417851c22c25f3e33fb654f4138c760c53051b9a.patch | 14 ++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 _sources/patches/SemanticWatchList.417851c22c25f3e33fb654f4138c760c53051b9a.patch diff --git a/Dockerfile b/Dockerfile index 8edeeb9d..478c7e39 100644 --- a/Dockerfile +++ b/Dockerfile @@ -501,6 +501,10 @@ RUN set -x; \ && git clone https://github.com/WikiTeq/SemanticTasks.git $MW_HOME/extensions/SemanticTasks \ && cd $MW_HOME/extensions/SemanticTasks \ && git checkout -q 70ddd8cf6090139ce5ee6fdf1e7f3a9f2c68d5d3 \ + # SemanticWatchlist (v. 1.3.0) + && git clone https://github.com/SemanticMediaWiki/SemanticWatchlist.git $MW_HOME/extensions/SemanticWatchlist \ + && cd $MW_HOME/extensions/SemanticWatchlist \ + && git checkout -q 417851c22c25f3e33fb654f4138c760c53051b9a \ # SimpleBatchUpload (v. 2.0.0) && git clone https://github.com/ProfessionalWiki/SimpleBatchUpload $MW_HOME/extensions/SimpleBatchUpload \ && cd $MW_HOME/extensions/SimpleBatchUpload \ @@ -636,6 +640,12 @@ RUN set -x; \ cd $MW_HOME/extensions/SemanticResultFormats \ && git apply /tmp/semantic-result-formats-composer-reqs.patch +# SemanticWatchlist +COPY _sources/patches/SemanticWatchList.417851c22c25f3e33fb654f4138c760c53051b9a.patch /tmp/SemanticWatchList.417851c22c25f3e33fb654f4138c760c53051b9a.patch +RUN set -x; \ + cd $MW_HOME/extensions/SemanticWatchlist \ + && git apply /tmp/SemanticWatchList.417851c22c25f3e33fb654f4138c760c53051b9a.patch + # Composer dependencies COPY _sources/configs/composer.canasta.json $MW_HOME/composer.local.json RUN set -x; \ diff --git a/_sources/configs/composer.canasta.json b/_sources/configs/composer.canasta.json index 8135cd45..f51854c7 100644 --- a/_sources/configs/composer.canasta.json +++ b/_sources/configs/composer.canasta.json @@ -22,6 +22,7 @@ "extensions/SemanticBreadcrumbLinks/composer.json", "extensions/SemanticMediaWiki/composer.json", "extensions/SemanticResultFormats/composer.json", + "extensions/SemanticWatchlist/composer.json", "extensions/WSOAuth/composer.json", "skins/chameleon/composer.json", "extensions/MassMessageEmail/composer.json" diff --git a/_sources/patches/SemanticWatchList.417851c22c25f3e33fb654f4138c760c53051b9a.patch b/_sources/patches/SemanticWatchList.417851c22c25f3e33fb654f4138c760c53051b9a.patch new file mode 100644 index 00000000..116699d6 --- /dev/null +++ b/_sources/patches/SemanticWatchList.417851c22c25f3e33fb654f4138c760c53051b9a.patch @@ -0,0 +1,14 @@ +diff --git a/composer.json b/composer.json +index 1f05843..6ccb6b7 100644 +--- a/composer.json ++++ b/composer.json +@@ -26,8 +26,7 @@ + }, + "require": { + "php": ">=7.3", +- "composer/installers": "1.*,>=1.0.1", +- "mediawiki/semantic-media-wiki": "~3.0|~4.0" ++ "composer/installers": "1.*,>=1.0.1" + }, + "extra": { + "branch-alias": { From db797cc68453c7387f99159548b3aa49697b1464 Mon Sep 17 00:00:00 2001 From: Vedmaka Date: Fri, 8 Dec 2023 23:38:30 +0400 Subject: [PATCH 32/78] Upgrades SemanticWatchlist to commit `ecea17097874d16cd240ce35bd20692a67c5064b` (#336) This commit includes fix for MailAddress calls, otherwise SWL is unable to send emails at 1.39+ --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 478c7e39..8d3f6411 100644 --- a/Dockerfile +++ b/Dockerfile @@ -504,7 +504,7 @@ RUN set -x; \ # SemanticWatchlist (v. 1.3.0) && git clone https://github.com/SemanticMediaWiki/SemanticWatchlist.git $MW_HOME/extensions/SemanticWatchlist \ && cd $MW_HOME/extensions/SemanticWatchlist \ - && git checkout -q 417851c22c25f3e33fb654f4138c760c53051b9a \ + && git checkout -q ecea17097874d16cd240ce35bd20692a67c5064b \ # SimpleBatchUpload (v. 2.0.0) && git clone https://github.com/ProfessionalWiki/SimpleBatchUpload $MW_HOME/extensions/SimpleBatchUpload \ && cd $MW_HOME/extensions/SimpleBatchUpload \ From 1730dabccf11fa3b6af3d705d6ededd95882fbea Mon Sep 17 00:00:00 2001 From: Yaron Koren Date: Thu, 7 Sep 2023 14:56:37 -0400 Subject: [PATCH 33/78] Add TemplateSandbox extension Fixes #240 --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index 8d3f6411..1d1c3c55 100644 --- a/Dockerfile +++ b/Dockerfile @@ -533,6 +533,10 @@ RUN set -x; \ && git clone https://github.com/ProfessionalWiki/SubPageList $MW_HOME/extensions/SubPageList \ && cd $MW_HOME/extensions/SubPageList \ && git checkout -q c016dcdb7866f20319731e6497b48fd43756505e \ + # TemplateSandbox + && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-TemplateSandbox $MW_HOME/extensions/TemplateSandbox \ + && cd $MW_HOME/extensions/TemplateSandbox \ + && git checkout -q 8af94cedc41cbe6c54614714ced6ce4128555ce4 \ # TemplateStyles && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-TemplateStyles $MW_HOME/extensions/TemplateStyles \ && cd $MW_HOME/extensions/TemplateStyles \ From 1d77b189ae7173b0e019f6e53d947bd5232f1741 Mon Sep 17 00:00:00 2001 From: Pavel Astakhov Date: Tue, 21 Nov 2023 23:34:48 +0600 Subject: [PATCH 34/78] Add configurable fpm/pool.d/www.conf file\ Environment variables: * PM_MAX_CHILDREN = 25 * PM_START_SERVERS = 10 * PM_MIN_SPARE_SERVERS = 5 * PM_MAX_SPARE_SERVERS = 15 * PM_MAX_REQUESTS = 2500 --- Dockerfile | 6 + _sources/configs/php-fpm-www.conf | 439 ++++++++++++++++++++++++++++++ 2 files changed, 445 insertions(+) create mode 100644 _sources/configs/php-fpm-www.conf diff --git a/Dockerfile b/Dockerfile index 1d1c3c55..7be6b08c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -737,6 +737,11 @@ ENV MW_ENABLE_JOB_RUNNER=true \ PHP_MAX_INPUT_VARS=1000 \ PHP_MAX_EXECUTION_TIME=60 \ PHP_MAX_INPUT_TIME=60 \ + PM_MAX_CHILDREN = 25 \ + PM_START_SERVERS = 10 \ + PM_MIN_SPARE_SERVERS = 5 \ + PM_MAX_SPARE_SERVERS = 15 \ + PM_MAX_REQUESTS = 2500 \ LOG_FILES_COMPRESS_DELAY=3600 \ LOG_FILES_REMOVE_OLDER_THAN_DAYS=10 @@ -747,6 +752,7 @@ COPY _sources/configs/php_error_reporting.ini _sources/configs/php_upload_max_fi COPY _sources/configs/php_error_reporting.ini _sources/configs/php_upload_max_filesize.ini /etc/php/7.4/fpm/conf.d/ COPY _sources/configs/php_max_input_vars.ini _sources/configs/php_max_input_vars.ini /etc/php/7.4/fpm/conf.d/ COPY _sources/configs/php_timeouts.ini /etc/php/7.4/fpm/conf.d/ +COPY _sources/configs/php-fpm-www.conf /etc/php/7.4/fpm/pool.d/www.conf COPY _sources/scripts/*.sh / COPY _sources/scripts/maintenance-scripts/*.sh /maintenance-scripts/ COPY _sources/scripts/*.php $MW_HOME/maintenance/ diff --git a/_sources/configs/php-fpm-www.conf b/_sources/configs/php-fpm-www.conf new file mode 100644 index 00000000..cc4391dd --- /dev/null +++ b/_sources/configs/php-fpm-www.conf @@ -0,0 +1,439 @@ +; Start a new pool named 'www'. +; the variable $pool can be used in any directive and will be replaced by the +; pool name ('www' here) +[www] + +; Per pool prefix +; It only applies on the following directives: +; - 'access.log' +; - 'slowlog' +; - 'listen' (unixsocket) +; - 'chroot' +; - 'chdir' +; - 'php_values' +; - 'php_admin_values' +; When not set, the global prefix (or /usr) applies instead. +; Note: This directive can also be relative to the global prefix. +; Default Value: none +;prefix = /path/to/pools/$pool + +; Unix user/group of processes +; Note: The user is mandatory. If the group is not set, the default user's group +; will be used. +user = $WWW_USER +group = $WWW_GROUP + +; The address on which to accept FastCGI requests. +; Valid syntaxes are: +; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on +; a specific port; +; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on +; a specific port; +; 'port' - to listen on a TCP socket to all addresses +; (IPv6 and IPv4-mapped) on a specific port; +; '/path/to/unix/socket' - to listen on a unix socket. +; Note: This value is mandatory. +listen = /run/php/php7.4-fpm.sock + +; Set listen(2) backlog. +; Default Value: 511 (-1 on FreeBSD and OpenBSD) +;listen.backlog = 511 + +; Set permissions for unix socket, if one is used. In Linux, read/write +; permissions must be set in order to allow connections from a web server. Many +; BSD-derived systems allow connections regardless of permissions. The owner +; and group can be specified either by name or by their numeric IDs. +; Default Values: user and group are set as the running user +; mode is set to 0660 +listen.owner = $WWW_USER +listen.group = $WWW_GROUP +;listen.mode = 0660 +; When POSIX Access Control Lists are supported you can set them using +; these options, value is a comma separated list of user/group names. +; When set, listen.owner and listen.group are ignored +;listen.acl_users = +;listen.acl_groups = + +; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. +; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original +; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address +; must be separated by a comma. If this value is left blank, connections will be +; accepted from any ip address. +; Default Value: any +;listen.allowed_clients = 127.0.0.1 + +; Specify the nice(2) priority to apply to the pool processes (only if set) +; The value can vary from -19 (highest priority) to 20 (lower priority) +; Note: - It will only work if the FPM master process is launched as root +; - The pool processes will inherit the master process priority +; unless it specified otherwise +; Default Value: no set +; process.priority = -19 + +; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user +; or group is differrent than the master process user. It allows to create process +; core dump and ptrace the process for the pool user. +; Default Value: no +; process.dumpable = yes + +; Choose how the process manager will control the number of child processes. +; Possible Values: +; static - a fixed number (pm.max_children) of child processes; +; dynamic - the number of child processes are set dynamically based on the +; following directives. With this process management, there will be +; always at least 1 children. +; pm.max_children - the maximum number of children that can +; be alive at the same time. +; pm.start_servers - the number of children created on startup. +; pm.min_spare_servers - the minimum number of children in 'idle' +; state (waiting to process). If the number +; of 'idle' processes is less than this +; number then some children will be created. +; pm.max_spare_servers - the maximum number of children in 'idle' +; state (waiting to process). If the number +; of 'idle' processes is greater than this +; number then some children will be killed. +; ondemand - no children are created at startup. Children will be forked when +; new requests will connect. The following parameter are used: +; pm.max_children - the maximum number of children that +; can be alive at the same time. +; pm.process_idle_timeout - The number of seconds after which +; an idle process will be killed. +; Note: This value is mandatory. +pm = dynamic + +; The number of child processes to be created when pm is set to 'static' and the +; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. +; This value sets the limit on the number of simultaneous requests that will be +; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. +; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP +; CGI. The below defaults are based on a server without much resources. Don't +; forget to tweak pm.* to fit your needs. +; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' +; Note: This value is mandatory. +pm.max_children = $PM_MAX_CHILDREN + +; The number of child processes created on startup. +; Note: Used only when pm is set to 'dynamic' +; Default Value: (min_spare_servers + max_spare_servers) / 2 +pm.start_servers = $PM_START_SERVERS + +; The desired minimum number of idle server processes. +; Note: Used only when pm is set to 'dynamic' +; Note: Mandatory when pm is set to 'dynamic' +pm.min_spare_servers = $PM_MIN_SPARE_SERVERS + +; The desired maximum number of idle server processes. +; Note: Used only when pm is set to 'dynamic' +; Note: Mandatory when pm is set to 'dynamic' +pm.max_spare_servers = $PM_MAX_SPARE_SERVERS + +; The number of seconds after which an idle process will be killed. +; Note: Used only when pm is set to 'ondemand' +; Default Value: 10s +;pm.process_idle_timeout = 10s; + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. For +; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default Value: 0 +pm.max_requests = $PM_MAX_REQUESTS + +; The URI to view the FPM status page. If this value is not set, no URI will be +; recognized as a status page. It shows the following informations: +; pool - the name of the pool; +; process manager - static, dynamic or ondemand; +; start time - the date and time FPM has started; +; start since - number of seconds since FPM has started; +; accepted conn - the number of request accepted by the pool; +; listen queue - the number of request in the queue of pending +; connections (see backlog in listen(2)); +; max listen queue - the maximum number of requests in the queue +; of pending connections since FPM has started; +; listen queue len - the size of the socket queue of pending connections; +; idle processes - the number of idle processes; +; active processes - the number of active processes; +; total processes - the number of idle + active processes; +; max active processes - the maximum number of active processes since FPM +; has started; +; max children reached - number of times, the process limit has been reached, +; when pm tries to start more children (works only for +; pm 'dynamic' and 'ondemand'); +; Value are updated in real time. +; Example output: +; pool: www +; process manager: static +; start time: 01/Jul/2011:17:53:49 +0200 +; start since: 62636 +; accepted conn: 190460 +; listen queue: 0 +; max listen queue: 1 +; listen queue len: 42 +; idle processes: 4 +; active processes: 11 +; total processes: 15 +; max active processes: 12 +; max children reached: 0 +; +; By default the status page output is formatted as text/plain. Passing either +; 'html', 'xml' or 'json' in the query string will return the corresponding +; output syntax. Example: +; http://www.foo.bar/status +; http://www.foo.bar/status?json +; http://www.foo.bar/status?html +; http://www.foo.bar/status?xml +; +; By default the status page only outputs short status. Passing 'full' in the +; query string will also return status for each pool process. +; Example: +; http://www.foo.bar/status?full +; http://www.foo.bar/status?json&full +; http://www.foo.bar/status?html&full +; http://www.foo.bar/status?xml&full +; The Full status returns for each process: +; pid - the PID of the process; +; state - the state of the process (Idle, Running, ...); +; start time - the date and time the process has started; +; start since - the number of seconds since the process has started; +; requests - the number of requests the process has served; +; request duration - the duration in µs of the requests; +; request method - the request method (GET, POST, ...); +; request URI - the request URI with the query string; +; content length - the content length of the request (only with POST); +; user - the user (PHP_AUTH_USER) (or '-' if not set); +; script - the main script called (or '-' if not set); +; last request cpu - the %cpu the last request consumed +; it's always 0 if the process is not in Idle state +; because CPU calculation is done when the request +; processing has terminated; +; last request memory - the max amount of memory the last request consumed +; it's always 0 if the process is not in Idle state +; because memory calculation is done when the request +; processing has terminated; +; If the process is in Idle state, then informations are related to the +; last request the process has served. Otherwise informations are related to +; the current request being served. +; Example output: +; ************************ +; pid: 31330 +; state: Running +; start time: 01/Jul/2011:17:53:49 +0200 +; start since: 63087 +; requests: 12808 +; request duration: 1250261 +; request method: GET +; request URI: /test_mem.php?N=10000 +; content length: 0 +; user: - +; script: /home/fat/web/docs/php/test_mem.php +; last request cpu: 0.00 +; last request memory: 0 +; +; Note: There is a real-time FPM status monitoring sample web page available +; It's available in: /usr/share/php/7.4/fpm/status.html +; +; Note: The value must start with a leading slash (/). The value can be +; anything, but it may not be a good idea to use the .php extension or it +; may conflict with a real PHP file. +; Default Value: not set +;pm.status_path = /status + +; The ping URI to call the monitoring page of FPM. If this value is not set, no +; URI will be recognized as a ping page. This could be used to test from outside +; that FPM is alive and responding, or to +; - create a graph of FPM availability (rrd or such); +; - remove a server from a group if it is not responding (load balancing); +; - trigger alerts for the operating team (24/7). +; Note: The value must start with a leading slash (/). The value can be +; anything, but it may not be a good idea to use the .php extension or it +; may conflict with a real PHP file. +; Default Value: not set +;ping.path = /ping + +; This directive may be used to customize the response of a ping request. The +; response is formatted as text/plain with a 200 response code. +; Default Value: pong +;ping.response = pong + +; The access log file +; Default: not set +;access.log = log/$pool.access.log + +; The access log format. +; The following syntax is allowed +; %%: the '%' character +; %C: %CPU used by the request +; it can accept the following format: +; - %{user}C for user CPU only +; - %{system}C for system CPU only +; - %{total}C for user + system CPU (default) +; %d: time taken to serve the request +; it can accept the following format: +; - %{seconds}d (default) +; - %{miliseconds}d +; - %{mili}d +; - %{microseconds}d +; - %{micro}d +; %e: an environment variable (same as $_ENV or $_SERVER) +; it must be associated with embraces to specify the name of the env +; variable. Some exemples: +; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e +; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e +; %f: script filename +; %l: content-length of the request (for POST request only) +; %m: request method +; %M: peak of memory allocated by PHP +; it can accept the following format: +; - %{bytes}M (default) +; - %{kilobytes}M +; - %{kilo}M +; - %{megabytes}M +; - %{mega}M +; %n: pool name +; %o: output header +; it must be associated with embraces to specify the name of the header: +; - %{Content-Type}o +; - %{X-Powered-By}o +; - %{Transfert-Encoding}o +; - .... +; %p: PID of the child that serviced the request +; %P: PID of the parent of the child that serviced the request +; %q: the query string +; %Q: the '?' character if query string exists +; %r: the request URI (without the query string, see %q and %Q) +; %R: remote IP address +; %s: status (response code) +; %t: server time the request was received +; it can accept a strftime(3) format: +; %d/%b/%Y:%H:%M:%S %z (default) +; The strftime(3) format must be encapsuled in a %{}t tag +; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t +; %T: time the log has been written (the request has finished) +; it can accept a strftime(3) format: +; %d/%b/%Y:%H:%M:%S %z (default) +; The strftime(3) format must be encapsuled in a %{}t tag +; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t +; %u: remote user +; +; Default: "%R - %u %t \"%m %r\" %s" +;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" + +; The log file for slow requests +; Default Value: not set +; Note: slowlog is mandatory if request_slowlog_timeout is set +;slowlog = log/$pool.log.slow + +; The timeout for serving a single request after which a PHP backtrace will be +; dumped to the 'slowlog' file. A value of '0s' means 'off'. +; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) +; Default Value: 0 +;request_slowlog_timeout = 0 + +; Depth of slow log stack trace. +; Default Value: 20 +;request_slowlog_trace_depth = 20 + +; The timeout for serving a single request after which the worker process will +; be killed. This option should be used when the 'max_execution_time' ini option +; does not stop script execution for some reason. A value of '0' means 'off'. +; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) +; Default Value: 0 +;request_terminate_timeout = 0 + +; The timeout set by 'request_terminate_timeout' ini option is not engaged after +; application calls 'fastcgi_finish_request' or when application has finished and +; shutdown functions are being called (registered via register_shutdown_function). +; This option will enable timeout limit to be applied unconditionally +; even in such cases. +; Default Value: no +;request_terminate_timeout_track_finished = no + +; Set open file descriptor rlimit. +; Default Value: system defined value +;rlimit_files = 1024 + +; Set max core size rlimit. +; Possible Values: 'unlimited' or an integer greater or equal to 0 +; Default Value: system defined value +;rlimit_core = 0 + +; Chroot to this directory at the start. This value must be defined as an +; absolute path. When this value is not set, chroot is not used. +; Note: you can prefix with '$prefix' to chroot to the pool prefix or one +; of its subdirectories. If the pool prefix is not set, the global prefix +; will be used instead. +; Note: chrooting is a great security feature and should be used whenever +; possible. However, all PHP paths will be relative to the chroot +; (error_log, sessions.save_path, ...). +; Default Value: not set +;chroot = + +; Chdir to this directory at the start. +; Note: relative path can be used. +; Default Value: current directory or / when chroot +;chdir = /var/www + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environement, this can cause some delay in the page +; process time (several ms). +; Default Value: no +;catch_workers_output = yes + +; Decorate worker output with prefix and suffix containing information about +; the child that writes to the log and if stdout or stderr is used as well as +; log level and time. This options is used only if catch_workers_output is yes. +; Settings to "no" will output data as written to the stdout or stderr. +; Default value: yes +;decorate_workers_output = no + +; Clear environment in FPM workers +; Prevents arbitrary environment variables from reaching FPM worker processes +; by clearing the environment in workers before env vars specified in this +; pool configuration are added. +; Setting to "no" will make all environment variables available to PHP code +; via getenv(), $_ENV and $_SERVER. +; Default Value: yes +clear_env = no + +; Limits the extensions of the main script FPM will allow to parse. This can +; prevent configuration mistakes on the web server side. You should only limit +; FPM to .php extensions to prevent malicious users to use other extensions to +; execute php code. +; Note: set an empty value to allow all extensions. +; Default Value: .php +;security.limit_extensions = .php .php3 .php4 .php5 .php7 + +; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from +; the current environment. +; Default Value: clean env +;env[HOSTNAME] = $HOSTNAME +;env[PATH] = /usr/local/bin:/usr/bin:/bin +;env[TMP] = /tmp +;env[TMPDIR] = /tmp +;env[TEMP] = /tmp + +; Additional php.ini defines, specific to this pool of workers. These settings +; overwrite the values previously defined in the php.ini. The directives are the +; same as the PHP SAPI: +; php_value/php_flag - you can set classic ini defines which can +; be overwritten from PHP call 'ini_set'. +; php_admin_value/php_admin_flag - these directives won't be overwritten by +; PHP call 'ini_set' +; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. + +; Defining 'extension' will load the corresponding shared extension from +; extension_dir. Defining 'disable_functions' or 'disable_classes' will not +; overwrite previously defined php.ini values, but will append the new value +; instead. + +; Note: path INI options can be relative and will be expanded with the prefix +; (pool, global or /usr) + +; Default Value: nothing is defined by default except the values in php.ini and +; specified at startup with the -d argument +;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com +;php_flag[display_errors] = off +;php_admin_value[error_log] = /var/log/fpm-php.www.log +;php_admin_flag[log_errors] = on +;php_admin_value[memory_limit] = 32M From 5b762db568abb49bd5cef2bacd2541d27044abd0 Mon Sep 17 00:00:00 2001 From: Pavel Astakhov Date: Wed, 22 Nov 2023 00:03:19 +0600 Subject: [PATCH 35/78] Use the "name=value" form for the env variables --- Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7be6b08c..2f0231fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -737,11 +737,11 @@ ENV MW_ENABLE_JOB_RUNNER=true \ PHP_MAX_INPUT_VARS=1000 \ PHP_MAX_EXECUTION_TIME=60 \ PHP_MAX_INPUT_TIME=60 \ - PM_MAX_CHILDREN = 25 \ - PM_START_SERVERS = 10 \ - PM_MIN_SPARE_SERVERS = 5 \ - PM_MAX_SPARE_SERVERS = 15 \ - PM_MAX_REQUESTS = 2500 \ + PM_MAX_CHILDREN=25 \ + PM_START_SERVERS=10 \ + PM_MIN_SPARE_SERVERS=5 \ + PM_MAX_SPARE_SERVERS=15 \ + PM_MAX_REQUESTS=2500 \ LOG_FILES_COMPRESS_DELAY=3600 \ LOG_FILES_REMOVE_OLDER_THAN_DAYS=10 From b0005bbe7b0354030b4ff336b94e8dc489f51130 Mon Sep 17 00:00:00 2001 From: Pavel Astakhov Date: Wed, 22 Nov 2023 23:48:51 +0600 Subject: [PATCH 36/78] Use "${VARIABLE_NAME}" form --- _sources/configs/php-fpm-www.conf | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/_sources/configs/php-fpm-www.conf b/_sources/configs/php-fpm-www.conf index cc4391dd..7ef7afc5 100644 --- a/_sources/configs/php-fpm-www.conf +++ b/_sources/configs/php-fpm-www.conf @@ -20,8 +20,8 @@ ; Unix user/group of processes ; Note: The user is mandatory. If the group is not set, the default user's group ; will be used. -user = $WWW_USER -group = $WWW_GROUP +user = "${WWW_USER}" +group = "${WWW_GROUP}" ; The address on which to accept FastCGI requests. ; Valid syntaxes are: @@ -45,8 +45,8 @@ listen = /run/php/php7.4-fpm.sock ; and group can be specified either by name or by their numeric IDs. ; Default Values: user and group are set as the running user ; mode is set to 0660 -listen.owner = $WWW_USER -listen.group = $WWW_GROUP +listen.owner = "${WWW_USER}" +listen.group = "${WWW_GROUP}" ;listen.mode = 0660 ; When POSIX Access Control Lists are supported you can set them using ; these options, value is a comma separated list of user/group names. @@ -111,22 +111,22 @@ pm = dynamic ; forget to tweak pm.* to fit your needs. ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' ; Note: This value is mandatory. -pm.max_children = $PM_MAX_CHILDREN +pm.max_children = "${PM_MAX_CHILDREN}" ; The number of child processes created on startup. ; Note: Used only when pm is set to 'dynamic' ; Default Value: (min_spare_servers + max_spare_servers) / 2 -pm.start_servers = $PM_START_SERVERS +pm.start_servers = "${PM_START_SERVERS}" ; The desired minimum number of idle server processes. ; Note: Used only when pm is set to 'dynamic' ; Note: Mandatory when pm is set to 'dynamic' -pm.min_spare_servers = $PM_MIN_SPARE_SERVERS +pm.min_spare_servers = "${PM_MIN_SPARE_SERVERS}" ; The desired maximum number of idle server processes. ; Note: Used only when pm is set to 'dynamic' ; Note: Mandatory when pm is set to 'dynamic' -pm.max_spare_servers = $PM_MAX_SPARE_SERVERS +pm.max_spare_servers = "${PM_MAX_SPARE_SERVERS}" ; The number of seconds after which an idle process will be killed. ; Note: Used only when pm is set to 'ondemand' @@ -137,7 +137,7 @@ pm.max_spare_servers = $PM_MAX_SPARE_SERVERS ; This can be useful to work around memory leaks in 3rd party libraries. For ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. ; Default Value: 0 -pm.max_requests = $PM_MAX_REQUESTS +pm.max_requests = "${PM_MAX_REQUESTS}" ; The URI to view the FPM status page. If this value is not set, no URI will be ; recognized as a status page. It shows the following informations: From 603c23f682d2321c667e88c0683b17d27a378439 Mon Sep 17 00:00:00 2001 From: Jeffrey Wang Date: Mon, 11 Dec 2023 00:43:55 -0800 Subject: [PATCH 37/78] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2f0231fc..42ac81b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ LABEL maintainers="" LABEL org.opencontainers.image.source=https://github.com/CanastaWiki/Canasta ENV MW_VERSION=REL1_39 \ - MW_CORE_VERSION=1.39.1 \ + MW_CORE_VERSION=1.39.5 \ WWW_ROOT=/var/www/mediawiki \ MW_HOME=/var/www/mediawiki/w \ MW_ORIGIN_FILES=/mw_origin_files \ From 7d8c1d3bb36a2dbbe8c7b7f0774ceefb61fdf121 Mon Sep 17 00:00:00 2001 From: Jeffrey Wang Date: Mon, 11 Dec 2023 01:00:59 -0800 Subject: [PATCH 38/78] Update Dockerfile per Yaron's PR --- Dockerfile | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 42ac81b8..ccc1cd53 100644 --- a/Dockerfile +++ b/Dockerfile @@ -654,16 +654,7 @@ RUN set -x; \ COPY _sources/configs/composer.canasta.json $MW_HOME/composer.local.json RUN set -x; \ cd $MW_HOME \ - && composer update --no-dev \ - # Fix up future use of canasta-extensions directory for composer autoload - && sed -i 's/extensions/canasta-extensions/g' $MW_HOME/vendor/composer/autoload_static.php \ - && sed -i 's/extensions/canasta-extensions/g' $MW_HOME/vendor/composer/autoload_files.php \ - && sed -i 's/extensions/canasta-extensions/g' $MW_HOME/vendor/composer/autoload_classmap.php \ - && sed -i 's/extensions/canasta-extensions/g' $MW_HOME/vendor/composer/autoload_psr4.php \ - && sed -i 's/skins/canasta-skins/g' $MW_HOME/vendor/composer/autoload_static.php \ - && sed -i 's/skins/canasta-skins/g' $MW_HOME/vendor/composer/autoload_files.php \ - && sed -i 's/skins/canasta-skins/g' $MW_HOME/vendor/composer/autoload_classmap.php \ - && sed -i 's/skins/canasta-skins/g' $MW_HOME/vendor/composer/autoload_psr4.php + && composer update --no-dev # Other patches From 74ca64490aaf9ea46acf062b79efd369cd485987 Mon Sep 17 00:00:00 2001 From: Jeffrey Wang Date: Mon, 11 Dec 2023 01:39:37 -0800 Subject: [PATCH 39/78] Update composer.canasta.json --- _sources/configs/composer.canasta.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/_sources/configs/composer.canasta.json b/_sources/configs/composer.canasta.json index f51854c7..2e0c2423 100644 --- a/_sources/configs/composer.canasta.json +++ b/_sources/configs/composer.canasta.json @@ -1,7 +1,4 @@ { - "require": { - "psr/http-message": "1.1" - }, "extra": { "merge-plugin": { "include": [ From 904b4ddb96be320bec234309182c76481960d026 Mon Sep 17 00:00:00 2001 From: Yaron Koren Date: Thu, 28 Dec 2023 11:46:21 -0500 Subject: [PATCH 40/78] Update to version 1.39.6 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ccc1cd53..c84d8090 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ LABEL maintainers="" LABEL org.opencontainers.image.source=https://github.com/CanastaWiki/Canasta ENV MW_VERSION=REL1_39 \ - MW_CORE_VERSION=1.39.5 \ + MW_CORE_VERSION=1.39.6 \ WWW_ROOT=/var/www/mediawiki \ MW_HOME=/var/www/mediawiki/w \ MW_ORIGIN_FILES=/mw_origin_files \ From 2b5da5ac0df5ff3949daff9d49d5d528c06bc8c9 Mon Sep 17 00:00:00 2001 From: Yaron Koren Date: Mon, 1 Jan 2024 10:26:51 -0500 Subject: [PATCH 41/78] Update MobileFrontend extension (the old version does not work) Based on #344 . --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c84d8090..e5d389f6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -400,7 +400,7 @@ RUN set -x; \ # MobileFrontend && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-MobileFrontend $MW_HOME/extensions/MobileFrontend \ && cd $MW_HOME/extensions/MobileFrontend \ - && git checkout -q f0bed5588f76b827038fb9af73fb9677e5804077 \ + && git checkout -q 7f9ecd976796d02988b40dff4a790c315d4651e6 \ # MsUpload && git clone https://github.com/wikimedia/mediawiki-extensions-MsUpload $MW_HOME/extensions/MsUpload \ && cd $MW_HOME/extensions/MsUpload \ From 44928201021b4a50d161d3bb55d27b87ce39070a Mon Sep 17 00:00:00 2001 From: Yaron Koren Date: Thu, 15 Feb 2024 15:05:30 -0500 Subject: [PATCH 42/78] Remove WikiForum extension --- Dockerfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index e5d389f6..5aa7c79a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -613,10 +613,6 @@ RUN set -x; \ && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-Widgets $MW_HOME/extensions/Widgets \ && cd $MW_HOME/extensions/Widgets \ && git checkout -q 197d429f971b2aebbce29b7a91a194e1f8181e64 \ - # WikiForum - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-WikiForum $MW_HOME/extensions/WikiForum \ - && cd $MW_HOME/extensions/WikiForum \ - && git checkout -q a2685b60af86890f199a5f3b6581918369e6a571 \ # WikiSEO && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-WikiSEO $MW_HOME/extensions/WikiSEO \ && cd $MW_HOME/extensions/WikiSEO \ From 26d5e388f5c18f35337b3dfaac4b98fa4ee39c1b Mon Sep 17 00:00:00 2001 From: Yaron Koren Date: Thu, 7 Mar 2024 09:39:40 -0500 Subject: [PATCH 43/78] Upgrade Maps to include fix to work with VisualEditor (#367) The fix was added by @pastakhov . --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5aa7c79a..330c562d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -376,7 +376,7 @@ RUN set -x; \ # Maps && git clone --single-branch -b master https://github.com/ProfessionalWiki/Maps $MW_HOME/extensions/Maps \ && cd $MW_HOME/extensions/Maps \ - && git checkout -q 5c87d702b30bb132d89ec03d24b7c19a9805db87 \ + && git checkout -q 9b01a6bbd8e0d4277c152b7343efccae28b54d1c \ # MassMessage && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-MassMessage $MW_HOME/extensions/MassMessage \ && cd $MW_HOME/extensions/MassMessage \ From d28342b7e48f43a379e75e54164104ae337480dc Mon Sep 17 00:00:00 2001 From: Yaron Koren Date: Fri, 8 Mar 2024 14:40:39 -0500 Subject: [PATCH 44/78] Rename run-apache.sh to run-all.sh (#358) * Rename run-apache.sh to setup-all.sh * Update Dockerfile * Update Dockerfile * Rename setup-all.sh to run-all.sh --- Dockerfile | 2 +- _sources/scripts/{run-apache.sh => run-all.sh} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename _sources/scripts/{run-apache.sh => run-all.sh} (100%) diff --git a/Dockerfile b/Dockerfile index 330c562d..9e582a0d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -779,4 +779,4 @@ WORKDIR $MW_HOME HEALTHCHECK --interval=1m --timeout=10s \ CMD wget -q --method=HEAD localhost/w/api.php -CMD ["/run-apache.sh"] +CMD ["/run-all.sh"] diff --git a/_sources/scripts/run-apache.sh b/_sources/scripts/run-all.sh similarity index 100% rename from _sources/scripts/run-apache.sh rename to _sources/scripts/run-all.sh From a596604bca4161f755eeb7b04bbd434b094a6e46 Mon Sep 17 00:00:00 2001 From: Yaron Koren Date: Fri, 8 Mar 2024 14:40:57 -0500 Subject: [PATCH 45/78] Add sitemaps and images to robots.txt (#364) * Update mediawiki.conf * Rename robots.txt to robots-main.txt * Update Dockerfile * Create robots.php * Update robots-main.txt --- Dockerfile | 2 +- _sources/configs/mediawiki.conf | 3 +++ .../configs/{robots.txt => robots-main.txt} | 8 ++++-- _sources/configs/robots.php | 27 +++++++++++++++++++ 4 files changed, 37 insertions(+), 3 deletions(-) rename _sources/configs/{robots.txt => robots-main.txt} (54%) create mode 100644 _sources/configs/robots.php diff --git a/Dockerfile b/Dockerfile index 9e582a0d..ea965ad9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -743,7 +743,7 @@ COPY _sources/configs/php-fpm-www.conf /etc/php/7.4/fpm/pool.d/www.conf COPY _sources/scripts/*.sh / COPY _sources/scripts/maintenance-scripts/*.sh /maintenance-scripts/ COPY _sources/scripts/*.php $MW_HOME/maintenance/ -COPY _sources/configs/robots.txt $WWW_ROOT/ +COPY _sources/configs/robots-main.txt _sources/configs/robots.php $WWW_ROOT/ COPY _sources/configs/.htaccess $WWW_ROOT/ COPY _sources/images/favicon.ico $WWW_ROOT/ COPY _sources/canasta/LocalSettings.php _sources/canasta/CanastaUtils.php _sources/canasta/CanastaDefaultSettings.php _sources/canasta/FarmConfigLoader.php $MW_HOME/ diff --git a/_sources/configs/mediawiki.conf b/_sources/configs/mediawiki.conf index d00c7347..bb6f955c 100644 --- a/_sources/configs/mediawiki.conf +++ b/_sources/configs/mediawiki.conf @@ -10,6 +10,9 @@ RewriteEngine On +# Artificial robots.txt file +RewriteRule ^/?robots\.txt$ /robots.php [NC,L] + # VisualEditor support. T262392 AllowEncodedSlashes NoDecode RewriteRule ^/?w/rest.php/ - [L] diff --git a/_sources/configs/robots.txt b/_sources/configs/robots-main.txt similarity index 54% rename from _sources/configs/robots.txt rename to _sources/configs/robots-main.txt index 427def37..925176dd 100644 --- a/_sources/configs/robots.txt +++ b/_sources/configs/robots-main.txt @@ -1,10 +1,14 @@ -User-agent: * -Allow: /w/load.php? Allow: /w/resources Allow: /w/skins Allow: /w/extensions +Allow: /w/images +Allow: /w/sitemap Disallow: /w/ Disallow: /Special: +Disallow: /Special%3A Disallow: /wiki/Special: +Disallow: /wiki/Special%3A Disallow: /MediaWiki: +Disallow: /MediaWiki%3A Disallow: /wiki/MediaWiki: +Disallow: /wiki/MediaWiki%3A diff --git a/_sources/configs/robots.php b/_sources/configs/robots.php new file mode 100644 index 00000000..7c653120 --- /dev/null +++ b/_sources/configs/robots.php @@ -0,0 +1,27 @@ + Date: Thu, 21 Mar 2024 19:58:04 -0400 Subject: [PATCH 46/78] Further fix for Maps with VE Another fix by @pastakhov. I don't know if this one is as critical as the first one. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ea965ad9..5e075349 100644 --- a/Dockerfile +++ b/Dockerfile @@ -376,7 +376,7 @@ RUN set -x; \ # Maps && git clone --single-branch -b master https://github.com/ProfessionalWiki/Maps $MW_HOME/extensions/Maps \ && cd $MW_HOME/extensions/Maps \ - && git checkout -q 9b01a6bbd8e0d4277c152b7343efccae28b54d1c \ + && git checkout -q 7175b47e3b2cbbfcd55c6bd896f4e8403dc03d33 \ # MassMessage && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-MassMessage $MW_HOME/extensions/MassMessage \ && cd $MW_HOME/extensions/MassMessage \ From 2a4dd5f8f65e3d3463a22401e0c027a1826ab2ab Mon Sep 17 00:00:00 2001 From: Naresh Kumar Date: Fri, 5 Apr 2024 22:41:18 +0530 Subject: [PATCH 47/78] Fix monitor-directories script and create-symlinks script (#366) * Fix monitor-directories script and create-symlinks script * Fix monitor-directories script and create-symlinks script * Upgrade Maps to include fix to work with VisualEditor (#367) The fix was added by @pastakhov . * Rename run-apache.sh to run-all.sh (#358) * Rename run-apache.sh to setup-all.sh * Update Dockerfile * Update Dockerfile * Rename setup-all.sh to run-all.sh * Add sitemaps and images to robots.txt (#364) * Update mediawiki.conf * Rename robots.txt to robots-main.txt * Update Dockerfile * Create robots.php * Update robots-main.txt * Further fix for Maps with VE Another fix by @pastakhov. I don't know if this one is as critical as the first one. * Rebase with master * Resolve conflicts --------- Co-authored-by: Yaron Koren --- _sources/scripts/create-symlinks.sh | 14 ++----------- .../monitor-directories.sh | 0 _sources/scripts/run-all.sh | 21 +++++++------------ 3 files changed, 10 insertions(+), 25 deletions(-) rename _sources/scripts/{ => maintenance-scripts}/monitor-directories.sh (100%) diff --git a/_sources/scripts/create-symlinks.sh b/_sources/scripts/create-symlinks.sh index 6514627b..41f7ad47 100644 --- a/_sources/scripts/create-symlinks.sh +++ b/_sources/scripts/create-symlinks.sh @@ -18,22 +18,12 @@ echo "Symlinking user extensions and overwriting any redundant bundled extension for user_extension_path in $(find $MW_HOME/user-extensions/ -maxdepth 1 -mindepth 1 -type d) do user_extension_id=$(basename $user_extension_path) - extension_symlink_path="$MW_HOME/extensions/$user_extension_id" - if [[ -e "$extension_symlink_path" ]] - then - rm "$extension_symlink_path" - fi - ln -s $MW_HOME/user-extensions/$user_extension_id/ $MW_HOME/extensions/$user_extension_id + ln -sf $MW_HOME/user-extensions/$user_extension_id/ $MW_HOME/extensions/$user_extension_id done echo "Symlinking user skins and overwriting any redundant bundled skins..." for user_skin_path in $(find $MW_HOME/user-skins/ -maxdepth 1 -mindepth 1 -type d) do user_skin_id=$(basename $user_skin_path) - skin_symlink_path="$MW_HOME/skins/$user_skin_id" - if [[ -e "$skin_symlink_path" ]] - then - rm "$skin_symlink_path" - fi - ln -s $MW_HOME/user-skins/$user_skin_id/ $MW_HOME/skins/$user_skin_id + ln -sf $MW_HOME/user-skins/$user_skin_id/ $MW_HOME/skins/$user_skin_id done diff --git a/_sources/scripts/monitor-directories.sh b/_sources/scripts/maintenance-scripts/monitor-directories.sh similarity index 100% rename from _sources/scripts/monitor-directories.sh rename to _sources/scripts/maintenance-scripts/monitor-directories.sh diff --git a/_sources/scripts/run-all.sh b/_sources/scripts/run-all.sh index 900467b8..56b757ab 100755 --- a/_sources/scripts/run-all.sh +++ b/_sources/scripts/run-all.sh @@ -92,14 +92,6 @@ else chmod -R g=rwX $APACHE_LOG_DIR fi -echo "Checking permissions of $MW_VOLUME/sitemap..." -if dir_is_writable "$MW_VOLUME/sitemap"; then - echo "Permissions are OK!" -else - chown -R "$WWW_GROUP":"$WWW_GROUP" $MW_VOLUME/sitemap - chmod -R g=rwX $MW_VOLUME/sitemap -fi - run_maintenance_scripts() { # Iterate through all the .sh files in /maintenance-scripts/ directory for maintenance_script in $(find /maintenance-scripts/ -maxdepth 1 -mindepth 1 -type f -name "*.sh"); do @@ -181,10 +173,6 @@ check_mount_points () { fi } -inotifywait() { - /monitor-directories.sh -} - # Wait db waitdatabase @@ -208,7 +196,14 @@ fi echo "Starting services..." run_maintenance_scripts & -inotifywait & + +echo "Checking permissions of $MW_VOLUME/sitemap..." +if dir_is_writable "$MW_VOLUME/sitemap"; then + echo "Permissions are OK!" +else + chown -R "$WWW_GROUP":"$WWW_GROUP" $MW_VOLUME/sitemap + chmod -R g=rwX $MW_VOLUME/sitemap +fi # Running php-fpm /run-php-fpm.sh & From 3c64c0365af827d2da4719b976c974206db39391 Mon Sep 17 00:00:00 2001 From: Naresh Kumar Date: Tue, 9 Apr 2024 21:30:42 +0530 Subject: [PATCH 48/78] Move extensions setup to extensions.yaml and add shell script for execution (#376) * Move extensions setup to extensions.yaml and add python script for execution * Move extensions setup to YAML and execute using sh script * Move extensions setup to YAML and execute using sh script * Move extensions setup to YAML and execute using sh script * Fix minor issues * Move extensions setup to extensions.yaml and add python script for execution * Refactor extension data extraction * Add comments in extensions.yaml * Add comments in extensions.yaml * Add comments in extensions.yaml * Fix monitor-directories script and create-symlinks script (#366) * Fix monitor-directories script and create-symlinks script * Fix monitor-directories script and create-symlinks script * Upgrade Maps to include fix to work with VisualEditor (#367) The fix was added by @pastakhov . * Rename run-apache.sh to run-all.sh (#358) * Rename run-apache.sh to setup-all.sh * Update Dockerfile * Update Dockerfile * Rename setup-all.sh to run-all.sh * Add sitemaps and images to robots.txt (#364) * Update mediawiki.conf * Rename robots.txt to robots-main.txt * Update Dockerfile * Create robots.php * Update robots-main.txt * Further fix for Maps with VE Another fix by @pastakhov. I don't know if this one is as critical as the first one. * Rebase with master * Resolve conflicts --------- Co-authored-by: Yaron Koren --------- Co-authored-by: Yaron Koren --- Dockerfile | 532 +--------------------------- _sources/configs/extensions.yaml | 295 +++++++++++++++ _sources/scripts/extension-setup.sh | 30 ++ 3 files changed, 336 insertions(+), 521 deletions(-) create mode 100644 _sources/configs/extensions.yaml create mode 100644 _sources/scripts/extension-setup.sh diff --git a/Dockerfile b/Dockerfile index 5e075349..7cdca010 100644 --- a/Dockerfile +++ b/Dockerfile @@ -123,6 +123,8 @@ RUN set -x; \ && cd $MW_HOME/skins/Refreshed \ && git checkout -q 86f33620f25335eb62289aa18d342ff3b980d8b8 +COPY _sources/patches/* /tmp/ + # Extensions # The following extensions are bundled into MediaWiki and do not need to be separately installed: # AbuseFilter, CategoryTree, Cite, CiteThisPage, CodeEditor, ConfirmEdit, Gadgets, ImageMap, InputBox, Interwiki, @@ -131,521 +133,21 @@ RUN set -x; \ # VisualEditor, WikiEditor. # The following extensions are downloaded via Composer and also do not need to be downloaded here: # Bootstrap, DataValues (and related extensions like DataValuesCommon), ParserHooks. +COPY _sources/scripts/extension-setup.sh /tmp/extension-setup.sh +COPY _sources/configs/extensions.yaml /tmp/extensions.yaml +RUN wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 +RUN chmod a+x /usr/local/bin/yq RUN set -x; \ - cd $MW_HOME/extensions \ - # AdminLinks (v. 0.6.1) - && git clone --single-branch -b master https://github.com/wikimedia/mediawiki-extensions-AdminLinks $MW_HOME/extensions/AdminLinks \ - && cd $MW_HOME/extensions/AdminLinks \ - && git checkout -q 3e2671c21fd4b8644552069ee60220035b6e96f5 \ - # AdvancedSearch - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-AdvancedSearch $MW_HOME/extensions/AdvancedSearch \ - && cd $MW_HOME/extensions/AdvancedSearch \ - && git checkout -q 1a44eafc93a17938333b74a37cb4deff2192e50a \ - # AJAXPoll - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-AJAXPoll $MW_HOME/extensions/AJAXPoll \ - && cd $MW_HOME/extensions/AJAXPoll \ - && git checkout -q 8429d8d4cba5be6df04e3fec17b0daabbf10cfa7 \ - # AntiSpoof - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-AntiSpoof $MW_HOME/extensions/AntiSpoof \ - && cd $MW_HOME/extensions/AntiSpoof \ - && git checkout -q 01cf89a678d5bab6610d24e07d3534356a5880cb \ - # ApprovedRevs (v. 1.8.2) - && git clone --single-branch -b master https://github.com/wikimedia/mediawiki-extensions-ApprovedRevs $MW_HOME/extensions/ApprovedRevs \ - && cd $MW_HOME/extensions/ApprovedRevs \ - && git checkout -q 53b67bf7e1e8ac3d20c2fd41ad2ab1c708c045a6 \ - # Arrays - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-Arrays $MW_HOME/extensions/Arrays \ - && cd $MW_HOME/extensions/Arrays \ - && git checkout -q 338f661bf0ab377f70e029079f2c5c5b370219df \ - # AWS (v. 0.12.0) - && git clone --single-branch -b master https://github.com/edwardspec/mediawiki-aws-s3 $MW_HOME/extensions/AWS \ - && cd $MW_HOME/extensions/AWS \ - && git checkout -q d75873a1f594ac3777b17047c9905b2521debb8b \ - # BetaFeatures - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-BetaFeatures $MW_HOME/extensions/BetaFeatures \ - && cd $MW_HOME/extensions/BetaFeatures \ - && git checkout -q 09cca44341f9695446c4e9fc9e8fec3fdcb197b0 \ - # BootstrapComponents (v. 5.1.0) - && git clone --single-branch -b master https://github.com/oetterer/BootstrapComponents $MW_HOME/extensions/BootstrapComponents \ - && cd $MW_HOME/extensions/BootstrapComponents \ - && git checkout -q 665c3dee1d9e3f4bcb18dd1920fe27b70e334574 \ - # BreadCrumbs2 - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-BreadCrumbs2 $MW_HOME/extensions/BreadCrumbs2 \ - && cd $MW_HOME/extensions/BreadCrumbs2 \ - && git checkout -q d53357a6839e94800a617de4fc451b6c64d0a1c8 \ - # Cargo (v. 3.4.2) - && git clone --single-branch -b master https://github.com/wikimedia/mediawiki-extensions-Cargo $MW_HOME/extensions/Cargo \ - && cd $MW_HOME/extensions/Cargo \ - && git checkout -q 7e8ea881cdb41e79687d059670fc68872a6a892c \ - # CharInsert - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-CharInsert $MW_HOME/extensions/CharInsert \ - && cd $MW_HOME/extensions/CharInsert \ - && git checkout -q 54c0f0ca9119a3ce791fb5d53edd4ec32035a5c5 \ - # CheckUser - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-CheckUser $MW_HOME/extensions/CheckUser \ - && cd $MW_HOME/extensions/CheckUser \ - && git checkout -q 9e2b6d3e928855247700146273d8131e025de918 \ - # CirrusSearch - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-CirrusSearch $MW_HOME/extensions/CirrusSearch \ - && cd $MW_HOME/extensions/CirrusSearch \ - && git checkout -q 8296300873aaffe815800cf05c84fa04c8cbd2c0 \ - # CodeMirror - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-CodeMirror $MW_HOME/extensions/CodeMirror \ - && cd $MW_HOME/extensions/CodeMirror \ - && git checkout -q 27efed79972ca181a194d17f4a94f4192fd5a493 \ - # Collection - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-Collection $MW_HOME/extensions/Collection \ - && cd $MW_HOME/extensions/Collection \ - && git checkout -q e00e70c6fcec963c8876e410e52c83c75ed60827 \ - # CommentStreams - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-CommentStreams $MW_HOME/extensions/CommentStreams \ - && cd $MW_HOME/extensions/CommentStreams \ - && git checkout -q 274bb10bc2d39fd137650dbc0dfc607c766d1aaa \ - # CommonsMetadata - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-CommonsMetadata $MW_HOME/extensions/CommonsMetadata \ - && cd $MW_HOME/extensions/CommonsMetadata \ - && git checkout -q 8ee30de3b1cabbe55c484839127493fd5fa5d076 \ - # ConfirmAccount - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-ConfirmAccount $MW_HOME/extensions/ConfirmAccount \ - && cd $MW_HOME/extensions/ConfirmAccount \ - && git checkout -q c06d5dfb43811a2dee99099476c57af2b6d762c4 \ - # ContactPage - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-ContactPage $MW_HOME/extensions/ContactPage \ - && cd $MW_HOME/extensions/ContactPage \ - && git checkout -q f509796056ae1fc597b6e3c3c268fac35bf66636 \ - # ContributionScores - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-ContributionScores $MW_HOME/extensions/ContributionScores \ - && cd $MW_HOME/extensions/ContributionScores \ - && git checkout -q 0c08d338a1150c76e74ae490cd4d5f5b9f6daa5f \ - # CookieWarning - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-CookieWarning $MW_HOME/extensions/CookieWarning \ - && cd $MW_HOME/extensions/CookieWarning \ - && git checkout -q bc991e93133bd69fe45e07b3d4554225decc7dae \ - # DataTransfer - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-DataTransfer $MW_HOME/extensions/DataTransfer \ - && cd $MW_HOME/extensions/DataTransfer \ - && git checkout -q 2f9f949f71f0bb7d1bd8b6b97c795b9428bb1c71 \ - # DeleteBatch - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-DeleteBatch $MW_HOME/extensions/DeleteBatch \ - && cd $MW_HOME/extensions/DeleteBatch \ - && git checkout -q 82078d60fc59a718f429ddebe5e99de8a8734413 \ - # Description2 - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-Description2 $MW_HOME/extensions/Description2 \ - && cd $MW_HOME/extensions/Description2 \ - && git checkout -q d2a5322a44f940de873050573e35fba4eb3063f8 \ - # Disambiguator - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-Disambiguator $MW_HOME/extensions/Disambiguator \ - && cd $MW_HOME/extensions/Disambiguator \ - && git checkout -q b7e7fad5f9f3dccfb902a3cbfd3bf2b16df91871 \ - # DismissableSiteNotice - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-DismissableSiteNotice $MW_HOME/extensions/DismissableSiteNotice \ - && cd $MW_HOME/extensions/DismissableSiteNotice \ - && git checkout -q 88129f80f077ec9e4932148056c8cfc1ed0361c7 \ - # DisplayTitle - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-DisplayTitle $MW_HOME/extensions/DisplayTitle \ - && cd $MW_HOME/extensions/DisplayTitle \ - && git checkout -q a14c406cc273c73a12957b55a27c095ad98d1795 \ - # Echo - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-Echo $MW_HOME/extensions/Echo \ - && cd $MW_HOME/extensions/Echo \ - && git checkout -q 7ae3c1059a5f4fd1f96f23fa8674bb1705f5e10d \ - # EditAccount - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-EditAccount.git $MW_HOME/extensions/EditAccount \ - && cd $MW_HOME/extensions/EditAccount \ - && git checkout -q abf772dc6ce8f3a31f2d82a1408796c138151ab0 \ - # Editcount - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-Editcount $MW_HOME/extensions/Editcount \ - && cd $MW_HOME/extensions/Editcount \ - && git checkout -q 41544ffceb1356f91575dc6772a48b172751d7cc \ - # Elastica - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-Elastica $MW_HOME/extensions/Elastica \ - && cd $MW_HOME/extensions/Elastica \ - && git checkout -q e4ead38b71ed4f3df8dc689fe448b749771b4ed4 \ - # EmailAuthorization - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-EmailAuthorization $MW_HOME/extensions/EmailAuthorization \ - && cd $MW_HOME/extensions/EmailAuthorization \ - && git checkout -q 2016da1b354f741d89b5dc207d4a84e11ffe9bce \ - # EmbedVideo - && git clone --single-branch -b master https://github.com/StarCitizenWiki/mediawiki-extensions-EmbedVideo.git $MW_HOME/extensions/EmbedVideo \ - && cd $MW_HOME/extensions/EmbedVideo \ - && git checkout -q 5c03c031070981730a0e01aa3cbc3e5cbd1b88c1 \ - # EventLogging - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-EventLogging $MW_HOME/extensions/EventLogging \ - && cd $MW_HOME/extensions/EventLogging \ - && git checkout -q 2740dbcd139be279ca2a4db039739b4f796b4178 \ - # EventStreamConfig - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-EventStreamConfig $MW_HOME/extensions/EventStreamConfig \ - && cd $MW_HOME/extensions/EventStreamConfig \ - && git checkout -q 1aae8cb6c312e49f0126091a59a453cb224657f9 \ - # ExternalData (v. 3.2) - && git clone --single-branch -b master https://github.com/wikimedia/mediawiki-extensions-ExternalData $MW_HOME/extensions/ExternalData \ - && cd $MW_HOME/extensions/ExternalData \ - && git checkout -q 5d30e60a65ca53a3fb5b39826deb2e6917892e22 \ - # FlexDiagrams (v. 0.5) - && git clone --single-branch -b master https://github.com/wikimedia/mediawiki-extensions-FlexDiagrams $MW_HOME/extensions/FlexDiagrams \ - && cd $MW_HOME/extensions/FlexDiagrams \ - && git checkout -q eefc9e29aedfc6d8ffaf4f4e50043b390ebd7adc \ - # GlobalNotice - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-GlobalNotice $MW_HOME/extensions/GlobalNotice \ - && cd $MW_HOME/extensions/GlobalNotice \ - && git checkout -q 15a40bff4641f00a5a8dda3d36795b1c659c19a7 \ - # GoogleAnalyticsMetrics - && git clone --single-branch -b master https://github.com/wikimedia/mediawiki-extensions-GoogleAnalyticsMetrics $MW_HOME/extensions/GoogleAnalyticsMetrics \ - && cd $MW_HOME/extensions/GoogleAnalyticsMetrics \ - && git checkout -q 82a08cc63ec58698f144be7c2fb1a6f861cb57bd \ - # GoogleDocCreator - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-GoogleDocCreator $MW_HOME/extensions/GoogleDocCreator \ - && cd $MW_HOME/extensions/GoogleDocCreator \ - && git checkout -q 9e53ecfa4149688a2352a7898c2a2005632e1b7d \ - # Graph - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-Graph $MW_HOME/extensions/Graph \ - && cd $MW_HOME/extensions/Graph \ - && git checkout -q 9c229eafdf406c95a4a666a6b7f2a9d0d3d682e4 \ - # GTag - && git clone https://github.com/SkizNet/mediawiki-GTag $MW_HOME/extensions/GTag \ - && cd $MW_HOME/extensions/GTag \ - && git checkout -q d45f54085d003166aa032363408b8dbef7dd3628 \ - # HeaderFooter - && git clone -b MW_REL1_39_Compat https://github.com/wikimedia/mediawiki-extensions-HeaderFooter.git $MW_HOME/extensions/HeaderFooter \ - && cd $MW_HOME/extensions/HeaderFooter \ - && git checkout -q 8b7e15ca013af371c7f37b0d955ed2039a5e2fbf \ - # HeaderTabs (v2.2) - && git clone --single-branch -b master https://github.com/wikimedia/mediawiki-extensions-HeaderTabs $MW_HOME/extensions/HeaderTabs \ - && cd $MW_HOME/extensions/HeaderTabs \ - && git checkout -q 42aaabf1deeb0a228fc99e578ff7ec925e560dd7 \ - # HTMLTags - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-HTMLTags $MW_HOME/extensions/HTMLTags \ - && cd $MW_HOME/extensions/HTMLTags \ - && git checkout -q b8cb3131c5e76f5c037c8474fe14e51f2e877f03 \ - # JWTAuth (v. 2.0.0) - && git clone --single-branch -b master https://github.com/wikimedia/mediawiki-extensions-JWTAuth $MW_HOME/extensions/JWTAuth \ - && cd $MW_HOME/extensions/JWTAuth \ - && git checkout -q a61d2c62e55b70d4442d0397c04ba8f429ae1c7d \ - # LabeledSectionTransclusion - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-LabeledSectionTransclusion $MW_HOME/extensions/LabeledSectionTransclusion \ - && cd $MW_HOME/extensions/LabeledSectionTransclusion \ - && git checkout -q 187abfeaafbad35eed4254f7a7ee0638980e932a \ - # LDAPAuthentication2 - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-LDAPAuthentication2 $MW_HOME/extensions/LDAPAuthentication2 \ - && cd $MW_HOME/extensions/LDAPAuthentication2 \ - && git checkout -q 6bc584893d3157d5180e0e3ed93c3dbbc5b93056 \ - # LDAPAuthorization - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-LDAPAuthorization $MW_HOME/extensions/LDAPAuthorization \ - && cd $MW_HOME/extensions/LDAPAuthorization \ - && git checkout -q e6815d29c22f4b4eb85f868372a729ad49d7d3c8 \ - # LDAPProvider - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-LDAPProvider $MW_HOME/extensions/LDAPProvider \ - && cd $MW_HOME/extensions/LDAPProvider \ - && git checkout -q 80f8cc8156b0cd250d0dfacd9378ed0db7c2091d \ - # Lingo - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-Lingo $MW_HOME/extensions/Lingo \ - && cd $MW_HOME/extensions/Lingo \ - && git checkout -q a291fa25822097a4a2aefff242a876edadb535a4 \ - # LinkSuggest - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-LinkSuggest $MW_HOME/extensions/LinkSuggest \ - && cd $MW_HOME/extensions/LinkSuggest \ - && git checkout -q 6005d191e35d1d6bed5a4e7bd1bedc5fa0030bf1 \ - # LinkTarget - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-LinkTarget $MW_HOME/extensions/LinkTarget \ - && cd $MW_HOME/extensions/LinkTarget \ - && git checkout -q e5d592dcc72a00e06604ee3f65dfb8f99977c156 \ - # Linter - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-Linter $MW_HOME/extensions/Linter \ - && cd $MW_HOME/extensions/Linter \ - && git checkout -q 8bc1727955da7468f096aa5c5b5790923db43d20 \ - # LockAuthor - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-LockAuthor $MW_HOME/extensions/LockAuthor \ - && cd $MW_HOME/extensions/LockAuthor \ - && git checkout -q 4ebc4f221a0987b64740014a9380e9c3522f271d \ - # Lockdown - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-Lockdown $MW_HOME/extensions/Lockdown \ - && cd $MW_HOME/extensions/Lockdown \ - && git checkout -q ffcb6e8892ad35bb731fad1dc24712a245ab86d0 \ - # LookupUser - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-LookupUser $MW_HOME/extensions/LookupUser \ - && cd $MW_HOME/extensions/LookupUser \ - && git checkout -q 5fa17d449b6bedb3e8cee5b239af6cadae31da70 \ - # Loops - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-Loops $MW_HOME/extensions/Loops \ - && cd $MW_HOME/extensions/Loops \ - && git checkout -q 0eb05a81b9b53f5381eefb4f8b6959b6dcdec1d8 \ - # MagicNoCache - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-MagicNoCache $MW_HOME/extensions/MagicNoCache \ - && cd $MW_HOME/extensions/MagicNoCache \ - && git checkout -q 93534c12dac0e821c46c94b21053d274a6e557de \ - # Maps - && git clone --single-branch -b master https://github.com/ProfessionalWiki/Maps $MW_HOME/extensions/Maps \ - && cd $MW_HOME/extensions/Maps \ - && git checkout -q 7175b47e3b2cbbfcd55c6bd896f4e8403dc03d33 \ - # MassMessage - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-MassMessage $MW_HOME/extensions/MassMessage \ - && cd $MW_HOME/extensions/MassMessage \ - && git checkout -q d6a86291bb975c3dc7778f370006f1145cc834bd \ - # MassMessageEmail - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-MassMessageEmail $MW_HOME/extensions/MassMessageEmail \ - && cd $MW_HOME/extensions/MassMessageEmail \ - && git checkout -q bd1f3413dbe8242b4294892a7f9803ea22364eae \ - # MediaUploader - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-MediaUploader $MW_HOME/extensions/MediaUploader \ - && cd $MW_HOME/extensions/MediaUploader \ - && git checkout -q 1edd91c506c1c0319e7b9a3e71d639130760b1fd \ - # Mermaid (v. 3.1.0) - && git clone --single-branch -b master https://github.com/SemanticMediaWiki/Mermaid $MW_HOME/extensions/Mermaid \ - && cd $MW_HOME/extensions/Mermaid \ - && git checkout -q fd792683fef3c84a7cdd56f8f474c4da0dd630f2 \ - # MintyDocs (1.0) - && git clone --single-branch -b master https://github.com/wikimedia/mediawiki-extensions-MintyDocs $MW_HOME/extensions/MintyDocs \ - && cd $MW_HOME/extensions/MintyDocs \ - && git checkout -q 4496e33ce71d2c364b16599619c961a1a330bf14 \ - # MobileFrontend - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-MobileFrontend $MW_HOME/extensions/MobileFrontend \ - && cd $MW_HOME/extensions/MobileFrontend \ - && git checkout -q 7f9ecd976796d02988b40dff4a790c315d4651e6 \ - # MsUpload - && git clone https://github.com/wikimedia/mediawiki-extensions-MsUpload $MW_HOME/extensions/MsUpload \ - && cd $MW_HOME/extensions/MsUpload \ - && git checkout -q 8c2403b09186f5f25f0c28369e6aff3c285047df \ - # MyVariables - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-MyVariables $MW_HOME/extensions/MyVariables \ - && cd $MW_HOME/extensions/MyVariables \ - && git checkout -q 8b45be10c9b0a484824c55d8cc48399290384260 \ - # NewUserMessage - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-NewUserMessage $MW_HOME/extensions/NewUserMessage \ - && cd $MW_HOME/extensions/NewUserMessage \ - && git checkout -q 206f32880fa7bf70b191d33ed80b8626bca39efe \ - # NumerAlpha - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-NumerAlpha $MW_HOME/extensions/NumerAlpha \ - && cd $MW_HOME/extensions/NumerAlpha \ - && git checkout -q 93c0869735581006a3f510096738e262d49f4107 \ - # OpenGraphMeta - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-OpenGraphMeta $MW_HOME/extensions/OpenGraphMeta \ - && cd $MW_HOME/extensions/OpenGraphMeta \ - && git checkout -q d319702cd4ceda1967c233ef8e021b67b3fc355f \ - # OpenIDConnect - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-OpenIDConnect $MW_HOME/extensions/OpenIDConnect \ - && cd $MW_HOME/extensions/OpenIDConnect \ - && git checkout -q 0824f3cf3800f63e930abf0f03baf1a7c755a270 \ - # PageExchange - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-PageExchange $MW_HOME/extensions/PageExchange \ - && cd $MW_HOME/extensions/PageExchange \ - && git checkout -q 28482410564e38d2b97ab7321e99c4281c6e5877 \ - # PageForms (v. 5.6.1) - && git clone --single-branch -b master https://github.com/wikimedia/mediawiki-extensions-PageForms $MW_HOME/extensions/PageForms \ - && cd $MW_HOME/extensions/PageForms \ - && git checkout -q f90d67ecc2c111e82db454c71592c83384ff9704 \ - # PluggableAuth - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-PluggableAuth $MW_HOME/extensions/PluggableAuth \ - && cd $MW_HOME/extensions/PluggableAuth \ - && git checkout -q 4be1e402e1862d165a4feb003c492ddc9525057e \ - # Popups - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-Popups $MW_HOME/extensions/Popups \ - && cd $MW_HOME/extensions/Popups \ - && git checkout -q ff4d2156e1f7f4c11f7396cb0cd70d387abd8187 \ - # RegularTooltips - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-RegularTooltips $MW_HOME/extensions/RegularTooltips \ - && cd $MW_HOME/extensions/RegularTooltips \ - && git checkout -q 1af807bb6d5cfbd1e471e38bf70d6a392fb7eda2 \ - # RevisionSlider - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-RevisionSlider $MW_HOME/extensions/RevisionSlider \ - && cd $MW_HOME/extensions/RevisionSlider \ - && git checkout -q 3cae51a322a5ca0f359e83efcb5fac38e73e346e \ - # RottenLinks - && git clone --single-branch -b master https://github.com/miraheze/RottenLinks.git $MW_HOME/extensions/RottenLinks \ - && cd $MW_HOME/extensions/RottenLinks \ - && git checkout -q a96e99d0a61a42d59587a67db0720ce245a7ee46 \ - # SandboxLink - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-SandboxLink $MW_HOME/extensions/SandboxLink \ - && cd $MW_HOME/extensions/SandboxLink \ - && git checkout -q 9ab23288a010c3894c59cd5ba3096d93d57c15c5 \ - # SaveSpinner - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-SaveSpinner $MW_HOME/extensions/SaveSpinner \ - && cd $MW_HOME/extensions/SaveSpinner \ - && git checkout -q 1e819e2fff7fad6999bafe71d866c3af50836c42 \ - # SemanticBreadcrumbLinks - && git clone --single-branch -b master https://github.com/SemanticMediaWiki/SemanticBreadcrumbLinks $MW_HOME/extensions/SemanticBreadcrumbLinks \ - && cd $MW_HOME/extensions/SemanticBreadcrumbLinks \ - && git checkout -q 87a69003743f1de52338f4717cfcf5218ca5a743 \ - # SemanticCompoundQueries (v. 2.2.0) - && git clone --single-branch -b master https://github.com/SemanticMediaWiki/SemanticCompoundQueries $MW_HOME/extensions/SemanticCompoundQueries \ - && cd $MW_HOME/extensions/SemanticCompoundQueries \ - && git checkout -q eeb514393fdf2e80ae7084839d8803ee32ae3da4 \ - # SemanticDependencyUpdater (v. 2.0.2) - && git clone --single-branch -b master https://github.com/gesinn-it/SemanticDependencyUpdater $MW_HOME/extensions/SemanticDependencyUpdater \ - && cd $MW_HOME/extensions/SemanticDependencyUpdater \ - && git checkout -q e8a483dd54de6a069854789ae6c702aab98a89ab \ - # SemanticDrilldown - && git clone --single-branch -b $MW_VERSION https://gerrit.wikimedia.org/r/mediawiki/extensions/SemanticDrilldown $MW_HOME/extensions/SemanticDrilldown \ - && cd $MW_HOME/extensions/SemanticDrilldown \ - && git checkout -q e960979ec5a3b1e662b3742cee7e7ef4056f9a46 \ - # SemanticExtraSpecialProperties (v. 3.0.4) - && git clone --single-branch -b master https://github.com/SemanticMediaWiki/SemanticExtraSpecialProperties $MW_HOME/extensions/SemanticExtraSpecialProperties \ - && cd $MW_HOME/extensions/SemanticExtraSpecialProperties \ - && git checkout -q e449633082a4bf7dcae119b6a6d0bfeec8e3cfe8 \ - # SemanticFormsSelect - && git clone https://github.com/SemanticMediaWiki/SemanticFormsSelect.git $MW_HOME/extensions/SemanticFormsSelect \ - && cd $MW_HOME/extensions/SemanticFormsSelect \ - && git checkout -q 4b56baa752401b4ff9fe555fd57fc5c3309601d4 \ - # SemanticMediaWiki (v. 4.1.2) - && git clone https://github.com/SemanticMediaWiki/SemanticMediaWiki $MW_HOME/extensions/SemanticMediaWiki \ - && cd $MW_HOME/extensions/SemanticMediaWiki \ - && git checkout -q 5c94879171d5f741b896828c25a9f2bb07a03dff \ - # SemanticResultFormats (v. 4.0.2) - && git clone https://github.com/SemanticMediaWiki/SemanticResultFormats $MW_HOME/extensions/SemanticResultFormats \ - && cd $MW_HOME/extensions/SemanticResultFormats \ - && git checkout -q d5196722a56f9b65475be68d1e97063d7b975cb9 \ - # SemanticScribunto (v. 2.2.0) - && git clone --single-branch -b master https://github.com/SemanticMediaWiki/SemanticScribunto $MW_HOME/extensions/SemanticScribunto \ - && cd $MW_HOME/extensions/SemanticScribunto \ - && git checkout -q 1c616a4c4da443b3433000d6870bb92c184236fa \ - # SemanticTasks - && git clone https://github.com/WikiTeq/SemanticTasks.git $MW_HOME/extensions/SemanticTasks \ - && cd $MW_HOME/extensions/SemanticTasks \ - && git checkout -q 70ddd8cf6090139ce5ee6fdf1e7f3a9f2c68d5d3 \ - # SemanticWatchlist (v. 1.3.0) - && git clone https://github.com/SemanticMediaWiki/SemanticWatchlist.git $MW_HOME/extensions/SemanticWatchlist \ - && cd $MW_HOME/extensions/SemanticWatchlist \ - && git checkout -q ecea17097874d16cd240ce35bd20692a67c5064b \ - # SimpleBatchUpload (v. 2.0.0) - && git clone https://github.com/ProfessionalWiki/SimpleBatchUpload $MW_HOME/extensions/SimpleBatchUpload \ - && cd $MW_HOME/extensions/SimpleBatchUpload \ - && git checkout -q 3b9e248b49d7fbeb81d7da32078db7040809e724 \ - # SimpleChanges - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-SimpleChanges $MW_HOME/extensions/SimpleChanges \ - && cd $MW_HOME/extensions/SimpleChanges \ - && git checkout -q 5352de89dfaf043f646a44582b26f07822f02be7 \ - # SimpleMathJax - && git clone --single-branch https://github.com/jmnote/SimpleMathJax.git $MW_HOME/extensions/SimpleMathJax \ - && cd $MW_HOME/extensions/SimpleMathJax \ - && git checkout -q 3757e9b1cf235b2e2c62e7d208d52206e185b28e \ - # SkinPerPage - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-SkinPerPage $MW_HOME/extensions/SkinPerPage \ - && cd $MW_HOME/extensions/SkinPerPage \ - && git checkout -q 2793602b37c33aa4c769834feac0b88f385ccef9 \ - # SmiteSpam - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-SmiteSpam $MW_HOME/extensions/SmiteSpam \ - && cd $MW_HOME/extensions/SmiteSpam \ - && git checkout -q 268f212b7e366711d8e7b54c7faf5b750fa014ad \ - # SocialProfile - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-SocialProfile $MW_HOME/extensions/SocialProfile \ - && cd $MW_HOME/extensions/SocialProfile \ - && git checkout -q 74fcf9bead948ec0419eea10800c9331bcc1273e \ - # SubPageList (v. 3.0.0) - && git clone https://github.com/ProfessionalWiki/SubPageList $MW_HOME/extensions/SubPageList \ - && cd $MW_HOME/extensions/SubPageList \ - && git checkout -q c016dcdb7866f20319731e6497b48fd43756505e \ - # TemplateSandbox - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-TemplateSandbox $MW_HOME/extensions/TemplateSandbox \ - && cd $MW_HOME/extensions/TemplateSandbox \ - && git checkout -q 8af94cedc41cbe6c54614714ced6ce4128555ce4 \ - # TemplateStyles - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-TemplateStyles $MW_HOME/extensions/TemplateStyles \ - && cd $MW_HOME/extensions/TemplateStyles \ - && git checkout -q 2a93b56e370ab8b8e020ed29c507104b56f1d11a \ - # TemplateWizard - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-TemplateWizard $MW_HOME/extensions/TemplateWizard \ - && cd $MW_HOME/extensions/TemplateWizard \ - && git checkout -q d486e3475f84118fd9b5c77d60254daa2f56f654 \ - # Thanks - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-Thanks $MW_HOME/extensions/Thanks \ - && cd $MW_HOME/extensions/Thanks \ - && git checkout -q 03b6a52f263604c819e69b78c157f6ef5adb053e \ - # TimedMediaHandler - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-TimedMediaHandler $MW_HOME/extensions/TimedMediaHandler \ - && cd $MW_HOME/extensions/TimedMediaHandler \ - && git checkout -q 2e64302c68e58693650e91b7869fa5aecf1aaf23 \ - # TinyMCE - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-TinyMCE $MW_HOME/extensions/TinyMCE \ - && cd $MW_HOME/extensions/TinyMCE \ - && git checkout -q 06436ec3a53c6cd53c458e4e8ab3ec8d1a23029b \ - # TitleIcon - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-TitleIcon $MW_HOME/extensions/TitleIcon \ - && cd $MW_HOME/extensions/TitleIcon \ - && git checkout -q 7c6c83f4859642542393612ad961a258378e0cac \ - # UniversalLanguageSelector - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-UniversalLanguageSelector $MW_HOME/extensions/UniversalLanguageSelector \ - && cd $MW_HOME/extensions/UniversalLanguageSelector \ - && git checkout -q 8216e434c38ddeba74e5ad758bfbbcc83861fa60 \ - # UploadWizard - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-UploadWizard $MW_HOME/extensions/UploadWizard \ - && cd $MW_HOME/extensions/UploadWizard \ - && git checkout -q 847413694b519c76da7196023651c8d584137d2f \ - # UrlGetParameters - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-UrlGetParameters $MW_HOME/extensions/UrlGetParameters \ - && cd $MW_HOME/extensions/UrlGetParameters \ - && git checkout -q d36f92810c762b301035ff1b4f42792ed9a1018b \ - # UserFunctions - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-UserFunctions $MW_HOME/extensions/UserFunctions \ - && cd $MW_HOME/extensions/UserFunctions \ - && git checkout -q b532b1047080c3738327ee2f3b541e563e06ca19 \ - # UserMerge - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-UserMerge $MW_HOME/extensions/UserMerge \ - && cd $MW_HOME/extensions/UserMerge \ - && git checkout -q 183bb7a8f78cbe365bec0fbd4b3ecdd4fae1a359 \ - # UserPageViewTracker (v. 0.7) - && git clone --single-branch -b master https://github.com/wikimedia/mediawiki-extensions-UserPageViewTracker $MW_HOME/extensions/UserPageViewTracker \ - && cd $MW_HOME/extensions/UserPageViewTracker \ - && git checkout -q f4b7c20c372165541164d449c12df1e74e98ed0b \ - # Variables - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-Variables $MW_HOME/extensions/Variables \ - && cd $MW_HOME/extensions/Variables \ - && git checkout -q b4a9063f16a928567e3b6788cda9246c2e94797f \ - # VEForAll (v. 0.5) - && git clone --single-branch -b master https://github.com/wikimedia/mediawiki-extensions-VEForAll $MW_HOME/extensions/VEForAll \ - && cd $MW_HOME/extensions/VEForAll \ - && git checkout -q cffa12abb85200e90b1cbc636325b1ec1a89a6af \ - # VoteNY - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-VoteNY $MW_HOME/extensions/VoteNY \ - && cd $MW_HOME/extensions/VoteNY \ - && git checkout -q 11c103f4b9167a8d8d5e850d8a781c6f49b249c1 \ - # WatchAnalytics (v. 4.1.2) - && git clone --single-branch -b master https://github.com/wikimedia/mediawiki-extensions-WatchAnalytics $MW_HOME/extensions/WatchAnalytics \ - && cd $MW_HOME/extensions/WatchAnalytics \ - && git checkout -q 72b70a667a26bbde0a3cf93fc79747aae08fca32 \ - # WhoIsWatching - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-WhoIsWatching $MW_HOME/extensions/WhoIsWatching \ - && cd $MW_HOME/extensions/WhoIsWatching \ - && git checkout -q 836a31018e26ab7c993088c4cca31a89efec2ee5 \ - # WhosOnline - && git clone --single-branch -b master https://github.com/wikimedia/mediawiki-extensions-WhosOnline $MW_HOME/extensions/WhosOnline \ - && cd $MW_HOME/extensions/WhosOnline \ - && git checkout -q d3d63faa08b89c429a7803b283e9bb685a51b9a0 \ - # Widgets - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-Widgets $MW_HOME/extensions/Widgets \ - && cd $MW_HOME/extensions/Widgets \ - && git checkout -q 197d429f971b2aebbce29b7a91a194e1f8181e64 \ - # WikiSEO - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-WikiSEO $MW_HOME/extensions/WikiSEO \ - && cd $MW_HOME/extensions/WikiSEO \ - && git checkout -q 610cffa3345333b53d4dda7b55b2012fbfcee9de \ - # WSOAuth - && git clone --single-branch -b $MW_VERSION https://github.com/wikimedia/mediawiki-extensions-WSOAuth $MW_HOME/extensions/WSOAuth \ - && cd $MW_HOME/extensions/WSOAuth \ - && git checkout -q 3c54c4899dd63989bc3214273bf1c5807c7ac5db + apt-get update \ + && apt-get install -y jq \ + && chmod +x /tmp/extension-setup.sh + +RUN /tmp/extension-setup.sh # Patch composer RUN set -x; \ sed -i 's="monolog/monolog": "2.2.0",="monolog/monolog": "^2.2",=g' $MW_HOME/composer.json -# Patch some SMW-based extensions' composer.json files to avoid Composer-based downloading of SMW. - -# SemanticBreadcrumbLinks -COPY _sources/patches/semantic-breadcrumb-links-composer-reqs.patch /tmp/semantic-breadcrumb-links-composer-reqs.patch -RUN set -x; \ - cd $MW_HOME/extensions/SemanticBreadcrumbLinks \ - && git apply /tmp/semantic-breadcrumb-links-composer-reqs.patch - -# SemanticResultFormats -COPY _sources/patches/semantic-result-formats-composer-reqs.patch /tmp/semantic-result-formats-composer-reqs.patch -RUN set -x; \ - cd $MW_HOME/extensions/SemanticResultFormats \ - && git apply /tmp/semantic-result-formats-composer-reqs.patch - -# SemanticWatchlist -COPY _sources/patches/SemanticWatchList.417851c22c25f3e33fb654f4138c760c53051b9a.patch /tmp/SemanticWatchList.417851c22c25f3e33fb654f4138c760c53051b9a.patch -RUN set -x; \ - cd $MW_HOME/extensions/SemanticWatchlist \ - && git apply /tmp/SemanticWatchList.417851c22c25f3e33fb654f4138c760c53051b9a.patch - # Composer dependencies COPY _sources/configs/composer.canasta.json $MW_HOME/composer.local.json RUN set -x; \ @@ -654,18 +156,6 @@ RUN set -x; \ # Other patches -# Add autoloading to several extensions' extension.json file, which normally require -# Composer autoloading -COPY _sources/patches/semantic-compound-queries-autoload.patch /tmp/semantic-compound-queries-autoload.patch -RUN set -x; \ - cd $MW_HOME/extensions/SemanticCompoundQueries \ - && git apply /tmp/semantic-compound-queries-autoload.patch - -COPY _sources/patches/semantic-scribunto-autoload.patch /tmp/semantic-scribunto-autoload.patch -RUN set -x; \ - cd $MW_HOME/extensions/SemanticScribunto \ - && git apply /tmp/semantic-scribunto-autoload.patch - # Cleanup all .git leftovers RUN set -x; \ cd $MW_HOME \ diff --git a/_sources/configs/extensions.yaml b/_sources/configs/extensions.yaml new file mode 100644 index 00000000..ead54e82 --- /dev/null +++ b/_sources/configs/extensions.yaml @@ -0,0 +1,295 @@ +# Canasta YAML file for extensions for MediaWiki 1.39. +# Where the repository is not specified, the Wikimedia Git repository for the +# extension with that name is used, and the default branch used is REL1_39. +# Where the repository *is* specified, the default branch used is master. +extensions: + - AdminLinks: + branch: master + commit: 3e2671c21fd4b8644552069ee60220035b6e96f5 # v. 0.6.1 + - AdvancedSearch: + commit: 1a44eafc93a17938333b74a37cb4deff2192e50a + - AJAXPoll: + commit: 8429d8d4cba5be6df04e3fec17b0daabbf10cfa7 + - AntiSpoof: + commit: 01cf89a678d5bab6610d24e07d3534356a5880cb + - ApprovedRevs: + branch: master + commit: 53b67bf7e1e8ac3d20c2fd41ad2ab1c708c045a6 # v. 1.8.2 + - Arrays: + commit: 338f661bf0ab377f70e029079f2c5c5b370219df + - AWS: + repository: https://github.com/edwardspec/mediawiki-aws-s3 + commit: d75873a1f594ac3777b17047c9905b2521debb8b # v. 0.12.0 + - BetaFeatures: + commit: 09cca44341f9695446c4e9fc9e8fec3fdcb197b0 + - BootstrapComponents: + repository: https://github.com/oetterer/BootstrapComponents + commit: 665c3dee1d9e3f4bcb18dd1920fe27b70e334574 # v. 5.1.0 + - BreadCrumbs2: + commit: d53357a6839e94800a617de4fc451b6c64d0a1c8 + - Cargo: + branch: master + commit: 7e8ea881cdb41e79687d059670fc68872a6a892c # v. 3.4.2 + - CharInsert: + commit: 54c0f0ca9119a3ce791fb5d53edd4ec32035a5c5 + - CheckUser: + commit: 9e2b6d3e928855247700146273d8131e025de918 + - CirrusSearch: + commit: 8296300873aaffe815800cf05c84fa04c8cbd2c0 + - CodeMirror: + commit: 27efed79972ca181a194d17f4a94f4192fd5a493 + - Collection: + commit: e00e70c6fcec963c8876e410e52c83c75ed60827 + - CommentStreams: + commit: 274bb10bc2d39fd137650dbc0dfc607c766d1aaa + - CommonsMetadata: + commit: 8ee30de3b1cabbe55c484839127493fd5fa5d076 + - ConfirmAccount: + commit: c06d5dfb43811a2dee99099476c57af2b6d762c4 + - ContactPage: + commit: f509796056ae1fc597b6e3c3c268fac35bf66636 + - ContributionScores: + commit: 0c08d338a1150c76e74ae490cd4d5f5b9f6daa5f + - CookieWarning: + commit: bc991e93133bd69fe45e07b3d4554225decc7dae + - DataTransfer: + commit: 2f9f949f71f0bb7d1bd8b6b97c795b9428bb1c71 + - DeleteBatch: + commit: 82078d60fc59a718f429ddebe5e99de8a8734413 + - Description2: + commit: d2a5322a44f + - Disambiguator: + commit: b7e7fad5f9f3dccfb902a3cbfd3bf2b16df91871 + - DismissableSiteNotice: + commit: 88129f80f077ec9e4932148056c8cfc1ed0361c7 + - DisplayTitle: + commit: a14c406cc273c73a12957b55a27c095ad98d1795 + - Echo: + commit: 7ae3c1059a5f4fd1f96f23fa8674bb1705f5e10d + - EditAccount: + commit: abf772dc6ce8f3a31f2d82a1408796c138151ab0 + - Editcount: + commit: 41544ffceb1356f91575dc6772a48b172751d7cc + - Elastica: + commit: e4ead38b71ed4f3df8dc689fe448b749771b4ed4 + - EmailAuthorization: + commit: 2016da1b354f741d89b5dc207d4a84e11ffe9bce + - EmbedVideo: + repository: https://github.com/StarCitizenWiki/mediawiki-extensions-EmbedVideo.git + commit: 5c03c031070981730a0e01aa3cbc3e5cbd1b88c1 + - EventLogging: + commit: 2740dbcd139be279ca2a4db039739b4f796b4178 + - EventStreamConfig: + commit: 1aae8cb6c312e49f0126091a59a453cb224657f9 + - ExternalData: + branch: master + commit: 5d30e60a65ca53a3fb5b39826deb2e6917892e22 # v. 3.2 + - FlexDiagrams: + branch: master + commit: eefc9e29aedfc6d8ffaf4f4e50043b390ebd7adc # v. 0.5 + - GlobalNotice: + commit: 15a40bff4641f00a5a8dda3d36795b1c659c19a7 + - GoogleAnalyticsMetrics: + branch: master + commit: 82a08cc63ec58698f144be7c2fb1a6f861cb57bd + - GoogleDocCreator: + commit: 9e53ecfa4149688a2352a7898c2a2005632e1b7d + - Graph: + commit: 9c229eafdf406c95a4a666a6b7f2a9d0d3d682e4 + - GTag: + repository: https://github.com/SkizNet/mediawiki-GTag + commit: d45f54085d003166aa032363408b8dbef7dd3628 + - HeaderFooter: + branch: MW_REL1_39_Compat + commit: 8b7e15ca013af371c7f37b0d955ed2039a5e2fbf + - HeaderTabs: + branch: master + commit: 42aaabf1deeb0a228fc99e578ff7ec925e560dd7 # v2.2 + - HTMLTags: + commit: b8cb3131c5e76f5c037c8474fe14e51f2e877f03 + - JWTAuth: + branch: master + commit: a61d2c62e55b70d4442d0397c04ba8f429ae1c7d # v. 2.0.0 + - LabeledSectionTransclusion: + commit: 187abfeaafbad35eed4254f7a7ee0638980e932a + - LDAPAuthentication2: + commit: 6bc584893d3157d5180e0e3ed93c3dbbc5b93056 + - LDAPAuthorization: + commit: e6815d29c22f4b4eb85f868372a729ad49d7d3c8 + - LDAPProvider: + commit: 80f8cc8156b0cd250d0dfacd9378ed0db7c2091d + - Lingo: + commit: a291fa25822097a4a2aefff242a876edadb535a4 + - LinkSuggest: + commit: 6005d191e35d1d6bed5a4e7bd1bedc5fa0030bf1 + - LinkTarget: + commit: e5d592dcc72a00e06604ee3f65dfb8f99977c156 + - Linter: + commit: 8bc1727955da7468f096aa5c5b5790923db43d20 + - LockAuthor: + commit: 4ebc4f221a0987b64740014a9380e9c3522f271d + - Lockdown: + commit: ffcb6e8892ad35bb731fad1dc24712a245ab86d0 + - LookupUser: + commit: 5fa17d449b6bedb3e8cee5b239af6cadae31da70 + - Loops: + commit: 0eb05a81b9b53f5381eefb4f8b6959b6dcdec1d8 + - MagicNoCache: + commit: 93534c12dac0e821c46c94b21053d274a6e557de + - Maps: + repository: https://github.com/ProfessionalWiki/Maps + commit: 9b01a6bbd8e0d4277c152b7343efccae28b54d1c + - MassMessage: + commit: d6a86291bb975c3dc7778f370006f1145cc834bd + - MassMessageEmail: + commit: bd1f3413dbe8242b4294892a7f9803ea22364eae + - MediaUploader: + commit: 1edd91c506c1c0319e7b9a3e71d639130760b1fd + - Mermaid: + repository: https://github.com/SemanticMediaWiki/Mermaid + commit: fd792683fef3c84a7cdd56f8f474c4da0dd630f2 # v. 3.1.0 + - MintyDocs: + branch: master + commit: 4496e33ce71d2c364b16599619c961a1a330bf14 # 1.0 + - MobileFrontend: + commit: 7f9ecd976796d02988b40dff4a790c315d4651e6 + - MsUpload: + commit: 8c2403b09186f5f25f0c28369e6aff3c285047df + - MyVariables: + commit: 8b45be10c9b0a484824c55d8cc48399290384260 + - NewUserMessage: + commit: 206f32880fa7bf70b191d33ed80b8626bca39efe + - NumerAlpha: + commit: 93c0869735581006a3f510096738e262d49f4107 + - OpenGraphMeta: + commit: d319702cd4ceda1967c233ef8e021b67b3fc355f + - OpenIDConnect: + commit: 0824f3cf3800f63e930abf0f03baf1a7c755a270 + - PageExchange: + commit: 28482410564e38d2b97ab7321e99c4281c6e5877 + - PageForms: + branch: master + commit: f90d67ecc2c111e82db454c71592c83384ff9704 # v. 5.6.1 + - PluggableAuth: + commit: 4be1e402e1862d165a4feb003c492ddc9525057e + - Popups: + commit: ff4d2156e1f7f4c11f7396cb0cd70d387abd8187 + - RegularTooltips: + commit: 1af807bb6d5cfbd1e471e38bf70d6a392fb7eda2 + - RevisionSlider: + commit: 3cae51a322a5ca0f359e83efcb5fac38e73e346e + - RottenLinks: + repository: https://github.com/miraheze/RottenLinks.git + commit: a96e99d0a61a42d59587a67db0720ce245a7ee46 + - SandboxLink: + commit: 9ab23288a010c3894c59cd5ba3096d93d57c15c5 + - SaveSpinner: + commit: 1e819e2fff7fad6999bafe71d866c3af50836c42 + - SemanticBreadcrumbLinks: + repository: https://github.com/SemanticMediaWiki/SemanticBreadcrumbLinks + commit: 87a69003743f1de52338f4717cfcf5218ca5a743 + patches: + - semantic-breadcrumb-links-composer-reqs.patch + - SemanticCompoundQueries: + repository: https://github.com/SemanticMediaWiki/SemanticCompoundQueries + commit: eeb514393fdf2e80ae7084839d8803ee32ae3da4 # v. 2.2.0 + patches: + - semantic-compound-queries-autoload.patch + - SemanticDependencyUpdater: + repository: https://github.com/gesinn-it/SemanticDependencyUpdater + commit: e8a483dd54de6a069854789ae6c702aab98a89ab # v. 2.0.2 + - SemanticDrilldown: + repository: https://gerrit.wikimedia.org/r/mediawiki/extensions/SemanticDrilldown + commit: e960979ec5a3b1e662b3742cee7e7ef4056f9a46 + - SemanticExtraSpecialProperties: + repository: https://github.com/SemanticMediaWiki/SemanticExtraSpecialProperties + commit: e449633082a4bf7dcae119b6a6d0bfeec8e3cfe8 # v. 3.0.4 + - SemanticFormsSelect: + repository: https://github.com/SemanticMediaWiki/SemanticFormsSelect.git + commit: 4b56baa752401b4ff9fe555fd57fc5c3309601d4 + - SemanticMediaWiki: + repository: https://github.com/SemanticMediaWiki/SemanticMediaWiki + commit: 5c94879171d5f741b896828c25a9f2bb07a03dff # v. 4.1.2 + - SemanticResultFormats: + repository: https://github.com/SemanticMediaWiki/SemanticResultFormats + commit: d5196722a56f9b65475be68d1e97063d7b975cb9 # v. 4.0.2 + patches: + - semantic-result-formats-composer-reqs.patch + - SemanticScribunto: + repository: https://github.com/SemanticMediaWiki/SemanticScribunto + commit: 1c616a4c4da443b3433000d6870bb92c184236fa # v. 2.2.0 + patches: + - semantic-scribunto-autoload.patch + - SemanticTasks: + repository: https://github.com/WikiTeq/SemanticTasks.git + commit: 70ddd8cf6090139ce5ee6fdf1e7f3a9f2c68d5d3 + - SemanticWatchlist: + repository: https://github.com/SemanticMediaWiki/SemanticWatchlist.git + commit: ecea17097874d16cd240ce35bd20692a67c5064b # v. 1.3.0 + patches: + - SemanticWatchList.417851c22c25f3e33fb654f4138c760c53051b9a.patch + - SimpleBatchUpload: + repository: https://github.com/ProfessionalWiki/SimpleBatchUpload + commit: 3b9e248b49d7fbeb81d7da32078db7040809e724 # v. 2.0.0 + - SimpleChanges: + commit: 5352de89dfaf043f646a44582b26f07822f02be7 + - SimpleMathJax: + repository: https://github.com/jmnote/SimpleMathJax.git + commit: 3757e9b1cf235b2e2c62e7d208d52206e185b28e + - SkinPerPage: + commit: 2793602b37c33aa4c769834feac0b88f385ccef9 + - SmiteSpam: + commit: 268f212b7e366711d8e7b54c7faf5b750fa014ad + - SocialProfile: + commit: 74fcf9bead948ec0419eea10800c9331bcc1273e + - SubPageList: + repository: https://github.com/ProfessionalWiki/SubPageList + commit: c016dcdb7866f20319731e6497b48fd43756505e # v. 3.0.0 + - TemplateSandbox: + commit: 8af94cedc41cbe6c54614714ced6ce4128555ce4 + - TemplateStyles: + commit: 2a93b56e370ab8b8e020ed29c507104b56f1d11a + - TemplateWizard: + commit: d486e3475f84118fd9b5c77d60254daa2f56f654 + - Thanks: + commit: 03b6a52f263604c819e69b78c157f6ef5adb053e + - TimedMediaHandler: + commit: 2e64302c68e58693650e91b7869fa5aecf1aaf23 + - TinyMCE: + commit: 06436ec3a53c6cd53c458e4e8ab3ec8d1a23029b + - TitleIcon: + commit: 7c6c83f4859642542393612ad961a258378e0cac + - UniversalLanguageSelector: + commit: 8216e434c38ddeba74e5ad758bfbbcc83861fa60 + - UploadWizard: + commit: 847413694b519c76da7196023651c8d584137d2f + - UrlGetParameters: + commit: d36f92810c762b301035ff1b4f42792ed9a1018b + - UserFunctions: + commit: b532b1047080c3738327ee2f3b541e563e06ca19 + - UserMerge: + commit: 183bb7a8f78cbe365bec0fbd4b3ecdd4fae1a359 + - UserPageViewTracker: + branch: master + commit: f4b7c20c372165541164d449c12df1e74e98ed0b # v. 0.7 + - Variables: + commit: b4a9063f16a928567e3b6788cda9246c2e94797f + - VEForAll: + branch: master + commit: cffa12abb85200e90b1cbc636325b1ec1a89a6af # v. 0.5 + - VoteNY: + commit: 11c103f4b9167a8d8d5e850d8a781c6f49b249c1 + - WatchAnalytics: + branch: master + commit: 72b70a667a26bbde0a3cf93fc79747aae08fca32 # v. 4.1.2 + - WhoIsWatching: + commit: 836a31018e26ab7c993088c4cca31a89efec2ee5 + - WhosOnline: + branch: master + commit: d3d63faa08b89c429a7803b283e9bb685a51b9a0 + - Widgets: + commit: 197d429f971b2aebbce29b7a91a194e1f8181e64 + - WikiSEO: + commit: 610cffa3345333b53d4dda7b55b2012fbfcee9de + - WSOAuth: + commit: 3c54c4899dd63989bc3214273bf1c5807c7ac5db diff --git a/_sources/scripts/extension-setup.sh b/_sources/scripts/extension-setup.sh new file mode 100644 index 00000000..cf86ba0e --- /dev/null +++ b/_sources/scripts/extension-setup.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +MW_HOME="$MW_HOME" +MW_VERSION="$MW_VERSION" +# Since yq cannot process data from variables, a conversion is made to JSON format to utilise jq. +commands=$(yq eval '. | to_json' extensions.yaml) +echo "$commands" | jq -r '.extensions' | jq -c '.[]' | while read -r obj; do + extension_data=$(echo "$obj" | jq -r 'keys_unsorted[] as $key | select(has($key)) | "\($key) \(.[$key].repository) \(.[$key].commit) \(.[$key].branch)"') + read -r extension_name repository commit branch <<< "$extension_data" + + git_clone_cmd="git clone " + if [ "$repository" == "null" ]; then + repository="https://github.com/wikimedia/mediawiki-extensions-$extension_name" + if [ "$branch" == "null" ]; then + branch=$MW_VERSION + git_clone_cmd="$git_clone_cmd --single-branch -b $branch" + fi + fi + git_clone_cmd="$git_clone_cmd $repository $MW_HOME/extensions/$extension_name" + git_checkout_cmd="cd $MW_HOME/extensions/$extension_name && git checkout -q $commit" + + eval "$git_clone_cmd && $git_checkout_cmd" + patches=$(echo "$obj" | jq -r ".$extension_name.patches") + if [ "$patches" != "null" ]; then + echo "$patches" | jq -c '.[]' | while read -r patch; do + git_apply_cmd="cd $MW_HOME/extensions/$extension_name && git apply /tmp/$patch" + eval "$git_apply_cmd" + done + fi +done From 391af15f7d41765b0a46a5d704e9e4c6c49a00eb Mon Sep 17 00:00:00 2001 From: Jeffrey Wang Date: Sun, 14 Apr 2024 10:18:07 -0700 Subject: [PATCH 49/78] Create bug_report.md Inspired by the Citizen skin's GitHub issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..8ae173bb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,30 @@ +--- +name: Bug report +about: Create a bug report +title: '' +labels: bug +assignees: '' +--- + +## Describe the bug +**Summary**: A clear, one-sentence summary of what the bug is. + +**Description**: Full description of what happens. + +**Screenshots**: If applicable, add screenshots to help explain your problem. + +**Steps to reproduce the behavior**: +1. Run `canasta ,,,` +2. Add `foo.php` into `config/bar.php` +3. Open wiki to `Main Page` +4. Error appears + +## Expected behavior +A clear and concise description of what you expected to happen. + +## System info +_Please complete the following information:_ + - MediaWiki version (e.g. 1.39.7) + - Canasta version + - Installed extensions and versions (e.g. Semantic MediaWiki 4.0.2, Cargo as of 2024-04-20, etc.) + - Any other context you think is appropriate to include here From d83aad4d633a2fc1b075a6788b85c7641d8c5770 Mon Sep 17 00:00:00 2001 From: Jeffrey Wang Date: Sun, 14 Apr 2024 10:21:04 -0700 Subject: [PATCH 50/78] Create feature_request.md --- .github/ISSUE_TEMPLATE/feature_request.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..59a234d8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,16 @@ +--- +name: Feature request +about: Propose an idea for Canasta (does not include requests to add/update/remove bundled extensions or skins) +title: '' +labels: enhancement +assignees: '' +--- + +## The current situation +A clear and concise description of what the current situation is. + +## The proposed result +A clear and concise description of what you want to happen. + +## Alternatives (if any) +Not always applicable, but if there are any alternative solutions Canasta could explore, please add them here. From e61877e37e182460953d9c454f8bb4a646bf66f9 Mon Sep 17 00:00:00 2001 From: Jeffrey Wang Date: Sun, 14 Apr 2024 10:29:57 -0700 Subject: [PATCH 51/78] Create extension_request.md --- .github/ISSUE_TEMPLATE/extension_request.md | 33 +++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/extension_request.md diff --git a/.github/ISSUE_TEMPLATE/extension_request.md b/.github/ISSUE_TEMPLATE/extension_request.md new file mode 100644 index 00000000..af5da1d5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/extension_request.md @@ -0,0 +1,33 @@ +--- +name: Extension or skin request +about: Propose to add or remove an extension or skin for Canasta +title: '' +labels: enhancement +assignees: '' +--- + +### Name of extension + +### MediaWiki.org page (if it exists) +https://www.mediawiki.org/wiki/Extension: + +### Link to the repo +_GitHub preferred, Gerrit is fine too._ + +### Justification +_Explain in a few sentences why this extension or skin should be bundled._ + +### How often is this extension/skin updated? +_e.g. Every few months_ + +### How many people contribute to this extension regularly? +How many consistent maintainers are there (i.e. those who would be capable of continuing the extension's development in the other maintainers' absence)? Do not include people who make one-time or occasional contributions. + +### Are you the author of this extension/skin? +Yes/No + +### Have you checked that this extension or skin isn't already bundled in Canasta? +Yes/No + +### (Extensions only) Have you checked there are no similar extensions to it already bundled in Canasta? +Yes/No From d84397aa2d97a677c3d96a9a6d06b58b987da7e4 Mon Sep 17 00:00:00 2001 From: Jeffrey Wang Date: Sun, 14 Apr 2024 10:40:32 -0700 Subject: [PATCH 52/78] Create support_request.md --- .github/ISSUE_TEMPLATE/support_request.md | 42 +++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/support_request.md diff --git a/.github/ISSUE_TEMPLATE/support_request.md b/.github/ISSUE_TEMPLATE/support_request.md new file mode 100644 index 00000000..c08cd535 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/support_request.md @@ -0,0 +1,42 @@ +--- +name: Community support request +about: Get support from the community for when you are unsure if it is a bug. +title: '' +labels: question +assignees: '' +--- + +## Describe the situation +**Summary**: A clear, one-sentence summary of what your situation is. _e.g. Varnish guru meditation error continues to appear after 5 minutes of starting up Canasta._ + +**Description**: Full description of the situation. + +**Screenshots**: If applicable, add screenshots to help elucidate your situation. + +**Steps to reproduce the issue** (if applicable): +1. Run `canasta ,,,` +2. Add `foo.php` into `config/bar.php` +3. Open wiki to `Main Page` +4. Error appears + +## Expected behavior +A clear and concise description of what you expected to happen. + +## System info +_Please complete the following information:_ + - MediaWiki version (e.g. 1.39.7) + - Canasta version + - Canasta CLI version + - Installed extensions and versions (e.g. Semantic MediaWiki 4.0.2, Cargo as of 2024-04-20, etc.) + - Host operating system + - Do you have sudo/root permissions on the host OS? + - Any other context you think is appropriate to include here + +## Sanity checks +Only applies to troubleshooting requests. + +- Have you checked the documentation on canasta.wiki for how to address this? Yes/No +- Have you checked prior issues on GitHub yet? Yes/No +- Are you following all Canasta approaches and have **_avoided_** doing things such as running `docker exec` directly on the container, removing the Caddy/Varnish containers, adding unauthorized files to the Docker container after startup, etc.? Yes/No + +If you answered no to any of the above sanity check questions, please do not open this support request until you can answer yes to all of the questions. From 17ea1357bae9f25481811642b660cff2e233795d Mon Sep 17 00:00:00 2001 From: Yaron Koren Date: Sun, 14 Apr 2024 22:44:17 -0400 Subject: [PATCH 53/78] Fix extension-setup.sh to pass validation --- _sources/scripts/extension-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_sources/scripts/extension-setup.sh b/_sources/scripts/extension-setup.sh index cf86ba0e..6cd0bbe3 100644 --- a/_sources/scripts/extension-setup.sh +++ b/_sources/scripts/extension-setup.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash MW_HOME="$MW_HOME" MW_VERSION="$MW_VERSION" From f5bf98ce8f1543fcf1258f1fe6ccefef7de10924 Mon Sep 17 00:00:00 2001 From: Jeffrey Wang Date: Sun, 14 Apr 2024 21:02:09 -0700 Subject: [PATCH 54/78] Canasta 2.0.1 - MediaWiki 1.39.7 (#385) * Update to MediaWiki 1.39.7 * Update VERSION to 2.0.1 --- Dockerfile | 2 +- VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7cdca010..024f76c7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ LABEL maintainers="" LABEL org.opencontainers.image.source=https://github.com/CanastaWiki/Canasta ENV MW_VERSION=REL1_39 \ - MW_CORE_VERSION=1.39.6 \ + MW_CORE_VERSION=1.39.7 \ WWW_ROOT=/var/www/mediawiki \ MW_HOME=/var/www/mediawiki/w \ MW_ORIGIN_FILES=/mw_origin_files \ diff --git a/VERSION b/VERSION index 227cea21..38f77a65 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.0 +2.0.1 From e3428b79db1151dbabd3f039b3e9f1e28c22d3ea Mon Sep 17 00:00:00 2001 From: Naresh Kumar Date: Mon, 15 Apr 2024 18:10:55 +0530 Subject: [PATCH 55/78] Upgrade PHP7.4 to PHP8.1 (#379) * Rebase PHP8.1 changes with master * Rebase PHP8.1 changes with master * Create bug_report.md Inspired by the Citizen skin's GitHub issue templates * Create feature_request.md * Create extension_request.md * Create support_request.md * Canasta 2.0.1 - MediaWiki 1.39.7 (#385) * Update to MediaWiki 1.39.7 * Update VERSION to 2.0.1 --------- Co-authored-by: Jeffrey Wang --- Dockerfile | 47 +++++++++++++++-------------- _sources/configs/extensions.yaml | 8 ++--- _sources/configs/php-fpm-www.conf | 2 +- _sources/scripts/extension-setup.sh | 2 +- _sources/scripts/run-php-fpm.sh | 2 +- 5 files changed, 32 insertions(+), 29 deletions(-) diff --git a/Dockerfile b/Dockerfile index 024f76c7..f2a30e65 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,6 +28,7 @@ RUN set x; \ apt-transport-https \ ca-certificates \ wget \ + lsb-release \ imagemagick \ librsvg2-bin \ python3-pygments \ @@ -45,23 +46,25 @@ RUN set x; \ rsync \ lynx \ poppler-utils \ + && wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg \ + && echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php.list \ && aptitude update \ && aptitude install -y \ - php7.4 \ - php7.4-mysql \ - php7.4-cli \ - php7.4-gd \ - php7.4-mbstring \ - php7.4-xml \ - php7.4-mysql \ - php7.4-intl \ - php7.4-opcache \ - php7.4-apcu \ - php7.4-redis \ - php7.4-curl \ - php7.4-zip \ - php7.4-fpm \ - php7.4-yaml \ + php8.1 \ + php8.1-mysql \ + php8.1-cli \ + php8.1-gd \ + php8.1-mbstring \ + php8.1-xml \ + php8.1-mysql \ + php8.1-intl \ + php8.1-opcache \ + php8.1-apcu \ + php8.1-redis \ + php8.1-curl \ + php8.1-zip \ + php8.1-fpm \ + php8.1-yaml \ libapache2-mod-fcgid \ && aptitude clean \ && rm -rf /var/lib/apt/lists/* @@ -76,7 +79,7 @@ RUN set -x; \ && a2enmod rewrite \ # enabling mpm_event and php-fpm && a2dismod mpm_prefork \ - && a2enconf php7.4-fpm \ + && a2enconf php8.1-fpm \ && a2enmod mpm_event \ && a2enmod proxy_fcgi \ # Create directories @@ -225,11 +228,11 @@ ENV MW_ENABLE_JOB_RUNNER=true \ COPY _sources/configs/msmtprc /etc/ COPY _sources/configs/mediawiki.conf /etc/apache2/sites-enabled/ COPY _sources/configs/status.conf /etc/apache2/mods-available/ -COPY _sources/configs/php_error_reporting.ini _sources/configs/php_upload_max_filesize.ini /etc/php/7.4/cli/conf.d/ -COPY _sources/configs/php_error_reporting.ini _sources/configs/php_upload_max_filesize.ini /etc/php/7.4/fpm/conf.d/ -COPY _sources/configs/php_max_input_vars.ini _sources/configs/php_max_input_vars.ini /etc/php/7.4/fpm/conf.d/ -COPY _sources/configs/php_timeouts.ini /etc/php/7.4/fpm/conf.d/ -COPY _sources/configs/php-fpm-www.conf /etc/php/7.4/fpm/pool.d/www.conf +COPY _sources/configs/php_error_reporting.ini _sources/configs/php_upload_max_filesize.ini /etc/php/8.1/cli/conf.d/ +COPY _sources/configs/php_error_reporting.ini _sources/configs/php_upload_max_filesize.ini /etc/php/8.1/fpm/conf.d/ +COPY _sources/configs/php_max_input_vars.ini _sources/configs/php_max_input_vars.ini /etc/php/8.1/fpm/conf.d/ +COPY _sources/configs/php_timeouts.ini /etc/php/8.1/fpm/conf.d/ +COPY _sources/configs/php-fpm-www.conf /etc/php/8.1/fpm/pool.d/www.conf COPY _sources/scripts/*.sh / COPY _sources/scripts/maintenance-scripts/*.sh /maintenance-scripts/ COPY _sources/scripts/*.php $MW_HOME/maintenance/ @@ -259,7 +262,7 @@ RUN set -x; \ && a2enmod expires \ && a2disconf other-vhosts-access-log \ # Enable environment variables for FPM workers - && sed -i '/clear_env/s/^;//' /etc/php/7.4/fpm/pool.d/www.conf + && sed -i '/clear_env/s/^;//' /etc/php/8.1/fpm/pool.d/www.conf COPY _sources/images/Powered-by-Canasta.png /var/www/mediawiki/w/resources/assets/ diff --git a/_sources/configs/extensions.yaml b/_sources/configs/extensions.yaml index ead54e82..dbe47306 100644 --- a/_sources/configs/extensions.yaml +++ b/_sources/configs/extensions.yaml @@ -29,7 +29,7 @@ extensions: commit: d53357a6839e94800a617de4fc451b6c64d0a1c8 - Cargo: branch: master - commit: 7e8ea881cdb41e79687d059670fc68872a6a892c # v. 3.4.2 + commit: a2865938165c1389d852df762f8c85073859e5dd # v. 3.5.1 - CharInsert: commit: 54c0f0ca9119a3ce791fb5d53edd4ec32035a5c5 - CheckUser: @@ -169,7 +169,7 @@ extensions: commit: 28482410564e38d2b97ab7321e99c4281c6e5877 - PageForms: branch: master - commit: f90d67ecc2c111e82db454c71592c83384ff9704 # v. 5.6.1 + commit: b3be227fa9650f1a165ab1cc549100f643646714 # v. 5.7.2 - PluggableAuth: commit: 4be1e402e1862d165a4feb003c492ddc9525057e - Popups: @@ -209,7 +209,7 @@ extensions: commit: 4b56baa752401b4ff9fe555fd57fc5c3309601d4 - SemanticMediaWiki: repository: https://github.com/SemanticMediaWiki/SemanticMediaWiki - commit: 5c94879171d5f741b896828c25a9f2bb07a03dff # v. 4.1.2 + commit: b5e2afe11991fe21a335cb90426de24b85bc9fe7 # v. 4.1.3 - SemanticResultFormats: repository: https://github.com/SemanticMediaWiki/SemanticResultFormats commit: d5196722a56f9b65475be68d1e97063d7b975cb9 # v. 4.0.2 @@ -271,7 +271,7 @@ extensions: commit: 183bb7a8f78cbe365bec0fbd4b3ecdd4fae1a359 - UserPageViewTracker: branch: master - commit: f4b7c20c372165541164d449c12df1e74e98ed0b # v. 0.7 + commit: 276ead8fb0ecaa4c77b587267aa52e17de81c542 # v. 0.8 - Variables: commit: b4a9063f16a928567e3b6788cda9246c2e94797f - VEForAll: diff --git a/_sources/configs/php-fpm-www.conf b/_sources/configs/php-fpm-www.conf index 7ef7afc5..14e599c4 100644 --- a/_sources/configs/php-fpm-www.conf +++ b/_sources/configs/php-fpm-www.conf @@ -33,7 +33,7 @@ group = "${WWW_GROUP}" ; (IPv6 and IPv4-mapped) on a specific port; ; '/path/to/unix/socket' - to listen on a unix socket. ; Note: This value is mandatory. -listen = /run/php/php7.4-fpm.sock +listen = /run/php/php8.1-fpm.sock ; Set listen(2) backlog. ; Default Value: 511 (-1 on FreeBSD and OpenBSD) diff --git a/_sources/scripts/extension-setup.sh b/_sources/scripts/extension-setup.sh index 6cd0bbe3..e8671423 100644 --- a/_sources/scripts/extension-setup.sh +++ b/_sources/scripts/extension-setup.sh @@ -3,7 +3,7 @@ MW_HOME="$MW_HOME" MW_VERSION="$MW_VERSION" # Since yq cannot process data from variables, a conversion is made to JSON format to utilise jq. -commands=$(yq eval '. | to_json' extensions.yaml) +commands=$(yq eval '. | to_json' /tmp/extensions.yaml) echo "$commands" | jq -r '.extensions' | jq -c '.[]' | while read -r obj; do extension_data=$(echo "$obj" | jq -r 'keys_unsorted[] as $key | select(has($key)) | "\($key) \(.[$key].repository) \(.[$key].commit) \(.[$key].branch)"') read -r extension_name repository commit branch <<< "$extension_data" diff --git a/_sources/scripts/run-php-fpm.sh b/_sources/scripts/run-php-fpm.sh index 9dc5f3f3..8df9ec1e 100755 --- a/_sources/scripts/run-php-fpm.sh +++ b/_sources/scripts/run-php-fpm.sh @@ -5,4 +5,4 @@ set -x echo "starting php-fpm" # Running php-fpm mkdir -p /run/php -exec /usr/sbin/php-fpm7.4 \ No newline at end of file +exec /usr/sbin/php-fpm8.1 \ No newline at end of file From 98fd549344746aa8b673bc9a11a508ae24f05822 Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Sun, 5 May 2024 04:04:35 -0400 Subject: [PATCH 56/78] Add exception for Special:Random fixes #400 --- _sources/configs/default.vcl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/_sources/configs/default.vcl b/_sources/configs/default.vcl index cee890bd..645bb94f 100644 --- a/_sources/configs/default.vcl +++ b/_sources/configs/default.vcl @@ -54,7 +54,12 @@ sub vcl_recv { if (req.url ~ "/w/api.php") { return(pass); } - + + # Bypass cache for "Special:Random" + if (req.url ~ "^/(w/index\.php\?title=|wiki/)Special:Random") { + return (pass); + } + call mobile_detect; # Pass requests from logged-in users directly. From b3a87ea24ec706ba48a0b2edf3288592ac7336d1 Mon Sep 17 00:00:00 2001 From: Yaron Koren Date: Thu, 6 Jun 2024 12:40:48 -0400 Subject: [PATCH 57/78] Update PluggableAuth to v. 7.0 (#397) Fixes #391. This requires updating five extensions in all: PluggableAuth, LDAPAuthentication2, OpenID Connect, WSOAuth, and (because the updated version of LDAPAuthentication2 requires an updated version of it) LDAPProvider. For all five of these, the seemingly working new version can still be found in the REL1_39 branch, so there was no need to switch to master for any of them. --- _sources/configs/extensions.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/_sources/configs/extensions.yaml b/_sources/configs/extensions.yaml index dbe47306..766b5072 100644 --- a/_sources/configs/extensions.yaml +++ b/_sources/configs/extensions.yaml @@ -113,11 +113,11 @@ extensions: - LabeledSectionTransclusion: commit: 187abfeaafbad35eed4254f7a7ee0638980e932a - LDAPAuthentication2: - commit: 6bc584893d3157d5180e0e3ed93c3dbbc5b93056 + commit: 125b09a026274bea480967f6ac04882abdc65ca2 - LDAPAuthorization: commit: e6815d29c22f4b4eb85f868372a729ad49d7d3c8 - LDAPProvider: - commit: 80f8cc8156b0cd250d0dfacd9378ed0db7c2091d + commit: 12bd83836c2337ea6569317be98c0cf82a924930 - Lingo: commit: a291fa25822097a4a2aefff242a876edadb535a4 - LinkSuggest: @@ -164,14 +164,14 @@ extensions: - OpenGraphMeta: commit: d319702cd4ceda1967c233ef8e021b67b3fc355f - OpenIDConnect: - commit: 0824f3cf3800f63e930abf0f03baf1a7c755a270 + commit: f193befe9d66249e694fcdaa7b1b2afbf4a2ffde - PageExchange: commit: 28482410564e38d2b97ab7321e99c4281c6e5877 - PageForms: branch: master commit: b3be227fa9650f1a165ab1cc549100f643646714 # v. 5.7.2 - PluggableAuth: - commit: 4be1e402e1862d165a4feb003c492ddc9525057e + commit: 1884a127cd5947ad7484d3b55711db3f6515d439 - Popups: commit: ff4d2156e1f7f4c11f7396cb0cd70d387abd8187 - RegularTooltips: @@ -292,4 +292,4 @@ extensions: - WikiSEO: commit: 610cffa3345333b53d4dda7b55b2012fbfcee9de - WSOAuth: - commit: 3c54c4899dd63989bc3214273bf1c5807c7ac5db + commit: e549b520c2916322323fe83f6b792c013043f61d From ed9cd06039ac0f890dee1a0dad1846483300a160 Mon Sep 17 00:00:00 2001 From: Naresh Kumar Babu Date: Thu, 13 Jun 2024 20:03:15 +0530 Subject: [PATCH 58/78] Add PHP script for extensions and skins setup (#390) * Move skins setup to skins.yaml and add shell script for execution * Move skins setup to skins.yaml and add shell script for execution * Move skins setup to skins.yaml and add shell script for execution * Move skins setup to skins.yaml and add shell script for execution * Use php script for extensions and skins setup (earlier - shell) * Use php script for extensions and skins setup (earlier - shell) * Use php script for extensions and skins setup (earlier - shell) --- Dockerfile | 36 +++----------------- _sources/configs/skins.yaml | 17 ++++++++++ _sources/scripts/extension-setup.sh | 30 ----------------- _sources/scripts/extensions-skins.php | 47 +++++++++++++++++++++++++++ 4 files changed, 68 insertions(+), 62 deletions(-) create mode 100644 _sources/configs/skins.yaml delete mode 100644 _sources/scripts/extension-setup.sh create mode 100644 _sources/scripts/extensions-skins.php diff --git a/Dockerfile b/Dockerfile index f2a30e65..f9de54bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -103,30 +103,10 @@ RUN set -x; \ # Skins # The Minerva Neue, MonoBook, Timeless, Vector and Vector 2022 skins are bundled into MediaWiki and do not need to be # separately installed. -RUN set -x; \ - cd $MW_HOME/skins \ - # Chameleon (v. 4.2.1) - && git clone https://github.com/ProfessionalWiki/chameleon $MW_HOME/skins/chameleon \ - && cd $MW_HOME/skins/chameleon \ - && git checkout -q f34a56528ada14ac07e1b03beda41f775ef27606 \ - # CologneBlue - && git clone -b $MW_VERSION --single-branch https://github.com/wikimedia/mediawiki-skins-CologneBlue $MW_HOME/skins/CologneBlue \ - && cd $MW_HOME/skins/CologneBlue \ - && git checkout -q 4d588eb78d7e64e574f631c5897579537305437d \ - # Modern - && git clone -b $MW_VERSION --single-branch https://github.com/wikimedia/mediawiki-skins-Modern $MW_HOME/skins/Modern \ - && cd $MW_HOME/skins/Modern \ - && git checkout -q fb6c2831b5f150e9b82d98d661710695a2d0f8f2 \ - # Pivot - && git clone -b v2.3.0 https://github.com/wikimedia/mediawiki-skins-Pivot $MW_HOME/skins/pivot \ - && cd $MW_HOME/skins/pivot \ - && git checkout -q d79af7514347eb5272936243d4013118354c85c1 \ - # Refreshed - && git clone -b $MW_VERSION --single-branch https://github.com/wikimedia/mediawiki-skins-Refreshed $MW_HOME/skins/Refreshed \ - && cd $MW_HOME/skins/Refreshed \ - && git checkout -q 86f33620f25335eb62289aa18d342ff3b980d8b8 - +COPY _sources/scripts/extensions-skins.php /tmp/extensions-skins.php COPY _sources/patches/* /tmp/ +COPY _sources/configs/skins.yaml /tmp/skins.yaml +RUN php /tmp/extensions-skins.php "skins" "/tmp/skins.yaml" # Extensions # The following extensions are bundled into MediaWiki and do not need to be separately installed: @@ -136,16 +116,8 @@ COPY _sources/patches/* /tmp/ # VisualEditor, WikiEditor. # The following extensions are downloaded via Composer and also do not need to be downloaded here: # Bootstrap, DataValues (and related extensions like DataValuesCommon), ParserHooks. -COPY _sources/scripts/extension-setup.sh /tmp/extension-setup.sh COPY _sources/configs/extensions.yaml /tmp/extensions.yaml -RUN wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -RUN chmod a+x /usr/local/bin/yq -RUN set -x; \ - apt-get update \ - && apt-get install -y jq \ - && chmod +x /tmp/extension-setup.sh - -RUN /tmp/extension-setup.sh +RUN php /tmp/extensions-skins.php "extensions" "/tmp/extensions.yaml" # Patch composer RUN set -x; \ diff --git a/_sources/configs/skins.yaml b/_sources/configs/skins.yaml new file mode 100644 index 00000000..d7a76703 --- /dev/null +++ b/_sources/configs/skins.yaml @@ -0,0 +1,17 @@ +# Canasta YAML file for skins for MediaWiki 1.39. +# Where the repository is not specified, the Wikimedia Git repository for the +# skins with that name is used, and the default branch used is REL1_39. +# Where the repository *is* specified, the default branch used is master. +skins: + - Chameleon: + commit: f34a56528ada14ac07e1b03beda41f775ef27606 # v. 4.2.1 + repository: https://github.com/ProfessionalWiki/chameleon + - CologneBlue: + commit: 4d588eb78d7e64e574f631c5897579537305437d + - Modern: + commit: fb6c2831b5f150e9b82d98d661710695a2d0f8f2 + - Pivot: + branch: v2.3.0 + commit: d79af7514347eb5272936243d4013118354c85c1 + - Refreshed: + commit: 86f33620f25335eb62289aa18d342ff3b980d8b8 \ No newline at end of file diff --git a/_sources/scripts/extension-setup.sh b/_sources/scripts/extension-setup.sh deleted file mode 100644 index e8671423..00000000 --- a/_sources/scripts/extension-setup.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -MW_HOME="$MW_HOME" -MW_VERSION="$MW_VERSION" -# Since yq cannot process data from variables, a conversion is made to JSON format to utilise jq. -commands=$(yq eval '. | to_json' /tmp/extensions.yaml) -echo "$commands" | jq -r '.extensions' | jq -c '.[]' | while read -r obj; do - extension_data=$(echo "$obj" | jq -r 'keys_unsorted[] as $key | select(has($key)) | "\($key) \(.[$key].repository) \(.[$key].commit) \(.[$key].branch)"') - read -r extension_name repository commit branch <<< "$extension_data" - - git_clone_cmd="git clone " - if [ "$repository" == "null" ]; then - repository="https://github.com/wikimedia/mediawiki-extensions-$extension_name" - if [ "$branch" == "null" ]; then - branch=$MW_VERSION - git_clone_cmd="$git_clone_cmd --single-branch -b $branch" - fi - fi - git_clone_cmd="$git_clone_cmd $repository $MW_HOME/extensions/$extension_name" - git_checkout_cmd="cd $MW_HOME/extensions/$extension_name && git checkout -q $commit" - - eval "$git_clone_cmd && $git_checkout_cmd" - patches=$(echo "$obj" | jq -r ".$extension_name.patches") - if [ "$patches" != "null" ]; then - echo "$patches" | jq -c '.[]' | while read -r patch; do - git_apply_cmd="cd $MW_HOME/extensions/$extension_name && git apply /tmp/$patch" - eval "$git_apply_cmd" - done - fi -done diff --git a/_sources/scripts/extensions-skins.php b/_sources/scripts/extensions-skins.php new file mode 100644 index 00000000..0d57dac2 --- /dev/null +++ b/_sources/scripts/extensions-skins.php @@ -0,0 +1,47 @@ + + From 9b933e54ba5edf0078d51052c87d6c1a09084bb0 Mon Sep 17 00:00:00 2001 From: Naresh Kumar Babu Date: Thu, 13 Jun 2024 20:04:00 +0530 Subject: [PATCH 59/78] Update the Maps extension (->clearState()) (#395) --- _sources/configs/extensions.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_sources/configs/extensions.yaml b/_sources/configs/extensions.yaml index 766b5072..33c49f9e 100644 --- a/_sources/configs/extensions.yaml +++ b/_sources/configs/extensions.yaml @@ -138,7 +138,7 @@ extensions: commit: 93534c12dac0e821c46c94b21053d274a6e557de - Maps: repository: https://github.com/ProfessionalWiki/Maps - commit: 9b01a6bbd8e0d4277c152b7343efccae28b54d1c + commit: 7175b47e3b2cbbfcd55c6bd896f4e8403dc03d33 - MassMessage: commit: d6a86291bb975c3dc7778f370006f1145cc834bd - MassMessageEmail: From f530a87ee990215cbbbefdee1a12aaec8b39a524 Mon Sep 17 00:00:00 2001 From: Naresh Kumar Babu Date: Thu, 20 Jun 2024 17:30:04 +0530 Subject: [PATCH 60/78] Fixes commit SHA length for master branch builds (#394) --- .github/workflows/docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 2ba1984e..57e6a8a1 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -97,7 +97,7 @@ jobs: echo REGISTRY_TAGS=$REGISTRY_TAGS echo headref=${{ github.head_ref }} - SHA_SHORT=${{ github.sha }} + SHA_SHORT=$(echo ${{ github.sha }} | cut -c1-8) [ "${{ github.event_name }}" == "pull_request" ] && SHA_SHORT=$(echo ${{ github.event.pull_request.head.sha }} | cut -c1-8) echo "Final image tag to be pushed:" From adbbc8a909413290f4a6f0ae7fec12c7767747f4 Mon Sep 17 00:00:00 2001 From: Naresh Kumar Babu Date: Fri, 21 Jun 2024 23:31:45 +0530 Subject: [PATCH 61/78] changing the call a2enmod expires to a2enmod expires remoteip (#405) --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f9de54bc..5e99b511 100644 --- a/Dockerfile +++ b/Dockerfile @@ -231,7 +231,7 @@ RUN set -x; \ && sed -i '//i RewriteCond %{THE_REQUEST} \\s(.*?)\\s\nRewriteRule ^ - [E=ORIGINAL_URL:%{REQUEST_SCHEME}://%{HTTP_HOST}%1]' /etc/apache2/apache2.conf \ && echo "Alias /w/images/ /var/www/mediawiki/w/canasta_img.php/" >> /etc/apache2/apache2.conf \ && echo "Alias /w/images /var/www/mediawiki/w/canasta_img.php" >> /etc/apache2/apache2.conf \ - && a2enmod expires \ + && a2enmod expires remoteip\ && a2disconf other-vhosts-access-log \ # Enable environment variables for FPM workers && sed -i '/clear_env/s/^;//' /etc/php/8.1/fpm/pool.d/www.conf From 28764de071c9688850488f4d63daff40fcfaa923 Mon Sep 17 00:00:00 2001 From: Naresh Kumar Babu Date: Mon, 24 Jun 2024 17:38:02 +0530 Subject: [PATCH 62/78] addition of the --memory-limit flag (with a value of 512M) when calling runJobs.php (#407) * addition of the --memory-limit flag (with a value of 512M) when calling runJobs.php * Remove unrelated changes --- Dockerfile | 1 + _sources/scripts/maintenance-scripts/mw_job_runner.sh | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5e99b511..fb854489 100644 --- a/Dockerfile +++ b/Dockerfile @@ -177,6 +177,7 @@ COPY --from=source $MW_ORIGIN_FILES $MW_ORIGIN_FILES # Default values ENV MW_ENABLE_JOB_RUNNER=true \ MW_JOB_RUNNER_PAUSE=2 \ + MW_JOB_RUNNER_MEMORY_LIMIT=512M \ MW_ENABLE_TRANSCODER=true \ MW_JOB_TRANSCODER_PAUSE=60 \ MW_MAP_DOMAIN_TO_DOCKER_GATEWAY=true \ diff --git a/_sources/scripts/maintenance-scripts/mw_job_runner.sh b/_sources/scripts/maintenance-scripts/mw_job_runner.sh index 32993344..33e58437 100755 --- a/_sources/scripts/maintenance-scripts/mw_job_runner.sh +++ b/_sources/scripts/maintenance-scripts/mw_job_runner.sh @@ -22,13 +22,13 @@ if [ -f "$MW_VOLUME/config/wikis.yaml" ]; then while true; do # Job types that need to be run ASAP no matter how many of them are in the queue # Those jobs should be very "cheap" to run - php $RJ --type="enotifNotify" --server="https://$wiki_url" --wiki="$wiki_id" + php $RJ --memory-limit="$MW_JOB_RUNNER_MEMORY_LIMIT" --type="enotifNotify" --server="https://$wiki_url" --wiki="$wiki_id" sleep 1 - php $RJ --type="createPage" --server="https://$wiki_url" --wiki="$wiki_id" + php $RJ --memory-limit="$MW_JOB_RUNNER_MEMORY_LIMIT" --type="createPage" --server="https://$wiki_url" --wiki="$wiki_id" sleep 1 - php $RJ --type="refreshLinks" --server="https://$wiki_url" --wiki="$wiki_id" + php $RJ --memory-limit="$MW_JOB_RUNNER_MEMORY_LIMIT" --type="refreshLinks" --server="https://$wiki_url" --wiki="$wiki_id" sleep 1 - php $RJ --type="htmlCacheUpdate" --maxjobs=500 --server="https://$wiki_url" --wiki="$wiki_id" + php $RJ --memory-limit="$MW_JOB_RUNNER_MEMORY_LIMIT" --type="htmlCacheUpdate" --maxjobs=500 --server="https://$wiki_url" --wiki="$wiki_id" sleep 1 # Everything else, limit the number of jobs on each batch # The --wait parameter will pause the execution here until new jobs are added, From 4f386a5f93a0c648b855bd7252f8dce02a76954d Mon Sep 17 00:00:00 2001 From: Naresh Kumar Babu Date: Mon, 24 Jun 2024 17:39:10 +0530 Subject: [PATCH 63/78] addition of the waitelastic() function, which pauses setup until Elasticsearch starts running (#408) * addition of the waitelastic() function, which pauses setup until Elasticsearch starts running * Improved comment --- _sources/scripts/run-all.sh | 38 ++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/_sources/scripts/run-all.sh b/_sources/scripts/run-all.sh index 56b757ab..be1f0af2 100755 --- a/_sources/scripts/run-all.sh +++ b/_sources/scripts/run-all.sh @@ -2,6 +2,8 @@ set -x +WG_CIRRUS_SEARCH_SERVER=$(get_mediawiki_cirrus_search_server) + isTrue() { case $1 in "True" | "TRUE" | "true" | 1) @@ -137,9 +139,36 @@ waitdatabase() { fi } -#waitelastic() { -# ./wait-for-it.sh -t 60 elasticsearch:9200 -#} +waitelastic() { + if [ -n "$es_started" ]; then + return 0; # already started + fi + + echo >&2 'Waiting for elasticsearch to start' + /wait-for-it.sh -t 60 "$WG_CIRRUS_SEARCH_SERVER" + + for i in {300..0}; do + result=0 + output=$(wget --timeout=1 -q -O - "http://$WG_CIRRUS_SEARCH_SERVER/_cat/health") || result=$? + if [[ "$result" = 0 && $(echo "$output"|awk '{ print $4 }') = "green" ]]; then + break + fi + if [ "$result" = 0 ]; then + echo >&2 "Waiting for elasticsearch health status changed from [$(echo "$output"|awk '{ print $4 }')] to [green]..." + else + echo >&2 'Waiting for elasticsearch to start...' + fi + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 'Elasticsearch is not ready for use' + echo "$output" + return 1 + fi + echo >&2 'Elasticsearch started successfully' + es_started="1" + return 0 +} run_autoupdate () { echo "Running auto-update..." @@ -176,6 +205,9 @@ check_mount_points () { # Wait db waitdatabase +# Pause setup until ElasticSearch starts running +waitelastic + # Check for `user-` prefixed mounts and bow out if not found check_mount_points From cdbf912c334e795ba9d7774a88ca5d45a25bf9f7 Mon Sep 17 00:00:00 2001 From: Naresh Kumar Babu Date: Tue, 25 Jun 2024 04:05:18 +0530 Subject: [PATCH 64/78] Make MediaWiki's l10n_cache directory into a volume (#406) * making MediaWiki's cache directory into a volume * making MediaWiki's cache directory into a volume --- _sources/canasta/CanastaDefaultSettings.php | 25 +++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/_sources/canasta/CanastaDefaultSettings.php b/_sources/canasta/CanastaDefaultSettings.php index 08ebfc07..2fb32f71 100644 --- a/_sources/canasta/CanastaDefaultSettings.php +++ b/_sources/canasta/CanastaDefaultSettings.php @@ -72,6 +72,31 @@ $wgCdnServersNoPurge[] = '172.16.0.0/12'; // 172.16.0.0 – 172.31.255.255 $wgCdnServersNoPurge[] = '192.168.0.0/16'; // 192.168.0.0 – 192.168.255.255 +/** + * Returns boolean value from environment variable + * Must return the same result as isTrue function in run-apache.sh file + * @param $value + * @return bool + */ +function isEnvTrue( $name ): bool { + $value = getenv( $name ); + switch ( $value ) { + case "True": + case "TRUE": + case "true": + case "1": + return true; + } + return false; +} + +$DOCKER_MW_VOLUME = getenv( 'MW_VOLUME' ); + +## Set $wgCacheDirectory to a writable directory on the web server +## to make your wiki go slightly faster. The directory should not +## be publicly accessible from the web. +$wgCacheDirectory = isEnvTrue( 'MW_USE_CACHE_DIRECTORY' ) ? "$DOCKER_MW_VOLUME/l10n_cache" : false; + # Include user defined CommonSettings.php file if ( file_exists( $canastaCommonSettingsFilePath ) ) { require_once "$canastaCommonSettingsFilePath"; From b5fb4b13da851fad3fa15f201001203929897d54 Mon Sep 17 00:00:00 2001 From: Naresh Kumar Babu Date: Wed, 3 Jul 2024 21:35:41 +0530 Subject: [PATCH 65/78] Moving some code into the new files functions.sh and run-maintenance-scripts.sh (#410) * Moving some code into the new files functions.sh and run-maintenance-scripts.sh * Fix typo --- _sources/scripts/functions.sh | 57 ++++ _sources/scripts/run-all.sh | 142 +--------- _sources/scripts/run-maintenance-scripts.sh | 280 ++++++++++++++++++++ _sources/scripts/update-docker-gateway.sh | 20 +- 4 files changed, 342 insertions(+), 157 deletions(-) create mode 100644 _sources/scripts/functions.sh create mode 100644 _sources/scripts/run-maintenance-scripts.sh diff --git a/_sources/scripts/functions.sh b/_sources/scripts/functions.sh new file mode 100644 index 00000000..ab62fd2f --- /dev/null +++ b/_sources/scripts/functions.sh @@ -0,0 +1,57 @@ +# read variables from LocalSettings.php +get_mediawiki_variable() { + php /getMediawikiSettings.php --variable="$1" --format="${2:-string}" +} + +get_mediawiki_db_var() { + case $1 in + "wgDBtype") + I="type" + ;; + "wgDBserver") + I="host" + ;; + "wgDBname") + I="dbname" + ;; + "wgDBuser") + I="user" + ;; + "wgDBpassword") + I="password" + ;; + *) + echo "Unexpected variable name passed to the get_mediawiki_db_var() function: $1" + return + esac + VALUE=$(php /getMediawikiSettings.php --variable=wgDBservers --variableArrayIndex="[0,\"$I\"]" --format=string) + if [ -z "$VALUE" ]; then + VALUE=$(get_mediawiki_variable "$1") + fi + echo "$VALUE" +} + +isTrue() { + case $1 in + "True" | "TRUE" | "true" | 1) + return 0 + ;; + *) + return 1 + ;; + esac +} + +get_hostname_with_port() { + port=$(echo "$1" | grep ":" | cut -d":" -f2) + echo "$1:${port:-$2}" +} + +make_dir_writable() { + find "$@" '(' -type f -o -type d ')' \ + -not '(' '(' -user "$WWW_USER" -perm -u=w ')' -o \ + '(' -group "$WWW_GROUP" -perm -g=w ')' -o \ + '(' -perm -o=w ')' \ + ')' \ + -exec chgrp "$WWW_GROUP" {} \; -exec chmod g=rwX {} \; +} diff --git a/_sources/scripts/run-all.sh b/_sources/scripts/run-all.sh index be1f0af2..429971d3 100755 --- a/_sources/scripts/run-all.sh +++ b/_sources/scripts/run-all.sh @@ -2,55 +2,7 @@ set -x -WG_CIRRUS_SEARCH_SERVER=$(get_mediawiki_cirrus_search_server) - -isTrue() { - case $1 in - "True" | "TRUE" | "true" | 1) - return 0 - ;; - *) - return 1 - ;; - esac -} - -isFalse() { - case $1 in - "True" | "TRUE" | "true" | 1) - return 1 - ;; - *) - return 0 - ;; - esac -} - -dir_is_writable() { - # Use -L to get information about the target of a symlink, - # not the link itself, as pointed out in the comments - INFO=( $(stat -L -c "0%a %G %U" "$1") ) - PERM=${INFO[0]} - GROUP=${INFO[1]} - OWNER=${INFO[2]} - - if (( ($PERM & 0002) != 0 )); then - # Everyone has write access - return 0 - elif (( ($PERM & 0020) != 0 )); then - # Some group has write access. - # Is user in that group? - if [[ $GROUP == $WWW_GROUP ]]; then - return 0 - fi - elif (( ($PERM & 0200) != 0 )); then - # The owner has write access. - # Does the user own the file? - [[ $WWW_USER == $OWNER ]] && return 0 - fi - - return 1 -} +. /functions.sh # Symlink all extensions and skins (both bundled and user) /create-symlinks.sh @@ -94,88 +46,6 @@ else chmod -R g=rwX $APACHE_LOG_DIR fi -run_maintenance_scripts() { - # Iterate through all the .sh files in /maintenance-scripts/ directory - for maintenance_script in $(find /maintenance-scripts/ -maxdepth 1 -mindepth 1 -type f -name "*.sh"); do - script_name=$(basename "$maintenance_script") - - # If the script's name starts with "mw_", run it with the run_mw_script function - if [[ "$script_name" == mw* ]]; then - run_mw_script "$script_name" & - else - # If the script's name doesn't start with "mw" - echo "Running $script_name with user $WWW_USER..." - nice -n 20 runuser -c "/maintenance-scripts/$script_name" -s /bin/bash "$WWW_USER" & - fi - done -} - -# Naming convention: -# Scripts with names starting with "mw_" have corresponding enable variables. -# The enable variable is formed by converting the script's name to uppercase and replacing the first underscore with "_ENABLE_". -# For example, the enable variable for "mw_sitemap_generator.sh" would be "MW_ENABLE_SITEMAP_GENERATOR". - -run_mw_script() { - sleep 3 - - # Process the script name and create the corresponding enable variable - local script_name="$1" - script_name_no_ext="${script_name%.*}" - script_name_upper=$(basename "$script_name_no_ext" | tr '[:lower:]' '[:upper:]') - local MW_ENABLE_VAR="${script_name_upper/_/_ENABLE_}" - - if isTrue "${!MW_ENABLE_VAR}"; then - echo "Running $script_name with user $WWW_USER..." - nice -n 20 runuser -c "/maintenance-scripts/$script_name" -s /bin/bash "$WWW_USER" - else - echo >&2 "$script_name is disabled." - fi -} - - -waitdatabase() { - if isFalse "$USE_EXTERNAL_DB"; then - /wait-for-it.sh -t 60 db:3306 - fi -} - -waitelastic() { - if [ -n "$es_started" ]; then - return 0; # already started - fi - - echo >&2 'Waiting for elasticsearch to start' - /wait-for-it.sh -t 60 "$WG_CIRRUS_SEARCH_SERVER" - - for i in {300..0}; do - result=0 - output=$(wget --timeout=1 -q -O - "http://$WG_CIRRUS_SEARCH_SERVER/_cat/health") || result=$? - if [[ "$result" = 0 && $(echo "$output"|awk '{ print $4 }') = "green" ]]; then - break - fi - if [ "$result" = 0 ]; then - echo >&2 "Waiting for elasticsearch health status changed from [$(echo "$output"|awk '{ print $4 }')] to [green]..." - else - echo >&2 'Waiting for elasticsearch to start...' - fi - sleep 1 - done - if [ "$i" = 0 ]; then - echo >&2 'Elasticsearch is not ready for use' - echo "$output" - return 1 - fi - echo >&2 'Elasticsearch started successfully' - es_started="1" - return 0 -} - -run_autoupdate () { - echo "Running auto-update..." - runuser -c "php maintenance/update.php --quick" -s /bin/bash "$WWW_USER" - echo "Auto-update completed" -} - config_subdir_wikis() { echo "Configuring subdirectory wikis..." /config-subdir-wikis.sh @@ -202,12 +72,6 @@ check_mount_points () { fi } -# Wait db -waitdatabase - -# Pause setup until ElasticSearch starts running -waitelastic - # Check for `user-` prefixed mounts and bow out if not found check_mount_points @@ -227,7 +91,9 @@ fi echo "Starting services..." -run_maintenance_scripts & +# Run maintenance scripts in background. +touch "$WWW_ROOT/.maintenance" +/run-maintenance-scripts.sh & echo "Checking permissions of $MW_VOLUME/sitemap..." if dir_is_writable "$MW_VOLUME/sitemap"; then diff --git a/_sources/scripts/run-maintenance-scripts.sh b/_sources/scripts/run-maintenance-scripts.sh new file mode 100644 index 00000000..522e4678 --- /dev/null +++ b/_sources/scripts/run-maintenance-scripts.sh @@ -0,0 +1,280 @@ +#!/bin/bash + +sleep 0.02 +printf "\n\n===== run-maintenance-scripts.sh =====\n\n\n" + +set -x + +. /functions.sh + +WG_DB_TYPE=$(get_mediawiki_db_var wgDBtype) +WG_DB_SERVER=$(get_mediawiki_db_var wgDBserver) +WG_DB_NAME=$(get_mediawiki_db_var wgDBname) +WG_DB_USER=$(get_mediawiki_db_var wgDBuser) +WG_DB_PASSWORD=$(get_mediawiki_db_var wgDBpassword) +WG_SQLITE_DATA_DIR=$(get_mediawiki_variable wgSQLiteDataDir) +WG_SEARCH_TYPE=$(get_mediawiki_variable wgSearchType) +WG_CIRRUS_SEARCH_SERVER=$(get_mediawiki_cirrus_search_server) +VERSION_HASH=$(php /getMediawikiSettings.php --versions --format=md5) + +waitdatabase() { + if [ -n "$db_started" ]; then + return 0; # already started + fi + + if [ "$WG_DB_TYPE" = "sqlite" ]; then + echo >&2 "SQLite database used" + db_started="3" + return 0 + fi + + if [ "$WG_DB_TYPE" != "mysql" ]; then + echo >&2 "Unsupported database type ($WG_DB_TYPE)" + rm "$WWW_ROOT/.maintenance" + exit 123 + fi + + echo >&2 "Waiting for database to start" + /wait-for-it.sh -t 86400 "$WG_DB_SERVER:3306" + + mysql=( mysql -h "$WG_DB_SERVER" -u"$WG_DB_USER" -p"$WG_DB_PASSWORD" ) + + for i in {60..0}; do + if echo 'SELECT 1' | "${mysql[@]}" &> /dev/null; then + db_started="1" + break + fi + echo >&2 'Waiting for database to start...' + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 'Could not connect to the database.' + return 1 + fi + echo >&2 'Successfully connected to the database.' + return 0 +} + +# Pause setup until ElasticSearch starts running +waitelastic() { + if [ -n "$es_started" ]; then + return 0; # already started + fi + + echo >&2 'Waiting for elasticsearch to start' + /wait-for-it.sh -t 60 "$WG_CIRRUS_SEARCH_SERVER" + + for i in {300..0}; do + result=0 + output=$(wget --timeout=1 -q -O - "http://$WG_CIRRUS_SEARCH_SERVER/_cat/health") || result=$? + if [[ "$result" = 0 && $(echo "$output"|awk '{ print $4 }') = "green" ]]; then + break + fi + if [ "$result" = 0 ]; then + echo >&2 "Waiting for elasticsearch health status changed from [$(echo "$output"|awk '{ print $4 }')] to [green]..." + else + echo >&2 'Waiting for elasticsearch to start...' + fi + sleep 1 + done + if [ "$i" = 0 ]; then + echo >&2 'Elasticsearch is not ready for use' + echo "$output" + return 1 + fi + echo >&2 'Elasticsearch started successfully' + es_started="1" + return 0 +} + +get_tables_count() { + waitdatabase || { + return $? + } + + if [ "3" = "$db_started" ]; then + # sqlite + find "$WG_SQLITE_DATA_DIR" -type f | wc -l + return 0 + elif [ "1" = "$db_started" ]; then + db_user="$WG_DB_USER" + db_password="$WG_DB_PASSWORD" + else + db_user="$MW_DB_INSTALLDB_USER" + db_password="$MW_DB_INSTALLDB_PASS" + fi + mysql -h "$WG_DB_SERVER" -u"$db_user" -p"$db_password" -e "SELECT count(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '$WG_DB_NAME'" | sed -n 2p +} + +run_maintenance_script_if_needed () { + if [ -f "$MW_VOLUME/$1.info" ]; then + update_info="$(cat "$MW_VOLUME/$1.info" 2>/dev/null)" + else + update_info="" + fi + + if [[ "$update_info" != "$2" && -n "$2" || "$2" == "always" ]]; then + waitdatabase || { + return $? + } + if [[ "$1" == *CirrusSearch* ]]; then + waitelastic || { + return $? + } + fi + + i=3 + while [ -n "${!i}" ] + do + if [ ! -f "$(echo "${!i}" | awk '{print $1}')" ]; then + echo >&2 "Maintenance script does not exit: ${!i}" + return 0; + fi + echo >&2 "Run maintenance script: ${!i}" + runuser -c "php ${!i}" -s /bin/bash "$WWW_USER" || { + echo >&2 "An error occurred when the maintenance script ${!i} was running" + return $? + } + i=$((i+1)) + done + + echo >&2 "Successful updated: $2" + echo "$2" > "$MW_VOLUME/$1.info" + else + echo >&2 "$1 is up to date: $2." + fi +} + +run_autoupdate () { + echo >&2 'Check for the need to run maintenance scripts' + ### maintenance/update.php + SMW_UPGRADE_KEY=$(php /getMediawikiSettings.php --SMWUpgradeKey) + run_maintenance_script_if_needed 'maintenance_update' "$MW_VERSION-$MW_CORE_VERSION-$MW_MAINTENANCE_UPDATE-$VERSION_HASH-$SMW_UPGRADE_KEY" \ + 'maintenance/update.php --quick' || { + echo >&2 "An error occurred when auto-update script was running" + return $? + } + # The SMW upgrade key can be changes after running update.php + NEW_SMW_UPGRADE_KEY=$(php /getMediawikiSettings.php --SMWUpgradeKey) + if [ "$SMW_UPGRADE_KEY" != "$NEW_SMW_UPGRADE_KEY" ]; then + SMW_UPGRADE_KEY="$NEW_SMW_UPGRADE_KEY" + # update the key without running the maintenance script + run_maintenance_script_if_needed 'maintenance_update' "$MW_VERSION-$MW_CORE_VERSION-$MW_MAINTENANCE_UPDATE-$VERSION_HASH-$SMW_UPGRADE_KEY" + fi + + # Run incomplete SemanticMediawiki setup tasks + SMW_INCOMPLETE_TASKS=$(php /getMediawikiSettings.php --SWMIncompleteSetupTasks --format=space) + for task in $SMW_INCOMPLETE_TASKS + do + case $task in + smw-updateentitycollation-incomplete) + run_maintenance_script_if_needed 'maintenance_semantic_updateEntityCollation' "always" \ + 'extensions/SemanticMediaWiki/maintenance/updateEntityCollation.php' + ;; + smw-updateentitycountmap-incomplete) + run_maintenance_script_if_needed 'maintenance_semantic_updateEntityCountMap' "always" \ + 'extensions/SemanticMediaWiki/maintenance/updateEntityCountMap.php' + ;; + *) + echo >&2 "######## Unknown SMW maintenance setup task - $task ########" + ;; + esac + done + + ### CirrusSearch + if [ "$WG_SEARCH_TYPE" == 'CirrusSearch' ]; then + run_maintenance_script_if_needed 'maintenance_CirrusSearch_updateConfig' "${EXTRA_MW_MAINTENANCE_CIRRUSSEARCH_UPDATECONFIG}${MW_MAINTENANCE_CIRRUSSEARCH_UPDATECONFIG}${MW_VERSION}" \ + 'extensions/CirrusSearch/maintenance/UpdateSearchIndexConfig.php --reindexAndRemoveOk --indexIdentifier now' && \ + run_maintenance_script_if_needed 'maintenance_CirrusSearch_forceIndex' "${EXTRA_MW_MAINTENANCE_CIRRUSSEARCH_FORCEINDEX}${MW_MAINTENANCE_CIRRUSSEARCH_FORCEINDEX}${MW_VERSION}" \ + 'extensions/CirrusSearch/maintenance/ForceSearchIndex.php --skipLinks --indexOnSkip' \ + 'extensions/CirrusSearch/maintenance/ForceSearchIndex.php --skipParse' + fi + + echo >&2 "Auto-update completed" +} + +run_maintenance_scripts() { + # Iterate through all the .sh files in /maintenance-scripts/ directory + for maintenance_script in $(find /maintenance-scripts/ -maxdepth 1 -mindepth 1 -type f -name "*.sh"); do + script_name=$(basename "$maintenance_script") + + # If the script's name starts with "mw_", run it with the run_mw_script function + if [[ "$script_name" == mw* ]]; then + run_mw_script "$script_name" & + else + # If the script's name doesn't start with "mw" + echo "Running $script_name with user $WWW_USER..." + nice -n 20 runuser -c "/maintenance-scripts/$script_name" -s /bin/bash "$WWW_USER" & + fi + done +} + +# Naming convention: +# Scripts with names starting with "mw_" have corresponding enable variables. +# The enable variable is formed by converting the script's name to uppercase and replacing the first underscore with "_ENABLE_". +# For example, the enable variable for "mw_sitemap_generator.sh" would be "MW_ENABLE_SITEMAP_GENERATOR". + +run_mw_script() { + sleep 3 + + # Process the script name and create the corresponding enable variable + local script_name="$1" + script_name_no_ext="${script_name%.*}" + script_name_upper=$(basename "$script_name_no_ext" | tr '[:lower:]' '[:upper:]') + local MW_ENABLE_VAR="${script_name_upper/_/_ENABLE_}" + + if isTrue "${!MW_ENABLE_VAR}"; then + echo "Running $script_name with user $WWW_USER..." + nice -n 20 runuser -c "/maintenance-scripts/$script_name" -s /bin/bash "$WWW_USER" + else + echo >&2 "$script_name is disabled." + fi +} + +########## Run maintenance scripts ########## +echo "Checking for LocalSettings..." +if [ -e "$MW_VOLUME/config/LocalSettings.php" ] || [ -e "$MW_VOLUME/config/CommonSettings.php" ]; then + if isTrue "$MW_AUTOUPDATE"; then + waitdatabase + rm "$WWW_ROOT/.maintenance" + run_autoupdate + else + rm "$WWW_ROOT/.maintenance" + echo "Auto update script is disabled, MW_AUTOUPDATE is $MW_AUTOUPDATE"; + fi + run_maintenance_scripts +else + rm "$WWW_ROOT/.maintenance" + set +x + echo "There is no LocalSettings.php/CommonSettings.php file" + n=6 + while [ ! -e "$MW_VOLUME/config/LocalSettings.php" ] && [ ! -e "$MW_VOLUME/config/CommonSettings.php" ]; do + echo -n "#" + if [ $n -eq 0 ]; then + echo " There is no LocalSettings.php/CommonSettings.php file..." + n=6 + else + ((n--)) + fi + sleep 10 + done + + echo + echo "Found LocalSettings.php/CommonSettings.php file" + set -x + # reload variables + WG_DB_TYPE=$(get_mediawiki_db_var wgDBtype) + WG_DB_SERVER=$(get_mediawiki_db_var wgDBserver) + WG_DB_NAME=$(get_mediawiki_db_var wgDBname) + WG_DB_USER=$(get_mediawiki_db_var wgDBuser) + WG_DB_PASSWORD=$(get_mediawiki_db_var wgDBpassword) + WG_SQLITE_DATA_DIR=$(get_mediawiki_variable wgSQLiteDataDir) + WG_SEARCH_TYPE=$(get_mediawiki_variable wgSearchType) + WG_CIRRUS_SEARCH_SERVER=$(get_mediawiki_cirrus_search_server) + VERSION_HASH=$(php /getMediawikiSettings.php --versions --format=md5) + + run_maintenance_scripts +fi + +sleep 4 +printf "\n\n>>>>> run-maintenance-scripts.sh <<<<<\n\n\n" \ No newline at end of file diff --git a/_sources/scripts/update-docker-gateway.sh b/_sources/scripts/update-docker-gateway.sh index 191bf8ac..a3fbca99 100644 --- a/_sources/scripts/update-docker-gateway.sh +++ b/_sources/scripts/update-docker-gateway.sh @@ -2,25 +2,7 @@ set -x -# read variables from LocalSettings.php -get_mediawiki_variable () { - php /getMediawikiSettings.php --variable="$1" --format="${2:-string}" -} - -get_docker_gateway () { - getent hosts "gateway.docker.internal" | awk '{ print $1 }' -} - -isTrue() { - case $1 in - "True" | "TRUE" | "true" | 1) - return 0 - ;; - *) - return 1 - ;; - esac -} +. /functions.sh # Try to fetch gateway IP from extra host DOCKER_GATEWAY=$(get_docker_gateway) From 07e785b1664899fc81df810e0665a84e17c6456a Mon Sep 17 00:00:00 2001 From: Naresh Kumar Babu Date: Sat, 6 Jul 2024 01:12:14 +0530 Subject: [PATCH 66/78] Add CirrusSearch maintenance scripts (#414) --- Dockerfile | 6 +++++- _sources/scripts/functions.sh | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index fb854489..70c5e9d9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -175,7 +175,11 @@ COPY --from=source $MW_HOME $MW_HOME COPY --from=source $MW_ORIGIN_FILES $MW_ORIGIN_FILES # Default values -ENV MW_ENABLE_JOB_RUNNER=true \ +ENV MW_AUTOUPDATE=true \ + MW_MAINTENANCE_UPDATE=0 \ + MW_MAINTENANCE_CIRRUSSEARCH_UPDATECONFIG=2 \ + MW_MAINTENANCE_CIRRUSSEARCH_FORCEINDEX=2 \ + MW_ENABLE_JOB_RUNNER=true \ MW_JOB_RUNNER_PAUSE=2 \ MW_JOB_RUNNER_MEMORY_LIMIT=512M \ MW_ENABLE_TRANSCODER=true \ diff --git a/_sources/scripts/functions.sh b/_sources/scripts/functions.sh index ab62fd2f..1e99f0b3 100644 --- a/_sources/scripts/functions.sh +++ b/_sources/scripts/functions.sh @@ -47,6 +47,14 @@ get_hostname_with_port() { echo "$1:${port:-$2}" } +get_mediawiki_cirrus_search_server() { + server=$(get_mediawiki_variable wgCirrusSearchServers first) + if [ -z "$server" ]; then + server=$(php /getMediawikiSettings.php --variable=wgCirrusSearchClusters --variableArrayIndex="[\"default\",0]" --format=string) + fi + get_hostname_with_port "$server" 9200 +} + make_dir_writable() { find "$@" '(' -type f -o -type d ')' \ -not '(' '(' -user "$WWW_USER" -perm -u=w ')' -o \ From 22041ad762fba645733b052aa4983507e641c2cc Mon Sep 17 00:00:00 2001 From: Naresh Kumar Babu Date: Sun, 7 Jul 2024 23:50:37 +0530 Subject: [PATCH 67/78] Ensure that various directories are writeable (#413) * making sure that various directories are writeable, via the new function make_dir_writable() * Move image permissions update code to run-all.sh * Move image permissions update code to run-all.sh * Move image permissions update code to update-images-permissions script --- _sources/scripts/run-all.sh | 7 +++++++ _sources/scripts/update-images-permissions.sh | 11 +++++++++++ 2 files changed, 18 insertions(+) create mode 100644 _sources/scripts/update-images-permissions.sh diff --git a/_sources/scripts/run-all.sh b/_sources/scripts/run-all.sh index 429971d3..1e47024f 100755 --- a/_sources/scripts/run-all.sh +++ b/_sources/scripts/run-all.sh @@ -78,6 +78,10 @@ check_mount_points sleep 1 cd "$MW_HOME" || exit +# Check and update permissions of wiki images in background. +# It can take a long time and should not block Apache from starting. +/update-images-permissions.sh & + ########## Run maintenance scripts ########## echo "Checking for LocalSettings..." if [ -e "$MW_VOLUME/config/LocalSettings.php" ] || [ -e "$MW_VOLUME/config/CommonSettings.php" ]; then @@ -103,6 +107,9 @@ else chmod -R g=rwX $MW_VOLUME/sitemap fi +echo "Checking permissions of MediaWiki volume dir $MW_VOLUME except $MW_VOLUME/images..." +make_dir_writable "$MW_VOLUME" -not '(' -path "$MW_VOLUME/images" -prune ')' + # Running php-fpm /run-php-fpm.sh & diff --git a/_sources/scripts/update-images-permissions.sh b/_sources/scripts/update-images-permissions.sh new file mode 100644 index 00000000..4933867f --- /dev/null +++ b/_sources/scripts/update-images-permissions.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +sleep 0.01 +printf "\n\n===== update-images-permissions.sh =====\n\n\n" + +set -x + +. /functions.sh + +echo "Checking permissions of images in MediaWiki volume dir $MW_VOLUME/images..." +make_dir_writable "$MW_VOLUME/images" \ No newline at end of file From 7e57acf59b6b280ea011dc1ba5d26abbbc46520a Mon Sep 17 00:00:00 2001 From: Yaron Koren Date: Thu, 18 Jul 2024 12:10:51 -0700 Subject: [PATCH 68/78] Update to MediaWiki 1.39.8 (#419) --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 70c5e9d9..ae8dd798 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ LABEL maintainers="" LABEL org.opencontainers.image.source=https://github.com/CanastaWiki/Canasta ENV MW_VERSION=REL1_39 \ - MW_CORE_VERSION=1.39.7 \ + MW_CORE_VERSION=1.39.8 \ WWW_ROOT=/var/www/mediawiki \ MW_HOME=/var/www/mediawiki/w \ MW_ORIGIN_FILES=/mw_origin_files \ From 06e3949ac95c8db389ab6258604b9e7903653001 Mon Sep 17 00:00:00 2001 From: Naresh Kumar Babu Date: Fri, 19 Jul 2024 00:49:39 +0530 Subject: [PATCH 69/78] Make log files into volume (#420) * Make log files into volume * Make log files into volume --- Dockerfile | 3 ++ _sources/canasta/getMediawikiSettings.php | 5 +- .../maintenance-scripts/mw_job_runner.sh | 22 +++++--- .../mw_sitemap_generator.sh | 44 ++++++++------- .../maintenance-scripts/mw_transcoder.sh | 16 ++++-- _sources/scripts/run-all.sh | 53 +++++++++++++------ 6 files changed, 95 insertions(+), 48 deletions(-) diff --git a/Dockerfile b/Dockerfile index ae8dd798..6da73565 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,7 @@ ENV MW_VERSION=REL1_39 \ MW_CORE_VERSION=1.39.8 \ WWW_ROOT=/var/www/mediawiki \ MW_HOME=/var/www/mediawiki/w \ + MW_LOG=/var/log/mediawiki \ MW_ORIGIN_FILES=/mw_origin_files \ MW_VOLUME=/mediawiki \ WWW_USER=www-data \ @@ -84,6 +85,7 @@ RUN set -x; \ && a2enmod proxy_fcgi \ # Create directories && mkdir -p $MW_HOME \ + && mkdir -p $MW_LOG \ && mkdir -p $MW_ORIGIN_FILES \ && mkdir -p $MW_VOLUME @@ -223,6 +225,7 @@ COPY _sources/configs/mpm_event.conf /etc/apache2/mods-available/mpm_event.conf RUN set -x; \ chmod -v +x /*.sh \ + && chmod -v +x /maintenance-scripts/*.sh \ # Sitemap directory && ln -s $MW_VOLUME/sitemap $MW_HOME/sitemap \ # Comment out ErrorLog and CustomLog parameters, we use rotatelogs in mediawiki.conf for the log files diff --git a/_sources/canasta/getMediawikiSettings.php b/_sources/canasta/getMediawikiSettings.php index 2aaee3cf..808e162f 100644 --- a/_sources/canasta/getMediawikiSettings.php +++ b/_sources/canasta/getMediawikiSettings.php @@ -1,6 +1,7 @@ > "$logfileNow" # Job types that need to be run ASAP no matter how many of them are in the queue # Those jobs should be very "cheap" to run - php $RJ --memory-limit="$MW_JOB_RUNNER_MEMORY_LIMIT" --type="enotifNotify" --server="https://$wiki_url" --wiki="$wiki_id" + php $RJ --memory-limit="$MW_JOB_RUNNER_MEMORY_LIMIT" --type="enotifNotify" --server="https://$wiki_url" --wiki="$wiki_id" >> "$logfileNow" 2>&1 sleep 1 - php $RJ --memory-limit="$MW_JOB_RUNNER_MEMORY_LIMIT" --type="createPage" --server="https://$wiki_url" --wiki="$wiki_id" + php $RJ --memory-limit="$MW_JOB_RUNNER_MEMORY_LIMIT" --type="createPage" --server="https://$wiki_url" --wiki="$wiki_id" >> "$logfileNow" 2>&1 sleep 1 - php $RJ --memory-limit="$MW_JOB_RUNNER_MEMORY_LIMIT" --type="refreshLinks" --server="https://$wiki_url" --wiki="$wiki_id" + php $RJ --memory-limit="$MW_JOB_RUNNER_MEMORY_LIMIT" --type="refreshLinks" --server="https://$wiki_url" --wiki="$wiki_id" >> "$logfileNow" 2>&1 sleep 1 - php $RJ --memory-limit="$MW_JOB_RUNNER_MEMORY_LIMIT" --type="htmlCacheUpdate" --maxjobs=500 --server="https://$wiki_url" --wiki="$wiki_id" + php $RJ --memory-limit="$MW_JOB_RUNNER_MEMORY_LIMIT" --type="htmlCacheUpdate" --maxjobs=500 --server="https://$wiki_url" --wiki="$wiki_id" >> "$logfileNow" 2>&1 sleep 1 # Everything else, limit the number of jobs on each batch # The --wait parameter will pause the execution here until new jobs are added, # to avoid running the loop without anything to do - php $RJ --maxjobs=10 --server="https://$wiki_url" --wiki="$wiki_id" + php $RJ --maxjobs=10 --server="https://$wiki_url" --wiki="$wiki_id" >> "$logfileNow" 2>&1 # Wait some seconds to let the CPU do other things, like handling web requests, etc - echo mwjobrunner waits for "$MW_JOB_RUNNER_PAUSE" seconds... + echo mwjobrunner waits for "$MW_JOB_RUNNER_PAUSE" seconds... >> "$logfileNow" sleep "$MW_JOB_RUNNER_PAUSE" done } & diff --git a/_sources/scripts/maintenance-scripts/mw_sitemap_generator.sh b/_sources/scripts/maintenance-scripts/mw_sitemap_generator.sh index fed66e8d..2db8b1cb 100755 --- a/_sources/scripts/maintenance-scripts/mw_sitemap_generator.sh +++ b/_sources/scripts/maintenance-scripts/mw_sitemap_generator.sh @@ -1,53 +1,61 @@ #!/bin/bash -# read variables from LocalSettings.php -if [ -z "$MW_SCRIPT_PATH" ]; then - MW_SCRIPT_PATH=$(php /getMediawikiSettings.php --variable=wgScriptPath --format=string) -fi -if [ -z "$MW_SCRIPT_PATH" ]; then - MW_SCRIPT_PATH="/w" -fi +. /functions.sh SCRIPT=$MW_HOME/maintenance/generateSitemap.php +logfileName=mwsitemapgen_log + # Verify the delay is >= 1, otherwise fall back to 1 if [ "$MW_SITEMAP_PAUSE_DAYS" -lt "1" ]; then MW_SITEMAP_PAUSE_DAYS=1 fi # Convert to seconds (suffixed sleep command has issues on OSX) -SLEEPDAYS=$(expr $MW_SITEMAP_PAUSE_DAYS \* 60 \* 60 \* 24) +SLEEP_DAYS=$((MW_SITEMAP_PAUSE_DAYS * 60 * 60 * 24)) -SITE_SERVER=$MW_SITE_SERVER +SITE_SERVER=$(get_mediawiki_variable wgServer) # Fallback to https:// scheme if it's protocol-relative if [[ $SITE_SERVER == "//"* ]]; then SITE_SERVER="https:$SITE_SERVER" fi +SCRIPT_PATH=$(get_mediawiki_variable wgScriptPath) + # Adds slash to sitemap dir if it's not empty and has no starting slash SITEMAP_DIR=$MW_SITEMAP_SUBDIR if [[ -n "$SITEMAP_DIR" && "$SITEMAP_DIR" != "/"* ]]; then SITEMAP_DIR="/$SITEMAP_DIR" fi -GOOGLE_PING_URL="https://www.google.com/ping?sitemap=${SITE_SERVER}${MW_SCRIPT_PATH}/sitemap${SITEMAP_DIR}/sitemap-index-${MW_SITEMAP_IDENTIFIER}.xml" +GOOGLE_PING_URL="https://www.google.com/ping?sitemap=${SITE_SERVER}${SCRIPT_PATH}/sitemap${SITEMAP_DIR}/sitemap-index-${MW_SITEMAP_IDENTIFIER}.xml" -echo Starting sitemap generator... +echo "Starting sitemap generator (in 30 seconds)..." # Wait three minutes after the server starts up to give other processes time to get started sleep 30 echo Sitemap generator started. while true; do - php $SCRIPT \ - --fspath=$MW_HOME/sitemap/$MW_SITEMAP_SUBDIR \ - --urlpath=$MW_SCRIPT_PATH/sitemap/$MW_SITEMAP_SUBDIR \ + logFilePrev="$logfileNow" + logfileNow="$MW_LOG/$logfileName"_$(date +%Y%m%d) + if [ -n "$logFilePrev" ] && [ "$logFilePrev" != "$logfileNow" ]; then + /rotatelogs-compress.sh "$logfileNow" "$logFilePrev" & + fi + + date >> "$logfileNow" + + # generate the sitemap + php "$SCRIPT" \ + --fspath="$MW_HOME/sitemap/$MW_SITEMAP_SUBDIR" \ + --urlpath="$SCRIPT_PATH/sitemap/$MW_SITEMAP_SUBDIR" \ --compress yes \ - --server=$MW_SITE_SERVER \ + --server="$MW_SITE_SERVER" \ --skip-redirects \ - --identifier=$MW_SITEMAP_IDENTIFIER + --identifier="$MW_SITEMAP_IDENTIFIER" \ + >> "$logfileNow" 2>&1 # sending the sitemap to google echo "sending to Google -> $GOOGLE_PING_URL" curl --silent "$GOOGLE_PING_URL" > /dev/null # Wait some seconds to let the CPU do other things, like handling web requests, etc - echo mwsitemapgen waits for "$SLEEPDAYS" seconds... - sleep "$SLEEPDAYS" + echo mwsitemapgen waits for "$SLEEP_DAYS" seconds... >> "$logfileNow" + sleep "$SLEEP_DAYS" done diff --git a/_sources/scripts/maintenance-scripts/mw_transcoder.sh b/_sources/scripts/maintenance-scripts/mw_transcoder.sh index 789a0731..c60a5f85 100755 --- a/_sources/scripts/maintenance-scripts/mw_transcoder.sh +++ b/_sources/scripts/maintenance-scripts/mw_transcoder.sh @@ -1,8 +1,9 @@ #!/bin/bash RJ=$MW_HOME/maintenance/runJobs.php +logfileName=mwtranscoder_log -echo Starting transcoder... +echo "Starting transcoder (in 180 seconds)..." # Wait three minutes after the server starts up to give other processes time to get started sleep 180 @@ -20,12 +21,19 @@ if [ -f "$MW_VOLUME/config/wikis.yaml" ]; then echo "$wiki_id transcoder started." { while true; do - php $RJ --type=webVideoTranscodePrioritized --maxjobs=10 --wiki="$wiki_id" --server="https://$wiki_url" + logFilePrev="$logfileNow" + logfileNow="$MW_LOG/$logfileName"_$(date +%Y%m%d) + if [ -n "$logFilePrev" ] && [ "$logFilePrev" != "$logfileNow" ]; then + /rotatelogs-compress.sh "$logfileNow" "$logFilePrev" & + fi + + date >> "$logfileNow" + php "$RJ" --type webVideoTranscodePrioritized --maxjobs=10 >> "$logfileNow" 2>&1 sleep 1 - php $RJ --type=webVideoTranscode --maxjobs=1 --wiki="$wiki_id" --server="https://$wiki_url" + php "$RJ" --type webVideoTranscode --maxjobs=1 >> "$logfileNow" 2>&1 # Wait some seconds to let the CPU do other things, like handling web requests, etc - echo mwtranscoder waits for "$MW_JOB_TRANSCODER_PAUSE" seconds... + echo mwtranscoder waits for "$MW_JOB_TRANSCODER_PAUSE" seconds... >> "$logfileNow" sleep "$MW_JOB_TRANSCODER_PAUSE" done } & diff --git a/_sources/scripts/run-all.sh b/_sources/scripts/run-all.sh index 1e47024f..db5ae124 100755 --- a/_sources/scripts/run-all.sh +++ b/_sources/scripts/run-all.sh @@ -4,6 +4,14 @@ set -x . /functions.sh +if ! mountpoint -q -- "$MW_VOLUME"; then + echo "Folder $MW_VOLUME contains important data and must be mounted to persistent storage!" + if ! isTrue "$MW_ALLOW_UNMOUNTED_VOLUME"; then + exit 1 + fi + echo "You allowed to continue because MW_ALLOW_UNMOUNTED_VOLUME is set as true" +fi + # Symlink all extensions and skins (both bundled and user) /create-symlinks.sh @@ -13,8 +21,8 @@ set -x # $MW_VOLUME (./extensions, ./skins, ./config, ./images), # note that this command will also set all the necessary permissions echo "Syncing files..." -rsync -ah --inplace --ignore-existing --remove-source-files \ - -og --chown=$WWW_GROUP:$WWW_USER --chmod=Fg=rw,Dg=rwx \ +rsync -ah --inplace --ignore-existing \ + -og --chown="$WWW_GROUP:$WWW_USER" --chmod=Fg=rw,Dg=rwx \ "$MW_ORIGIN_FILES"/ "$MW_VOLUME"/ # We don't need it anymore @@ -30,20 +38,27 @@ rm -rf "$MW_ORIGIN_FILES" # hence it does not perform any recursive checks and may lead to files # or directories down the tree having incorrect permissions left untouched -echo "Checking permissions of $MW_VOLUME..." -if dir_is_writable $MW_VOLUME; then - echo "Permissions are OK!" +# Write log files to $MW_VOLUME/log directory if target folders are not mounted +echo "Checking permissions of Apache log dir $APACHE_LOG_DIR..." +if ! mountpoint -q -- "$APACHE_LOG_DIR/"; then + mkdir -p "$MW_VOLUME/log/httpd" + rsync -avh --ignore-existing "$APACHE_LOG_DIR/" "$MW_VOLUME/log/httpd/" + mv "$APACHE_LOG_DIR" "${APACHE_LOG_DIR}_old" + ln -s "$MW_VOLUME/log/httpd" "$APACHE_LOG_DIR" else - chown -R "$WWW_GROUP":"$WWW_GROUP" "$MW_VOLUME" - chmod -R g=rwX "$MW_VOLUME" + chgrp -R "$WWW_GROUP" "$APACHE_LOG_DIR" + chmod -R g=rwX "$APACHE_LOG_DIR" fi -echo "Checking permissions of $APACHE_LOG_DIR..." -if dir_is_writable $APACHE_LOG_DIR; then - echo "Permissions are OK!" +echo "Checking permissions of PHP-FPM log dir $PHP_LOG_DIR..." +if ! mountpoint -q -- "$PHP_LOG_DIR/"; then + mkdir -p "$MW_VOLUME/log/php-fpm" + rsync -avh --ignore-existing "$PHP_LOG_DIR/" "$MW_VOLUME/log/php-fpm/" + mv "$PHP_LOG_DIR" "${PHP_LOG_DIR}_old" + ln -s "$MW_VOLUME/log/php-fpm" "$PHP_LOG_DIR" else - chown -R "$WWW_GROUP":"$WWW_GROUP" $APACHE_LOG_DIR - chmod -R g=rwX $APACHE_LOG_DIR + chgrp -R "$WWW_GROUP" "$PHP_LOG_DIR" + chmod -R g=rwX "$PHP_LOG_DIR" fi config_subdir_wikis() { @@ -99,12 +114,16 @@ echo "Starting services..." touch "$WWW_ROOT/.maintenance" /run-maintenance-scripts.sh & -echo "Checking permissions of $MW_VOLUME/sitemap..." -if dir_is_writable "$MW_VOLUME/sitemap"; then - echo "Permissions are OK!" +echo "Checking permissions of Mediawiki log dir $MW_LOG..." +if ! mountpoint -q -- "$MW_LOG"; then + mkdir -p "$MW_VOLUME/log/mediawiki" + rsync -avh --ignore-existing "$MW_LOG/" "$MW_VOLUME/log/mediawiki/" + mv "$MW_LOG" "${MW_LOG}_old" + ln -s "$MW_VOLUME/log/mediawiki" "$MW_LOG" + chmod -R o=rwX "$MW_VOLUME/log/mediawiki" else - chown -R "$WWW_GROUP":"$WWW_GROUP" $MW_VOLUME/sitemap - chmod -R g=rwX $MW_VOLUME/sitemap + chgrp -R "$WWW_GROUP" "$MW_LOG" + chmod -R go=rwX "$MW_LOG" fi echo "Checking permissions of MediaWiki volume dir $MW_VOLUME except $MW_VOLUME/images..." From 57fe62e673ae54411cc84ba14171b6ecbc16241b Mon Sep 17 00:00:00 2001 From: Naresh Kumar Babu Date: Fri, 19 Jul 2024 07:53:11 +0530 Subject: [PATCH 70/78] Fix validation issues (#421) --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6da73565..ec2f1309 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:11.7 as base +FROM debian:11.7 AS base LABEL maintainers="" LABEL org.opencontainers.image.source=https://github.com/CanastaWiki/Canasta @@ -94,7 +94,7 @@ RUN set -x; \ curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ && composer self-update 2.1.3 -FROM base as source +FROM base AS source # MediaWiki core RUN set -x; \ @@ -171,7 +171,7 @@ RUN set -x; \ mkdir $MW_HOME/extensions/ \ && mkdir $MW_HOME/skins/ -FROM base as final +FROM base AS final COPY --from=source $MW_HOME $MW_HOME COPY --from=source $MW_ORIGIN_FILES $MW_ORIGIN_FILES From 506b8be8a0cb11f1fee1e4a1340fa61e0a8236ff Mon Sep 17 00:00:00 2001 From: Naresh Kumar Babu Date: Wed, 31 Jul 2024 20:02:02 +0530 Subject: [PATCH 71/78] Add persistent-directories param to skin/extension YAML files (#423) * Add persistent directories param to skin/extension YAML files * Add persistent directories param to skin/extension YAML files * Add persistent directories param to skin/extension YAML files --- Dockerfile | 1 + _sources/canasta/getMediawikiSettings.php | 2 ++ _sources/configs/extensions.yaml | 4 ++++ _sources/scripts/create-symlinks.sh | 3 +++ _sources/scripts/extensions-skins.php | 11 +++++++++++ .../maintenance-scripts/monitor-directories.sh | 4 ++-- 6 files changed, 23 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index ec2f1309..32f2ee77 100644 --- a/Dockerfile +++ b/Dockerfile @@ -227,6 +227,7 @@ RUN set -x; \ chmod -v +x /*.sh \ && chmod -v +x /maintenance-scripts/*.sh \ # Sitemap directory + && mkdir -p $MW_ORIGIN_FILES/sitemap \ && ln -s $MW_VOLUME/sitemap $MW_HOME/sitemap \ # Comment out ErrorLog and CustomLog parameters, we use rotatelogs in mediawiki.conf for the log files && sed -i 's/^\(\s*ErrorLog .*\)/# \1/g' /etc/apache2/apache2.conf \ diff --git a/_sources/canasta/getMediawikiSettings.php b/_sources/canasta/getMediawikiSettings.php index 808e162f..78ca1521 100644 --- a/_sources/canasta/getMediawikiSettings.php +++ b/_sources/canasta/getMediawikiSettings.php @@ -86,6 +86,8 @@ public function execute() { SemanticMediaWiki::onExtensionFunction(); $smwId = SMW\Site::id(); $return = $GLOBALS['smw.json'][$smwId]['upgrade_key'] ?? ''; + } else { + $return = 'SMW_not_installed'; } } elseif ( $this->hasOption( 'SWMIncompleteSetupTasks' ) ) { $extThings = self::getExtensionsThings(); diff --git a/_sources/configs/extensions.yaml b/_sources/configs/extensions.yaml index 33c49f9e..900771ee 100644 --- a/_sources/configs/extensions.yaml +++ b/_sources/configs/extensions.yaml @@ -210,6 +210,8 @@ extensions: - SemanticMediaWiki: repository: https://github.com/SemanticMediaWiki/SemanticMediaWiki commit: b5e2afe11991fe21a335cb90426de24b85bc9fe7 # v. 4.1.3 + persistent-directories: + - config - SemanticResultFormats: repository: https://github.com/SemanticMediaWiki/SemanticResultFormats commit: d5196722a56f9b65475be68d1e97063d7b975cb9 # v. 4.0.2 @@ -289,6 +291,8 @@ extensions: commit: d3d63faa08b89c429a7803b283e9bb685a51b9a0 - Widgets: commit: 197d429f971b2aebbce29b7a91a194e1f8181e64 + persistent-directories: + - compiled_templates - WikiSEO: commit: 610cffa3345333b53d4dda7b55b2012fbfcee9de - WSOAuth: diff --git a/_sources/scripts/create-symlinks.sh b/_sources/scripts/create-symlinks.sh index 41f7ad47..b112500d 100644 --- a/_sources/scripts/create-symlinks.sh +++ b/_sources/scripts/create-symlinks.sh @@ -1,5 +1,8 @@ #!/bin/bash +rm -f "$MW_HOME"/extensions/* +rm -f "$MW_HOME"/skins/* + echo "Symlinking bundled extensions..." for bundled_extension_path in $(find $MW_HOME/canasta-extensions/ -maxdepth 1 -mindepth 1 -type d) do diff --git a/_sources/scripts/extensions-skins.php b/_sources/scripts/extensions-skins.php index 0d57dac2..1c35aa47 100644 --- a/_sources/scripts/extensions-skins.php +++ b/_sources/scripts/extensions-skins.php @@ -6,6 +6,8 @@ $MW_HOME = getenv("MW_HOME"); $MW_VERSION = getenv("MW_VERSION"); +$MW_VOLUME = getenv("MW_VOLUME"); +$MW_ORIGIN_FILES = getenv("MW_ORIGIN_FILES"); $type = $argv[1]; $path = $argv[2]; @@ -19,6 +21,15 @@ $commit = $data['commit'] ?? null; $branch = $data['branch'] ?? null; $patches = $data['patches'] ?? null; + $persistentDirectories = $data['persistent-directories'] ?? null; + + if ($persistentDirectories !== null) { + exec("mkdir -p $MW_ORIGIN_FILES/canasta-$type/$name"); + foreach ($directory as $persistentDirectories) { + exec("mv $MW_HOME/canasta-$type/$name/$directory $MW_ORIGIN_FILES/canasta-$type/$name/"); + exec("ln -s $MW_VOLUME/canasta-$type/$name/$directory $MW_HOME/canasta-$type/$name/$directory"); + } + } $gitCloneCmd = "git clone "; diff --git a/_sources/scripts/maintenance-scripts/monitor-directories.sh b/_sources/scripts/maintenance-scripts/monitor-directories.sh index 4a4a525f..1990a25b 100644 --- a/_sources/scripts/maintenance-scripts/monitor-directories.sh +++ b/_sources/scripts/maintenance-scripts/monitor-directories.sh @@ -29,9 +29,9 @@ inotifywait -m -e create,moved_to,delete,moved_from --format '%e:%f' -- "$usersk while IFS=: read -r event file; do case $event in CREATE,ISDIR|MOVED_TO,ISDIR) - ln -rsft skins -- "$userskins"/"$file" ;; + ln -rsft "$skins" -- "$userskins"/"$file" ;; DELETE,ISDIR|MOVED_FROM,ISDIR) echo "event: ${event} file: ${file}"; - ln -rsft skins -- "$canskins"/"$file" || rm -- "$file"; + ln -rsft "$skins" -- "$canskins"/"$file" || rm -- "$file"; esac done From 9657fb3a2bff9b976a9f3882af5c2af5cdd28949 Mon Sep 17 00:00:00 2001 From: Naresh Kumar Babu Date: Wed, 31 Jul 2024 20:02:43 +0530 Subject: [PATCH 72/78] Create l10n cache directory (#424) --- _sources/scripts/run-all.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_sources/scripts/run-all.sh b/_sources/scripts/run-all.sh index db5ae124..1e282056 100755 --- a/_sources/scripts/run-all.sh +++ b/_sources/scripts/run-all.sh @@ -25,8 +25,8 @@ rsync -ah --inplace --ignore-existing \ -og --chown="$WWW_GROUP:$WWW_USER" --chmod=Fg=rw,Dg=rwx \ "$MW_ORIGIN_FILES"/ "$MW_VOLUME"/ -# We don't need it anymore -rm -rf "$MW_ORIGIN_FILES" +# Create needed directories +mkdir -p "$MW_VOLUME"/l10n_cache /update-docker-gateway.sh From 6cd0d49da793b6e835d22c7a198da50e13d5f9b2 Mon Sep 17 00:00:00 2001 From: Naresh Kumar Babu Date: Fri, 2 Aug 2024 22:26:19 +0530 Subject: [PATCH 73/78] Update robots.txt, add ROBOTS_DISALLOWED and extra-robots.txt (#426) * Update robots.txt, add ROBOTS_DISALLOWED and extra-robots.txt * Update robots.txt, add ROBOTS_DISALLOWED and extra-robots.txt * Update robots.txt, add ROBOTS_DISALLOWED and extra-robots.txt * Update robots.txt, add ROBOTS_DISALLOWED and extra-robots.txt * Update robots.txt, add ROBOTS_DISALLOWED and extra-robots.txt --- _sources/configs/robots.php | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/_sources/configs/robots.php b/_sources/configs/robots.php index 7c653120..3efdb9df 100644 --- a/_sources/configs/robots.php +++ b/_sources/configs/robots.php @@ -5,8 +5,15 @@ ini_set( 'display_errors', 0 ); error_reporting( 0 ); +echo "# The following lines are generated by robots.php\n"; + header( 'Content-Type: text/plain' ); +$robotsDisallowed = getenv( 'ROBOTS_DISALLOWED' ); +if ( !empty( $robotsDisallowed ) && in_array( strtolower($robotsDisallowed), [ 'true', '1' ] ) ) { + die( "User-agent: *\nDisallow: /\n" ); +} + $enableSitemapEnv = getenv( 'MW_ENABLE_SITEMAP_GENERATOR'); // match the value check to the isTrue function at _sources/scripts/functions.sh if ( !empty( $enableSitemapEnv ) && in_array( $enableSitemapEnv, [ 'true', 'True', 'TRUE', '1' ] ) ) { @@ -17,11 +24,17 @@ $siteMapUrl = "$server$script/sitemap$subdir/sitemap-index-$identifier.xml"; - echo "# It generated by the robots.php file\n"; - echo "# Add the sitemap url:\n"; echo "Sitemap: $siteMapUrl\n"; - - echo "\n# Content of the robots.txt file:\n"; + echo "\n# Content of the robots.txt file:\n"; } readfile( 'robots-main.txt' ); + +// If the file `extra-robots.txt` is created under the name +// `/var/www/mediawiki/extra-robots.txt` then its contents get appended to the +// default `robots.txt` +if ( is_readable( 'extra-robots.txt' ) ) { + // Extra line to separate the files so that rules don't combine + echo "\n"; + readfile( 'extra-robots.txt' ); +} From 3ee11f7799d097fdaf070b4e6bf61f0e814b2428 Mon Sep 17 00:00:00 2001 From: Yaron Koren Date: Tue, 6 Aug 2024 18:53:15 -0700 Subject: [PATCH 74/78] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 3 ++- .github/ISSUE_TEMPLATE/extension_request.md | 10 +--------- .github/ISSUE_TEMPLATE/feature_request.md | 4 +++- .github/ISSUE_TEMPLATE/support_request.md | 1 + 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 8ae173bb..817d7303 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -2,8 +2,9 @@ name: Bug report about: Create a bug report title: '' -labels: bug +labels: bug, question assignees: '' + --- ## Describe the bug diff --git a/.github/ISSUE_TEMPLATE/extension_request.md b/.github/ISSUE_TEMPLATE/extension_request.md index af5da1d5..3b6d0da5 100644 --- a/.github/ISSUE_TEMPLATE/extension_request.md +++ b/.github/ISSUE_TEMPLATE/extension_request.md @@ -4,6 +4,7 @@ about: Propose to add or remove an extension or skin for Canasta title: '' labels: enhancement assignees: '' + --- ### Name of extension @@ -11,9 +12,6 @@ assignees: '' ### MediaWiki.org page (if it exists) https://www.mediawiki.org/wiki/Extension: -### Link to the repo -_GitHub preferred, Gerrit is fine too._ - ### Justification _Explain in a few sentences why this extension or skin should be bundled._ @@ -25,9 +23,3 @@ How many consistent maintainers are there (i.e. those who would be capable of co ### Are you the author of this extension/skin? Yes/No - -### Have you checked that this extension or skin isn't already bundled in Canasta? -Yes/No - -### (Extensions only) Have you checked there are no similar extensions to it already bundled in Canasta? -Yes/No diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 59a234d8..3f2e32fa 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,9 +1,11 @@ --- name: Feature request -about: Propose an idea for Canasta (does not include requests to add/update/remove bundled extensions or skins) +about: Propose an idea for Canasta (does not include requests to add/update/remove + bundled extensions or skins) title: '' labels: enhancement assignees: '' + --- ## The current situation diff --git a/.github/ISSUE_TEMPLATE/support_request.md b/.github/ISSUE_TEMPLATE/support_request.md index c08cd535..409ada5f 100644 --- a/.github/ISSUE_TEMPLATE/support_request.md +++ b/.github/ISSUE_TEMPLATE/support_request.md @@ -4,6 +4,7 @@ about: Get support from the community for when you are unsure if it is a bug. title: '' labels: question assignees: '' + --- ## Describe the situation From ea2ce4296ea4f9ad10c3851e8bf62e51ded9ec35 Mon Sep 17 00:00:00 2001 From: Naresh Kumar Babu Date: Tue, 27 Aug 2024 23:42:57 +0530 Subject: [PATCH 75/78] Fix chameleon installation problem (#433) --- _sources/configs/skins.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_sources/configs/skins.yaml b/_sources/configs/skins.yaml index d7a76703..67dbb193 100644 --- a/_sources/configs/skins.yaml +++ b/_sources/configs/skins.yaml @@ -3,7 +3,7 @@ # skins with that name is used, and the default branch used is REL1_39. # Where the repository *is* specified, the default branch used is master. skins: - - Chameleon: + - chameleon: commit: f34a56528ada14ac07e1b03beda41f775ef27606 # v. 4.2.1 repository: https://github.com/ProfessionalWiki/chameleon - CologneBlue: From d40ef7907209b03409ee4f14e54b4902062fc92d Mon Sep 17 00:00:00 2001 From: Naresh Kumar Babu Date: Mon, 2 Sep 2024 18:54:12 +0530 Subject: [PATCH 76/78] Add missing imports and remove unused parameter (#434) * Add missing imports * Remove unused variableArrayIndex parameter --- _sources/scripts/functions.sh | 4 ++-- _sources/scripts/run-all.sh | 1 + _sources/scripts/update-docker-gateway.sh | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/_sources/scripts/functions.sh b/_sources/scripts/functions.sh index 1e99f0b3..1542b38b 100644 --- a/_sources/scripts/functions.sh +++ b/_sources/scripts/functions.sh @@ -24,7 +24,7 @@ get_mediawiki_db_var() { echo "Unexpected variable name passed to the get_mediawiki_db_var() function: $1" return esac - VALUE=$(php /getMediawikiSettings.php --variable=wgDBservers --variableArrayIndex="[0,\"$I\"]" --format=string) + VALUE=$(php /getMediawikiSettings.php --variable=wgDBservers --format=string) if [ -z "$VALUE" ]; then VALUE=$(get_mediawiki_variable "$1") fi @@ -50,7 +50,7 @@ get_hostname_with_port() { get_mediawiki_cirrus_search_server() { server=$(get_mediawiki_variable wgCirrusSearchServers first) if [ -z "$server" ]; then - server=$(php /getMediawikiSettings.php --variable=wgCirrusSearchClusters --variableArrayIndex="[\"default\",0]" --format=string) + server=$(php /getMediawikiSettings.php --variable=wgCirrusSearchClusters --format=string) fi get_hostname_with_port "$server" 9200 } diff --git a/_sources/scripts/run-all.sh b/_sources/scripts/run-all.sh index 1e282056..05ec26cd 100755 --- a/_sources/scripts/run-all.sh +++ b/_sources/scripts/run-all.sh @@ -101,6 +101,7 @@ cd "$MW_HOME" || exit echo "Checking for LocalSettings..." if [ -e "$MW_VOLUME/config/LocalSettings.php" ] || [ -e "$MW_VOLUME/config/CommonSettings.php" ]; then # Run auto-update + . /run-maintenance-scripts.sh run_autoupdate if [ -e "$MW_VOLUME/config/wikis.yaml" ]; then config_subdir_wikis diff --git a/_sources/scripts/update-docker-gateway.sh b/_sources/scripts/update-docker-gateway.sh index a3fbca99..8aa4d4f6 100644 --- a/_sources/scripts/update-docker-gateway.sh +++ b/_sources/scripts/update-docker-gateway.sh @@ -4,6 +4,10 @@ set -x . /functions.sh +get_docker_gateway () { + getent hosts "gateway.docker.internal" | awk '{ print $1 }' +} + # Try to fetch gateway IP from extra host DOCKER_GATEWAY=$(get_docker_gateway) From a354e01872f1188a5ac69c1579bf63fa1afaf41e Mon Sep 17 00:00:00 2001 From: CyberLynx Date: Fri, 11 Oct 2024 12:46:23 +0200 Subject: [PATCH 77/78] Updated version to 1.39.10 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 32f2ee77..ad399d93 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ LABEL maintainers="" LABEL org.opencontainers.image.source=https://github.com/CanastaWiki/Canasta ENV MW_VERSION=REL1_39 \ - MW_CORE_VERSION=1.39.8 \ + MW_CORE_VERSION=1.39.10 \ WWW_ROOT=/var/www/mediawiki \ MW_HOME=/var/www/mediawiki/w \ MW_LOG=/var/log/mediawiki \ From 78217f1778095cb62a238f4683bc26b1c059ef2c Mon Sep 17 00:00:00 2001 From: CyberLynx Date: Fri, 11 Oct 2024 13:36:10 +0200 Subject: [PATCH 78/78] Updated core to 1.39.10 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 32f2ee77..ad399d93 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ LABEL maintainers="" LABEL org.opencontainers.image.source=https://github.com/CanastaWiki/Canasta ENV MW_VERSION=REL1_39 \ - MW_CORE_VERSION=1.39.8 \ + MW_CORE_VERSION=1.39.10 \ WWW_ROOT=/var/www/mediawiki \ MW_HOME=/var/www/mediawiki/w \ MW_LOG=/var/log/mediawiki \