Commit graph

19 commits

Author SHA1 Message Date
James D. Forrester
91a37f53b4 Switch over a bunch of class_alias uses to actuals
Change-Id: Id175a83e71cc910eaee5d5890a9106872a3ca3b8
2024-10-03 17:09:36 +00:00
James D. Forrester
e7a47e1548 Change 'powered by MediaWiki' icon to new version, wrapped in Codex buttons
Bug: T256190
Change-Id: I4eca56b28682e5ca2b880bc01c123dc4f977f485
2024-06-17 14:35:48 -04:00
Amir Sarabadani
650602f4c3 footer: Stop interfering with full override of mediawiki footer icon
This is to allow seamless deployment of the new footer icons.

Bug: T256190
Change-Id: I206f51c6e3cb92c2b49eb5643a2d196320775494
2024-05-13 12:45:12 +02:00
Umherirrender
3e6a1bdd00 logging: Inject services into PageLangLogFormatter
Bug: T356468
Change-Id: I593fbd8c340aa9ea75a303115d1355f3ce96be11
2024-03-28 01:32:02 +00:00
jenkins-bot
0e593c7a28 Merge "Migrate bot passwords to virtual domains" 2024-02-07 00:11:25 +00:00
Amir Sarabadani
be5593b10d Migrate bot passwords to virtual domains
Bug: T351559
Change-Id: I645f1e4a4517b9177286e834236b0c047bef928c
2024-02-01 17:35:29 +01:00
Amir Sarabadani
2d66025fdf Drop deprecated configs $wgMinimalPasswordLength and $wgMaximalPasswordLength
Soft-deprecated since 1.26 and hard-deprecated since at least
I9776d11d4e2d184 (1.39).

Not set in production.

Change-Id: I55e4569c5a40f77a719bc7ab1924eaa706e0da53
2024-02-01 16:29:05 +01:00
Lucas Werkmeister
e9991ffb68 Create 'x-xss' language code feature
This creates a new language code, 'x-xss', which is enabled using the
setting $wgUseXssLanguage (similar to how $wgUsePigLatinVariant enables
the 'en-x-piglatin' language code, and likewise defaults to false; will
be enabled in development settings soon).

In this language code, all messages become “malicious”, trying to run
some alert() JavaScript; if any alert() actually fires in the browser,
the message was not escaped properly. ($wgRawHtmlMessages are exempt,
since they’re already known to be “unsafe” and require more rights to
edit on-wiki.) Messages that are not escaped properly are generally a
minor security issue; they effectively let a user with 'editinterface'
right (such as a sysop, on many wikis) run arbitrary JS, without needing
the 'editsitejs' right (normally restricted to interface admins).

Developers can use this language code to more easily check their code
for escaping issues / cross-site scripting vulnerabilities.

Bug: T340201
Change-Id: Ia9a1cf712b139fea5da72046e37035e6de39d8d5
2023-09-28 15:50:11 +02:00
James D. Forrester
a8a6cfd966 Namespace NamespaceInfo under \MediaWiki\Title
One of the big ones, so doing this alone.

Bug: T166010
Change-Id: Ibe103cd362535d3cb94cb8931e95fc74099d1497
2023-09-19 05:17:04 +00:00
Timo Tijhof
39ead04e98 objectcache: Remove $wgMainWANCache and $wgWANObjectCaches
We always wrap the local cluster cache, and there are no subclasses
of WANObjectCache. It was never documented or recommended how these
would be used. It is a left-over from the original 2015 Multi-DC plan
in which WANObjectCache would work differently. See task for details.

Note that this requires no configuration changes, even in the
theoretical case of these variables being used, as the only
option is to use the main cache, and that's also the default.

* Update WAN overrides to override the underlying main cache
  instead.
* Fix EditPageTest which was previously implicitly using a 'hash'
  as main cache but also relying on wan cache to be 'none'.
  The part that it actually needs is the 'none'. When WAN cache is
  enabled, testUpdateNoMinor fails due to an edit conflict because
  one of the edits it makes is made with a current timestamp whereas
  it expects to simulate wpEdittime in the year 2012 which, when
  caching is enabled, is ignored and becomes the current time instead.
  I don't understand exactly why, but I'm going to conserve that
  behaviour for now.
* Fix TemplateCategoriesTest, which was failing due to an unexpected
  cache hit:
  > [objectcache] fetchOrRegenerate(…:page:10:…): volatile hit
  This could be solved in a more realistic way by splitting the test,
  or by explicitly resetting services half-way the test to clear
  WikiPageFactory, PageStore and WANCache process state.
  For now, keep the prior behaviour of no cache in this test.

Bug: T305093
Bug: T329680
Depends-On: If890622eed0d0f8b4bd73d36ba1815a3d760ea05
Depends-On: Ie1def75208822bdf19bb2cfd7e6edf32c2000e6b
Depends-On: I35cce61dc3ee90dcee3dd6f0b36f84133be029ed
Change-Id: I53781a8c06ebb2583f6ca83dd91bbfe8a5c88b13
2023-03-07 22:47:04 +00:00
daniel
d4f785d931 Rename rate limits to match permission names
This changes the name of the rate limits to match the name of the
corresponding permission:

1) "emailuser" is now "sendemail".
2) "changetag" is now "changetags".

This is done in preparation for merging rate limit checks into Authority.

Backwards compatibility is retained, but the old keys trigger a settings
warning which will be shown by the updater.

Bug: T310476
Change-Id: I59163c88a3f9237ee4592f4b51e3f56359f73fc0
2023-02-26 13:21:40 +01:00
Timo Tijhof
8a0e6cfe31 docs: Fix broken references to docs/Configuration.md
Follows-up a5277ce87f (Ie6152cf510). This file no longer exists.
Update references to MainConfigSchema or MainConfigSchema.php instead.

Bug: T300129
Change-Id: I40a8881e843cc75a10e44b51ed0784fdc834f0e5
2022-09-07 16:36:21 +00:00
Umherirrender
9b8f153fb8 Setup: Remove internal short-cut config $wgUseEnotif
It is not possible to set $wgUseEnotif on LocalSettings.php,
because it is always set on setup, it should not be a global/setting.
Just remove it from the dynamic setup and use the config it is set from

Bug: T305093
Change-Id: I9bfa502a0b9798bd149b4cfe4db86a0461e76f55
2022-08-17 23:41:30 +02:00
Kevin Israel
1636c24306 Don't add $wgExtraNamespaces to $wgCanonicalNamespaceNames
This fixes a bug experienced by jawiki users in which overriding names
of extension namespaces (e.g. "モジュール・トーク") would unexpectedly
also override extension-provided canonical names (e.g. "Module talk").

Pretty much the only Wikimedia-deployed code that reads the config
variable directly is NamespaceInfo::getCanonicalNamespaces(), which
already takes into account $wgExtraNamespaces, so this should be OK.

Bug: T314013
Change-Id: Icd3405c02886651f8e4ec87f6d66783314c1024b
2022-07-28 08:23:41 -04:00
daniel
cf39a40f16 SettingsBuilder: report warnings
This adds functionality to SettingsBuilder for collecting warnings to be
logged later, when the logging mechanism has been set up.

This also adds a validation step to update.php that aborts the update
if any warnings have been registered in SettingsBuilder, or the settings
fail to validate against the settings schema.

Change-Id: I387905289fb93591f79b96bf4c6cb5ec692b2aff
2022-07-15 12:24:20 +02:00
daniel
5e928f39e8 Dynamic defaults: fix $wgLocaltimezone being empty
Apparently, $wgLocaltimezone is set to the empty string in many
existing LocalSettings.php file, presumably because the installer
failed to detect the correct time zone.

The new code for handling automatic defaults will only trigger if
$wgLocaltimezone is null, not when it is otherwise empty.

This adds fallback code in strategic places to ensure that the empty
string is handled correctly.

Bug: T305093
Change-Id: I39226466f2bb6a36823ae9032fc62f981eabc64a
2022-07-09 18:59:32 +02:00
Aryeh Gregor
b72b9a8c43 Move dynamic defaults into MainConfigSchema
The goal is to keep the actual default values for settings in the same
place as the setting is declared, and applied using the regular means
for loading the settings -- not in a separate piece of code that needs
to be loaded through some entirely different mechanism.

SetupDynamicConfig.php now contains a few categories of things:

* Post-processing of configuration settings, where already-set settings
  are altered. This could be moved to MainConfigSchema too as a separate
  set of methods.
* Processing of old aliases of settings (blacklist, slave) that are not
  registered as settings anymore and therefore are not available to
  MainConfigSchema. This could perhaps be moved to LocalSettings
  processing somehow?
* Setting $wgUseEnotif, which is also not registered as a setting.
  Easiest would be just to declare it as a setting and have it set
  unconditionally.
* Setting the actual timezone to $wgLocaltimezone. This is not related
  to configuration and should just be in Setup.php.

Bug: T305093
Change-Id: Ia5c23b52dbbfcb3d07ffcf5d3b7f2d7befba2a26
2022-07-07 09:55:48 +10:00
daniel
237bbf089f Turn DefaultSettings.php into a deprecated stub
DefaultSettings.php has been replaced by MainConfigSchema.
Loading DefaultSettings.php is deprecated.

Code that needs to have access to configuration defaults should use the
ConfigSchema service object.

Bug: T300129
Change-Id: I7b2c0ca95a78990be1cdb9dd9ace92f6dcf1af15
2022-05-17 16:50:56 +02:00
Aryeh Gregor
7fe63e48c5 Test dynamic configuration logic
To do so, we move the relevant parts to a separate include file that's
included both by Setup and the test.

The --color-moved option is highly recommended when reviewing this patch
to verify correctness.

More tests to come.

Bug: T305093
Change-Id: I931b92357ec48db4665891c8546f86264885e881
2022-04-12 15:21:35 +03:00