Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

Improve delete-account script and documentation

parent 87a1584f
Loading
Loading
Loading
Loading
+3 −10
Original line number Diff line number Diff line
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"
+14 −3
Original line number Diff line number Diff line
@@ -5,8 +5,19 @@ source /mnt/repo-base/scripts/base.sh

ACCOUNT=$1

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

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"

    echo "Deleting email account"
    docker-compose exec -T postfixadmin /postfixadmin/scripts/postfixadmin-cli mailbox delete "$ACCOUNT"

    # TODO: delete onlyoffice account???
fi