Page MenuHomePhabricator

Remove provisioning for 'mwscript', 'foreachwikiindblist' etc from deployment host
Open, Needs TriagePublic

Description

As seen by T253756, it is easy to mistakenly run a maintenance script from the deployment host rather than the maintenance host as their environment is so similar.

For a lot of people these two hosts are the only MediaWik-deployed hosts in production that they have shell access to.

To my knowledge, on a deployment host:

  • ... there is no use case for running foreachwiki .
  • ... there is one use case for automated/scripted running of mwscript, namely by Scap for generating the localisation cache. This does not need the CLI wrapper, though. I suggest letting scap run php multiversion/MWScript.php directly. That also means Scap is explicitly in control over whether it executes from /srv/medaiwiki or /srv/medaiwiki-staging.
  • ... there is one use case for manual invocation of mwscript, namely as part of scap update-interwiki-cache. This has numerous other problems (per T247107), but given that this too is scripted by Scap, it would be trivial to write out the long-form here.

As such, I propose that the following are removed from the deployment host:

  • mwscript
  • foreachwiki
  • foreachwikiindblist
  • (any other MWScript wrappers?)

Thus making yielding a very obvious error that these are not available here. Just like when debugging a random app server in production, php MWScript.php can still be called directly ad-hoc if/when absolutely needed for some reason.

Event Timeline

Krinkle created this task.May 28 2020, 1:40 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 28 2020, 1:40 AM
DannyS712 updated the task description. (Show Details)May 28 2020, 3:20 AM
DannyS712 added a subscriber: DannyS712.
Joe added a subscriber: Joe.May 28 2020, 5:20 AM

Just out of curiosity, what's the problem with running scripts from the deployment host, other than "we prefer if they're run on mwmaint for consistency"?

I don't think it's harmful in any ways, but maybe I'm missing something.

Dzahn added a subscriber: Dzahn.May 28 2020, 6:57 AM

Just out of curiosity, what's the problem with running scripts from the deployment host, other than "we prefer if they're run on mwmaint for consistency"?

deployment hosts are simultaneously everything and nothing. They are only partially provisioned as an app/maint server. As such, some deployment steps cannot be applied to itself. This means that /srv/mediawiki does not have a functioning localisation cache. There exists one at /srv/mediawiki-staging though, which mwscript uses if it exists.

jijiki moved this task from Incoming 🐫 to Unsorted on the serviceops board.Aug 17 2020, 11:45 PM
jijiki moved this task from Inbox 🐅 to Misc on the User-jijiki board.Sep 8 2020, 10:15 AM