Guide: selfhosted git onion

From Gentoo Wiki
Jump to: navigation, 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.

Notes:

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

Installation

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
emacs Add support for GNU Emacs
gnome-keyring Enable support for storing passwords via gnome-keyring
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
libressl Use dev-libs/libressl instead of dev-libs/openssl when applicable (see also the ssl useflag)
mediawiki Support pulling and pushing from MediaWiki
mediawiki-experimental Add experimental patches for improved MediaWiki support
nls Add Native Language Support (using gettext - GNU locale utilities)
pcre Add support for Perl Compatible Regular Expressions
pcre-jit Enable JIT for pcre
perforce Add support for Perforce version control system (requires manual installation of Perforce client)
perl Add optional support/bindings for the Perl language
ppcsha1 Make use of a bundled routine that is optimized for the PPC arch
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)
threads Add threads support for various packages. Usually pthreads
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

Emerge

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

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

Configuration

Services

OpenRC

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

Systemd

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

Configuration

Configure your git-daemon to

Gentoo specific (Overlay)

Troubleshooting

Advice

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

See also