Instant Gitweb Daemon

Standalone wrapper for self-hosting a GitWeb frontend as simple and unified replacement for git-instaweb.

The builtin Gitweb repository frontend can be fiddly to setup and configure. As a more stable and featured self-hosted alternative to the git-instaweb generated Python code, the Instant Gitweb Daemon centrally configures and runs the corresponding CGI script in a Python HTTP server.

Screenshot: Gitweb frontend

No local files will be created, a temporary directory containing configuration files that are generated with sensible defaults is used as environment instead. The GITWEB_CONFIG environment variable can be used to override this. Note that GITWEB_CONFIG_SYSTEM and GITWEB_CONFIG_COMMON can be set, too – see the Gitweb documentation for details.

Basic HTTP authentication is supported – via commandline argument or environment variable. Given a certificate and key, the web frontend can also be served via HTTPS.

There are no additional python3 dependencies needed and gitweb is usually already installed per default with git. For actually running the Perl CGI script, libcgi-pm-perl or similar might be needed, though.

In general, this self-hosted git web interface still should not be considered safe enough to be exposed to the internet – even when using authentication and HTTPS.

usage: gitweb.py [-h] [--local] [--port PORT] [--auth USER:PASS] [--ssl-cert CERT_PEM] [--ssl-key KEY_PEM] [--gitweb DIR] --project-root DIR [REPOSITORY [REPOSITORY ...]]

positional arguments:
  REPOSITORY           repository git directory to expose, scan root if none given (default: None)

optional arguments:
  -h, --help           show this help message and exit
  --local              only bind to 127.0.0.1 (default: False)
  --port PORT          port number to bind to (default: 8000)
  --auth USER:PASS     require HTTP basic authentication (default: None)
  --auth-env ENVAR     require HTTP basic authentication, credentials from environment variable (default: None)
  --ssl-cert CERT_PEM  certificate PEM file for HTTPS (default: None)
  --ssl-key KEY_PEM    certificate key PEM file for HTTPS (default: None)
  --gitweb DIR         gitweb installation directory (default: /usr/share/gitweb)
  --project-root DIR   common root directory for repositories or where to scan for (default: None)

Code & Download