@@ -12,6 +12,8 @@ docker run -d -p 80:80 -e SVN_REPO_NAME=test -e SVN_USER=admin -e SVN_PASSWORD=s
12
12
```
13
13
14
14
That creates a Subversion repository named test and exposes it to the user admin with password securepassword on port 80 without SSL.
15
+ The repository can be accessed at http://localhost/svn/test .
16
+
15
17
For a slightly more realistic configuration run:
16
18
17
19
```
@@ -27,14 +29,13 @@ For production use without a fronting load balancer:
27
29
28
30
```
29
31
docker run -d --name httpd-svn --mount source=v_svn,target=/svn \
30
- --mount type=bind,source="$(pwd)/server.crt",target=/usr/local/apache2/conf/server.crt,readonly \
31
- --mount type=bind,source="$(pwd)/server.key",target=/usr/local/apache2/conf/server.key,readonly \
32
+ --mount type=bind,source="$(pwd)/localcerts",target=/etc/ssl/localcerts,readonly \
32
33
-p 443:443 -e HTTPD_SSL=on \
33
34
-e HTTPD_SERVER_NAME=myhost.mydomain.com httpd-svn
34
35
```
35
36
36
- This uses a real SSL certificate mapped into the container and a volume for the repositories, configuration files and backups.
37
- Users are added manually:
37
+ This uses a real SSL certificate (represented by server.crt and server.key in localcerts) mapped into the container
38
+ and a volume for the repositories, configuration files and backups. Users are added manually:
38
39
```
39
40
docker exec -it httpd-svn /bin/bash
40
41
htpasswd -B /svn/config/svn-users someuser
@@ -45,18 +46,39 @@ docker exec -it httpd-svn /bin/bash
45
46
svnadmin create /svn/repos/somerepo
46
47
chown -R httpd:httpd /svn/repos/somerepo
47
48
```
48
-
49
49
Backups can be created using the backup-svn-repos.sh script using an external cron job:
50
50
```
51
51
docker exec httpd-svn backup-svn-repos.sh
52
52
```
53
53
54
54
The backups are saved in the same volume as the repositories, so be sure to copy the files to another location as well.
55
55
56
+ ## Configuration
57
+
58
+ There are many configuration options. It should be possible to use this image as is. The Apache configuration file
59
+ (httpd.conf) is present in /svn/config in the /svn volume. That means it is possible to edit the configuration; the
60
+ changes will persist. The same applies to the users and access rules (also in /svn/config) and of course to the
61
+ repositories.
62
+
63
+ The SSL certificates are stored in /etc/ssl/localcerts and can be replaced (see above). If intermediate certs are
64
+ needed the httpd.conf file must be edited to include them, though.
65
+
66
+ The following options are supported without the need for manual changes:
67
+ * HTTPD_SERVER_NAME, the ServerName option for Apache. Set this to the external address.
68
+ * HTTPD_SERVER_ADMIN, the mail address to the administrator for server-generated pages.
69
+ * HTTPD_SSL, set this to use SSL and listen on port 443. If not set the server listens on port 80.
70
+ * SVN_REPO_NAME, the name of a repository to create on startup.
71
+ * SVN_USER, the name of a Subversion user to create on startup.
72
+ * SVN_PASSWORD, the password for SVN_USER.
73
+
74
+ The Subversion user will not be created if the svn-users file already exists. Likewise the repository will
75
+ not be recreated if it exists.
56
76
57
77
## Notes
58
78
59
79
* It is important to set the ServerName option to the real external host name, as Subversion (or rather DAV) needs it for the copy command.
60
80
Set HTTPD_SERVER_NAME when using the default configuration or be sure to set it manually. If not defined the container's host name will
61
81
be used and that is probably wrong.
62
82
* It is a very good idea to require SSL/TLS or alternatively to use a web front with SSL.
83
+
84
+ Suggestions and pull requests are welcome!
0 commit comments