diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Document the environment macro expansion reads
| -rw-r--r-- | cgitrc.5.txt | 16 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 14 insertions, 2 deletions
diff --git a/cgitrc.5.txt b/cgitrc.5.txt index a5e0f29..b05f6e9 100644 --- a/cgitrc.5.txt +++ b/cgitrc.5.txt @@ -837,13 +837,25 @@ named environment variable: Macro expansion will also happen on the content of $CGIT_CONFIG, if defined. +The set of available variables is not fixed by cgit. The options above are +expanded while the configuration is parsed, against whatever environment +the web server hands the cgit process, so any variable the server sets can +be used. A CGI server provides the standard request variables, among them +$HTTP_HOST, $HTTPS, $PATH_INFO, $QUERY_STRING, $REQUEST_METHOD, +$SCRIPT_NAME, $SERVER_NAME and $SERVER_PORT, and server directives such as +SetEnv (Apache), fastcgi_param (nginx) or setenv.add-environment +(lighttpd) can add anything else. Note that cgit unsets $HOME and +$XDG_CONFIG_HOME before reading its configuration, so those two never +expand. + One usage of this feature is virtual hosting, which in its simplest form can be accomplished by adding the following line to /etc/cgitrc: include=/etc/cgitrc.d/$HTTP_HOST -The following options are expanded during request processing, and support -the environment variables defined in "FILTER API": +The following options are expanded later, during request processing, and +additionally support the seven CGIT_REPO_* variables defined in +"FILTER API": - clone-url - repo.clone-url |
