Page MenuHomePhabricator

Make ShellboxClient polymorphic
Open, Needs TriagePublic

Description

We are using Shellbox in WQCS (T176312) and it would be great to have ShellboxClientFactory be a dispatcher returning different implementations of shellbox (as a concept not the service) based on configuration or auto-detection. This improves portability of mediawiki and following LSP. One big reason for this was that setting up shellbox server wasn't easy for devs who just wanted to test the shellbox client. The other implementations of shellbox can be using firejail (falling back to Shell and possibly deprecating direct use of Shell class) or direct execution (for tests only).

Event Timeline

I would frame this task a bit differently. Shellbox is, and IMHO should remain, a specific implementation; but it should implement some general service, which could then also be provided by MediaWiki using other (less secure) implementations. The main difference from the existing Shell class would probably be the addition of an equivalent of Client::call(), to call a PHP callable.