Running SVN in Docker

Currently reading
Running SVN in Docker

Is that possible to do automatically every time when the docker starts after update/reboot/turning off/on?
Volume bind is the method that will make this happen. Depending on the image you are using you will bind a location of your choice (on your NAS) to a predefined location inside the container. So, make sure to check the documentation for the image and then use either the command line, Portainer, or Container Manager for that matter to configure it. Whats the image you are using in the end?
 
Last edited:
@Rusty
Talked to Bard (Google AI). It looks like more smart than ChatGPT, but still not a human :) Anyway it knows about bind and explained it to me.
We got some useful info, let me share with you summary of what we found .
Steps to resolve the SVN repository delete permission issue in Synology DSM 7:

  1. To resolve the SVN repository delete permission issue, you need to change the RepositoryDeleteEnabled setting in the config.ini file to true.
  2. The config.ini file in the Docker container is located at the path: /var/www/html/data/config.ini.
  3. In the local volume, you need to create a directory called /svn/conf. You can also use the existing directory /svn/keys, but there is a chance that it will be deleted when the container is updated.
  4. To mount the found file in the local directory, you can use the following command:
    sudo docker run --mount type=bind,source=/var/www/html/data/config.ini,target=/svn/conf/config.ini <svn-name>
    Note that even if the container name has uppercase letters, you need to write it in lowercase.
  5. The command above does not find the path to the source. This is likely because Docker is not in the PATH variable. The "standard" way to add a path to the PATH variable by editing the .bashrc file does not work because the file cannot be found in DSM 7.
  6. Once you are able to mount the config.ini file locally, you can change the corresponding key in the GUI.

Possible solution for the /var/www/html/data/config.ini path not being found:
The most likely problem is that the path /var/www/html/data/config.ini is not absolute. To allow the docker run command to find this file, you need to specify the absolute path.
I assume you know DSM and Docker better than Bard and this info might help you to help me.
 
Last edited:
Thank you all for the valuable information, hints and suggestions in this topic.
I kept postponing finding a solution for SVN and DSM 7, especially since I'm not familiar with Docker and no command line genius.

But I finally succeeded. And understand the Docker concept. But it was a difficult trip. And also one with disappointments. :cry:
I finally had the Docker image from elleflorio running, when I discovered that it contains a pretty old SVN version 1.9.7 (Aug-2017). While DSM 6.2 contains the more recent version 1.14.0 from May 2020.
This significant downgrade was an absolute no go.

After more research I stumbled on the extremely lightweight image from garethflowers with up-to-date SVN version 1.14.2 from April 2022. (y)

And I found a decent way of using this with my existing repositories in /volume1/svn/. No need to move or rename the existing repositories. They can be accessed via the existing native SVN application in DSM 6 and via the new Docker SVN for DSM 6 and 7. :cool:

To help others that struggle with this Docker solution, I decided to document all steps from A to Z at my Git page. Please use it to your advantage and report any problems in the Issues section of the Git website.

These instructions are intended for users who are not familiar with Docker and/or the Linux Command Line Interface. Hence the abundance of screenshots and explanations. I hope that the advanced reader can appreciate my effort to help a wide audience and is not offended by all "the obvious".
 
I've got information that clamy54 is working on update for his Docker image with new version of iF.SVNAdmin. Promises to finish it soon.
 
Last edited:
Last edited:
Finally, I've got svn server with web control ability with using iF.SVNAdmin working the way how it supposed to work. Well, almost :)

Here is a short summary what needs to be done (without forwarding ports part - it is obvious)
  1. The author web page Installer un serveur Subversion sur Synology DSM 7 explains installation step-by-step. There is some difference between installation windows for the Docker used in DSM7.0 and Container Manager (by Docker :)) but it is not a problem. The page written in French, but who cares about different languages on internet today. Especially for technical articles.
  2. In addition to the folders that author creates during first run of the container I would propose to create another one. With path /svn/conf , for example. It will be used for the file config.ini. Definitely it is possible to use /svn/keys directory, it is quite logical. However, in case of the container update the file could be deleted. I would not like to have such risk.
  3. After all steps in the author guide and ports forwarding it starts to work with a good GUI. However, by default it does not provide access to two important features - I don't understand why:
    1. You can create repo, but can't delete it. It is possible just delete the folder using File Station, but it is very inconvenient.
    2. You can't get correct path to the repository like http://<svn-address>:<svn-port>/svn/test/trunk
  4. Documentation of ifsvnadmin iF.SVNAdmin | Documentation shows what to do for allowing these features in config.ini. However, we don't have access to this file inside the container. And that I spent quite a time trying to understand how to get that file. If I were a Linux guy, I would get it immediately. The solution actually is as easy as a snap - just copy it from original location to the available location :) and link them together when the container starts.
  5. Remember /svn/conf directory? Two simple commands from SSH terminal does the work:
    Code:
    sudo docker exec -it /<svn-name> find / -name config.ini # Where is the file?/var/www/html/data/config.ini # Here
    sudo docker cp <svn-name>:/var/www/html/data/config.ini /volume1/docker/svn/conf/config.ini #copy it to my location
  6. Go to /volume1/docker/svn/conf and
    Code:
    chmod 777 config.ini
  7. Now we can edit the local file with the DSM Text Editor.
  8. Go to the section [GUI] in the end of config.ini and:
    1. Change RepositoryDeleteEnabled= from false to true. (RepositoryDeleteEnabled=true)
    2. Add one more key CustomDirectoryListing=http://<svn-address>:<svn-port>/svn/%1/%2
  9. Save the file.
  10. Stop the container.
  11. Go to the Settings/Volume Settings and Click +Add File
    1705129859866.png
  12. Save and start the container.
Results:
1705130020396.png
1705130063632.png

Button Delete appears. And folder in the repo got the icon in the Options row for getting the correct path to them.
I did not do it for svn:// interface but it should be very similar. Just check the documentation page I showed early if you need it.

I'm going to write either a blog post or an article with a little bit more details and how to have more repos like this
1705130376919.png

It will be in Russian for one Russian site, but who cares about the language these days, right? :cool: Let me know if you'd like to read it later.
-- post merged: --

Oh, I forgot. Why almost.
When you run GUI it shows that it is possible to create Multi Project Structure
1705131233406.png

However, if you try to create another project in the BigProject repo, it does not do it and shows an error. I believe it can be fixed in config.ini, but somebody with php or python experience need to look at that and try to find the required key and setting for it.
 
I have published result of my research as a blog at SVN для NAS под Synology DSM 7.2. Записки Linux дилетанта / HDD, SSD, флешки, прочие носители информации / iXBT Live
It's written in Russian, but I checked automatic online translation - it's ok. At least, from my perspective :)
There is a text before the link I've shown here - it is not necessary for the SVN sever installation. Just my thoughts about some hardness of the life related to the SVN installation.
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Similar threads

How did you create the Portainer container in first place? As in exact docker run commands or in case...
Replies
7
Views
1,375
Thank you for this - I'll give it a go and see where I get - worst case I learn something as I go!
Replies
6
Views
1,618
  • Question
1707646023 Old post!! But I have the same isue. To enable the portal, I go into Container Management...
Replies
7
Views
10,357
ye, feels like routing issue. Internet connection is working until tunnel is up. After that tunnel seems...
Replies
26
Views
5,269
Have you tried to setup a rule for specific docker network subnet for that container and test internet access?
Replies
24
Views
9,395
@DeltaGolf Here’s my approach: Docker - NextCloud on Synology NAS using Docker compose (with Portainer)
Replies
18
Views
4,716

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Back
Top