Console Login
Home / Blog / DevOps & Infrastructure / Escaping Subversion: Building a Bulletproof Private Git Server with Gitolite in Norway
DevOps & Infrastructure 12 views

Escaping Subversion: Building a Bulletproof Private Git Server with Gitolite in Norway

@

Escaping Subversion: Building a Bulletproof Private Git Server with Gitolite in Norway

If you are still managing your project's source code with Subversion (SVN) in 2011, you are fighting a losing battle. The distributed nature of Git has revolutionized how we handle branching and merging, but it introduces a new dilemma for Norwegian development teams: Where do you host the repository?

Sure, GitHub is gaining traction, and Bitbucket offers free private repos, but let's talk about the elephant in the server room: The US Patriot Act. If your servers are located in the United States, your intellectual property is subject to foreign jurisdiction. For those of us answering to Datatilsynet (The Norwegian Data Protection Authority) or handling sensitive client data, "putting it in the cloud" isn't a strategy; it's a liability.

I've seen too many CTOs ignore the latency overhead of trans-Atlantic pipes. When your team in Oslo does a git clone of a 2GB repository hosted in Virginia, productivity dies. You need metal close to home. You need low latency to NIX (Norwegian Internet Exchange).

Today, we are going to set up a rock-solid, private Git server using Gitolite on a CoolVDS instance running Ubuntu 10.04 LTS. This setup gives you granular access control without the overhead of a heavy web interface.

Why Hardware IOPS Matter for Git

Many developers think Git is just CPU-bound. Wrong. Git is a filesystem thrasher. When you run garbage collection (git gc) or index a massive commit history, you are generating thousands of small I/O operations. On a traditional 7.2k SATA drive, your sleek DVCS turns into a sloth.

This is where the underlying infrastructure of your VPS provider becomes critical. We configure our CoolVDS instances on high-performance enterprise storage arrays. While standard VPS hosts oversubscribe their spinning disks, resulting in "I/O wait" spikes during peak hours, a dedicated slice with proper I/O isolation ensures your git push completes before you can switch windows.

Step 1: The Environment

I am assuming you have a fresh CoolVDS VPS provisioned. We stick to Ubuntu 10.04 Lucid Lynx for this tutorial because reliability trumps novelty in production.

First, log in as root and update your system. Never deploy on a stale kernel.

apt-get update && apt-get upgrade -y

Step 2: Install Git and Create the User

We need the core Git binaries. We also need to create a dedicated user that will handle the repositories. Do not run Git access via root. That is a rookie mistake.

apt-get install git-core adduser --system --shell /bin/bash --group --disabled-password --home /home/git git

Step 3: Setting Up Gitolite

Gitolite is the standard for Git access control right now. It allows you to manage access via a single gitolite-admin repository, using SSH keys to identify users. It is far more secure than managing Unix users for every developer.

You will need your local workstation's public SSH key (usually ~/.ssh/id_rsa.pub). Upload it to your VPS:

scp ~/.ssh/id_rsa.pub root@your-coolvds-ip:/tmp/admin.pub

Now, switch to the git user and install Gitolite:

su - git git clone git://github.com/sitaramc/gitolite gitolite/src/gl-system-install gl-setup /tmp/admin.pub

You will be prompted to check the configuration file. The defaults are usually fine for 99% of teams.

Step 4: Managing Access from Your Workstation

This is the beauty of Gitolite. You never need to log into the server again to add users. Go back to your local machine and clone the admin repo:

git clone git@your-coolvds-ip:gitolite-admin

Inside, you will see two folders: conf/ and keydir/.

  • keydir/: Drop your developers' public keys here (e.g., johndoe.pub).
  • conf/gitolite.conf: Define your repositories and permissions.

Example configuration:

repo super-secret-project RW+ = admin RW = johndoe R = deployment-bot

Commit and push these changes. Gitolite's hooks will automatically update the server configuration. It is seamless.

Pro Tip: Network latency kills flow. By hosting on CoolVDS within Norway, your ping times to the server are likely under 10ms. This makes SSH handshakes and small object transfers feel instantaneous compared to hosting in the US or Germany.

Data Sovereignty and Compliance

Under the current Personopplysningsloven, you are responsible for how personal data is secured. When you host code that might contain database dumps or customer logic on a US-controlled cloud, you are entering a grey area regarding the Safe Harbor framework.

By keeping your Git server on a Norwegian VPS, you simplify your compliance landscape. Your data stays under Norwegian law, physically located in high-security datacenters in Oslo, protected by strict access controls you define.

Summary

Stop tolerating slow pushes and legal ambiguity. A self-hosted Gitolite setup on a high-performance VPS gives you:

  1. Speed: Local peering prevents latency lag.
  2. Control: Granular permissions without per-user license fees.
  3. Privacy: Your code, your server, your jurisdiction.

Don't let your infrastructure be the bottleneck for your release cycle. Deploy a CoolVDS instance today and experience what raw, unthrottled I/O does for your development workflow.

/// TAGS

/// RELATED POSTS

Building a CI/CD Pipeline on CoolVDS

Step-by-step guide to setting up a modern CI/CD pipeline using Firecracker MicroVMs....

Read More →

Taming the Beast: Kubernetes Networking Deep Dive (Pre-v1.0 Edition)

Google's Kubernetes is changing how we orchestrate Docker containers, but the networking model is a ...

Read More →

Stop SSH-ing into Production: Building a Git-Centric Deployment Pipeline

Manual FTP uploads and hot-patching config files are killing your stability. Here is how to implemen...

Read More →

Decomposing the Monolith: Practical Microservices Patterns for Nordic Ops

Moving from monolithic architectures to microservices introduces network complexity and latency chal...

Read More →

Beyond the Hype: Building "NoOps" Microservices Infrastructure in Norway

While Silicon Valley buzzes about AWS Lambda, pragmatic engineers know the truth: latency and vendor...

Read More →

Ditch Nagios: Monitoring Docker Microservices with Prometheus in 2015

Monolithic monitoring tools like Nagios fail in dynamic Docker environments. Learn how to deploy Pro...

Read More →
← Back to All Posts