Page MenuHomePhabricator

Use wgCanonicalServer in notification message
Closed, ResolvedPublic1 Estimated Story Points

Description

We currently generate messages like this:

The following file revision on Wikipedia is a possible match to a known child exploitation image based on their hash:

We should replace "Wikipedia" with the wiki ID, so that it's easy for the person receiving the notification to find, report, and remove the image.

Related Objects

Event Timeline

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

[mediawiki/extensions/MediaModeration@master] Use wgCanonicalServer instead of wgSitename in intro text of email

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

Change 1010705 merged by jenkins-bot:

[mediawiki/extensions/MediaModeration@master] Use wgCanonicalServer instead of wgSitename in intro text of email

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

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

[mediawiki/extensions/MediaModeration@wmf/1.42.0-wmf.21] Use wgCanonicalServer instead of wgSitename in intro text of email

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

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

[mediawiki/extensions/MediaModeration@wmf/1.42.0-wmf.22] Use wgCanonicalServer instead of wgSitename in intro text of email

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

Suggested QA steps which need a local wiki:

  1. Enable email support on your wiki so that you can view emails, if not already enabled.
    1. To set-up email support for MediaWiki-Docker, you can follow the steps at https://www.mediawiki.org/wiki/MediaWiki-Docker/Configuration_recipes/Mail_handling to add Mail hog to your MediaWiki-Docker instance. You should add the code listed in that page to the listed files and then down and up your MediaWiki-Docker instance.
  2. Upload a test file to your wiki
  3. For the filename of the file you uploaded in step 2, note down the filename after replacing any spaces in the name with _ and removing the File: prefix.
  4. Define $wgMediaModerationPhotoDNAMockServiceFiles in your LocalSettings.php as the following replacing <file> with the filename from step 3. If you already have a definition of $wgMediaModerationPhotoDNAMockServiceFiles then remove it.
$wgMediaModerationPhotoDNAMockServiceFiles = [
	'FilesToIsMatchMap'	=> [
		// change to false if you want IsMatch to be false
		'<file>' => true,
	]
];
  1. Define the following in your LocalSettings.php, if you don't already have it there:
$wgMediaModerationRecipientList = [ 'admin@wikimedia.org' ];
$wgMediaModerationFrom = 'no-reply@wikimedia.org';
$wgAllowHTMLEmail = true;
  1. Run ./maintenance/run MediaModeration:scanFilesInScanTable.php --use-jobqueue --verbose
  2. Open the email server for your wiki (if you use mail hog / did step 1A then open http://localhost:8025 ).
  3. Verify that an email for the file you uploaded in step 2 is in the inbox
  4. Open the email and verify that the first sentence of the email contains a link to the URL of your wiki. For example, it should look something like:

image.png (70×1 px, 19 KB)

kostajh renamed this task from Use wiki ID in notification message to Use wgCanonicalServer in notification message.Mar 13 2024, 12:23 PM

Change 1010577 merged by jenkins-bot:

[mediawiki/extensions/MediaModeration@wmf/1.42.0-wmf.21] Use wgCanonicalServer instead of wgSitename in intro text of email

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

Change rEAFF1010578b1147 merged by jenkins-bot:

[mediawiki/extensions/MediaModeration@wmf/1.42.0-wmf.22] Use wgCanonicalServer instead of wgSitename in intro text of email

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

Mentioned in SAL (#wikimedia-operations) [2024-03-13T14:01:16Z] <dreamyjazz@deploy2002> Started scap: Backport for [[gerrit:1010577|Use wgCanonicalServer instead of wgSitename in intro text of email (T359979)]], [[gerrit:rEAFF1010578b1147|Use wgCanonicalServer instead of wgSitename in intro text of email (T359979)]]

Mentioned in SAL (#wikimedia-operations) [2024-03-13T14:03:45Z] <dreamyjazz@deploy2002> dreamyjazz: Backport for [[gerrit:1010577|Use wgCanonicalServer instead of wgSitename in intro text of email (T359979)]], [[gerrit:rEAFF1010578b1147|Use wgCanonicalServer instead of wgSitename in intro text of email (T359979)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-03-13T14:16:13Z] <dreamyjazz@deploy2002> Finished scap: Backport for [[gerrit:1010577|Use wgCanonicalServer instead of wgSitename in intro text of email (T359979)]], [[gerrit:rEAFF1010578b1147|Use wgCanonicalServer instead of wgSitename in intro text of email (T359979)]] (duration: 14m 56s)

Djackson-ctr subscribed.

Per the ticket Description, I have verified the new code has been implemented and is functioning and displaying as expected... Good Work as always @Dreamy_Jazz!!!


As it shows in Chrome -- MailHog

image.png (412×1 px, 61 KB)

image.png (379×1 px, 59 KB)


As it shows in Firefox

image.png (108×563 px, 8 KB)


As it shows in Opera

image.png (94×563 px, 10 KB)