view · edit · print · history

Using optware gitosis ipk to host git repository.

# ipkg update
# ipkg install gitosis
To complete gitosis setup:

1. Copy a SSH pubkey from SSH client to this gitosis server
2. [server]$ sudo -H -u gitosis /opt/bin/gitosis-init < /tmp/transfered-SSH-key.pub
3. [client]$ git clone gitosis@server:gitosis-admin.git
4. Manage gitosis-admin by editing, committing & pushing

See http://www.nslu2-linux.org/wiki/HowTo/HostingGit for more info.

The original document of gitosis is packaged at /opt/share/doc/gitosis/.

For how to create repo, add user, control access, see this guide (optware uses gitosis as the system login instead of git).

Note - Problems found on Datatank optware install:

1. The git clone operation asks for password. 
 - Check the gitosis user is allowed to login via the sshd. 
 - if not - add the line "AllowUsers gitosis" to the /usr/local/etc/sshd_conf or equivalent.
 - Check you have the transfered-SSH-key.pub enabled in your ~/.ssh/config 
   if not, add the line "IdentityFile ~/.ssh/SSH-key-pub" or equivalent.
2. The git operation complains "gitosis-serve not found" 
 - Check you have /opt/bin in the default path setup. 
   One way is to change the shell for gitosis to bash in /etc/passwd 
   Add /opt/bin to the $PATH env variable in the file ~gitosis/.bashrc
   remember to install the bash ipkg.
   If you want to keep busybox as shell, set "PermitUserEnvironment yes"
   in /etc/ssh/sshd_config and modify PATH in ~gitosis/.ssh/environment
view · edit · print · history · Last edited by vitus.
Based on work by TimOCallaghan and BrianZhou.
Originally by BrianZhou.
Page last modified on May 17, 2010, at 11:20 PM