cGit-UI for Git Repositories

cGit-UI – is a web interface for Git Repositories. cGit CGI script is writen in C and therefore it's fast enough

3 Commits   0 Branches   1 Tag
author: kx <kx@radix.pro> 2023-03-24 03:51:10 +0300 committer: kx <kx@radix.pro> 2023-03-24 03:51:10 +0300 commit: 05d292b208dfe01324826b4c87bbc4da3389a0d5 parent: 40ab18a661ff6ada40e73969be293918d346a2f5
Commit Summary:
Version 0.1.7
Diffstat:
9 files changed, 596 insertions, 0 deletions
diff --git a/doc/build-packages/archlinux/PKGBUILD b/doc/build-packages/archlinux/PKGBUILD
new file mode 100644
index 0000000..ad47573
--- /dev/null
+++ b/doc/build-packages/archlinux/PKGBUILD
@@ -0,0 +1,38 @@
+#
+# Maintainer: Andrey V.Kosteltsev <kx@radix.pro>
+#
+pkgname=cgit-ui
+pkgver=0.1.7
+pkgrel=2
+pkgdesc='cGit-ui CGI Script is a web interface for Git Repositories'
+arch=('x86_64')
+url='https://csvn.radix.pro'
+license=('custom')
+depends=('file' 'pcre2' 'libgit2' 'md4c')
+source=("https://ftp.radix.pro/pub/cgit-ui/${pkgname}-${pkgver}.tar.xz")
+md5sums=('..Check MD5 sum before Building Package..')
+
+build() {
+  cd ${pkgname}-${pkgver}
+
+  CFLAGS="-O2 -fPIC -Wno-unused-result" \
+  ./configure \
+    --prefix=/usr \
+    --sysconfdir=/etc \
+    --with-scriptdir=/usr/share/nginx/cgit
+
+  make
+}
+
+package() {
+  cd ${pkgname}-${pkgver}
+
+  make install DESTDIR="${pkgdir}"
+
+  # Gzip man pages:
+  gzip -9 ${pkgdir}/usr/share/man/man5/cgit-ui.rc.5
+
+  # Install documentation:
+  install -d ${pkgdir}/usr/share/doc/${pkgname}-${pkgver}
+  cp -a ChangeLog LICENSE README README.md doc/ ${pkgdir}/usr/share/doc/${pkgname}-${pkgver}
+}
diff --git a/doc/build-packages/archlinux/README b/doc/build-packages/archlinux/README
new file mode 100644
index 0000000..f4333db
--- /dev/null
+++ b/doc/build-packages/archlinux/README
@@ -0,0 +1,23 @@
+
+Sytem requires:
+  fakeroot, logrotate, nginx, uwsgi
+
+Build time requires:
+  make, binutils, gcc, bison, autoconf, automake, pkgconfig,
+  file (libmagic), pcre2, libgit2, md4c
+
+Runtime requires:
+  libmagic, pcre2, libgit2, md4c
+
+As non-privileged user:
+
+  $ mkdir build
+  $ cp PKGBUILD build/
+  $ cd build/
+  $ makepkg
+
+As root:
+
+  # pacman -U ./cgit-ui-0.1.7-2-x86_64.pkg.tar.zst
+
+After install you have to configure uWsgi and Nginx servers (see: README.md).
diff --git a/doc/build-packages/rpms/README b/doc/build-packages/rpms/README
new file mode 100644
index 0000000..0ed174b
--- /dev/null
+++ b/doc/build-packages/rpms/README
@@ -0,0 +1,17 @@
+
+To build RPM packages we have to copy source package downloaded
+from https://ftp.radix.pro/pub/cgit-ui directory to /usr/src/packages/SOURSES/
+directory. And also copy the cgit-ui.spec file into /usr/src/packages/SPECS/
+directory. Then edit the package version in the cgit-ui.spec file according
+to source package version.
+
+Dependencies: file-devel, pcre2-devel, libgit2-devel, md4c-devel, md4c-html-devel.
+
+RPMs can be built by following command:
+
+ $ rpmbuild --define "_topdir /usr/src/packages" -ba /usr/src/packages/SPECS/cgit-ui.spec
+
+Resulting RPMs will be saved in /usr/src/packages/SRPMS/ and
+/usr/src/packages/RPMS/`uname -m`/ directories.
+
+After install you have to configure uWsgi and Nginx servers (see: README.md).
diff --git a/doc/build-packages/rpms/cgit-ui.spec b/doc/build-packages/rpms/cgit-ui.spec
new file mode 100644
index 0000000..3d58d35
--- /dev/null
+++ b/doc/build-packages/rpms/cgit-ui.spec
@@ -0,0 +1,42 @@
+
+Name:       cgit-ui
+Version:    0.1.7
+Release:    2
+Summary:    cGit-ui a web interface for Git repositories
+License:    RADIX-1.0
+Group:      System/base
+Source:     https://ftp.radix.pro/pub/cgit-ui/cgit-ui-0.1.7.tar.xz
+Url:        https://csvn.radix/pro/cgit-ui/
+
+
+%define _sysconfdir /etc
+%define _scriptdir  /srv/www/htdocs/cgit
+
+
+%description
+cGit-ui CGI Script - is a web interface for Git Repositories
+
+%prep
+%setup -q
+
+%build
+./configure \
+  --prefix=/usr \
+  --sysconfdir=%{_sysconfdir} \
+  --with-scriptdir=%{_scriptdir}
+
+%install
+make install DESTDIR=%{buildroot}
+
+%clean
+%{?buildroot:%__rm -rf "%{buildroot}"}
+
+%files
+%defattr(-,root,root)
+%{_datadir}/*
+%doc LICENSE README README.md doc/
+%attr(755,root,root) %{_scriptdir}/cgit-ui.cgi
+%attr(644,root,root) %{_scriptdir}/favicon.ico
+%attr(644,root,root) %{_scriptdir}/robots.txt
+%{_scriptdir}/.cgit/
+
diff --git a/doc/build-packages/slackware/README b/doc/build-packages/slackware/README
new file mode 100644
index 0000000..d89f753
--- /dev/null
+++ b/doc/build-packages/slackware/README
@@ -0,0 +1,7 @@
+
+cgit-ui (a web interface for Git repositories)
+
+cGit-ui CGI Script is a web interface for browsing Git
+repositories.
+
+Homepage: https://csvn.radix.pro
diff --git a/doc/build-packages/slackware/cgit-ui.SlackBuild b/doc/build-packages/slackware/cgit-ui.SlackBuild
new file mode 100644
index 0000000..c356cae
--- /dev/null
+++ b/doc/build-packages/slackware/cgit-ui.SlackBuild
@@ -0,0 +1,92 @@
+#!/bin/bash
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PKGNAM=cgit-ui
+VERSION=${VERSION:-$(echo cgit-ui-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+BUILD=${BUILD:-2}
+
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+  case "$( uname -m )" in
+    i?86) export ARCH=i586 ;;
+    arm*) export ARCH=arm ;;
+    # Unless $ARCH is already set, use uname -m for all other archs:
+       *) export ARCH=$( uname -m ) ;;
+  esac
+fi
+
+if [ "$ARCH" = "i586" ]; then
+  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+  LIBDIRSUFFIX=""
+elif [ "$ARCH" = "s390" ]; then
+  SLKCFLAGS="-O2"
+  LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+  SLKCFLAGS="-O2 -fPIC"
+  LIBDIRSUFFIX="64"
+else
+  SLKCFLAGS="-O2"
+  LIBDIRSUFFIX=""
+fi
+
+TMP=${TMP:-/tmp}
+PKG=$TMP/package-$PKGNAM
+
+rm -rf $PKG
+mkdir -p $TMP $PKG
+
+cd $TMP
+rm -rf $PKGNAM-$VERSION
+tar xvf $CWD/$PKGNAM-$VERSION.tar.?z* || exit 1
+cd $PKGNAM-$VERSION || exit 1
+
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \+ -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \+
+
+CFLAGS="$SLKCFLAGS" \
+./configure \
+  --prefix=/usr \
+  --sysconfdir=/etc \
+  --libdir=/usr/lib${LIBDIRSUFFIX} \
+  --with-scriptdir=/srv/www/htdocs/cgit \
+  --build=$ARCH-slackware-linux || exit 1
+
+
+make || exit 1
+make install DESTDIR=$PKG || exit 1
+
+find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
+  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+
+mv $PKG/usr/share/man $PKG/usr/
+gzip -9 $PKG/usr/man/man?/*
+rmdir $PKG/usr/share/man
+
+find $PKG/usr/man -type f -exec gzip -9 {} \;
+
+mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
+cp -a \
+  ChangeLog LICENSE README README.md doc \
+  $PKG/usr/doc/$PKGNAM-$VERSION
+
+cp -a $CWD/$PKGNAM.info        $PKG/usr/doc/$PKGNAM-$VERSION
+cp -a $CWD/$PKGNAM.SlackBuild  $PKG/usr/doc/$PKGNAM-$VERSION
+
+# If there's a ChangeLog file, installing at least part of the recent history
+# is useful, but don't let it get totally out of control:
+if [ -r ChangeLog ]; then
+  DOCSDIR=$(echo $PKG/usr/doc/*-$VERSION)
+  cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
+  touch -r ChangeLog $DOCSDIR/ChangeLog
+fi
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
diff --git a/doc/build-packages/slackware/cgit-ui.info b/doc/build-packages/slackware/cgit-ui.info
new file mode 100644
index 0000000..e999235
--- /dev/null
+++ b/doc/build-packages/slackware/cgit-ui.info
@@ -0,0 +1,10 @@
+PRGNAM="cgit-ui"
+VERSION="0.1.7"
+HOMEPAGE="http://csvn.radix.pro"
+DOWNLOAD="https://ftp.radix.pro/pub/cgit-ui/cgit-ui-0.1.7.tar.xz"
+MD5SUM="..Check MD5 sum before Building Package.."
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES="cscm md4c libpcre2-8 libpcre2-32 libgit2"
+MAINTAINER="Andrey V.Kosteltsev"
+EMAIL="kx@radix.pro"
diff --git a/doc/build-packages/slackware/slack-desc b/doc/build-packages/slackware/slack-desc
new file mode 100644
index 0000000..f256466
--- /dev/null
+++ b/doc/build-packages/slackware/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|' on
+# the right side marks the last column you can put a character in. You must make
+# exactly 11 lines for the formatting to be correct. It's also customary to
+# leave one space after the ':'.
+
+       |-----handy-ruler------------------------------------------------------|
+cgit-ui: cgit-ui (a web interface for Git repositories)
+cgit-ui:
+cgit-ui: cGit-ui CGI Script is a web interface for browsing Git
+cgit-ui: repositories.
+cgit-ui:
+cgit-ui:
+cgit-ui: Homepage: https://csvn.radix.pro
+cgit-ui:
+cgit-ui:
+cgit-ui:
+cgit-ui:
diff --git a/doc/cgit-ui.rc.5.md b/doc/cgit-ui.rc.5.md
new file mode 100644
index 0000000..7273d03
--- /dev/null
+++ b/doc/cgit-ui.rc.5.md
@@ -0,0 +1,604 @@
+
+# [cgit-ui.rc(5) Config File](https://csvn.radix.pro/cgit-ui/trunk/doc/cgit-ui.rc.5.md)
+
+**/etc/cgit-ui.rc** &#8211; **cGit-ui CGI Script** config file describes the Git&#8482;
+repositories that should be displayed on the WEB-client side.
+
+
+## Table of Contents
+
+* [File Format](#file-format)
+    * [Data Types](#data-types)
+    * [Reserved Variables](#reserved-variables)
+    * [Repository Declaration](#repository-declaration)
+* [Working Example](#working-example)
+* [See Also](#see-also)
+
+
+## File Format
+
+**/etc/cgit-ui.rc** is a regular text file created by user to present Git repositories. This file
+reads by [**cscmd(8)**](https://csvn.radix.pro/cscm/trunk/doc/cscmd.8.md) daemon and converts to binary
+form for **cGit-ui** CGI script. Binary format allows to minimize the time needed for complete HTTP
+responses.
+
+The configuration file consists of a set of variable or repository declarations also configuration
+file can contains section of repository descriptions. The C/C++ comments are available:
+
+```dts
+/**************************
+  Kernel Git repositories:
+ */
+home-page = "https://www.kernel.org/";
+
+repo 'git.git' {
+  owner = "Junio C. Hamano";
+  title = "The core git plumbing";
+  description = "Git &#8211; fast, scalable, distributed revision control system.";
+  git-root = '/pub/scm/git';
+  clone-prefix-readonly = 'git://git.kernel.org/pub/scm/git';
+  home-page = "https://git-scm.com/";
+}
+
+section "Other Repositories" {
+  repo 'other-repository' {
+    . . .
+  }
+  . . .
+}
+```
+
+### Data Types
+
+Configuration file assumes three types of variables.
+
+> **int** &#8211; integer constants. Example declaration:
+
+>> ```dts
+>> true = 1;
+>> ```
+
+
+> **string** &#8211; string constants. Example declaration:
+
+>> ```dts
+>> name = "Git-scm";
+>> ```
+
+
+> **path** &#8211; path constants. Example declaration:
+
+>> ```dts
+>> path = '/etc/cgit-ui.rc';
+>> ```
+
+
+### Reserved Variables
+
+There is a set of variable names used by **cGit-ui** CGI Script.
+
+
+#### git-root
+
+The name of directory where Git repositories is placed on the filesystem. For example:
+
+```dts
+git-root = '/pub/scm/git';
+```
+
+#### repo-root
+
+The name of directory where some repository is placed related to **git-root** directory. For example:
+
+```dts
+repo-root = 'dm644x';
+```
+
+
+#### git-utc-offset
+
+The integer or string value of UTC offset on the Git server where repositories are published.
+For example:
+
+```dts
+git-utc-offset = +0300; /* Europe/Moscow time zone */
+```
+
+
+#### clone-prefix-readonly
+
+The clone prefix for readonly access to the repository. The value of this variable should
+has **path** type without leadinfg dir-separator. Example declaration:
+
+```dts
+clone-prefix-readonly = 'git://example.com';
+```
+
+
+#### clone-prefix
+
+The clone prefix for readwrite access to the repository. The value of this variable should
+has **path** type without leadinfg dir-separator. Example declaration:
+
+```dts
+clone-prefix = 'git://git@example.com:pub';
+```
+
+This means the access on behalf **git** system user.
+
+
+#### trunk
+
+The name of the main branch of particular repository. Default value is *'master'*.
+
+Example declarations of main branch name:
+
+```dts
+trunk = 'master';
+```
+
+
+#### snapshots
+
+The extension of snapshot tarballs. Default value: *'tar.xz'*. Example declaration:
+
+```dts
+snapshots = 'tar.xz';
+```
+
+Currently snapshot variable is not used by **cGit-ui** CGI Script.
+
+
+#### css
+
+The full name of the CSS style sheet relative to the directory where **cGit-ui** CGI Sctipt is installed.
+Example declaration:
+
+```dts
+css = '/.cgit/css/cgit.css';
+```
+
+
+#### logo
+
+Url which specifies the source of an image which will be used as a logo (i.e right banner)
+on **cGit-ui** pages. Default value: *'/.cgit/pixmaps/cgit-banner-280x280.png'*. The path to the
+**logo** also should be set relative to the directory where **cGit-ui** CGI Script is installed.
+Example declaration:
+
+```dts
+logo = '/.cgit/pixmaps/cgit-banner-280x280.png';
+```
+
+
+#### logo-alt
+
+The string used in HTML as a 'alt' property of the right banner &lt;img&gt; tag.
+Default value: *"Example.org"*. Example declaration:
+
+```dts
+logo-alt = "Example.org";
+```
+
+
+#### logo-link
+
+The string used in HTML as a 'href' property of the right banner image link &lt;a&gt; tag.
+Default value: *"https://example.org"*. Example declaration:
+
+```dts
+logo-link = "https://example.org";
+```
+
+
+#### main-menu-logo
+
+Url which specifies the source of an image which will be used as a logo of the main menu item
+on **cGit-ui** pages. Default value: *'/.cgit/pixmaps/logo/git-logo-white-256x256.svg'*. The path
+to the *main-menu-logo* also should be set relative to the directory where **cGit-ui** CGI Script
+is installed. Example declaration:
+
+```dts
+main-menu-logo = '/.cgit/pixmaps/logo/git-logo-white-256x256.svg';
+```
+
+
+#### favicon-path
+
+The directory name of the *favicon.ico* file without leadind dir-separator.
+Default value: *'/.cgit/pixmaps/favicon'*. Example declaration:
+
+```dts
+favicon-path = '/.cgit/pixmaps/favicon';
+```
+
+This directory name used for finding additional images declared in the HTML **header** of all
+**cGit-ui** pages.
+
+
+#### syntax-highlight-css
+
+The base name of the CSS style sheet file used for syntax highlighting.
+Default value: *'_cgit.css'*. Example declaration:
+
+```dts
+syntax-highlight-css = '_cgit.css';
+```
+
+**cGit-ui** CGI Script uses [highlight.js](https://highlightjs.org/) installed into
+`/.cgit/.engines/highlight/${hljs-version}/{css,js}` directories where the default
+*_cgit.css* file is palced too.
+
+
+#### header
+
+The content of the file specified with this option will be included verbatim at the top of all pages.
+Default value: *'/.cgit/html/header.html'*.
+
+#### footer
+
+The content of the file specified with this option will be included verbatim at the bottom of all pages.
+Default value: *'/.cgit/html/footer.html'*. Examle of the **header** and the **footer** declarations:
+
+```dts
+header = '/.cgit/html/header.html';
+footer = '/.cgit/html/footer.html';
+```
+
+The **header** and the **footer** files used as template where **cGit-ui** CGI Script substitute
+placeholders such as `${variable-name}` by their values. For example the `${css}` placeholder
+will be replaced by the value of **css** variable declared in the **/etc/cgit-ui.rc** config file.
+
+
+#### page-size
+
+The **string** or **int** variable which set the length of the repositories list or logs that shown
+in one page by the **cGit-ui** CGI Script. Default value: 200. Example declaration:
+
+```dts
+page-size = 50; /* 10 ... 200 may be string or integer. Default value is page-size = 200 */
+```
+
+#### owner
+
+The **string** variable used in the HTML header of all **cGit-ui** pages and also in the *Owner* colon
+of the repository list. Default value: *"Andrey V.Kosteltsev"*.
+
+#### author
+
+The **string** variable used in the HTML header of all **cGit-ui** pages. Default value: *"Andrey V.Kosteltsev"*.
+Example declarations of the **owner** and the **author** variables:
+
+```dts
+owner  = "John Smith";
+author = "John Smith";
+```
+
+
+#### title
+
+The **string** variable used in the HTML header of all **cGit-ui** pages as a page title.
+Default value: *"Git Repositories"*. Example declaration:
+
+```dts
+title  = "Example.org Git Repositories";
+```
+
+
+#### description
+
+The **string** variable used in the HTML header of all **cGit-ui** pages as a page description.
+Default value: *"Git repositories hosted at Solar System, Earth"*.
+Example declaration:
+
+```dts
+description  = "Git repositories hosted at example.org (St.-Petersburg)";
+```
+
+For a long description the value of this **string** variable can be defined by following way:
+
+```dts
+description  = "Git repositories
+                hosted at example.org
+                (St.-Petersburg)";
+```
+
+
+#### keywords
+
+The **string** variable contains space separated keywords used in the HTML header of all **cGit-ui**
+pages as a page keywords. Default value: *"cGit repositories"*. Example declaration:
+
+```dts
+keywords = "cGit UI CGI Git Repositories scm";
+```
+
+
+#### copyright-notice
+
+The **string** variable used in the HTML footer of all **cGit-ui** pages as a *Copyright Notice*.
+Default value: *"By using any website materials you agree to indicate source."*.
+Example declaration:
+
+```dts
+copyright-notice = "By using any materials you agree with ...";
+```
+
+
+#### copyright
+
+The **string** variable used in the HTML footer of all **cGit-ui** pages as a *Copyright*.
+Default value: *"&#169; 2022 Andrey V.Kosteltsev. All Rights Reserved."*.
+Example declaration:
+
+```dts
+copyright = "&#169; John Smith (explorer), 1580 - 1631.";
+```
+
+
+#### home-page
+
+The URL of the home page of the project. Default value: *"https://example.org"*.
+Example declaration:
+
+```dts
+home-page = "https://main-site-of-the-project.org";
+```
+
+
+### Analytics variables:
+
+
+#### analytic-links
+
+The path to the file which contains meta tags with site ownership verificaton codes for engines such as *Google Search Console* or
+*Yandex Webmaster*. **cGit-ui** CGI Script reads the file **analytic-links** in RAW format and includes it into &lt;HEAD&gt; tag of each HTML page.
+Example declaration:
+
+```dts
+analytic-links = '/analytics/links';
+```
+
+Where the file */analytics/links* may contains HTML tags like follow:
+
+```html
+<meta name="google-site-verification" content="..." />
+```
+
+The file name should be defined relative of the path where **cGit-ui** CGI Script is installed. For example, if **cGit-ui** CGI Script installed
+into */srv/www/htdocs/cgit* directory and file name declared as */analytics/links* then **cGit-ui** CGI Script will try to read the
+file */srv/www/htdocs/cgit/analytics/links*.
+
+
+#### analytic-scripts
+
+The path to the file which contains *JavaScripts* for engines such as *Google Search Console* or
+*Yandex Webmaster*. **cGit-ui** CGI Script reads the file **analytic-scripts** in RAW format and includes it at the end of &lt;HEAD&gt; tag before
+&lt;/HEAD&gt; entry of each HTML page. Example declaration:
+
+```dts
+analytic-scripts = '/analytics/scripts';
+```
+
+Where the file */analytics/scripts* may contains code like follow:
+
+```html
+<!-- Global site tag (gtag.js) - Google Analytics -->
+<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
+<script>
+  window.dataLayer = window.dataLayer || [];
+  function gtag(){dataLayer.push(arguments);}
+  gtag('js', new Date());
+
+  gtag('config', 'G-XXXXXXXXXX');
+</script>
+```
+
+Please note that the *&lt;script&gt;* tags should be present in the */analytics/scripts* because **cGit-ui** CGI Script reads this file
+in RAW format and includes it as is.
+
+The variables **analytic-links** and **analytic-scripts** should be declared on the global level of the **/etc/cgit-ui.rc**
+configuration file and cannot be overriden in a repository declaration.
+
+
+### Donation variables:
+
+The **cGit-ui** CGI Script provides the ability to create a custom donation dialogue. To do this, you need to create a set of three files:
+**CSS**, **HTML**, and **JavaScript** file for automation. You can add a donation dialogue for each repository separately, as well as for the
+entire list of repositories. To enable donation dialogue you have to set the value of **donate** variable to **donate = 1**:
+
+
+#### donate
+
+The integer variable used to enable or disable donation dialogue. Example declaration:
+
+```dts
+donate = 1;
+```
+
+#### donate-css
+
+The name of file contains the stylesheet for donation modal dialogue. Example declaration:
+
+```dts
+donate-css = '/donations/donate.css';
+```
+
+#### donate-html
+
+The name of file contains the HTML code of donation modal dialogue. Example declaration:
+
+```dts
+donate-html = '/donations/donate.html';
+```
+
+#### donate-js
+
+The name of file contains the javascript code for donation modal dialogue automation. Example declaration:
+
+```dts
+donate-js = '/donations/donate.js';
+```
+
+**cGit-ui** CGI Script includes these files at end of &lt;BODY&gt; tag just before the closing &lt;/BODY&gt; tag. Unlike the others,
+the **donate-html** file should be no more than 8192 bytes in size due to the fact that this file is a template
+and the values of the following two variables are substituted into its body using placeholders *${donate-header}*
+and *${donate-purpose}*:
+
+
+#### donate-header
+
+The title of the donation modal dialogue defined in the **donate-html** file. Example declaration:
+
+```dts
+donate-header = "Donations";
+```
+
+#### donate-purpose
+
+The donation purpose used as value of &lt;input value="..."&gt; tag property in payment form of systems such as **PayPal** or **Yandex.Money**.
+Also this value can be used as a header of modal dialogue content. Example declaration:
+
+```dts
+donate-purpose = "Support for our projects";
+```
+
+Donation dialogue can be defined for each repository separately or defined on global level. In the last case
+the dialogue header and payment purpose may be overriden in the body of a repository declaration like follow:
+
+```dts
+true  = 1;
+false = 0;
+
+donate         = true;
+donate-css     = '/donations/donate.css';
+donate-html    = '/donations/donate.html';
+donate-js      = '/donations/donate.js';
+donate-header  = "Donation";
+donate-purpose = "Support our activities";
+
+section "Tools" {
+  repo 'repo-path' {
+    . . .
+    donate-header  = "Project Donation";
+    donate-purpose = "Support our Project";
+    . . .
+  }
+}
+```
+
+To show the modal dialogue in javascript code **donate-js** the selector **'a.donate'** should be used. For examle, like this:
+
+```php
+var show = document.querySelector( "a.donate" );
+
+/**************
+  Open Dialog:
+ */
+show.onclick = function() {
+  dialog.style.display = "block";
+}
+```
+
+Where the variable *dialog* points to modal dialogue defined in the **donate-html** file.
+
+
+
+### Repository Declaration
+
+The **/etc/cgit-ui.rc** config file should contains at least one repository declaration to be shown
+by the **cGit-ui** CGI Script. When all expected variables declared in the global section
+the config file the repository declaration can be very simple:
+
+```dts
+repo 'tools' {
+  owner = "John Smith";
+  description = "John Smith's tools source code repository.";
+}
+```
+
+The list of repositories can be splitted in several sections. The section has a name and can
+contains repository declarations only.
+
+```dts
+section "John Smith sources" {
+  repo 'tools' {
+    owner = "John Smith";
+    description = "John Smith's tools source code repository.";
+  }
+  repo 'examples' {
+    owner = "John Smith";
+    description = "John Smith's examples source code.";
+  }
+}
+```
+
+Please note, repositories, unlike sections, do not have a name, but have a **path** to repository.
+So if your repositories in the file system are stored in the `/var/scm/git` directory, and the
+`tools` repository is located in the `/var/scm/git/tools` directory, then the path to the repository
+is set relative to the `/var/scm/git` directory as follows:
+
+```dts
+repo 'tools' {
+  owner = "John Smith";
+  description = "John Smith's tools source code repository.";
+}
+```
+
+
+## Working Example
+
+As an example, we will give a working configuration file in which the
+[**pkgtools.git**](https://cgit.radix.pro/pkgtools.git/trunk/) repository is presented.
+
+```dts
+git-utc-offset = +0300;
+
+clone-prefix-readonly = 'git://radix.pro';
+clone-prefix          = 'git://git@radix.pro:pub';
+
+trunk    = 'master';
+
+snapshots = 'tar.xz';
+
+css = '/.cgit/css/cgit.css';
+logo = '/.cgit/pixmaps/cgit-banner-280x280.png';
+logo-alt = "Radix.pro";
+logo-link = "https://radix.pro";
+main-menu-logo = '/.cgit/pixmaps/logo/git-logo-white-256x256.svg';
+favicon-path = '/.cgit/pixmaps/favicon';
+syntax-highlight-css = '_cgit.css';
+header = '/.cgit/html/header.html';
+footer = '/.cgit/html/footer.html';
+page-size = 200;
+
+owner = "Andrey V.Kosteltsev";
+author = "Andrey V.Kosteltsev";
+title = "Radix.pro Git Repositories";
+description = "Git repositories hosted at radix.pro (St.-Petersburg)";
+keywords = "cGit repositories cgit-ui web web-ui user interface Git";
+copyright = "&#169; Andrey V. Kosteltsev, 2019 &#8211; 2022.";
+copyright-notice = "Where any material of this site is being reproduced, published or issued to others the reference to the source is obligatory.";
+
+home-page = "https://radix.pro/";
+
+section "Tools" {
+  repo 'pkgtools.git' {
+    owner = "Andrey V.Kosteltsev";
+    title = "Package Tools Utilities";
+    description = "Pkgtools &#8211; is a set of utilities to create, install, remove and update packages";
+    home-page = "https://radix.pro/";
+    git-root = '/u3/scm/git';
+    clone-prefix-readonly = 'git://git@radix.pro:git';
+    clone-prefix          = 'git://git@radix.pro:git';
+  }
+}
+
+```
+
+
+## See Also
+
+> [**README**](https://csvn.radix.pro/cgit-ui/trunk/README.md),
+> [**cscmd(8)**](https://csvn.radix.pro/cscm/trunk/doc/cscmd.8.md)
+