-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move LocalSetting.d from portal-compose to this repo #193
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe changes introduce a set of new configuration files and updates for a MediaWiki deployment. A Dockerfile update copies the new configuration directory into the container, and numerous PHP configuration files under the LocalSettings.d directory have been added. These files load various MediaWiki extensions, set up database connections, customize site skins, define namespaces, and configure authentication, search, analytics, and Wikibase integration. Conditional logic in some files ensures settings are applied only under specific conditions (e.g., based on the database name). Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant D as Docker Build
participant MW as MediaWiki Container
participant CF as Config Files
participant EX as Extensions Loader
Dev->>D: Commit changes (Dockerfile & LocalSettings.d/*)
D->>MW: Copy LocalSettings.d into container
MW->>CF: Read configuration files during startup
loop For each config file
CF->>EX: Invoke wfLoadExtension / set parameters
EX-->>CF: Extension loaded & configured
end
MW->>Dev: Wiki ready with updated extensions & settings
Poem
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 12
🧹 Nitpick comments (35)
LocalSettings.d/MathSearch.php (1)
3-3
: Add an Explanatory Comment for the Configuration Variable.
The new configuration variable$wgMathSearchContentTexMaxLength
is defined with a value of30000
, which sets the maximum length for MathSearch content processing. For improved clarity and maintainability, consider adding a comment above this assignment explaining its purpose and any relevant units or context.Example Diff to Add an Explanatory Comment:
-<?php - -$wgMathSearchContentTexMaxLength = 30000; +<?php + +// Set the maximum allowed length for MathSearch content (in characters). +$wgMathSearchContentTexMaxLength = 30000;LocalSettings.d/Shibboleth.php (1)
1-4
: File: Shibboleth.php Initial Setup
The new file is structured correctly with the PHP opening tag and includes an informational link to the extension's documentation. The commented-outwfLoadExtension('Shibboleth')
indicates that the extension is not activated by default, which is acceptable if manual activation is intended.Consider adding a note or clarifying comment on when or how to enable the extension if it might cause confusion later.
LocalSettings.d/DisplayTitle.php (1)
1-7
: Configuration looks good, with a minor formatting suggestion.The file correctly configures the DisplayTitle extension, which allows customizing how page titles are displayed and used in links. The comments clearly explain the purpose and include helpful documentation links.
One minor formatting suggestion:
-$wgRestrictDisplayTitle=false; +$wgRestrictDisplayTitle = false;Adding spaces around the equals sign would better align with MediaWiki coding conventions, improving readability and consistency.
LocalSettings.d/MSC_classification.php (1)
1-14
: Database configuration lacks error handling and documentationThe configuration for the MSC external data source is functionally correct, but has several areas for improvement:
- There's no error handling if the environment variables (
DB_SERVER
,MSC_USER
,MSC_PASS
) are not set- The file lacks documentation explaining the purpose of this configuration
- The naming convention for environment variables is inconsistent (
DB_SERVER
vsMSC_USER
/MSC_PASS
)Consider adding checks for environment variables and enhancing with documentation:
<?php +// Configuration for connecting to the Mathematical Subject Classification database +// This allows MediaWiki to retrieve MSC classification strings by their IDs + +// Verify that required environment variables are set +if (!getenv('DB_SERVER') || !getenv('MSC_USER') || !getenv('MSC_PASS')) { + wfLogWarning('MSC classification database configuration is incomplete. Check environment variables.'); +} + $wgExternalDataSources['MSC'] = [ 'server' => getenv('DB_SERVER'), 'type' => 'mysql', 'name' => 'msc_classification', 'user' => getenv('MSC_USER'), 'password' => getenv('MSC_PASS'), 'prepared' => <<<'SQL' SELECT msc_string FROM msc_id_mapping WHERE msc_id = ? SQL, 'types' => 's' ];LocalSettings.d/UniversalLanguageSelector.php (1)
3-4
: Ensure Consistent Comment Style.
Currently, the comments use two different styles (//
and##
). Although PHP treats both as valid comments, using a consistent style (e.g., using only//
for single-line comments) can improve readability and maintainability.LocalSettings.d/LinkedWiki.php (1)
1-15
: Consider adding error handling for endpoint availabilityWhile the configuration is generally good, there's no visible error handling for cases where the SPARQL endpoint might be unavailable. Consider adding appropriate fallback mechanisms or error reporting if the LinkedWiki extension supports it.
LocalSettings.d/swmath.php (3)
12-12
: Consider matching the siteGlobalID with database name.The siteGlobalID is set to 'swmath' while the database name is 'wiki_swmath'. While this is not necessarily a problem, consider whether these identifiers should be consistent or if there's a specific reason for the difference.
14-15
: Document the commented-out extension.The 'ExternalData' extension is commented out without explanation. Consider adding a comment explaining why it's disabled and under what conditions it should be enabled.
# Load swMATH specific extensions - # wfLoadExtension( 'ExternalData' ); + # wfLoadExtension( 'ExternalData' ); // Disabled until dependency X is resolved - see issue #123
2-16
: Add error handling for Wikibase Client settings.The code assumes
$wgWBClientSettings
is defined before accessing it. Consider adding a check to ensure this variable exists to prevent potential PHP notices or errors.<?php if ( $wgDBname === 'wiki_swmath' ){ $wgSitename = 'swMATH staging'; # Set swMATH logo $wgLogos = [ 'wordmark' => [ 'src' => $wgScriptPath . '/images_repo/swMATH.svg', // path to wordmark version 'width' => 155, 'height' => 35 ] ]; - $wgWBClientSettings['siteGlobalID'] = 'swmath'; + if ( isset( $wgWBClientSettings ) ) { + $wgWBClientSettings['siteGlobalID'] = 'swmath'; + } else { + // Log a warning or initialize the array if needed + $wgWBClientSettings = [ 'siteGlobalID' => 'swmath' ]; + } # Load swMATH specific extensions # wfLoadExtension( 'ExternalData' ); }LocalSettings.d/YouTube.php (1)
6-6
: Optional Cleanup: Trailing Blank Line:
Consider removing any trailing blank lines at the end of the file to maintain clean file formatting.LocalSettings.d/zzCodeEditingExtension.php (1)
1-19
: Consider separating different extension configurations.This file contains configurations for multiple conceptually different extensions (JsonConfig, WikiEditor, CodeEditor, CodeMirror). Consider separating these into more focused configuration files for better maintainability, especially if the configurations grow more complex in the future.
LocalSettings.d/mardi_namespaces.php (2)
105-109
: Consider which namespaces should be searchable by defaultOnly 5 out of 15 namespaces are marked as searchable by default (Formula, Person, Publication, Software, Dataset). Consider whether the other namespaces should also be searchable by default. If the current configuration is intentional, consider adding a comment explaining why only these namespaces are searchable.
Also consider adding CODEMETA to searchable namespaces if appropriate:
+$wgNamespacesToBeSearchedDefault[NS_CODEMETA] = true;
111-112
: Clean up empty lines at end of fileConsider removing extra empty lines at the end of the file and keeping just one, following standard coding practices.
LocalSettings.d/TimedMediaHandler.php (1)
6-6
: File is missing proper PHP closing structure.The file ends with a blank line without proper PHP closure. While PHP doesn't require closing tags, your file should follow project conventions for consistency.
If your project standard includes closing PHP tags, add the following:
+?>
LocalSettings.d/cldr.php (1)
3-4
: Consistent Comment Formatting
Line 3 uses a//
style comment while line 4 uses##
. For clarity and consistency, consider adopting a single style (e.g.,//
) throughout all configuration files.LocalSettings.d/Babel.php (1)
1-5
: Consistent Comment Style RecommendedThe file properly loads the Babel extension, and the reference to the documentation is useful. Note that there are mixed comment styles (
//
and##
). For better readability and consistency, consider unifying these (e.g., using//
for both).LocalSettings.d/Scribunto.php (1)
1-4
: Appropriate Configuration for ScribuntoThe file not only loads the Scribunto extension but also sets the default engine via
$wgScribuntoDefaultEngine = 'luastandalone';
. This configuration appears correct for the intended deployment. Consider using a single, consistent comment style (e.g., replacing## Scribunto
with// Scribunto
) to match the style in other configuration files.LocalSettings.d/SPARQL.php (1)
1-4
: Consider environment-specific configuration.The SPARQL endpoint URL is hardcoded to a specific service name and port. While this works for the current environment, it might make the configuration less portable.
Consider making the endpoint configurable via environment variables:
-$wgSPARQLEndpoint = 'http://wdqs.svc:9999/bigdata/namespace/wdq/sparql'; +$wgSPARQLEndpoint = getenv('SPARQL_ENDPOINT') ?: 'http://wdqs.svc:9999/bigdata/namespace/wdq/sparql';Also, adding a comment explaining what this endpoint is used for would be helpful for future maintainers.
LocalSettings.d/WikibaseExport.php (1)
1-2
: Consider improving readability with standard conditional.The ternary operator used for its side effect of conditional extension loading might be less readable than a standard if statement. Also, consider adding a comment explaining why this extension should not be loaded for the 'wiki_swmath' database.
-$wgDBname !== 'wiki_swmath' ? wfLoadExtension( 'WikibaseExport' ) : NULL; +// Skip WikibaseExport for wiki_swmath database as it's not compatible or not needed +if ( $wgDBname !== 'wiki_swmath' ) { + wfLoadExtension( 'WikibaseExport' ); +}LocalSettings.d/PluggableAuth.php (1)
6-6
: Remove trailing empty lineThere appears to be an empty line at the end of the file without any content.
wfLoadExtension( 'PluggableAuth' ); -6
LocalSettings.d/EntitySchema.php (2)
3-5
: Consider using an if-statement instead of ternary for readabilityWhile the ternary operator works, an if-statement would be more readable for conditional extension loading, especially for maintainers who may not be familiar with PHP's ternary syntax.
// https://www.mediawiki.org/wiki/Extension:EntitySchema ## EntitySchema Configuration -$wgDBname !== 'wiki_swmath' ? wfLoadExtension( 'EntitySchema' ):NULL; +if ( $wgDBname !== 'wiki_swmath' ) { + wfLoadExtension( 'EntitySchema' ); +}
5-5
: Add comment explaining why EntitySchema is excluded for 'wiki_swmath'Including a brief comment explaining why this extension should not be loaded for the 'wiki_swmath' database would improve maintainability.
## EntitySchema Configuration +// EntitySchema is not needed for swmath as it is not a Wikibase repository $wgDBname !== 'wiki_swmath' ? wfLoadExtension( 'EntitySchema' ):NULL;
LocalSettings.d/WikibaseLocalMedia.php (2)
3-6
: Good documentation, consider if-statement instead of ternaryThe file includes helpful documentation about the extension and its limitations, which is excellent. Similar to the EntitySchema.php file, consider using an if-statement instead of a ternary operator for better readability.
// https://github.com/ProfessionalWiki/WikibaseLocalMedia ## WikibaseLocalMedia Configuration ## NOTE: WikibaseLocalMedia does currently not work in a client only setup. -$wgDBname !== 'wiki_swmath' ? wfLoadExtension( 'WikibaseLocalMedia' ) : NULL; +if ( $wgDBname !== 'wiki_swmath' ) { + wfLoadExtension( 'WikibaseLocalMedia' ); +}
6-6
: Consider adding check for Wikibase extensionSince WikibaseLocalMedia depends on Wikibase being loaded, consider adding a check to ensure Wikibase is loaded before loading this extension.
## WikibaseLocalMedia Configuration ## NOTE: WikibaseLocalMedia does currently not work in a client only setup. -$wgDBname !== 'wiki_swmath' ? wfLoadExtension( 'WikibaseLocalMedia' ) : NULL; +if ( $wgDBname !== 'wiki_swmath' && class_exists( 'Wikibase\\Repo\\WikibaseRepo' ) ) { + wfLoadExtension( 'WikibaseLocalMedia' ); +}LocalSettings.d/WikibaseManifest.php (1)
5-6
: Consider restructuring conditional logic for better readabilityThe ternary operator with NULL as its alternative value is an unusual pattern. A standard if statement would be more readable and maintainable:
-$wgDBname !== 'wiki_swmath' ? wfLoadExtension( 'WikibaseManifest' ) : NULL; +if ($wgDBname !== 'wiki_swmath') { + wfLoadExtension( 'WikibaseManifest' ); +}This makes the code's intent clearer and follows more common PHP practices.
LocalSettings.d/widgets.php (1)
1-8
: Configuration looks good but consider deployment flexibilityThe configuration correctly loads the Widgets extension and sets appropriate permissions for bureaucrats. The documentation reference is helpful.
For the compile directory, consider using a more flexible approach:
-$wgWidgetsCompileDir = "/var/www/html/w/images"; +$wgWidgetsCompileDir = getenv('WIDGETS_COMPILE_DIR') ?: "/var/www/html/w/images";This would allow configuring the directory through environment variables, making the setup more flexible across different environments.
LocalSettings.d/OpenID_Connect.php (3)
3-10
: Consider removing or documenting commented codeThe commented-out Google Account configuration could be confusing. Either:
- Remove it if it's no longer needed
- Add a clear comment explaining why it's kept as reference
-/** $wgPluggableAuth_Config['Login with your Google Account'] = [ +/** + * Google login configuration kept for reference purposes. + * Disabled in favor of NFDI AAI authentication. + * + * $wgPluggableAuth_Config['Login with your Google Account'] = [
15-16
: Consider using environment variables for client IDFor security and flexibility, consider moving the client ID to an environment variable like you did with the client secret:
- 'clientID' => 'u2pwxwERLrACYw3z', + 'clientID' => $_ENV['NFDI_AAI_CLIENT_ID'] ?: 'u2pwxwERLrACYw3z',Also add validation to handle cases where the secret environment variable might not be set:
- 'clientsecret' => $_ENV['NFDI_AAI_SECRET'], + 'clientsecret' => $_ENV['NFDI_AAI_SECRET'] ?? '',
20-20
: Fix coding style inconsistencyAdd a space after the equals sign for consistency with the rest of the code:
-$wgOpenIDConnect_MigrateUsersByEmail=true; +$wgOpenIDConnect_MigrateUsersByEmail = true;LocalSettings.d/WikibaseCirrusSearch.php (2)
4-4
: Use standard if-statement for clarity.
Ternary usage to load an extension is unconventional here. Consider refactoring for readability:-$wgDBname !== 'wiki_swmath' ? wfLoadExtension( 'WikibaseCirrusSearch' ) : NULL; +if ( $wgDBname !== 'wiki_swmath' ) { + wfLoadExtension( 'WikibaseCirrusSearch' ); +}
11-827
: Consider externalizing the property IDs for maintainability.
Storing a large array of property IDs directly in the code may be cumbersome. You could move them into a separate configuration file or extension setting for easier updates and better clarity.LocalSettings.d/Wikibase.php (1)
7-12
: Consider handling missing environment variables gracefully.
Currently,$wikibaseHost
and$portalHost
rely on environment variables (WIKIBASE_SCHEME
,WIKIBASE_HOST
, andWIKIBASE_PORT
), and they might not be defined in all deployments. Ensuring fallback values or throwing a clear error would improve reliability.LocalSettings.d/LocalSettings.override.php (3)
28-38
: Reassess restricted account creation and editing.
Anonymous editing is disabled, and account creation is blocked for*
(non-logged-in users) but allowed foruser
and autoconfigured for SSO. Ensure this aligns with your security policy (e.g., user-driven signup vs. admin-driven).
42-44
: Eliminate duplicated$wgCaptchaTriggers['addurl']
assignment.
Line 43 and line 184 both set$wgCaptchaTriggers['addurl']
tofalse
. Consolidating them in one place will avoid confusion or future drift.-# Deactivate captchas for URLs -$wgCaptchaTriggers['addurl'] = false; ... -# repeated later -$wgCaptchaTriggers['addurl'] = false; +# consider retaining the assignment in only one locationAlso applies to: 184-184
178-179
: Evaluate or monitor file cache performance.
$wgUseFileCache=true;
can reduce load time for anonymous visitors, but be mindful of potential invalidation overhead if frequent edits occur. Monitoring usage patterns and adjusting caching strategies might improve overall performance.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (43)
Dockerfile
(1 hunks)LocalSettings.d/00_database.php
(1 hunks)LocalSettings.d/Babel.php
(1 hunks)LocalSettings.d/CirrusSearch.php
(1 hunks)LocalSettings.d/Cite.php
(1 hunks)LocalSettings.d/ConfirmEdit.php
(1 hunks)LocalSettings.d/DisplayTitle.php
(1 hunks)LocalSettings.d/Elastica.php
(1 hunks)LocalSettings.d/EntitySchema.php
(1 hunks)LocalSettings.d/ExternalData.php
(1 hunks)LocalSettings.d/Gadgets.php
(1 hunks)LocalSettings.d/LinkedWiki.php
(1 hunks)LocalSettings.d/LocalSettings.override.php
(1 hunks)LocalSettings.d/MSC_classification.php
(1 hunks)LocalSettings.d/MathSearch.php
(1 hunks)LocalSettings.d/MatomoAnalytics.php
(1 hunks)LocalSettings.d/Nuke.php
(1 hunks)LocalSettings.d/OAuth.php
(1 hunks)LocalSettings.d/OpenID_Connect.php
(1 hunks)LocalSettings.d/PluggableAuth.php
(1 hunks)LocalSettings.d/SPARQL.php
(1 hunks)LocalSettings.d/Scribunto.php
(1 hunks)LocalSettings.d/Shibboleth.php
(1 hunks)LocalSettings.d/Skin.php
(1 hunks)LocalSettings.d/Thanks.php
(1 hunks)LocalSettings.d/TimedMediaHandler.php
(1 hunks)LocalSettings.d/UniversalLanguageSelector.php
(1 hunks)LocalSettings.d/UrlGetParameters.php
(1 hunks)LocalSettings.d/UserMerge.php
(1 hunks)LocalSettings.d/VisualEditor.php
(1 hunks)LocalSettings.d/Wikibase.php
(1 hunks)LocalSettings.d/WikibaseCirrusSearch.php
(1 hunks)LocalSettings.d/WikibaseExport.php
(1 hunks)LocalSettings.d/WikibaseLocalMedia.php
(1 hunks)LocalSettings.d/WikibaseManifest.php
(1 hunks)LocalSettings.d/WikibaseQualityConstraints.php
(1 hunks)LocalSettings.d/YouTube.php
(1 hunks)LocalSettings.d/cldr.php
(1 hunks)LocalSettings.d/email.php
(1 hunks)LocalSettings.d/mardi_namespaces.php
(1 hunks)LocalSettings.d/swmath.php
(1 hunks)LocalSettings.d/widgets.php
(1 hunks)LocalSettings.d/zzCodeEditingExtension.php
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build-base
🔇 Additional comments (43)
LocalSettings.d/ExternalData.php (1)
1-2
: Efficient Extension LoadingThis new file correctly starts with the PHP opening tag and loads the ExternalData extension using
wfLoadExtension
. Make sure that the extension is installed and available in the MediaWiki environment.LocalSettings.d/MathSearch.php (1)
1-1
: PHP Opening Tag is Correct.
The file correctly begins with the PHP opening tag.LocalSettings.d/Elastica.php (2)
1-2
: PHP File Initialization and Best Practices
The file correctly starts with the PHP opening tag (<?php
). As per common MediaWiki and PHP configuration practices, omitting the closing PHP tag in configuration files helps prevent accidental whitespace issues.
3-6
: Loading the Elastica Extension
The file loads the Elastica extension usingwfLoadExtension( 'Elastica' );
and includes a helpful comment with a reference to the official MediaWiki documentation. The additional note to checkWikibaseCirrusSearch.php
for further configuration is useful for context. Ensure that any additional settings or error handling required for the Elastica extension are appropriately configured elsewhere if needed.LocalSettings.d/UniversalLanguageSelector.php (2)
1-1
: PHP Opening Tag is Correct.
The file correctly begins with the PHP opening tag (<?php
), ensuring proper interpretation by the PHP engine.
5-5
: Extension Loading Appears Correct.
The call towfLoadExtension( 'UniversalLanguageSelector' );
is appropriately placed and correctly loads the Universal Language Selector extension as intended for MediaWiki.LocalSettings.d/UserMerge.php (1)
1-3
:✅ Verification successful
Configuration for UserMerge extension looks good.
The code correctly loads the UserMerge extension and appropriately grants the 'usermerge' permission only to users in the bureaucrat group, which follows MediaWiki's recommended security practices for user management.
🏁 Script executed:
#!/bin/bash # Verify if the UserMerge extension is mentioned in other configuration files # or Dockerfiles to ensure it's properly installed in the environment grep -r "UserMerge" --include="*.php" --include="Dockerfile*" .Length of output: 127
Final Verification: UserMerge extension configuration is correct and secure.
The grep output confirms that the only reference to the UserMerge extension is in
LocalSettings.d/UserMerge.php
, and the configuration correctly grants theusermerge
permission exclusively to bureaucrats per MediaWiki security guidelines.No additional changes are necessary.
LocalSettings.d/UrlGetParameters.php (2)
2-2
: Documentation Comment is Clear:
The comment on line 2 provides a direct link to the extension's documentation, which is useful for maintainers to quickly reference relevant information.
3-3
: Extension Loading is Implemented Correctly:
The call towfLoadExtension( 'UrlGetParameters' );
correctly integrates the extension into the MediaWiki environment. Ensure that the extension name matches the actual extension package and that any additional configuration required by the extension is addressed elsewhere if necessary.LocalSettings.d/LinkedWiki.php (3)
1-2
: LGTM - Extension loading looks goodThe extension loading syntax is correct and follows MediaWiki's standard approach.
4-12
:✅ Verification successful
SPARQL service configuration looks correct
The SPARQL service configuration for "mardi" includes all required parameters and follows best practices by setting debug to false and making the endpoint read-only for security.
You might want to verify that the endpoint URL is accessible and correctly configured:
🏁 Script executed:
#!/bin/bash # Check if the SPARQL endpoint is accessible curl -s -o /dev/null -w "%{http_code}" "https://query.portal.mardi4nfdi.de/proxy/wdqs/bigdata/namespace/wdq/sparql?query=ASK%20%7B%20%3Fs%20%3Fp%20%3Fo%20%7D"Length of output: 164
SPARQL Configuration Confirmed
The "mardi" SPARQL service configuration is correct. The endpoint URL has been verified and returned a 200 HTTP status, confirming accessibility. No further changes are required.
14-14
:⚠️ Potential issueMissing semicolon at the end of line
There's a syntax error - the line defining
$wgLinkedWikiSPARQLServiceByDefault
is missing a semicolon at the end.-$wgLinkedWikiSPARQLServiceByDefault= "mardi" +$wgLinkedWikiSPARQLServiceByDefault = "mardi";Likely an incorrect or invalid review comment.
LocalSettings.d/swmath.php (1)
1-2
: Well-structured conditional for database-specific settings.The condition checks if the current database name matches 'wiki_swmath' before applying specific configurations, which is a good practice for maintaining separate configurations in a multi-wiki setup.
LocalSettings.d/YouTube.php (2)
1-1
: PHP Opening Tag:
The file correctly begins with the<?php
opening tag, which is standard for PHP files.
3-5
: YouTube Extension Configuration:
The comments provide a useful reference URL for more information on the YouTube extension, and the call towfLoadExtension( 'YouTube' );
is correctly implemented to load the extension in MediaWiki.LocalSettings.d/zzCodeEditingExtension.php (4)
7-8
: LGTM: JsonConfig model configuration.The JsonConfig extension setup is appropriate with the model class set to NULL to allow non-validated data. This is a valid approach when you need to store flexible JSON data without strict validation.
13-15
: LGTM: Editor extensions configuration.The WikiEditor and CodeEditor extensions are properly loaded, and the default user preference for the beta toolbar is enabled, which improves the editing experience.
16-18
: LGTM: CodeMirror configuration is well-documented.The CodeMirror extension is loaded properly with a clear comment explaining the reasoning behind enabling it by default while allowing users to disable it.
2-2
:✅ Verification successful
Check the dependency on NS_CODEMETA.
This comment indicates that this file should be loaded after NS_CODEMETA is defined. Make sure that the file responsible for defining NS_CODEMETA is always loaded before this one. Consider using a more explicit dependency management mechanism if available in your MediaWiki configuration system.
🏁 Script executed:
#!/bin/bash # Find where NS_CODEMETA is defined in the codebase rg -l "define.*NS_CODEMETA" --type phpLength of output: 77
Dependency Order Verification for NS_CODEMETA
The executed search confirms that NS_CODEMETA is defined in
LocalSettings.d/mardi_namespaces.php
. Given the alphabetical load order (with "mardi_namespaces.php" preceding "zzCodeEditingExtension.php"), the dependency appears to be satisfied. However, please double-check that your MediaWiki configuration consistently follows this load order. If there's any risk of the ordering changing in the future, consider implementing an explicit dependency management mechanism to enforce the correct sequence.LocalSettings.d/TimedMediaHandler.php (1)
3-5
:❓ Verification inconclusive
Verify that these large upload size limits are appropriate.
You've set the upload size limits to 2GB (2147483647 bytes, which is the max 32-bit integer), effectively removing practical limits on uploads. While this may be necessary for video files, consider:
- If your server has sufficient resources to handle files of this size
- If there are security implications of allowing such large uploads
- Whether a more moderate limit might be appropriate
🌐 Web query:
What is the recommended maximum upload size for MediaWiki TimedMediaHandler extension?
💡 Result:
The recommended maximum upload size for the MediaWiki TimedMediaHandler extension depends on server configuration and transcoding limits:
PHP and MediaWiki Settings:
- The upload size is primarily limited by PHP's
upload_max_filesize
andpost_max_size
(default: 2 MB and 8 MB, respectively)[1][3][4]. To support larger files, adjust these inphp.ini
(e.g.,upload_max_filesize = 3G
andpost_max_size = 3G
).- MediaWiki’s
$wgMaxUploadSize
must align with PHP settings. For example:$wgMaxUploadSize = 3 * 1024 * 1024 * 1024; // 3 GiBTimedMediaHandler-Specific Limits:
- TranscodeBackgroundSizeLimit: Maximum file size for transcoding is 3 GiB (default)[2][8]. Files exceeding this cannot be processed.
- TranscodeSoftSizeLimit: Files above 2 GiB require admin approval for transcoding[2].
Best Practices:
- Ensure PHP, MediaWiki, and TimedMediaHandler limits are synchronized.
- For uploads requiring transcoding (e.g., video files), keep files under 2 GiB to avoid manual admin intervention[2].
- Larger files (up to 3 GiB) can be uploaded but may face processing delays or failures if server resources are insufficient[2][8].
For context, a user reported successfully configuring uploads up to 1.86 GiB by adjusting both PHP and MediaWiki settings[9].
Citations:
- 1: https://www.mediawiki.org/wiki/Manual:$wgMaxUploadSize
- 2: https://github.com/wikimedia/mediawiki-extensions-TimedMediaHandler/blob/master/extension.json
- 3: https://www.mediawiki.org/wiki/Manual:Configuring_file_uploads
- 4: https://workingwithmediawiki.com/book/chapter7.html
- 5: https://doc.wikimedia.org/mediawiki-core/master/php/classMediaHandler.html
- 6: https://www.mediawiki.org/wiki/Help:Images
- 7: https://www.mediawiki.org/wiki/Help:Images/en
- 8: https://www.mediawiki.org/wiki/Extension:TimedMediaHandler/ar
- 9: https://forums.lawrencesystems.com/t/mediawiki-increase-max-file-size-upload/22215
- 10: https://en.wikipedia.org/wiki/Help:Template_limits
Action Required: Validate 2GB Upload Limit Settings
The current configuration sets both the warning and maximum upload sizes to 2GB (2147483647 bytes). Note that this value aligns with the default TranscodeSoftSizeLimit in TimedMediaHandler, meaning files near this limit will require admin approval for transcoding. Please verify the following:
- Ensure your PHP settings (
upload_max_filesize
andpost_max_size
) are adjusted to support a 2GB upload.- Confirm that your server resources (storage, memory, processing) can adequately handle such large files.
- Assess whether a 2GB limit is optimal for your use case or if lowering the threshold (to avoid admin intervention during transcoding) or adjusting to a slightly higher limit (up to 3GB, if supported by your infrastructure) might be more appropriate.
LocalSettings.d/cldr.php (2)
1-2
: PHP File Initialization
The file begins with the proper PHP opening tag, and the omission of the closing tag is a best practice for configuration files to prevent accidental whitespace output.
5-5
: CLDR Extension Activation
The use ofwfLoadExtension( 'cldr' );
is correct for enabling the CLDR extension in MediaWiki. Ensure that the extension is installed and properly configured in your environment.LocalSettings.d/Cite.php (1)
1-3
: Good Extension Loading for CiteThe file correctly loads the Cite extension using
wfLoadExtension( 'Cite' );
. For enhanced clarity and maintainability, you might consider adding a brief header comment describing the purpose of this file, although the current implementation meets the requirements.LocalSettings.d/Thanks.php (1)
1-4
: Verify Extension Dependency OrderThis file loads both the Echo and Thanks extensions. If the Thanks extension depends on Echo, the current order is appropriate. Just double-check that this order satisfies any dependency requirements documented for these extensions.
LocalSettings.d/Gadgets.php (1)
1-4
: Clear Extension Loading for GadgetsThe file includes a helpful reference to the documentation and correctly invokes
wfLoadExtension( 'Gadgets' );
. The implementation is straightforward and meets the objective of integrating the Gadgets extension.LocalSettings.d/Nuke.php (1)
1-5
: Extension configuration looks good.The file correctly loads the Nuke extension with proper documentation reference. The structure follows MediaWiki's extension configuration pattern.
LocalSettings.d/ConfirmEdit.php (1)
1-6
: Extension configuration looks good.The file correctly loads the ConfirmEdit extension with proper documentation reference. The structure follows MediaWiki's extension configuration pattern.
LocalSettings.d/PluggableAuth.php (1)
1-5
: LGTM: Good configuration for PluggableAuth extensionThe file properly loads the PluggableAuth extension and enables local login functionality, which provides a fallback authentication method alongside any other authentication extensions that might be configured.
LocalSettings.d/CirrusSearch.php (2)
8-8
:✅ Verification successful
Verify the referenced file exists
The comment references WikibaseCirrusSearch.php for further configuration, but there's no guarantee this file exists or will be loaded.
🏁 Script executed:
#!/bin/bash # Check if the referenced file exists if [ -f "LocalSettings.d/WikibaseCirrusSearch.php" ]; then echo "File exists: LocalSettings.d/WikibaseCirrusSearch.php" cat "LocalSettings.d/WikibaseCirrusSearch.php" | head -n 20 else echo "File not found: LocalSettings.d/WikibaseCirrusSearch.php" # Find all files with similar names find . -name "*Cirrus*.php" -o -name "*Search*.php" fiLength of output: 926
File Reference Verified – No Changes Needed
The file
LocalSettings.d/WikibaseCirrusSearch.php
referenced for further configuration has been confirmed to exist. The output confirms that it is present and contains the expected configuration details. No changes are necessary.
3-8
:✅ Verification successful
Verify ElasticSearch configuration is available
The file loads the CirrusSearch and AdvancedSearch extensions but doesn't provide any configuration for connecting to an ElasticSearch server, which is required for these extensions to work.
Make sure that:
- An ElasticSearch server is available in the deployment environment
- Connection parameters are defined elsewhere (perhaps in WikibaseCirrusSearch.php)
- The search functionality is properly tested after deployment
🏁 Script executed:
#!/bin/bash # Check if there's any ElasticSearch configuration in the repo grep -r "wgCirrusSearch" --include="*.php" .Length of output: 271
ElasticSearch configuration verified via WikibaseCirrusSearch.php
The CirrusSearch and AdvancedSearch extensions are correctly loaded in this file. The necessary connection parameters are set externally (in
LocalSettings.d/WikibaseCirrusSearch.php
with$wgCirrusSearchServers = [ $_ENV['MW_ELASTIC_HOST'] ];
). Please ensure that:
- An ElasticSearch server is available in the deployment environment.
- The environment variable
MW_ELASTIC_HOST
is set properly.- Post-deployment testing covers the search functionality to confirm connectivity and performance.
Dockerfile (1)
84-84
: LGTM: Successfully implements directory relocationThe change correctly copies the LocalSettings.d directory into the container, implementing the PR objective of moving these files from portal-compose to this repository.
LocalSettings.d/OAuth.php (1)
1-8
: Security permissions look appropriateThe configuration correctly loads the OAuth extension and sets appropriate permissions for sysop users. This follows standard MediaWiki practice for administrator permissions.
Consider adding additional OAuth configuration options if your use case requires them, such as:
$wgOAuth2Client
for customizing token lifetimes$wgMWOAuthCentralWiki
if using a central OAuth wiki$wgMWOAuthSharedUserSource
for shared user sourcesLocalSettings.d/OpenID_Connect.php (1)
17-17
: Verify empty scope array is intentionalThe empty scope array may limit the permissions requested from the identity provider. Confirm this is intentional for your use case, or specify the required scopes if needed:
- 'scope' => [], + 'scope' => ['openid', 'email', 'profile'],Check the NFDI AAI documentation for recommended scopes.
LocalSettings.d/00_database.php (2)
2-2
: Confirm PHP 8 compatibility.
str_contains()
requires PHP 8 or higher. Ensure your runtime environment meets this requirement.
3-30
: Block is effectively disabled and never runs.
Becauseif ( false && getenv('CI') !== 'true' )
always evaluates to false,$wgLBFactoryConf
is never assigned. Please confirm if this is intentional or if the condition needs revisiting.LocalSettings.d/Wikibase.php (3)
36-37
: Verify additional wikis or future expansions.
This array sets the local databases towiki_swmath
andmy_wiki
only. Confirm that no other wikis need to be added or if the list should be dynamically determined for better maintainability.
41-92
: Confirm the intended conditional skip for ‘wiki_swmath.’
When$wgDBname
equalswiki_swmath
, the WikibaseRepository extension and all related repo settings are skipped. Verify that this behavior is correct and thatwiki_swmath
only ever serves as a client. If an additional local entity store is desired, removing or adjusting the condition might be necessary.
4-5
:❓ Verification inconclusive
Confirm the WikibaseClient extension availability.
These lines load the WikibaseClient extension and related settings. Ensure that the extension is installed in the container image or environment to avoid runtime errors.You may run a quick scan to confirm that the WikibaseClient extension files exist:
🏁 Script executed:
#!/bin/bash # Verify that WikibaseClient extension files are present fd extension-client.json --exec ls -lLength of output: 39
Action Required: Verify WikibaseClient Extension Availability
The code in
LocalSettings.d/Wikibase.php
loads the WikibaseClient extension:wfLoadExtension( 'WikibaseClient', "$IP/extensions/Wikibase/extension-client.json" ); require_once "$IP/extensions/Wikibase/client/ExampleSettings.php";However, the automated scan did not produce any output for
extension-client.json
. Please manually verify that the WikibaseClient extension is installed in your container or deployment environment and that the file is located at$IP/extensions/Wikibase/extension-client.json
to avoid possible runtime errors.LocalSettings.d/LocalSettings.override.php (3)
45-60
: Ensure secure file upload configurations.
Enabling uploads and supporting file types likesvg
,md
can pose security risks if user-stored files are not sanitized or if accounts have wide upload permissions. Confirm that your environment includes robust validation or scanning of uploaded files.
78-81
: Validate predefined property “P10” for URL formatting.
$wgWBRepoSettings['formatterUrlProperty']='P10';
presumes that P10 is the correct internal property ID for link formatting. Double-check that P10 is indeed the intended property or verify that it exists in the local Wikibase.
81-82
: Confirm container references for LaTeXML, Redis, and ffmpeg.
These lines assume services are available at:
http://latexml:8080/convert/
(LaTeXML processing)redis:6379
(Redis job queue)http://ffmpeg/shellbox
(Shellbox for ffmpeg)Ensure that each container name, port, and path is correct in your Compose or Kubernetes setup. If there are different service names in production, you may need to update these references.
Also applies to: 156-161, 231-233
LocalSettings.d/WikibaseQualityConstraints.php (2)
5-75
: Verify that each property ID is valid and present in your Wikibase.
These lines define a large set of property-based constraints (e.g.,P31
,P36
, etc.). Ensure that these property IDs match each constraint’s actual ID in your instance. If any ID is missing, you may need to import or create the corresponding property.
3-4
:✅ Verification successful
Confirm the WikibaseQualityConstraints extension availability.
Make sureWikibaseQualityConstraints
is installed in the environment. If not, this load statement will fail.
🏁 Script executed:
#!/bin/bash # Check for WikibaseQualityConstraints extension files fd WikibaseQualityConstraints --exec ls -lLength of output: 142
WikibaseQualityConstraints Extension Confirmed
The verification output shows that the
LocalSettings.d/WikibaseQualityConstraints.php
file is present, ensuring that the extension is indeed installed in the environment. No further action is needed regarding this load statement.
@@ -0,0 +1,3 @@ | |||
<?php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Consider Adding an Entry Point Guard:
The PHP opening tag is correct; however, it is a best practice to include a guard clause (e.g., checking if ( !defined('MEDIAWIKI') ) { exit; }
) to ensure the file is executed only within the MediaWiki environment. This helps prevent direct access via a browser.
For example, you might add the following immediately after the opening tag:
<?php
+if ( !defined('MEDIAWIKI') ) {
+ exit;
+}
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
<?php | |
<?php | |
if ( !defined('MEDIAWIKI') ) { | |
exit; | |
} |
$wgSitename = 'swMATH staging'; | ||
# Set swMATH logo | ||
$wgLogos = [ | ||
'wordmark' => [ | ||
'src' => $wgScriptPath . '/images_repo/swMATH.svg', // path to wordmark version | ||
'width' => 155, | ||
'height' => 35 | ||
] | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Logo path validation recommended.
The logo configuration appears correct, but ensure that the path $wgScriptPath . '/images_repo/swMATH.svg'
will resolve correctly in the production environment.
🏁 Script executed:
#!/bin/bash
# Check if the images_repo directory and swMATH.svg file exist in the codebase
echo "Checking for image path..."
fd -t d "images_repo" .
fd "swMATH.svg" .
Length of output: 124
Update the logo path to match the actual file location.
The current configuration in LocalSettings.d/swmath.php
uses:
'src' => $wgScriptPath . '/images_repo/swMATH.svg'
However, our verification shows that the file exists at ./images/swMATH.svg
rather than within an images_repo
directory. Please update the configuration to use the correct folder (or add the missing directory/file) so that the path resolves correctly in production.
- File:
LocalSettings.d/swmath.php
(Lines 3-11) - Action: Change the path from
$wgScriptPath . '/images_repo/swMATH.svg'
to$wgScriptPath . '/images/swMATH.svg'
(or ensure that theimages_repo
directory and file exist as required).
'namespace' => NS_CODEMETA, | ||
'nsName' => 'CodeMeta', | ||
'pattern' => '/.\.json/', | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify the regex pattern for JSON files.
The pattern /.\.json/
might be too restrictive. It will only match files with a single character followed by ".json" (like "a.json", "b.json") but not typical filenames like "metadata.json". Consider if this is intentional or if you meant to use something like /.*\.json/
to match any JSON file.
🏁 Script executed:
#!/bin/bash
# Check for any existing documentation about JsonConfig patterns to understand typical usage
rg "pattern.*json" --type php -A 3 -B 3
Length of output: 557
Attention: Regex Pattern for JSON File Matching
The current regex /.\.json/
only matches filenames with a single character preceding the extension (e.g., "a.json"). This may not cover typical JSON files like "metadata.json". If the intent is to match any JSON file, consider updating the pattern to /.*\.json/
(or a similar variant). Please verify whether the current behavior is intentional or requires revision.
- File: LocalSettings.d/zzCodeEditingExtension.php
- Suggested Change: Update from
to
'pattern' => '/.\.json/',
'pattern' => '/.*\.json/',
$wgContentNamespaces[] = NS_FORMULA; | ||
$wgContentNamespaces[] = NS_PERSON; | ||
$wgContentNamespaces[] = NS_PUBLICATION; | ||
$wgContentNamespaces[] = NS_SOFTWARE; | ||
$wgContentNamespaces[] = NS_DATASET; | ||
$wgContentNamespaces[] = NS_COMMUNITY; | ||
$wgContentNamespaces[] = NS_WORKFLOW; | ||
$wgContentNamespaces[] = NS_ALGORITHM; | ||
$wgContentNamespaces[] = NS_SERVICE; | ||
$wgContentNamespaces[] = NS_THEOREM; | ||
$wgContentNamespaces[] = NS_RESEARCH_FIELD; | ||
$wgContentNamespaces[] = NS_RESEARCH_PROBLEM; | ||
$wgContentNamespaces[] = NS_MODEL; | ||
$wgContentNamespaces[] = NS_QUANTITY; | ||
$wgContentNamespaces[] = NS_TASK; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add CODEMETA to content namespaces
The CODEMETA namespace is missing from the content namespaces. Consider adding it for consistency:
+$wgContentNamespaces[] = NS_CODEMETA;
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
$wgContentNamespaces[] = NS_FORMULA; | |
$wgContentNamespaces[] = NS_PERSON; | |
$wgContentNamespaces[] = NS_PUBLICATION; | |
$wgContentNamespaces[] = NS_SOFTWARE; | |
$wgContentNamespaces[] = NS_DATASET; | |
$wgContentNamespaces[] = NS_COMMUNITY; | |
$wgContentNamespaces[] = NS_WORKFLOW; | |
$wgContentNamespaces[] = NS_ALGORITHM; | |
$wgContentNamespaces[] = NS_SERVICE; | |
$wgContentNamespaces[] = NS_THEOREM; | |
$wgContentNamespaces[] = NS_RESEARCH_FIELD; | |
$wgContentNamespaces[] = NS_RESEARCH_PROBLEM; | |
$wgContentNamespaces[] = NS_MODEL; | |
$wgContentNamespaces[] = NS_QUANTITY; | |
$wgContentNamespaces[] = NS_TASK; | |
$wgContentNamespaces[] = NS_FORMULA; | |
$wgContentNamespaces[] = NS_PERSON; | |
$wgContentNamespaces[] = NS_PUBLICATION; | |
$wgContentNamespaces[] = NS_SOFTWARE; | |
$wgContentNamespaces[] = NS_DATASET; | |
$wgContentNamespaces[] = NS_COMMUNITY; | |
$wgContentNamespaces[] = NS_WORKFLOW; | |
$wgContentNamespaces[] = NS_ALGORITHM; | |
$wgContentNamespaces[] = NS_SERVICE; | |
$wgContentNamespaces[] = NS_THEOREM; | |
$wgContentNamespaces[] = NS_RESEARCH_FIELD; | |
$wgContentNamespaces[] = NS_RESEARCH_PROBLEM; | |
$wgContentNamespaces[] = NS_MODEL; | |
$wgContentNamespaces[] = NS_QUANTITY; | |
$wgContentNamespaces[] = NS_TASK; | |
$wgContentNamespaces[] = NS_CODEMETA; |
$wgExtraNamespaces[NS_FORMULA] = "Formula"; | ||
$wgExtraNamespaces[NS_FORMULA_TALK] = "Formula_talk"; | ||
$wgExtraNamespaces[NS_PERSON] = "Person"; | ||
$wgExtraNamespaces[NS_PERSON_TALK] = "Person_talk"; | ||
$wgExtraNamespaces[NS_PUBLICATION] = "Publication"; | ||
$wgExtraNamespaces[NS_PUBLICATION_TALK] = "Publication_talk"; | ||
$wgExtraNamespaces[NS_SOFTWARE] = "Software"; | ||
$wgExtraNamespaces[NS_SOFTWARE_TALK] = "Software_talk"; | ||
$wgExtraNamespaces[NS_DATASET] = "Dataset"; | ||
$wgExtraNamespaces[NS_DATASET_TALK] = "Dataset_talk"; | ||
$wgExtraNamespaces[NS_COMMUNITY] = "Community"; | ||
$wgExtraNamespaces[NS_COMMUNITY_TALK] = "Community_talk"; | ||
$wgExtraNamespaces[NS_WORKFLOW] = "Workflow"; | ||
$wgExtraNamespaces[NS_WORKFLOW_TALK] = "Workflow_talk"; | ||
$wgExtraNamespaces[NS_ALGORITHM] = "Algorithm"; | ||
$wgExtraNamespaces[NS_ALGORITHM_TALK] = "Algorithm_talk"; | ||
$wgExtraNamespaces[NS_SERVICE] = "Service"; | ||
$wgExtraNamespaces[NS_SERVICE_TALK] = "Service_talk"; | ||
$wgExtraNamespaces[NS_THEOREM] = "Theorem"; | ||
$wgExtraNamespaces[NS_THEOREM_TALK] = "Theorem_talk"; | ||
$wgExtraNamespaces[NS_RESEARCH_FIELD] = "Research_field"; | ||
$wgExtraNamespaces[NS_RESEARCH_FIELD_TALK] = "Research_field_talk"; | ||
$wgExtraNamespaces[NS_RESEARCH_PROBLEM] = "Research_problem"; | ||
$wgExtraNamespaces[NS_RESEARCH_PROBLEM_TALK] = "Research_problem_talk"; | ||
$wgExtraNamespaces[NS_MODEL] = "Model"; | ||
$wgExtraNamespaces[NS_MODEL_TALK] = "Model_talk"; | ||
$wgExtraNamespaces[NS_QUANTITY] = "Quantity"; | ||
$wgExtraNamespaces[NS_QUANTITY_TALK] = "Quantity_talk"; | ||
$wgExtraNamespaces[NS_TASK] = "Task"; | ||
$wgExtraNamespaces[NS_TASK_TALK] = "Task_talk"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add the missing CODEMETA namespace configuration
The CODEMETA namespace constants are defined but not added to $wgExtraNamespaces
. Consider adding them for consistency:
+$wgExtraNamespaces[NS_CODEMETA] = "Codemeta";
+$wgExtraNamespaces[NS_CODEMETA_TALK] = "Codemeta_talk";
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
$wgExtraNamespaces[NS_FORMULA] = "Formula"; | |
$wgExtraNamespaces[NS_FORMULA_TALK] = "Formula_talk"; | |
$wgExtraNamespaces[NS_PERSON] = "Person"; | |
$wgExtraNamespaces[NS_PERSON_TALK] = "Person_talk"; | |
$wgExtraNamespaces[NS_PUBLICATION] = "Publication"; | |
$wgExtraNamespaces[NS_PUBLICATION_TALK] = "Publication_talk"; | |
$wgExtraNamespaces[NS_SOFTWARE] = "Software"; | |
$wgExtraNamespaces[NS_SOFTWARE_TALK] = "Software_talk"; | |
$wgExtraNamespaces[NS_DATASET] = "Dataset"; | |
$wgExtraNamespaces[NS_DATASET_TALK] = "Dataset_talk"; | |
$wgExtraNamespaces[NS_COMMUNITY] = "Community"; | |
$wgExtraNamespaces[NS_COMMUNITY_TALK] = "Community_talk"; | |
$wgExtraNamespaces[NS_WORKFLOW] = "Workflow"; | |
$wgExtraNamespaces[NS_WORKFLOW_TALK] = "Workflow_talk"; | |
$wgExtraNamespaces[NS_ALGORITHM] = "Algorithm"; | |
$wgExtraNamespaces[NS_ALGORITHM_TALK] = "Algorithm_talk"; | |
$wgExtraNamespaces[NS_SERVICE] = "Service"; | |
$wgExtraNamespaces[NS_SERVICE_TALK] = "Service_talk"; | |
$wgExtraNamespaces[NS_THEOREM] = "Theorem"; | |
$wgExtraNamespaces[NS_THEOREM_TALK] = "Theorem_talk"; | |
$wgExtraNamespaces[NS_RESEARCH_FIELD] = "Research_field"; | |
$wgExtraNamespaces[NS_RESEARCH_FIELD_TALK] = "Research_field_talk"; | |
$wgExtraNamespaces[NS_RESEARCH_PROBLEM] = "Research_problem"; | |
$wgExtraNamespaces[NS_RESEARCH_PROBLEM_TALK] = "Research_problem_talk"; | |
$wgExtraNamespaces[NS_MODEL] = "Model"; | |
$wgExtraNamespaces[NS_MODEL_TALK] = "Model_talk"; | |
$wgExtraNamespaces[NS_QUANTITY] = "Quantity"; | |
$wgExtraNamespaces[NS_QUANTITY_TALK] = "Quantity_talk"; | |
$wgExtraNamespaces[NS_TASK] = "Task"; | |
$wgExtraNamespaces[NS_TASK_TALK] = "Task_talk"; | |
$wgExtraNamespaces[NS_FORMULA] = "Formula"; | |
$wgExtraNamespaces[NS_FORMULA_TALK] = "Formula_talk"; | |
$wgExtraNamespaces[NS_PERSON] = "Person"; | |
$wgExtraNamespaces[NS_PERSON_TALK] = "Person_talk"; | |
$wgExtraNamespaces[NS_PUBLICATION] = "Publication"; | |
$wgExtraNamespaces[NS_PUBLICATION_TALK] = "Publication_talk"; | |
$wgExtraNamespaces[NS_SOFTWARE] = "Software"; | |
$wgExtraNamespaces[NS_SOFTWARE_TALK] = "Software_talk"; | |
$wgExtraNamespaces[NS_DATASET] = "Dataset"; | |
$wgExtraNamespaces[NS_DATASET_TALK] = "Dataset_talk"; | |
$wgExtraNamespaces[NS_COMMUNITY] = "Community"; | |
$wgExtraNamespaces[NS_COMMUNITY_TALK] = "Community_talk"; | |
$wgExtraNamespaces[NS_WORKFLOW] = "Workflow"; | |
$wgExtraNamespaces[NS_WORKFLOW_TALK] = "Workflow_talk"; | |
$wgExtraNamespaces[NS_ALGORITHM] = "Algorithm"; | |
$wgExtraNamespaces[NS_ALGORITHM_TALK] = "Algorithm_talk"; | |
$wgExtraNamespaces[NS_SERVICE] = "Service"; | |
$wgExtraNamespaces[NS_SERVICE_TALK] = "Service_talk"; | |
$wgExtraNamespaces[NS_THEOREM] = "Theorem"; | |
$wgExtraNamespaces[NS_THEOREM_TALK] = "Theorem_talk"; | |
$wgExtraNamespaces[NS_RESEARCH_FIELD] = "Research_field"; | |
$wgExtraNamespaces[NS_RESEARCH_FIELD_TALK] = "Research_field_talk"; | |
$wgExtraNamespaces[NS_RESEARCH_PROBLEM] = "Research_problem"; | |
$wgExtraNamespaces[NS_RESEARCH_PROBLEM_TALK] = "Research_problem_talk"; | |
$wgExtraNamespaces[NS_MODEL] = "Model"; | |
$wgExtraNamespaces[NS_MODEL_TALK] = "Model_talk"; | |
$wgExtraNamespaces[NS_QUANTITY] = "Quantity"; | |
$wgExtraNamespaces[NS_QUANTITY_TALK] = "Quantity_talk"; | |
$wgExtraNamespaces[NS_TASK] = "Task"; | |
$wgExtraNamespaces[NS_TASK_TALK] = "Task_talk"; | |
$wgExtraNamespaces[NS_CODEMETA] = "Codemeta"; | |
$wgExtraNamespaces[NS_CODEMETA_TALK] = "Codemeta_talk"; |
@@ -0,0 +1,5 @@ | |||
<?php | |||
# wfLoadExtension( 'TimedMediaHandler' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extension loading is commented out, but configuration is present.
The wfLoadExtension( 'TimedMediaHandler' )
call is commented out, which means the TimedMediaHandler extension won't be loaded despite this file containing configuration for it. This will likely prevent the MP4 file handling from working properly.
-# wfLoadExtension( 'TimedMediaHandler' );
+wfLoadExtension( 'TimedMediaHandler' );
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
# wfLoadExtension( 'TimedMediaHandler' ); | |
wfLoadExtension( 'TimedMediaHandler' ); |
$wgSMTP = [ | ||
'host' => 'ssl://smtp.gmail.com', // hostname of the email server | ||
'IDHost' => getenv('WIKIBASE_HOST'), | ||
'port' => 465, | ||
'auth' => true | ||
// username and password are missing here on purpose, they'll be added with private config overwrite | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add missing semicolon and consider checking for environment variable existence
The $wgSMTP array declaration is missing a trailing semicolon, which would cause a PHP syntax error. Additionally, using getenv() without checking if the environment variable exists could lead to unexpected behavior.
$wgSMTP = [
'host' => 'ssl://smtp.gmail.com', // hostname of the email server
- 'IDHost' => getenv('WIKIBASE_HOST'),
+ 'IDHost' => getenv('WIKIBASE_HOST') ?: 'localhost',
'port' => 465,
'auth' => true
// username and password are missing here on purpose, they'll be added with private config overwrite
-];
+];
Consider providing a fallback value if the environment variable is not set, to avoid potential issues.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
$wgSMTP = [ | |
'host' => 'ssl://smtp.gmail.com', // hostname of the email server | |
'IDHost' => getenv('WIKIBASE_HOST'), | |
'port' => 465, | |
'auth' => true | |
// username and password are missing here on purpose, they'll be added with private config overwrite | |
]; | |
$wgSMTP = [ | |
'host' => 'ssl://smtp.gmail.com', // hostname of the email server | |
'IDHost' => getenv('WIKIBASE_HOST') ?: 'localhost', | |
'port' => 465, | |
'auth' => true | |
// username and password are missing here on purpose, they'll be added with private config overwrite | |
]; |
wfLoadExtension( 'MatomoAnalytics' ); | ||
$wgMatomoAnalyticsServerURL='https://matomo.' . getenv('WIKIBASE_HOST') .'/'; | ||
$wgMatomoAnalyticsTokenAuth=$_ENV['MATOMO_TOKEN']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix inconsistent environment variable access and add missing semicolon
There are several issues with this configuration:
- Inconsistent environment variable access methods (
getenv()
vs$_ENV
) - No validation if environment variables exist
- Missing semicolon at the end of line 4
- Inconsistent spacing around operators
wfLoadExtension( 'MatomoAnalytics' );
-$wgMatomoAnalyticsServerURL='https://matomo.' . getenv('WIKIBASE_HOST') .'/';
-$wgMatomoAnalyticsTokenAuth=$_ENV['MATOMO_TOKEN'];
+$wgMatomoAnalyticsServerURL = 'https://matomo.' . (getenv('WIKIBASE_HOST') ?: 'localhost') . '/';
+$wgMatomoAnalyticsTokenAuth = $_ENV['MATOMO_TOKEN'] ?? '';
Consider using a consistent method for accessing environment variables and add validation to handle cases when they're not set.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
wfLoadExtension( 'MatomoAnalytics' ); | |
$wgMatomoAnalyticsServerURL='https://matomo.' . getenv('WIKIBASE_HOST') .'/'; | |
$wgMatomoAnalyticsTokenAuth=$_ENV['MATOMO_TOKEN']; | |
wfLoadExtension( 'MatomoAnalytics' ); | |
$wgMatomoAnalyticsServerURL = 'https://matomo.' . (getenv('WIKIBASE_HOST') ?: 'localhost') . '/'; | |
$wgMatomoAnalyticsTokenAuth = $_ENV['MATOMO_TOKEN'] ?? ''; |
## VisualEditor Extension | ||
wfLoadExtension( 'VisualEditor' ); | ||
wfLoadExtension( 'Parsoid', "{$IP}/vendor/wikimedia/parsoid/extension.json" ); | ||
$wgVisualEditorRebaserURL='wikimongo.' . getenv('WIKIBASE_HOST'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add protocol and error handling for environment variable
The URL configuration is missing a protocol specification and lacks validation for the environment variable:
-$wgVisualEditorRebaserURL='wikimongo.' . getenv('WIKIBASE_HOST');
+$wgVisualEditorRebaserURL='http://wikimongo.' . (getenv('WIKIBASE_HOST') ?: 'localhost');
This ensures a valid URL is constructed even if the environment variable is not set.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
$wgVisualEditorRebaserURL='wikimongo.' . getenv('WIKIBASE_HOST'); | |
$wgVisualEditorRebaserURL='http://wikimongo.' . (getenv('WIKIBASE_HOST') ?: 'localhost'); |
}; | ||
# https://github.com/ProfessionalWiki/MardiSkin | ||
wfLoadExtension( 'Bootstrap' ); | ||
wfLoadskin( 'chameleon' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible function name mismatch.
MediaWiki’s standard function name is wfLoadSkin
with a capital “S.” Verify whether wfLoadskin
is a valid alias or correct it:
-wfLoadskin( 'chameleon' );
+wfLoadSkin( 'chameleon' );
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
wfLoadskin( 'chameleon' ); | |
wfLoadSkin( 'chameleon' ); |
As discussed with @eloiferrer we would want to have LocalSettings.d rather stored in this repository than in docker-compose
Summary by CodeRabbit
New Features
Chore