module Git::Lighttp
Module wich implements the following features:
-
Smart-HTTP, based on
git-http-backend
. -
Authentication flexible based on database or configuration file like
.htpasswd
. -
API to get information about repository.
This class configure the needed variables used by application.
Basically, the default
attribute set the values that will be necessary by all applications.
The HTTP-Backend application is configured by http_backend
attribute to set the Git
RCP CLI. More details about this feature, see git-http-backend
official page.
For tree view (JSON API) just use the attribute treeish
.
- default
-
Default configuration. All attributes will be used by all modular applications.
- default.project_root
-
Sets the root directory where repositories have been placed.
- default.git_path
-
Path to the git command line.
- treeish
-
Configuration for
Treeish
JSON API.- treeish.authenticate
-
Sets if the tree view server requires authentication.
- http_backend
-
HTTP-Backend configuration.
- http_backend.authenticate
-
Sets if authentication is required.
- http_backend.get_any_file
-
Like
http.getanyfile
. - http_backend.upload_pack
-
Like
http.uploadpack
. - http_backend.receive_pack
-
Like
http.receivepack
.
Constants
- DEFAULT_CONFIG
Public Class Methods
# File lib/git/lighttp.rb, line 335 def config @config ||= DEFAULT_CONFIG.to_struct end
# File lib/git/lighttp.rb, line 339 def config_reset! @config = DEFAULT_CONFIG.to_struct end
Configure Git::Lighttp
modules using keys. See Config for options.
# File lib/git/lighttp.rb, line 344 def configure(*) # :yield: config yield config config end
# File lib/git/lighttp.rb, line 349 def load_config_file(file) YAML.load_file(file).to_struct.each_pair do |app, options| options.each_pair do |option, value| config[app][option] = value end end config rescue IndexError abort 'configuration option not found' end