Commit graph

3596 commits

Author SHA1 Message Date
jenkins-bot
395e60b088 Merge "Simpler RedisLockManager configuration" 2021-11-03 22:38:18 +00:00
Umherirrender
07820b24ae Remove duplicate settings from DefaultSettings
Change-Id: Icb02cc5ddf2a065d77d4ac666047b9f08e799c33
2021-11-03 00:11:11 +00:00
Tim Starling
06fc5ddb56 Simpler RedisLockManager configuration
I set up a local test instance with RedisLockManager, but some things
seemed more complicated than they needed to be. So:

* Add lockManager option to $wgLocalFileRepo, which becomes the
  lockManager of the auto-generated file backend.
* Made srvsByBucket be optional. I made the same change to the identical
  code in MemcLockManager and DBLockManager, but I didn't test them.
* Improved doc comments for RedisLockManager::__construct() and
  $wgLocalFileRepo.

Change-Id: I8ce430b8e849589d4ea87c90a56ee3659da085a0
2021-11-02 18:28:23 +11:00
James D. Forrester
20fd877da4 Drop experimental FileJournal system without deprecation
The feature was introduced in 2012 with d19f54602f (just before
the gerrit migration).

Change-Id: Ia3f59ad0ddeb1f610947b14e22b0694ff4c6ed84
2021-11-01 14:08:09 +11:00
Tks4Fish
76e3701d6a OutputPage: Remove $wgLoggedOutMaxAge experiment and related tests
Bug: T293848
Change-Id: I5e5e52fac7fe389b36715dae11cc30cdb2b9136a
2021-10-25 19:33:32 +00:00
jenkins-bot
93821348aa Merge "Allow using a reverse proxy for local HTTP requests" 2021-10-16 04:41:08 +00:00
Kunal Mehta
cc241c2add Allow using a reverse proxy for local HTTP requests
$wgLocalHTTPProxy can be used to configure a reverse proxy
for requests to domains in $wgLocalVirtualHosts. The previous
implementation of using it as a proper HTTP proxy is no longer
supported and has been reverted out of REL1_37 (856da72363d1ba8bf).

It sets the hostname of the request as a "Host" header, scheme as
"X-Forwarded-Proto" and then sets the proxy's scheme, host and port as
those of the request.

Bug: T288848
Change-Id: Ibc3616f5ad925d464d937ab15461a88619c8b7a7
2021-10-15 10:56:46 -07:00
jenkins-bot
2303886bc9 Merge "Add $wgParserEnableLegacyMediaDOM to REL1-37 release notes" 2021-10-14 20:41:34 +00:00
Arlo Breault
b770956968 Add $wgParserEnableLegacyMediaDOM to REL1-37 release notes
Bug: T51097
Change-Id: Iabc092b643bfb9d6bc90559f230ae6a84f6d544d
2021-10-14 16:03:27 -04:00
Martin Urbanec
ba53aa6d78 Add unwatchedpages to the basic grant
This is a fairly low-risk right, I think viewing
deleted content (viewdeleted) or OS logs (viewrestrictedlogs)
should be separate from this. The basic grant already has
other low-risk rights, like patrolmarks or abusefilter-log-detail,
so I think it should be fine to add this too.

Alternatively, we can create a new grant instead.

Bug: T292940
Change-Id: Ied76fe0e6f896e56029fb40f1197e87f3f5ff68a
2021-10-11 10:16:23 +02:00
Cole White
0e150f8cb2 Metrics: Wire up MetricsFactory into ServiceWiring and emit steps
* Adds DefaultSettings options
 * Wires up MetricsFactory into ServiceWiring
 * Performs MetricsFactory->flush() in restInPeace()

Bug: T240685
Bug: T205870
Change-Id: I46f0a09f4dab38fa4c9495aa2da9ecab60376ca7
2021-10-07 16:19:42 +02:00
jenkins-bot
db6d49320a Merge "DefaultSettings: Note that wgEnablePartialActionBlocks is retained for REL1_37" 2021-10-06 23:27:12 +00:00
jenkins-bot
05d4865d76 Merge "Drop jQuery migrate" 2021-10-06 00:15:36 +00:00
James D. Forrester
709fe57144 DefaultSettings: Note that wgEnablePartialActionBlocks is retained for REL1_37
Bug: T280531
Change-Id: Idaf7e374d5c8fe04e2e851f84fef4e134ff83f00
2021-10-05 16:50:56 -07:00
jenkins-bot
ce0f3ffea4 Merge "Add a separate config for content.media.less" 2021-10-05 23:23:56 +00:00
Arlo Breault
8b5f95a963 Add a separate config for content.media.less
It's already shipped when $wgParserEnableLegacyMediaDOM is disabled, but
having separate config for it will allow us to leave it enabled should
we re-enable $wgParserEnableLegacyMediaDOM and still have content in
the cache that needs styling.

Bug: T292498
Bug: T51097
Change-Id: I027d3a718b0c1a3eebe4b55983540ad2f28d229a
2021-10-05 18:50:17 -04:00
Amir Sarabadani
649bbdd6c5 Remove "auto-number headings" preference
Bug: T284921
Change-Id: Ic9ed88f419419cf4cc5cc32010539eea8b76314b
2021-10-03 00:47:08 +02:00
Amir Sarabadani
388f098bdd Drop jQuery migrate
Bug: T280944
Change-Id: I3c87b3ef925f942489720fabc6aea2433ca2d1be
2021-09-30 18:29:05 +02:00
Tim Starling
65b1b6b56a Remove $wgShellLocale, always use C
$wgShellLocale was a flawed solution to the problem of locale
dependence. MediaWiki has its own concept of locale (the Language
hierarchy) and any kind of dependence on the server's libc locale is
incorrect and harmful, leading to bugs. Developers have an expectation
that functions like strtolower() will work in a certain way, and
respecting the locale set in the environment at install time violates
this expectation.

The problems with using C as a locale, which led to $wgShellLocale, are:

* escapeshellarg() will strip non-ASCII characters. This can be worked
  around by not using it. The security vulnerability it was trying to
  fix can be prevented in another way.
* Shell commands like rsvg will fail to correctly interpret UTF-8
  arguments. This is the reason for the putenv(). On Linux, this can
  be fixed by using C.UTF-8, which we didn't know at the time. On
  Windows, the problem is not relevant (there are unrelated issues
  with UTF-8 arguments).

Bug: T291234
Change-Id: Ib5ac0e7bc720dcc094303a358ee1c7bbdcfc6447
2021-09-24 17:25:01 -07:00
Kunal Mehta
a7c90ecc5f Allow skipping $wgMaxImageArea check
If $wgMaxImageArea is false, MediaWiki will no longer check if the image
fits within that area before trying to scale it. Extensions can still
use the BitmapHandlerCheckImageArea hook to override it.

This is primarily useful when using an external scaler like Wikimedia
does with Thumbor, which decides whether it can scale images by using a
timeout rather than based on size.

Codesearch indicates that the only extension checking this setting is
PagedTiffHandler, which will be updated in Iefa67321d07f7.

Bug: T291014
Depends-On: Iefa67321d07f79d982388231e02e87e2f18aed40
Change-Id: Id10173bbddb32bc70e036f426369cfbea52cecf4
2021-09-23 15:33:37 -07:00
Petr Pchelko
5afc62f258 Remove stub threshold feature
Bug: T284917
Change-Id: I5c9ea04a9deca136bb7210f07200d18f97fd6686
2021-09-13 09:26:38 -07:00
jenkins-bot
1f7c0a73dc Merge "Change $wgExperimentalHtmlIds to HTML5-first" 2021-09-12 04:32:28 +00:00
Gergő Tisza
17b91bb099
Change $wgExperimentalHtmlIds to HTML5-first
Use HTML5 URL fragment encoding (leaving almost all Unicode
characters unescaped) when rendering internal links. Section titles
will still generate an anchor with the old (percent-encoding-style,
with dots instead of percents) fragment encoding, alongside the
HTML5 one, for compatiblity with external links etc.

Follows up I8780bb589002a4 which enabled the HTML5 anchors.
This follow-up was planned for 1.35 but better late than never.
Wikimedia has been using HTML5-first since 1.31 without problems.

Bug: T186267
Bug: T290464
Change-Id: If6696fb33ef95cbd29c944b48588918e8077e9f9
Depends-On: I0c846173c06698eb039ed289ad202fd3539e61a9
2021-09-11 17:41:56 -07:00
DannyS712
05cf969386 DefaultSettings: Fix typo LocalSetings -> LocalSettings
Change-Id: I862ef0d8d4ebf4a35cd757565bc398f8472fc340
2021-09-10 23:06:07 +00:00
Amir Sarabadani
64752c0fc4 Drop $wgDjvuToXML
The software behind this is abandoned and we are migrating djvu metadata
to json instead.

This doesn't affect production as we already use djvudump

Bug: T275268
Change-Id: If45ae5746ba91ba305f93603dc1e3aafba80a369
2021-09-10 23:40:31 +02:00
Reedy
4dae3b1a06 Rename four config variables to avoid 'blacklist' term
As part of our wider work on modernising and making more welcoming the
language we use within and around MediaWiki, now is a good time for us
to rename these configuration variables:

 - $wgFileBlacklist is now $wgProhibitedFileExtensions
 - $wgMimeTypeBlacklist is now $wgMimeTypeExclusions
 - $wgEnableUserEmailBlacklist is now $wgEnableUserEmailMuteList
 - $wgShortPagesNamespaceBlacklist is now $wgShortPagesNamespaceExclusions

Bug: T277987
Depends-On: I91e065c58fda144a722a41cf532e717f962d7a64
Change-Id: I558a8b20d67d48edccce0d065aec2d22992e9dda
2021-09-08 23:32:29 +01:00
jenkins-bot
27a6c36d0a Merge "build: Update mediawiki/mediawiki-phan-config to 0.11.0" 2021-09-08 03:06:10 +00:00
jenkins-bot
79615a43c1 Merge "Drop wgAjaxEditStash, deprecated in 1.36" 2021-09-07 16:45:22 +00:00
jenkins-bot
1630fed011 Merge "Block application/javascript in wgMimeTypeBlacklist too" 2021-09-07 16:31:13 +00:00
jenkins-bot
8ff1e8e74b Merge "Remove PasswordCannotMatchUsername password policy" 2021-09-07 15:24:31 +00:00
Umherirrender
07b499fbcf build: Update mediawiki/mediawiki-phan-config to 0.11.0
Addition and remove of suppression needs to be done with the version
update.

Change-Id: I3288b3cefa744b507eadebb67b8ab08c86517c1c
2021-09-07 17:19:05 +02:00
Timo Tijhof
5947b51adf profiler: Document ProfilerXhprof class options
* Remove references to "udp" profiler output, removed in MediaWiki 1.27.

* Improve $wgProfiler docs.

* Improve ProfilerXhprof docs.

* Remove some inline $wgProfiler examples,
  in favour of references to $wgProfiler.

Bug: T247332
Change-Id: I8ec3a2a38cda767d47330c67a61b842d512b30ef
2021-09-07 03:10:32 +01:00
Reedy
7a17473dd1 Remove PasswordCannotMatchUsername password policy
Bug: T242768
Change-Id: Ied6fe389a1ce6c66cbf558d2f3867fb12245ff8a
2021-09-06 14:55:12 +00:00
James D. Forrester
e0b63530ef Block application/javascript in wgMimeTypeBlacklist too
Per IETF RFC 4329 (http://www.rfc-editor.org/rfc/rfc4329.txt),
application/javascript is nominally now the main MIME type for
JavaScript files. See T250370 for some discussion over whether
we should switch MediaWiki to emitting ResourceLoader and page
objects with application/javascript instead of text/javascript
but that's a different matter.

Change-Id: I16fdf38e2b2fb2698b7683687fbc7aa26d40105a
2021-09-02 16:43:30 -07:00
Amir Sarabadani
54fb283a0a Set $wgIncludejQueryMigrate to false as default
Bug: T280944
Change-Id: I02a3e4f4a2b596ff2741436884b2ef9a4b2b9177
2021-08-29 02:09:35 +02:00
Kunal Mehta
5312ac5497 http: Add $wgLocalHTTPProxy to set a proxy for local requests
Currently requests to domains listed in $wgLocalVirtualHosts bypass
use of the standard $wgHttpProxy. With WMF's migration to Kubernetes, we
limit outgoing traffic in a much stricter manner, so even internal
requests will need to go over a proxy (e.g. Envoy).

If the domain passes MWHttpRequest::isLocalURL(), then $wgLocalHTTPProxy
will be used if set, otherwise no proxy will be used (current behavior).

Bug: T288848
Change-Id: Ifd0cbab02fa8f14a82ca34ebc7ad95b2be174434
2021-08-19 16:11:21 +00:00
James D. Forrester
1ca1b910c5 Drop wgAjaxEditStash, deprecated in 1.36
Bug: T274695
Change-Id: Ia51d889fff5132ff4f9a89d07bc04cc72f936f1f
2021-08-02 12:21:56 -07:00
Timo Tijhof
b98cca8872 language: Remove $wgLangObjCacheSize from LanguageFactory
The $wgLangObjCacheSize configuration variable was added in 2012
with commit 121cf60119. From what I could gather, no-one has ever
needed to change its value. Not for any WMF wikis, not for heavy-duty
special-purpose wikis like translatewiki.net, not for any third-parties
that have public configuration files (e.g. Fandom, WikiApiary, Miraheze),
not for developer environments, and not for test suites.

This follows-up 0484ac9e7a, where the implementation changed
from a FIFO array to use MapCacheLRU (which requires a non-zero size)
and thus introduced conditional complexity and code duplication. This
could be simplified by other means, but it seems like we could just
remove it.

Change-Id: I5143e238857f760f2a2ab6f2e0af174872e9cd43
2021-08-01 16:22:34 +01:00
DannyS712
20293e4c99 Add an ActionFactory and start converting to DI
$wgActions used to map string action names to true,
false, a string, a callable, or an object. Now it can also
be an array (that isn't a callable) corresponding to an
ObjectFactory spec for DI.

This patch converts the revisiondelete and rollback actions to
use DI, with the rest to be converted later. The new structure
of $wgActions is fully backwards-compatible.

We don't yet deprecate Action::factory(), ::getActionName(),
and ::exists(), those will be deprecated in a follow-up.

Additionally, we no longer impose a rule that only some
actions can be overridden on a per-article basis via
Article::getActionOverrides().

Bug: T253078
Change-Id: I0fc3c53d671eced1758458f9a0148180b40c6c9b
2021-07-29 01:32:43 +00:00
Derk-Jan Hartman
7b7f3ac563 Disable browser data detection of telephone numbers
Number ranges are common and easily mistaken as telephone numbers by
the data detectors of popular browsers. To link a telephone number,
use the explicit [tel:phonenumber display value] syntax.

If you want to re-enable, set the BrowserFormatDetection configuration
variable to false.

Bug: T256758
Change-Id: I49dff3c084d8c9a66defcdae5a1ffb8f35ba8a93
2021-07-26 09:39:07 +00:00
Petr Pchelko
4f4822119d Convert CentralIdLookup to UserIdentity.
NOTE: this is a backwards incompatible change which will
need to have corresponding changes implemented in CentralAuth
and probably force-merged.

Depends-On: I4c2170a25ea8b1cf5410a4648ebec66a3ab253f3
Depends-On: I612460ec2c6a038b7155b3f38f3261757ba63b4e
Depends-On: I3b91b333753a877aceb177b7d38f9272a044f055
Depends-On: I9ae86c9a5da66d5857fcea9967012c6bbbfc4d45
Depends-On: I4a08af2227d0dfd833e16469df3f76e397dce669
Change-Id: I67bf4f2442269b8aa1002868ede9a71a5ca43a84
2021-07-21 06:18:59 -07:00
jenkins-bot
19b277816a Merge "DefaultSettings.php: Remove obsolete, no-op config variables" 2021-07-14 13:50:34 +00:00
Ammarpad
f90ecdfa81 DefaultSettings.php: Remove obsolete, no-op config variables
$wgShowSQLErrors and $wgShowDBErrorBacktrace have been
deprecated and immediately made no-op since MW 1.32

Change-Id: I655610ac49cb0a836d0c95aa1e6edc087ebf3f4c
2021-07-14 14:30:44 +01:00
Tim Starling
d3d8dc9965 Schema migration for revison_actor_temp table removal
Introduce a new schema migration stage in which rev_actor is used
directly and the revision_actor_temp table is no longer needed. This
becomes the new "new" stage whereas the previous situation is now
termed SCHEMA_COMPAT_TEMP.

Introduce migrateRevisionActorTemp which copies data from
revision_actor_temp to rev_actor. The code is similar to
migrateImageCommentTemp.php except that it doesn't delete from the old
table.

Partial revert of c29909e59f. That change removed direct
references to $wgActorTableSchemaMigrationStage and made queries
involving revision_actor_temp be unconditional. Such changes need to be
reverted to make the use of revision_actor_temp be conditional again.

In ActorMigrationTest, I compacted provideGetJoin() and
provideGetWhere(), removing most of the duplication between expected
values. I gave all the stages a short name, and mostly used the name in
providers.

Bug: T275246
Change-Id: I7498107dd6433ab7de5bf2e7b3fe2aa5e10e345d
2021-07-14 08:29:04 +10:00
Ammarpad
a03354006e Provide preference to make skins responsive
Bug: T285402
Change-Id: I4e567199a92c0492dac0561a5c7844f6c5c239e6
2021-07-01 22:18:27 +01:00
Timo Tijhof
f602a585ad DefaultSettings: Improve $wgUpdateCompatibleMetadata docs
The old description had some grammatical issues, and did not explain
what it influences or when. Namely, that it considered during manual
purges and overall rebuilds/refreshes. (E.g. it does not cause
update something directly on page views, nor does it kick-off a job
that will upgrade all existing files or something like that.)

Change-Id: Ia2d3f17a9f7c05f816004c619eb9ff1ec45b019b
2021-06-30 17:48:27 +00:00
jenkins-bot
1ffb4ae93a Merge "Manual and automatic image metadata reserialization" 2021-06-29 13:12:35 +00:00
Fomafix
356f1b72ef Use IEC prefixes instead of SI prefixes for byte sizes (docs+backend)
This change doesn't change any UI messages.

Bug: T54687
Change-Id: Ia62899a2a6fe8910618c35cd667291e397ddb055
2021-06-28 11:59:09 +01:00
Tim Starling
9251f3c9e3 Manual and automatic image metadata reserialization
* Add automatic splitting of large metadata on upload or refresh. If
  the reserializeMetadata option is enabled, metadata stored with PHP
  serialization will be automatically reserialized to JSON.
* Inject configuration variable $wgUpdateCompatibleMetadata via
  LocalRepo instead of accessing it directly.
* In refreshImageMetadata.php and rebuildImages.php, construct a new
  LocalRepo with config overrides, instead of overwriting config
  globals. Add a helper to RepoGroup to help with this.
* In refreshImageMetadata.php, add new options --convert-to-json and
  --split which reserialize metadata and optionally split out large
  items to blob storage.

Also, refreshImageMetadata.php was totally broken in the non-force mode
since metadata refresh on page view was disabled in b814245d9f. The
maintenance script was relying on newFileFromRow() magically upgrading
the row, which doesn't happen anymore. So, call maybeUpgradeRow()
directly.

Bug: T275268
Change-Id: I7bf7d9cef71641e287ca4346b568b381f4ada50e
2021-06-26 22:50:17 +00:00
jenkins-bot
2739509d38 Merge "Optionally split out parts of file metadata to BlobStore" 2021-06-26 20:32:04 +00:00