Files
team/server/cmd/mmctl/docs/mmctl_system_nuke.rst
439a9c1825 Move mmctl user deleteall to mmctl system nuke users (#37197)
* Move mmctl user deleteall to system nuke users

Relocate the destructive PermanentDeleteAllUsers command out of the
user namespace into a new system nuke subcommand to reduce the risk of
accidental invocation. Regenerate mmctl docs and move associated unit
and e2e tests accordingly.

Co-authored-by: mattermost-code <[email protected]>

* Address CodeRabbit feedback for system nuke users E2E tests

Exercise SystemNukeUsersCmd with localOnlyPrecheck and --confirm in E2E
tests, verify non-local mode is blocked via subprocess, and update
confirmation text to mention users, posts, and related data.

Co-authored-by: mattermost-code <[email protected]>

* Fix viper local flag pollution in nuke users E2E tests

Avoid setting viper local directly so unit tests that bind the local
flag are not affected when mmctl unit and e2e suites run together.

Co-authored-by: mattermost-code <[email protected]>

* Simplify nuke users E2E test to reuse existing deleteall pattern

Replace the subprocess-based localOnlyPrecheck verification with the
straightforward client-based approach from the original
TestDeleteAllUserCmd. The local-only enforcement is already covered by
the local-only PermanentDeleteAllUsers API endpoint, so the regular and
system-admin clients fail naturally without invoking the precheck. This
also removes the viper local flag manipulation that previously polluted
other E2E tests.

---------

Co-authored-by: mattermost-code <[email protected]>

Co-authored-by: Hanzo Dev <[email protected]>
2026-06-25 12:37:26 +02:00

42 lines
1.3 KiB
ReStructuredText

.. _mmctl_system_nuke:
mmctl system nuke
-----------------
Destructive operations that permanently delete data
Synopsis
~~~~~~~~
Destructive operations that permanently and irreversibly delete server data. Use with extreme caution.
Options
~~~~~~~
::
-h, --help help for nuke
Options inherited from parent commands
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
::
--config string path to the configuration file (default "$XDG_CONFIG_HOME/mmctl/config")
--disable-pager disables paged output
--insecure-sha1-intermediate allows to use insecure TLS protocols, such as SHA-1
--insecure-tls-version allows to use TLS versions 1.0 and 1.1
--json the output format will be in json format
--local allows communicating with the server through a unix socket
--quiet prevent mmctl to generate output for the commands
--strict will only run commands if the mmctl version matches the server one
--suppress-warnings disables printing warning messages
SEE ALSO
~~~~~~~~
* `mmctl system <mmctl_system.rst>`_ - System management
* `mmctl system nuke users <mmctl_system_nuke_users.rst>`_ - Delete all users and all posts. Local command only.