Add support for blacklisting common passwords
[lhc/web/wiklou.git] / includes / DefaultSettings.php
index f0049f5..be6b5ec 100644 (file)
@@ -805,7 +805,7 @@ $wgRepositoryBaseUrl = "https://commons.wikimedia.org/wiki/File:";
  * such as odt or doc, and untrusted users are allowed to upload files, then
  * your wiki will be vulnerable to cross-site request forgery (CSRF).
  */
-$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg' );
+$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'webp' );
 
 /**
  * Files with these extensions will never be allowed as uploads.
@@ -2211,7 +2211,7 @@ $wgObjectCaches = array(
        CACHE_DB => array( 'class' => 'SqlBagOStuff', 'loggroup' => 'SQLBagOStuff' ),
 
        CACHE_ANYTHING => array( 'factory' => 'ObjectCache::newAnything' ),
-       CACHE_ACCEL => array( 'factory' => 'ObjectCache::newAccelerator' ),
+       CACHE_ACCEL => array( 'factory' => 'ObjectCache::getLocalServerInstance' ),
        CACHE_MEMCACHED => array( 'class' => 'MemcachedPhpBagOStuff', 'loggroup' => 'memcached' ),
 
        'db-replicated' => array(
@@ -3397,14 +3397,14 @@ $wgMangleFlashPolicy = true;
 /** @} */ # End of output format settings }
 
 /*************************************************************************//**
- * @name   Resource loader settings
+ * @name   ResourceLoader settings
  * @{
  */
 
 /**
  * Client-side resource modules.
  *
- * Extensions should add their resource loader module definitions
+ * Extensions should add their ResourceLoader module definitions
  * to the $wgResourceModules variable.
  *
  * @par Example:
@@ -3529,7 +3529,7 @@ $wgResourceLoaderSources = array();
 $wgResourceBasePath = null;
 
 /**
- * Maximum time in seconds to cache resources served by the resource loader.
+ * Maximum time in seconds to cache resources served by ResourceLoader.
  * Used to set last modified headers (max-age/s-maxage).
  *
  * Following options to distinguish:
@@ -3736,7 +3736,7 @@ $wgResourceLoaderStorageVersion = 1;
  */
 $wgAllowSiteCSSOnRestrictedPages = false;
 
-/** @} */ # End of resource loader settings }
+/** @} */ # End of ResourceLoader settings }
 
 /*************************************************************************//**
  * @name   Page title and interwiki link settings
@@ -4352,6 +4352,10 @@ $wgActiveUserDays = 30;
  *     - PasswordCannotMatchUsername - Password cannot match username to
  *     - PasswordCannotMatchBlacklist - Username/password combination cannot
  *             match a specific, hardcoded blacklist.
+ *     - PasswordCannotBePopular - Blacklist passwords which are known to be
+ *             commonly chosen. Set to integer n to ban the top n passwords.
+ *             If you want to ban all common passwords on file, use the
+ *             PHP_INT_MAX constant.
  * @since 1.26
  */
 $wgPasswordPolicy = array(
@@ -4360,11 +4364,13 @@ $wgPasswordPolicy = array(
                        'MinimalPasswordLength' => 8,
                        'MinimumPasswordLengthToLogin' => 1,
                        'PasswordCannotMatchUsername' => true,
+                       'PasswordCannotBePopular' => 25,
                ),
                'sysop' => array(
                        'MinimalPasswordLength' => 8,
                        'MinimumPasswordLengthToLogin' => 1,
                        'PasswordCannotMatchUsername' => true,
+                       'PasswordCannotBePopular' => 25,
                ),
                'bot' => array(
                        'MinimalPasswordLength' => 8,
@@ -4384,6 +4390,7 @@ $wgPasswordPolicy = array(
                'PasswordCannotMatchUsername' => 'PasswordPolicyChecks::checkPasswordCannotMatchUsername',
                'PasswordCannotMatchBlacklist' => 'PasswordPolicyChecks::checkPasswordCannotMatchBlacklist',
                'MaximalPasswordLength' => 'PasswordPolicyChecks::checkMaximalPasswordLength',
+               'PasswordCannotBePopular' => 'PasswordPolicyChecks::checkPopularPasswordBlacklist'
        ),
 );
 
@@ -7776,6 +7783,19 @@ $wgVirtualRestConfig = array(
  */
 $wgSearchRunSuggestedQuery = true;
 
+/**
+ * Where popular password file is located.
+ *
+ * Default in core contains 50,000 most popular. This config
+ * allows you to change which file, in case you want to generate
+ * a password file with > 50000 entries in it.
+ *
+ * @see maintenance/createCommonPasswordCdb.php
+ * @since 1.27
+ * @var string path to file
+ */
+$wgPopularPasswordFile = __DIR__ . '/../serialized/commonpasswords.cdb';
+
 /**
  * For really cool vim folding this needs to be at the end:
  * vim: foldmarker=@{,@} foldmethod=marker