Held together by spare time: Reviving wiki.alpinelinux.org during PHP2Shell
18 points by durrendal
18 points by durrendal
The rest were the kind of thing that just ate time, and they make for a pretty dull story. $wgMainCacheType = CACHE_ACCEL needs php83-pecl-apcu, and opcache doesn't count.
Opcache just handles (automatic) code caching, APCu handles (application opt-in) data caching.
It's a good story and I nearly completely agree about packaging the dependencies, but keeping just the bespoke mediawiki version unpackaged for a 2nd, later step sounds like a reasonable compromise to me, but I've not reread every paragraph here to make sure I didn't miss anything. I guess I'm a fan of 80:20 solutions and making a good chunk of something nicer and keeping the chaos contained is more acceptable to me.
In my experience, distro packaging of web applications (in particular PHP that runs in the context of a web server and not an app server of its own) tends not to mesh very well with how the applications work, or how they're deployed (i.e. multiple instances). So your 80:20 solution would make more sense anyways.
I'm not really informed about the technical details of the wiki, but why don't a static HTML backup is present?. When such vulnerability occurs, at least the userbase will have access to something.
Or just put the whole thing in an SSG
Well the wiki has been around since about at least 2010, possibly a little earlier than that. SSG's weren't really mainstream at that point, but mediawiki had 8 years of development and support by that point.
Plus the intent of the wiki was to give the community a space to collaboratively document the distribution. Wiki's are really great for this specific use case, you don't need to worry about knowing git, or how to make a merge request, etc. All you need is a login and to write prose.
We do use SSGs for our main site and blog, hugo and antora depending where you look; so we're not opposed to this. It's just a different tool for a different job.
Obligatory ikiwiki mention: a static site generator originally from 2006 with a wiki front end. Mind you these days I think some of the design choices might be a little unpalatable and a migration from media wiki would be far from trivial.
A static backup is a good idea, we've had a few contributors kick around the idea of packaging our documentation as a set of mandocs as well. It just takes time to implement everything we want.
This is a great writeup, I hope that some of the lessons learned can be leveraged into improving the docs on mediawiki.org. I do fear that some of the issues are potentially self-inflicted (not to shame, it's just a complicated system), e.g. most single-server installs should never need to set $wgCacheEpoch manually.
Which means the next time a PHP2Shell comes along, the fix is apk upgrade, run.php update, and a php-fpm restart.
This is great, and the workflow we've also strived to make possible for users of the MediaWiki Debian package. I would expect your work to also benefit a lot of other users, so kudos.
...and then break out all of the various extensions that comprise the core system into a proper APKBUILD.
I don't think this is a good idea tbh. There's a reason MediaWiki bundles these extensions, they're essentially "core" functionality from a user-perspective, even if they are implemented as extensions. And as you noted, it causes extra work on the package maintenance side. In Debian we just ship them all in the main "mediawiki" package.
This is a great writeup Thank you! That means a ton, especially coming from someone as intimate with Mediawiki as yourself.
some of the issues are potentially self-inflicted You're absolutely right, there's probably still some misconfiguration in our deployment even, that's a side effect of people owning the problems without being fully versed in them. I would by no means call myself an expert mediawiki admin, so it's likely I've injected some self-inflicted problems too.
I hope that some of the lessons learned can be leveraged into improving the docs on mediawiki.org. This was my thinking in writing the article initially. I try and work in a way that leaves it better for whomever comes after me, both from an infrastructure and packaging perspective. I hope that in making it easier for me to help administer this infrastructure that it also helps someone else deploy it new, and that all of it outlives my direct contributions. Especially if the next person does it better than me because they faced different problems!
In Debian we just ship them all in the main "mediawiki" package I'm glad you mentioned this, I didn't think to go and look at the Debian packaging when I put together the APKBUILD, but that sounds like a saner approach. Right now I have it split into
mediawikiand amediawiki-default-extensions, and you need to apk add both. Fortunately very easy to fix, I just wouldn't have thought to do so.
I’m currently involved in two separate mediawiki migrations. One of them, the smaller one, follows much of the same story as here: we are migrating a small mediawiki instance from a host with an old ish mediawiki version, old ish PHP version etc. The owner has ultimately decided to move to a static site which I am happy about. On the other project, I’m involved in trying to move the Debian wiki to mediawiki . That is a much bigger project.