Page MenuHomePhabricator

On sso.wikimedia.beta.wmflabs.org login page, the "Powered by MediaWiki" icon does not render
Closed, ResolvedPublic

Description

On sso.wikimedia.beta.wmflabs.org login page, the "Powered by MediaWiki" icon does not render:

image.png (2×3 px, 339 KB)

Compared to the normal login page:
image.png (2×3 px, 336 KB)

The <img> element has src="/en.wikipedia.beta.wmflabs.org/w/resources/assets/poweredby_mediawiki.svg" (note the single slash – this is a relative URL with a wiki prefix, not a protocol-relative one). It should either be rewritten to use https://en.wikipedia.beta.wmflabs.org/, or the SSO domain should serve that URL. I'm not sure if this is a MediaWiki bug, CentralAuth bug, or a configuration bug.

Event Timeline

The URL uses $wgResourceBasePath which we override to use the domain prefix. Maybe we shouldn't? I thought the Apache rewrite would take care of this...

(On an aside, there is apparently a $wmgPoweredByMediaWikiIcon setting but it seems completely unused.)

The URL uses $wgResourceBasePath which we override to use the domain prefix. Maybe we shouldn't? I thought the Apache rewrite would take care of this...

It looks like the rewrite works correctly. Accessing https://sso.wikimedia.beta.wmflabs.org/en.wikipedia.beta.wmflabs.org/w/resources/assets/poweredby_mediawiki.svg prints a helpful error message:

[Zt_JWB93MOGfFgBoDxmOIAAAAAU] /en.wikipedia.beta.wmflabs.org/w/resources/assets/poweredby_mediawiki.svg RuntimeException: unknown endpoint is not allowed on the SSO domain

Backtrace:

from /srv/mediawiki/php-master/extensions/CentralAuth/includes/Hooks/Handlers/SsoHookHandler.php(102)
#0 /srv/mediawiki/php-master/includes/HookContainer/HookContainer.php(159): MediaWiki\Extension\CentralAuth\Hooks\Handlers\SsoHookHandler->onSetupAfterCache()
#1 /srv/mediawiki/php-master/includes/HookContainer/HookRunner.php(3482): MediaWiki\HookContainer\HookContainer->run(string, array)
#2 /srv/mediawiki/php-master/includes/Setup.php(453): MediaWiki\HookContainer\HookRunner->onSetupAfterCache()
#3 /srv/mediawiki/php-master/includes/WebStart.php(85): require_once(string)
#4 /srv/mediawiki/w/static.php(52): require(string)
#5 {main}

So I guess we need to define MW_ENTRY_POINT to static or something in static.php, and then allow that value in the onSetupAfterCache() hook. Or should we just allow the "unknown" entry points there?

Change #1072624 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[operations/mediawiki-config@master] Define MW_ENTRY_POINT in static.php

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

Change #1072625 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/CentralAuth@master] SsoHookHandler: Allow static.php entry point

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

Change #1072625 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@master] SsoHookHandler: Allow static.php entry point

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

Change #1072624 merged by jenkins-bot:

[operations/mediawiki-config@master] Define MW_ENTRY_POINT in static.php

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

Mentioned in SAL (#wikimedia-operations) [2024-09-16T13:39:22Z] <hashar@deploy1003> Started scap sync-world: Backport for [[gerrit:1072624|Define MW_ENTRY_POINT in static.php (T374286)]]

Mentioned in SAL (#wikimedia-operations) [2024-09-16T13:43:01Z] <hashar@deploy1003> hashar, matmarex: Backport for [[gerrit:1072624|Define MW_ENTRY_POINT in static.php (T374286)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-09-16T13:49:25Z] <hashar@deploy1003> Finished scap sync-world: Backport for [[gerrit:1072624|Define MW_ENTRY_POINT in static.php (T374286)]] (duration: 10m 03s)