Commit graph

3164 commits

Author SHA1 Message Date
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
jenkins-bot
66384d8dee Merge "Add some additional domains to the CSP false positive list" 2018-11-19 17:55:30 +00:00
C. Scott Ananian
6db35b3c98 Remove most support for configuring Tidy, including Raggett
Remex is pure PHP so there is no reason to use an external tidy any
more. Configuration variables and implementation classes were
deprecated in 1.32 or earlier.  We've kept only $wgTidyConfig
which can be used for experimental features or debugging Remex.

Bug: T198214
Change-Id: I99d48f858d97b6e1d1e6cd76a42c960cc2c61f9f
2018-11-15 12:22:06 -05:00
jenkins-bot
65f12f7190 Merge "Set migration stage for change tag to read new" 2018-11-14 16:28:34 +00:00
Brian Wolff
5e44921c57 Add some additional domains to the CSP false positive list
Based on Wikimedia server logs

Change-Id: If9523d49a55572b222fb60c2832f84b21fb81f05
2018-11-08 07:34:36 +00:00
Aaron Schulz
51945dbca3 Use DB domain in JobQueueGroup and make WikiMap domain ID methods stricter
Using domains means thats JobQueueDB has the right value to use for calls
like LoadBalancer::getConnection(). The full domain includes the schema in
the case of Postgres. This makes calls to getConnection() less awkward by
not relying on the fallback logic in reallyOpenConnection() for null schemas.

Make getWikiIdFromDomain/isCurrentWikiDomain account for the schema if it
is both defined and is not simply the generic "mediawiki" schema MediaWiki
uses by default. If all wikis use the default schema, the wiki IDs can get
by with DB/prefix alone, which various config and methods may be built around.
Otherwise, the config callbacks must account for schema and the config must
include it in various wiki domain ID lists to properly disambiguate wikis.

Also, clean up SiteConfiguration::siteFromDB() since it is not meant
to handle schemas unless the callback method was taylored to do so.

Finally, add more comments to DefaultSettings.php about already existing
limitations of wiki domain IDs and their components.

Change-Id: I8d94a650e5c99a19ee50551c5be9544318eb05b1
2018-11-07 04:46:56 +00:00
Amir Sarabadani
bb07b4a368 Set migration stage for change tag to read new
Plus removing not needed config

Bug: T185355
Change-Id: Iaa8bfbbbf4fa939bbc7a1a0ec0b00c8af97abfaa
2018-11-02 13:52:55 +01:00
Aaron Schulz
f6939d0e88 Ignore master connections for POST-nonwrite in $wgTrxProfilerLimits
Unless an actuall write happens, avoid create log spam over things
like CentralAuthUser->getSafeReadDB().

Change-Id: I1cf43f4b1cdd12eb458458448f0f0ea328925b47
2018-11-01 15:39:12 -07:00
Max Semenik
c16704c33a Display SVGs in target language
Previously, they were always displayed in defult language unless
forced explicitly in wikitext, e.g. [[File:Foo.svg|lang=ru]].
This change adds a feature flag that would enable always trying to
display in page language.

* If enabled, Parser will pass a new parameter - 'pagelang' - to
  the media handler.
* SvgHandler uses page language when determining what language to
  render the image in.
* 'pagelang' can always be overridden by 'lang'.
* If no translation in page language is available, the default
  language (English) will be used for thumbnail URLs, to prevent
  cluttering media storage and HTTP caches with useless copies.

Performance: this requires accessing image's metadata during parsing.
My testing indicates there were no code path where this wasn't the
case already, so no performance hit is expected, however we should
still keep an eye on page save performance.

Bug: T205040
Change-Id: I348840ef405e1370cc0c17d69051bce30153c9c0
2018-10-30 16:12:11 -07:00
Kunal Mehta
d47e2822bc Disable $wgEnableImageWhitelist by default
This opens up a hole for administrators to load images from external resources,
potentially leaking user's private information to external servers (IP address,
User-Agent, etc.).

Change-Id: Ie780637b292493e664e4d54671a5bb81046106f4
2018-10-24 15:39:53 -07:00
jenkins-bot
954b695a85 Merge "Remove old "bulletin board style toolbar" from core" 2018-10-24 05:30:14 +00:00
jenkins-bot
8f338c0e29 Merge "Add block restriction classes" 2018-10-24 01:28:36 +00:00
Dayllan Maza
a562611e5b Add block restriction classes
Partial blocks logic will be used in multiple places. This
classes will group block restriction functionality to avoid
code duplication

Bug: T202036
Change-Id: I675316dddf272fd0d6172ecad3882160752bf780
2018-10-23 17:41:50 -07:00
Gergő Tisza
cfb62c605f Hard-deprecate LegacyHookPreAuthenticationProvider class
The hooks that used to be called by this class will be removed in
I24d6fa963. The only reason to keep this class around is that
someone might have added it to $wgAuthManagerConfig so removing
it would trigger class lookup failures, so make sure any use
of the class triggers a deprecation warning.

Change-Id: I9755288eda7461ecf3dcd35de2081fbb3eb04ae3
2018-10-22 12:14:19 -07:00
jenkins-bot
b71dda8458 Merge "Include BCP 47 codes in $wgDummyLanguageCodes, but deprecate it" 2018-10-22 17:13:50 +00:00
C. Scott Ananian
103a4f76dc Deprecate $wgFixArabicUnicode / $wgFixMalayalamUnicode
These were introduced in MW 1.17 and are always true in production.

They were useful to allow folks to defer title conversion, but it's
been a long time now.  We don't need to make this optional any more.

Change-Id: I65dcfe80dc3e1dfeb4d63924a8928655e012a20c
2018-10-21 21:55:39 -04:00
jenkins-bot
93f50a6d18 Merge "Remove mention of $wgHTCPMulticastRouting, not present since MW 1.24" 2018-10-21 18:03:42 +00:00
C. Scott Ananian
f2e0516934 Include BCP 47 codes in $wgDummyLanguageCodes, but deprecate it
Add BCP 47 codes to $wgDummyLanguageCodes to ensure that
Language::factory() will return a valid MediaWiki-internal code if
given a BCP 47 alias.  We will want to make $wgDummyLanguageCodes a
private property of LanguageCode eventually, but let's start with
removing it from user configuration.

Setting $wgDummyLanguageCodes in LocalSettings.php has been deprecated
since 1.29.  Hard deprecate adding entries to $wgDummyLanguageCodes so
that we can eventually remove manual overrides from user
configuration.

This is a follow-up to 48ab87d0a3,
which described the various categories of codes, and
21ead7a98d, which added the correct
BCP 47 mappings.

Bug: T207433
Change-Id: I9f6dda3360f79ab65f6392f44c98926588d851c8
2018-10-19 14:31:21 -04:00
C. Scott Ananian
5255e01af7 Remove mention of $wgHTCPMulticastRouting, not present since MW 1.24
Change-Id: I04ba9761e98ac4cf177cd2581f0304206cd4365c
2018-10-19 17:40:52 +00:00
C. Scott Ananian
6c14dcfc97 Deprecate $wgSquidPurgeUseHostHeader
This header supports Squid in forward-proxy mode using HTTP/1.0
HTTP headers.  It is not used in production.

Change-Id: I99646c9c5519bd55b3d4988306e379f89d413bdc
2018-10-19 11:44:18 -04:00
C. Scott Ananian
d63684a064 Deprecate $wgUseESI
This was an experimental Squid 3 feature which is now defunct.

Change-Id: I799d87309b0dc77100900b75040fa9b85a35fc9a
2018-10-19 11:44:17 -04:00
James D. Forrester
cfa70ea6d0 Remove old "bulletin board style toolbar" from core
With this change, MediaWiki will no longer have a 'JavaScript-powered'
wikitext toolbar, and instead sysadmins will be required to choose one
(or more) of the several extensions available for this purpose if they
need the functionality. For over half a decade MediaWiki's tarball has
included the 2010-era replacement for this feature, WikiEditor. We are
now working on replacing even that, with the 2013-era visual editor, a
mode of which is the forthcoming 2017-era wikitext editor, and several
more specialised editors like CodeEditor.

Beyond this, the core editor toolbar is ancient, un-loved, and is used
only exceptionally rarely, mostly by accident. It is unhelpful to give
implicitly this as the primary editor for MediaWiki just because we've
not removed it from core when it is not a very good experience for any
kind of user, and has not received the attention that users deserve to
be worth retaining in core.

The old core preference, which was intended to govern whether this old
toolbar should be shown, has since mutated into whether the to run the
EditPageBeforeEditToolbar hook. The hook is used by several extensions
to provide toolbars in lieu of the core one. This preference has been,
in practice, a very confusing preference for MediaWiki users, who have
to interact with quite similar preferences to toggle their real editor
which sit next to this one on the preferences page. Consequently, this
preference is also removed.

The code could be made into an extension for those (very few) users of
MediaWiki who might want to keep on using it. However, the author will
offer their services but not their encouragement in said undertaking.

Bug: T30856
Bug: T32795
Change-Id: I2b05f0ca25873ad8e0b33a5e4938bef52c4e9347
2018-10-16 20:08:32 -07:00
jenkins-bot
50d87ad2f8 Merge "Prepare for REL1_32 cut, labelling master as 1.33-alpha" 2018-10-17 01:52:30 +00:00
James D. Forrester
b162e8ae78 Follow-up 3481e3b2: Drop disablability of ExpiryInputWidget before 1.32 is cut
No longer used anywhere(?); we'd rather not have to explain the temporary
variable in the MediaWiki 1.32.0 release notes if we can instead just not ship
it.

Bug: T192620
Change-Id: Icfb82f228512ed45f1a27ce3e565fbc5fc09f39c
2018-10-16 19:21:40 +00:00