From: anarcat Date: Sat, 23 May 2020 15:09:59 +0000 (-0400) Subject: (no commit message) X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/8eac2a4510b2d86635d07d9d4ad700fd071ad70c --- diff --git a/doc/tips/user_command.mdwn b/doc/tips/user_command.mdwn new file mode 100644 index 000000000..795f4638e --- /dev/null +++ b/doc/tips/user_command.mdwn @@ -0,0 +1,13 @@ +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]]