##// END OF EJS Templates
docs: moving svn http docs to vcs server management
lisaq -
r759:4e97ef26 default
parent child Browse files
Show More
@@ -1,41 +1,31 b''
1 1 .. _lab-settings:
2 2
3 3 Lab Settings
4 4 ============
5 5
6 6 |RCE| Lab Settings is for delivering features which may require an additional
7 7 level of support to optimize for production scenarios. To enable lab settings,
8 8 use the following instructions:
9 9
10 10 1. Open the |RCE| configuration file,
11 11 :file:`/home/{user}/.rccontrol/{instance-id}/rhodecode.ini`
12 12
13 13 2. Add the following configuration option in the ``[app:main]`` section.
14 14
15 15 .. code-block:: bash
16 16
17 17 [app:main]
18 18
19 19 ## Display extended labs settings
20 20 labs_settings_active = true
21 21
22 22 3. Restart your |RCE| instance
23 23
24 24 .. code-block:: bash
25 25
26 26 $ rccontrol restart enterprise-1
27 27
28 28 4. You will see the labs setting on the
29 29 :menuselection:`Admin --> Settings --> labs` page.
30 30
31 31 .. image:: ../images/lab-setting.png
32
33 Available Lab Extras
34 --------------------
35
36 Once lab settings are enabled, the following features are available.
37
38 .. toctree::
39 :maxdepth: 1
40
41 svn-http
@@ -1,301 +1,430 b''
1 1 .. _vcs-server:
2 2
3 3 VCS Server Management
4 4 ---------------------
5 5
6 6 The VCS Server handles |RCM| backend functionality. You need to configure
7 7 a VCS Server to run with a |RCM| instance. If you do not, you will be missing
8 8 the connection between |RCM| and its |repos|. This will cause error messages
9 9 on the web interface. You can run your setup in the following configurations,
10 10 currently the best performance is one VCS Server per |RCM| instance:
11 11
12 12 * One VCS Server per |RCM| instance.
13 13 * One VCS Server handling multiple instances.
14 14
15 15 .. important::
16 16
17 17 If your server locale settings are not correctly configured,
18 18 |RCE| and the VCS Server can run into issues. See this `Ask Ubuntu`_ post
19 19 which explains the problem and gives a solution.
20 20
21 21 For more information, see the following sections:
22 22
23 23 * :ref:`install-vcs`
24 24 * :ref:`config-vcs`
25 25 * :ref:`vcs-server-options`
26 26 * :ref:`vcs-server-versions`
27 27 * :ref:`vcs-server-maintain`
28 28 * :ref:`vcs-server-config-file`
29 * :ref:`svn-http`
29 30
30 31 .. _install-vcs:
31 32
32 33 VCS Server Installation
33 34 ^^^^^^^^^^^^^^^^^^^^^^^
34 35
35 36 To install a VCS Server, see
36 37 :ref:`Installing a VCS server <control:install-vcsserver>`.
37 38
38 39 .. _config-vcs:
39 40
40 41 Hooking |RCE| to its VCS Server
41 42 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
42 43
43 44 To configure a |RCE| instance to use a VCS server, see
44 45 :ref:`Configuring the VCS Server connection <control:manually-vcsserver-ini>`.
45 46
46 47 .. _vcs-server-options:
47 48
48 49 |RCE| VCS Server Options
49 50 ^^^^^^^^^^^^^^^^^^^^^^^^
50 51
51 52 The following list shows the available options on the |RCM| side of the
52 53 connection to the VCS Server. The settings are configured per
53 54 instance in the
54 55 :file:`/home/{user}/.rccontrol/{instance-id}/rhodecode.ini` file.
55 56
56 57 .. rst-class:: dl-horizontal
57 58
58 59 \vcs.backends <available-vcs-systems>
59 60 Set a comma-separated list of the |repo| options available from the
60 61 web interface. The default is ``hg, git, svn``,
61 62 which is all |repo| types available.
62 63
63 64 \vcs.connection_timeout <seconds>
64 65 Set the length of time in seconds that the VCS Server waits for
65 66 requests to process. After the timeout expires,
66 67 the request is closed. The default is ``3600``. Set to a higher
67 68 number if you experience network latency, or timeout issues with very
68 69 large push/pull requests.
69 70
70 71 \vcs.server.enable <boolean>
71 72 Enable or disable the VCS Server. The available options are ``true`` or
72 73 ``false``. The default is ``true``.
73 74
74 75 \vcs.server <host:port>
75 76 Set the host, either hostname or IP Address, and port of the VCS server
76 77 you wish to run with your |RCM| instance.
77 78
78 79 .. code-block:: ini
79 80
80 81 ##################
81 82 ### VCS CONFIG ###
82 83 ##################
83 84 # set this line to match your VCS Server
84 85 vcs.server = 127.0.0.1:10004
85 86 # Set to False to disable the VCS Server
86 87 vcs.server.enable = True
87 88 vcs.backends = hg, git, svn
88 89 vcs.connection_timeout = 3600
89 90
90 91
91 92 .. _vcs-server-versions:
92 93
93 94 VCS Server Versions
94 95 ^^^^^^^^^^^^^^^^^^^
95 96
96 97 An updated version of the VCS Server is released with each |RCE| version. Use
97 98 the VCS Server number that matches with the |RCE| version to pair the
98 99 appropriate ones together. For |RCE| versions pre 3.3.0,
99 100 VCS Server 1.X.Y works with |RCE| 3.X.Y, for example:
100 101
101 102 * VCS Server 1.0.0 works with |RCE| 3.0.0
102 103 * VCS Server 1.2.2 works with |RCE| 3.2.2
103 104
104 105 For |RCE| versions post 3.3.0, the VCS Server and |RCE| version numbers
105 106 match, for example:
106 107
107 108 * VCS Server |release| works with |RCE| |release|
108 109
109 110 .. _vcs-server-maintain:
110 111
111 112 VCS Server Memory Optimization
112 113 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
113 114
114 115 To configure the VCS server to manage the cache efficiently, you need to
115 116 configure the following options in the
116 117 :file:`/home/{user}/.rccontrol/{vcsserver-id}/vcsserver.ini` file. Once
117 118 configured, restart the VCS Server.
118 119
119 120 .. rst-class:: dl-horizontal
120 121
121 122 \beaker.cache.repo_object.type = memorylru
122 123 Configures the cache to discard the least recently used items.
123 124 This setting takes the following valid options:
124 125
125 126 * ``memorylru``: The default setting, which removes the least recently
126 127 used items from the cache.
127 128 * ``memory``: Runs the VCS Server without clearing the cache.
128 129 * ``nocache``: Runs the VCS Server without a cache. This will
129 130 dramatically reduce the VCS Server performance.
130 131
131 132 \beaker.cache.repo_object.max_items = 100
132 133 Sets the maximum number of items stored in the cache, before the cache
133 134 starts to be cleared.
134 135
135 136 As a general rule of thumb, running this value at 120 resulted in a
136 137 5GB cache. Running it at 240 resulted in a 9GB cache. Your results
137 138 will differ based on usage patterns and |repo| sizes.
138 139
139 140 Tweaking this value to run at a fairly constant memory load on your
140 141 server will help performance.
141 142
142 143 To clear the cache completely, you can restart the VCS Server.
143 144
144 145 .. important::
145 146
146 147 While the VCS Server handles a restart gracefully on the web interface,
147 148 it will drop connections during push/pull requests. So it is recommended
148 149 you only perform this when there is very little traffic on the instance.
149 150
150 151 Use the following example to restart your VCS Server,
151 152 for full details see the :ref:`RhodeCode Control CLI <control:rcc-cli>`.
152 153
153 154 .. code-block:: bash
154 155
155 156 $ rccontrol status
156 157
157 158 .. code-block:: vim
158 159
159 160 - NAME: vcsserver-1
160 161 - STATUS: RUNNING
161 162 - TYPE: VCSServer
162 163 - VERSION: 1.0.0
163 164 - URL: http://127.0.0.1:10001
164 165
165 166 $ rccontrol restart vcsserver-1
166 167 Instance "vcsserver-1" successfully stopped.
167 168 Instance "vcsserver-1" successfully started.
168 169
169 170 .. _vcs-server-config-file:
170 171
171 172 VCS Server Configuration
172 173 ^^^^^^^^^^^^^^^^^^^^^^^^
173 174
174 175 You can configure settings for multiple VCS Servers on your
175 176 system using their individual configuration files. Use the following
176 177 properties inside the configuration file to set up your system. The default
177 178 location is :file:`home/{user}/.rccontrol/{vcsserver-id}/vcsserver.ini`.
178 179 For a more detailed explanation of the logger levers, see :ref:`debug-mode`.
179 180
180 181 .. rst-class:: dl-horizontal
181 182
182 183 \host <ip-address>
183 184 Set the host on which the VCS Server will run.
184 185
185 186 \port <int>
186 187 Set the port number on which the VCS Server will be available.
187 188
188 189 \locale <locale_utf>
189 190 Set the locale the VCS Server expects.
190 191
191 192 \threadpool_size <int>
192 193 Set the size of the threadpool used to communicate
193 194 with the WSGI workers. This should be at least 6 times the number of
194 195 WSGI worker processes.
195 196
196 197 \timeout <seconds>
197 198 Set the timeout for RPC communication in seconds.
198 199
199 200 .. note::
200 201
201 202 After making changes, you need to restart your VCS Server to pick them up.
202 203
203 204 .. code-block:: ini
204 205
205 206 ################################################################################
206 207 # RhodeCode VCSServer - configuration #
207 208 # #
208 209 ################################################################################
209 210
210 211 [DEFAULT]
211 212 host = 127.0.0.1
212 213 port = 9900
213 214 locale = en_US.UTF-8
214 215 # number of worker threads, this should be set based on a formula threadpool=N*6
215 216 # where N is number of RhodeCode Enterprise workers, eg. running 2 instances
216 217 # 8 gunicorn workers each would be 2 * 8 * 6 = 96, threadpool_size = 96
217 218 threadpool_size = 16
218 219 timeout = 0
219 220
220 221 # cache regions, please don't change
221 222 beaker.cache.regions = repo_object
222 223 beaker.cache.repo_object.type = memorylru
223 224 beaker.cache.repo_object.max_items = 1000
224 225
225 226 # cache auto-expires after N seconds
226 227 beaker.cache.repo_object.expire = 10
227 228 beaker.cache.repo_object.enabled = true
228 229
229 230
230 231 ################################
231 232 ### LOGGING CONFIGURATION ####
232 233 ################################
233 234 [loggers]
234 235 keys = root, vcsserver, pyro4, beaker
235 236
236 237 [handlers]
237 238 keys = console
238 239
239 240 [formatters]
240 241 keys = generic
241 242
242 243 #############
243 244 ## LOGGERS ##
244 245 #############
245 246 [logger_root]
246 247 level = NOTSET
247 248 handlers = console
248 249
249 250 [logger_vcsserver]
250 251 level = DEBUG
251 252 handlers =
252 253 qualname = vcsserver
253 254 propagate = 1
254 255
255 256 [logger_beaker]
256 257 level = DEBUG
257 258 handlers =
258 259 qualname = beaker
259 260 propagate = 1
260 261
261 262 [logger_pyro4]
262 263 level = DEBUG
263 264 handlers =
264 265 qualname = Pyro4
265 266 propagate = 1
266 267
267 268
268 269 ##############
269 270 ## HANDLERS ##
270 271 ##############
271 272
272 273 [handler_console]
273 274 class = StreamHandler
274 275 args = (sys.stderr,)
275 276 level = DEBUG
276 277 formatter = generic
277 278
278 279 [handler_file]
279 280 class = FileHandler
280 281 args = ('vcsserver.log', 'a',)
281 282 level = DEBUG
282 283 formatter = generic
283 284
284 285 [handler_file_rotating]
285 286 class = logging.handlers.TimedRotatingFileHandler
286 287 # 'D', 5 - rotate every 5days
287 288 # you can set 'h', 'midnight'
288 289 args = ('vcsserver.log', 'D', 5, 10,)
289 290 level = DEBUG
290 291 formatter = generic
291 292
292 293 ################
293 294 ## FORMATTERS ##
294 295 ################
295 296
296 297 [formatter_generic]
297 298 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
298 299 datefmt = %Y-%m-%d %H:%M:%S
299 300
301 .. _svn-http:
300 302
301 .. _Ask Ubuntu: http://askubuntu.com/questions/162391/how-do-i-fix-my-locale-issue
303 |svn| With Write Over HTTP
304 ^^^^^^^^^^^^^^^^^^^^^^^^^^
305
306 To use |svn| with read/write support over the |svn| HTTP protocol, you have to
307 configure the HTTP |svn| backend.
308
309 Prerequisites
310 =============
311
312 - Enable HTTP support inside the admin VCS settings on your |RCE| instance
313 - You need to install the following tools on the machine that is running an
314 instance of |RCE|:
315 ``Apache HTTP Server`` and
316 ``mod_dav_svn``.
317
318
319 Using Ubuntu Distribution as an example you can run:
320
321 .. code-block:: bash
322
323 $ sudo apt-get install apache2 libapache2-mod-svn
324
325 Once installed you need to enable ``dav_svn``:
326
327 .. code-block:: bash
328
329 $ sudo a2enmod dav_svn
330
331 Configuring Apache Setup
332 ========================
333
334 .. tip::
335
336 It is recommended to run Apache on a port other than 80, due to possible
337 conflicts with other HTTP servers like nginx. To do this, set the
338 ``Listen`` parameter in the ``/etc/apache2/ports.conf`` file, for example
339 ``Listen 8090``.
340
341
342 .. warning::
343
344 Make sure your Apache instance which runs the mod_dav_svn module is
345 only accessible by RhodeCode. Otherwise everyone is able to browse
346 the repositories or run subversion operations (checkout/commit/etc.).
347
348 It is also recommended to run apache as the same user as |RCE|, otherwise
349 permission issues could occur. To do this edit the ``/etc/apache2/envvars``
350
351 .. code-block:: apache
352
353 export APACHE_RUN_USER=rhodecode
354 export APACHE_RUN_GROUP=rhodecode
355
356 1. To configure Apache, create and edit a virtual hosts file, for example
357 :file:`/etc/apache2/sites-available/default.conf`. Below is an example
358 how to use one with auto-generated config ```mod_dav_svn.conf```
359 from configured |RCE| instance.
360
361 .. code-block:: apache
362
363 <VirtualHost *:8080>
364 ServerAdmin rhodecode-admin@localhost
365 DocumentRoot /var/www/html
366 ErrorLog ${'${APACHE_LOG_DIR}'}/error.log
367 CustomLog ${'${APACHE_LOG_DIR}'}/access.log combined
368 Include /home/user/.rccontrol/enterprise-1/mod_dav_svn.conf
369 </VirtualHost>
370
371
372 2. Go to the :menuselection:`Admin --> Settings --> VCS` page, and
373 enable :guilabel:`Proxy Subversion HTTP requests`, and specify the
374 :guilabel:`Subversion HTTP Server URL`.
375
376 3. Open the |RCE| configuration file,
377 :file:`/home/{user}/.rccontrol/{instance-id}/rhodecode.ini`
378
379 4. Add the following configuration option in the ``[app:main]``
380 section if you don't have it yet.
381
382 This enables mapping of the created |RCE| repo groups into special |svn| paths.
383 Each time a new repository group is created, the system will update
384 the template file and create new mapping. Apache web server needs to be
385 reloaded to pick up the changes on this file.
386 It's recommended to add reload into a crontab so the changes can be picked
387 automatically once someone creates a repository group inside RhodeCode.
388
389
390 .. code-block:: ini
391
392 ##############################################
393 ### Subversion proxy support (mod_dav_svn) ###
394 ##############################################
395 ## Enable or disable the config file generation.
396 svn.proxy.generate_config = true
397 ## Generate config file with `SVNListParentPath` set to `On`.
398 svn.proxy.list_parent_path = true
399 ## Set location and file name of generated config file.
400 svn.proxy.config_file_path = %(here)s/mod_dav_svn.conf
401 ## File system path to the directory containing the repositories served by
402 ## RhodeCode.
403 svn.proxy.parent_path_root = /path/to/repo_store
404 ## Used as a prefix to the <Location> block in the generated config file. In
405 ## most cases it should be set to `/`.
406 svn.proxy.location_root = /
407
408
409 This would create a special template file called ```mod_dav_svn.conf```. We
410 used that file path in the apache config above inside the Include statement.
411
412
413 Using |svn|
414 ===========
415
416 Once |svn| has been enabled on your instance, you can use it with the
417 following examples. For more |svn| information, see the `Subversion Red Book`_
418
419 .. code-block:: bash
420
421 # To clone a repository
422 svn checkout http://my-svn-server.example.com/my-svn-repo
423
424 # svn commit
425 svn commit
426
427 .. _Subversion Red Book: http://svnbook.red-bean.com/en/1.7/svn-book.html#svn.ref.svn
428
429
430 .. _Ask Ubuntu: http://askubuntu.com/questions/162391/how-do-i-fix-my-locale-issue No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now