1. gitlab 서비스 중지

gitlab-ctl stop

 

2. gitlab.rb 수정

위와 같이 git_data_dirs 설정 부분에 path 설정

 

git_data_dirs({
   "default" => { "path" => "데이터를 저장할 경로" }
 })

 

3. 수정 사항 반영

gitlab-ctl reconfigure

 

4. gitlab 서비스 시작

gitlab-ctl start

 

* 혹시 이미 운영중인데 Repository를 변경해야 하는 경우 기존 데이터를 복사 후 새로운 경로에 복사 후 그 경로를 지정해주면 된다.

Gitlab에 ssl을 적용하는 방법은 크게 2가지가 있다.

1. Let’s Encrypt 사용

2. SSL 인증서 수동 적용

 

이 글에서는 2. SSL 인증서 수동 적용에 관련하여 포스팅 한다.

/etc/gitlab/gitlab.rb 파일에서 아래의 설정을 해준다.

 

1. HTTP 요청을 HTTPS로 리다이렉트

nginx['redirect_http_to_https'] = true

 

2. 사용할 도메인 URL 설정

external_url '사용할 URL'

 

3. SSL 인증서 경로 지정

nginx['ssl_certificate'] = "crt 파일의 절대경로"
nginx['ssl_certificate_key'] = "key 파일의 절대경로"

 

4. SSL 인증서 패스워드 정보(Key에 비밀번호가 설정되어 있는 경우)

nginx['ssl_password_file'] = 'key 비밀번호가 있는 파일의 절대경로'   --> ex) txt 파일

 

5. 설정 값 적용

sudo gitlab-ctl reconfigure

 

 

UI, Rake task, Rails console, Users API를 이용하여 사용자 패스워드를 변경할 수 있다.

 

이 글에서는 Rails console를 이용한 방법에 대해 포스팅 한다.

 

1. Rails console 열기

sudo gitlab-rails console

 

 

2. 변경할 사용자 찾기

user = User.find_by_username '사용자이름'

 

3. user.password 및 user.password_confirmation에 대한 값을 설정하여 암호 재설정

new_password = '변경할 패스워드'
user.password = new_password
user.password_confirmation = new_password

 

4. 저장

user.save!

 

5. Rails Console 종료

exit

 

 

출처 : https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password

 

Reset a user

Documentation for GitLab Community Edition, GitLab Enterprise Edition, Omnibus GitLab, and GitLab Runner.

docs.gitlab.com

 

 

Gitlab 구축 또는 설정 값을 변경 한 후 다음과 같은 에러 페이지가 나오는 경우가 있다.

 

 

 

 

HTTP 상태 코드 422 는

422 Unprocessable Entity

이 응답은 서버가 요청을 이해하고 요청 문법도 올바르지만 요청된 지시를 따를 수 없음을 나타낸다.

https://developer.mozilla.org/ko/docs/Web/HTTP/Status/422

 

 

422 Unprocessable Entity - HTTP | MDN

이 응답은 서버가 요청을 이해하고 요청 문법도 올바르지만 요청된 지시를 따를 수 없음을 나타냅니다.

developer.mozilla.org

 

해결방법

참 간단하게도 브라우저 쿠키 및 캐쉬 삭제 후 다시 하면 된다....

+ Recent posts