Commit graph

32 commits

Author SHA1 Message Date
Miguel de la Cruz
a9b894b7c3
Move mmctl cpa subcommands under mmctl user attributes (#33975)
Co-authored-by: Miguel de la Cruz <miguel@ctrlz.es>
2025-09-29 11:29:30 +00:00
Miguel de la Cruz
cd3f4483ee
Improves mmctl cpa subcommands' output to show human readable values instead of IDs (#33943)
* Improves `mmctl cpa` subcommands' output to show human readable values instead of IDs

* Adds mmctl docs updates

* Fixed linter

---------

Co-authored-by: Miguel de la Cruz <miguel@ctrlz.es>
2025-09-26 10:56:01 +02:00
Miguel de la Cruz
aad2fa1461
Adds Custom Profile Attributes value commands to mmctl (#33881)
Co-authored-by: Miguel de la Cruz <miguel@ctrlz.es>
2025-09-12 17:59:40 +02:00
Miguel de la Cruz
316712522c
Adds Custom Profile Attribute field commands to mmctl (#33789)
* Adds Custom Profile Attribute field commands to mmctl

* Fix linter

* Refactor buildFieldAttrs

* Reverse test to match implementation

* Adds a confirmation prompt

* Refactor the tests

---------

Co-authored-by: Miguel de la Cruz <miguel@ctrlz.es>
Co-authored-by: Mattermost Build <build@mattermost.com>
2025-09-11 18:38:21 +02:00
Ben Schumacher
24bb82e345
[MM-63593] Add mmctl user edit command (#31181)
* Add mmctl user edit command

* Add e2e tests

* Use right client method to update authdata

* implement local API endpoint

* Don't allow users to clear the authdata

* make mmctl-docs

* Fix casing

* Fix example

* make mmctl-docs

* Simplify error message

* Fix test

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2025-07-25 09:56:25 +02:00
Ben Schumacher
54f407b22b
[MM-57062] Update mmctl shell completion to v2 (#31287) 2025-07-18 15:29:01 +02:00
Claudio Costa
4a7aeae861
[MM-64663] Fix potential panic in mmctl ldap job show command (#32575)
* Fix potential panic in `mmctl ldap job show` command

* fix examples and docs

---------

Co-authored-by: Christopher Poile <cpoile@gmail.com>
2025-07-04 07:48:17 -06:00
Christopher Poile
9b1e03a6b8
[MM-63557] mmctl: Add compliance export create cmd (#30594)
* Refactor job retrieval to support multiple statuses & multiple types

- Updated job retrieval functions to handle multiple job statuses.
- Renamed `GetJobsByTypeAndStatus` to `GetJobsByTypesAndStatuses` for consistency across the codebase.
- Adjusted related function signatures and implementations in the job store and retry layer to accommodate the new method.
- Updated tests to reflect changes in job retrieval logic and ensure proper functionality.

* Add compliance export create command and tests

- Introduced `ComplianceExportCreateCmd` to facilitate the creation of compliance export jobs with options for date, start, and end timestamps.
- Added unit tests for the new command, covering various scenarios including valid and invalid inputs.
- Updated documentation to include usage examples and options for the new command.
- Enhanced existing tests to ensure proper functionality of compliance export job handling.

* update docs

* update tests for new logic

* Refactor message export job tests to use DefaultPreviousJobPageSize

- Updated all test cases in worker_test.go to replace hardcoded page size of 100 with DefaultPreviousJobPageSize for consistency.
- Adjusted the worker.go file to define DefaultPreviousJobPageSize and use it in job retrieval logic.
- Ensured that the changes maintain the functionality of job data initialization and retrieval tests.

* PR comments

* PR comments, simplifications, clarifications, formatting

* prefer hypen over underscore in command names

* merge conflict

* update mmctl docs
2025-06-24 21:38:30 +00:00
Christopher Poile
b33a7e362f
[MM-63556] mmctl: Add compliance export download cmd (#30576)
* add mmctl compliance export download command and tests

- Introduced `ComplianceExportDownloadCmd` to facilitate downloading compliance export files.
- Implemented the `DownloadComplianceExport` method in the Client interface for handling file downloads.
- Added unit tests for the download command, covering successful downloads, error handling for non-existent jobs, and retries on failure.
- Included end-to-end tests to validate the command's functionality.
- Updated documentation to include usage examples and options for the new command.

* don't know why this was left out

* PR comments

* adjust test for new retry logic

* refactored download fn for compliance_export and export

* fix test due to fixed logic

* docs
2025-06-24 16:27:54 -04:00
Christopher Poile
e60f878090
[MM-63555] mmctl: Add compliance export show and cancel cmds (#30569)
* add compliance export cancel command and tests

- Introduced `ComplianceExportCancelCmd` to allow cancellation of compliance export jobs.
- Implemented unit tests for the cancellation command, covering successful cancellation, error handling for non-existent jobs, and cancellation in non-cancellable states.
- Added end-to-end tests to validate the command's functionality in the E2E test suite.

* mmctl docs

* clean up example text; remove unneeded getJob

* fix tests

* fix tests, again.

* prefer hyphen for command naming

* update docs
2025-06-24 12:26:43 -04:00
Christopher Poile
9399398e04
[MM-62888] mmctl: Add compliance export list cmd (#30914)
* Add compliance export list cmd and tests

- Introduced `ListComplianceExports` method in the Client interface to retrieve compliance export jobs.
- Added `compliance_export` command with subcommand `list` for listing compliance export jobs, including pagination options.
- Implemented end-to-end and unit tests for the compliance export listing functionality.

* Add docs for mmctl

* fix test typo

* added paging, tested

* update docs with better desc (how it's sorted)

* simplified, reusing job call

* add show cmd, unit tests, e2e tests

* update mmctl docs
2025-06-24 11:20:40 -04:00
Harsh Aulakh
09a2037b61
MMCTL: Add import delete cmd for removing the import files (#29764)
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
2025-06-10 12:06:38 +02:00
Ben Schumacher
c2d08b7540
[MM-63772] Add LDAP setting to re-add removed members (#30787) 2025-05-20 11:15:25 +02:00
Ben Schumacher
8d4bf4bae0
[MM-54288] Support Packet V2 (#29403) 2025-01-13 20:23:09 +01:00
Ibrahim Serdar Acikgoz
424ce2b8db
[MM-59503] export: enable exporting configuration with mmctl (#28412) 2024-12-17 10:23:52 +01:00
Ben Schumacher
707144d358
[MM-61132] Fix example for mmctl permissions role show command (#28816) 2024-10-24 14:03:21 +02:00
Ben Cooke
b3c7ef0b97
[MM-56073] MMCTL delete post command (#27539)
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
2024-10-08 16:45:31 +02:00
Ibrahim Serdar Acikgoz
076a3cb0d5
cmd/mmctl/user: attempt to improve migrate-auth documentation (#28330) 2024-10-01 12:46:06 +02:00
Ben Cooke
9187c772b6
[MM-56074] mmctl job commands (#26855)
* add job list and update  job status command to mmctl
2024-06-17 12:07:05 -04:00
Ezekiel
b6a8965969
Gh 19916 mmctl list deactivated users only (#26646) 2024-04-30 14:49:50 +02:00
Ben Schumacher
3dae305dc7
[MM-56000] Add LDAP job command to mmctl (#25633) 2024-04-22 12:19:53 +02:00
Agniva De Sarker
273d4432b4
MM-57512: Disable content extraction during import (#26619)
https://mattermost.atlassian.net/browse/MM-57512
```release-note
NONE
```
2024-04-03 09:04:33 +05:30
Claudio Costa
4d6602aff0
[MM-57295] Bulk export: add roles and permission schemes (#26523)
* Bulk export: add roles and permission schemes

* Update mmctl docs

* Fix log

* Update mmctl tests

* Update mmctl unit tests

* Refactor to avoid extra calls

* Update translations

* Add test case

* Fix test

* Fix test
2024-03-26 08:43:25 -06:00
Jesse Hallam
ec1c693df9
mmctl: user preferences (#25721)
* add support for get/set/delete user preferences

* make mmctl-docs

* make --category required

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-02-07 15:34:37 -04:00
Julien Tant
6f1bbcd8ec
[MM-54770] Add ability to export profile pictures and fix importing them (#25042)
* add ability to export pp and fix import

* remove unused nopSeeker

* remove debug log

* fix shadow vars

* generate a warning instead of an error when unable to export profile picture

* fix merge conflicts

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-01-15 14:29:45 -07:00
Agniva De Sarker
b946dad78d
MM-55987: Bypass uploading to S3 for local mode mmctl import (#25591)
We directly instruct the server to read from the local filesystem
in case the local_mode key is set.

There is now no need to upload the file in --local mode and a warning
is thrown accordingly.

https://mattermost.atlassian.net/browse/MM-55987

```release-note
Now the mmctl bulk import process command in local mode supports processing an import file without actually uploading it to the server. Simply pass the file path to the import file and the server will directly read from it, and pass the --bypass-upload flag. There is no need to use the import upload command. NOTE: all of this is applicable only in local mode.
```

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-12-13 09:38:00 +05:30
Joram Wilander
e0a36cf60a
mmctl: add listing oauth apps (#25497)
* mmctl: add listing oauth apps

* Fix tests

* Update mmctl docs

* Fix tests

* Update server/cmd/mmctl/commands/oauth.go

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>

* Update server/cmd/mmctl/commands/oauth.go

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>

* Add paging

* Update docs

---------

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
2023-12-05 12:25:35 -05:00
Carrie Warner (Mattermost)
91a7639c3c
Updated mmctl export create command flag (#25474)
* Updated export create flag

* Update server/cmd/mmctl/docs/mmctl_export_create.rst

* Updated mmctl export create command flags
2023-11-23 08:58:34 -05:00
Ben Schumacher
5e94af1302
[MM-54852] Add mmctl command to download Support Packet (#25419)
* Add mmctl command to download Support Packet

* Simplify file name

* Revert "Simplify file name"

This reverts commit 17084a3350.

* Fix docs
2023-11-21 15:25:01 +01:00
Julien Tant
9d569df9b4
[MM-22133] Allow exporting and importing archived channels (#23724) 2023-08-25 17:55:47 -07:00
Julien Tant
077c16ef61
[MM-53454] Add export file settings + slash command for public link (#23915)
Co-authored-by: Mattermost Build <build@mattermost.com>
2023-07-19 13:01:39 -07:00
Miguel de la Cruz
951456c780
Includes mmctl into the mono-repo (#23091)
* Includes mmctl into the mono-repo

* Update to use the new public module paths

* Adds docs check to the mmctl CI

* Fix public utils import path

* Tidy up modules

* Fix linter

* Update CI tasks to use the new file structure

* Update CI references
2023-06-05 12:42:55 +02:00