• info@happli.be


Setup Git on Synology through webdav

Suppose you want to use git for one of your projects. Suppose you don’t want to open your sources to everyone. You could resort to GitHub and get a private repository, but you’d have to pay for it and you want to limit the expenses.

If you own a NAS, then you might want to host your sources on it. I own a Synology Diskstation and I was able to host git repositories on it, working through Http (ssh was not an option because of non-configurable firewalls between me and my NAS in some scenarios). It’s using WebDav and works a threat.

Here are some of the tasks you’ll need to go through:

  • Add the Git package to your DiskStation (an official package exists)
  • Configure WebDav on your DiskStation
  • Open ports (to allow webdav in)
  • Setup your DiskStation with an SSL certificate (don’t want everyone on the wire see what you’re working on)
  • Configure DDNS on your DiskStation (so that you can use a DNS instead of your probably dynamic IP in order to reach your repositories)

The following tutorial has been of great help and I strongly recommend it:


Don’t forget the part related to post-update!!!

I found myself in troubles in the opening ports part, so I keep a copy of my findings here. Maybe it’ll help you as well!

Opening Ports => Beware of CGN and double NATs

Opening ports requires going to your router’s setup and adding rules to the port forwarding. I faced a problem with this: Even though everything seemed correctly configured, I couldn’t reach my repositories.

I was able to connect to the DiskStation remotely, using QuickConnect. So I thought that I could use QuickConnect and simply suffix the hostname (XXXXX.quickconnect.to) with the port number. It didn’t work. QuickConnect is designed to work with only a few applications, not including WebDav. So I had to use a DDNS.

After setting that DDNS up and making it look good (normal state in Diskstation DDNS management view), I added port forwarding rules to my router. And then I tested => didn’t work.


I have searched for hours and suspected something wrong with port forwarding. But I was able to connect to the DiskStation through QuickConnect. I couldn’t understand why the port forwarding that I had configured for Diskstation remote access (through QuickConnect) was working and that the one I was trying to configure for webdav (through DDNS) wasn’t. The answer wasn’t so obvious: connecting to DiskStation through QuickConnect doesn’t require ports forwarding (http://blog.synology.com/?p=2283), that’s simply not the way it works. I thought that ports forwarding was working, and it never had worked. I had defined useless port forwarding rules. Shame on me.

After browsing the web for a while, I discovered that I was in a double-NAT configuration (http://www.practicallynetworked.com/networking/fixing_double_nat.htm). My ISP, Voo, a Belgian ISP, seems to be putting the low contracts under a double NAT situation, through the use of a Carrier-grade NAT (CGN). Maybe they’re running out of IP Addresses.

No luck at the first phone call. Maybe the operator didn’t understand my request, maybe he didn’t wan’t to help, maybe he had received orders (trying to limit CGN related operations). I don’t know. I gave a second phone call later in the day and the operator did something that allowed me to get a public IP. No more double NAT => webdav working!!!


SSL Certificate

You can configure your diskstation with a self-signed one, but you’ ll need to install the CA on the different machines on which you’ll want to clone the repository.

If you don’t want/can’t install the CA, the following post shows how to trust temporarilly the self-signed certificate when cloning the repository : http://blog.decayingcode.com/post/temporarily-ignore-ssl-certificate-problem-in-git-under-windows

First post

Happli is a small Belgium-based software development company focusing on training and taylor-made solutions.

This blog was set-up as a way for Happli to keep track of all the little things (problems faced, tips and tricks) that can occur when you develop software in which you integrate more and more third-party components (most of which are open source). And who knows, maybe you’ll find a little help in the posts.

Hello world!

Welcome to WordPress. This is your first post. Edit or delete it, then start writing!