gitweb.conf - Linux


Overview

gitweb.conf is a configuration file for Gitweb, a web interface for browsing Git repositories. It allows users to customize the appearance, behavior, and functionality of the Gitweb interface.

Syntax

/etc/gitweb.conf

Options/Flags

General Options

  • [repository_path]Required. Specifies the root directory containing the Git repositories you want to access.
  • projectrootRequired. Specifies the URL prefix for your Gitweb installation.
  • owner – Specifies the user who owns the Git repositories.
  • group – Specifies the group that owns the Git repositories.

Interface Options

  • themes – Specifies a list of themes to use for customizing the Gitweb interface.
  • language – Specifies the default language for the Gitweb interface.
  • commit_message_wrap – Specifies the maximum length of commit messages before they are wrapped.
  • max_file_size – Specifies the maximum file size (in bytes) that Gitweb will display.
  • toplist – Specifies the number of recent commits to display on the front page.

Security Options

  • auth_method – Specifies the authentication method to use (e.g., ‘none’, ‘basic’, ‘ldap’).
  • auth_file – Specifies the password file to use for basic authentication.
  • ldap_uri – Specifies the LDAP URI to use for LDAP authentication.
  • ldap_base_dn – Specifies the LDAP base DN to use for LDAP authentication.
  • ldap_user_attribute – Specifies the LDAP user attribute to use for LDAP authentication.

Examples

Basic Configuration

repository_path = /var/git
projectroot = /gitweb
owner = gitweb
group = git

Customizing the Interface

themes = blue-dust,gray-dust
language = en
commit_message_wrap = 72
max_file_size = 100000
toplist = 10

Enabling Basic Authentication

auth_method = basic
auth_file = /etc/gitweb-passwords

Common Issues

Permission Denied

Ensure that the Gitweb user has read access to the Git repositories and the .gitweb.conf file.

Invalid Authentication

Verify that the authentication method, password file, LDAP server, and base DN are configured correctly.

Integration

gitweb.conf can be used with other commands and tools to enhance its functionality, such as:

  • git – Use the git clone command to clone repositories from the Gitweb interface.
  • shell – Use the gitweb-rev command to retrieve information about Git revisions.

Related Commands

  • gitdaemon – A daemon that serves read-only Git repositories over the network.
  • git-http-backend – A CGI backend for Apache or Cherokee web servers that provides Git repository access.