Commit graph

3187 commits

Author SHA1 Message Date
Tim Eulitz
341320457c Show confirmation prompt on rollback links
Bug: T215020
Change-Id: Ic831888e30808a20a04397912498fe2ca04f80ba
2019-03-21 10:13:22 +00:00
Gilles Dubuc
e83e1fc1ee Add support for Element Timing API
https://github.com/WICG/element-timing

Bug: T216598
Change-Id: Ieda41f5074784957760c17dc15f7c891e56b6795
2019-03-20 09:54:02 +01:00
Timo Tijhof
074ce9ab14 User: Remove redundant wgClockSkewFudge code
Ensuring the new value is at least as high as 1 second higher
than the current value is sufficient.

The main code paths using this are checkAndSetTouched (for user group
changes) and saveSettings(), both of which use makeUpdateConditions() which
ensures we bail out if something else already wrote to it in the mean time.
As such, there is no longer a need to make sure our time is higher than
something another server may have written, given that is no longer something
we support.

This variable was introduced in 2005 (MW 1.4) with r9403 (1d12276bcb),
and factored out as newTouchedTimestamp() in 2007 (MW 1.8)
with r16772 (c1094ba987).

Change-Id: I940fb0dd125286a4a348c11e2c8d197f9288a75d
2019-03-15 20:03:54 +00:00
Timo Tijhof
4677392718 Remove wgSitesCacheFile and rebuildSitesCache.php (unused)
This seems to have been intended as optimization for SiteStore,
but was never used as far as I can tell. Instead, SiteStore is
already cached via LocalServerCache (APC).

Keep the FileBasedSiteLookup class for one release cycle in case
third parties not indexed by MediaWiki Codesearch are using it.

== History

* 2013: Report of high memcached usage by Wikibase via SiteStore.
* 2014: Lazy-load the data in Wikibase (d3f2e99cb6).
* 2014: Implement the file-based cache (via T47532 and 90f6efc360).
* 2015: Use local-server cache (APC), per T58602.

The file-based code was never used. The related task marked
invalid (T47532).

Change-Id: I8e2d9edcf3880149f824cc3de37793ca57435b49
2019-03-15 20:03:44 +00:00
jenkins-bot
5a2e5db4fc Merge "Add password policy setting suggestChangeOnLogin" 2019-03-12 16:35:00 +00:00
Dayllan Maza
4b39919c47 Add password policy setting suggestChangeOnLogin
Password policy checks that fail and have `suggestChangeOnLogin` set to true will
prompt for a password change on login.

Below are some rules that apply to this setting in different scenarios:

- If only one policy fails and has `suggestChangeOnLogin = false`, a password change will
  not be requested
- If more than one policy fails and one or more have `suggestChangeOnLogin` set to true`,
  a password change will be requested
- If `forceChange` is present in any of the failing policies, `suggestChangeOnLogin` value
  will be ignored and password change will be enforced
- if $wgInvalidPasswordReset is set to false `suggestChangeOnLogin` is ignored

IMPORTANT**
Before this patch, suggesting a password change was the default behavior (depending on
$wgInvalidPasswordReset), which means that the necessary changes to $wgPasswordPolicy
need to be in place before this patch is merged and gets to production.

Bug: T211621
Change-Id: I7a4a0a06273fa4e8bd0da3dac54cf5a1b78bb3fd
2019-03-09 14:59:02 -05:00
James D. Forrester
3f717984c1 Drop AuthPlugin and related code, deprecated in 1.27
Bug: T215843
Depends-On: Ie49709faa6f67b0a31bd546823d29dbfea0a70eb
Depends-On: If8109dbfdeeb88a6265f4cd79d1ae81bff48d934
Depends-On: I36b195fa2d6c23a76631ebaf869c787e44427d60
Depends-On: Iaa171b085fde331eab7d85c7de74523e27fc625a
Change-Id: I330b30d6582034a233fed204c0680b1ce84eec6e
2019-03-05 08:23:14 +00:00
Fomafix
4b46994799 Fix usage of MediaWikiServices in comments and documentation
MediaWikiServices::getFoo()

is wrong. Right is:

MediaWikiServices::getInstance()->getFoo()

Change-Id: Ib6d844ddfe5bd6ccd72b887a63d9ad476c8d196f
2019-03-03 14:09:33 +00:00
MGChecker
84c46d38b7 Add separate log action for file reverts
This change s adds 'revert' as a separate log action for file reverts, as it
allows special formatting of log entries and revisions in UI and filtering
for file reverts specifically.

Even though there are no log entries with this log action right now, it does
seem that this was intended as some point, as there are corresponding
test cases in UploadLogFormatterTest, and is listed in
$wgLogActionsHandlers and https://www.mediawiki.org/wiki/API:Logevents
as well. Furthermore, the i18n message 'logentry-upload-revert' already
existed before this change.

Because this functionality can not be provided by tags, the 'mw-undo' tag
is not suited for this use case. However, it could be added additionally to
all log entries with this log action..

Bug: T60209
Change-Id: Ie1ccd8053dc5de58b2297a8460219f0233aab968
2019-03-02 22:16:55 +00:00
jenkins-bot
747bdd543d Merge "Show password policy flags on Special:PasswordPolicies" 2019-03-02 03:51:05 +00:00
Gergő Tisza
22c8cda841
Show password policy flags on Special:PasswordPolicies
Follow-up to I28c31fc4ea.

Also improves what policy values are considered disabled, documents
how to extend core checks/flags and adds a structure test for it.

Bug: T118774
Change-Id: I66bf396e8e8a8c310a47ba337abe9070e7e83ff6
2019-03-01 19:02:40 -08:00
jenkins-bot
227a807ef5 Merge "Add Priority Hints support" 2019-02-25 20:31:59 +00:00
jenkins-bot
cabf43cc00 Merge "Chrome Origin Trial support" 2019-02-25 20:31:48 +00:00
Gilles Dubuc
8e11c5dabc Add Priority Hints support
When the option is enabled, the first non-icon
thumbnail encountered has a "high" importance.

Bug: T216499
Change-Id: I8d3c1b3e2d136ba16bd7de4809ee3ca63ab462fe
2019-02-25 18:14:59 +01:00
Gilles Dubuc
ea33553ba7 Chrome Origin Trial support
Bug: T216595
Change-Id: I74b8824a87e6f52a84d2f8a9708501fc05f73266
2019-02-25 18:11:35 +01:00
Brian Wolff
2be26155ec Add .phar to $wgFileBlacklist as a paranoia measure
Seems like it can't hurt.

Change-Id: I833dd95742d7de772833c738ca7f5403e57bc2f4
2019-02-22 04:31:56 +00:00
jenkins-bot
e0df6ef754 Merge "Add support for Argon2 password hashing" 2019-02-21 07:24:52 +00:00
Max Semenik
31f740d31c Set $wgMediaInTargetLanguage to true by default
This feature flag is still unreleased, flipping it on by default
in preparation for removal.

Change-Id: Ice3c3d7e35023d93afb85d43f838c18dae9a9c3a
2019-02-20 20:26:46 -08:00
Aaron Schulz
5414aee495 objectcache: remove dangling WAN cache EventRelayer references
* Remove 'channels' field references from config/setup
* Remove 'relayer'/'channels' field reference in unit tests
* Remove unused DEFAULT_PURGE_CHANNEL class constant
* Also remove long-since bogus 'pool' field references

Follow-up to 4753b0a4ed

Change-Id: If6670ff4e1dccc8ae253a08b46d205601da10024
2019-02-16 20:22:32 -08:00
Max Semenik
292e13edc5 Add support for Argon2 password hashing
So far, everything we had was vulnerable to newest advances in
GPU cracking and timing side-channel attacks. Argon2 was designed
specifically to address these problems.

Unfortunately, PHP support is lagging, with some builds missing
Argon2id or even Argon2i.

Change-Id: Ifdf648f5d8a734a663e630286724a6d0a87c7510
2019-02-10 02:20:52 -08:00
James D. Forrester
a38fe6cd7d Drop b/c reading of wgSessionsInObjectCache and wgSessionHandler, deprecated in 1.27
Depends-On: I0d861a24b6cfd5c881112f15c682d97cef715cf0
Change-Id: I6b69d9ad3863512879f287f960828c1fdf7b214c
2019-02-09 13:42:43 -08:00
Brad Jorsch
0abb9338f8 Mostly drop old comment schemas
This removes most of the pre-CommentStore text columns, and the
$wgCommentTableSchemaMigrationStage setting that used to determine
whether the columns were used.

rev_comment remains in the code, as on Wikimedia wikis the revision
table is too large to alter at this time. A future change will combine
that with the removal of rev_user_text, rev_content_model, and
rev_content_format (and the addition of rev_comment_id and rev_actor).

CommentStore's constructor continues to take a $stage parameter, and
continues to have the logic for handling it, for the benefit of
extensions that might need their own migration process.

Bug: T166733
Change-Id: I1479c73774e01ead1490adf6128f820c09bce9d4
2019-02-07 16:59:27 +11:00
Tim Eulitz
be27ff2de8 Add option for confirmation prompts on rollbacks
By default this option will be enabled in core, however, the option will
be overriden by a separate commit to mediawiki-config where it will be
disabled for all wikis for now.

Bug: T215019
Change-Id: I73f060fc954abb6ec02238b16c8598dd6ebd4ae4
2019-02-04 17:04:46 +01:00
Timo Tijhof
d39cc0e885 Remove deprecated wgEnableParserCache
One less thing to do in Setup.php.

Bug: T189966
Change-Id: Ie9b631897fda51f6db9fc4d634bcbd6bf865dfc9
2019-01-25 21:08:10 -08:00
jenkins-bot
8a2be2c599 Merge "Fix tag for partial blocks config" 2019-01-08 18:48:56 +00:00
Thalia
f96c988f19 Fix tag for partial blocks config
Change-Id: I421298f216bc018d1606c297b2f89ee53c8da7ec
2019-01-08 17:47:02 +00:00
Gergő Tisza
f15ecc60cd
Add force option to password policy
Adds a way to set an array of options for a password policy. Currently
there is one option, 'forceChange', which forces the user to change
their password (if it fails the given check) before logging in.

Bug: T118774
Change-Id: I28c31fc4eae08c3ac44eff3a05f5e785ce4b9e01
2019-01-02 12:38:11 -08:00
Reedy
0d3807c510 Deprecate PasswordPolicyChecks::checkPopularPasswordBlacklist
Change-Id: I4c90e361b7538efeb0c5efa7ca61aed2e468591c
2018-12-27 20:45:49 +00:00
Gergő Tisza
a183aee89e Simplify default password policy
* Remove PasswordNotInLargeBlacklist => false, it's a no-op
* Deduplicate PasswordCannotMatchUsername
* Remove PasswordCannotBePopular. There is no point in using both
  PasswordCannotBePopular (top 10K passwords from SecLists) and
  PasswordNotInLargeBlacklist (top 100K passwords from SecLists),
  and the CDB lookup is probably not that cheap.

Change-Id: I868846931988b88f06800e42861e82e2bb0bc427
2018-12-27 20:25:40 +00:00
jenkins-bot
bfe80c5233 Merge "Add 'suppressrevision' right to new 'oversight' grant" 2018-12-23 23:47:10 +00:00
Martin Urbanec
952876e30b Add 'suppressrevision' right to new 'oversight' grant
Change-Id: Ic7eeff94ea533670c85c9e82801f38fded9e7a30
2018-12-23 23:41:32 +01:00
jenkins-bot
bebaaaefb8 Merge "Deprecate User::getPasswordValidity()" 2018-12-21 05:06:40 +00:00
Gergő Tisza
86db28715f
Deprecate User::getPasswordValidity()
Unused, the return format does not seem useful.

Also improve the documentation of $wgPasswordPolicy
and PasswordPolicyChecks.

Change-Id: Ic01e80cfefc4cfb0eee1eccc6a66942f692278a0
2018-12-20 20:26:51 -08:00
jenkins-bot
f2d4db9d03 Merge "Add editing own JSON to editmyoptions grant" 2018-12-20 07:35:09 +00:00
jenkins-bot
e9bc2cb5ff Merge "Increase default minimum password length on privileged groups and bots" 2018-12-13 23:41:51 +00:00
Dayllan Maza
fc9efe67d5 Increase default minimum password length on privileged groups and bots
Minimum password length is now 10 by default on privileged
groups (bureaucrat, sysop, interface-admin), and bots.

Bug: T208246
Change-Id: I373c5c6865b90cdc5c4848266c5996dd190f6001
2018-12-13 23:22:14 +00:00
Dayllan Maza
05a5b8e749 Add new rules when user is blocked for UTP
No changes for sitewide blocks when "Prevent user... edit own talk page"
is checked. On partial blocks, this option will be disabled and ignored. All users
will be allowed to edit their own talk page unless a page restriction
for their page is in place.

New rules will be implemented for Namespace restrictions in a different
patch when Namespace blocking is ready.

Bug: T210475
Change-Id: I096edf2887441bccd59f09bf0eceb3988b36db1e
2018-12-11 00:01:29 -05:00
jenkins-bot
9ff8e0a946 Merge "Remove most support for configuring Tidy, including Raggett" 2018-12-05 18:59:50 +00:00
jenkins-bot
023fec5d7b Merge "[MCR] Introduce SlotRoleHandler and SlotRoleRegistry" 2018-12-03 16:20:06 +00:00
daniel
db987c700a [MCR] Introduce SlotRoleHandler and SlotRoleRegistry
These new classes provide a mechanism for defining the
behavior of slots, like the content models it supports.
This acts as an extension point for extensions that need
to define custom slots, like the MediaInfo extension
for the SDC project.

Bug: T194046
Change-Id: Ia20c98eee819293199e541be75b5521f6413bc2f
2018-11-30 12:29:05 -08:00
jenkins-bot
366f5d69c1 Merge "Use ParserCache in CategoryMembershipChangeJob" 2018-11-29 01:15:01 +00:00
jenkins-bot
32b573187d Merge "Drop $wgChangeTagsSchemaMigrationStage" 2018-11-28 23:52:00 +00:00
jenkins-bot
19ed99208a Merge "Default $wgCommentTableSchemaMigrationStage to MIGRATION_NEW" 2018-11-28 22:32:50 +00:00
Amir Sarabadani
02a930d7fb Drop $wgChangeTagsSchemaMigrationStage
Bug: T194163
Change-Id: Ieb6cc60cacf9dd0d86641b1be817249cdce42112
2018-11-28 23:03:41 +01:00
jenkins-bot
2cf4a2c296 Merge "Add block notice stats on EditPage." 2018-11-28 19:55:12 +00:00
Brad Jorsch
fd5a1842d2 Default $wgCommentTableSchemaMigrationStage to MIGRATION_NEW
WRITE_NEW mode seems to be working well on Wikimedia sites. Let's change
the default to MIGRATION_NEW so existing installs and Wikimedia CI will
start using the new code rather than the old.

This also fixes some unit tests that were broken with MIGRATION_NEW, and
updates some that were forcing MIGRATION_OLD to force MIGRATION_NEW
instead.

Bug: T166733
Change-Id: I7bf4ad0105dd1f6cc49eba3ddcb7a51badcd5ed3
Depends-On: I30f7cdcc3875f3f7af116c1e41e88f62ab9e91d0
2018-11-28 13:59:19 -05:00
Dayllan Maza
49bb28b557 Add block notice stats on EditPage.
Monitoring block notices is behind $wgEnableBlockNoticeStats config
flag which is set to false by default.

The reason behind this metric is to get an idea on how
frequently blocked users attempt to edit a page. Similar tracking
is being added to MobileFrontend and VisualEditor.

Bug: T201718
Change-Id: I6bd1c95548616677e1f72ba6bcfc6f2b551c1ca6
2018-11-28 00:51:37 -05:00
daniel
4268545b4d Use ParserCache in CategoryMembershipChangeJob
Note that we will still be re-parsing either the old or the new
revision. Keeping the rendered version of the old revision cached
for a bit would be nice, but ParserCache currently does not
support this.

Bug: T205369
Change-Id: I86d26e494924eec24e7b1fb32c424ac1284be478
2018-11-27 15:46:14 -08:00
Reedy
519ff1a402 Add PasswordPolicy to check the password isn't in the large blacklist
Add wikimedia/password-blacklist 0.1.3, which contains 100,000 common passwords

Bug: T151425
Change-Id: I80572fcee6d23ea04ad9ee683157bab9378b660e
Depends-On: I8aea5a44248da9bb9ff7b328679bff6fcf41750d
2018-11-24 15:46:14 -08:00
Gergő Tisza
b93e106462 Add editing own JSON to editmyoptions grant
Editing one's own user JS is a dangerous grant that should only
be given to very highly trusted app. The same is probably true
of CSS as well, even if it's less dangerous.
Editing user JSON, on the other hand, is entirely harmless as long
as the consumers of the JSON are coded reasonably, so grouping it
with JS/CSS editing into a single grant is unhelpful. Make it part
of the editmyoptions grant instead.

This extends an existing grant, which is not great, both in terms
of clarity of the grant (even though user preferences and user JSON
have a very similar role, this grouping is not intuitive) and
user experience with existing access tokens (which seem to grant
the new right but actually don't). It still seems better than
further inflating the number of grant options, though.

Bug: T206438
Change-Id: I14482093f7ce05250398feabbb4d17c0461c04c3
2018-11-19 21:40:57 +00:00