Support redirects in JavaScriptContent
[lhc/web/wiklou.git] / includes / DefaultSettings.php
index 857d69e..baefef9 100644 (file)
@@ -82,6 +82,14 @@ $wgVersion = '1.26alpha';
  */
 $wgSitename = 'MediaWiki';
 
+/**
+ * When the wiki is running behind a proxy and this is set to true, assumes that the proxy exposes
+ * the wiki on the standard ports (443 for https and 80 for http).
+ * @var bool
+ * @since 1.26
+ */
+$wgAssumeProxiesUseDefaultProtocolPorts = true;
+
 /**
  * URL of the server.
  *
@@ -472,13 +480,13 @@ $wgImgAuthUrlPathMap = array();
  *
  * These settings describe a foreign MediaWiki installation. They are optional, and will be ignored
  * for local repositories:
- *   - descBaseUrl       URL of image description pages, e.g. http://en.wikipedia.org/wiki/File:
+ *   - descBaseUrl       URL of image description pages, e.g. https://en.wikipedia.org/wiki/File:
  *   - scriptDirUrl      URL of the MediaWiki installation, equivalent to $wgScriptPath, e.g.
- *                       http://en.wikipedia.org/w
+ *                       https://en.wikipedia.org/w
  *   - scriptExtension   Script extension of the MediaWiki installation, equivalent to
  *                       $wgScriptExtension, e.g. .php5 defaults to .php
  *
- *   - articleUrl        Equivalent to $wgArticlePath, e.g. http://en.wikipedia.org/wiki/$1
+ *   - articleUrl        Equivalent to $wgArticlePath, e.g. https://en.wikipedia.org/wiki/$1
  *   - fetchDescription  Fetch the text of the remote file description page. Equivalent to
  *                       $wgFetchCommonsDescriptions.
  *   - abbrvThreshold    File names over this size will use the short form of thumbnail names.
@@ -709,7 +717,7 @@ $wgMaxUploadSize = 1024 * 1024 * 100; # 100MB
  *
  * @par Example:
  * @code
- * $wgUploadNavigationUrl = 'http://commons.wikimedia.org/wiki/Special:Upload';
+ * $wgUploadNavigationUrl = 'https://commons.wikimedia.org/wiki/Special:Upload';
  * @endcode
  */
 $wgUploadNavigationUrl = false;
@@ -769,7 +777,7 @@ $wgHashedSharedUploadDirectory = true;
  *
  * Please specify the namespace, as in the example below.
  */
-$wgRepositoryBaseUrl = "http://commons.wikimedia.org/wiki/File:";
+$wgRepositoryBaseUrl = "https://commons.wikimedia.org/wiki/File:";
 
 /**
  * This is the list of preferred extensions for uploading files. Uploading files
@@ -876,6 +884,7 @@ $wgMediaHandlers = array(
        'image/png' => 'PNGHandler',
        'image/gif' => 'GIFHandler',
        'image/tiff' => 'TiffHandler',
+       'image/webp' => 'WebPHandler',
        'image/x-ms-bmp' => 'BmpHandler',
        'image/x-bmp' => 'BmpHandler',
        'image/x-xcf' => 'XCFHandler',
@@ -970,6 +979,14 @@ $wgJpegTran = '/usr/bin/jpegtran';
  */
 $wgExiv2Command = '/usr/bin/exiv2';
 
+
+/**
+ * Path to exiftool binary. Used for lossless ICC profile swapping.
+ *
+ * @since 1.26
+ */
+$wgExiftool = '/usr/bin/exiftool';
+
 /**
  * Scalable Vector Graphics (SVG) may be uploaded as images.
  * Since SVG support is not yet standard in browsers, it is
@@ -1322,6 +1339,14 @@ $wgUploadThumbnailRenderHttpCustomHost = false;
  */
 $wgUploadThumbnailRenderHttpCustomDomain = false;
 
+/**
+ * When this variable is true and JPGs use the sRGB ICC profile, swaps it for the more lightweight
+ * (and free) TinyRGB profile when generating thumbnails.
+ *
+ * @since 1.26
+ */
+$wgUseTinyRGBForJPGThumbnails = false;
+
 /**
  * Default parameters for the "<gallery>" tag
  */
@@ -1572,7 +1597,8 @@ $wgEnotifRevealEditorAddress = false;
 
 /**
  * Send notification mails on minor edits to watchlist pages. This is enabled
- * by default. Does not affect user talk notifications.
+ * by default. User talk notifications are affected by this, $wgEnotifUserTalk, and
+ * the nominornewtalk user right.
  */
 $wgEnotifMinorEdits = true;
 
@@ -1597,15 +1623,6 @@ $wgEnotifMaxRecips = 500;
  */
 $wgEnotifUseJobQ = false;
 
-/**
- * Use the job queue for user activity updates like updating "last visited"
- * fields for email notifications of page changes. This should only be enabled
- * if the jobs have a dedicated runner to avoid update lag.
- *
- * @since 1.26
- */
-$wgActivityUpdatesUseJobQueue = false;
-
 /**
  * Use real name instead of username in e-mail "from" field.
  */
@@ -2151,6 +2168,19 @@ $wgObjectCaches = array(
        CACHE_ACCEL => array( 'factory' => 'ObjectCache::newAccelerator' ),
        CACHE_MEMCACHED => array( 'factory' => 'ObjectCache::newMemcached', 'loggroup' => 'memcached' ),
 
+       'db-replicated' => array(
+               'class'       => 'ReplicatedBagOStuff',
+               'readFactory' => array(
+                       'class' => 'SqlBagOStuff',
+                       'args'  => array( array( 'slaveOnly' => true ) )
+               ),
+               'writeFactory' => array(
+                       'class' => 'SqlBagOStuff',
+                       'args'  => array( array( 'slaveOnly' => false ) )
+               ),
+               'loggroup'  => 'SQLBagOStuff'
+       ),
+
        'apc' => array( 'class' => 'APCBagOStuff' ),
        'xcache' => array( 'class' => 'XCacheBagOStuff' ),
        'wincache' => array( 'class' => 'WinCacheBagOStuff' ),
@@ -2160,7 +2190,7 @@ $wgObjectCaches = array(
 );
 
 /**
- * Main cache Wide-Area-Network cache type. This should be a cache with fast access,
+ * Main Wide-Area-Network cache type. This should be a cache with fast access,
  * but it may have limited space. By default, it is disabled, since the basic stock
  * cache is not fast enough to make it worthwhile. For single data-center setups, this can
  * simply be pointed to a cache in $wgWANObjectCaches that uses a local $wgObjectCaches
@@ -2171,7 +2201,8 @@ $wgObjectCaches = array(
  *                       a relayer (only matters if there are multiple data-centers)
  *   - CACHE_NONE:       Do not cache
  *   - (other):          A string may be used which identifies a cache
- *                       configuration in $wgWANObjectCaches.
+ *                       configuration in $wgWANObjectCaches
+ * @since 1.26
  */
 $wgMainWANCache = false;
 
@@ -2187,6 +2218,8 @@ $wgMainWANCache = false;
  * a cache identifier from $wgObjectCaches. The "relayerConfig" parameter is an
  * array used to construct an EventRelayer object. The "pool" parameter is a
  * string that is used as a PubSub channel prefix.
+ *
+ * @since 1.26
  */
 $wgWANObjectCaches = array(
        CACHE_NONE => array(
@@ -2205,6 +2238,22 @@ $wgWANObjectCaches = array(
        */
 );
 
+/**
+ * Main object stash type. This should be a fast storage system for storing
+ * lightweight data like hit counters and user activity. Sites with multiple
+ * data-centers should have this use a store that replicates all writes. The
+ * store should have enough consistency for CAS operations to be usable.
+ * Reads outside of those needed for merge() may be eventually consistent.
+ *
+ * The options are:
+ *   - db:      Store cache objects in the DB
+ *   - (other): A string may be used which identifies a cache
+ *              configuration in $wgObjectCaches
+ *
+ * @since 1.26
+ */
+$wgMainStash = 'db-replicated';
+
 /**
  * The expiry time for the parser cache, in seconds.
  * The default is 86400 (one day).
@@ -2279,11 +2328,13 @@ $wgAdaptiveMessageCache = false;
  * Localisation cache configuration. Associative array with keys:
  * class:       The class to use. May be overridden by extensions.
  *
- * store:       The location to store cache data. May be 'files', 'db' or
+ * store:       The location to store cache data. May be 'files', 'array', 'db' or
  *              'detect'. If set to "files", data will be in CDB files. If set
  *              to "db", data will be stored to the database. If set to
  *              "detect", files will be used if $wgCacheDirectory is set,
  *              otherwise the database will be used.
+ *              "array" is an experimental option that uses PHP files that
+ *              store static arrays.
  *
  * storeClass:  The class name for the underlying storage. If set to a class
  *              name, it overrides the "store" setting.
@@ -2351,13 +2402,8 @@ $wgUseFileCache = false;
 $wgFileCacheDepth = 2;
 
 /**
- * Keep parsed pages in a cache (objectcache table or memcached)
- * to speed up output of the same page viewed by another user with the
- * same options.
- *
- * This can provide a significant speedup for medium to large pages,
- * so you probably want to keep it on. Extensions that conflict with the
- * parser cache should disable the cache on a per-page basis instead.
+ * Kept for extension compatibility; see $wgParserCacheType
+ * @deprecated 1.26
  */
 $wgEnableParserCache = true;
 
@@ -2487,13 +2533,16 @@ $wgInternalServer = false;
 /**
  * Cache timeout for the squid, will be sent as s-maxage (without ESI) or
  * Surrogate-Control (with ESI). Without ESI, you should strip out s-maxage in
- * the Squid config. 18000 seconds = 5 hours, more cache hits with 2678400 = 31
- * days
+ * the Squid config.
+ *
+* 18000 seconds = 5 hours, more cache hits with 2678400 = 31 days.
  */
 $wgSquidMaxage = 18000;
 
 /**
  * Default maximum age for raw CSS/JS accesses
+ *
+ * 300 seconds = 5 minutes.
  */
 $wgForcedRawSMaxage = 300;
 
@@ -2782,14 +2831,14 @@ $wgBrowserBlackList = array(
         * - Mozilla/4.0 (compatible; MSIE 5.23; Mac_PowerPC)
         * - [...]
         *
-        * @link http://en.wikipedia.org/w/index.php?diff=12356041&oldid=12355864
-        * @link http://en.wikipedia.org/wiki/Template%3AOS9
+        * @link https://en.wikipedia.org/w/index.php?diff=12356041&oldid=12355864
+        * @link https://en.wikipedia.org/wiki/Template%3AOS9
         */
        '/^Mozilla\/4\.0 \(compatible; MSIE \d+\.\d+; Mac_PowerPC\)/',
 
        /**
         * Google wireless transcoder, seems to eat a lot of chars alive
-        * http://it.wikipedia.org/w/index.php?title=Luciano_Ligabue&diff=prev&oldid=8857361
+        * https://it.wikipedia.org/w/index.php?title=Luciano_Ligabue&diff=prev&oldid=8857361
         */
        '/^Mozilla\/4\.0 \(compatible; MSIE 6.0; Windows NT 5.0; Google Wireless Transcoder;\)/'
 );
@@ -4237,6 +4286,59 @@ $wgActiveUserDays = 30;
  * @{
  */
 
+/**
+ * Password policy for local wiki users. A user's effective policy
+ * is the superset of all policy statements from the policies for the
+ * groups where the user is a member. If more than one group policy
+ * include the same policy statement, the value is the max() of the
+ * values. Note true > false. The 'default' policy group is required,
+ * and serves as the minimum policy for all users. New statements can
+ * be added by appending to $wgPasswordPolicy['checks'].
+ * Statements:
+ *     - MinimalPasswordLength - minimum length a user can set
+ *     - MinimumPasswordLengthToLogin - passwords shorter than this will
+ *             not be allowed to login, regardless if it is correct.
+ *     - MaximalPasswordLength - maximum length password a user is allowed
+ *             to attempt. Prevents DoS attacks with pbkdf2.
+ *     - PasswordCannotMatchUsername - Password cannot match username to
+ *     - PasswordCannotMatchBlacklist - Username/password combination cannot
+ *             match a specific, hardcoded blacklist.
+ * @since 1.26
+ */
+$wgPasswordPolicy = array(
+       'policies' => array(
+               'bureaucrat' => array(
+                       'MinimalPasswordLength' => 8,
+                       'MinimumPasswordLengthToLogin' => 1,
+                       'PasswordCannotMatchUsername' => true,
+               ),
+               'sysop' => array(
+                       'MinimalPasswordLength' => 8,
+                       'MinimumPasswordLengthToLogin' => 1,
+                       'PasswordCannotMatchUsername' => true,
+               ),
+               'bot' => array(
+                       'MinimalPasswordLength' => 8,
+                       'MinimumPasswordLengthToLogin' => 1,
+                       'PasswordCannotMatchUsername' => true,
+               ),
+               'default' => array(
+                       'MinimalPasswordLength' => 1,
+                       'PasswordCannotMatchUsername' => true,
+                       'PasswordCannotMatchBlacklist' => true,
+                       'MaximalPasswordLength' => 4096,
+               ),
+       ),
+       'checks' => array(
+               'MinimalPasswordLength' => 'PasswordPolicyChecks::checkMinimalPasswordLength',
+               'MinimumPasswordLengthToLogin' => 'PasswordPolicyChecks::checkMinimumPasswordLengthToLogin',
+               'PasswordCannotMatchUsername' => 'PasswordPolicyChecks::checkPasswordCannotMatchUsername',
+               'PasswordCannotMatchBlacklist' => 'PasswordPolicyChecks::checkPasswordCannotMatchBlacklist',
+               'MaximalPasswordLength' => 'PasswordPolicyChecks::checkMaximalPasswordLength',
+       ),
+);
+
+
 /**
  * For compatibility with old installations set to false
  * @deprecated since 1.24 will be removed in future
@@ -4246,8 +4348,9 @@ $wgPasswordSalt = true;
 /**
  * Specifies the minimal length of a user password. If set to 0, empty pass-
  * words are allowed.
+ * @deprecated since 1.26, use $wgPasswordPolicy's MinimalPasswordLength.
  */
-$wgMinimalPasswordLength = 1;
+$wgMinimalPasswordLength = false;
 
 /**
  * Specifies the maximal length of a user password (T64685).
@@ -4258,8 +4361,9 @@ $wgMinimalPasswordLength = 1;
  *
  * @warning Unlike other password settings, user with passwords greater than
  *      the maximum will not be able to log in.
+ * @deprecated since 1.26, use $wgPasswordPolicy's MaximalPasswordLength.
  */
-$wgMaximalPasswordLength = 4096;
+$wgMaximalPasswordLength = false;
 
 /**
  * Specifies if users should be sent to a password-reset form on login, if their
@@ -4335,7 +4439,7 @@ $wgPasswordConfig = array(
  */
 $wgPasswordResetRoutes = array(
        'username' => true,
-       'email' => false,
+       'email' => true,
 );
 
 /**
@@ -4454,7 +4558,7 @@ $wgUserrightsInterwikiDelimiter = '@';
 /**
  * This is to let user authenticate using https when they come from http.
  * Based on an idea by George Herbert on wikitech-l:
- * http://lists.wikimedia.org/pipermail/wikitech-l/2010-October/050039.html
+ * https://lists.wikimedia.org/pipermail/wikitech-l/2010-October/050039.html
  * @since 1.17
  */
 $wgSecureLogin = false;
@@ -4981,7 +5085,7 @@ $wgAccountCreationThrottle = 0;
  * There's no administrator override on-wiki, so be careful what you set. :)
  * May be an array of regexes or a single string for backwards compatibility.
  *
- * @see http://en.wikipedia.org/wiki/Regular_expression
+ * @see https://en.wikipedia.org/wiki/Regular_expression
  *
  * @note Each regex needs a beginning/end delimiter, eg: # or /
  */
@@ -5179,6 +5283,22 @@ $wgProxyList = array();
  */
 $wgCookieExpiration = 180 * 86400;
 
+/**
+ * The identifiers of the login cookies that can have their lifetimes
+ * extended independently of all other login cookies.
+ *
+ * @var string[]
+ */
+$wgExtendedLoginCookies = array( 'UserID', 'Token' );
+
+/**
+ * Default login cookie lifetime, in seconds. Setting
+ * $wgExtendLoginCookieExpiration to null will use $wgCookieExpiration to
+ * calculate the cookie lifetime. As with $wgCookieExpiration, 0 will make
+ * login cookies session-only.
+ */
+$wgExtendedLoginCookieExpiration = null;
+
 /**
  * Set to set an explicit domain on the login cookies eg, "justthis.domain.org"
  * or ".any.subdomain.net"
@@ -5512,7 +5632,7 @@ $wgProfilePerHost = null;
  *
  * The host should be running a daemon which can be obtained from MediaWiki
  * Git at:
- * http://git.wikimedia.org/tree/operations%2Fsoftware.git/master/udpprofile
+ * https://git.wikimedia.org/tree/operations%2Fsoftware.git/master/udpprofile
  *
  * @deprecated set $wgProfiler['udphost'] instead
  */
@@ -5568,6 +5688,29 @@ $wgAggregateStatsID = false;
  */
 $wgStatsFormatString = "stats/%s - %s 1 1 1 1 %s\n";
 
+/**
+ * Destination of statsd metrics.
+ *
+ * A host or host:port of a statsd server. Port defaults to 8125.
+ *
+ * If not set, statsd metrics will not be collected.
+ *
+ * @see wfLogProfilingData
+ * @since 1.25
+ */
+$wgStatsdServer = false;
+
+/**
+ * Prefix for metric names sent to wgStatsdServer.
+ *
+ * Defaults to "MediaWiki".
+ *
+ * @see RequestContext::getStats
+ * @see BufferingStatsdDataFactory
+ * @since 1.25
+ */
+$wgStatsdMetricPrefix = false;
+
 /**
  * InfoAction retrieves a list of transclusion links (both to and from).
  * This number puts a limit on that query in the case of highly transcluded
@@ -5900,6 +6043,21 @@ $wgGitRepositoryViewers = array(
  */
 $wgRCMaxAge = 90 * 24 * 3600;
 
+/**
+ * Page watchers inactive for more than this many seconds are considered inactive.
+ * Used mainly by action=info. Default: 180 days = about six months.
+ * @since 1.26
+ */
+$wgWatchersMaxAge = 180 * 24 * 3600;
+
+/**
+ * If active watchers (per above) are this number or less, do not disclose it.
+ * Left to 1, prevents unprivileged users from knowing for sure that there are 0.
+ * Set to -1 if you want to always complement watchers count with this info.
+ * @since 1.26
+ */
+$wgUnwatchedPageSecret = 1;
+
 /**
  * Filter $wgRCLinkDays by $wgRCMaxAge to avoid showing links for numbers
  * higher than what will be stored. Note that this is disabled by default
@@ -6569,7 +6727,7 @@ $wgJobSerialCommitThreshold = false;
  * These settings should be global to all wikis.
  */
 $wgJobTypeConf = array(
-       'default' => array( 'class' => 'JobQueueDB', 'order' => 'random' ),
+       'default' => array( 'class' => 'JobQueueDB', 'order' => 'random', 'claimTTL' => 3600 ),
 );
 
 /**
@@ -6685,6 +6843,7 @@ $wgLogTypes = array(
        'suppress',
        'tag',
        'managetags',
+       'contentmodel',
 );
 
 /**
@@ -6760,15 +6919,15 @@ $wgLogNames = array(
 $wgLogHeaders = array(
        '' => 'alllogstext',
        'block' => 'blocklogtext',
-       'protect' => 'protectlogtext',
-       'rights' => 'rightslogtext',
        'delete' => 'dellogpagetext',
-       'upload' => 'uploadlogpagetext',
-       'move' => 'movelogpagetext',
        'import' => 'importlogpagetext',
-       'patrol' => 'patrol-log-header',
        'merge' => 'mergelogpagetext',
+       'move' => 'movelogpagetext',
+       'patrol' => 'patrol-log-header',
+       'protect' => 'protectlogtext',
+       'rights' => 'rightslogtext',
        'suppress' => 'suppressionlogtext',
+       'upload' => 'uploadlogpagetext',
 );
 
 /**
@@ -6778,10 +6937,10 @@ $wgLogHeaders = array(
  * Extensions with custom log types may add to this array.
  */
 $wgLogActions = array(
-       'protect/protect' => 'protectedarticle',
        'protect/modify' => 'modifiedarticleprotection',
-       'protect/unprotect' => 'unprotectedarticle',
        'protect/move_prot' => 'movedarticleprotection',
+       'protect/protect' => 'protectedarticle',
+       'protect/unprotect' => 'unprotectedarticle',
 );
 
 /**
@@ -6791,34 +6950,35 @@ $wgLogActions = array(
  * @see LogFormatter
  */
 $wgLogActionsHandlers = array(
-       'move/move' => 'MoveLogFormatter',
-       'move/move_redir' => 'MoveLogFormatter',
+       'block/block' => 'BlockLogFormatter',
+       'block/reblock' => 'BlockLogFormatter',
+       'block/unblock' => 'BlockLogFormatter',
+       'contentmodel/change' => 'ContentModelLogFormatter',
        'delete/delete' => 'DeleteLogFormatter',
+       'delete/event' => 'DeleteLogFormatter',
        'delete/restore' => 'DeleteLogFormatter',
        'delete/revision' => 'DeleteLogFormatter',
-       'delete/event' => 'DeleteLogFormatter',
-       'suppress/revision' => 'DeleteLogFormatter',
-       'suppress/event' => 'DeleteLogFormatter',
-       'suppress/delete' => 'DeleteLogFormatter',
-       'patrol/patrol' => 'PatrolLogFormatter',
-       'rights/rights' => 'RightsLogFormatter',
-       'rights/autopromote' => 'RightsLogFormatter',
-       'upload/upload' => 'UploadLogFormatter',
-       'upload/overwrite' => 'UploadLogFormatter',
-       'upload/revert' => 'UploadLogFormatter',
-       'merge/merge' => 'MergeLogFormatter',
-       'tag/update' => 'TagLogFormatter',
-       'managetags/create' => 'LogFormatter',
-       'managetags/delete' => 'LogFormatter',
+       'import/interwiki' => 'LogFormatter',
+       'import/upload' => 'LogFormatter',
        'managetags/activate' => 'LogFormatter',
+       'managetags/create' => 'LogFormatter',
        'managetags/deactivate' => 'LogFormatter',
-       'block/block' => 'BlockLogFormatter',
-       'block/unblock' => 'BlockLogFormatter',
-       'block/reblock' => 'BlockLogFormatter',
+       'managetags/delete' => 'LogFormatter',
+       'merge/merge' => 'MergeLogFormatter',
+       'move/move' => 'MoveLogFormatter',
+       'move/move_redir' => 'MoveLogFormatter',
+       'patrol/patrol' => 'PatrolLogFormatter',
+       'rights/autopromote' => 'RightsLogFormatter',
+       'rights/rights' => 'RightsLogFormatter',
        'suppress/block' => 'BlockLogFormatter',
+       'suppress/delete' => 'DeleteLogFormatter',
+       'suppress/event' => 'DeleteLogFormatter',
        'suppress/reblock' => 'BlockLogFormatter',
-       'import/upload' => 'LogFormatter',
-       'import/interwiki' => 'LogFormatter',
+       'suppress/revision' => 'DeleteLogFormatter',
+       'tag/update' => 'TagLogFormatter',
+       'upload/overwrite' => 'UploadLogFormatter',
+       'upload/revert' => 'UploadLogFormatter',
+       'upload/upload' => 'UploadLogFormatter',
 );
 
 /**
@@ -6844,14 +7004,6 @@ $wgAllowSpecialInclusion = true;
  */
 $wgDisableQueryPageUpdate = false;
 
-/**
- * List of special pages, followed by what subtitle they should go under
- * at Special:SpecialPages
- *
- * @deprecated since 1.21 Override SpecialPage::getGroupName instead
- */
-$wgSpecialPageGroups = array();
-
 /**
  * On Special:Unusedimages, consider images "used", if they are put
  * into a category. Default (false) is not to count those as used.