Show More
@@ -0,0 +1,15 b'' | |||
|
1 | |RCE| 4.3.1 |RNS| | |
|
2 | ----------------- | |
|
3 | ||
|
4 | Release Date | |
|
5 | ^^^^^^^^^^^^ | |
|
6 | ||
|
7 | - 2016-08-23 | |
|
8 | ||
|
9 | Fixes | |
|
10 | ^^^^^ | |
|
11 | ||
|
12 | - Core: fixed database session cleanups. This will make sure RhodeCode can | |
|
13 | function correctly after database server problems. Fixes #4173, refs #4166 | |
|
14 | - Diffs: limit the file context to ~1mln lines. Fixes #4184, also make sure | |
|
15 | this doesn't trigger Integer overflow for msgpack. No newline at end of file |
@@ -6,3 +6,4 b' 41c87da28a179953df86061d817bc35533c66dd2' | |||
|
6 | 6 | baaf9f5bcea3bae0ef12ae20c8b270482e62abb6 v4.2.0 |
|
7 | 7 | 32a70c7e56844a825f61df496ee5eaf8c3c4e189 v4.2.1 |
|
8 | 8 | fa695cdb411d294679ac081d595ac654e5613b03 v4.3.0 |
|
9 | 0e4dc11b58cad833c513fe17bac39e6850edf959 v4.3.1 |
@@ -3,16 +3,21 b'' | |||
|
3 | 3 | |svn| With Write Over HTTP |
|
4 | 4 | -------------------------- |
|
5 | 5 | |
|
6 | To use |svn| with write access, the currently supported method is over HTTP. | |
|
7 | This requires you to configure your local machine so that it can access your | |
|
8 | |RCE| instance. | |
|
6 | To use |svn| with read/write support over the |svn| protocol, you have to | |
|
7 | configure HTTP |svn| backend. | |
|
9 | 8 | |
|
10 | 9 | Prerequisites |
|
11 | 10 | ^^^^^^^^^^^^^ |
|
12 | 11 | |
|
13 |
- Enable lab setting on your |RCE| instance, |
|
|
14 | - You need to install the following tools on your local machine: ``Apache`` and | |
|
15 | ``mod_dav_svn``. Use the following Ubuntu as an example. | |
|
12 | - Enable HTTP support inside labs setting on your |RCE| instance, | |
|
13 | see :ref:`lab-settings`. | |
|
14 | - You need to install the following tools on the machine that is running an | |
|
15 | instance of |RCE|: | |
|
16 | ``Apache HTTP Server`` and | |
|
17 | ``mod_dav_svn``. | |
|
18 | ||
|
19 | ||
|
20 | Using Ubuntu Distribution as an example you can run: | |
|
16 | 21 | |
|
17 | 22 | .. code-block:: bash |
|
18 | 23 | |
@@ -32,41 +37,80 b' Configuring Apache Setup' | |||
|
32 | 37 | It is recommended to run Apache on a port other than 80, due to possible |
|
33 | 38 | conflicts with other HTTP servers like nginx. To do this, set the |
|
34 | 39 | ``Listen`` parameter in the ``/etc/apache2/ports.conf`` file, for example |
|
35 | ``Listen 8090`` | |
|
40 | ``Listen 8090``. | |
|
41 | ||
|
42 | ||
|
43 | .. warning:: | |
|
44 | ||
|
45 | Make sure your Apache instance which runs the mod_dav_svn module is | |
|
46 | only accessible by RhodeCode. Otherwise everyone is able to browse | |
|
47 | the repositories or run subversion operations (checkout/commit/etc.). | |
|
36 | 48 | |
|
37 | 49 |
|
|
38 | 50 |
|
|
39 | 51 | |
|
40 | 52 | .. code-block:: apache |
|
41 | 53 | |
|
42 |
export APACHE_RUN_USER= |
|
|
43 |
export APACHE_RUN_GROUP= |
|
|
54 | export APACHE_RUN_USER=rhodecode | |
|
55 | export APACHE_RUN_GROUP=rhodecode | |
|
44 | 56 | |
|
45 | 57 | 1. To configure Apache, create and edit a virtual hosts file, for example |
|
46 |
:file:`/etc/apache2/sites-available/default.conf` |
|
|
47 | virtual hosts file and add a location section inside the | |
|
48 | ``<VirtualHost>`` section. | |
|
58 | :file:`/etc/apache2/sites-available/default.conf`. Below is an example | |
|
59 | how to use one with auto-generated config ```mod_dav_svn.conf``` | |
|
60 | from configured |RCE| instance. | |
|
49 | 61 | |
|
50 | 62 | .. code-block:: apache |
|
51 | 63 | |
|
52 | <Location /> | |
|
53 | DAV svn | |
|
54 | # Must be explicit path, relative not supported | |
|
55 | SVNParentPath /PATH/TO/REPOSITORIES | |
|
56 | SVNListParentPath On | |
|
57 | Allow from all | |
|
58 | Order allow,deny | |
|
59 | </Location> | |
|
64 | <VirtualHost *:8080> | |
|
65 | ServerAdmin rhodecode-admin@localhost | |
|
66 | DocumentRoot /var/www/html | |
|
67 | ErrorLog ${'${APACHE_LOG_DIR}'}/error.log | |
|
68 | CustomLog ${'${APACHE_LOG_DIR}'}/access.log combined | |
|
69 | Include /home/user/.rccontrol/enterprise-1/mod_dav_svn.conf | |
|
70 | </VirtualHost> | |
|
60 | 71 | |
|
61 | .. note:: | |
|
62 | ||
|
63 | Once configured, check that you can see the list of repositories on your | |
|
64 | |RCE| instance. | |
|
65 | 72 |
|
|
66 | 73 | 2. Go to the :menuselection:`Admin --> Settings --> Labs` page, and |
|
67 | 74 | enable :guilabel:`Proxy Subversion HTTP requests`, and specify the |
|
68 | 75 | :guilabel:`Subversion HTTP Server URL`. |
|
69 | 76 | |
|
77 | 3. Open the |RCE| configuration file, | |
|
78 | :file:`/home/{user}/.rccontrol/{instance-id}/rhodecode.ini` | |
|
79 | ||
|
80 | 4. Add the following configuration option in the ``[app:main]`` | |
|
81 | section if you don't have it yet. | |
|
82 | ||
|
83 | This enable mapping of created |RCE| repo groups into special |svn| paths. | |
|
84 | Each time a new repository group will be created the system will update | |
|
85 | the template file, and create new mapping. Apache web server needs to be | |
|
86 | reloaded to pick up the changes on this file. | |
|
87 | It's recommended to add reload into a crontab so the changes can be picked | |
|
88 | automatically once someone creates an repository group inside RhodeCode. | |
|
89 | ||
|
90 | ||
|
91 | .. code-block:: ini | |
|
92 | ||
|
93 | ############################################## | |
|
94 | ### Subversion proxy support (mod_dav_svn) ### | |
|
95 | ############################################## | |
|
96 | ## Enable or disable the config file generation. | |
|
97 | svn.proxy.generate_config = true | |
|
98 | ## Generate config file with `SVNListParentPath` set to `On`. | |
|
99 | svn.proxy.list_parent_path = true | |
|
100 | ## Set location and file name of generated config file. | |
|
101 | svn.proxy.config_file_path = %(here)s/mod_dav_svn.conf | |
|
102 | ## File system path to the directory containing the repositories served by | |
|
103 | ## RhodeCode. | |
|
104 | svn.proxy.parent_path_root = /path/to/repo_store | |
|
105 | ## Used as a prefix to the <Location> block in the generated config file. In | |
|
106 | ## most cases it should be set to `/`. | |
|
107 | svn.proxy.location_root = / | |
|
108 | ||
|
109 | ||
|
110 | This would create a special template file called ```mod_dav_svn.conf```. We | |
|
111 | used that file path in the apache config above inside the Include statement. | |
|
112 | ||
|
113 | ||
|
70 | 114 | Using |svn| |
|
71 | 115 | ^^^^^^^^^^^ |
|
72 | 116 |
@@ -9,6 +9,7 b' Release Notes' | |||
|
9 | 9 | .. toctree:: |
|
10 | 10 | :maxdepth: 1 |
|
11 | 11 | |
|
12 | release-notes-4.3.1.rst | |
|
12 | 13 | release-notes-4.3.0.rst |
|
13 | 14 | release-notes-4.2.1.rst |
|
14 | 15 | release-notes-4.2.0.rst |
@@ -39,6 +39,7 b' from routes.middleware import RoutesMidd' | |||
|
39 | 39 | import routes.util |
|
40 | 40 | |
|
41 | 41 | import rhodecode |
|
42 | from rhodecode.model import meta | |
|
42 | 43 | from rhodecode.config import patches |
|
43 | 44 | from rhodecode.config.routing import STATIC_FILE_PREFIX |
|
44 | 45 | from rhodecode.config.environment import ( |
@@ -159,6 +160,10 b' def make_pyramid_app(global_config, **se' | |||
|
159 | 160 | pyramid_app = config.make_wsgi_app() |
|
160 | 161 | pyramid_app = wrap_app_in_wsgi_middlewares(pyramid_app, config) |
|
161 | 162 | pyramid_app.config = config |
|
163 | ||
|
164 | # creating the app uses a connection - return it after we are done | |
|
165 | meta.Session.remove() | |
|
166 | ||
|
162 | 167 | return pyramid_app |
|
163 | 168 | |
|
164 | 169 | |
@@ -381,7 +386,25 b' def wrap_app_in_wsgi_middlewares(pyramid' | |||
|
381 | 386 | pyramid_app = make_gzip_middleware( |
|
382 | 387 | pyramid_app, settings, compress_level=1) |
|
383 | 388 | |
|
384 | return pyramid_app | |
|
389 | ||
|
390 | # this should be the outer most middleware in the wsgi stack since | |
|
391 | # middleware like Routes make database calls | |
|
392 | def pyramid_app_with_cleanup(environ, start_response): | |
|
393 | try: | |
|
394 | return pyramid_app(environ, start_response) | |
|
395 | finally: | |
|
396 | # Dispose current database session and rollback uncommitted | |
|
397 | # transactions. | |
|
398 | meta.Session.remove() | |
|
399 | ||
|
400 | # In a single threaded mode server, on non sqlite db we should have | |
|
401 | # '0 Current Checked out connections' at the end of a request, | |
|
402 | # if not, then something, somewhere is leaving a connection open | |
|
403 | pool = meta.Base.metadata.bind.engine.pool | |
|
404 | log.debug('sa pool status: %s', pool.status()) | |
|
405 | ||
|
406 | ||
|
407 | return pyramid_app_with_cleanup | |
|
385 | 408 | |
|
386 | 409 | |
|
387 | 410 | def sanitize_settings_and_apply_defaults(settings): |
@@ -40,12 +40,17 b' from rhodecode.lib.utils2 import safe_un' | |||
|
40 | 40 | |
|
41 | 41 | log = logging.getLogger(__name__) |
|
42 | 42 | |
|
43 | # define max context, a file with more than this numbers of lines is unusable | |
|
44 | # in browser anyway | |
|
45 | MAX_CONTEXT = 1024 * 1014 | |
|
46 | ||
|
43 | 47 | |
|
44 | 48 | class OPS(object): |
|
45 | 49 | ADD = 'A' |
|
46 | 50 | MOD = 'M' |
|
47 | 51 | DEL = 'D' |
|
48 | 52 | |
|
53 | ||
|
49 | 54 | def wrap_to_table(str_): |
|
50 | 55 | return '''<table class="code-difftable"> |
|
51 | 56 | <tr class="line no-comment"> |
@@ -79,7 +84,8 b' def wrapped_diff(filenode_old, filenode_' | |||
|
79 | 84 | f_gitdiff = get_gitdiff(filenode_old, filenode_new, |
|
80 | 85 | ignore_whitespace=ignore_whitespace, |
|
81 | 86 | context=line_context) |
|
82 |
diff_processor = DiffProcessor( |
|
|
87 | diff_processor = DiffProcessor( | |
|
88 | f_gitdiff, format='gitdiff', diff_limit=diff_limit, | |
|
83 | 89 |
|
|
84 | 90 | _parsed = diff_processor.prepare() |
|
85 | 91 | |
@@ -115,6 +121,10 b' def get_gitdiff(filenode_old, filenode_n' | |||
|
115 | 121 | """ |
|
116 | 122 | # make sure we pass in default context |
|
117 | 123 | context = context or 3 |
|
124 | # protect against IntOverflow when passing HUGE context | |
|
125 | if context > MAX_CONTEXT: | |
|
126 | context = MAX_CONTEXT | |
|
127 | ||
|
118 | 128 | submodules = filter(lambda o: isinstance(o, SubModuleNode), |
|
119 | 129 | [filenode_new, filenode_old]) |
|
120 | 130 | if submodules: |
@@ -190,7 +200,8 b' class DiffProcessor(object):' | |||
|
190 | 200 | # used for inline highlighter word split |
|
191 | 201 | _token_re = re.compile(r'()(>|<|&|\W+?)') |
|
192 | 202 | |
|
193 |
def __init__(self, diff, format='gitdiff', diff_limit=None, |
|
|
203 | def __init__(self, diff, format='gitdiff', diff_limit=None, | |
|
204 | file_limit=None, show_full_diff=True): | |
|
194 | 205 | """ |
|
195 | 206 | :param diff: A `Diff` object representing a diff from a vcs backend |
|
196 | 207 | :param format: format of diff passed, `udiff` or `gitdiff` |
@@ -30,6 +30,7 b' import Pyro4' | |||
|
30 | 30 | import pylons |
|
31 | 31 | import rhodecode |
|
32 | 32 | |
|
33 | from rhodecode.model import meta | |
|
33 | 34 | from rhodecode.lib import hooks_base |
|
34 | 35 | from rhodecode.lib.utils2 import ( |
|
35 | 36 | AttributeDict, safe_str, get_routes_generator_for_server_url) |
@@ -64,7 +65,10 b' class HooksHttpHandler(BaseHTTPRequestHa' | |||
|
64 | 65 | |
|
65 | 66 | def _call_hook(self, method, extras): |
|
66 | 67 | hooks = Hooks() |
|
68 | try: | |
|
67 | 69 | result = getattr(hooks, method)(extras) |
|
70 | finally: | |
|
71 | meta.Session.remove() | |
|
68 | 72 | return result |
|
69 | 73 | |
|
70 | 74 | def log_message(self, format, *args): |
@@ -261,6 +265,7 b' class Hooks(object):' | |||
|
261 | 265 | } |
|
262 | 266 | finally: |
|
263 | 267 | pylons.url._pop_object() |
|
268 | meta.Session.remove() | |
|
264 | 269 | |
|
265 | 270 | return { |
|
266 | 271 | 'status': result.status, |
@@ -406,8 +406,11 b' class SimpleVCS(object):' | |||
|
406 | 406 | yield chunk |
|
407 | 407 | finally: |
|
408 | 408 | # invalidate cache on push |
|
409 | try: | |
|
409 | 410 | if action == 'push': |
|
410 | 411 | self._invalidate_cache(repo_name) |
|
412 | finally: | |
|
413 | meta.Session.remove() | |
|
411 | 414 | |
|
412 | 415 | def _get_repository_name(self, environ): |
|
413 | 416 | """Get repository name out of the environmnent |
@@ -40,7 +40,6 b' def pylons_compatibility_tween_factory(h' | |||
|
40 | 40 | from pyramid. For example while rendering an old template that uses the |
|
41 | 41 | 'c' or 'h' objects. This tween sets up the needed pylons globals. |
|
42 | 42 | """ |
|
43 | try: | |
|
44 | 43 |
|
|
45 | 44 |
|
|
46 | 45 |
|
@@ -70,10 +69,6 b' def pylons_compatibility_tween_factory(h' | |||
|
70 | 69 |
|
|
71 | 70 |
|
|
72 | 71 |
|
|
73 | finally: | |
|
74 | # Dispose current database session and rollback uncommitted | |
|
75 | # transactions. | |
|
76 | meta.Session.remove() | |
|
77 | 72 | |
|
78 | 73 | return pylons_compatibility_tween |
|
79 | 74 |
General Comments 0
You need to be logged in to leave comments.
Login now