Commit graph

22 commits

Author SHA1 Message Date
Amir Sarabadani
5156ae0404 Allow sharding in site_stats update
This would be useful in cases that lots of edits happen at the same time
and this would reduce the time waiting to get the row lock.

Bug: T306589
Change-Id: I3b869e3b85dfd66575390ef4247f2f81f19c878e
2022-05-30 20:46:08 +02:00
Tim Starling
3e2653f83b ResourceLoader namespace (attempt 2)
Move ResourceLoader classes to their own namespace. Strip the
"ResourceLoader" prefix from all except ResourceLoader itself.

Move the tests by analogy.

I used a namespace alias "RL" in some callers since RL\Module is less
ambiguous at the call site than just "Module".

I did not address DependencyStore which continues to have a non-standard
location and namespace.

Revert of a241d83e0a.

Bug: T308718
Change-Id: Id08a220e1d6085e2b33f3f6c9d0e3935a4204659
2022-05-24 15:41:46 +00:00
Amir Sarabadani
24115a8f4c Start clean up of revision_actor_temp table
It is being dropped in production

Bug: T215466
Change-Id: I66b2cb8653252e720c897351065978119f040ba7
2022-05-23 15:37:42 +00:00
mainframe98
0d90560e64 parser: Remove Priority Hints experiment for thumbnails
Both this feature and the web standard are experimental.
The standard was only exposed as a Google Chrome Origin Trial
and the standard has evolved in a non-compatible way.

Bug: T308707
Change-Id: I987c0fb9e3fbb1a9f727b3f171c747246d8adb77
2022-05-19 09:38:17 +02:00
mainframe98
ebffc4f6b1 parser: Remove Element Timing experiment for thumbnails
This feature was experimental, unsupported and untested.
It was disabled by default.

Bug: T308621
Change-Id: I9375f35d031f635af0d39ee0bc027ac719899d9d
2022-05-18 20:34:26 +00:00
Lucas Werkmeister (WMDE)
a241d83e0a Revert "ResourceLoader namespace"
This reverts commit e08ea8ccb9.

Reason for revert: Breaks Phan in extensions, and as far as I’m aware,
this change isn’t urgently needed for anything, so the simplest fix is
to revert it again for now. After PHP 7.4 it should be safer to try this
again (we hopefully won’t need the two “hack” classes by then).

Bug: T308443
Change-Id: Iff3318cbf97a67f821f78e60da62a583f63e389e
2022-05-16 14:43:33 +00:00
Tim Starling
e08ea8ccb9 ResourceLoader namespace
Move ResourceLoader classes to their own namespace. Strip the
"ResourceLoader" prefix from all except ResourceLoader and
ResourceLoaderContext.

Move the tests by analogy.

I used a namespace alias "RL" in some callers since RL\Module is less
ambiguous at the call site than just "Module".

I did not address DependencyStore which continues to have a non-standard
location and namespace.

Change-Id: I92998ae6a82e0b935c13e02a183e7c324fa410a3
2022-05-16 14:41:27 +10:00
jenkins-bot
e7573c0e5d Merge "Remove support for $wgMaxRedirect" 2022-05-08 20:25:09 +00:00
Yuki Shira
d73a6a6a6f MainConfigSchema: fix @deprecated tag of $wgSquidPurgeUseHostHeader
$wgSquidPurgeUseHostHeader is @since 1.21 and @deprecated since 1.33.

Follow-Up: I9776d11d4e2d184af35b1117cd7950354c0e343e
Change-Id: Ibaa261fcce3498eba56ab37c8ed95f52e59cfef4
2022-05-06 21:00:29 +09:00
daniel
66f3ab254c Remove support for $wgMaxRedirect
Redirect chains have never worked as intended.

Bug: T296430
Change-Id: If0e514c57b8f3d857d956a581f1b549518ecb099
2022-05-06 10:52:56 +02:00
jenkins-bot
990881f89d Merge "WikiFarm: remove site detection based on domain name." 2022-05-05 15:41:06 +00:00
jenkins-bot
3a8c008ea2 Merge "MainConfigSchema: declare deprecations" 2022-05-04 23:33:17 +00:00
daniel
90ccce647d WikiFarm: remove site detection based on domain name.
While detecting the site name based on the request domain is common,
the exact mappings used in practice differ a lot. If we implemented one,
we could never change it. It seems beter to require the requested site
to be identified explicitly.

Bug: T221535
Change-Id: I31c20e87bb7d5fc4565714e86f547b42bacea82f
2022-05-04 22:09:06 +02:00
Tim Starling
910d146679 Call ZipDirectoryReader from MimeAnalyzer
Remove the special case GIFAR vulnerability check from UploadBase. I
put it there because the GIFAR vulnerability was so severe that we
needed to check for it even if $wgVerifyMimeType was false. Now that
support for Java applets has been dropped from browsers, the
vulnerability is not so severe and we can wind back the paranoia.

Add a ZipDirectoryReader invocation to MimeAnalyzer, to replace some
terrible regex hacks. This allows MimeAnalyzer to detect docx files
saved by LibreOffice (T291750).

This is also the new place for the GIFAR check. Add application/java
to $wgMimeTypeExclusions so that JAR uploads are rejected.

Since ZipDirectoryReader cannot look inside the contents of files in the
package, it can't detect the subtype of Open Document files. Use the
file extension instead, like what we do for Microsoft OPC files.

Remove public method detectZipType -- no callers in code search.

Bug: T291750
Change-Id: Iff1611c7adda9c0f0ed31593bad6dfffc9c9a086
2022-05-03 14:43:26 +10:00
daniel
3b7f6ac63c MainConfigSchema: declare deprecations
Declare deprecations as part of the schema, not just in the doc string.
This allows deprecations to carry over to MainConfigNames and
DefaultSettings.php.

Change-Id: I9776d11d4e2d184af35b1117cd7950354c0e343e
2022-05-02 22:15:32 +02:00
jenkins-bot
99836b7c2a Merge "Drop $wgMultiContentRevisionSchemaMigrationStage config" 2022-04-14 19:13:37 +00:00
Tim Starling
e8dbf5f80c TempUser infrastructure and services
Add services and utilities for automatic creation of temporary user
accounts on page save, in order to avoid exposing the user's IP
address.

* Add $wgAutoCreateTempUser, for configuring the system
* Add TempUserConfig service, which interprets the config.
* Add TempUserCreator service, which creates users during page save as
  requested by EditPage. With proxy methods to TempUserConfig for
  convenience.
* Add table user_autocreate_serial. Table creation is necessary before
  the feature is enabled but is not necessary before deployment of this
  commit.

Bug: T300263
Change-Id: Ib14a352490fc42039106523118e8d021844e3dfb
2022-04-14 09:23:55 +10:00
Alexander Vorwerk
0779a61e15 Drop $wgMultiContentRevisionSchemaMigrationStage config
has no effect since 1.35

Bug: T231674
Change-Id: I69a4463cce42cbd79e1137d748e4a70781999cfb
2022-04-12 21:29:41 +02:00
daniel
5fcedc88c9 Add wiki-farm support
Added support for an easy to configure multi-tenant ("wiki farm") mode:
Settings for each site can be placed in a directory specified by
$wgWikiFarmSettingsDirectory. Site detection is controlled by
$wgWikiFarmSiteDetector and defaults to the requested host name.

Instructions for manual testing: https://etherpad.wikimedia.org/p/T221535

Bug: T221535
Change-Id: I7581921b7d99ba1fe7e25523fde691d76b67a99c
2022-04-01 14:29:22 +02:00
C. Scott Ananian
2d66ee70a2 Copy over Parsoid's Config and ServiceWiring classes
* This is the first step of migrating Parsoid integration code into
  core and transitioning Parsoid from an extension to a pure library.

* Parsoid already has conditional code to skip loading Parsoid's
  copy of its classes, but it relies on the existence of ParsoidServices.
  Technically ParsoidServices isn't needed once Parsoid is migrated to
  core -- users can just use MediaWikiServices instead -- but we need
  to temporarily add ParsoidServices as a marker class during the
  transition.

This version of Parsoid's ServiceWiring comes from Parsoid commit
898c813fd832b3f2d7b5a37f60bd65e8368ce18f.

Bug: T302118
Change-Id: I0b388d93143a782c2c3b72e46407572e5c586e4a
2022-03-28 12:36:38 -04:00
Taavi Väänänen
caa8a2c3f0
Allow managing upload-by-url allowlist as a system message
This patch introduces a new system message,
MediaWiki:copyupload-allowed-domains, which lets sysops to define which
domains can be used with the upload-by-url tool. This feature is behind
an off-by-default feature flag, which lets system administrators
disable this feature if it is not wanted.

Bug: T300407
Change-Id: Iae7dafbd71182695444210409d550e5b6d10928b
2022-03-23 11:11:41 +02:00
daniel
6880561a4d Generate config name constants.
We can generate a class that contains constants for all config variable
names. This removes the need to rely on string literals when calling
Config::get, and it provides a place for documentation that integrates
better with IDEs than the markdown file.

Change-Id: I817dc14c4ce8fc0a29d9c07e8fd393c4f359cade
2022-03-18 10:32:58 +01:00