Multi-select users for mass modification/deletion/purge #14038

Open
opened 2025-11-02 11:01:00 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @KawaKode on GitHub (Jan 24, 2025).

Feature Description

Hello and happy new year,

I have an issue that a lot of people that did not deactivated the registration button have : hundreds of bot accounts.
I wish to delete them all and purge their spam repos but, I cannot do that via the GUI, where you have to go onto each of the 600 accounts to delete/purge them. And no, the inactive users deletion option is useless against that because all of those "users" are active.
Image

I'm usually pro-command line but when I'm out and about or connecting to a friends workstation, i dont want to have to connect to my wireguard VPN ssh into my docker host and make a script to delete all of those users.

Thanks for your consideration !

Screenshots

No response

Originally created by @KawaKode on GitHub (Jan 24, 2025). ### Feature Description Hello and happy new year, I have an issue that a lot of people that did not deactivated the registration button have : hundreds of bot accounts. I wish to delete them all and purge their spam repos but, I cannot do that via the GUI, where you have to go onto each of the 600 accounts to delete/purge them. And no, the inactive users deletion option is useless against that because all of those "users" are active. ![Image](https://github.com/user-attachments/assets/e7d8ff1b-58a8-4494-8795-052df1f18481) I'm usually pro-command line but when I'm out and about or connecting to a friends workstation, i dont want to have to connect to my wireguard VPN ssh into my docker host and make a script to delete all of those users. Thanks for your consideration ! ### Screenshots _No response_
GiteaMirror added the type/proposal label 2025-11-02 11:01:00 -06:00
Author
Owner

@infogulch commented on GitHub (Jul 10, 2025):

I had 19918 spam/malware bot accounts that got into my instance. I was able to mark them as inactive through a SQL query, and the Delete all unactivated accounts worked for all but 2166 of them which I can't delete because they have live repos. I will not be clicking each account individually to purge it.

I would like a new maintenance operation: Purge all unactivated accounts.

Edit: I ended up exporting the bad users from mysql and using the cli to purge:

  • Exported users to delete with mysql --user=${CLOUDRON_MYSQL_USERNAME} --password=${CLOUDRON_MYSQL_PASSWORD} --host=${CLOUDRON_MYSQL_HOST} ${CLOUDRON_MYSQL_DATABASE} -e "SELECT id FROM user WHERE FROM_UNIXTIME(created_unix) > '2025-03-01'" > /app/data/users-to-delete.txt
  • Deleted the header name with vim
  • Run a command to use the cli to purge each user in the list: while read -r id; do /home/git/gitea/gitea -c /run/gitea/app.ini admin user delete --id "$id" --purge; done < /app/data/users-to-delete.txt

Forum thread with more details: https://forum.cloudron.io/topic/14053/clean-up-external-users-that-have-accessed-gitea-instance

@infogulch commented on GitHub (Jul 10, 2025): I had 19918 spam/malware bot accounts that got into my instance. I was able to mark them as inactive through a SQL query, and the *Delete all unactivated accounts* worked for all but 2166 of them which I can't delete because they have live repos. I will not be clicking each account individually to purge it. I would like a new maintenance operation: *Purge all unactivated accounts*. Edit: I ended up exporting the bad users from mysql and using the cli to purge: - Exported users to delete with ` mysql --user=${CLOUDRON_MYSQL_USERNAME} --password=${CLOUDRON_MYSQL_PASSWORD} --host=${CLOUDRON_MYSQL_HOST} ${CLOUDRON_MYSQL_DATABASE} -e "SELECT id FROM user WHERE FROM_UNIXTIME(created_unix) > '2025-03-01'" > /app/data/users-to-delete.txt` - Deleted the header name with vim - Run a command to use the cli to purge each user in the list: `while read -r id; do /home/git/gitea/gitea -c /run/gitea/app.ini admin user delete --id "$id" --purge; done < /app/data/users-to-delete.txt` Forum thread with more details: https://forum.cloudron.io/topic/14053/clean-up-external-users-that-have-accessed-gitea-instance
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14038