Jeremy Durham

Ruby, Rails, and everything in between.

  • BlogThoughts
  • AboutAbout the Author
  • ContactGet in touch

December 26, 2010 19:26
Posted by Jeremy Durham

Setting up Git and Gitosis on the DNS-321

A few weeks back, I bought a DNS-321 with the idea of turning it into a sub $200 RAID 1 Time Machine and replacement for my Linux box that was serving Git repositories.

I purchased the DNS-321 for 60 bucks from TigerDirect with a $20 rebate, and managed to get two 1.5TB Western Digital 5400rpm hard drives from Micro Center for $60 a piece. The fun had just begun.

The first thing on the list was to “fun_plug” the DNS-321, which is incredibly trivial and allows you to get root on the device via telnet. “Hacking” the DNS-321 is not required to setup Time Machine, but is essential for installing and configuring Gitosis. Rooting the device is covered very well on the DNS 323 wiki.

Setting up Gitosis was a bit less trivial. First, you need to install Python, setuptools, and PERL from the fun_plug packages. Git depends on PERL, and Gitosis depends on Python and setuptools. You can get Python and setuptools from plord’s repository.

Once the dependencies are installed, you need to fetch git using wget:

wget http://kernel.org/pub/software/scm/git/git-1.7.3.4.tar.bz2

After decompressing, git must be configured to install into /ffp, so run:

./configure --prefix=/ffp

After configuring, git must be built with NO_NSEC because of the version of libc used by the DNS-321, so run:

NO_NSEC=YesPlease make install 

Once git has been installed, which takes a while, you need to clone gitosis:

git clone git://github.com/res0nat0r/gitosis.git

You can pretty much follow the directions at scie.nti.st, with a few caveats:

When adding a user, you need to use the syntax appropriate for BusyBox’s adduser:

adduser -S -g 'git version control' -D -h /mnt/HD_a2/git

After this user is added, you need to run:

store-passwd.sh

to permanently store the git user.

Make sure that you create git’s home directory on the NAS and set the appropriate privileges. You don’t want to accidentally delete the directory when you’re browsing the NAS one day.

The last tweak I had to make was an unfortunate one, but I couldn’t think of a more reasonable way of doing it. I had to disable StrictModes in OpenSSH, because the git user’s home directory is not located in /home. I tried mounting /mnt/HD_a2/git to /home/git or symlinking /mnt/HD_a2/git to /home/git, but neither of those worked. This can be done via editing /ffp/etc/ssh/sshd_config and adding:

StrictModes no

Once you’re done with that remember to restart OpenSSH and you should be good to go. I hope you enjoy your RAID 1 Gitosis repository on your DNS-321 as much as I am enjoying mine. After updating this site to Ruby 1.9 and Rails 3, I began deploying exclusively from my DNS-321.

2 Comments

Posted Under Technology

2 Comments

40242beb847d3a808a91829efc34cd3a?s=32&r=g V
July 8, 2011

To get git to compile on DNS-320, I had to do the following:

[code]
./configure —prefix=/ffp —with-iconv=/mnt/HD/HD_a2/ffp/bin
NO_NSEC=YesPlease SANE_TOOL_PATH=/ffp/bin/ NO_PYTHON=YesPlease NO_PERL_MAKEMAKER=YesPlease make install
[/code]

Even though I installed python and perl (and both were correctly linked and functional in /ffp/bin/, I was getting permission issues all over the place. Hope this saves someone else the headache.

D309592f2a210d745b8044847b214bb6?s=32&r=g Jeremy
July 14, 2011

@V,

Thank you for posting your experience with the DNS-320! I am considering getting a DNS-320 to replace my 321 for the 4k sector support and cpu speed increase, and this will definitely come in handy.

Leave a comment

* = Required
  • Posts
  • Twitter
  • Flickr
 

There is no Holy ...

Technology

 

Google and Apple:...

Technology

 

Setting up Git an...

Technology

@mariusrugan awesome, glad I was able to be of some help

follow me on
twitter

125942640_a3dcc3f951_s125942637_c4524c7c88_s125942628_a682f8a639_s122144184_5f2dd86929_s122144182_1b01ded312_s122144181_893a82f1d3_s122144179_70465b00ff_s122102402_21e6174af6_s122102401_f6d9ebff55_s

Categories

  • Technology
  • Programming
  • Family
  • Travel

This site is using the Handgloves WordPress Theme
Designed & Developed by George Wiscombe

Subscribe via RSS