@@ -12,6 +12,8 @@ docker run -d -p 80:80 -e SVN_REPO_NAME=test -e SVN_USER=admin -e SVN_PASSWORD=s
1212```
1313
1414That 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+
1517For a slightly more realistic configuration run:
1618
1719```
@@ -27,14 +29,13 @@ For production use without a fronting load balancer:
2729
2830```
2931docker 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 \
3233 -p 443:443 -e HTTPD_SSL=on \
3334 -e HTTPD_SERVER_NAME=myhost.mydomain.com httpd-svn
3435```
3536
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:
3839```
3940docker exec -it httpd-svn /bin/bash
4041htpasswd -B /svn/config/svn-users someuser
@@ -45,18 +46,39 @@ docker exec -it httpd-svn /bin/bash
4546svnadmin create /svn/repos/somerepo
4647chown -R httpd:httpd /svn/repos/somerepo
4748```
48-
4949Backups can be created using the backup-svn-repos.sh script using an external cron job:
5050```
5151docker exec httpd-svn backup-svn-repos.sh
5252```
5353
5454The backups are saved in the same volume as the repositories, so be sure to copy the files to another location as well.
5555
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.
5676
5777## Notes
5878
5979* 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.
6080 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
6181 be used and that is probably wrong.
6282* 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