Skip to content

Commit b698422

Browse files
committed
Initial drop
1 parent e77de32 commit b698422

File tree

12 files changed

+671
-1
lines changed

12 files changed

+671
-1
lines changed

Dockerfile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
FROM alpine:3.14
2+
MAINTAINER rupor (https://github.com/rupor-github/serve-svn)
3+
4+
ARG SVN_UID=1000
5+
ARG SVN_GID=1000
6+
ENV SRV_HOST_PORT=
7+
8+
ENV S6_OVERLAY_VERSION=2.2.0.3
9+
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-amd64-installer /tmp/
10+
RUN chmod +x /tmp/s6-overlay-amd64-installer && /tmp/s6-overlay-amd64-installer / && rm /tmp/s6-overlay-amd64-installer
11+
12+
RUN apk add --no-cache shadow ca-certificates \
13+
apache2 apache2-utils \
14+
php7 php7-apache2 php7-session php7-json php7-xml && \
15+
mkdir -p /run/apache2/
16+
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+
20+
# For some reason Alpine subversion build does not have svnauthz (or any svn tools for this matter) - have to build my own
21+
COPY replace/subversion-1.14.1-r3.apk /tmp/
22+
RUN apk add --no-cache --allow-untrusted /tmp/subversion-1.14.1-r3.apk && \
23+
rm /tmp/*.apk && \
24+
mkdir /home/svn/ && \
25+
mkdir /etc/subversion/ && touch /etc/subversion/passwd
26+
27+
COPY root /
28+
29+
ENV WEBSVN_VERSION=2.6.1
30+
ADD https://github.com/websvnphp/websvn/archive/refs/tags/${WEBSVN_VERSION}.tar.gz /var/www/
31+
WORKDIR /var/www
32+
RUN tar -xvf ${WEBSVN_VERSION}.tar.gz && \
33+
mv websvn-${WEBSVN_VERSION} websvn && \
34+
rm ${WEBSVN_VERSION}.tar.gz
35+
36+
COPY replace/config.php /var/www/websvn/include/config.php
37+
RUN chmod a+w /etc/subversion/* && \
38+
chmod a+w /home/svn && \
39+
chmod a+w /var/www/websvn/include/config.php
40+
41+
ENV HOME /home
42+
EXPOSE 80 3690
43+
44+
ENTRYPOINT ["/init"]
45+
CMD []

README.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,40 @@
11
# serve-svn
2-
Simple container to run SVN with DAV and UI
2+
## Very simple container to run WebSVN viewer and provide access to svn utilities and svnserve.
3+
4+
sudo docker run -d --name svn -p 4000:80 -p 3690:3690 \
5+
-e SRV_HOST_PORT=192.168.50.10:4000 \
6+
-v /volume4/docker/svn/data:/home/svn \
7+
-v /volume4/docker/svn/svn/subversion-access-control:/etc/subversion/subversion-access-control \
8+
-v /volume4/docker/svn/svn/passwd:/etc/subversion/passwd \
9+
localhost/serve-svn
10+
11+
By default eveything is in read-only mode, but it could be recofigured easily. In this case following could be halpful:
12+
13+
docker exec -t svn-server htpasswd -b /etc/subversion/passwd <username> <password>
14+
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.
17+
18+
Building Subversion with `svnauthz` requires a simple patch:
19+
20+
diff --git a/main/subversion/APKBUILD b/main/subversion/APKBUILD
21+
index 6eb16766a2..3c20964d76 100644
22+
--- a/main/subversion/APKBUILD
23+
+++ b/main/subversion/APKBUILD
24+
@@ -85,10 +85,10 @@ check() {
25+
26+
package() {
27+
local _pydir=$(python3 -c "import sysconfig;print(sysconfig.get_path('stdlib'))")
28+
- make -j1 DESTDIR="$pkgdir" \
29+
+ make -j1 DESTDIR="$pkgdir" toolsdir=/usr/bin \
30+
swig_pydir="$_pydir/libsvn"\
31+
swig_pydir_extra="$_pydir/svn" \
32+
- install install-swig-pl-lib install-swig-py
33+
+ install install-swig-pl-lib install-swig-py install-tools
34+
make pure_vendor_install -C subversion/bindings/swig/perl/native \
35+
PERL_INSTALL_ROOT="$pkgdir"
36+
find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
37+
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.
39+
40+
Enjoy

0 commit comments

Comments
 (0)