##// END OF EJS Templates
svn: added svn setup instructions link into the proxy host form.
svn: added svn setup instructions link into the proxy host form.

File last commit:

r1109:3aef7260 default
r1117:92446807 default
Show More
vcs-server.rst
431 lines | 13.0 KiB | text/x-rst | RstLexer

VCS Server Management

The VCS Server handles |RCM| backend functionality. You need to configure a VCS Server to run with a |RCM| instance. If you do not, you will be missing the connection between |RCM| and its |repos|. This will cause error messages on the web interface. You can run your setup in the following configurations, currently the best performance is one VCS Server per |RCM| instance:

  • One VCS Server per |RCM| instance.
  • One VCS Server handling multiple instances.

Important

If your server locale settings are not correctly configured, |RCE| and the VCS Server can run into issues. See this Ask Ubuntu post which explains the problem and gives a solution.

For more information, see the following sections:

  • :ref:`install-vcs`
  • :ref:`config-vcs`
  • :ref:`vcs-server-options`
  • :ref:`vcs-server-versions`
  • :ref:`vcs-server-maintain`
  • :ref:`vcs-server-config-file`
  • :ref:`svn-http`

VCS Server Installation

To install a VCS Server, see :ref:`Installing a VCS server <control:install-vcsserver>`.

Hooking |RCE| to its VCS Server

To configure a |RCE| instance to use a VCS server, see :ref:`Configuring the VCS Server connection <control:manually-vcsserver-ini>`.

|RCE| VCS Server Options

The following list shows the available options on the |RCM| side of the connection to the VCS Server. The settings are configured per instance in the :file:`/home/{user}/.rccontrol/{instance-id}/rhodecode.ini` file.

##################
### VCS CONFIG ###
##################
# set this line to match your VCS Server
vcs.server = 127.0.0.1:10004
# Set to False to disable the VCS Server
vcs.server.enable = True
vcs.backends = hg, git, svn
vcs.connection_timeout = 3600

VCS Server Versions

An updated version of the VCS Server is released with each |RCE| version. Use the VCS Server number that matches with the |RCE| version to pair the appropriate ones together. For |RCE| versions pre 3.3.0, VCS Server 1.X.Y works with |RCE| 3.X.Y, for example:

  • VCS Server 1.0.0 works with |RCE| 3.0.0
  • VCS Server 1.2.2 works with |RCE| 3.2.2

For |RCE| versions post 3.3.0, the VCS Server and |RCE| version numbers match, for example:

  • VCS Server |release| works with |RCE| |release|

VCS Server Memory Optimization

To configure the VCS server to manage the cache efficiently, you need to configure the following options in the :file:`/home/{user}/.rccontrol/{vcsserver-id}/vcsserver.ini` file. Once configured, restart the VCS Server.

To clear the cache completely, you can restart the VCS Server.

Important

While the VCS Server handles a restart gracefully on the web interface, it will drop connections during push/pull requests. So it is recommended you only perform this when there is very little traffic on the instance.

Use the following example to restart your VCS Server, for full details see the :ref:`RhodeCode Control CLI <control:rcc-cli>`.

$ rccontrol status
- NAME: vcsserver-1
- STATUS: RUNNING
- TYPE: VCSServer
- VERSION: 1.0.0
- URL: http://127.0.0.1:10001

$ rccontrol restart vcsserver-1
Instance "vcsserver-1" successfully stopped.
Instance "vcsserver-1" successfully started.

VCS Server Configuration

You can configure settings for multiple VCS Servers on your system using their individual configuration files. Use the following properties inside the configuration file to set up your system. The default location is :file:`home/{user}/.rccontrol/{vcsserver-id}/vcsserver.ini`. For a more detailed explanation of the logger levers, see :ref:`debug-mode`.

Note

After making changes, you need to restart your VCS Server to pick them up.

################################################################################
# RhodeCode VCSServer - configuration                                          #
#                                                                              #
################################################################################

[DEFAULT]
host = 127.0.0.1
port = 9900
locale = en_US.UTF-8
# number of worker threads, this should be set based on a formula threadpool=N*6
# where N is number of RhodeCode Enterprise workers, eg. running 2 instances
# 8 gunicorn workers each would be 2 * 8 * 6 = 96, threadpool_size = 96
threadpool_size = 16
timeout = 0

# cache regions, please don't change
beaker.cache.regions = repo_object
beaker.cache.repo_object.type = memorylru
beaker.cache.repo_object.max_items = 1000

# cache auto-expires after N seconds
beaker.cache.repo_object.expire = 10
beaker.cache.repo_object.enabled = true


################################
### LOGGING CONFIGURATION   ####
################################
[loggers]
keys = root, vcsserver, pyro4, beaker

[handlers]
keys = console

[formatters]
keys = generic

#############
## LOGGERS ##
#############
[logger_root]
level = NOTSET
handlers = console

[logger_vcsserver]
level = DEBUG
handlers =
qualname = vcsserver
propagate = 1

[logger_beaker]
level = DEBUG
handlers =
qualname = beaker
propagate = 1

[logger_pyro4]
level = DEBUG
handlers =
qualname = Pyro4
propagate = 1


##############
## HANDLERS ##
##############

[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = DEBUG
formatter = generic

[handler_file]
class = FileHandler
args = ('vcsserver.log', 'a',)
level = DEBUG
formatter = generic

[handler_file_rotating]
class = logging.handlers.TimedRotatingFileHandler
# 'D', 5 - rotate every 5days
# you can set 'h', 'midnight'
args = ('vcsserver.log', 'D', 5, 10,)
level = DEBUG
formatter = generic

################
## FORMATTERS ##
################

[formatter_generic]
format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
datefmt = %Y-%m-%d %H:%M:%S

|svn| With Write Over HTTP

To use |svn| with read/write support over the |svn| HTTP protocol, you have to configure the HTTP |svn| backend.

Prerequisites

  • Enable HTTP support inside the admin VCS settings on your |RCE| instance
  • You need to install the following tools on the machine that is running an instance of |RCE|: Apache HTTP Server and mod_dav_svn.

Using Ubuntu Distribution as an example you can run:

$ sudo apt-get install apache2 libapache2-mod-svn

Once installed you need to enable dav_svn:

$ sudo a2enmod dav_svn
$ sudo a2enmod headers

Configuring Apache Setup

Tip

It is recommended to run Apache on a port other than 80, due to possible conflicts with other HTTP servers like nginx. To do this, set the Listen parameter in the /etc/apache2/ports.conf file, for example Listen 8090.

Warning

Make sure your Apache instance which runs the mod_dav_svn module is only accessible by RhodeCode. Otherwise everyone is able to browse the repositories or run subversion operations (checkout/commit/etc.).

It is also recommended to run apache as the same user as |RCE|, otherwise permission issues could occur. To do this edit the /etc/apache2/envvars

export APACHE_RUN_USER=rhodecode
export APACHE_RUN_GROUP=rhodecode
  1. To configure Apache, create and edit a virtual hosts file, for example :file:`/etc/apache2/sites-available/default.conf`. Below is an example how to use one with auto-generated config `mod_dav_svn.conf` from configured |RCE| instance.
<VirtualHost *:8080>
    ServerAdmin rhodecode-admin@localhost
    DocumentRoot /var/www/html
    ErrorLog ${'${APACHE_LOG_DIR}'}/error.log
    CustomLog ${'${APACHE_LOG_DIR}'}/access.log combined
    Include /home/user/.rccontrol/enterprise-1/mod_dav_svn.conf
</VirtualHost>
  1. Go to the :menuselection:`Admin --> Settings --> VCS` page, and enable :guilabel:`Proxy Subversion HTTP requests`, and specify the :guilabel:`Subversion HTTP Server URL`.

  2. Open the |RCE| configuration file, :file:`/home/{user}/.rccontrol/{instance-id}/rhodecode.ini`

  3. Add the following configuration option in the [app:main] section if you don't have it yet.

    This enables mapping of the created |RCE| repo groups into special |svn| paths. Each time a new repository group is created, the system will update the template file and create new mapping. Apache web server needs to be reloaded to pick up the changes on this file. It's recommended to add reload into a crontab so the changes can be picked automatically once someone creates a repository group inside RhodeCode.

##############################################
### Subversion proxy support (mod_dav_svn) ###
##############################################
## Enable or disable the config file generation.
svn.proxy.generate_config = true
## Generate config file with `SVNListParentPath` set to `On`.
svn.proxy.list_parent_path = true
## Set location and file name of generated config file.
svn.proxy.config_file_path = %(here)s/mod_dav_svn.conf
## File system path to the directory containing the repositories served by
## RhodeCode.
svn.proxy.parent_path_root = /path/to/repo_store
## Used as a prefix to the <Location> block in the generated config file. In
## most cases it should be set to `/`.
svn.proxy.location_root = /

This would create a special template file called `mod_dav_svn.conf`. We used that file path in the apache config above inside the Include statement.

Using |svn|

Once |svn| has been enabled on your instance, you can use it with the following examples. For more |svn| information, see the Subversion Red Book

# To clone a repository
svn checkout http://my-svn-server.example.com/my-svn-repo

# svn commit
svn commit