Skip to content

Commit bf58934

Browse files
committedDec 26, 2019
customization
1 parent ad270ae commit bf58934

File tree

5 files changed

+236
-43
lines changed

5 files changed

+236
-43
lines changed
 

‎Dockerfile

+8-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ RUN apk add --no-cache apache2 apache2-utils apache2-webdav mod_dav_svn &&\
2323
ln -s /opt/svnadmin /var/www/localhost/htdocs/svnadmin &&\
2424
chmod -R 777 /opt/svnadmin/data
2525

26-
# Solve a sicurity issue (https://alpinelinux.org/posts/Docker-image-vulnerability-CVE-2019-5021.html)
26+
# Solve a security issue (https://alpinelinux.org/posts/Docker-image-vulnerability-CVE-2019-5021.html)
2727
RUN sed -i -e 's/^root::/root:!:/' /etc/shadow
2828

2929
# Fixing https://github.com/mfreiholz/iF.SVNAdmin/issues/118
@@ -33,6 +33,13 @@ ADD svnadmin/classes/util/global.func.php /opt/svnadmin/classes/util/global.func
3333
ADD apache/ /etc/services.d/apache/
3434
ADD subversion/ /etc/services.d/subversion/
3535

36+
# customization
37+
ADD subversion-config /root/.subversion/config
38+
ADD subversion-config /etc/subversion/config
39+
RUN chmod +s -R /home/svn/ &&\
40+
chown apache:apache -R /home/svn/
41+
42+
3643
# Add SVNAuth file
3744
ADD subversion-access-control /etc/subversion/subversion-access-control
3845
RUN chmod a+w /etc/subversion/* && chmod a+w /home/svn

‎README.md

+37-36
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,37 @@
1-
[![Docker Image](https://img.shields.io/badge/docker%20image-available-green.svg)](https://hub.docker.com/r/lzhangtoolineo/svn-binary-docker/)
2-
3-
# Description
4-
Lightweight container providing an SVN server, based on **Alpine Linux** and S6 process management (see [here](https://github.com/smebberson/docker-alpine) for details).
5-
The access to the server is possible via **WebDav protocol** (http://), and via **custom protocol** (svn://).
6-
A complete tutorial on how to build this image, and how to run the container is available on [Medium](https://medium.com/@elle.florio/the-svn-dockerization-84032e11d88d#.bafh3otmh)
7-
8-
# Running Commands
9-
To run the image, you can use the following command:
10-
```
11-
docker run -d --name svn-server -p 8080:80 -p 3690:3690 lzhangtoolineo/svn-binary-docker
12-
```
13-
You can optionally bind a local folder to the container folder that will store your repositories using the flag `-v <hostpath>:/home/svn`, which will be:
14-
```
15-
docker run -d --name svn-server -v <hostpath>:/home/svn -p 8080:80 -p 3690:3690 lzhangtoolineo/svn-binary-docker
16-
```
17-
18-
# Configuration
19-
**You need to setup username and password** for the access via WebDav protocol. You can use the following command from your host machine:
20-
```
21-
docker exec -t svn-server htpasswd -b /etc/subversion/passwd <username> <password>
22-
```
23-
To verify that everything is up and running, open your browser and connect to `http://localhost/svn`. The system should ask you for the username and password, then it will show you an empty folder (no repos yet!).
24-
Check also that the custom protocol is working fine: go to your terminal and type `svn info svn://localhost:3690`. The system should connect to the server and tell you that is not able to find any repository.
25-
For further information on how to configure Subversion, please refer to the [official web page](https://subversion.apache.org/).
26-
27-
# Alternative configuration via SVNADMIN
28-
the image provides a graphical ui using the [SVNADMIN](https://github.com/mfreiholz/iF.SVNAdmin) interface via `http://localhost/svnadmin`.
29-
You'll be prompted with a setup page, remember to test every step on the page then save the configuration.
30-
31-
# How to contribute
32-
I'm super happy if you want to contribute! I do my best to keep this image updated and solve the issues that may arise, but I'm not much an operations guy, and I have very limited free time. :sweat_smile:
33-
34-
If you find something that can be improved or the solution to some issue, just comment the issue to notify that you will handle it, and then submit a pull request. I will then merge it and publish the updated image in the Docker Hub. :wink:
35-
36-
Thank you! :smile:
1+
[![Docker Image](https://img.shields.io/badge/docker%20image-available-green.svg)](https://hub.docker.com/r/lzhangtoolineo/svn-binary-docker/)
2+
3+
# Description
4+
Lightweight container providing an SVN server, based on **Alpine Linux** and S6 process management (see [here](https://github.com/smebberson/docker-alpine) for details).
5+
The access to the server is possible via **WebDav protocol** (http://), and via **custom protocol** (svn://).
6+
A complete tutorial on how to build this image, and how to run the container is available on [Medium](https://medium.com/@elle.florio/the-svn-dockerization-84032e11d88d#.bafh3otmh)
7+
8+
# Running Commands
9+
To run the image, you can use the following command:
10+
```
11+
docker run -d --name svn-server -p 8080:80 -p 3690:3690 lzhangtoolineo/svn-binary-docker
12+
```
13+
You can optionally bind a local folder to the container folder that will store your repositories using the flag `-v <hostpath>:/home/svn`, which will be:
14+
```
15+
docker run -d --name svn-server -v <hostpath>:/home/svn -p 8080:80 -p 3690:3690 lzhangtoolineo/svn-binary-docker
16+
```
17+
18+
# Configuration
19+
**You need to setup username and password** for the access via WebDav protocol. You can use the following command from your host machine:
20+
```
21+
docker exec -t svn-server htpasswd -b /etc/subversion/passwd <username> <password>
22+
```
23+
To verify that everything is up and running, open your browser and connect to `http://localhost/svn`. The system should ask you for the username and password, then it will show you an empty folder (no repos yet!).
24+
Check also that the custom protocol is working fine: go to your terminal and type `svn info svn://localhost:3690`. The system should connect to the server and tell you that is not able to find any repository.
25+
For further information on how to configure Subversion, please refer to the [official web page](https://subversion.apache.org/).
26+
27+
# Alternative configuration via SVNADMIN
28+
the image provides a graphical ui using the [SVNADMIN](https://github.com/mfreiholz/iF.SVNAdmin) interface via `http://localhost/svnadmin`.
29+
You'll be prompted with a setup page, remember to test every step on the page then save the configuration.
30+
31+
# How to contribute
32+
I'm super happy if you want to contribute! I do my best to keep this image updated and solve the issues that may arise, but I'm not much an operations guy, and I have very limited free time. :sweat_smile:
33+
34+
If you find something that can be improved or the solution to some issue, just comment the issue to notify that you will handle it, and then submit a pull request. I will then merge it and publish the updated image in the Docker Hub. :wink:
35+
36+
Thank you! :smile:
37+

‎dav_svn.conf

+9-5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ LoadModule dav_svn_module /usr/lib/apache2/mod_dav_svn.so
22
LoadModule authz_svn_module /usr/lib/apache2/mod_authz_svn.so
33

44
<Location /svn>
5+
# svn: E175002: Unexpected HTTP status 413 'Request Entity Too Large' on '/svn/binrepo/!svn/me'
6+
LimitXMLRequestBody 8000000
7+
LimitRequestBody 0
8+
59
DAV svn
610
SVNParentPath /home/svn
711
SVNListParentPath On
@@ -11,10 +15,10 @@ LoadModule authz_svn_module /usr/lib/apache2/mod_authz_svn.so
1115
AuthzSVNAccessFile /etc/subversion/subversion-access-control
1216
Require valid-user
1317

14-
# customerization
15-
SVNAllowBuldUpdates Prefer
16-
SVNInMemoryCacheSize 1048576
18+
# customization
19+
SVNAllowBulkUpdates Prefer
20+
# SVNInMemoryCacheSize 1048576
1721
SVNCacheTextDeltas On
1822
SVNCacheFullTexts On
19-
SVNCompressionLevel 0
20-
</Location>
23+
# SVNCompressionLevel 0
24+
</Location>

‎subversion-access-control

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[groups]
22

33
[/]
4-
* = r
4+
* = rw

‎subversion-config

+181
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
### This file configures various client-side behaviors.
2+
###
3+
### The commented-out examples below are intended to demonstrate
4+
### how to use this file.
5+
6+
### Section for authentication and authorization customizations.
7+
[auth]
8+
### Set password stores used by Subversion. They should be
9+
### delimited by spaces or commas. The order of values determines
10+
### the order in which password stores are used.
11+
### Valid password stores:
12+
### gnome-keyring (Unix-like systems)
13+
### kwallet (Unix-like systems)
14+
### gpg-agent (Unix-like systems)
15+
### keychain (Mac OS X)
16+
### windows-cryptoapi (Windows)
17+
# password-stores = windows-cryptoapi
18+
### To disable all password stores, use an empty list:
19+
# password-stores =
20+
###
21+
### Set ssl-client-cert-file-prompt to 'yes' to cause the client
22+
### to prompt for a path to a client cert file when the server
23+
### requests a client cert but no client cert file is found in the
24+
### expected place (see the 'ssl-client-cert-file' option in the
25+
### 'servers' configuration file). Defaults to 'no'.
26+
# ssl-client-cert-file-prompt = no
27+
###
28+
### The rest of the [auth] section in this file has been deprecated.
29+
### Both 'store-passwords' and 'store-auth-creds' can now be
30+
### specified in the 'servers' file in your config directory
31+
### and are documented there. Anything specified in this section
32+
### is overridden by settings specified in the 'servers' file.
33+
# store-passwords = no
34+
# store-auth-creds = no
35+
36+
### Section for configuring external helper applications.
37+
[helpers]
38+
### Set editor-cmd to the command used to invoke your text editor.
39+
### This will override the environment variables that Subversion
40+
### examines by default to find this information ($EDITOR,
41+
### et al).
42+
# editor-cmd = editor (vi, emacs, notepad, etc.)
43+
### Set diff-cmd to the absolute path of your 'diff' program.
44+
### This will override the compile-time default, which is to use
45+
### Subversion's internal diff implementation.
46+
# diff-cmd = diff_program (diff, gdiff, etc.)
47+
### Diff-extensions are arguments passed to an external diff
48+
### program or to Subversion's internal diff implementation.
49+
### Set diff-extensions to override the default arguments ('-u').
50+
# diff-extensions = -u -p
51+
### Set diff3-cmd to the absolute path of your 'diff3' program.
52+
### This will override the compile-time default, which is to use
53+
### Subversion's internal diff3 implementation.
54+
# diff3-cmd = diff3_program (diff3, gdiff3, etc.)
55+
### Set diff3-has-program-arg to 'yes' if your 'diff3' program
56+
### accepts the '--diff-program' option.
57+
# diff3-has-program-arg = [yes | no]
58+
### Set merge-tool-cmd to the command used to invoke your external
59+
### merging tool of choice. Subversion will pass 5 arguments to
60+
### the specified command: base theirs mine merged wcfile
61+
# merge-tool-cmd = merge_command
62+
63+
### Section for configuring tunnel agents.
64+
[tunnels]
65+
### Configure svn protocol tunnel schemes here. By default, only
66+
### the 'ssh' scheme is defined. You can define other schemes to
67+
### be used with 'svn+scheme://hostname/path' URLs. A scheme
68+
### definition is simply a command, optionally prefixed by an
69+
### environment variable name which can override the command if it
70+
### is defined. The command (or environment variable) may contain
71+
### arguments, using standard shell quoting for arguments with
72+
### spaces. The command will be invoked as:
73+
### <command> <hostname> svnserve -t
74+
### (If the URL includes a username, then the hostname will be
75+
### passed to the tunnel agent as <user>@<hostname>.) If the
76+
### built-in ssh scheme were not predefined, it could be defined
77+
### as:
78+
# ssh = $SVN_SSH ssh -q --
79+
### If you wanted to define a new 'rsh' scheme, to be used with
80+
### 'svn+rsh:' URLs, you could do so as follows:
81+
# rsh = rsh --
82+
### Or, if you wanted to specify a full path and arguments:
83+
# rsh = /path/to/rsh -l myusername --
84+
### On Windows, if you are specifying a full path to a command,
85+
### use a forward slash (/) or a paired backslash (\\) as the
86+
### path separator. A single backslash will be treated as an
87+
### escape for the following character.
88+
89+
### Section for configuring miscellaneous Subversion options.
90+
[miscellany]
91+
### Set global-ignores to a set of whitespace-delimited globs
92+
### which Subversion will ignore in its 'status' output, and
93+
### while importing or adding files and directories.
94+
### '*' matches leading dots, e.g. '*.rej' matches '.foo.rej'.
95+
# global-ignores = *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo __pycache__
96+
# *.rej *~ #*# .#* .*.swp .DS_Store [Tt]humbs.db
97+
### Set log-encoding to the default encoding for log messages
98+
# log-encoding = latin1
99+
### Set use-commit-times to make checkout/update/switch/revert
100+
### put last-committed timestamps on every file touched.
101+
# use-commit-times = yes
102+
### Set no-unlock to prevent 'svn commit' from automatically
103+
### releasing locks on files.
104+
# no-unlock = yes
105+
### Set mime-types-file to a MIME type registry file, used to
106+
### provide hints to Subversion's MIME type auto-detection
107+
### algorithm.
108+
# mime-types-file = /path/to/mime.types
109+
### Set preserved-conflict-file-exts to a whitespace-delimited
110+
### list of patterns matching file extensions which should be
111+
### preserved in generated conflict file names. By default,
112+
### conflict files use custom extensions.
113+
# preserved-conflict-file-exts = doc ppt xls od?
114+
### Set enable-auto-props to 'yes' to enable automatic properties
115+
### for 'svn add' and 'svn import', it defaults to 'no'.
116+
### Automatic properties are defined in the section 'auto-props'.
117+
enable-auto-props = yes
118+
### Set interactive-conflicts to 'no' to disable interactive
119+
### conflict resolution prompting. It defaults to 'yes'.
120+
# interactive-conflicts = no
121+
### Set memory-cache-size to define the size of the memory cache
122+
### used by the client when accessing a FSFS repository via
123+
### ra_local (the file:// scheme). The value represents the number
124+
### of MB used by the cache.
125+
# memory-cache-size = 16
126+
### Set diff-ignore-content-type to 'yes' to cause 'svn diff' to
127+
### attempt to show differences of all modified files regardless
128+
### of their MIME content type. By default, Subversion will only
129+
### attempt to show differences for files believed to have human-
130+
### readable (non-binary) content. This option is especially
131+
### useful when Subversion is configured (via the 'diff-cmd'
132+
### option) to employ an external differencing tool which is able
133+
### to show meaningful differences for binary file formats. [New
134+
### in 1.9]
135+
# diff-ignore-content-type = no
136+
137+
### Section for configuring automatic properties.
138+
[auto-props]
139+
### The format of the entries is:
140+
### file-name-pattern = propname[=value][;propname[=value]...]
141+
### The file-name-pattern can contain wildcards (such as '*' and
142+
### '?'). All entries which match (case-insensitively) will be
143+
### applied to the file. Note that auto-props functionality
144+
### must be enabled, which is typically done by setting the
145+
### 'enable-auto-props' option.
146+
# *.c = svn:eol-style=native
147+
# *.cpp = svn:eol-style=native
148+
# *.h = svn:keywords=Author Date Id Rev URL;svn:eol-style=native
149+
# *.dsp = svn:eol-style=CRLF
150+
# *.dsw = svn:eol-style=CRLF
151+
# *.sh = svn:eol-style=native;svn:executable
152+
# *.txt = svn:eol-style=native;svn:keywords=Author Date Id Rev URL;
153+
# *.png = svn:mime-type=image/png
154+
# *.jpg = svn:mime-type=image/jpeg
155+
# Makefile = svn:eol-style=native
156+
157+
# customizations
158+
*.txt = svn:mime-type=application/octet-stream
159+
*.json = svn:mime-type=application/octet-stream
160+
*.product = svn:mime-type=application/octet-stream
161+
162+
### Section for configuring working copies.
163+
[working-copy]
164+
### Set to a list of the names of specific clients that should use
165+
### exclusive SQLite locking of working copies. This increases the
166+
### performance of the client but prevents concurrent access by
167+
### other clients. Third-party clients may also support this
168+
### option.
169+
### Possible values:
170+
### svn (the command line client)
171+
# exclusive-locking-clients =
172+
### Set to true to enable exclusive SQLite locking of working
173+
### copies by all clients using the 1.8 APIs. Enabling this may
174+
### cause some clients to fail to work properly. This does not have
175+
### to be set for exclusive-locking-clients to work.
176+
# exclusive-locking = false
177+
### Set the SQLite busy timeout in milliseconds: the maximum time
178+
### the client waits to get access to the SQLite database before
179+
### returning an error. The default is 10000, i.e. 10 seconds.
180+
### Longer values may be useful when exclusive locking is enabled.
181+
# busy-timeout = 10000

0 commit comments

Comments
 (0)
Please sign in to comment.