Five Tools-tab actions: create account, list users, reset password, set admin, deactivate. Driven by mmctl --local, which talks to the server's unix socket rather than the REST API — no credentials to store, no token to expire, and it keeps working when the admin account is locked out or the site URL is wrong. mmctl is also the only route available: the v11 image is distroless with no shell at all, so every call has to be a direct exec of a binary. Two things found by running them: - `user promote` / `user demote` convert between GUEST and member accounts and have nothing to do with administrator rights. Granting system admin is `roles system-admin` / `roles member`. The first version used the wrong pair and failed with "Unable to convert the guest to regular user because is not a guest." - mmctl errors are multi-line: a summary line, then an indented bullet carrying the part that explains anything. Reporting the first line alone surfaced "1 error occurred:" and threw the reason away. Deactivate rather than delete, deliberately: Mattermost's delete is a permanent content purge, which is not something a single WebUI button should do. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
9 lines
194 B
Bash
9 lines
194 B
Bash
#!/bin/bash
|
|
|
|
appMattermostResetPassword() {
|
|
local args="$1"
|
|
authAdapterCall mattermost setPassword \
|
|
"$(authToolArg "$args" email)" \
|
|
"$(authToolArg "$args" password)"
|
|
}
|