1 Commits

Author SHA1 Message Date
ebb85c44bc init 2022-09-28 12:28:51 +07:00
3 changed files with 15 additions and 1 deletions

2
.gitignore vendored
View File

@@ -5,4 +5,4 @@ data/gitlab-test/postgresql
data/gitlab-test/redis
data/gitlab-test/gitlab-runner*
Addons/
Addons/gpg*

View File

@@ -0,0 +1,2 @@
GITLAB_TOKEN=glpat-XXX
GITLAB_SERVER=https://git.realmanual.ru/api/v4

View File

@@ -0,0 +1,12 @@
#!/bin/bash
source .env
USERS_LIST=$(curl -s --header "Authorization: Bearer $GITLAB_TOKEN" "${GITLAB_SERVER}/users?per_page=100" | jq -r '.[] | select( .state == "deactivated" and .is_admin == false).id')
echo $USERS_LIST
for user in ${USERS_LIST[@]}; do
echo "delete user_id: $user"
curl -s --request DELETE --header "Authorization: Bearer $GITLAB_TOKEN" "${GITLAB_SERVER}/users/$user"
done