Some documentations (README files).
This commit is contained in:
parent
069104cd23
commit
4c98e71475
@ -17,10 +17,88 @@
|
|||||||
|
|
||||||
# Permanently delete a user and all related information, including posts from the database.
|
# Permanently delete a user and all related information, including posts from the database.
|
||||||
#
|
#
|
||||||
# mattermost user delete <users>
|
# Requirement:
|
||||||
|
# Set "EnableAPIUserDeletion" to "true" in file /opt/mattermost/config/config.json and restart mattermost
|
||||||
|
#
|
||||||
|
# /opt/mattermost/bin/mmctl user delete <users>
|
||||||
#
|
#
|
||||||
# Note:
|
# Note:
|
||||||
# Does not delete content from the file storage. You can manually delete all file uploads
|
# Does not delete content from the file storage. You can manually delete all file uploads
|
||||||
# for a given user as uploads contain the CreatorId field. User profile pictures are stored
|
# for a given user as uploads contain the CreatorId field. User profile pictures are stored
|
||||||
# in data/users/<userid>/profile.png.
|
# in data/users/<userid>/profile.png.
|
||||||
|
|
||||||
|
|
||||||
|
# Set "EnableAPIUserDeletion" to "true" in file /opt/mattermost/config/config.json
|
||||||
|
#
|
||||||
|
perl -i -n -p -e "s/^(\s*\"EnableAPIUserDeletion\":).*$/\1 true,/" /opt/mattermost/config/config.json
|
||||||
|
|
||||||
|
# Restart Mattermost
|
||||||
|
#
|
||||||
|
systemctl restart mattermost
|
||||||
|
|
||||||
|
usr_to_delete="
|
||||||
|
a.marinou-strohm
|
||||||
|
angelika
|
||||||
|
bennie
|
||||||
|
clarissa
|
||||||
|
david
|
||||||
|
fabian
|
||||||
|
georg
|
||||||
|
hanna
|
||||||
|
hannahnieswand
|
||||||
|
leonie
|
||||||
|
leoniestetter
|
||||||
|
lilian
|
||||||
|
lisa
|
||||||
|
lsachenbacher
|
||||||
|
ludwig
|
||||||
|
klaudia
|
||||||
|
mads
|
||||||
|
owain
|
||||||
|
stina
|
||||||
|
tim_vallee
|
||||||
|
viktar
|
||||||
|
"
|
||||||
|
|
||||||
|
clear
|
||||||
|
echo ""
|
||||||
|
for _user in $usr_to_delete ; do
|
||||||
|
echo ""
|
||||||
|
echo $_user
|
||||||
|
if $(mmctl user list 2> /dev/null | grep -q $_user) ; then
|
||||||
|
echo -n " Delete user '$_user' [yes/no]: "
|
||||||
|
read OK
|
||||||
|
OK="${OK,,}"
|
||||||
|
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
|
||||||
|
echo -n " Wrong answer - repeat [yes/no]: "
|
||||||
|
read OK
|
||||||
|
OK="${OK,,}"
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ $OK = "yes" ]] ; then
|
||||||
|
|
||||||
|
# Delete user
|
||||||
|
#
|
||||||
|
/opt/mattermost/bin/mmctl user delete $_user --confirm > /dev/null 2>&1
|
||||||
|
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
echo -e " [ \033[31m\033[1mError\033[m ] Deleting user '$_user' failed!"
|
||||||
|
else
|
||||||
|
echo -e " [ \033[32m\033[1mInfo\033[m ] User '$_user' was deleted."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo -e " [ \033[33m\033[1mWarning\033[m ] User '$_user' was omitted"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo -e " [ \033[31m\033[1mError\033[m ] User '$_user' not found!"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Set "EnableAPIUserDeletion" to "false" in file /opt/mattermost/config/config.json
|
||||||
|
#
|
||||||
|
perl -i -n -p -e "s/^(\s*\"EnableAPIUserDeletion\":).*$/\1 false,/" /opt/mattermost/config/config.json
|
||||||
|
|
||||||
|
# Restart Mattermost
|
||||||
|
#
|
||||||
|
systemctl restart mattermost
|
||||||
|
|
||||||
|
44
README.mmctl
Normal file
44
README.mmctl
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
# ---
|
||||||
|
# Mattermost Administration - mmctl command line tool
|
||||||
|
# ---
|
||||||
|
|
||||||
|
|
||||||
|
# see: https://docs.mattermost.com/manage/mmctl-command-line-tool.html
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Manage the credentials and authentication methods of remote Mattermost instances.
|
||||||
|
#
|
||||||
|
# Format
|
||||||
|
#
|
||||||
|
# mmctl auth login <instanceUrl> --name <namei-for-this-credentials>> --username <username> --password-file <fqfn>
|
||||||
|
# mmctl auth login <instanceUrl> --name <namei-for-this-credentials>> --username <username>
|
||||||
|
# mmctl auth login <instanceUrl>
|
||||||
|
#
|
||||||
|
# Examples
|
||||||
|
#
|
||||||
|
# /opt/mattermost/bin/mmctl auth login --name local-server https://mm-irights.oopen.de --username admin-irights
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# this stores the credentials at ~/.config/mmctl/config
|
||||||
|
#
|
||||||
|
# This is done by command "mmctl auth login"
|
||||||
|
#
|
||||||
|
# Example (for site mm-irights.oopen.de)
|
||||||
|
#
|
||||||
|
# name: local-server
|
||||||
|
# username: admin-irights
|
||||||
|
# password: M6aHdhGh_I%9
|
||||||
|
# instanceUrl: https://mm-irights.oopen.de
|
||||||
|
#
|
||||||
|
/opt/mattermost/bin/mmctl auth login --name local-server https://mm-irights.oopen.de --username admin-irights
|
||||||
|
|
||||||
|
|
||||||
|
# List your defined credentials at ~/.config/mmctl/config
|
||||||
|
#
|
||||||
|
/opt/mattermost/bin/mmctl auth list
|
||||||
|
|
||||||
|
|
||||||
|
# Set credentilas named 'local-server' as active
|
||||||
|
#
|
||||||
|
/opt/mattermost/bin/mmctl auth set local-server
|
@ -2,6 +2,10 @@
|
|||||||
# Aktualisieren des Mattermost-Servers
|
# Aktualisieren des Mattermost-Servers
|
||||||
# ------------------------------------
|
# ------------------------------------
|
||||||
|
|
||||||
|
# How do I install the Extended Support Release (ESR)?
|
||||||
|
#
|
||||||
|
# see: https://docs.mattermost.com/upgrade/extended-support-release.html
|
||||||
|
|
||||||
#
|
#
|
||||||
# see:
|
# see:
|
||||||
# - https://docs.mattermost.com/guides/administrator.html#upgrade-mattermost
|
# - https://docs.mattermost.com/guides/administrator.html#upgrade-mattermost
|
||||||
|
Loading…
Reference in New Issue
Block a user