비트버켓 - 개인 저장소 생성 차단 방법
개요
비트버켓 데이터센터에서는 개인이 별도의 Personal Repository 들을 생성하여 사용 가능합니다. 이렇게 생성된 개인 저장소는 주로 Main Repository 를 Fork 하여 Main Repository 에 영향을 주지 않는 상태로 개발하고 Fork 한 Repository 의 Branch 를 Main Repository 로 PR Merge 하는 형태로 작업하시는 데 사용합니다.
다만 이렇게 Personal Repository 를 생성한 계정을 삭제할 경우 해당 Personal Repository 의 이름을 포함하여 검색이 될 경우 오류가 발생하는 경우가 있습니다.
개인 저장소 생성 차단 방안
1) Bitbucket 의 bitbucket.properties 파일 오픈
※ 기본 설치 시 위치 : /var/atlassian/application-data/bitbucket/shared/bitbucket.properties
2) 개인 저장소 생성을 disable 하는 property 추가
feature.personal.repos=false
3) 비트버켓 재기동
# 기본 경로
/opt/atlassian/bitbucket/"version"/bin/stop-bitbucket.sh
/opt/atlassian/bitbucket/"version"/bin/start-bitbucket.sh
참고
개인 계정으로 생성한 Personal Repository 는 DB 에서 아래 SQL 구문으로 검색이 가능합니다.
select snu.name, r.slug from sta_personal_project spr, repository r, sta_normal_user snu
where spr.project_id=r.project_id and spr.owner_id=snu.user_id
and snu.name not in
(select u.lower_user_name
from cwd_user u join cwd_directory d on u.directory_id = d.id
where d.is_active='T' and u.is_active='T');