FreeBSD 14
Sponsored Link

Subversion : Remote Access to Repositories2024/09/13

 

Access to Repositories from remote Hosts.

[1] Start [svnserve] on a Host that Subversion repository exists.
# start [svnserve]

root@dlp:~ #
pw useradd svn -m -d /home/svn

root@dlp:~ #
mkdir -p /home/svn/repos

root@dlp:~ #
chown svn:svn /home/svn/repos

root@dlp:~ #
sysrc svnserve_data="/home/svn/repos"

svnserve_data: -> /home/svn/repos
root@dlp:~ #
service svnserve enable

svnserve enabled in /etc/rc.conf
root@dlp:~ #
service svnserve start

Starting svnserve.
# create a test project

root@dlp:~ #
su - svn

svn@dlp:~ $
mkdir -p /home/svn/repos/project

svn@dlp:~ $
svnadmin create /home/svn/repos/project

svn@dlp:~ $
svn mkdir file:///home/svn/repos/project/trunk -m "create"

svn@dlp:~ $
svn mkdir file:///home/svn/repos/project/branches -m "create"

svn@dlp:~ $
svn mkdir file:///home/svn/repos/project/tags -m "create"

[2] Access to existing Subversion repository from another remote Host.
For example, Access to existing [/home/svn/repos/project] repository.
By the way, default access permission is read only, so it's impossible to execute [commit] or others like changing operation. For changing operation from remote Host, it needs to set access permission like the link.
# specify relative path name for SVN URI
# on this example
# SVN Top directory : [/home/svn/repos]
# SVN repository directory : [/home/svn/repos/project]
# relative path : [project]
# SVN URI : [svn://dlp.srv.world/project]

freebsd@node01:~ $
svn list svn://dlp.srv.world/project

branches/
tags/
trunk/

freebsd@node01:~ $
mkdir ./work

freebsd@node01:~ $
svn checkout svn://dlp.srv.world/project ./work

A    work/branches
A    work/tags
A    work/trunk
Checked out revision 3.

freebsd@node01:~ $
ls -la work

total 19
drwxr-xr-x  6 freebsd freebsd  6 Sep 13 09:21 .
drwxr-xr-x  4 freebsd freebsd 11 Sep 13 09:21 ..
drwxr-xr-x  4 freebsd freebsd  8 Sep 13 09:21 .svn
drwxr-xr-x  2 freebsd freebsd  2 Sep 13 09:21 branches
drwxr-xr-x  2 freebsd freebsd  2 Sep 13 09:21 tags
drwxr-xr-x  2 freebsd freebsd  2 Sep 13 09:21 trunk
[3] It's also possible to access via SSH without running [svnserve] service on Subversion Host.
freebsd@node01:~ $
svn ls svn+ssh://freebsd@dlp.srv.world/home/svn/repos/project

(freebsd@dlp.srv.world) Password for freebsd@dlp.srv.world:
branches/
tags/
trunk/

freebsd@node01:~ $
mkdir ./work2

freebsd@node01:~ $
svn co svn+ssh://freebsd@dlp.srv.world/home/svn/repos/project ./work2

(freebsd@dlp.srv.world) Password for freebsd@dlp.srv.world:
A    work2/branches
A    work2/tags
A    work2/trunk
Checked out revision 3.
Matched Content