Skip to content

Commit 3ddfe6d

Browse files
committed
Cleaning up
1 parent b698422 commit 3ddfe6d

File tree

3 files changed

+33
-17
lines changed

3 files changed

+33
-17
lines changed

Dockerfile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
FROM alpine:3.14
22
MAINTAINER rupor (https://github.com/rupor-github/serve-svn)
33

4-
ARG SVN_UID=1000
5-
ARG SVN_GID=1000
64
ENV SRV_HOST_PORT=
75

86
ENV S6_OVERLAY_VERSION=2.2.0.3
@@ -14,9 +12,6 @@ RUN apk add --no-cache shadow ca-certificates \
1412
php7 php7-apache2 php7-session php7-json php7-xml && \
1513
mkdir -p /run/apache2/
1614

17-
# ensure, apache user can handle svn
18-
RUN if [ "$SVN_UID" != "100" ] ; then usermod -u $SVN_UID apache && groupmod -g $SVN_GID apache ; fi
19-
2015
# For some reason Alpine subversion build does not have svnauthz (or any svn tools for this matter) - have to build my own
2116
COPY replace/subversion-1.14.1-r3.apk /tmp/
2217
RUN apk add --no-cache --allow-untrusted /tmp/subversion-1.14.1-r3.apk && \

README.md

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,38 @@
11
# serve-svn
2-
## Very simple container to run WebSVN viewer and provide access to svn utilities and svnserve.
2+
## Very simple container to run WebSVN viewer and provide access to svn utilities and protocol.
3+
4+
I am using this container on my Synology NAS to have access to old code - recently DSM 7.0 dropped svn support and I am to lazy to move old code to git.
5+
6+
Normally I run it in read only mode, viewer is fully functional and you could use svn:// protocol to list things:
7+
8+
sudo docker run -d --name svn -p 4000:80 -p 3690:3690 \
9+
-e SRV_HOST_PORT=192.168.50.10:4000 \
10+
-v /volume/docker/svn/data:/home/svn:ro \
11+
rupor/serve-svn
12+
13+
Since `svnadmin` does not care about access control lists you could always add more repositories:
14+
15+
sudo docker exec -t svn svnadmin create /home/svn/<another repo>
16+
sudo docker exec -t svn svnadmin load /home/svn/<another repo> < dump
17+
18+
It is easy however to get a full access:
319

420
sudo docker run -d --name svn -p 4000:80 -p 3690:3690 \
521
-e SRV_HOST_PORT=192.168.50.10:4000 \
622
-v /volume4/docker/svn/data:/home/svn \
723
-v /volume4/docker/svn/svn/subversion-access-control:/etc/subversion/subversion-access-control \
824
-v /volume4/docker/svn/svn/passwd:/etc/subversion/passwd \
9-
localhost/serve-svn
25+
rupor/serve-svn
1026

11-
By default eveything is in read-only mode, but it could be recofigured easily. In this case following could be halpful:
27+
In this case you may want to change SVN access control lists and add users:
1228

13-
docker exec -t svn-server htpasswd -b /etc/subversion/passwd <username> <password>
29+
sudo docker exec -t svn htpasswd -b /etc/subversion/passwd <username> <password>
1430

15-
For some reason Alpine's build of subversion does not have svntools and without `svnauthz` [WebSVN](https://websvnphp.github.io/) refuses to work. So I had to build my own. Setting up build environment is very simple. I
16-
used [this](https://github.com/yuk7/AlpineWSL) to install Alpine 3.14 under WSL2 in Windows 10 and then followed [the official guide](https://wiki.alpinelinux.org/wiki/Creating_an_Alpine_package#Setup_your_system_and_account). Takes about 3 minutes to complete.
31+
## Technicalities
32+
33+
For some reason Alpine's build of subversion does not have svntools and without `svnauthz` [WebSVN](https://websvnphp.github.io/) refuses to work. So I had to build my own.
34+
Setting up build environment is very simple. I used [this](https://github.com/yuk7/AlpineWSL) to install Alpine 3.14 under WSL2 in Windows 10 (you could use Hyper-V or VirtualBox too)
35+
and then followed [the official guide](https://wiki.alpinelinux.org/wiki/Creating_an_Alpine_package#Setup_your_system_and_account). Takes about 3 minutes to complete.
1736

1837
Building Subversion with `svnauthz` requires a simple patch:
1938

@@ -35,6 +54,7 @@ Building Subversion with `svnauthz` requires a simple patch:
3554
PERL_INSTALL_ROOT="$pkgdir"
3655
find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
3756

38-
I am using this container on my Synology to have access to very old code - recently DSM 7.0 dropped svn support and I am to lazy to move old code to git.
57+
## Credits
58+
59+
* Thanks to [Luca Florio](https://github.com/elleFlorio) with his [elleFlorio/svn-docker](https://github.com/elleFlorio/svn-docker) for inspiration.
3960

40-
Enjoy

replace/config.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,9 @@
113113
// Note that in this case the path is a filesystem path and depends on your platform:
114114
// Unix-like: /path/to/parent
115115
// Windows: c:\\svn
116-
//
116+
117117
$config->parentPath('/home/svn');
118+
118119
// $config->parentPath('filesystem path', 'group');
119120
//
120121
// To exclude a repository from being added by the parentPath method uncomment the next line
@@ -204,7 +205,7 @@
204205
// By default, WebSVN does not ignore whitespaces when showing diffs.
205206
// To enable ignoring whitespaces in diffs per default uncomment this line.
206207

207-
// $config->setIgnoreWhitespacesInDiff(true);
208+
$config->setIgnoreWhitespacesInDiff(true);
208209

209210
// }}}
210211

@@ -317,7 +318,7 @@
317318
// Uncomment the line below to offer a tarball download option across all your
318319
// repositories.
319320
//
320-
// $config->allowDownload();
321+
$config->allowDownload();
321322
//
322323
// Set download modes
323324
// $config->setDefaultFileDlMode('plain');
@@ -511,7 +512,7 @@
511512

512513
// Number of spaces to expand tabs to in diff/listing view across all repositories
513514

514-
$config->expandTabsBy(8);
515+
$config->expandTabsBy(4);
515516

516517
// To override the global setting for individual repositories, uncomment and replicate
517518
// the line below (replacing 'myrep' with the name of the repository).

0 commit comments

Comments
 (0)