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