Guide: selfhosted git onion

From Gentoo Wiki
Jump to:navigation Jump to:search
Warning, this page is a work in progress by ng0 (talk | contribs). Treat its contents with caution.

git was designed to be used in a decentralized context, that is why it suited to be used through tor. This guide does not replace or provide guidelines on the safe usage of tor and only focuses on the work with git.


  • 1st: git-daemon+tor general usecase scenario.
  • 2nd: gentoo specific: overlay, teamwork+alone.
  • 3rd: server specific: adding webinterface, if needed


USE flags

Cannot load package information. Is the atom net-misc/tor correct?

USE flags for dev-vcs/git Stupid content tracker: distributed VCS designed for speed and efficiency

blksha1 Use the new optimized SHA1 implementation
cgi Install gitweb too
curl Support fetching and pushing (requires webdav too) over http:// and https:// protocols
cvs Enable CVS (Concurrent Versions System) integration
doc Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally
gpg Pull in gnupg for signing -- without gnupg, attempts at signing will fail at runtime!
highlight GitWeb support for app-text/highlight
iconv Enable support for the iconv character set conversion library
keyring Enable support for Secret Service API password store
mediawiki Support pulling and pushing from MediaWiki
nls Add Native Language Support (using gettext - GNU locale utilities)
pcre Add support for Perl Compatible Regular Expressions
perforce Add support for Perforce version control system (requires manual installation of Perforce client)
perl Add optional support/bindings for the Perl language
safe-directory Respect the setting
selinux !!internal use only!! Security Enhanced Linux support, this must be set by the selinux profile or breakage will occur
subversion Include git-svn for dev-vcs/subversion support
test Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled independently)
tk Include the 'gitk' and 'git gui' tools
webdav Adds support for push'ing to HTTP/HTTPS repositories via DAV
xinetd Add support for the xinetd super-server


Install net-misc/tor and dev-vcs/git:

root #emerge --ask net-misc/tor
root #emerge --ask dev-vcs/git




To start:

root #rc-service tor start
root #rc-service git-daemon start

To start the services on system boot, add it to the default runlevel:

root #rc-update add tor default
root #rc-update add git-daemon default


To start:

root #systemctl start tor.service
root #systemctl start git-daemon.service

To start the services on system boot:

root #systemctl enable tor.service
root #systemctl enable git-daemon.service

Working with


Configure your git-daemon to

Gentoo specific (Overlay)



  • For optimal usage, the machine with the git-daemon should have an uptime close to 24/7

See also