Page MenuHomePhabricator

MediaModeration: Disable extension on beta wikis
Closed, ResolvedPublic2 Estimated Story Points

Description

Summary

The MediaModeration extension scans files using the PhotoDNA service that needs an API key. We don't have the API key available on beta wikis, so need to disable it to avoid issues.

Background

  • MediaModeration runs scans over images using a maintenance script
  • To scan images we need to make a request to PhotoDNA
    • This needs an API key to make these requests, but it is not set for the beta wikis
  • We should disable the scanning script on beta wiki to avoid requests that contain an invalid API key

Acceptance criteria

Event Timeline

Change #1145946 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/MediaModeration@master] Throw if $wgMediaModerationPhotoDNASubscriptionKey not set

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

Change #1145947 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[operations/mediawiki-config@master] Set $wgMediaModerationPhotoDNASubscriptionKey as empty in readme.php

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

Change #1145949 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[operations/puppet@production] MediaModeration: Only running scanning scripts on production

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

Change #1145947 merged by jenkins-bot:

[operations/mediawiki-config@master] Set $wgMediaModerationPhotoDNASubscriptionKey as empty in readme.php

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

Mentioned in SAL (#wikimedia-operations) [2025-05-14T14:43:49Z] <dreamyjazz@deploy1003> Started scap sync-world: Backport for [[gerrit:1145947|Set $wgMediaModerationPhotoDNASubscriptionKey as empty in readme.php (T394299)]]

Mentioned in SAL (#wikimedia-operations) [2025-05-14T14:48:23Z] <dreamyjazz@deploy1003> dreamyjazz: Backport for [[gerrit:1145947|Set $wgMediaModerationPhotoDNASubscriptionKey as empty in readme.php (T394299)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Change #1145946 merged by jenkins-bot:

[mediawiki/extensions/MediaModeration@master] Throw if $wgMediaModerationPhotoDNASubscriptionKey not set

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

Mentioned in SAL (#wikimedia-operations) [2025-05-14T14:55:09Z] <dreamyjazz@deploy1003> Finished scap sync-world: Backport for [[gerrit:1145947|Set $wgMediaModerationPhotoDNASubscriptionKey as empty in readme.php (T394299)]] (duration: 11m 20s)

Change #1145949 merged by RLazarus:

[operations/puppet@production] MediaModeration: Only running scanning scripts on production

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

For QA I would suggest checking that no more logs appear in https://beta-logs.wmcloud.org/goto/7dacc8512956b14f79255206bf05187e after end of May 15th.

You can also verify that setting $wgMediaModerationPhotoDNASubscriptionKey as an empty string on a local instance causes a LogicException to be thrown when you try to scan.

Djackson-ctr subscribed.

QA is completed, I have verified the new code has been implemented and is functioning as expected (When viewing the https://beta-logs.wmcloud.org/goto/7dacc8512956b14f79255206bf05187e, I am seeing LogicExceptions thrown for $wgMediaModerationPhotoDNASubscriptionKey API Key is not set).