Docker-Based SVN Server and WebSVN Configuration
1. Installation
- Pull the Docker image
docker pull gurcan/svn-server
- Launch the container
docker run -d --name svn-container --restart=always -v /var/lib/svn/repos:/home/svn -p 14890:80 -p 4890:3690 gurcan/svn-server
- Create an administrator account
docker exec -t svn-container htpasswd -b /etc/subversion/passwd admin_user secure_password
- Grant write permissions to the persistent volume
chmod -R 777 /var/lib/svn/repos
2. Accessing SVN Repository
- In your browser, navigate to http://192.168.1.100:14890/svn. You will be prompted for credentials. Use the username and password created in the previous step. After authentication, the repository list will be displayed.
- In your browser, navigate to http://192.168.1.100:14890/svnadmin. The first visit will trigger the backend configuration process.
| Configuration Name | Value |
|---|
| Subversion authorization file | /etc/subversion/subversion-access-control |
| User authentication file (SVNUserFile) | /etc/subversion/passwd |
| User view provider type | passwd |
| User edit provider type | passwd |
| Group view provider type | svnauthfile |
| Group edit provider type | svnauthfile |
| Repository view provider type | svnclient |
| Repository edit provider type | svnclient |
| Parent directory of the repositories (SVNParentPath) | /home/svn |
| Subversion client executable | /usr/bin/svn |
| Subversion admin executable | /usr/bin/svnadmin |
After filling in the configuration values, perform a test. Only save the configuration after the test passes. Pay special attention to ensuring that the "Parent directory of the repositories (SVNParentPath)" passes the test.
3. Repository Creation and Authorization
- Navigate to http://192.168.1.100:14890/svnadmin/repositorycreate.php to create a new repository. Enter the repository name, select the repository type (default is filesystem), and choose the repository structure template. Click "Create".
- Go to http://192.168.1.100:14890/svnadmin/accesspathslist.php to select the created repository and assign user or group permissions (read-only and read-write).
- After authorization is complete, you can begin version controlling your repository content.