bfc1508d (kx 2023-03-24 03:55:33 +0300 1)
bfc1508d (kx 2023-03-24 03:55:33 +0300 2) # cSvn-UI for SVN Repositories
bfc1508d (kx 2023-03-24 03:55:33 +0300 3)
bfc1508d (kx 2023-03-24 03:55:33 +0300 4) **cSvn-UI** – is a web interface for Subversion (SVN) Repositories. **cSvn** CGI script is writen in **C**
bfc1508d (kx 2023-03-24 03:55:33 +0300 5) and therefore it's fast enough.
bfc1508d (kx 2023-03-24 03:55:33 +0300 6)
bfc1508d (kx 2023-03-24 03:55:33 +0300 7)
bfc1508d (kx 2023-03-24 03:55:33 +0300 8) ## Table of Contents
bfc1508d (kx 2023-03-24 03:55:33 +0300 9)
bfc1508d (kx 2023-03-24 03:55:33 +0300 10) * [Reqired packages](#reqired-packages)
bfc1508d (kx 2023-03-24 03:55:33 +0300 11) * [Installation](#installation)
bfc1508d (kx 2023-03-24 03:55:33 +0300 12) * [Bootstrap Script](#bootstrap-script)
bfc1508d (kx 2023-03-24 03:55:33 +0300 13) * [Configuring Sources](#configuring-sources)
bfc1508d (kx 2023-03-24 03:55:33 +0300 14) * [Post Install](#post-install)
bfc1508d (kx 2023-03-24 03:55:33 +0300 15) * [uWsgi Configuration](#uwsgi)
bfc1508d (kx 2023-03-24 03:55:33 +0300 16) * [Nginx Configuration](#nginx)
bfc1508d (kx 2023-03-24 03:55:33 +0300 17) * [Configuring SVN Repositories](#configuring-svn-repositories)
bfc1508d (kx 2023-03-24 03:55:33 +0300 18) * [See Also](#see-also)
bfc1508d (kx 2023-03-24 03:55:33 +0300 19) * [Copyright and License](#copyright-and-license)
bfc1508d (kx 2023-03-24 03:55:33 +0300 20)
bfc1508d (kx 2023-03-24 03:55:33 +0300 21)
bfc1508d (kx 2023-03-24 03:55:33 +0300 22) ## Reqired packages
bfc1508d (kx 2023-03-24 03:55:33 +0300 23)
bfc1508d (kx 2023-03-24 03:55:33 +0300 24) **cSvn-ui** depends of following libraries: [libpcre2-8](https://www.pcre.org/),
bfc1508d (kx 2023-03-24 03:55:33 +0300 25) [librt](https://www.gnu.org/software/libc/), [libm](https://www.gnu.org/software/libc/),
bfc1508d (kx 2023-03-24 03:55:33 +0300 26) [libmd4c](https://github.com/mity/md4c/), [libmd4c-html](https://github.com/mity/md4c/),
bfc1508d (kx 2023-03-24 03:55:33 +0300 27) [libmagic](http://darwinsys.com/file/), and [libxml2](http://www.xmlsoft.org/).
bfc1508d (kx 2023-03-24 03:55:33 +0300 28)
bfc1508d (kx 2023-03-24 03:55:33 +0300 29) From the moment when the **cSvn** package was split into two, so as do not produce
bfc1508d (kx 2023-03-24 03:55:33 +0300 30) unnecessary entities, **cSvn-ui** depends on the **cScm** package. Therefore, before
bfc1508d (kx 2023-03-24 03:55:33 +0300 31) installing **cSvn-ui**, you have to install and configure
bfc1508d (kx 2023-03-24 03:55:33 +0300 32) [**cScm Configuration Daemon**](https://csvn.radix.pro/cscm/trunk/README.md).
bfc1508d (kx 2023-03-24 03:55:33 +0300 33)
bfc1508d (kx 2023-03-24 03:55:33 +0300 34) To use **cSvn-ui** a web server must be installed and configured on the system. We recommend
bfc1508d (kx 2023-03-24 03:55:33 +0300 35) the [Nginx](https://nginx.org/en/) with [uWsgi](https://uwsgi-docs.readthedocs.io/en/latest/)
bfc1508d (kx 2023-03-24 03:55:33 +0300 36) application server. Of course [Apache Subversion](https://subversion.apache.org/) SCM system
bfc1508d (kx 2023-03-24 03:55:33 +0300 37) should be installed too.
bfc1508d (kx 2023-03-24 03:55:33 +0300 38)
bfc1508d (kx 2023-03-24 03:55:33 +0300 39)
bfc1508d (kx 2023-03-24 03:55:33 +0300 40) ## Installation
bfc1508d (kx 2023-03-24 03:55:33 +0300 41)
bfc1508d (kx 2023-03-24 03:55:33 +0300 42) To obtain sources we have to checkout its from SVN repository:
bfc1508d (kx 2023-03-24 03:55:33 +0300 43)
bfc1508d (kx 2023-03-24 03:55:33 +0300 44) ```Bash
bfc1508d (kx 2023-03-24 03:55:33 +0300 45) svn checkout svn://radix.pro/csvn-ui/tags/csvn-ui-0.1.3 csvn-ui-0.1.3
bfc1508d (kx 2023-03-24 03:55:33 +0300 46) ```
bfc1508d (kx 2023-03-24 03:55:33 +0300 47) and run the bootstrap script:
bfc1508d (kx 2023-03-24 03:55:33 +0300 48)
bfc1508d (kx 2023-03-24 03:55:33 +0300 49) ```Bash
bfc1508d (kx 2023-03-24 03:55:33 +0300 50) cd csvn-ui-0.1.3
bfc1508d (kx 2023-03-24 03:55:33 +0300 51) ./bootstrap
bfc1508d (kx 2023-03-24 03:55:33 +0300 52) ```
bfc1508d (kx 2023-03-24 03:55:33 +0300 53) Also **cSvn-ui** source packages are available for download on the
bfc1508d (kx 2023-03-24 03:55:33 +0300 54) [Radix.pro FTP-server](https://ftp.radix.pro/pub/csvn-ui/).
bfc1508d (kx 2023-03-24 03:55:33 +0300 55)
bfc1508d (kx 2023-03-24 03:55:33 +0300 56)
bfc1508d (kx 2023-03-24 03:55:33 +0300 57) ### Bootstrap Script
bfc1508d (kx 2023-03-24 03:55:33 +0300 58)
bfc1508d (kx 2023-03-24 03:55:33 +0300 59) The *bootstrap* script especialy created for *Autotools* install automation. To install
bfc1508d (kx 2023-03-24 03:55:33 +0300 60) *Autotools* into sourse directory on build machine (i.e. when **build** == **host**) the *bootstrap*
bfc1508d (kx 2023-03-24 03:55:33 +0300 61) script can be run without arguments.
bfc1508d (kx 2023-03-24 03:55:33 +0300 62)
bfc1508d (kx 2023-03-24 03:55:33 +0300 63) ```Bash
bfc1508d (kx 2023-03-24 03:55:33 +0300 64) ./bootstrap
bfc1508d (kx 2023-03-24 03:55:33 +0300 65) ```
bfc1508d (kx 2023-03-24 03:55:33 +0300 66)
bfc1508d (kx 2023-03-24 03:55:33 +0300 67) I this case *Autotools* will be installed from current root file system.
bfc1508d (kx 2023-03-24 03:55:33 +0300 68)
bfc1508d (kx 2023-03-24 03:55:33 +0300 69) For the cross environment the `--target-dest-dir` option allows to install some stuff from
bfc1508d (kx 2023-03-24 03:55:33 +0300 70) development root file system:
bfc1508d (kx 2023-03-24 03:55:33 +0300 71)
bfc1508d (kx 2023-03-24 03:55:33 +0300 72) ```Bash
bfc1508d (kx 2023-03-24 03:55:33 +0300 73) TARGET_DEST_DIR=/home/developer/prog/trunk-672/dist/.s9xx-glibc/enybox-x2 \
bfc1508d (kx 2023-03-24 03:55:33 +0300 74) ./bootstrap --target-dest-dir=${TARGET_DEST_DIR}
bfc1508d (kx 2023-03-24 03:55:33 +0300 75) ```
bfc1508d (kx 2023-03-24 03:55:33 +0300 76)
bfc1508d (kx 2023-03-24 03:55:33 +0300 77) For example, in this case the *aclocal.m4* script will be collected from the
bfc1508d (kx 2023-03-24 03:55:33 +0300 78) `${TARGET_DEST_DIR}/usr/share/aclocal` directory.
bfc1508d (kx 2023-03-24 03:55:33 +0300 79)
bfc1508d (kx 2023-03-24 03:55:33 +0300 80)
bfc1508d (kx 2023-03-24 03:55:33 +0300 81) ### Configuring Sources
bfc1508d (kx 2023-03-24 03:55:33 +0300 82)
bfc1508d (kx 2023-03-24 03:55:33 +0300 83) ```Bash
bfc1508d (kx 2023-03-24 03:55:33 +0300 84) ./configure --prefix=/usr \
bfc1508d (kx 2023-03-24 03:55:33 +0300 85) --with-scriptdir=/var/www/htdocs/csvn
bfc1508d (kx 2023-03-24 03:55:33 +0300 86) ```
bfc1508d (kx 2023-03-24 03:55:33 +0300 87)
bfc1508d (kx 2023-03-24 03:55:33 +0300 88)
bfc1508d (kx 2023-03-24 03:55:33 +0300 89) #### Install on the Build Machine
bfc1508d (kx 2023-03-24 03:55:33 +0300 90)
bfc1508d (kx 2023-03-24 03:55:33 +0300 91) ```Bash
bfc1508d (kx 2023-03-24 03:55:33 +0300 92) make
bfc1508d (kx 2023-03-24 03:55:33 +0300 93) make install
bfc1508d (kx 2023-03-24 03:55:33 +0300 94) ```
bfc1508d (kx 2023-03-24 03:55:33 +0300 95)
bfc1508d (kx 2023-03-24 03:55:33 +0300 96)
bfc1508d (kx 2023-03-24 03:55:33 +0300 97) #### Cross Compilation Example
bfc1508d (kx 2023-03-24 03:55:33 +0300 98)
bfc1508d (kx 2023-03-24 03:55:33 +0300 99) ```Bash
bfc1508d (kx 2023-03-24 03:55:33 +0300 100) #!/bin/sh
bfc1508d (kx 2023-03-24 03:55:33 +0300 101)
bfc1508d (kx 2023-03-24 03:55:33 +0300 102) TARGET_DEST_DIR=/home/developer/prog/trunk-672/dist/.s9xx-glibc/enybox-x2
bfc1508d (kx 2023-03-24 03:55:33 +0300 103) TOOLCHAIN_PATH=/opt/toolchains/aarch64-S9XX-linux-glibc/1.1.4/bin
bfc1508d (kx 2023-03-24 03:55:33 +0300 104) TARGET=aarch64-s9xx-linux-gnu
bfc1508d (kx 2023-03-24 03:55:33 +0300 105)
bfc1508d (kx 2023-03-24 03:55:33 +0300 106) ./bootstrap --target-dest-dir=${TARGET_DEST_DIR}
bfc1508d (kx 2023-03-24 03:55:33 +0300 107)
bfc1508d (kx 2023-03-24 03:55:33 +0300 108) PKG_CONFIG=/usr/bin/pkg-config \
bfc1508d (kx 2023-03-24 03:55:33 +0300 109) PKG_CONFIG_PATH=${TARGET_DEST_DIR}/usr/lib${LIBDIRSUFFIX}/pkgconfig:${TARGET_DEST_DIR}/usr/share/pkgconfig \
bfc1508d (kx 2023-03-24 03:55:33 +0300 110) PKG_CONFIG_LIBDIR=${TARGET_DEST_DIR}/usr/lib${LIBDIRSUFFIX}/pkgconfig:${TARGET_DEST_DIR}/usr/share/pkgconfig \
bfc1508d (kx 2023-03-24 03:55:33 +0300 111) STRIP="${TOOLCHAIN_PATH}/${TARGET}-strip" \
bfc1508d (kx 2023-03-24 03:55:33 +0300 112) CC="${TOOLCHAIN_PATH}/${TARGET}-gcc --sysroot=${TARGET_DEST_DIR}" \
bfc1508d (kx 2023-03-24 03:55:33 +0300 113) ./configure --prefix=/usr
bfc1508d (kx 2023-03-24 03:55:33 +0300 114) --build=x86_64-pc-linux-gnu \
bfc1508d (kx 2023-03-24 03:55:33 +0300 115) --host=${TARGET} \
bfc1508d (kx 2023-03-24 03:55:33 +0300 116) --with-scriptdir=/var/www/htdocs/csvn
bfc1508d (kx 2023-03-24 03:55:33 +0300 117)
bfc1508d (kx 2023-03-24 03:55:33 +0300 118) make
bfc1508d (kx 2023-03-24 03:55:33 +0300 119) make install DESTDIR=${TARGET_DEST_DIR}
bfc1508d (kx 2023-03-24 03:55:33 +0300 120) ```
bfc1508d (kx 2023-03-24 03:55:33 +0300 121)
bfc1508d (kx 2023-03-24 03:55:33 +0300 122) Also we can make use of additional variables such as `CFLAGS`, `LDFLAGS`:
bfc1508d (kx 2023-03-24 03:55:33 +0300 123)
bfc1508d (kx 2023-03-24 03:55:33 +0300 124) ```Bash
bfc1508d (kx 2023-03-24 03:55:33 +0300 125) LDFLAGS="-L${TARGET_DEST_DIR}/lib -L${TARGET_DEST_DIR}/usr/lib"
bfc1508d (kx 2023-03-24 03:55:33 +0300 126) TARGET_INCPATH="-L${TARGET_DEST_DIR}/usr/include"
bfc1508d (kx 2023-03-24 03:55:33 +0300 127) CFLAGS="${TARGET_INCPATH}"
bfc1508d (kx 2023-03-24 03:55:33 +0300 128) CPPFLAGS="${TARGET_INCPATH}"
bfc1508d (kx 2023-03-24 03:55:33 +0300 129) ```
bfc1508d (kx 2023-03-24 03:55:33 +0300 130)
bfc1508d (kx 2023-03-24 03:55:33 +0300 131)
bfc1508d (kx 2023-03-24 03:55:33 +0300 132) ### Post Install
bfc1508d (kx 2023-03-24 03:55:33 +0300 133)
bfc1508d (kx 2023-03-24 03:55:33 +0300 134) The system user, on whose behalf the **Nginx** server is launched, must have permissions to access
bfc1508d (kx 2023-03-24 03:55:33 +0300 135) the directory in which the **cSvn-ui CGI script** was installed:
bfc1508d (kx 2023-03-24 03:55:33 +0300 136)
bfc1508d (kx 2023-03-24 03:55:33 +0300 137) ```Bash
bfc1508d (kx 2023-03-24 03:55:33 +0300 138) chown -R nginx:nginx /var/www/htdocs/csvn
bfc1508d (kx 2023-03-24 03:55:33 +0300 139) ```
bfc1508d (kx 2023-03-24 03:55:33 +0300 140)
bfc1508d (kx 2023-03-24 03:55:33 +0300 141)
bfc1508d (kx 2023-03-24 03:55:33 +0300 142) ## uWsgi
bfc1508d (kx 2023-03-24 03:55:33 +0300 143)
bfc1508d (kx 2023-03-24 03:55:33 +0300 144) Since we used the *--with-scriptdir=/var/www/htdocs/csvn* option on configuring stage,
bfc1508d (kx 2023-03-24 03:55:33 +0300 145) the **cSvn-ui** CGI script installed in the */var/www/htdocs/csvn/* directory. In this case,
bfc1508d (kx 2023-03-24 03:55:33 +0300 146) the */etc/uwsgi/csvn-ui.ini* file should look like this:
bfc1508d (kx 2023-03-24 03:55:33 +0300 147)
bfc1508d (kx 2023-03-24 03:55:33 +0300 148) **/etc/uwsgi/csvn-ui.ini:**
bfc1508d (kx 2023-03-24 03:55:33 +0300 149)
bfc1508d (kx 2023-03-24 03:55:33 +0300 150) ```ini
bfc1508d (kx 2023-03-24 03:55:33 +0300 151) [uwsgi]
bfc1508d (kx 2023-03-24 03:55:33 +0300 152) master = true
bfc1508d (kx 2023-03-24 03:55:33 +0300 153) plugins = cgi
bfc1508d (kx 2023-03-24 03:55:33 +0300 154) socket = /run/uwsgi/%n.sock
bfc1508d (kx 2023-03-24 03:55:33 +0300 155) uid = nginx
bfc1508d (kx 2023-03-24 03:55:33 +0300 156) gid = nginx
bfc1508d (kx 2023-03-24 03:55:33 +0300 157) procname-master = uwsgi csvn-ui
bfc1508d (kx 2023-03-24 03:55:33 +0300 158) processes = 1
bfc1508d (kx 2023-03-24 03:55:33 +0300 159) threads = 2
bfc1508d (kx 2023-03-24 03:55:33 +0300 160) cgi = /var/www/htdocs/csvn/csvn-ui.cgi
bfc1508d (kx 2023-03-24 03:55:33 +0300 161) ```
bfc1508d (kx 2023-03-24 03:55:33 +0300 162)
bfc1508d (kx 2023-03-24 03:55:33 +0300 163) Where */var/www/htdocs/csvn/csvn-ui.cgi* is the full name of installed **cSvn-ui** CGI script.
bfc1508d (kx 2023-03-24 03:55:33 +0300 164)
bfc1508d (kx 2023-03-24 03:55:33 +0300 165) To run the **uWSGI** daemon for **cSvn-ui** backend we can make use following start/stop script:
bfc1508d (kx 2023-03-24 03:55:33 +0300 166)
bfc1508d (kx 2023-03-24 03:55:33 +0300 167) **/ets/rc.d/rc.csvn-ui-uwsgi:**
bfc1508d (kx 2023-03-24 03:55:33 +0300 168)
bfc1508d (kx 2023-03-24 03:55:33 +0300 169) ```Bash
bfc1508d (kx 2023-03-24 03:55:33 +0300 170) #!/bin/sh
bfc1508d (kx 2023-03-24 03:55:33 +0300 171) #
bfc1508d (kx 2023-03-24 03:55:33 +0300 172) # uWSGI daemon control script.
bfc1508d (kx 2023-03-24 03:55:33 +0300 173) #
bfc1508d (kx 2023-03-24 03:55:33 +0300 174)
bfc1508d (kx 2023-03-24 03:55:33 +0300 175) CONF=csvn-ui
bfc1508d (kx 2023-03-24 03:55:33 +0300 176) BIN=/usr/bin/uwsgi
bfc1508d (kx 2023-03-24 03:55:33 +0300 177) CONFDIR=/etc/uwsgi
bfc1508d (kx 2023-03-24 03:55:33 +0300 178) PID=/var/run/$CONF-uwsgi.pid
bfc1508d (kx 2023-03-24 03:55:33 +0300 179)
bfc1508d (kx 2023-03-24 03:55:33 +0300 180) uwsgi_start() {
bfc1508d (kx 2023-03-24 03:55:33 +0300 181) # Sanity checks.
bfc1508d (kx 2023-03-24 03:55:33 +0300 182) if [ ! -r $CONFDIR/csvn-ui.ini ]; then # no config files, exit:
bfc1508d (kx 2023-03-24 03:55:33 +0300 183) echo "There are config files in $CONFDIR directory. Abort."
bfc1508d (kx 2023-03-24 03:55:33 +0300 184) exit 1
bfc1508d (kx 2023-03-24 03:55:33 +0300 185) fi
bfc1508d (kx 2023-03-24 03:55:33 +0300 186)
bfc1508d (kx 2023-03-24 03:55:33 +0300 187) if [ -s $PID ]; then
bfc1508d (kx 2023-03-24 03:55:33 +0300 188) echo "uWSGI for cSvn-ui appears to already be running?"
bfc1508d (kx 2023-03-24 03:55:33 +0300 189) exit 1
bfc1508d (kx 2023-03-24 03:55:33 +0300 190) fi
bfc1508d (kx 2023-03-24 03:55:33 +0300 191)
bfc1508d (kx 2023-03-24 03:55:33 +0300 192) echo "Starting uWSGI for cSvn-ui server daemon..."
bfc1508d (kx 2023-03-24 03:55:33 +0300 193) if [ -x $BIN ]; then
bfc1508d (kx 2023-03-24 03:55:33 +0300 194) /bin/mkdir -p /run/uwsgi
bfc1508d (kx 2023-03-24 03:55:33 +0300 195) /bin/chown nginx:nginx /run/uwsgi
bfc1508d (kx 2023-03-24 03:55:33 +0300 196) /bin/chmod 0755 /run/uwsgi
bfc1508d (kx 2023-03-24 03:55:33 +0300 197) $BIN --thunder-lock --pidfile $PID --daemonize /var/log/csvn-ui-uwsgi.log --ini $CONFDIR/$CONF.ini
bfc1508d (kx 2023-03-24 03:55:33 +0300 198) fi
bfc1508d (kx 2023-03-24 03:55:33 +0300 199) }
bfc1508d (kx 2023-03-24 03:55:33 +0300 200)
bfc1508d (kx 2023-03-24 03:55:33 +0300 201) uwsgi_stop() {
bfc1508d (kx 2023-03-24 03:55:33 +0300 202) echo "Shutdown uWSGI for cSvn-ui gracefully..."
bfc1508d (kx 2023-03-24 03:55:33 +0300 203) /bin/kill -INT $(cat $PID)
bfc1508d (kx 2023-03-24 03:55:33 +0300 204) /bin/rm -f $PID
bfc1508d (kx 2023-03-24 03:55:33 +0300 205) }
bfc1508d (kx 2023-03-24 03:55:33 +0300 206)
bfc1508d (kx 2023-03-24 03:55:33 +0300 207) uwsgi_reload() {
bfc1508d (kx 2023-03-24 03:55:33 +0300 208) echo "Reloading uWSGI for cSvn-ui configuration..."
bfc1508d (kx 2023-03-24 03:55:33 +0300 209) kill -HUP $(cat $PID)
bfc1508d (kx 2023-03-24 03:55:33 +0300 210) }
bfc1508d (kx 2023-03-24 03:55:33 +0300 211)
bfc1508d (kx 2023-03-24 03:55:33 +0300 212) uwsgi_restart() {
bfc1508d (kx 2023-03-24 03:55:33 +0300 213) uwsgi_stop
bfc1508d (kx 2023-03-24 03:55:33 +0300 214) sleep 3
bfc1508d (kx 2023-03-24 03:55:33 +0300 215) uwsgi_start
bfc1508d (kx 2023-03-24 03:55:33 +0300 216) }
bfc1508d (kx 2023-03-24 03:55:33 +0300 217)
bfc1508d (kx 2023-03-24 03:55:33 +0300 218) case "$1" in
bfc1508d (kx 2023-03-24 03:55:33 +0300 219) start)
bfc1508d (kx 2023-03-24 03:55:33 +0300 220) uwsgi_start
bfc1508d (kx 2023-03-24 03:55:33 +0300 221) ;;
bfc1508d (kx 2023-03-24 03:55:33 +0300 222) stop)
bfc1508d (kx 2023-03-24 03:55:33 +0300 223) uwsgi_stop
bfc1508d (kx 2023-03-24 03:55:33 +0300 224) ;;
bfc1508d (kx 2023-03-24 03:55:33 +0300 225) reload)
bfc1508d (kx 2023-03-24 03:55:33 +0300 226) uwsgi_reload
bfc1508d (kx 2023-03-24 03:55:33 +0300 227) ;;
bfc1508d (kx 2023-03-24 03:55:33 +0300 228) restart)
bfc1508d (kx 2023-03-24 03:55:33 +0300 229) uwsgi_restart
bfc1508d (kx 2023-03-24 03:55:33 +0300 230) ;;
bfc1508d (kx 2023-03-24 03:55:33 +0300 231) *)
bfc1508d (kx 2023-03-24 03:55:33 +0300 232) echo "usage: `basename $0` {start|stop|reload|restart}"
bfc1508d (kx 2023-03-24 03:55:33 +0300 233) esac
bfc1508d (kx 2023-03-24 03:55:33 +0300 234) ```
bfc1508d (kx 2023-03-24 03:55:33 +0300 235)
bfc1508d (kx 2023-03-24 03:55:33 +0300 236) To run this daemon on systems with BSD-like initialization such as **Slackware**
bfc1508d (kx 2023-03-24 03:55:33 +0300 237) we have to add following lines to the */etc/rc.d/rc.M* and */etc/rc.d/rc.6* scripts
bfc1508d (kx 2023-03-24 03:55:33 +0300 238) correspondingly.
bfc1508d (kx 2023-03-24 03:55:33 +0300 239)
bfc1508d (kx 2023-03-24 03:55:33 +0300 240) **/etc/rc.d/rc.M:**
bfc1508d (kx 2023-03-24 03:55:33 +0300 241)
bfc1508d (kx 2023-03-24 03:55:33 +0300 242) ```Bash
bfc1508d (kx 2023-03-24 03:55:33 +0300 243) # Start uWSGI for cSvn-ui server:
bfc1508d (kx 2023-03-24 03:55:33 +0300 244) if [ -x /etc/rc.d/rc.csvn-ui-uwsgi ]; then
bfc1508d (kx 2023-03-24 03:55:33 +0300 245) /etc/rc.d/rc.csvn-ui-uwsgi start
bfc1508d (kx 2023-03-24 03:55:33 +0300 246) fi
bfc1508d (kx 2023-03-24 03:55:33 +0300 247) ```
bfc1508d (kx 2023-03-24 03:55:33 +0300 248)
bfc1508d (kx 2023-03-24 03:55:33 +0300 249) **/etc/rc.d/rc.6:**
bfc1508d (kx 2023-03-24 03:55:33 +0300 250)
bfc1508d (kx 2023-03-24 03:55:33 +0300 251) ```Bash
bfc1508d (kx 2023-03-24 03:55:33 +0300 252) # Stop uWSGI for cSvn-ui server:
bfc1508d (kx 2023-03-24 03:55:33 +0300 253) if [ -x /etc/rc.d/rc.csvn-ui-uwsgi ]; then
bfc1508d (kx 2023-03-24 03:55:33 +0300 254) /etc/rc.d/rc.csvn-ui-uwsgi stop
bfc1508d (kx 2023-03-24 03:55:33 +0300 255) fi
bfc1508d (kx 2023-03-24 03:55:33 +0300 256) ```
bfc1508d (kx 2023-03-24 03:55:33 +0300 257)
bfc1508d (kx 2023-03-24 03:55:33 +0300 258)
bfc1508d (kx 2023-03-24 03:55:33 +0300 259) ## Nginx
bfc1508d (kx 2023-03-24 03:55:33 +0300 260)
bfc1508d (kx 2023-03-24 03:55:33 +0300 261) First of all we have to add virtual server to the main **Nginx** config file:
bfc1508d (kx 2023-03-24 03:55:33 +0300 262)
bfc1508d (kx 2023-03-24 03:55:33 +0300 263) **/etc/nginx/nginx.conf:**
bfc1508d (kx 2023-03-24 03:55:33 +0300 264)
bfc1508d (kx 2023-03-24 03:55:33 +0300 265) ```Nginx
bfc1508d (kx 2023-03-24 03:55:33 +0300 266) include /etc/nginx/vhosts/csvn.example.org.conf;
bfc1508d (kx 2023-03-24 03:55:33 +0300 267) ```
bfc1508d (kx 2023-03-24 03:55:33 +0300 268)
bfc1508d (kx 2023-03-24 03:55:33 +0300 269) The following configuration used **uWsgi** and will serve **cSvn-ui** on a subdomain
bfc1508d (kx 2023-03-24 03:55:33 +0300 270) like *csvn.example.org*:
bfc1508d (kx 2023-03-24 03:55:33 +0300 271)
bfc1508d (kx 2023-03-24 03:55:33 +0300 272) **/etc/nginx/vhosts/csvn.example.org.conf:**
bfc1508d (kx 2023-03-24 03:55:33 +0300 273)
bfc1508d (kx 2023-03-24 03:55:33 +0300 274) ```Nginx
bfc1508d (kx 2023-03-24 03:55:33 +0300 275) #
bfc1508d (kx 2023-03-24 03:55:33 +0300 276) # cSvn server:
bfc1508d (kx 2023-03-24 03:55:33 +0300 277) #
bfc1508d (kx 2023-03-24 03:55:33 +0300 278)
bfc1508d (kx 2023-03-24 03:55:33 +0300 279) server {
bfc1508d (kx 2023-03-24 03:55:33 +0300 280) listen 80;
bfc1508d (kx 2023-03-24 03:55:33 +0300 281) server_name csvn.example.org;
bfc1508d (kx 2023-03-24 03:55:33 +0300 282) return 301 https://csvn.example.org$request_uri;
bfc1508d (kx 2023-03-24 03:55:33 +0300 283) }
bfc1508d (kx 2023-03-24 03:55:33 +0300 284)
bfc1508d (kx 2023-03-24 03:55:33 +0300 285) server {
bfc1508d (kx 2023-03-24 03:55:33 +0300 286) listen 443 ssl;
bfc1508d (kx 2023-03-24 03:55:33 +0300 287) server_name csvn.example.org;
bfc1508d (kx 2023-03-24 03:55:33 +0300 288) root /var/www/htdocs/csvn;
bfc1508d (kx 2023-03-24 03:55:33 +0300 289)
bfc1508d (kx 2023-03-24 03:55:33 +0300 290) charset UTF-8;
bfc1508d (kx 2023-03-24 03:55:33 +0300 291)
bfc1508d (kx 2023-03-24 03:55:33 +0300 292) #
bfc1508d (kx 2023-03-24 03:55:33 +0300 293) # see:
bfc1508d (kx 2023-03-24 03:55:33 +0300 294) # https://developer.mozilla.org/en-US/docs/Web/Security/HTTP_strict_transport_security ,
bfc1508d (kx 2023-03-24 03:55:33 +0300 295) # https://raymii.org/s/tutorials/HTTP_Strict_Transport_Security_for_Apache_NGINX_and_Lighttpd.html
bfc1508d (kx 2023-03-24 03:55:33 +0300 296) #
bfc1508d (kx 2023-03-24 03:55:33 +0300 297) # see also: http://classically.me/blogs/how-clear-hsts-settings-major-browsers
bfc1508d (kx 2023-03-24 03:55:33 +0300 298) # and do not include includeSubdomains; parameter into line:
bfc1508d (kx 2023-03-24 03:55:33 +0300 299) #
bfc1508d (kx 2023-03-24 03:55:33 +0300 300) add_header Strict-Transport-Security "max-age=63072000; preload";
bfc1508d (kx 2023-03-24 03:55:33 +0300 301)
bfc1508d (kx 2023-03-24 03:55:33 +0300 302) error_log /var/log/nginx/csvn.example.org-error.log;
bfc1508d (kx 2023-03-24 03:55:33 +0300 303) access_log /var/log/nginx/csvn.example.org-access.log;
bfc1508d (kx 2023-03-24 03:55:33 +0300 304)
bfc1508d (kx 2023-03-24 03:55:33 +0300 305) keepalive_timeout 60;
bfc1508d (kx 2023-03-24 03:55:33 +0300 306) ssl_certificate /etc/letsencrypt/live/csvn.example.org/fullchain.pem;
bfc1508d (kx 2023-03-24 03:55:33 +0300 307) ssl_certificate_key /etc/letsencrypt/live/csvn.example.org/privkey.pem;
bfc1508d (kx 2023-03-24 03:55:33 +0300 308) ssl_trusted_certificate /etc/letsencrypt/live/csvn.example.org/chain.pem;
bfc1508d (kx 2023-03-24 03:55:33 +0300 309) ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
bfc1508d (kx 2023-03-24 03:55:33 +0300 310) ssl_ciphers "RC4:HIGH:!aNULL:!MD5:!kEDH";
bfc1508d (kx 2023-03-24 03:55:33 +0300 311)
bfc1508d (kx 2023-03-24 03:55:33 +0300 312) gzip on;
bfc1508d (kx 2023-03-24 03:55:33 +0300 313) gzip_disable "msie6";
bfc1508d (kx 2023-03-24 03:55:33 +0300 314) gzip_comp_level 6;
bfc1508d (kx 2023-03-24 03:55:33 +0300 315) gzip_min_length 1100;
bfc1508d (kx 2023-03-24 03:55:33 +0300 316) gzip_buffers 16 8k;
bfc1508d (kx 2023-03-24 03:55:33 +0300 317) gzip_proxied any;
bfc1508d (kx 2023-03-24 03:55:33 +0300 318) gzip_types text/plain text/css text/js text/xml text/javascript
bfc1508d (kx 2023-03-24 03:55:33 +0300 319) image/svg+xml image/gif image/jpeg image/png
bfc1508d (kx 2023-03-24 03:55:33 +0300 320) application/json application/x-javascript application/xml application/xml+rss application/javascript
bfc1508d (kx 2023-03-24 03:55:33 +0300 321) font/truetype font/opentype application/font-woff application/font-woff2
bfc1508d (kx 2023-03-24 03:55:33 +0300 322) application/x-font-ttf application/x-font-opentype application/vnd.ms-fontobject application/font-sfnt;
bfc1508d (kx 2023-03-24 03:55:33 +0300 323)
bfc1508d (kx 2023-03-24 03:55:33 +0300 324)
bfc1508d (kx 2023-03-24 03:55:33 +0300 325) location ~* ^.+(favicon.ico|robots.txt) {
bfc1508d (kx 2023-03-24 03:55:33 +0300 326) root /var/www/htdocs/csvn;
bfc1508d (kx 2023-03-24 03:55:33 +0300 327) expires 30d;
bfc1508d (kx 2023-03-24 03:55:33 +0300 328) }
bfc1508d (kx 2023-03-24 03:55:33 +0300 329)
bfc1508d (kx 2023-03-24 03:55:33 +0300 330) location = /robots.txt {
bfc1508d (kx 2023-03-24 03:55:33 +0300 331) allow all;
bfc1508d (kx 2023-03-24 03:55:33 +0300 332) log_not_found off;
bfc1508d (kx 2023-03-24 03:55:33 +0300 333) access_log off;
bfc1508d (kx 2023-03-24 03:55:33 +0300 334) }
bfc1508d (kx 2023-03-24 03:55:33 +0300 335)
bfc1508d (kx 2023-03-24 03:55:33 +0300 336) location / {
bfc1508d (kx 2023-03-24 03:55:33 +0300 337) try_files $uri @csvn-ui;
bfc1508d (kx 2023-03-24 03:55:33 +0300 338) }
bfc1508d (kx 2023-03-24 03:55:33 +0300 339)
bfc1508d (kx 2023-03-24 03:55:33 +0300 340) location @csvn-ui {
bfc1508d (kx 2023-03-24 03:55:33 +0300 341) gzip off;
bfc1508d (kx 2023-03-24 03:55:33 +0300 342) include uwsgi_params;
bfc1508d (kx 2023-03-24 03:55:33 +0300 343) uwsgi_modifier1 9;
bfc1508d (kx 2023-03-24 03:55:33 +0300 344) uwsgi_pass unix:/run/uwsgi/csvn-ui.sock;
bfc1508d (kx 2023-03-24 03:55:33 +0300 345) }
bfc1508d (kx 2023-03-24 03:55:33 +0300 346) }
bfc1508d (kx 2023-03-24 03:55:33 +0300 347) ```
bfc1508d (kx 2023-03-24 03:55:33 +0300 348)
bfc1508d (kx 2023-03-24 03:55:33 +0300 349)
bfc1508d (kx 2023-03-24 03:55:33 +0300 350) ## Configuring SVN Repositories
bfc1508d (kx 2023-03-24 03:55:33 +0300 351)
bfc1508d (kx 2023-03-24 03:55:33 +0300 352) A detailed description of the configuration file format can be found in the
bfc1508d (kx 2023-03-24 03:55:33 +0300 353) [**csvn-ui.rc(5)**](https://csvn.radix.pro/csvn-ui/trunk/doc/csvn-ui.rc.5.md) manual page:
bfc1508d (kx 2023-03-24 03:55:33 +0300 354)
bfc1508d (kx 2023-03-24 03:55:33 +0300 355) ```Bash
bfc1508d (kx 2023-03-24 03:55:33 +0300 356) man 5 csvn-ui.rc
bfc1508d (kx 2023-03-24 03:55:33 +0300 357) ```
bfc1508d (kx 2023-03-24 03:55:33 +0300 358)
bfc1508d (kx 2023-03-24 03:55:33 +0300 359) Here we will give an example of a description of the
bfc1508d (kx 2023-03-24 03:55:33 +0300 360) [Apache Subversion repository](https://svn.apache.org/viewvc/subversion/trunk/).
bfc1508d (kx 2023-03-24 03:55:33 +0300 361) Please note that the Apache server responds very slowly to HTTP requests.
bfc1508d (kx 2023-03-24 03:55:33 +0300 362)
bfc1508d (kx 2023-03-24 03:55:33 +0300 363) ```dts
bfc1508d (kx 2023-03-24 03:55:33 +0300 364) /**************************
bfc1508d (kx 2023-03-24 03:55:33 +0300 365) Apache's SVN repository:
bfc1508d (kx 2023-03-24 03:55:33 +0300 366) */
bfc1508d (kx 2023-03-24 03:55:33 +0300 367) home-page = "https://svn.apache.org/";
bfc1508d (kx 2023-03-24 03:55:33 +0300 368)
bfc1508d (kx 2023-03-24 03:55:33 +0300 369) section "Subversion" {
bfc1508d (kx 2023-03-24 03:55:33 +0300 370) repo 'subversion' {
bfc1508d (kx 2023-03-24 03:55:33 +0300 371) owner = "Apache";
bfc1508d (kx 2023-03-24 03:55:33 +0300 372) description = "Source repository of the Subversion.";
bfc1508d (kx 2023-03-24 03:55:33 +0300 373) checkout-prefix-readonly = 'https://svn.apache.org/repos/asf';
bfc1508d (kx 2023-03-24 03:55:33 +0300 374) }
bfc1508d (kx 2023-03-24 03:55:33 +0300 375) }
bfc1508d (kx 2023-03-24 03:55:33 +0300 376) ```
bfc1508d (kx 2023-03-24 03:55:33 +0300 377)
bfc1508d (kx 2023-03-24 03:55:33 +0300 378) To access your own repositories, we recommend the **svn+ssh** protocol.
bfc1508d (kx 2023-03-24 03:55:33 +0300 379)
bfc1508d (kx 2023-03-24 03:55:33 +0300 380)
bfc1508d (kx 2023-03-24 03:55:33 +0300 381) ## See Also
bfc1508d (kx 2023-03-24 03:55:33 +0300 382)
bfc1508d (kx 2023-03-24 03:55:33 +0300 383) > [**cscmd(8)**](https://csvn.radix.pro/cscm/trunk/doc/cscmd.8.md),
bfc1508d (kx 2023-03-24 03:55:33 +0300 384) > [**csvn-ui.rc(5)**](https://csvn.radix.pro/csvn-ui/trunk/doc/csvn-ui.rc.5.md)
bfc1508d (kx 2023-03-24 03:55:33 +0300 385)
bfc1508d (kx 2023-03-24 03:55:33 +0300 386)
bfc1508d (kx 2023-03-24 03:55:33 +0300 387) ## Copyright and License
bfc1508d (kx 2023-03-24 03:55:33 +0300 388)
bfc1508d (kx 2023-03-24 03:55:33 +0300 389) © Andrey V. Kosteltsev, 2019 – 2020.<br/>
bfc1508d (kx 2023-03-24 03:55:33 +0300 390) Code and documentation released under [the **Radix.pro** License](https://csvn.radix.pro/csvn-ui/trunk/LICENSE).