After battling with the oneliners in [[tips/inside_dot_ikiwiki]], I have expanded them into a full script ([current snapshot](https://gitlab.com/anarcat/scripts/-/blob/836bda6929f23fae49f8d4cf75e88ca6cc55152b/ikiwiki-user), [latest](https://gitlab.com/anarcat/scripts/blob/master/ikiwiki-user)).

It has three commands:

 * `list`: just list the users as a TSV (tab-separated list)
 * `dump`: use `Data::Dumper` to dump the entire database, as done in the oneliners
 * `delete`: delete the given user, or interactively approve all users one by one

It's kind of rough right now, but it helped me deal with the [[bugs/emailauth_bypasses_account__95__creation__95__password]] problem, as a crude [[todo/anti-spam_protection]]. In particular, it "vendors" the lock mechanisms because `lockwiki` and `unlockwiki` are not exported by the `IkiWiki` module, which is unfortunate.

It could be improved significantly: for example, the `delete` command could use a "time" argument to review only the accounts created after a certain date, instead of reviewing the entire list each time. I just couldn't be bothered with the date parsing.

I would be happy to see this command land in ikiwiki itself, under a GPL-2+ or whatever open license. :) -- [[anarcat]]
