As contractors come and go, we end up with dead forks in Stash. That is, forks in user repositories that are never going to be incorporated. We would like to delete all repositories in the user's personal space.
Our users are configured using LDAP. Once the user is dropped from LDAP, the user is no longer visible in the user's admin page of Stash. However, we can still go to the users list of repositories via http://stash/users/user_name.
Is there a convenient way to remove all personal repositories for these users?
There isn't a convenient way - at least no way I know.
As a central git-server is generally used as a long-time archive, there even shouldn't be a convenient way IMHO to do mass destruction operations (which might be easily done by incident ...)
You might achieve your goal using the REST API.This needs a little scripting, but should be easy enough though.
Get all personal repositories of the user via GET /rest/api/1.0/projects/{~username}/repos (https://developer.atlassian.com/static/rest/bitbucket-server/4.4.1/bitbucket-rest.html#idp1740304)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just wanted to point out, how "freeing licenses when using LDAP" works ...- I was aware that was not part of @michael_giroux's question - therefore I added it as a comment - and not as an answer
Tim Crall: Thanks - wasn't aware of this. My insights have been a result of discussion on https://answers.atlassian.com/questions/195495 As I don't have access on our ActiveDirectory contents, the dynamic "Separate Group" solution is not a way to go for me yet .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yeah, I know licenses weren't your issue, but Johannes's aside about deleting accounts from LDAP being the only way to retrieve licenses seemed odd to me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The license is not the issue. Some of these folks forked several repos, and/or created their own repositories. We want to every repository created by a contractor once they are removed from LDAP.
Johannes Kilian has proposed a nice solution using the Rest API. We will look into that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We have our server configured so that only members of a particular AD group can login to Stash, and removing them from that group frees up the license.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@michael_giroux: "Once the user is dropped from LDAP, the user is no longer visible in the user's admin page of Stash"
Just for information: This is the only way to free the Bitbucket-licenses of LDAP users. Each LDAP user is able to login into Bitbucket server. As soon as the LDAP user initially logs in, he eats up one license out of your license pool. Bitbucket does not offer a possibility to remove the user from the license pool again to free the license (as can be done with Internal Bitbucket Users). The only way to free licenses of LDAP users is removing them from LDAP - after this Bitbucket automatically should free the users license.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.