User account cleaning

Hi all, when I remove a user account in NS8 seems that all his data are not removed continue to stay there. Can I remove them manually?

If I can remove them manually there is a way to find where user account data can be stored on NS8? For example mail data are stored in /home/mail1/.local/share/containers/storage/volumes/dovecot-data/_data/ but I can find even in webtop some user data (/home/webtop1/.local/share/containers/storage/volumes/webtop-home/_data/domains/NethServer/com.sonicle.webtop.vfs/mydocuments/ or in nethvoice: /home/nethvoice1/.local/share/containers/storage/volumes/nethcti-middleware-secrets/_data/.

There is a way to clean account data after the account has been removed? Can be useful to add a flag (or a flag for each service) when removing an account to remove even all flagged service data stored?

NethServer Version: 8
Module: ALL

We have to wait?

Paolo

at least one week to wait, it is quiet here, devs are back next week cc @davidep

Generally speaking, we try to avoid creating issues directly on GitHub. We prefer to discuss and define the issue first on Discourse.

Thanks stephdl, forgive the noise, I’ll wait the discussion about this issue.

Best regards

Paolo

Good question, and yeah, account removal in NS8 is currently manual per-service.

The official docs confirm removal doesn’t clean up app data automatically, but they don’t go into per-app specifics. Here’s what I can share:

Webtop: a bit tricky. 1) Access the Webtop admin interface, 2) remove the user’s active shared resources, 3) disable the user before removing the LDAP entry. If you’ve already deleted the LDAP entry, temporarily recreate it (disabled, same username), run the procedure, then delete it again.

Mail: erase the mailbox with:

runagent -m mail1 podman exec dovecot rm -rf username

Some settings (custom quota, disabled state, custom retention) may remain on disk — shouldn’t cause issues unless you recreate the same account later, just keep it in mind.

Nextcloud: the manual already links to the official Nextcloud docs for this procedure.

Samba File Server: remove the home directory with:

runagent -m samba1 podman exec samba-dc rm -rf /srv/homes/username

NethVoice: I might be missing pieces here, so I’ll loop in @Stll0 for confirmation. At minimum, for NethCTI secrets:

runagent -m nethvoice1 podman exec nethcti-middleware rm -rf /var/lib/whale/secrets/username

In the future we may implement automated and scheduled removal of stale data in applications once a user becomes orphaned of the corresponding LDAP entry. See Automated cleanup of orphaned application data after account removal · Issue #8137 · NethServer/dev · GitHub

Hi Davide, thanks for the detailed response. I have some more detail to ask you :slight_smile:
If there are no Domains->Nethserver->Resources in administration interface means that there are no shared resources?

Further remove ldap entry means remove the user from NS8 cluster-admin interface?

Is not needed remove the user before removing the LDAP entry it is sufficient disable it?

Best regards

Piviul

This may be a question for Webtop experts. I used the word “resources” for IMAP shared folders, calendars etc. I guess if you forget to remove them in advance, Webtop will handle the stale references; I hope it handles them successfully! /cc @lucag

I guess you’re referring to Webtop. The user in this case is the Webtop one, in Webtop admin UI. You must disable it before removing the user account (hence its LDAP entry) from the cluster-admin interface. You can temporarily recreate it in cluster-admin, with the same name, if needed.

AFAIK yes, but let’s ask Luca for confirmation.

Here I am :slightly_smiling_face:

I confirm much of what my colleague @davidep has already said.

For completeness, I’ve provided the correct procedure below when deleting a user with an active profile on WebTop:

  1. delete all resource sharing on WebTop for the profile you want to delete.
  2. if necessary, also delete the contents of personal resources (events, contacts, tasks, and cloud files).
  3. access the WebTop admin panel and disable or remove the profile from the user list.
  4. only then, delete the user from the NS8 provider account.

If the user has already been deleted from NS8, I recommend temporarily recreating it and proceeding as suggested.

Nice.

I bet that all necessary steps are detaily described into the admin manual… no?

I lost. not even 1 row esplaining how to correctly delete users…

I’m surprised that you still have to do anything manually at all. Something like this should be automated, including the option to archive user resources externally before deleting them.

Hi Luca, let me ask you some more details: to delete all wetop resource sharing and personal resources of the target user I have to access in webtop with user credentials or I can find them even from admin interface?