Guide: selfhosted git onion

From Gentoo Wiki
Jump to:navigation Jump to:search
This article is a work in progress; treat its contents with caution - ng0 (talk | contribs).


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
+curl Support fetching and pushing (requires webdav too) over http:// and https:// protocols
+gpg Pull in gnupg for signing -- without gnupg, attempts at signing will fail at runtime!
+iconv Enable support for the iconv character set conversion library
+nls Add Native Language Support (using gettext - GNU locale utilities)
+pcre Add support for Perl Compatible Regular Expressions
+perl Add optional support/bindings for the Perl language
+safe-directory Respect the safe.directory setting
+webdav Adds support for push'ing to HTTP/HTTPS repositories via DAV
cgi Install gitweb too
cvs Enable CVS (Concurrent Versions System) integration
doc Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally
highlight GitWeb support for app-text/highlight
keyring Enable support for freedesktop.org Secret Service API password store
mediawiki Support pulling and pushing from MediaWiki
perforce Add support for Perforce version control system (requires manual installation of Perforce client)
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
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