레이블이 subversion인 게시물을 표시합니다. 모든 게시물 표시
레이블이 subversion인 게시물을 표시합니다. 모든 게시물 표시

2010년 1월 25일 월요일

SVN 권한설정

출처 : http://www.darkfox.info/1489

오늘은 SVN + apache  조합에서 권한 설정을 하려고 합니다.
프로젝트들 마다 Core 로직과 App 부분으로 나뉘어집니다. SVN을 통해서 특정 ID는 특정 구역에 접근하지 못하도록 설정하고 싶은데, 이 부분의 세팅을 하고 싶을 껍니다.
여기서  SVN 설치를 성공을 했다면, 이제 세팅을 해봅시다.
뭐 일단 간단 합니다. http.conf 파일을 수정합니다.
<VirtualHost *:80>
    ServerAdmin webmaster@darkfox.info
    ServerName svn.darkfox.info
    ErrorLog logs/svn.darkfox.info-error_log
    CustomLog logs/svn.darkfox.info-access_log common
    <Location />
        DAV svn
        SVNPath c:/svn
# 여러개의 프로젝트를 등록할꺼면 SVNPath 대신 SVNParentPath를 사용하세요.
#        SVNListParentPath on
#        SVNParentPath c:\svn
        AuthType Basic
        AuthName "Subversion repository"
        AuthUserFile c:/svn/conf/htpasswd
        AuthzSVNAccessFile c:/svn/conf/authz
    #    <LimitExcept GET PROPFIND OPTIONS REPORT>
    #        Require valid-user
    #    </LimitExcept>
        Require valid-user
    </Location>
</VirtualHost>
잘 했는지 봅시다.
http://svn.darkfox.info 를 경로로 사용하겠습니다.
SVNParentPath 를 사용했다면
http://svn.darkfox.info/만든프로젝트폴더 를 사용하시면 됩니다
예를 들면
http://svn.darkfox.info/test-svn 이런식이죠.
SVN 서버에 c:\svn\conf 에 있는 authz 파일을 수정합니다
[groups]
admin = darkfox
devteam = user2
tester = user1
anonymous =
[/]
#그룹으로 처리해도 되고
@admin = rw
[/core]
#읽기전용
@devteam = r
#접근금지
@tester =
[test-svn:/]
#ID를 직접 써도 됩니다.
darkfox = rw
샘플로 만든 파일입니다. 
SVN에 만들어진 경로들을 적당히 등록해주시면 하위 디렉토리들은 자동으로 적용됩니다.
다음엔 HTTPS를 이용한 SSL 보안과 SVN에 대해 다뤄보도록 하겠습니다.
궁금한건 댓글을 달아주시면 짬나는대로 답변해드리겠습니다.

2009년 12월 11일 금요일

Tortoise SVN의 명령을 Command 창으로 실행하기

 

windheim at naver ( http://blog.naver.com/windheim )

보통 마우스의 오른쪽 버튼 클릭으로 실행되는 똘똘이(Tortoise) SVN을 프롬프트 창에서 실행이 가능하다.

예를 들어 수 십개의 코드 레포지터리를 한꺼번에 업데이트하는 배치파일을 만든다던가 SVN 서버를 애플리케이션과 함께 응용하고자 할 때 유용하다.

예컨대
"D:\work\TestCode" 디렉토리의 코드들을 update하기 위해서는 아래와 같이 실행하면 된다.

(똘똘이 설치 패스)TortoiseProc.exe /command:update /path:"D:\work\TestCode" /notempfile

이외 오른쪽 버튼 클릭으로 실행되는 모든 오퍼레이션을 아래와 같은 명령어 표를 응용하여 실행할 수 있다.

http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-automation.html#tsvn-automation-basics

# 자동으로 닫지않는다.
tortoiseproc.exe /closeonend:0
# 에러가 없다면 자동으로 닫는다.
tortoiseproc.exe /closeonend:1
# 충돌이 없다면 자동으로 닫는다.
tortoiseproc.exe /closeonend:2
# 머지할 것이 없다면 자동으로 닫는다.
tortoiseproc.exe /closeonend:3

인용:

TortoiseProc.exe /command:commit /path:"c:\svn_wc\file1.txt*c:\svn_wc\file2.txt"
/logmsg:"test log message" /notempfile /closeonend

인용:

TortoiseProc.exe /command:update /path:"c:\svn_wc\" /notempfile /closeonend

인용:

TortoiseProc.exe /command:log /path:"c:\svn_wc\file1.txt"
/revstart:50 /revend:60 /notempfile /closeonend

about Shows the About-dialog. This is also shown if no command is given.
log Opens the log dialog. The path specifies the file or folder for which the log should be shown. Two additional options can be set:
/revstart:xxx and /revend:xxx.
checkout Opens the checkout dialog. The /path specifies the target directory.
import Opens the import dialog. The path specifies the directory with the data to import.
update Updates the working copy in /path to HEAD. If the option /rev is given then a dialog is shown to ask the user to which revision the update should go.
commit Opens the commit dialog. The path specifies the target directory or the list of files to commit. You can also specify the /logmsg switch to pass a predefined log message to the commit dialog.
add Adds the files in /path to version control.
revert Reverts local modifications of a working copy. The /path tells which items to revert.
cleanup Cleans up interrupted or aborted operations and unlocks the working copy in /path.
resolve Marks a conflicted file specified in /path as resolved. If /noquestion is given, then resolving is done without asking the user first if it really should be done.
repocreate Creates a repository in /path
switch Opens the switch dialog. The path specifies the target directory.
export Exports the working copy in /path to another directory. If the /path points to an unversioned directory, a dialog will ask for an URL to export to the dir in /path.
merge Opens the merge dialog. The path specifies the target directory.
copy Brings up the branch/tag dialog. The /path is the working copy to branch/tag from.
settings Opens the settings dialog.
remove Removes the file(s) in /path from version control.
rename Renames the file in /path. The new name for the file is asked with a dialog.
diff Starts the external diff program specified in the TortoiseSVN settings. The /path specifies the first file. If the option /path2 is set, then the diff program is started with those two files. If /path2 is ommitted, then the diff is done between the file in /path and its BASE.
conflicteditor Starts the conflicteditor specified in the TortoiseSVN settings with the correct files for the conflicted file in /path.
relocate Opens the relocate dialog. The /path specifies the working copy path to relocate.
help Opens the help file.
repostatus Opens the check-for-modifications dialog. The path specifies the working copy directory.
repobrowser Starts the repository browser dialog, pointing to the URL of the working copy given in /path or /path points directly to an URL. An additional option /rev:xxx can be used to specify the revision which the repository browser should show. If the /rev:xxx is omitted, it defaults to HEAD.
ignore Adds all targes in /path to the ignore list, i.e. adds the svn:ignored property to those files.
blame Opens the blame dialog for the file specified in /path.
cat Saves a file from an URL or working copy path given in /path to the location given in /savepath:path. The revision is given in /revision:xxx. This can be used to get a file with a specific revision.
createpatch Creates a patch file for the path given in /path.

2009년 3월 20일 금요일

아파치 SVN 모듈 설치

http.conf파일에 를 추가해준다.

LoadModule dav_module modules/mod_dav.so
LoadModule dav_svn_module "E:\Program Files\Subversion\bin\mod_dav_svn.so"
LoadModule authz_svn_module "E:\Program Files\Subversion\bin\mod_authz_svn.so"

2009년 3월 17일 화요일

[Subversion] SVN 설치

버전관리 시스템중의 하나인 서브버전 설치에 대해서 설명할까 합니다.

다들 아시겠지만.. 그래도.. 제 나름 정리한 문서이니.^^

참고하시기 바랍니다.

설치파일의 다운로드 위치는 아래와 같습니다.


SubVersion : http://subversion.tigris.org/

TortoiseSVN : http://tortoisesvn.net/downloads

설명은 윈도우 기반의 서브버전에 대해서 설명합니다.

1. SubVersion 설치

2. TortoiseSVN설치>설치 후 재부팅 Or Explorer 종료(Process)

3. TortoiseSVN 한글 언어팩 설치

- TortoiseSVN의 Settung>Language 한국어로 변경

4. 저장소 만들기
a. svn이용
- C:\mkdir c:\repos

- cd c:\repos

- svnadmin create sample
b. TortoiseSVN 이용
- C:\repos\sample 폴더에서 현재 위치에 저장소 생성(Y) 선택
- 고유 파일시스템선택(BSD 방식 선택 해도 무방 But 불안정 하다고 함)

5. 저장소 설정
a. c:\repos\sample\conf\svnserve.conf 수정

anon-access = none

auth-access = write

password-db = passwd

authz-db = authz

- anon-access = none : 로그인 하지 않은 사용자에게 읽기, 쓰기 금지

anon-access = read : 로그인하지 않은 사용자에게 읽기만 허용

anon-access =write : 로그인 하지 않은 사용자에게 읽기, 쓰기 허용

- auth-access = none : 로그인한 사용자에게 읽기, 쓰기 금지

auth-access = read : 로그인한 사용자에게 읽기만 허용

auth-access =write : 로그인한 사용자에게 읽기, 쓰기 허용

- password-db 패스워드경로이름
- authz-db 인증경로이름

b. c:\repos\sample\conf\passwd 수정

[user]
sample= 1234

- 사용자 ID = 암호
c. c:\repos\sample\conf\authz

[/]
sample = rw

- [/] 경로에대해 sample 유저가 읽기 쓰기 가능하도록 설정함.

6. SubVersion 서버 사용하기
svn:\\ 프로토콜 서버인 svnserve를 사용하는 방법


a. 일반모드 : svn serve.exe –d –r c:\repos


b. 서비스 모드 : sc \\컴퓨터이름 create svnserve binpath= “c:\Program Files\Subversion\bin\svnserve.exe --service –r c:\repos”  DisplayName= “Subversion svnserve”

- 서비스 모드로 실행 할 경우 서비스에서 시작을 해줘 야함.

- - d : 데몬모드
- --listen-port : 기본 포트 3690이외의 포트를 사용하고자 할때 설정

- --listen-host : 컴퓨터에 IP가 여러개 일때 하나의 IP를 지정하여 사용하고자 할때 사용
- -r : 저장소들이 모여있는 부모 디렉터리나 개별 저장소의 경로를 지정
c:\repos 를 할 경우 하위 폹더 까지 사용가능

- --service : 서비스 모드로 실행

참고 사항 : 입력을 잘못하였을 경우 sc delete svnserve 하면 서비스에서 삭제 됩니다.

7. svn://localhost/sample 접속 확인