5 kx
13 kx # [csvn-ui.rc(5) Config File](https://csvn.radix.pro/scm-tools/csvn-ui/trunk/doc/csvn-ui.rc.5.md)
5 kx
5 kx **/etc/csvn-ui.rc** – **cSvn-ui** CGI Script configuration file describes the Subversion™
5 kx repositories that should be displayed on the client side.
5 kx
5 kx
5 kx ## Table of Contents
5 kx
5 kx * [File Format](#file-format)
5 kx * [Data Types](#data-types)
5 kx * [Reserved Variables](#reserved-variables)
5 kx * [Repository Declaration](#repository-declaration)
5 kx * [Working Example](#working-example)
5 kx * [See Also](#see-also)
5 kx
5 kx
5 kx ## File Format
5 kx
5 kx **/etc/csvn-ui.rc** is a regular text file created by user to present Subversion repositories. This file
13 kx reads by [**cscnd(8)**](https://csvn.radix.pro/scm-tools/cscm/trunk/doc/cscmd.8.md) daemon and converts to binary
5 kx form for **cSvn-ui** CGI script. Binary format allows to minimize the time needed for complete HTTP
5 kx responses.
5 kx
5 kx The configuration file consists of a set of variable or repository declarations also configuration
5 kx file can contains section of repository descriptions. The C/C++ comments are available:
5 kx
5 kx ```dts
5 kx /****************************
5 kx Apache's SVN repositories:
5 kx */
5 kx home-page = "https://svn.apache.org/";
5 kx
5 kx repo 'subversion' {
5 kx owner = "Apache";
5 kx description = "Source repository of the Subversion.";
5 kx checkout-prefix-readonly = 'https://svn.apache.org/repos/asf';
5 kx }
5 kx
5 kx section "Other Repositories" {
5 kx repo 'other-repository' {
5 kx . . .
5 kx }
5 kx . . .
5 kx }
5 kx ```
5 kx
5 kx
5 kx ### Data Types
5 kx
5 kx Configuration file assumes three types of variables.
5 kx
5 kx > **int** – integer constants. Example declaration:
5 kx
5 kx >> ```dts
5 kx >> true = 1;
5 kx >> ```
5 kx
5 kx
5 kx > **string** – string constants. Example declaration:
5 kx
5 kx >> ```dts
5 kx >> name = "Apache Subversion";
5 kx >> ```
5 kx
5 kx
5 kx > **path** – path constants. Example declaration:
5 kx
5 kx >> ```dts
5 kx >> path = '/etc/csvn-ui.rc';
5 kx >> ```
5 kx
5 kx
5 kx ### Reserved Variables
5 kx
5 kx There is a set of variable names used by **cSvn-ui** CGI Script.
5 kx
5 kx
5 kx #### svn-utc-offset
5 kx
5 kx The integer or string value of UTC offset on the SVN server where repositories are published.
5 kx For example:
5 kx
5 kx ```dts
5 kx svn-utc-offset = +0300; /* Europe/Moscow time zone */
5 kx ```
5 kx
5 kx
6 kx #### repo-root
6 kx
6 kx The name of directory where some repository is placed related to **svn repositories root** directory.
6 kx For example:
6 kx
6 kx ```dts
6 kx repo-root = 'tools';
6 kx ```
6 kx
6 kx
5 kx #### checkout-prefix-readonly
5 kx
5 kx The checkout prefix for readonly access to the repository. The value of this variable should
5 kx has **path** type without leadinfg dir-separator. Example declaration:
5 kx
5 kx ```dts
5 kx checkout-prefix-readonly = 'svn://example.com';
5 kx checkout-prefix-readonly = 'https://svn.example.com/svn';
5 kx ```
5 kx
5 kx Please note that **svn** protocol works match quickly.
5 kx
5 kx
5 kx #### checkout-prefix
5 kx
5 kx The checkout prefix for readwrite access to the repository. The value of this variable should
5 kx has **path** type without leadinfg dir-separator. Example declaration:
5 kx
5 kx ```dts
5 kx checkout-prefix = 'svn+ssh://svn@example.com';
5 kx ```
5 kx
5 kx This means the access on behalf **svn** system user.
5 kx
5 kx
5 kx #### branches
5 kx
5 kx The name of directory where branches is places. Default value is *'branches'*.
5 kx
5 kx #### trunk
5 kx
5 kx The name of the *trunk* directory. Default value is *'trunks'*.
5 kx
5 kx #### tags
5 kx
5 kx The name of directory where tags are saved. Default value is *'tags'*.
5 kx Example declarations of directory names:
5 kx
5 kx ```dts
5 kx branches = 'branches';
5 kx trunk = 'trunk';
5 kx tags = 'tags';
5 kx ```
5 kx
5 kx
5 kx #### snapshots
5 kx
5 kx The extension of snapshot tarballs. Default value: *'tar.xz'*. Example declaration:
5 kx
5 kx ```dts
5 kx snapshots = 'tar.xz';
5 kx ```
5 kx
5 kx Currently snapshot variable is not used by **cSvn-ui** CGI Script.
5 kx
5 kx
5 kx #### css
5 kx
5 kx The full name of the CSS style sheet relative to the directory where **cSvn-ui** CGI Sctipt is installed.
5 kx Example declaration:
5 kx
5 kx ```dts
5 kx css = '/.csvn/css/csvn.css';
5 kx ```
5 kx
5 kx
5 kx #### logo
5 kx
5 kx Url which specifies the source of an image which will be used as a logo (i.e right banner)
5 kx on **cSvn-ui** pages. Default value: *'/.csvn/pixmaps/csvn-banner-280x280.png'*. The path to the
5 kx **logo** also should be set relative to the directory where **cSvn-ui** CGI Script is installed.
5 kx Example declaration:
5 kx
5 kx ```dts
5 kx logo = '/.csvn/pixmaps/csvn-banner-280x280.png';
5 kx ```
5 kx
5 kx
5 kx #### logo-alt
5 kx
5 kx The string used in HTML as a 'alt' property of the right banner <img> tag.
5 kx Default value: *"Example.org"*. Example declaration:
5 kx
5 kx ```dts
5 kx logo-alt = "Example.org";
5 kx ```
5 kx
5 kx
5 kx #### logo-link
5 kx
5 kx The string used in HTML as a 'href' property of the right banner image link <a> tag.
5 kx Default value: *"https://example.org"*. Example declaration:
5 kx
5 kx ```dts
5 kx logo-link = "https://example.org";
5 kx ```
5 kx
5 kx
5 kx #### main-menu-logo
5 kx
5 kx Url which specifies the source of an image which will be used as a logo of the main menu item
5 kx on **cSvn-ui** pages. Default value: *'/.csvn/pixmaps/logo/SVN-logo-white-744x744.svg'*. The path
5 kx to the *main-menu-logo* also should be set relative to the directory where **cSvn-ui** CGI Script
5 kx is installed. Example declaration:
5 kx
5 kx ```dts
5 kx main-menu-logo = '/.csvn/pixmaps/logo/SVN-logo-white-744x744.svg';
5 kx ```
5 kx
5 kx
5 kx #### favicon-path
5 kx
5 kx The directory name of the *favicon.ico* file without leadind dir-separator.
5 kx Default value: *'/.csvn/pixmaps/favicon'*. Example declaration:
5 kx
5 kx ```dts
5 kx favicon-path = '/.csvn/pixmaps/favicon';
5 kx ```
5 kx
5 kx This directory name used for finding additional images declared in the HTML **header** of all
5 kx **cSvn-ui** pages.
5 kx
5 kx
5 kx #### syntax-highlight-css
5 kx
5 kx The base name of the CSS style sheet file used for syntax highlighting.
5 kx Default value: *'_csvn.css'*. Example declaration:
5 kx
5 kx ```dts
5 kx syntax-highlight-css = '_csvn.css';
5 kx ```
5 kx
5 kx **cSvn-ui** CGI Script uses [highlight.js](https://highlightjs.org/) installed into
5 kx `/.csvn/.engines/highlight/${hljs-version}/{css,js}` directories where the default
5 kx *_csvn.css* file is palced too.
5 kx
5 kx
5 kx #### header
5 kx
5 kx The content of the file specified with this option will be included verbatim at the top of all pages.
5 kx Default value: *'/.csvn/html/header.html'*.
5 kx
5 kx
5 kx #### footer
5 kx
5 kx The content of the file specified with this option will be included verbatim at the bottom of all pages.
5 kx Default value: *'/.csvn/html/footer.html'*. Examle of the **header** and the **footer** declarations:
5 kx
5 kx ```dts
5 kx header = '/.csvn/html/header.html';
5 kx footer = '/.csvn/html/footer.html';
5 kx ```
5 kx
5 kx The **header** and the **footer** files used as template where **cSvn-ui** CGI Script substitute
5 kx placeholders such as `${variable-name}` by their values. For example the `${css}` placeholder
5 kx will be replaced by the value of **css** variable declared in the **/etc/csvn-ui.rc** config file.
5 kx
5 kx
5 kx #### page-size
5 kx
5 kx The **string** or **int** variable which set the length of the repositories list or logs that shown
5 kx in one page by the **cSvn-ui** CGI Script. Default value: 200. Example declaration:
5 kx
5 kx ```dts
5 kx page-size = 50; /* 10 ... 200 may be string or integer. Default value is page-size = 200 */
5 kx ```
5 kx
5 kx
5 kx #### owner
5 kx
5 kx The **string** variable used in the HTML header of all **cSvn-ui** pages and also in the *Owner* colon
5 kx of the repository list. Default value: *"Andrey V.Kosteltsev"*.
5 kx
5 kx
5 kx #### author
5 kx
5 kx The **string** variable used in the HTML header of all **cSvn-ui** pages. Default value: *"Andrey V.Kosteltsev"*.
5 kx Example declarations of the **owner** and the **author** variables:
5 kx
5 kx ```dts
5 kx owner = "John Smith";
5 kx author = "John Smith";
5 kx ```
5 kx
5 kx
5 kx #### title
5 kx
5 kx The **string** variable used in the HTML header of all **cSvn-ui** pages as a page title.
5 kx Default value: *"SVN Repositories"*. Example declaration:
5 kx
5 kx ```dts
5 kx title = "Example.org SVN Repositories";
5 kx ```
5 kx
5 kx
5 kx #### description
5 kx
5 kx The **string** variable used in the HTML header of all **cSvn-ui** pages as a page description.
5 kx Default value: *"Subversion repositories hosted at Solar System, Earth"*.
5 kx Example declaration:
5 kx
5 kx ```dts
5 kx description = "Subversion repositories hosted at example.org (St.-Petersburg)";
5 kx ```
5 kx
5 kx For a long description the value of this **string** variable can be splitted in the C-style
5 kx by following way:
5 kx
5 kx ```dts
5 kx description = "Subversion repositories"
5 kx " hosted at example.org "
5 kx "(St.-Petersburg)";
5 kx ```
5 kx
5 kx
5 kx #### keywords
5 kx
5 kx The **string** variable contains space separated keywords used in the HTML header of all **cSvn-ui**
5 kx pages as a page keywords. Default value: *"cSvn repositories"*. Example declaration:
5 kx
5 kx ```dts
5 kx keywords = "cSvn-ui cSvn UI CGI Subversion Repositories scm SVN";
5 kx ```
5 kx
5 kx
5 kx #### copyright-notice
5 kx
5 kx The **string** variable used in the HTML footer of all **cSvn-ui** pages as a *Copyright Notice*.
5 kx Default value: *"By using any website materials you agree to indicate source."*.
5 kx Example declaration:
5 kx
5 kx ```dts
5 kx copyright-notice = "By using any materials you agree with ...";
5 kx ```
5 kx
5 kx
5 kx #### copyright
5 kx
5 kx The **string** variable used in the HTML footer of all **cSvn-ui** pages as a *Copyright*.
5 kx Default value: *"© 2020 Andrey V.Kosteltsev. All Rights Reserved."*.
5 kx Example declaration:
5 kx
5 kx ```dts
5 kx copyright = "© John Smith (explorer), 1580 - 1631.";
5 kx ```
5 kx
5 kx
5 kx #### home-page
5 kx
5 kx The URL of the home page of the project. Default value: *"https://example.org"*.
5 kx Example declaration:
5 kx
5 kx ```dts
5 kx home-page = "https://main-site-of-the-project.org";
5 kx ```
5 kx
5 kx
5 kx ### Analytics variables:
5 kx
5 kx
5 kx #### analytic-links
5 kx
5 kx The path to the file which contains meta tags with site ownership verificaton codes for engines such as *Google Search Console* or
5 kx *Yandex Webmaster*. **cSvn-ui** CGI Script reads the file **analytic-links** in RAW format and includes it into <HEAD> tag of each HTML page.
5 kx Example declaration:
5 kx
5 kx ```dts
5 kx analytic-links = '/analytics/links';
5 kx ```
5 kx
5 kx Where the file */analytics/links* may contains HTML tags like follow:
5 kx
5 kx ```html
5 kx <meta name="google-site-verification" content="..." />
5 kx ```
5 kx
5 kx The file name should be defined relative of the path where **cSvn-ui** CGI Script is installed. For example, if **cSvn-ui** CGI Script installed
5 kx into */srv/www/htdocs/csvn* directory and file name declared as */analytics/links* then **cSvn-ui** CGI Script will try to read the
5 kx file */srv/www/htdocs/csvn/analytics/links*.
5 kx
5 kx
5 kx #### analytic-scripts
5 kx
5 kx The path to the file which contains *JavaScripts* for engines such as *Google Search Console* or
5 kx *Yandex Webmaster*. **cSvn-ui** CGI Script reads the file **analytic-scripts** in RAW format and includes it at the end of <HEAD> tag before
5 kx </HEAD> entry of each HTML page. Example declaration:
5 kx
5 kx ```dts
5 kx analytic-scripts = '/analytics/scripts';
5 kx ```
5 kx
5 kx Where the file */analytics/scripts* may contains code like follow:
5 kx
5 kx ```html
5 kx <!-- Global site tag (gtag.js) - Google Analytics -->
5 kx <script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
5 kx <script>
5 kx window.dataLayer = window.dataLayer || [];
5 kx function gtag(){dataLayer.push(arguments);}
5 kx gtag('js', new Date());
5 kx
5 kx gtag('config', 'G-XXXXXXXXXX');
5 kx </script>
5 kx ```
5 kx
5 kx Please note that the *<script>* tags should be present in the */analytics/scripts* because **cSvn-ui** CGI Script reads this file
5 kx in RAW format and includes it as is.
5 kx
5 kx The variables **analytic-links** and **analytic-scripts** should be declared on the global level of the **/etc/csvn-ui.rc**
5 kx configuration file and cannot be overriden in a repository declaration.
5 kx
5 kx
5 kx ### Donation variables:
5 kx
5 kx The **cSvn-ui** CGI Script provides the ability to create a custom donation dialogue. To do this, you need to create a set of three files:
5 kx **CSS**, **HTML**, and **JavaScript** file for automation. You can add a donation dialogue for each repository separately, as well as for the
5 kx entire list of repositories. To enable donation dialogue you have to set the value of **donate** variable to **donate = 1**:
5 kx
5 kx
5 kx #### donate
5 kx
5 kx The integer variable used to enable or disable donation dialogue. Example declaration:
5 kx
5 kx ```dts
5 kx donate = 1;
5 kx ```
5 kx
5 kx #### donate-css
5 kx
5 kx The name of file contains the stylesheet for donation modal dialogue. Example declaration:
5 kx
5 kx ```dts
5 kx donate-css = '/donations/donate.css';
5 kx ```
5 kx
5 kx #### donate-html
5 kx
5 kx The name of file contains the HTML code of donation modal dialogue. Example declaration:
5 kx
5 kx ```dts
5 kx donate-html = '/donations/donate.html';
5 kx ```
5 kx
5 kx #### donate-js
5 kx
5 kx The name of file contains the javascript code for donation modal dialogue automation. Example declaration:
5 kx
5 kx ```dts
5 kx donate-js = '/donations/donate.js';
5 kx ```
5 kx
5 kx **cSvn-ui** CGI Script includes these files at end of <BODY> tag just before the closing </BODY> tag. Unlike the others,
5 kx the **donate-html** file should be no more than 8192 bytes in size due to the fact that this file is a template
5 kx and the values of the following two variables are substituted into its body using placeholders *${donate-header}*
5 kx and *${donate-purpose}*:
5 kx
5 kx
5 kx #### donate-header
5 kx
5 kx The title of the donation modal dialogue defined in the **donate-html** file. Example declaration:
5 kx
5 kx ```dts
5 kx donate-header = "Donations";
5 kx ```
5 kx
5 kx #### donate-purpose
5 kx
5 kx The donation purpose used as value of <input value="..."> tag property in payment form of systems such as **PayPal** or **Yandex.Money**.
5 kx Also this value can be used as a header of modal dialogue content. Example declaration:
5 kx
5 kx ```dts
5 kx donate-purpose = "Support for our projects";
5 kx ```
5 kx
5 kx Donation dialogue can be defined for each repository separately or defined on global level. In the last case
5 kx the dialogue header and payment purpose may be overriden in the body of a repository declaration like follow:
5 kx
5 kx ```dts
5 kx true = 1;
5 kx false = 0;
5 kx
5 kx donate = true;
5 kx donate-css = '/donations/donate.css';
5 kx donate-html = '/donations/donate.html';
5 kx donate-js = '/donations/donate.js';
5 kx donate-header = "Donation";
5 kx donate-purpose = "Support our activities";
5 kx
5 kx section "Tools" {
5 kx repo 'repo-path' {
5 kx . . .
5 kx donate-header = "Project Donation";
5 kx donate-purpose = "Support our Project";
5 kx . . .
5 kx }
5 kx }
5 kx ```
5 kx
5 kx To show the modal dialogue in javascript code **donate-js** the selector **'a.donate'** should be used. For examle, like this:
5 kx
5 kx ```php
5 kx var show = document.querySelector( "a.donate" );
5 kx
5 kx /**************
5 kx Open Dialog:
5 kx */
5 kx show.onclick = function() {
5 kx dialog.style.display = "block";
5 kx }
5 kx ```
5 kx
5 kx Where the variable *dialog* points to modal dialogue defined in the **donate-html** file.
5 kx
5 kx
5 kx
5 kx ### Repository Declaration
5 kx
5 kx The **/etc/csvn-ui.rc** config file should contains at least one repository declaration to be shown
5 kx by the **cSvn-ui** CGI Script. When all expected variables declared in the global section
5 kx the config file the repository declaration can be very simple:
5 kx
5 kx ```dts
5 kx repo 'tools' {
5 kx owner = "John Smith";
5 kx description = "John Smith's tools source code repository.";
5 kx }
5 kx ```
5 kx
5 kx The list of repositories can be splitted in several sections. The section has a name and can
5 kx contains repository declarations only.
5 kx
5 kx ```dts
5 kx section "John Smith sources" {
5 kx repo 'tools' {
5 kx owner = "John Smith";
5 kx description = "John Smith's tools source code repository.";
5 kx }
5 kx repo 'examples' {
5 kx owner = "John Smith";
5 kx description = "John Smith's examples source code.";
5 kx }
5 kx }
5 kx ```
5 kx
5 kx Please note, repositories, unlike sections, do not have a name, but have a **path** to repository.
5 kx So if your repositories in the file system are stored in the `/var/scm/svn` directory, and the
5 kx `tools` repository is located in the `/var/scm/svn/tools` directory, then the path to the repository
5 kx is set relative to the `/var/scm/svn` directory as follows:
5 kx
5 kx ```dts
5 kx repo 'tools' {
5 kx owner = "John Smith";
5 kx description = "John Smith's tools source code repository.";
5 kx }
5 kx ```
5 kx
5 kx
5 kx ## Working Example
5 kx
5 kx As an example, we will give a working configuration file in which the **cSvn-ui** repository is presented.
5 kx
5 kx ```dts
5 kx svn-utc-offset = +0300;
5 kx
5 kx checkout-prefix-readonly = 'svn://radix.pro';
5 kx checkout-prefix = 'svn+ssh://svn@radix.pro';
5 kx
5 kx branches = 'branches';
5 kx trunk = 'trunk';
5 kx tags = 'tags';
5 kx
5 kx snapshots = 'tar.xz';
5 kx
5 kx css = '/.csvn/css/csvn.css';
5 kx logo = '/.csvn/pixmaps/csvn-banner-280x280.png';
5 kx logo-alt = "Radix.pro";
5 kx logo-link = "https://radix.pro";
5 kx main-menu-logo = '/.csvn/pixmaps/logo/SVN-logo-white-744x744.svg';
5 kx favicon-path = '/.csvn/pixmaps/favicon';
5 kx syntax-highlight-css = '_csvn.css';
5 kx header = '/.csvn/html/header.html';
5 kx footer = '/.csvn/html/footer.html';
5 kx page-size = 200;
5 kx
5 kx owner = "Andrey V.Kosteltsev";
5 kx author = "Andrey V.Kosteltsev";
5 kx title = "Radix.pro SVN Repositories";
5 kx description = "Subversion repositories hosted at radix.pro (St.-Petersburg)";
5 kx keywords = "cSvn repositories";
5 kx copyright = "© Andrey V. Kosteltsev, 2019 – 2020.";
5 kx copyright-notice = "Where any material of this site is being reproduced, published or issued to others the reference to the source is obligatory.";
5 kx
5 kx home-page = "https://radix.pro/";
5 kx
5 kx section "Tools" {
5 kx repo 'csvn-ui' {
5 kx owner = "Andrey V.Kosteltsev";
5 kx title = "cSvn-ui for SVN Repositories";
5 kx description = "cSvn-ui – is a web interface for Subversion™ Repositories written in C";
5 kx home-page = "https://radix.pro/";
5 kx }
5 kx }
5 kx
5 kx ```
5 kx
5 kx
5 kx ## See Also
5 kx
13 kx > [**README**](https://csvn.radix.pro/scm-tools/csvn-ui/trunk/README.md),
13 kx > [**cscmd(8)**](https://csvn.radix.pro/scm-tools/cscm/trunk/doc/cscmd.8.md)
5 kx