Page MenuHomePhabricator

Block all imports if no configuration file for a source wiki exists
Closed, ResolvedPublic2 Story Points

Description

Motivation
While working on the "bad categories/templates" feature we decided to go with an "allow everything by default" mode when no CommonsHelper2-compatible configuration for a local wiki could be found.

With T196969 we enabled the FileExporter extension for a very small subset of wikis. But the FileImporter allows imports from all wikis in the cluster. Users can easily make use of this by manually providing a ?clientUrl=… parameter in the URL, and already did.

Acceptance Criteria

  • An import from a wiki without a config file is not allowed
  • The following error message is shown on our error page:

The file could not be imported. There is no configuration for wiki %s yet. You can create a configuration for the wiki <a href=”…”>here</a>.

Details

Related Gerrit Patches:
operations/mediawiki-config : masterSet FileImporter config help location
mediawiki/extensions/FileImporter : masterAdd config setting for the config help page
mediawiki/extensions/FileImporter : masterReuse existing URL to point to missing ComonsHelper config page
mediawiki/extensions/FileImporter : masterBlock imports if no configuration exists

Event Timeline

WMDE-Fisch set the point value for this task to 3.Jul 24 2018, 12:29 PM

@Lea_WMDE we would need the text for the error message and the url of the link where to point the users to.

@Lea_WMDE There was an alternative suggestion from the community, to implement a fallback to using the configs of enwiki if none are found. The background is that a lot of (but not all) small wikis import the templates from enwiki as an start. link

@MichaelSchoenitzer_WMDE:

to implement a fallback to using the configs of enwiki if none are found.

I personally oppose such fallback, because, for example, zhwikisource (note to every active users of this wiki: please do not add Chinese-Sites just because of this mention) doesn't allow files that are public domain in US but not in CN/HK/TW... where enwikisource allow such files.

Lea_WMDE triaged this task as Medium priority.Nov 13 2018, 1:58 PM
Lea_WMDE updated the task description. (Show Details)

The following error message is shown on our error page: TODO (create page based on examples?)

The error message that should be displayed when no config file is found still needs to be defined. - Any ideas? @JStrodt_WMDE @Lea_WMDE

WMDE-Fisch moved this task from Sprint Backlog to Doing on the WMDE-QWERTY-Sprint-2018-11-20 board.

Change 475091 had a related patch set uploaded (by WMDE-Fisch; owner: WMDE-Fisch):
[mediawiki/extensions/FileImporter@master] [WIP] Block imports if no configuration exists

https://gerrit.wikimedia.org/r/475091

@MichaelSchoenitzer_WMDE will add the text in the description.

@MichaelSchoenitzer_WMDE will add the text in the description.

I have a rough idea build from other messages we have there:

The configuration file for your wiki ($URL_TO_EXPECTED_CONFIG_LOCATION) seems to be missing. Please create it and add the relevant information to know if  can be put on Commons

@WMDE-Fisch: Sorry for the delay, I added my draft of the text above. It's still quite easy to change the text at any time, isn't it?

@WMDE-Fisch: Sorry for the delay, I added my draft of the text above. It's still quite easy to change the text at any time, isn't it?

No worries and thanks. Yeah changing the text is not a problem. Might just be annoying for the translators - So if you feel you will come up with a different text in the next few days we can still wait before we merge the patch. :-)

Change 476260 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/FileImporter@master] Reuse existing URL to point to missing ComonsHelper config page

https://gerrit.wikimedia.org/r/476260

Change 475091 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Block imports if no configuration exists

https://gerrit.wikimedia.org/r/475091

We reevaluated the text on the error page and came the conclusion of having Importing files from the source wiki ($1) is not yet possible. There is no configuration for the wiki at $2. - It's a bit more in sync with other messages in that realm. This still would be more useful with a help page to link at for that see T210722

Can the link of $2 please be https://www.mediawiki.org/wiki/Extension:FileImporter/Data instead of linking to the special page results?
Also, it would be great, if the whole URL would be visible and not just "mediawiki.org", since right now it looks like we are linking to mediawiki in general.

@Lea_WMDE, the problem is that all we currently have in the FileImporter configuration is a base name for the CommonsHelper2 configuration pages. In our specific setup this base name is Extension:FileImporter/Data/. We append the abbreviated domain name, e.g. en.wikipedia, and expect to find a page via https://www.mediawiki.org/w/api.php?action=query&titles=Extension:FileImporter/Data/en.wikipedia, which is then either found or not.

There is no guarantee a page with the title https://www.mediawiki.org/wiki/Extension:FileImporter/Data/ exists (oh, and it doesn't). We created a page https://www.mediawiki.org/wiki/Extension:FileImporter/Data on Commons, but this is specific for Commons only, and would result in an error message in all other cases.

Linking to https://www.mediawiki.org/wiki/Special:PrefixIndex/Extension:FileImporter/Data/ avoids this problem for now.

In other words: We have not introduced a configuration flag for the concept of an "overview page". My suggestion would be to not invest time on this because I think a link to an actual help page will be much more helpful, and resolve all this.

Change 477305 had a related patch set uploaded (by WMDE-Fisch; owner: WMDE-Fisch):
[mediawiki/extensions/FileImporter@master] Add config setting for the config help page

https://gerrit.wikimedia.org/r/477305

We'll make the link to the help-/landing-page for the settings a configurable variable. This way it can be set also by 3rd parties to something different than the mediawiki.org page. - I will include a wmf-config ticket so that we default it on production to https://www.mediawiki.org/wiki/Extension:FileImporter/Data

Lea_WMDE changed the point value for this task from 3 to 2.

Change 477798 had a related patch set uploaded (by WMDE-Fisch; owner: WMDE-Fisch):
[operations/mediawiki-config@master] Set FileImporter config help location

https://gerrit.wikimedia.org/r/477798

Change 476260 abandoned by Thiemo Kreuz (WMDE):
Reuse existing URL to point to missing ComonsHelper config page

Reason:
Obsolete via I59f2d39.

https://gerrit.wikimedia.org/r/476260

When the config change for the help page setting is goes live this can be tested on beta. Config will be in SWAT on Monday 1PM UTC+1
see https://wikitech.wikimedia.org/w/index.php?title=Deployments&type=revision&diff=1810551&oldid=1810503

Change 477305 merged by WMDE-Fisch:
[mediawiki/extensions/FileImporter@master] Add config setting for the config help page

https://gerrit.wikimedia.org/r/477305

Change 477798 merged by jenkins-bot:
[operations/mediawiki-config@master] Set FileImporter config help location

https://gerrit.wikimedia.org/r/477798

Mentioned in SAL (#wikimedia-operations) [2018-12-10T12:21:28Z] <zfilipin@deploy1001> Synchronized wmf-config/CommonSettings.php: SWAT: [[gerrit:477798|Set FileImporter config help location (T199108)]] (duration: 00m 47s)

WMDE-Fisch moved this task from Done to Demo on the WMDE-QWERTY-Sprint-2018-12-04 board.
Lea_WMDE closed this task as Resolved.Dec 18 2018, 1:12 PM
Lea_WMDE moved this task from Demo to Done on the WMDE-QWERTY-Sprint-2018-12-04 board.