Commit 014865ea authored by Felix Ableitner's avatar Felix Ableitner

Improve delete-account script and documentation

parent 87a1584f
Delete User Cccount
-------------------
1. Delete email account and data
- login to mail.$DOMAIN
- click on domain list
- select the correct domain
- search for the username on the top right
- delete the correct account
2. delete nextcloud account
1. Delete email account, Nextcloud account and all data
- `ssh user@$DOMAIN`
- `cd /mnt/repo-base/`
- `sudo docker-compose exec -u www-data nextcloud php occ user:delete user@$DOMAIN`
- `sudo ./scripts/delete-account $USER`
4. onlyoffice data
2. onlyoffice data
- go to [https://office.$DOMAIN/products/people/#sortorder=ascending](https://office.$DOMAIN/products/people/#sortorder=ascending)
- search for the username
- click on the arrow at the far right and press "Delete profile"
......@@ -5,8 +5,19 @@ source /mnt/repo-base/scripts/base.sh
ACCOUNT=$1
docker-compose exec -T -u www-data nextcloud php occ user:delete "$ACCOUNT"
if ! docker-compose exec -T -u www-data nextcloud php occ user:info "$ACCOUNT" | grep "$ACCOUNT" --quiet; then
echo "Error: The account $ACCOUNT does not exist"
exit
fi
docker-compose exec -T postfixadmin /postfixadmin/scripts/postfixadmin-cli mailbox delete "$ACCOUNT"
echo "Please confirm to delete the user account $ACCOUNT including all data. This is not reversible."
read -r -p "[y/N] " response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then
echo "Deleting Nextcloud account"
docker-compose exec -T -u www-data nextcloud php occ user:delete "$ACCOUNT"
# TODO: delete onlyoffice account???
echo "Deleting email account"
docker-compose exec -T postfixadmin /postfixadmin/scripts/postfixadmin-cli mailbox delete "$ACCOUNT"
# TODO: delete onlyoffice account???
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment