Programming/Tips

Bitnami Redmine SVN 연결 - Ubuntu VM

acidpop 2012. 11. 6. 11:23
반응형

Ubuntu 가상머신으로 완성되어 있는 bitnami redmine 을 사용중에

 

SVN 연결에 관한 정리가 필요하여 블로그에 포스팅함.

 

포스팅 날짜 기준 redmine 정보

 

VM : Ubuntu 12.04 (64-bit)

Redmine : 2.1.2-1

 

bitnami redmine 에서 저장소에 연결시 SVN 이 https 프로토콜을 사용중일때 404 NotFound 오류가 나오는것을 확인 할 수 있다.

 

https 프로토콜 인증과정 문제이므로 다음과 같은 방법으로 해결 할 수 있다.

 

1. ubuntu VM 에 터미널 접속을 한다.

 

2. vi 로 다음 파일을 편집한다.

/opt/bitnami/apps/redmine/htdocs/lib/redmine/scm/adapters/subversion_adapter.rb

 

위 파일 내용중 263라인을 보면 다음의 내용이 있다.

 

def credentials_string
    str = ''
    str << " --username #{shell_quote(@login)}" unless @login.blank?
    str << " --password #{shell_quote(@password)}" unless @login.blank? || @password.blank?
    str << " --no-auth-cache --non-interactive"
    str
end 

 

 

def credentials_string
    str = ''
    str << " --username #{shell_quote(@login)}" unless @login.blank?
    str << " --password #{shell_quote(@password)}" unless @login.blank? || @password.blank?
    str << " --no-auth-cache --trust-server-cert --non-interactive"
    str
end

 

수많은 블로그글이나 해외 사이트의 글들도 여기까지만 설명이 되어 있다.

 

하지만 위와 같이 파일 편집 후 redmine 서비스를 재시작 하여도 404 Not Found 가 나오는 경우가 많다.

 

직접 svn 명령을 이용하여 영구인증을 해야 하는데 콘솔 커맨드창에서 다음과 같이 명령을 입력한다.

 

3. SVN 인증

svn info "https://SVN저장소 주소"

 

위와 같이 직접 명령을 수행하면 다음과 같은 메시지를 볼 수 있다.

 

 

Error validating server certificate for 'https://127.0.0.1:443':
 - The certificate is not issued by a trusted authority. Use the
    fingerprint to validate the certificate manually!
 - The certificate hostname does not match.
Certificate information:
 - Hostname: SVN-SERVER
 - Valid: from Sun, 19 Feb 2012 01:07:46 GMT until Wed, 16 Feb 2022 01:07:46 GMT
 - Issuer: SVN-SERVER
 - Fingerprint: xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx
(R)eject, accept (t)emporarily or accept (p)ermanently?

 

위와 같이 인증 방식을 물어보게 된다

 

이때 Permanently 를 선택하여 영구 인증을 해야 redmine 서버가 저런 메시지를 만나지 않고 웹페이지에 표시 해줄수 있기 때문에 p 를 타이핑 하고 엔터를 입력하자.

 

4. 최종 확인

다음과 같이 명령어를 수행하여 svn 저장소가 잘 출력 되는지 확인한다.

 

svn info --xml https://SVN저장소주소

 

 

<?xml version="1.0" encoding="UTF-8"?>
<info>
<entry
   kind="dir"
   path="trunk"
   revision="22">
<url>https://SVN저장소주소</url>

<repository>
<root>https://SVN저장소주소</root>
<uuid>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</uuid>
</repository>
<commit
   revision="22">
<author>acidpop</author>
<date>2012-11-02T02:23:12.187205Z</date>
</commit>
</entry>
</info>

 

위와 같이 Repository 목록이 잘 보인다면 성공이다.

 

Redmine 웹 페이지로 가서 저장소를 클릭하여 정상적으로 나오는지 확인한다.

 

 

 

 

PS1 - Windows 에 설치한 Bitnami Redmine 은 위와 같이 인증 과정을 거쳐도 https SVN 이 연결이 되지 않는다..ㅠㅠ

         혹시 해결한 사람이 있다면 댓글로 알려주세요~!

 

 

PS2 - Bitnami Stack 에서 제공되는 Ubuntu VM 은 상당히 기본적인 부분만 설치가 되어 있어서 SSH 접속도 안되며

ZModem 도 없고 VIM 도 없다.

 

다음과 같이 업데이트를 해주자.

 

1. SSH 설정

 

sudo mv /etc/init/ssh.conf.back /etc/init/ssh.conf
sudo start ssh

 

2. apt-get Update

 

apt-get update 

 

Ubuntu VM 이 인터넷에 연결 되어 있어야 한다.

 

3. ZModem 설치

 

apt-get install lrzsz 

 

4. VIM 설치

 

apt-get install vim 

 

5. SSH 접속후 ls 명령 디렉토리 색깔

 

~/.bashrc 파일 편집 

 alias vi='vim'
alias ll='ls -al --color=auto'
alias ls='ls --color=auto'

 

위 alias 를 아래쪽에 출력한다.

 

그 다음 source ~/.bashrc 명령을 수행하여 다시 로딩한다.

 

반응형