##// END OF EJS Templates
Change bitbucket and hosting URL
Bradley M. Kuhn -
r4179:010e9532 kallithea-2.2.5-r...
parent child Browse files
Show More
@@ -1,180 +1,176 b''
1 1 =========
2 2 RhodeCode
3 3 =========
4 4
5 5 About
6 6 -----
7 7
8 8 ``RhodeCode`` is a fast and powerful management tool for Mercurial_ and GIT_
9 9 with a built in push/pull server, full text search and code-review.
10 10 It works on http/https and has a built in permission/authentication system with
11 11 the ability to authenticate via LDAP or ActiveDirectory. RhodeCode also provides
12 12 simple API so it's easy integrable with existing external systems.
13 13
14 14 RhodeCode is similar in some respects to github_ or bitbucket_,
15 15 however RhodeCode can be run as standalone hosted application on your own server.
16 16 It is open source and donation ware and focuses more on providing a customized,
17 17 self administered interface for Mercurial_ and GIT_ repositories.
18 18 RhodeCode works on \*nix systems and Windows it is powered by a vcs_ library
19 19 that Lukasz Balcerzak and Marcin Kuzminski created to handle multiple
20 20 different version control systems.
21 21
22 22 RhodeCode uses `PEP386 versioning <http://www.python.org/dev/peps/pep-0386/>`_
23 23
24 24 Installation
25 25 ------------
26 26 Stable releases of RhodeCode are best installed via::
27 27
28 28 easy_install rhodecode
29 29
30 30 Or::
31 31
32 32 pip install rhodecode
33 33
34 34 Detailed instructions and links may be found on the Installation page.
35 35
36 36 Please visit http://packages.python.org/RhodeCode/installation.html for
37 37 more details
38 38
39 39 RhodeCode demo
40 40 --------------
41 41
42 42 http://demo.rhodecode.org
43 43
44 44 The default access is anonymous but you can login to an administrative account
45 45 using the following credentials:
46 46
47 47 - username: demo
48 48 - password: demo12
49 49
50 50 Source code
51 51 -----------
52 52
53 The latest sources can be obtained from official RhodeCode instance
54 https://secure.rhodecode.org
53 The latest sources can be obtained from https://kallithea-scm.org/repos/kallithea
55 54
56 55
57 56 MIRRORS:
58 57
59 58 Issue tracker and sources at bitbucket_
60 59
61 http://bitbucket.org/marcinkuzminski/rhodecode
60 https://bitbucket.org/conservancy/kallithea
62 61
63 Sources at github_
64
65 https://github.com/marcinkuzminski/rhodecode
66 62
67 63
68 64 RhodeCode Features
69 65 ------------------
70 66
71 67 - Has its own middleware to handle mercurial_ and git_ protocol requests.
72 68 Each request is authenticated and logged together with IP address.
73 69 - Build for speed and performance. You can make multiple pulls/pushes simultaneous.
74 70 Proven to work with 1000s of repositories and users
75 71 - Supports http/https, LDAP, AD, proxy-pass authentication.
76 72 - Full permissions (private/read/write/admin) together with IP restrictions for each repository,
77 73 additional explicit forking, repositories group and repository creation permissions.
78 74 - User groups for easier permission management.
79 75 - Repository groups let you group repos and manage them easier. They come with
80 76 permission delegation features, so you can delegate groups management.
81 77 - Users can fork other users repos, and compare them at any time.
82 78 - Built in Gist functionality for sharing code snippets.
83 79 - Integrates easily with other systems, with custom created mappers you can connect it to almost
84 80 any issue tracker, and with an JSON-RPC API you can make much more
85 81 - Build in commit-api let's you add, edit and commit files right from RhodeCode
86 82 web interface using simple editor or upload binary files using simple form.
87 83 - Powerfull pull-request driven review system with inline commenting,
88 84 changeset statuses, and notification system.
89 85 - Importing and syncing repositories from remote locations for GIT_, Mercurial_ and SVN.
90 86 - Mako templates let's you customize the look and feel of the application.
91 87 - Beautiful diffs, annotations and source code browsing all colored by pygments.
92 88 Raw diffs are made in git-diff format for both VCS systems, including GIT_ binary-patches
93 89 - Mercurial_ and Git_ DAG graphs and yui-flot powered graphs with zooming and statistics
94 90 to track activity for repositories
95 91 - Admin interface with user/permission management. Admin activity journal, logs
96 92 pulls, pushes, forks, registrations and other actions made by all users.
97 93 - Server side forks. It is possible to fork a project and modify it freely
98 94 without breaking the main repository.
99 95 - rst and markdown README support for repositories.
100 96 - Full text search powered by Whoosh on the source files, commit messages, and file names.
101 97 Build in indexing daemons, with optional incremental index build
102 98 (no external search servers required all in one application)
103 99 - Setup project descriptions/tags and info inside built in db for easy, non
104 100 file-system operations.
105 101 - Intelligent cache with invalidation after push or project change, provides
106 102 high performance and always up to date data.
107 103 - RSS / Atom feeds, gravatar support, downloadable sources as zip/tar/gz
108 104 - Optional async tasks for speed and performance using celery_
109 105 - Backup scripts can do backup of whole app and send it over scp to desired
110 106 location
111 107 - Based on pylons / sqlalchemy / sqlite / whoosh / vcs
112 108
113 109
114 110 Incoming / Plans
115 111 ----------------
116 112
117 113 - Finer granular permissions per branch, or subrepo
118 114 - Web based merges for pull requests
119 115 - Tracking history for each lines in files
120 116 - Simple issue tracker
121 117 - SSH based authentication with server side key management
122 118 - Commit based built in wiki system
123 119 - More statistics and graph (global annotation + some more statistics)
124 120 - Other advancements as development continues (or you can of course make
125 121 additions and or requests)
126 122
127 123 License
128 124 -------
129 125
130 126 ``RhodeCode`` is released under the GPLv3 license.
131 127
132 128
133 129 Getting help
134 130 ------------
135 131
136 132 Listed bellow are various support resources that should help.
137 133
138 134 .. note::
139 135
140 136 Please try to read the documentation before posting any issues, especially
141 137 the **troubleshooting section**
142 138
143 139 - Join the `Google group <http://groups.google.com/group/rhodecode>`_ and ask
144 140 any questions.
145 141
146 - Open an issue at `issue tracker <http://bitbucket.org/marcinkuzminski/rhodecode/issues>`_
142 - Open an issue at `issue tracker <https://bitbucket.org/conservancy/kallithea/issues>`_
147 143
148 144 - Join #rhodecode on FreeNode (irc.freenode.net)
149 145 or use http://webchat.freenode.net/?channels=rhodecode for web access to irc.
150 146
151 147 - You can also follow me on twitter **@marcinkuzminski** where i often post some
152 148 news about RhodeCode
153 149
154 150
155 151 Online documentation
156 152 --------------------
157 153
158 154 Online documentation for the current version of RhodeCode is available at
159 155 - http://packages.python.org/RhodeCode/
160 156 - http://rhodecode.readthedocs.org/en/latest/index.html
161 157
162 158 You may also build the documentation for yourself - go into ``docs/`` and run::
163 159
164 160 make html
165 161
166 162 (You need to have sphinx_ installed to build the documentation. If you don't
167 163 have sphinx_ installed you can install it via the command:
168 164 ``easy_install sphinx``)
169 165
170 166 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
171 167 .. _python: http://www.python.org/
172 168 .. _sphinx: http://sphinx.pocoo.org/
173 169 .. _mercurial: http://mercurial.selenic.com/
174 170 .. _bitbucket: http://bitbucket.org/
175 171 .. _github: http://github.com/
176 172 .. _subversion: http://subversion.tigris.org/
177 173 .. _git: http://git-scm.com/
178 174 .. _celery: http://celeryproject.org/
179 175 .. _Sphinx: http://sphinx.pocoo.org/
180 176 .. _vcs: http://pypi.python.org/pypi/vcs
@@ -1,588 +1,588 b''
1 1 ################################################################################
2 2 ################################################################################
3 3 # RhodeCode - Pylons environment configuration #
4 4 # #
5 5 # The %(here)s variable will be replaced with the parent directory of this file#
6 6 ################################################################################
7 7
8 8 [DEFAULT]
9 9 debug = true
10 10 pdebug = false
11 11 ################################################################################
12 12 ## Uncomment and replace with the address which should receive ##
13 13 ## any error reports after application crash ##
14 14 ## Additionally those settings will be used by RhodeCode mailing system ##
15 15 ################################################################################
16 16 #email_to = admin@localhost
17 17 #error_email_from = paste_error@localhost
18 18 #app_email_from = rhodecode-noreply@localhost
19 19 #error_message =
20 20 #email_prefix = [RhodeCode]
21 21
22 22 #smtp_server = mail.server.com
23 23 #smtp_username =
24 24 #smtp_password =
25 25 #smtp_port =
26 26 #smtp_use_tls = false
27 27 #smtp_use_ssl = true
28 28 ## Specify available auth parameters here (e.g. LOGIN PLAIN CRAM-MD5, etc.)
29 29 #smtp_auth =
30 30
31 31 [server:main]
32 32 ## PASTE ##
33 33 #use = egg:Paste#http
34 34 ## nr of worker threads to spawn
35 35 #threadpool_workers = 5
36 36 ## max request before thread respawn
37 37 #threadpool_max_requests = 10
38 38 ## option to use threads of process
39 39 #use_threadpool = true
40 40
41 41 ## WAITRESS ##
42 42 use = egg:waitress#main
43 43 ## number of worker threads
44 44 threads = 5
45 45 ## MAX BODY SIZE 100GB
46 46 max_request_body_size = 107374182400
47 47 ## use poll instead of select, fixes fd limits, may not work on old
48 48 ## windows systems.
49 49 #asyncore_use_poll = True
50 50
51 51 ## GUNICORN ##
52 52 #use = egg:gunicorn#main
53 53 ## number of process workers. You must set `instance_id = *` when this option
54 54 ## is set to more than one worker
55 55 #workers = 1
56 56 ## process name
57 57 #proc_name = rhodecode
58 58 ## type of worker class, one of sync, eventlet, gevent, tornado
59 59 ## recommended for bigger setup is using of of other than sync one
60 60 #worker_class = sync
61 61 #max_requests = 5
62 62 ## ammount of time a worker can handle request before it gets killed and
63 63 ## restarted
64 64 #timeout = 3600
65 65
66 66 ## UWSGI ##
67 67 ## run with uwsgi --ini-paste-logged <inifile.ini>
68 68 #[uwsgi]
69 69 #socket = /tmp/uwsgi.sock
70 70 #master = true
71 71 #http = 0.0.0.0:5000
72 72
73 73 ## set as deamon and redirect all output to file
74 74 #daemonize = ./uwsgi_rhodecode.log
75 75
76 76 ## master process PID
77 77 #pidfile = ./uwsgi_rhodecode.pid
78 78
79 79 ## stats server with workers statistics, use uwsgitop
80 80 ## for monitoring, `uwsgitop 127.0.0.1:1717`
81 81 #stats = 127.0.0.1:1717
82 82 #memory-report = true
83 83
84 84 ## log 5XX errors
85 85 #log-5xx = true
86 86
87 87 ## Set the socket listen queue size.
88 88 #listen = 256
89 89
90 90 ## Gracefully Reload workers after the specified amount of managed requests
91 91 ## (avoid memory leaks).
92 92 #max-requests = 1000
93 93
94 94 ## enable large buffers
95 95 #buffer-size=65535
96 96
97 97 ## socket and http timeouts ##
98 98 #http-timeout=3600
99 99 #socket-timeout=3600
100 100
101 101 ## Log requests slower than the specified number of milliseconds.
102 102 #log-slow = 10
103 103
104 104 ## Exit if no app can be loaded.
105 105 #need-app = true
106 106
107 107 ## Set lazy mode (load apps in workers instead of master).
108 108 #lazy = true
109 109
110 110 ## scaling ##
111 111 ## set cheaper algorithm to use, if not set default will be used
112 112 #cheaper-algo = spare
113 113
114 114 ## minimum number of workers to keep at all times
115 115 #cheaper = 1
116 116
117 117 ## number of workers to spawn at startup
118 118 #cheaper-initial = 1
119 119
120 120 ## maximum number of workers that can be spawned
121 121 #workers = 4
122 122
123 123 ## how many workers should be spawned at a time
124 124 #cheaper-step = 1
125 125
126 126 ## COMMON ##
127 127 host = 0.0.0.0
128 128 port = 5000
129 129
130 130 ## prefix middleware for rc
131 131 #[filter:proxy-prefix]
132 132 #use = egg:PasteDeploy#prefix
133 133 #prefix = /<your-prefix>
134 134
135 135 [app:main]
136 136 use = egg:rhodecode
137 137 ## enable proxy prefix middleware
138 138 #filter-with = proxy-prefix
139 139
140 140 full_stack = true
141 141 static_files = true
142 142 ## Optional Languages
143 143 ## en, fr, ja, pt_BR, zh_CN, zh_TW, pl
144 144 lang = en
145 145 cache_dir = %(here)s/data
146 146 index_dir = %(here)s/data/index
147 147
148 148 ## perform a full repository scan on each server start, this should be
149 149 ## set to false after first startup, to allow faster server restarts.
150 150 initial_repo_scan = true
151 151
152 152 ## uncomment and set this path to use archive download cache
153 153 #archive_cache_dir = /tmp/tarballcache
154 154
155 155 ## change this to unique ID for security
156 156 app_instance_uuid = rc-production
157 157
158 158 ## cut off limit for large diffs (size in bytes)
159 159 cut_off_limit = 256000
160 160
161 161 ## use cache version of scm repo everywhere
162 162 vcs_full_cache = true
163 163
164 164 ## force https in RhodeCode, fixes https redirects, assumes it's always https
165 165 force_https = false
166 166
167 167 ## use Strict-Transport-Security headers
168 168 use_htsts = false
169 169
170 170 ## number of commits stats will parse on each iteration
171 171 commit_parse_limit = 25
172 172
173 173 ## use gravatar service to display avatars
174 174 use_gravatar = true
175 175
176 176 ## path to git executable
177 177 git_path = git
178 178
179 179 ## git rev filter option, --all is the default filter, if you need to
180 180 ## hide all refs in changelog switch this to --branches --tags
181 181 git_rev_filter=--all
182 182
183 183 ## RSS feed options
184 184 rss_cut_off_limit = 256000
185 185 rss_items_per_page = 10
186 186 rss_include_diff = false
187 187
188 188 ## options for showing and identifying changesets
189 189 show_sha_length = 12
190 190 show_revision_number = true
191 191
192 192 ## gist URL alias, used to create nicer urls for gist. This should be an
193 193 ## url that does rewrites to _admin/gists/<gistid>.
194 194 ## example: http://gist.rhodecode.org/{gistid}. Empty means use the internal
195 195 ## RhodeCode url, ie. http[s]://rhodecode.server/_admin/gists/<gistid>
196 196 gist_alias_url =
197 197
198 198 ## white list of API enabled controllers. This allows to add list of
199 199 ## controllers to which access will be enabled by api_key. eg: to enable
200 200 ## api access to raw_files put `FilesController:raw`, to enable access to patches
201 201 ## add `ChangesetController:changeset_patch`. This list should be "," separated
202 202 ## Syntax is <ControllerClass>:<function>. Check debug logs for generated names
203 203 ## Recommended settings bellow are commented out:
204 204 api_access_controllers_whitelist =
205 205 # ChangesetController:changeset_patch,
206 206 # ChangesetController:changeset_raw,
207 207 # FilesController:raw,
208 208 # FilesController:archivefile
209 209
210 210 ## alternative_gravatar_url allows you to use your own avatar server application
211 211 ## the following parts of the URL will be replaced
212 212 ## {email} user email
213 213 ## {md5email} md5 hash of the user email (like at gravatar.com)
214 214 ## {size} size of the image that is expected from the server application
215 215 ## {scheme} http/https from RhodeCode server
216 216 ## {netloc} network location from RhodeCode server
217 217 #alternative_gravatar_url = http://myavatarserver.com/getbyemail/{email}/{size}
218 218 #alternative_gravatar_url = http://myavatarserver.com/getbymd5/{md5email}?s={size}
219 219
220 220
221 221 ## container auth options
222 222 container_auth_enabled = false
223 223 proxypass_auth_enabled = false
224 224
225 225 ## default encoding used to convert from and to unicode
226 226 ## can be also a comma seperated list of encoding in case of mixed encodings
227 227 default_encoding = utf8
228 228
229 229 ## overwrite schema of clone url
230 230 ## available vars:
231 231 ## scheme - http/https
232 232 ## user - current user
233 233 ## pass - password
234 234 ## netloc - network location
235 235 ## path - usually repo_name
236 236
237 237 #clone_uri = {scheme}://{user}{pass}{netloc}{path}
238 238
239 239 ## issue tracker for RhodeCode (leave blank to disable, absent for default)
240 #bugtracker = http://bitbucket.org/marcinkuzminski/rhodecode/issues
240 #bugtracker = https://bitbucket.org/conservancy/kallithea/issues
241 241
242 242 ## issue tracking mapping for commits messages
243 243 ## comment out issue_pat, issue_server, issue_prefix to enable
244 244
245 245 ## pattern to get the issues from commit messages
246 246 ## default one used here is #<numbers> with a regex passive group for `#`
247 247 ## {id} will be all groups matched from this pattern
248 248
249 249 issue_pat = (?:\s*#)(\d+)
250 250
251 251 ## server url to the issue, each {id} will be replaced with match
252 252 ## fetched from the regex and {repo} is replaced with full repository name
253 253 ## including groups {repo_name} is replaced with just name of repo
254 254
255 255 issue_server_link = https://myissueserver.com/{repo}/issue/{id}
256 256
257 257 ## prefix to add to link to indicate it's an url
258 258 ## #314 will be replaced by <issue_prefix><id>
259 259
260 260 issue_prefix = #
261 261
262 262 ## issue_pat, issue_server_link, issue_prefix can have suffixes to specify
263 263 ## multiple patterns, to other issues server, wiki or others
264 264 ## below an example how to create a wiki pattern
265 265 # #wiki-some-id -> https://mywiki.com/some-id
266 266
267 267 #issue_pat_wiki = (?:wiki-)(.+)
268 268 #issue_server_link_wiki = https://mywiki.com/{id}
269 269 #issue_prefix_wiki = WIKI-
270 270
271 271
272 272 ## instance-id prefix
273 273 ## a prefix key for this instance used for cache invalidation when running
274 274 ## multiple instances of rhodecode, make sure it's globally unique for
275 275 ## all running rhodecode instances. Leave empty if you don't use it
276 276 instance_id =
277 277
278 278 ## alternative return HTTP header for failed authentication. Default HTTP
279 279 ## response is 401 HTTPUnauthorized. Currently HG clients have troubles with
280 280 ## handling that. Set this variable to 403 to return HTTPForbidden
281 281 auth_ret_code =
282 282
283 283 ## locking return code. When repository is locked return this HTTP code. 2XX
284 284 ## codes don't break the transactions while 4XX codes do
285 285 lock_ret_code = 423
286 286
287 287 ## allows to change the repository location in settings page
288 288 allow_repo_location_change = True
289 289
290 290 ## allows to setup custom hooks in settings page
291 291 allow_custom_hooks_settings = True
292 292
293 293
294 294 ####################################
295 295 ### CELERY CONFIG ####
296 296 ####################################
297 297 use_celery = false
298 298 broker.host = localhost
299 299 broker.vhost = rabbitmqhost
300 300 broker.port = 5672
301 301 broker.user = rabbitmq
302 302 broker.password = qweqwe
303 303
304 304 celery.imports = rhodecode.lib.celerylib.tasks
305 305
306 306 celery.result.backend = amqp
307 307 celery.result.dburi = amqp://
308 308 celery.result.serialier = json
309 309
310 310 #celery.send.task.error.emails = true
311 311 #celery.amqp.task.result.expires = 18000
312 312
313 313 celeryd.concurrency = 2
314 314 #celeryd.log.file = celeryd.log
315 315 celeryd.log.level = debug
316 316 celeryd.max.tasks.per.child = 1
317 317
318 318 ## tasks will never be sent to the queue, but executed locally instead.
319 319 celery.always.eager = false
320 320
321 321 ####################################
322 322 ### BEAKER CACHE ####
323 323 ####################################
324 324 beaker.cache.data_dir=%(here)s/data/cache/data
325 325 beaker.cache.lock_dir=%(here)s/data/cache/lock
326 326
327 327 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
328 328
329 329 beaker.cache.super_short_term.type=memory
330 330 beaker.cache.super_short_term.expire=10
331 331 beaker.cache.super_short_term.key_length = 256
332 332
333 333 beaker.cache.short_term.type=memory
334 334 beaker.cache.short_term.expire=60
335 335 beaker.cache.short_term.key_length = 256
336 336
337 337 beaker.cache.long_term.type=memory
338 338 beaker.cache.long_term.expire=36000
339 339 beaker.cache.long_term.key_length = 256
340 340
341 341 beaker.cache.sql_cache_short.type=memory
342 342 beaker.cache.sql_cache_short.expire=10
343 343 beaker.cache.sql_cache_short.key_length = 256
344 344
345 345 beaker.cache.sql_cache_med.type=memory
346 346 beaker.cache.sql_cache_med.expire=360
347 347 beaker.cache.sql_cache_med.key_length = 256
348 348
349 349 beaker.cache.sql_cache_long.type=file
350 350 beaker.cache.sql_cache_long.expire=3600
351 351 beaker.cache.sql_cache_long.key_length = 256
352 352
353 353 ####################################
354 354 ### BEAKER SESSION ####
355 355 ####################################
356 356 ## Type of storage used for the session, current types are
357 357 ## dbm, file, memcached, database, and memory.
358 358 ## The storage uses the Container API
359 359 ## that is also used by the cache system.
360 360
361 361 ## db session ##
362 362 #beaker.session.type = ext:database
363 363 #beaker.session.sa.url = postgresql://postgres:qwe@localhost/rhodecode
364 364 #beaker.session.table_name = db_session
365 365
366 366 ## encrypted cookie client side session, good for many instances ##
367 367 #beaker.session.type = cookie
368 368
369 369 ## file based cookies (default) ##
370 370 #beaker.session.type = file
371 371
372 372 beaker.session.key = rhodecode
373 373 beaker.session.secret = develop-rc-uytcxaz
374 374
375 375 ## Secure encrypted cookie. Requires AES and AES python libraries
376 376 ## you must disable beaker.session.secret to use this
377 377 #beaker.session.encrypt_key = <key_for_encryption>
378 378 #beaker.session.validate_key = <validation_key>
379 379
380 380 ## sets session as invalid if it haven't been accessed for given amount of time
381 381 beaker.session.timeout = 2592000
382 382 beaker.session.httponly = true
383 383 #beaker.session.cookie_path = /<your-prefix>
384 384
385 385 ## uncomment for https secure cookie
386 386 beaker.session.secure = false
387 387
388 388 ## auto save the session to not to use .save()
389 389 beaker.session.auto = False
390 390
391 391 ## default cookie expiration time in seconds `true` expire at browser close ##
392 392 #beaker.session.cookie_expires = 3600
393 393
394 394
395 395 ############################
396 396 ## ERROR HANDLING SYSTEMS ##
397 397 ############################
398 398
399 399 ####################
400 400 ### [errormator] ###
401 401 ####################
402 402
403 403 ## Errormator is tailored to work with RhodeCode, see
404 404 ## http://errormator.com for details how to obtain an account
405 405 ## you must install python package `errormator_client` to make it work
406 406
407 407 ## errormator enabled
408 408 errormator = false
409 409
410 410 errormator.server_url = https://api.errormator.com
411 411 errormator.api_key = YOUR_API_KEY
412 412
413 413 ## TWEAK AMOUNT OF INFO SENT HERE
414 414
415 415 ## enables 404 error logging (default False)
416 416 errormator.report_404 = false
417 417
418 418 ## time in seconds after request is considered being slow (default 1)
419 419 errormator.slow_request_time = 1
420 420
421 421 ## record slow requests in application
422 422 ## (needs to be enabled for slow datastore recording and time tracking)
423 423 errormator.slow_requests = true
424 424
425 425 ## enable hooking to application loggers
426 426 # errormator.logging = true
427 427
428 428 ## minimum log level for log capture
429 429 # errormator.logging.level = WARNING
430 430
431 431 ## send logs only from erroneous/slow requests
432 432 ## (saves API quota for intensive logging)
433 433 errormator.logging_on_error = false
434 434
435 435 ## list of additonal keywords that should be grabbed from environ object
436 436 ## can be string with comma separated list of words in lowercase
437 437 ## (by default client will always send following info:
438 438 ## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that
439 439 ## start with HTTP* this list be extended with additional keywords here
440 440 errormator.environ_keys_whitelist =
441 441
442 442
443 443 ## list of keywords that should be blanked from request object
444 444 ## can be string with comma separated list of words in lowercase
445 445 ## (by default client will always blank keys that contain following words
446 446 ## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'
447 447 ## this list be extended with additional keywords set here
448 448 errormator.request_keys_blacklist =
449 449
450 450
451 451 ## list of namespaces that should be ignores when gathering log entries
452 452 ## can be string with comma separated list of namespaces
453 453 ## (by default the client ignores own entries: errormator_client.client)
454 454 errormator.log_namespace_blacklist =
455 455
456 456
457 457 ################
458 458 ### [sentry] ###
459 459 ################
460 460
461 461 ## sentry is a alternative open source error aggregator
462 462 ## you must install python packages `sentry` and `raven` to enable
463 463
464 464 sentry.dsn = YOUR_DNS
465 465 sentry.servers =
466 466 sentry.name =
467 467 sentry.key =
468 468 sentry.public_key =
469 469 sentry.secret_key =
470 470 sentry.project =
471 471 sentry.site =
472 472 sentry.include_paths =
473 473 sentry.exclude_paths =
474 474
475 475
476 476 ################################################################################
477 477 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
478 478 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
479 479 ## execute malicious code after an exception is raised. ##
480 480 ################################################################################
481 481 #set debug = false
482 482
483 483 ##################################
484 484 ### LOGVIEW CONFIG ###
485 485 ##################################
486 486 logview.sqlalchemy = #faa
487 487 logview.pylons.templating = #bfb
488 488 logview.pylons.util = #eee
489 489
490 490 #########################################################
491 491 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
492 492 #########################################################
493 493 #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30
494 494 sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode
495 495 #sqlalchemy.db1.url = mysql://root:qweqwe@localhost/rhodecode
496 496 sqlalchemy.db1.echo = false
497 497 sqlalchemy.db1.pool_recycle = 3600
498 498 sqlalchemy.db1.convert_unicode = true
499 499
500 500 ################################
501 501 ### LOGGING CONFIGURATION ####
502 502 ################################
503 503 [loggers]
504 504 keys = root, routes, rhodecode, sqlalchemy, beaker, templates, whoosh_indexer
505 505
506 506 [handlers]
507 507 keys = console, console_sql
508 508
509 509 [formatters]
510 510 keys = generic, color_formatter, color_formatter_sql
511 511
512 512 #############
513 513 ## LOGGERS ##
514 514 #############
515 515 [logger_root]
516 516 level = NOTSET
517 517 handlers = console
518 518
519 519 [logger_routes]
520 520 level = DEBUG
521 521 handlers =
522 522 qualname = routes.middleware
523 523 ## "level = DEBUG" logs the route matched and routing variables.
524 524 propagate = 1
525 525
526 526 [logger_beaker]
527 527 level = DEBUG
528 528 handlers =
529 529 qualname = beaker.container
530 530 propagate = 1
531 531
532 532 [logger_templates]
533 533 level = INFO
534 534 handlers =
535 535 qualname = pylons.templating
536 536 propagate = 1
537 537
538 538 [logger_rhodecode]
539 539 level = DEBUG
540 540 handlers =
541 541 qualname = rhodecode
542 542 propagate = 1
543 543
544 544 [logger_sqlalchemy]
545 545 level = INFO
546 546 handlers = console_sql
547 547 qualname = sqlalchemy.engine
548 548 propagate = 0
549 549
550 550 [logger_whoosh_indexer]
551 551 level = DEBUG
552 552 handlers =
553 553 qualname = whoosh_indexer
554 554 propagate = 1
555 555
556 556 ##############
557 557 ## HANDLERS ##
558 558 ##############
559 559
560 560 [handler_console]
561 561 class = StreamHandler
562 562 args = (sys.stderr,)
563 563 level = DEBUG
564 564 formatter = color_formatter
565 565
566 566 [handler_console_sql]
567 567 class = StreamHandler
568 568 args = (sys.stderr,)
569 569 level = DEBUG
570 570 formatter = color_formatter_sql
571 571
572 572 ################
573 573 ## FORMATTERS ##
574 574 ################
575 575
576 576 [formatter_generic]
577 577 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
578 578 datefmt = %Y-%m-%d %H:%M:%S
579 579
580 580 [formatter_color_formatter]
581 581 class=rhodecode.lib.colored_formatter.ColorFormatter
582 582 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
583 583 datefmt = %Y-%m-%d %H:%M:%S
584 584
585 585 [formatter_color_formatter_sql]
586 586 class=rhodecode.lib.colored_formatter.ColorFormatterSql
587 587 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
588 588 datefmt = %Y-%m-%d %H:%M:%S
@@ -1,53 +1,53 b''
1 1 .. _contributing:
2 2
3 3 =========================
4 4 Contributing to RhodeCode
5 5 =========================
6 6
7 7 If you would like to contribute to RhodeCode, please contact me, any help is
8 8 greatly appreciated!
9 9
10 10 Could I request that you make your source contributions by first forking the
11 11 RhodeCode repository on bitbucket_
12 https://bitbucket.org/marcinkuzminski/rhodecode and then make your changes to
12 https://bitbucket.org/conservancy/kallithea and then make your changes to
13 13 your forked repository. Please post all fixes into **dev** bookmark since your
14 14 change might be already fixed there and i try to merge all fixes from dev into
15 15 stable, and not the other way. Finally, when you are finished with your changes,
16 16 please send me a pull request.
17 17
18 18 To run RhodeCode in a development version you always need to install the latest
19 19 required libs. Simply clone rhodecode and switch to beta branch::
20 20
21 hg clone -u dev https://secure.rhodecode.org/rhodecode
21 hg clone https://kallithea-scm.org/repos/kallithea
22 22
23 23 after downloading/pulling RhodeCode make sure you run::
24 24
25 25 python setup.py develop
26 26
27 27 command to install/verify all required packages, and prepare development
28 28 enviroment.
29 29
30 30 There are two files in the directory production.ini and developement.ini copy
31 31 the `development.ini` file as rc.ini (which is excluded from version controll)
32 32 and put all your changes like db connection or server port in there.
33 33
34 34 After finishing your changes make sure all tests passes ok. You can run
35 35 the testsuite running ``nosetest`` from the project root, or if you use tox
36 36 run tox for python2.5-2.7 with multiple database test. When using `nosetests`
37 37 test.ini file is used and by default it uses sqlite for tests, edit this file
38 38 to change your testing enviroment.
39 39
40 40
41 41 There's a special set of tests for push/pull operations, you can runn them using::
42 42
43 43 paster serve test.ini --pid-file=test.pid --daemon
44 44 RC_WHOOSH_TEST_DISABLE=1 RC_NO_TMP_PATH=1 nosetests -x rhodecode/tests/other/test_vcs_operations.py
45 45 kill -9 $(cat test.pid)
46 46
47 47
48 48 | Thank you for any contributions!
49 49 | Marcin
50 50
51 51
52 52
53 53 .. _bitbucket: http://bitbucket.org/
@@ -1,746 +1,746 b''
1 1 .. _setup:
2 2
3 3 =====
4 4 Setup
5 5 =====
6 6
7 7
8 8 Setting up RhodeCode
9 9 --------------------
10 10
11 11 First, you will need to create a RhodeCode configuration file. Run the
12 12 following command to do this::
13 13
14 14 paster make-config RhodeCode production.ini
15 15
16 16 - This will create the file `production.ini` in the current directory. This
17 17 configuration file contains the various settings for RhodeCode, e.g proxy
18 18 port, email settings, usage of static files, cache, celery settings and
19 19 logging.
20 20
21 21
22 22 Next, you need to create the databases used by RhodeCode. I recommend that you
23 23 use postgresql or sqlite (default). If you choose a database other than the
24 24 default ensure you properly adjust the db url in your production.ini
25 25 configuration file to use this other database. RhodeCode currently supports
26 26 postgresql, sqlite and mysql databases. Create the database by running
27 27 the following command::
28 28
29 29 paster setup-rhodecode production.ini
30 30
31 31 This will prompt you for a "root" path. This "root" path is the location where
32 32 RhodeCode will store all of its repositories on the current machine. After
33 33 entering this "root" path ``setup-rhodecode`` will also prompt you for a username
34 34 and password for the initial admin account which ``setup-rhodecode`` sets
35 35 up for you.
36 36
37 37 setup process can be fully automated, example for lazy::
38 38
39 39 paster setup-rhodecode production.ini --user=marcink --password=secret --email=marcin@rhodecode.org --repos=/home/marcink/my_repos
40 40
41 41
42 42 - The ``setup-rhodecode`` command will create all of the needed tables and an
43 43 admin account. When choosing a root path you can either use a new empty
44 44 location, or a location which already contains existing repositories. If you
45 45 choose a location which contains existing repositories RhodeCode will simply
46 46 add all of the repositories at the chosen location to it's database.
47 47 (Note: make sure you specify the correct path to the root).
48 48 - Note: the given path for mercurial_ repositories **must** be write accessible
49 49 for the application. It's very important since the RhodeCode web interface
50 50 will work without write access, but when trying to do a push it will
51 51 eventually fail with permission denied errors unless it has write access.
52 52
53 53 You are now ready to use RhodeCode, to run it simply execute::
54 54
55 55 paster serve production.ini
56 56
57 57 - This command runs the RhodeCode server. The web app should be available at the
58 58 127.0.0.1:5000. This ip and port is configurable via the production.ini
59 59 file created in previous step
60 60 - Use the admin account you created above when running ``setup-rhodecode``
61 61 to login to the web app.
62 62 - The default permissions on each repository is read, and the owner is admin.
63 63 Remember to update these if needed.
64 64 - In the admin panel you can toggle ldap, anonymous, permissions settings. As
65 65 well as edit more advanced options on users and repositories
66 66
67 67 Optionally users can create `rcextensions` package that extends RhodeCode
68 68 functionality. To do this simply execute::
69 69
70 70 paster make-rcext production.ini
71 71
72 72 This will create `rcextensions` package in the same place that your `ini` file
73 73 lives. With `rcextensions` it's possible to add additional mapping for whoosh,
74 74 stats and add additional code into the push/pull/create/delete repo hooks.
75 75 For example for sending signals to build-bots such as jenkins.
76 76 Please see the `__init__.py` file inside `rcextensions` package
77 77 for more details.
78 78
79 79
80 80 Using RhodeCode with SSH
81 81 ------------------------
82 82
83 83 RhodeCode currently only hosts repositories using http and https. (The addition
84 84 of ssh hosting is a planned future feature.) However you can easily use ssh in
85 85 parallel with RhodeCode. (Repository access via ssh is a standard "out of
86 86 the box" feature of mercurial_ and you can use this to access any of the
87 87 repositories that RhodeCode is hosting. See PublishingRepositories_)
88 88
89 89 RhodeCode repository structures are kept in directories with the same name
90 90 as the project. When using repository groups, each group is a subdirectory.
91 91 This allows you to easily use ssh for accessing repositories.
92 92
93 93 In order to use ssh you need to make sure that your web-server and the users
94 94 login accounts have the correct permissions set on the appropriate directories.
95 95 (Note that these permissions are independent of any permissions you have set up
96 96 using the RhodeCode web interface.)
97 97
98 98 If your main directory (the same as set in RhodeCode settings) is for example
99 99 set to **/home/hg** and the repository you are using is named `rhodecode`, then
100 100 to clone via ssh you should run::
101 101
102 102 hg clone ssh://user@server.com/home/hg/rhodecode
103 103
104 104 Using other external tools such as mercurial-server_ or using ssh key based
105 105 authentication is fully supported.
106 106
107 107 Note: In an advanced setup, in order for your ssh access to use the same
108 108 permissions as set up via the RhodeCode web interface, you can create an
109 109 authentication hook to connect to the rhodecode db and runs check functions for
110 110 permissions against that.
111 111
112 112 Setting up Whoosh full text search
113 113 ----------------------------------
114 114
115 115 Starting from version 1.1 the whoosh index can be build by using the paster
116 116 command ``make-index``. To use ``make-index`` you must specify the configuration
117 117 file that stores the location of the index. You may specify the location of the
118 118 repositories (`--repo-location`). If not specified, this value is retrieved
119 119 from the RhodeCode database. This was required prior to 1.2. Starting from
120 120 version 1.2 it is also possible to specify a comma separated list of
121 121 repositories (`--index-only`) to build index only on chooses repositories
122 122 skipping any other found in repos location
123 123
124 124 You may optionally pass the option `-f` to enable a full index rebuild. Without
125 125 the `-f` option, indexing will run always in "incremental" mode.
126 126
127 127 For an incremental index build use::
128 128
129 129 paster make-index production.ini
130 130
131 131 For a full index rebuild use::
132 132
133 133 paster make-index production.ini -f
134 134
135 135
136 136 building index just for chosen repositories is possible with such command::
137 137
138 138 paster make-index production.ini --index-only=vcs,rhodecode
139 139
140 140
141 141 In order to do periodical index builds and keep your index always up to date.
142 142 It's recommended to do a crontab entry for incremental indexing.
143 143 An example entry might look like this::
144 144
145 145 /path/to/python/bin/paster make-index /path/to/rhodecode/production.ini
146 146
147 147 When using incremental mode (the default) whoosh will check the last
148 148 modification date of each file and add it to be reindexed if a newer file is
149 149 available. The indexing daemon checks for any removed files and removes them
150 150 from index.
151 151
152 152 If you want to rebuild index from scratch, you can use the `-f` flag as above,
153 153 or in the admin panel you can check `build from scratch` flag.
154 154
155 155
156 156 Setting up LDAP support
157 157 -----------------------
158 158
159 159 RhodeCode starting from version 1.1 supports ldap authentication. In order
160 160 to use LDAP, you have to install the python-ldap_ package. This package is
161 161 available via pypi, so you can install it by running
162 162
163 163 using easy_install::
164 164
165 165 easy_install python-ldap
166 166
167 167 using pip::
168 168
169 169 pip install python-ldap
170 170
171 171 .. note::
172 172 python-ldap requires some certain libs on your system, so before installing
173 173 it check that you have at least `openldap`, and `sasl` libraries.
174 174
175 175 LDAP settings are located in admin->ldap section,
176 176
177 177 Here's a typical ldap setup::
178 178
179 179 Connection settings
180 180 Enable LDAP = checked
181 181 Host = host.example.org
182 182 Port = 389
183 183 Account = <account>
184 184 Password = <password>
185 185 Connection Security = LDAPS connection
186 186 Certificate Checks = DEMAND
187 187
188 188 Search settings
189 189 Base DN = CN=users,DC=host,DC=example,DC=org
190 190 LDAP Filter = (&(objectClass=user)(!(objectClass=computer)))
191 191 LDAP Search Scope = SUBTREE
192 192
193 193 Attribute mappings
194 194 Login Attribute = uid
195 195 First Name Attribute = firstName
196 196 Last Name Attribute = lastName
197 197 E-mail Attribute = mail
198 198
199 199 If your user groups are placed in a Organisation Unit (OU) structure the Search Settings configuration differs::
200 200
201 201 Search settings
202 202 Base DN = DC=host,DC=example,DC=org
203 203 LDAP Filter = (&(memberOf=CN=your user group,OU=subunit,OU=unit,DC=host,DC=example,DC=org)(objectClass=user))
204 204 LDAP Search Scope = SUBTREE
205 205
206 206 .. _enable_ldap:
207 207
208 208 Enable LDAP : required
209 209 Whether to use LDAP for authenticating users.
210 210
211 211 .. _ldap_host:
212 212
213 213 Host : required
214 214 LDAP server hostname or IP address. Can be also a comma separated
215 215 list of servers to support LDAP fail-over.
216 216
217 217 .. _Port:
218 218
219 219 Port : required
220 220 389 for un-encrypted LDAP, 636 for SSL-encrypted LDAP.
221 221
222 222 .. _ldap_account:
223 223
224 224 Account : optional
225 225 Only required if the LDAP server does not allow anonymous browsing of
226 226 records. This should be a special account for record browsing. This
227 227 will require `LDAP Password`_ below.
228 228
229 229 .. _LDAP Password:
230 230
231 231 Password : optional
232 232 Only required if the LDAP server does not allow anonymous browsing of
233 233 records.
234 234
235 235 .. _Enable LDAPS:
236 236
237 237 Connection Security : required
238 238 Defines the connection to LDAP server
239 239
240 240 No encryption
241 241 Plain non encrypted connection
242 242
243 243 LDAPS connection
244 244 Enable ldaps connection. It will likely require `Port`_ to be set to
245 245 a different value (standard LDAPS port is 636). When LDAPS is enabled
246 246 then `Certificate Checks`_ is required.
247 247
248 248 START_TLS on LDAP connection
249 249 START TLS connection
250 250
251 251 .. _Certificate Checks:
252 252
253 253 Certificate Checks : optional
254 254 How SSL certificates verification is handled - this is only useful when
255 255 `Enable LDAPS`_ is enabled. Only DEMAND or HARD offer full SSL security
256 256 while the other options are susceptible to man-in-the-middle attacks. SSL
257 257 certificates can be installed to /etc/openldap/cacerts so that the
258 258 DEMAND or HARD options can be used with self-signed certificates or
259 259 certificates that do not have traceable certificates of authority.
260 260
261 261 NEVER
262 262 A serve certificate will never be requested or checked.
263 263
264 264 ALLOW
265 265 A server certificate is requested. Failure to provide a
266 266 certificate or providing a bad certificate will not terminate the
267 267 session.
268 268
269 269 TRY
270 270 A server certificate is requested. Failure to provide a
271 271 certificate does not halt the session; providing a bad certificate
272 272 halts the session.
273 273
274 274 DEMAND
275 275 A server certificate is requested and must be provided and
276 276 authenticated for the session to proceed.
277 277
278 278 HARD
279 279 The same as DEMAND.
280 280
281 281 .. _Base DN:
282 282
283 283 Base DN : required
284 284 The Distinguished Name (DN) where searches for users will be performed.
285 285 Searches can be controlled by `LDAP Filter`_ and `LDAP Search Scope`_.
286 286
287 287 .. _LDAP Filter:
288 288
289 289 LDAP Filter : optional
290 290 A LDAP filter defined by RFC 2254. This is more useful when `LDAP
291 291 Search Scope`_ is set to SUBTREE. The filter is useful for limiting
292 292 which LDAP objects are identified as representing Users for
293 293 authentication. The filter is augmented by `Login Attribute`_ below.
294 294 This can commonly be left blank.
295 295
296 296 .. _LDAP Search Scope:
297 297
298 298 LDAP Search Scope : required
299 299 This limits how far LDAP will search for a matching object.
300 300
301 301 BASE
302 302 Only allows searching of `Base DN`_ and is usually not what you
303 303 want.
304 304
305 305 ONELEVEL
306 306 Searches all entries under `Base DN`_, but not Base DN itself.
307 307
308 308 SUBTREE
309 309 Searches all entries below `Base DN`_, but not Base DN itself.
310 310 When using SUBTREE `LDAP Filter`_ is useful to limit object
311 311 location.
312 312
313 313 .. _Login Attribute:
314 314
315 315 Login Attribute : required
316 316 The LDAP record attribute that will be matched as the USERNAME or
317 317 ACCOUNT used to connect to RhodeCode. This will be added to `LDAP
318 318 Filter`_ for locating the User object. If `LDAP Filter`_ is specified as
319 319 "LDAPFILTER", `Login Attribute`_ is specified as "uid" and the user has
320 320 connected as "jsmith" then the `LDAP Filter`_ will be augmented as below
321 321 ::
322 322
323 323 (&(LDAPFILTER)(uid=jsmith))
324 324
325 325 .. _ldap_attr_firstname:
326 326
327 327 First Name Attribute : required
328 328 The LDAP record attribute which represents the user's first name.
329 329
330 330 .. _ldap_attr_lastname:
331 331
332 332 Last Name Attribute : required
333 333 The LDAP record attribute which represents the user's last name.
334 334
335 335 .. _ldap_attr_email:
336 336
337 337 Email Attribute : required
338 338 The LDAP record attribute which represents the user's email address.
339 339
340 340 If all data are entered correctly, and python-ldap_ is properly installed
341 341 users should be granted access to RhodeCode with ldap accounts. At this
342 342 time user information is copied from LDAP into the RhodeCode user database.
343 343 This means that updates of an LDAP user object may not be reflected as a
344 344 user update in RhodeCode.
345 345
346 346 If You have problems with LDAP access and believe You entered correct
347 347 information check out the RhodeCode logs, any error messages sent from LDAP
348 348 will be saved there.
349 349
350 350 Active Directory
351 351 ''''''''''''''''
352 352
353 353 RhodeCode can use Microsoft Active Directory for user authentication. This
354 354 is done through an LDAP or LDAPS connection to Active Directory. The
355 355 following LDAP configuration settings are typical for using Active
356 356 Directory ::
357 357
358 358 Base DN = OU=SBSUsers,OU=Users,OU=MyBusiness,DC=v3sys,DC=local
359 359 Login Attribute = sAMAccountName
360 360 First Name Attribute = givenName
361 361 Last Name Attribute = sn
362 362 E-mail Attribute = mail
363 363
364 364 All other LDAP settings will likely be site-specific and should be
365 365 appropriately configured.
366 366
367 367
368 368 Authentication by container or reverse-proxy
369 369 --------------------------------------------
370 370
371 371 Starting with version 1.3, RhodeCode supports delegating the authentication
372 372 of users to its WSGI container, or to a reverse-proxy server through which all
373 373 clients access the application.
374 374
375 375 When these authentication methods are enabled in RhodeCode, it uses the
376 376 username that the container/proxy (Apache/Nginx/etc) authenticated and doesn't
377 377 perform the authentication itself. The authorization, however, is still done by
378 378 RhodeCode according to its settings.
379 379
380 380 When a user logs in for the first time using these authentication methods,
381 381 a matching user account is created in RhodeCode with default permissions. An
382 382 administrator can then modify it using RhodeCode's admin interface.
383 383 It's also possible for an administrator to create accounts and configure their
384 384 permissions before the user logs in for the first time.
385 385
386 386 Container-based authentication
387 387 ''''''''''''''''''''''''''''''
388 388
389 389 In a container-based authentication setup, RhodeCode reads the user name from
390 390 the ``REMOTE_USER`` server variable provided by the WSGI container.
391 391
392 392 After setting up your container (see `Apache's WSGI config`_), you'd need
393 393 to configure it to require authentication on the location configured for
394 394 RhodeCode.
395 395
396 396 In order for RhodeCode to start using the provided username, you should set the
397 397 following in the [app:main] section of your .ini file::
398 398
399 399 container_auth_enabled = true
400 400
401 401
402 402 Proxy pass-through authentication
403 403 '''''''''''''''''''''''''''''''''
404 404
405 405 In a proxy pass-through authentication setup, RhodeCode reads the user name
406 406 from the ``X-Forwarded-User`` request header, which should be configured to be
407 407 sent by the reverse-proxy server.
408 408
409 409 After setting up your proxy solution (see `Apache virtual host reverse proxy example`_,
410 410 `Apache as subdirectory`_ or `Nginx virtual host example`_), you'd need to
411 411 configure the authentication and add the username in a request header named
412 412 ``X-Forwarded-User``.
413 413
414 414 For example, the following config section for Apache sets a subdirectory in a
415 415 reverse-proxy setup with basic auth::
416 416
417 417 <Location /<someprefix> >
418 418 ProxyPass http://127.0.0.1:5000/<someprefix>
419 419 ProxyPassReverse http://127.0.0.1:5000/<someprefix>
420 420 SetEnvIf X-Url-Scheme https HTTPS=1
421 421
422 422 AuthType Basic
423 423 AuthName "RhodeCode authentication"
424 424 AuthUserFile /home/web/rhodecode/.htpasswd
425 425 require valid-user
426 426
427 427 RequestHeader unset X-Forwarded-User
428 428
429 429 RewriteEngine On
430 430 RewriteCond %{LA-U:REMOTE_USER} (.+)
431 431 RewriteRule .* - [E=RU:%1]
432 432 RequestHeader set X-Forwarded-User %{RU}e
433 433 </Location>
434 434
435 435 In order for RhodeCode to start using the forwarded username, you should set
436 436 the following in the [app:main] section of your .ini file::
437 437
438 438 proxypass_auth_enabled = true
439 439
440 440 .. note::
441 441 If you enable proxy pass-through authentication, make sure your server is
442 442 only accessible through the proxy. Otherwise, any client would be able to
443 443 forge the authentication header and could effectively become authenticated
444 444 using any account of their liking.
445 445
446 446 Integration with Issue trackers
447 447 -------------------------------
448 448
449 449 RhodeCode provides a simple integration with issue trackers. It's possible
450 450 to define a regular expression that will fetch issue id stored in commit
451 451 messages and replace that with an url to this issue. To enable this simply
452 452 uncomment following variables in the ini file::
453 453
454 454 issue_pat = (?:^#|\s#)(\w+)
455 455 issue_server_link = https://myissueserver.com/{repo}/issue/{id}
456 456 issue_prefix = #
457 457
458 458 `issue_pat` is the regular expression that will fetch issues from commit messages.
459 459 Default regex will match issues in format of #<number> eg. #300.
460 460
461 461 Matched issues will be replace with the link specified as `issue_server_link`
462 462 {id} will be replaced with issue id, and {repo} with repository name.
463 463 Since the # is striped `issue_prefix` is added as a prefix to url.
464 464 `issue_prefix` can be something different than # if you pass
465 465 ISSUE- as issue prefix this will generate an url in format::
466 466
467 467 <a href="https://myissueserver.com/example_repo/issue/300">ISSUE-300</a>
468 468
469 469 Hook management
470 470 ---------------
471 471
472 472 Hooks can be managed in similar way to this used in .hgrc files.
473 473 To access hooks setting click `advanced setup` on Hooks section of Mercurial
474 474 Settings in Admin.
475 475
476 476 There are 4 built in hooks that cannot be changed (only enable/disable by
477 477 checkboxes on previos section).
478 478 To add another custom hook simply fill in first section with
479 479 <name>.<hook_type> and the second one with hook path. Example hooks
480 480 can be found at *rhodecode.lib.hooks*.
481 481
482 482
483 483 Changing default encoding
484 484 -------------------------
485 485
486 486 By default RhodeCode uses utf8 encoding, starting from 1.3 series this
487 487 can be changed, simply edit default_encoding in .ini file to desired one.
488 488 This affects many parts in rhodecode including committers names, filenames,
489 489 encoding of commit messages. In addition RhodeCode can detect if `chardet`
490 490 library is installed. If `chardet` is detected RhodeCode will fallback to it
491 491 when there are encode/decode errors.
492 492
493 493
494 494 Setting Up Celery
495 495 -----------------
496 496
497 497 Since version 1.1 celery is configured by the rhodecode ini configuration files.
498 498 Simply set use_celery=true in the ini file then add / change the configuration
499 499 variables inside the ini file.
500 500
501 501 Remember that the ini files use the format with '.' not with '_' like celery.
502 502 So for example setting `BROKER_HOST` in celery means setting `broker.host` in
503 503 the config file.
504 504
505 505 In order to start using celery run::
506 506
507 507 paster celeryd <configfile.ini>
508 508
509 509
510 510 .. note::
511 511 Make sure you run this command from the same virtualenv, and with the same
512 512 user that rhodecode runs.
513 513
514 514 HTTPS support
515 515 -------------
516 516
517 517 There are two ways to enable https:
518 518
519 519 - Set HTTP_X_URL_SCHEME in your http server headers, than rhodecode will
520 520 recognize this headers and make proper https redirections
521 521 - Alternatively, change the `force_https = true` flag in the ini configuration
522 522 to force using https, no headers are needed than to enable https
523 523
524 524
525 525 Nginx virtual host example
526 526 --------------------------
527 527
528 528 Sample config for nginx using proxy::
529 529
530 530 upstream rc {
531 531 server 127.0.0.1:5000;
532 532 # add more instances for load balancing
533 533 #server 127.0.0.1:5001;
534 534 #server 127.0.0.1:5002;
535 535 }
536 536
537 537 ## gist alias
538 538 server {
539 539 listen 443;
540 540 server_name gist.myserver.com;
541 541 access_log /var/log/nginx/gist.access.log;
542 542 error_log /var/log/nginx/gist.error.log;
543 543
544 544 ssl on;
545 545 ssl_certificate gist.rhodecode.myserver.com.crt;
546 546 ssl_certificate_key gist.rhodecode.myserver.com.key;
547 547
548 548 ssl_session_timeout 5m;
549 549
550 550 ssl_protocols SSLv3 TLSv1;
551 551 ssl_ciphers DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:EDH-RSA-DES-CBC3-SHA:AES256-SHA:DES-CBC3-SHA:AES128-SHA:RC4-SHA:RC4-MD5;
552 552 ssl_prefer_server_ciphers on;
553 553
554 554 rewrite ^/(.+)$ https://rhodecode.myserver.com/_admin/gists/$1;
555 555 rewrite (.*) https://rhodecode.myserver.com/_admin/gists;
556 556 }
557 557
558 558 server {
559 559 listen 443;
560 560 server_name rhodecode.myserver.com;
561 561 access_log /var/log/nginx/rhodecode.access.log;
562 562 error_log /var/log/nginx/rhodecode.error.log;
563 563
564 564 ssl on;
565 565 ssl_certificate rhodecode.myserver.com.crt;
566 566 ssl_certificate_key rhodecode.myserver.com.key;
567 567
568 568 ssl_session_timeout 5m;
569 569
570 570 ssl_protocols SSLv3 TLSv1;
571 571 ssl_ciphers DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:EDH-RSA-DES-CBC3-SHA:AES256-SHA:DES-CBC3-SHA:AES128-SHA:RC4-SHA:RC4-MD5;
572 572 ssl_prefer_server_ciphers on;
573 573
574 574 ## uncomment root directive if you want to serve static files by nginx
575 575 ## requires static_files = false in .ini file
576 576 #root /path/to/installation/rhodecode/public;
577 577 include /etc/nginx/proxy.conf;
578 578 location / {
579 579 try_files $uri @rhode;
580 580 }
581 581
582 582 location @rhode {
583 583 proxy_pass http://rc;
584 584 }
585 585
586 586 }
587 587
588 588 Here's the proxy.conf. It's tuned so it will not timeout on long
589 589 pushes or large pushes::
590 590
591 591 proxy_redirect off;
592 592 proxy_set_header Host $host;
593 593 ## needed for container auth
594 594 #proxy_set_header REMOTE_USER $remote_user;
595 595 #proxy_set_header X-Forwarded-User $remote_user;
596 596 proxy_set_header X-Url-Scheme $scheme;
597 597 proxy_set_header X-Host $http_host;
598 598 proxy_set_header X-Real-IP $remote_addr;
599 599 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
600 600 proxy_set_header Proxy-host $proxy_host;
601 601 proxy_buffering off;
602 602 proxy_connect_timeout 7200;
603 603 proxy_send_timeout 7200;
604 604 proxy_read_timeout 7200;
605 605 proxy_buffers 8 32k;
606 606 client_max_body_size 1024m;
607 607 client_body_buffer_size 128k;
608 608 large_client_header_buffers 8 64k;
609 609
610 610
611 611 Apache virtual host reverse proxy example
612 612 -----------------------------------------
613 613
614 614 Here is a sample configuration file for apache using proxy::
615 615
616 616 <VirtualHost *:80>
617 617 ServerName hg.myserver.com
618 618 ServerAlias hg.myserver.com
619 619
620 620 <Proxy *>
621 621 Order allow,deny
622 622 Allow from all
623 623 </Proxy>
624 624
625 625 #important !
626 626 #Directive to properly generate url (clone url) for pylons
627 627 ProxyPreserveHost On
628 628
629 629 #rhodecode instance
630 630 ProxyPass / http://127.0.0.1:5000/
631 631 ProxyPassReverse / http://127.0.0.1:5000/
632 632
633 633 #to enable https use line below
634 634 #SetEnvIf X-Url-Scheme https HTTPS=1
635 635
636 636 </VirtualHost>
637 637
638 638
639 639 Additional tutorial
640 640 http://wiki.pylonshq.com/display/pylonscookbook/Apache+as+a+reverse+proxy+for+Pylons
641 641
642 642
643 643 Apache as subdirectory
644 644 ----------------------
645 645
646 646 Apache subdirectory part::
647 647
648 648 <Location /<someprefix> >
649 649 ProxyPass http://127.0.0.1:5000/<someprefix>
650 650 ProxyPassReverse http://127.0.0.1:5000/<someprefix>
651 651 SetEnvIf X-Url-Scheme https HTTPS=1
652 652 </Location>
653 653
654 654 Besides the regular apache setup you will need to add the following line
655 655 into [app:main] section of your .ini file::
656 656
657 657 filter-with = proxy-prefix
658 658
659 659 Add the following at the end of the .ini file::
660 660
661 661 [filter:proxy-prefix]
662 662 use = egg:PasteDeploy#prefix
663 663 prefix = /<someprefix>
664 664
665 665
666 666 then change <someprefix> into your chosen prefix
667 667
668 668 Apache's WSGI config
669 669 --------------------
670 670
671 671 Alternatively, RhodeCode can be set up with Apache under mod_wsgi. For
672 672 that, you'll need to:
673 673
674 674 - Install mod_wsgi. If using a Debian-based distro, you can install
675 675 the package libapache2-mod-wsgi::
676 676
677 677 aptitude install libapache2-mod-wsgi
678 678
679 679 - Enable mod_wsgi::
680 680
681 681 a2enmod wsgi
682 682
683 683 - Create a wsgi dispatch script, like the one below. Make sure you
684 684 check the paths correctly point to where you installed RhodeCode
685 685 and its Python Virtual Environment.
686 686 - Enable the WSGIScriptAlias directive for the wsgi dispatch script,
687 687 as in the following example. Once again, check the paths are
688 688 correctly specified.
689 689
690 690 Here is a sample excerpt from an Apache Virtual Host configuration file::
691 691
692 692 WSGIDaemonProcess pylons \
693 693 threads=4 \
694 694 python-path=/home/web/rhodecode/pyenv/lib/python2.6/site-packages
695 695 WSGIScriptAlias / /home/web/rhodecode/dispatch.wsgi
696 696 WSGIPassAuthorization On
697 697
698 698 .. note::
699 699 when running apache as root please add: `user=www-data group=www-data`
700 700 into above configuration
701 701
702 702 .. note::
703 703 Running RhodeCode in multiprocess mode in apache is not supported,
704 704 make sure you don't specify `processes=num` directive in the config
705 705
706 706
707 707 Example wsgi dispatch script::
708 708
709 709 import os
710 710 os.environ["HGENCODING"] = "UTF-8"
711 711 os.environ['PYTHON_EGG_CACHE'] = '/home/web/rhodecode/.egg-cache'
712 712
713 713 # sometimes it's needed to set the curent dir
714 714 os.chdir('/home/web/rhodecode/')
715 715
716 716 import site
717 717 site.addsitedir("/home/web/rhodecode/pyenv/lib/python2.6/site-packages")
718 718
719 719 from paste.deploy import loadapp
720 720 from paste.script.util.logging_config import fileConfig
721 721
722 722 fileConfig('/home/web/rhodecode/production.ini')
723 723 application = loadapp('config:/home/web/rhodecode/production.ini')
724 724
725 725 Note: when using mod_wsgi you'll need to install the same version of
726 726 Mercurial that's inside RhodeCode's virtualenv also on the system's Python
727 727 environment.
728 728
729 729
730 730 Other configuration files
731 731 -------------------------
732 732
733 733 Some example init.d scripts can be found in init.d directory::
734 734
735 https://secure.rhodecode.org/rhodecode/files/beta/init.d
735 https://kallithea-scm.org/repos/kallithea/files/tip/init.d/
736 736
737 737 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
738 738 .. _python: http://www.python.org/
739 739 .. _mercurial: http://mercurial.selenic.com/
740 740 .. _celery: http://celeryproject.org/
741 741 .. _rabbitmq: http://www.rabbitmq.com/
742 742 .. _python-ldap: http://www.python-ldap.org/
743 743 .. _mercurial-server: http://www.lshift.net/mercurial-server.html
744 744 .. _PublishingRepositories: http://mercurial.selenic.com/wiki/PublishingRepositories
745 .. _Issues tracker: https://bitbucket.org/marcinkuzminski/rhodecode/issues
745 .. _Issues tracker: https://bitbucket.org/conservancy/kallithea/issues
746 746 .. _google group rhodecode: http://groups.google.com/group/rhodecode
@@ -1,82 +1,82 b''
1 1 .. _troubleshooting:
2 2
3 3
4 4 ===============
5 5 Troubleshooting
6 6 ===============
7 7
8 8 :Q: **Missing static files?**
9 9 :A: Make sure either to set the `static_files = true` in the .ini file or
10 10 double check the root path for your http setup. It should point to
11 11 for example:
12 12 /home/my-virtual-python/lib/python2.6/site-packages/rhodecode/public
13 13
14 14 |
15 15
16 16 :Q: **Can't install celery/rabbitmq?**
17 17 :A: Don't worry RhodeCode works without them too. No extra setup is required.
18 18 Try out great celery docs for further help.
19 19
20 20 |
21 21
22 22 :Q: **Long lasting push timeouts?**
23 23 :A: Make sure you set a longer timeouts in your proxy/fcgi settings, timeouts
24 24 are caused by https server and not RhodeCode.
25 25
26 26 |
27 27
28 28 :Q: **Large pushes timeouts?**
29 29 :A: Make sure you set a proper max_body_size for the http server. Very often
30 30 Apache, Nginx or other http servers kill the connection due to to large
31 31 body.
32 32
33 33 |
34 34
35 35 :Q: **Apache doesn't pass basicAuth on pull/push?**
36 36 :A: Make sure you added `WSGIPassAuthorization true`.
37 37
38 38 |
39 39
40 40 :Q: **Git fails on push/pull?**
41 41 :A: Make sure you're using an wsgi http server that can handle chunked encoding
42 42 such as `waitress` or `gunicorn`
43 43
44 44 |
45 45
46 46 :Q: **How i use hooks in RhodeCode?**
47 47 :A: It's easy if they are python hooks just use advanced link in hooks section
48 48 in Admin panel, that works only for Mercurial. If you want to use githooks,
49 49 just install proper one in repository eg. create file in
50 50 `/gitrepo/hooks/pre-receive`. You can also use RhodeCode-extensions to
51 51 connect to callback hooks, for both Git and Mercurial.
52 52
53 53 |
54 54
55 55 :Q: **RhodeCode is slow for me, how can i make it faster?**
56 56 :A: See the :ref:`performance` section
57 57
58 58 |
59 59
60 60 :Q: **UnicodeDecodeError on Apache mod_wsgi**
61 61 :A: Please read: https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/modwsgi/#if-you-get-a-unicodeencodeerror
62 62
63 63 |
64 64
65 65 :Q: **Requests hanging on Windows**
66 66 :A: Please try out with disabled Antivirus software, there are some known problems with Eset Anitivirus. Make sure
67 67 you have installed latest windows patches (especially KB2789397)
68 68
69 69
70 70 For further questions search the `Issues tracker`_, or post a message in the
71 71 `google group rhodecode`_
72 72
73 73 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
74 74 .. _python: http://www.python.org/
75 75 .. _mercurial: http://mercurial.selenic.com/
76 76 .. _celery: http://celeryproject.org/
77 77 .. _rabbitmq: http://www.rabbitmq.com/
78 78 .. _python-ldap: http://www.python-ldap.org/
79 79 .. _mercurial-server: http://www.lshift.net/mercurial-server.html
80 80 .. _PublishingRepositories: http://mercurial.selenic.com/wiki/PublishingRepositories
81 .. _Issues tracker: https://bitbucket.org/marcinkuzminski/rhodecode/issues
81 .. _Issues tracker: https://bitbucket.org/conservancy/kallithea/issues
82 82 .. _google group rhodecode: http://groups.google.com/group/rhodecode
@@ -1,588 +1,588 b''
1 1 ################################################################################
2 2 ################################################################################
3 3 # RhodeCode - Pylons environment configuration #
4 4 # #
5 5 # The %(here)s variable will be replaced with the parent directory of this file#
6 6 ################################################################################
7 7
8 8 [DEFAULT]
9 9 debug = true
10 10 pdebug = false
11 11 ################################################################################
12 12 ## Uncomment and replace with the address which should receive ##
13 13 ## any error reports after application crash ##
14 14 ## Additionally those settings will be used by RhodeCode mailing system ##
15 15 ################################################################################
16 16 #email_to = admin@localhost
17 17 #error_email_from = paste_error@localhost
18 18 #app_email_from = rhodecode-noreply@localhost
19 19 #error_message =
20 20 #email_prefix = [RhodeCode]
21 21
22 22 #smtp_server = mail.server.com
23 23 #smtp_username =
24 24 #smtp_password =
25 25 #smtp_port =
26 26 #smtp_use_tls = false
27 27 #smtp_use_ssl = true
28 28 ## Specify available auth parameters here (e.g. LOGIN PLAIN CRAM-MD5, etc.)
29 29 #smtp_auth =
30 30
31 31 [server:main]
32 32 ## PASTE ##
33 33 #use = egg:Paste#http
34 34 ## nr of worker threads to spawn
35 35 #threadpool_workers = 5
36 36 ## max request before thread respawn
37 37 #threadpool_max_requests = 10
38 38 ## option to use threads of process
39 39 #use_threadpool = true
40 40
41 41 ## WAITRESS ##
42 42 use = egg:waitress#main
43 43 ## number of worker threads
44 44 threads = 5
45 45 ## MAX BODY SIZE 100GB
46 46 max_request_body_size = 107374182400
47 47 ## use poll instead of select, fixes fd limits, may not work on old
48 48 ## windows systems.
49 49 #asyncore_use_poll = True
50 50
51 51 ## GUNICORN ##
52 52 #use = egg:gunicorn#main
53 53 ## number of process workers. You must set `instance_id = *` when this option
54 54 ## is set to more than one worker
55 55 #workers = 1
56 56 ## process name
57 57 #proc_name = rhodecode
58 58 ## type of worker class, one of sync, eventlet, gevent, tornado
59 59 ## recommended for bigger setup is using of of other than sync one
60 60 #worker_class = sync
61 61 #max_requests = 5
62 62 ## ammount of time a worker can handle request before it gets killed and
63 63 ## restarted
64 64 #timeout = 3600
65 65
66 66 ## UWSGI ##
67 67 ## run with uwsgi --ini-paste-logged <inifile.ini>
68 68 #[uwsgi]
69 69 #socket = /tmp/uwsgi.sock
70 70 #master = true
71 71 #http = 127.0.0.1:5000
72 72
73 73 ## set as deamon and redirect all output to file
74 74 #daemonize = ./uwsgi_rhodecode.log
75 75
76 76 ## master process PID
77 77 #pidfile = ./uwsgi_rhodecode.pid
78 78
79 79 ## stats server with workers statistics, use uwsgitop
80 80 ## for monitoring, `uwsgitop 127.0.0.1:1717`
81 81 #stats = 127.0.0.1:1717
82 82 #memory-report = true
83 83
84 84 ## log 5XX errors
85 85 #log-5xx = true
86 86
87 87 ## Set the socket listen queue size.
88 88 #listen = 256
89 89
90 90 ## Gracefully Reload workers after the specified amount of managed requests
91 91 ## (avoid memory leaks).
92 92 #max-requests = 1000
93 93
94 94 ## enable large buffers
95 95 #buffer-size=65535
96 96
97 97 ## socket and http timeouts ##
98 98 #http-timeout=3600
99 99 #socket-timeout=3600
100 100
101 101 ## Log requests slower than the specified number of milliseconds.
102 102 #log-slow = 10
103 103
104 104 ## Exit if no app can be loaded.
105 105 #need-app = true
106 106
107 107 ## Set lazy mode (load apps in workers instead of master).
108 108 #lazy = true
109 109
110 110 ## scaling ##
111 111 ## set cheaper algorithm to use, if not set default will be used
112 112 #cheaper-algo = spare
113 113
114 114 ## minimum number of workers to keep at all times
115 115 #cheaper = 1
116 116
117 117 ## number of workers to spawn at startup
118 118 #cheaper-initial = 1
119 119
120 120 ## maximum number of workers that can be spawned
121 121 #workers = 4
122 122
123 123 ## how many workers should be spawned at a time
124 124 #cheaper-step = 1
125 125
126 126 ## COMMON ##
127 127 host = 127.0.0.1
128 128 port = 5000
129 129
130 130 ## prefix middleware for rc
131 131 #[filter:proxy-prefix]
132 132 #use = egg:PasteDeploy#prefix
133 133 #prefix = /<your-prefix>
134 134
135 135 [app:main]
136 136 use = egg:rhodecode
137 137 ## enable proxy prefix middleware
138 138 #filter-with = proxy-prefix
139 139
140 140 full_stack = true
141 141 static_files = true
142 142 ## Optional Languages
143 143 ## en, fr, ja, pt_BR, zh_CN, zh_TW, pl
144 144 lang = en
145 145 cache_dir = %(here)s/data
146 146 index_dir = %(here)s/data/index
147 147
148 148 ## perform a full repository scan on each server start, this should be
149 149 ## set to false after first startup, to allow faster server restarts.
150 150 initial_repo_scan = true
151 151
152 152 ## uncomment and set this path to use archive download cache
153 153 #archive_cache_dir = /tmp/tarballcache
154 154
155 155 ## change this to unique ID for security
156 156 app_instance_uuid = rc-production
157 157
158 158 ## cut off limit for large diffs (size in bytes)
159 159 cut_off_limit = 256000
160 160
161 161 ## use cache version of scm repo everywhere
162 162 vcs_full_cache = true
163 163
164 164 ## force https in RhodeCode, fixes https redirects, assumes it's always https
165 165 force_https = false
166 166
167 167 ## use Strict-Transport-Security headers
168 168 use_htsts = false
169 169
170 170 ## number of commits stats will parse on each iteration
171 171 commit_parse_limit = 25
172 172
173 173 ## use gravatar service to display avatars
174 174 use_gravatar = true
175 175
176 176 ## path to git executable
177 177 git_path = git
178 178
179 179 ## git rev filter option, --all is the default filter, if you need to
180 180 ## hide all refs in changelog switch this to --branches --tags
181 181 git_rev_filter=--all
182 182
183 183 ## RSS feed options
184 184 rss_cut_off_limit = 256000
185 185 rss_items_per_page = 10
186 186 rss_include_diff = false
187 187
188 188 ## options for showing and identifying changesets
189 189 show_sha_length = 12
190 190 show_revision_number = true
191 191
192 192 ## gist URL alias, used to create nicer urls for gist. This should be an
193 193 ## url that does rewrites to _admin/gists/<gistid>.
194 194 ## example: http://gist.rhodecode.org/{gistid}. Empty means use the internal
195 195 ## RhodeCode url, ie. http[s]://rhodecode.server/_admin/gists/<gistid>
196 196 gist_alias_url =
197 197
198 198 ## white list of API enabled controllers. This allows to add list of
199 199 ## controllers to which access will be enabled by api_key. eg: to enable
200 200 ## api access to raw_files put `FilesController:raw`, to enable access to patches
201 201 ## add `ChangesetController:changeset_patch`. This list should be "," separated
202 202 ## Syntax is <ControllerClass>:<function>. Check debug logs for generated names
203 203 ## Recommended settings bellow are commented out:
204 204 api_access_controllers_whitelist =
205 205 # ChangesetController:changeset_patch,
206 206 # ChangesetController:changeset_raw,
207 207 # FilesController:raw,
208 208 # FilesController:archivefile
209 209
210 210 ## alternative_gravatar_url allows you to use your own avatar server application
211 211 ## the following parts of the URL will be replaced
212 212 ## {email} user email
213 213 ## {md5email} md5 hash of the user email (like at gravatar.com)
214 214 ## {size} size of the image that is expected from the server application
215 215 ## {scheme} http/https from RhodeCode server
216 216 ## {netloc} network location from RhodeCode server
217 217 #alternative_gravatar_url = http://myavatarserver.com/getbyemail/{email}/{size}
218 218 #alternative_gravatar_url = http://myavatarserver.com/getbymd5/{md5email}?s={size}
219 219
220 220
221 221 ## container auth options
222 222 container_auth_enabled = false
223 223 proxypass_auth_enabled = false
224 224
225 225 ## default encoding used to convert from and to unicode
226 226 ## can be also a comma seperated list of encoding in case of mixed encodings
227 227 default_encoding = utf8
228 228
229 229 ## overwrite schema of clone url
230 230 ## available vars:
231 231 ## scheme - http/https
232 232 ## user - current user
233 233 ## pass - password
234 234 ## netloc - network location
235 235 ## path - usually repo_name
236 236
237 237 #clone_uri = {scheme}://{user}{pass}{netloc}{path}
238 238
239 239 ## issue tracker for RhodeCode (leave blank to disable, absent for default)
240 #bugtracker = http://bitbucket.org/marcinkuzminski/rhodecode/issues
240 #bugtracker = https://bitbucket.org/conservancy/kallithea/issues
241 241
242 242 ## issue tracking mapping for commits messages
243 243 ## comment out issue_pat, issue_server, issue_prefix to enable
244 244
245 245 ## pattern to get the issues from commit messages
246 246 ## default one used here is #<numbers> with a regex passive group for `#`
247 247 ## {id} will be all groups matched from this pattern
248 248
249 249 issue_pat = (?:\s*#)(\d+)
250 250
251 251 ## server url to the issue, each {id} will be replaced with match
252 252 ## fetched from the regex and {repo} is replaced with full repository name
253 253 ## including groups {repo_name} is replaced with just name of repo
254 254
255 255 issue_server_link = https://myissueserver.com/{repo}/issue/{id}
256 256
257 257 ## prefix to add to link to indicate it's an url
258 258 ## #314 will be replaced by <issue_prefix><id>
259 259
260 260 issue_prefix = #
261 261
262 262 ## issue_pat, issue_server_link, issue_prefix can have suffixes to specify
263 263 ## multiple patterns, to other issues server, wiki or others
264 264 ## below an example how to create a wiki pattern
265 265 # #wiki-some-id -> https://mywiki.com/some-id
266 266
267 267 #issue_pat_wiki = (?:wiki-)(.+)
268 268 #issue_server_link_wiki = https://mywiki.com/{id}
269 269 #issue_prefix_wiki = WIKI-
270 270
271 271
272 272 ## instance-id prefix
273 273 ## a prefix key for this instance used for cache invalidation when running
274 274 ## multiple instances of rhodecode, make sure it's globally unique for
275 275 ## all running rhodecode instances. Leave empty if you don't use it
276 276 instance_id =
277 277
278 278 ## alternative return HTTP header for failed authentication. Default HTTP
279 279 ## response is 401 HTTPUnauthorized. Currently HG clients have troubles with
280 280 ## handling that. Set this variable to 403 to return HTTPForbidden
281 281 auth_ret_code =
282 282
283 283 ## locking return code. When repository is locked return this HTTP code. 2XX
284 284 ## codes don't break the transactions while 4XX codes do
285 285 lock_ret_code = 423
286 286
287 287 ## allows to change the repository location in settings page
288 288 allow_repo_location_change = True
289 289
290 290 ## allows to setup custom hooks in settings page
291 291 allow_custom_hooks_settings = True
292 292
293 293
294 294 ####################################
295 295 ### CELERY CONFIG ####
296 296 ####################################
297 297 use_celery = false
298 298 broker.host = localhost
299 299 broker.vhost = rabbitmqhost
300 300 broker.port = 5672
301 301 broker.user = rabbitmq
302 302 broker.password = qweqwe
303 303
304 304 celery.imports = rhodecode.lib.celerylib.tasks
305 305
306 306 celery.result.backend = amqp
307 307 celery.result.dburi = amqp://
308 308 celery.result.serialier = json
309 309
310 310 #celery.send.task.error.emails = true
311 311 #celery.amqp.task.result.expires = 18000
312 312
313 313 celeryd.concurrency = 2
314 314 #celeryd.log.file = celeryd.log
315 315 celeryd.log.level = debug
316 316 celeryd.max.tasks.per.child = 1
317 317
318 318 ## tasks will never be sent to the queue, but executed locally instead.
319 319 celery.always.eager = false
320 320
321 321 ####################################
322 322 ### BEAKER CACHE ####
323 323 ####################################
324 324 beaker.cache.data_dir=%(here)s/data/cache/data
325 325 beaker.cache.lock_dir=%(here)s/data/cache/lock
326 326
327 327 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
328 328
329 329 beaker.cache.super_short_term.type=memory
330 330 beaker.cache.super_short_term.expire=10
331 331 beaker.cache.super_short_term.key_length = 256
332 332
333 333 beaker.cache.short_term.type=memory
334 334 beaker.cache.short_term.expire=60
335 335 beaker.cache.short_term.key_length = 256
336 336
337 337 beaker.cache.long_term.type=memory
338 338 beaker.cache.long_term.expire=36000
339 339 beaker.cache.long_term.key_length = 256
340 340
341 341 beaker.cache.sql_cache_short.type=memory
342 342 beaker.cache.sql_cache_short.expire=10
343 343 beaker.cache.sql_cache_short.key_length = 256
344 344
345 345 beaker.cache.sql_cache_med.type=memory
346 346 beaker.cache.sql_cache_med.expire=360
347 347 beaker.cache.sql_cache_med.key_length = 256
348 348
349 349 beaker.cache.sql_cache_long.type=file
350 350 beaker.cache.sql_cache_long.expire=3600
351 351 beaker.cache.sql_cache_long.key_length = 256
352 352
353 353 ####################################
354 354 ### BEAKER SESSION ####
355 355 ####################################
356 356 ## Type of storage used for the session, current types are
357 357 ## dbm, file, memcached, database, and memory.
358 358 ## The storage uses the Container API
359 359 ## that is also used by the cache system.
360 360
361 361 ## db session ##
362 362 #beaker.session.type = ext:database
363 363 #beaker.session.sa.url = postgresql://postgres:qwe@localhost/rhodecode
364 364 #beaker.session.table_name = db_session
365 365
366 366 ## encrypted cookie client side session, good for many instances ##
367 367 #beaker.session.type = cookie
368 368
369 369 ## file based cookies (default) ##
370 370 #beaker.session.type = file
371 371
372 372 beaker.session.key = rhodecode
373 373 beaker.session.secret = production-rc-uytcxaz
374 374
375 375 ## Secure encrypted cookie. Requires AES and AES python libraries
376 376 ## you must disable beaker.session.secret to use this
377 377 #beaker.session.encrypt_key = <key_for_encryption>
378 378 #beaker.session.validate_key = <validation_key>
379 379
380 380 ## sets session as invalid if it haven't been accessed for given amount of time
381 381 beaker.session.timeout = 2592000
382 382 beaker.session.httponly = true
383 383 #beaker.session.cookie_path = /<your-prefix>
384 384
385 385 ## uncomment for https secure cookie
386 386 beaker.session.secure = false
387 387
388 388 ## auto save the session to not to use .save()
389 389 beaker.session.auto = False
390 390
391 391 ## default cookie expiration time in seconds `true` expire at browser close ##
392 392 #beaker.session.cookie_expires = 3600
393 393
394 394
395 395 ############################
396 396 ## ERROR HANDLING SYSTEMS ##
397 397 ############################
398 398
399 399 ####################
400 400 ### [errormator] ###
401 401 ####################
402 402
403 403 ## Errormator is tailored to work with RhodeCode, see
404 404 ## http://errormator.com for details how to obtain an account
405 405 ## you must install python package `errormator_client` to make it work
406 406
407 407 ## errormator enabled
408 408 errormator = false
409 409
410 410 errormator.server_url = https://api.errormator.com
411 411 errormator.api_key = YOUR_API_KEY
412 412
413 413 ## TWEAK AMOUNT OF INFO SENT HERE
414 414
415 415 ## enables 404 error logging (default False)
416 416 errormator.report_404 = false
417 417
418 418 ## time in seconds after request is considered being slow (default 1)
419 419 errormator.slow_request_time = 1
420 420
421 421 ## record slow requests in application
422 422 ## (needs to be enabled for slow datastore recording and time tracking)
423 423 errormator.slow_requests = true
424 424
425 425 ## enable hooking to application loggers
426 426 # errormator.logging = true
427 427
428 428 ## minimum log level for log capture
429 429 # errormator.logging.level = WARNING
430 430
431 431 ## send logs only from erroneous/slow requests
432 432 ## (saves API quota for intensive logging)
433 433 errormator.logging_on_error = false
434 434
435 435 ## list of additonal keywords that should be grabbed from environ object
436 436 ## can be string with comma separated list of words in lowercase
437 437 ## (by default client will always send following info:
438 438 ## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that
439 439 ## start with HTTP* this list be extended with additional keywords here
440 440 errormator.environ_keys_whitelist =
441 441
442 442
443 443 ## list of keywords that should be blanked from request object
444 444 ## can be string with comma separated list of words in lowercase
445 445 ## (by default client will always blank keys that contain following words
446 446 ## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'
447 447 ## this list be extended with additional keywords set here
448 448 errormator.request_keys_blacklist =
449 449
450 450
451 451 ## list of namespaces that should be ignores when gathering log entries
452 452 ## can be string with comma separated list of namespaces
453 453 ## (by default the client ignores own entries: errormator_client.client)
454 454 errormator.log_namespace_blacklist =
455 455
456 456
457 457 ################
458 458 ### [sentry] ###
459 459 ################
460 460
461 461 ## sentry is a alternative open source error aggregator
462 462 ## you must install python packages `sentry` and `raven` to enable
463 463
464 464 sentry.dsn = YOUR_DNS
465 465 sentry.servers =
466 466 sentry.name =
467 467 sentry.key =
468 468 sentry.public_key =
469 469 sentry.secret_key =
470 470 sentry.project =
471 471 sentry.site =
472 472 sentry.include_paths =
473 473 sentry.exclude_paths =
474 474
475 475
476 476 ################################################################################
477 477 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
478 478 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
479 479 ## execute malicious code after an exception is raised. ##
480 480 ################################################################################
481 481 set debug = false
482 482
483 483 ##################################
484 484 ### LOGVIEW CONFIG ###
485 485 ##################################
486 486 logview.sqlalchemy = #faa
487 487 logview.pylons.templating = #bfb
488 488 logview.pylons.util = #eee
489 489
490 490 #########################################################
491 491 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
492 492 #########################################################
493 493 #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30
494 494 sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode
495 495 #sqlalchemy.db1.url = mysql://root:qweqwe@localhost/rhodecode
496 496 sqlalchemy.db1.echo = false
497 497 sqlalchemy.db1.pool_recycle = 3600
498 498 sqlalchemy.db1.convert_unicode = true
499 499
500 500 ################################
501 501 ### LOGGING CONFIGURATION ####
502 502 ################################
503 503 [loggers]
504 504 keys = root, routes, rhodecode, sqlalchemy, beaker, templates, whoosh_indexer
505 505
506 506 [handlers]
507 507 keys = console, console_sql
508 508
509 509 [formatters]
510 510 keys = generic, color_formatter, color_formatter_sql
511 511
512 512 #############
513 513 ## LOGGERS ##
514 514 #############
515 515 [logger_root]
516 516 level = NOTSET
517 517 handlers = console
518 518
519 519 [logger_routes]
520 520 level = DEBUG
521 521 handlers =
522 522 qualname = routes.middleware
523 523 ## "level = DEBUG" logs the route matched and routing variables.
524 524 propagate = 1
525 525
526 526 [logger_beaker]
527 527 level = DEBUG
528 528 handlers =
529 529 qualname = beaker.container
530 530 propagate = 1
531 531
532 532 [logger_templates]
533 533 level = INFO
534 534 handlers =
535 535 qualname = pylons.templating
536 536 propagate = 1
537 537
538 538 [logger_rhodecode]
539 539 level = DEBUG
540 540 handlers =
541 541 qualname = rhodecode
542 542 propagate = 1
543 543
544 544 [logger_sqlalchemy]
545 545 level = INFO
546 546 handlers = console_sql
547 547 qualname = sqlalchemy.engine
548 548 propagate = 0
549 549
550 550 [logger_whoosh_indexer]
551 551 level = DEBUG
552 552 handlers =
553 553 qualname = whoosh_indexer
554 554 propagate = 1
555 555
556 556 ##############
557 557 ## HANDLERS ##
558 558 ##############
559 559
560 560 [handler_console]
561 561 class = StreamHandler
562 562 args = (sys.stderr,)
563 563 level = INFO
564 564 formatter = generic
565 565
566 566 [handler_console_sql]
567 567 class = StreamHandler
568 568 args = (sys.stderr,)
569 569 level = WARN
570 570 formatter = generic
571 571
572 572 ################
573 573 ## FORMATTERS ##
574 574 ################
575 575
576 576 [formatter_generic]
577 577 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
578 578 datefmt = %Y-%m-%d %H:%M:%S
579 579
580 580 [formatter_color_formatter]
581 581 class=rhodecode.lib.colored_formatter.ColorFormatter
582 582 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
583 583 datefmt = %Y-%m-%d %H:%M:%S
584 584
585 585 [formatter_color_formatter_sql]
586 586 class=rhodecode.lib.colored_formatter.ColorFormatterSql
587 587 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
588 588 datefmt = %Y-%m-%d %H:%M:%S
@@ -1,609 +1,609 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%text>
3 3 ################################################################################
4 4 ################################################################################
5 5 # RhodeCode - Example config #
6 6 # Built-in functions and variables #
7 7 # The ${here} variable will be replaced with the parent directory of this file #
8 8 # ${uuid()} function will generate a unique hash #
9 9 ################################################################################
10 10 </%text>
11 11 [DEFAULT]
12 12 debug = true
13 13 pdebug = false
14 14 <%text>
15 15 ################################################################################
16 16 ## Uncomment and replace with the address which should receive ##
17 17 ## any error reports after application crash ##
18 18 ## Additionally those settings will be used by RhodeCode mailing system ##
19 19 ################################################################################
20 20 </%text>
21 21 #email_to = admin@localhost
22 22 #error_email_from = paste_error@localhost
23 23 #app_email_from = rhodecode-noreply@localhost
24 24 #error_message =
25 25 #email_prefix = [RhodeCode]
26 26
27 27 #smtp_server = mail.server.com
28 28 #smtp_username =
29 29 #smtp_password =
30 30 #smtp_port =
31 31 #smtp_use_tls = false
32 32 #smtp_use_ssl = true
33 33 <%text>## Specify available auth parameters here (e.g. LOGIN PLAIN CRAM-MD5, etc.)</%text>
34 34 #smtp_auth =
35 35
36 36 [server:main]
37 37 %if http_server == 'paste':
38 38 <%text>## PASTE ##</%text>
39 39 use = egg:Paste#http
40 40 <%text>## nr of worker threads to spawn</%text>
41 41 threadpool_workers = 5
42 42 <%text>## max request before thread respawn</%text>
43 43 threadpool_max_requests = 10
44 44 <%text>## option to use threads of process</%text>
45 45 use_threadpool = true
46 46 %endif
47 47 %if http_server == 'waitress':
48 48 <%text>## WAITRESS ##</%text>
49 49 use = egg:waitress#main
50 50 <%text>## number of worker threads</%text>
51 51 threads = 5
52 52 <%text>## MAX BODY SIZE 100GB</%text>
53 53 max_request_body_size = 107374182400
54 54 <%text>## use poll instead of select, fixes fd limits, may not work on old</%text>
55 55 <%text>## windows systems.</%text>
56 56 #asyncore_use_poll = True
57 57 %endif
58 58 %if http_server == 'gunicorn':
59 59 <%text>## GUNICORN ##</%text>
60 60 use = egg:gunicorn#main
61 61 <%text>## number of process workers. You must set `instance_id = *` when this option</%text>
62 62 <%text>## is set to more than one worker</%text>
63 63 workers = 1
64 64 <%text>## process name</%text>
65 65 proc_name = rhodecode
66 66 <%text>## type of worker class, one of sync, eventlet, gevent, tornado</%text>
67 67 <%text>## recommended for bigger setup is using of of other than sync one</%text>
68 68 worker_class = sync
69 69 max_requests = 1000
70 70 <%text>## ammount of time a worker can handle request before it gets killed and</%text>
71 71 <%text>## restarted</%text>
72 72 timeout = 3600
73 73 %endif
74 74 %if http_server == 'uwsgi':
75 75 <%text>## UWSGI ##</%text>
76 76 <%text>## run with uwsgi --ini-paste-logged <inifile.ini></%text>
77 77 [uwsgi]
78 78 socket = /tmp/uwsgi.sock
79 79 master = true
80 80 http = 0.0.0.0:5000
81 81
82 82 <%text>## set as deamon and redirect all output to file</%text>
83 83 #daemonize = ./uwsgi_rhodecode.log
84 84
85 85 <%text>## master process PID</%text>
86 86 pidfile = ./uwsgi_rhodecode.pid
87 87
88 88 <%text>## stats server with workers statistics, use uwsgitop</%text>
89 89 <%text>## for monitoring</%text>
90 90 stats = 127.0.0.1:1717
91 91 memory-report = true
92 92
93 93 <%text>## log 5XX errors</%text>
94 94 log-5xx = true
95 95
96 96 <%text>## Set the socket listen queue size.</%text>
97 97 listen = 256
98 98
99 99 <%text>## Gracefully Reload workers after the specified amount of managed requests</%text>
100 100 <%text>## (avoid memory leaks).</%text>
101 101 max-requests = 1000
102 102
103 103 <%text>## enable large buffers</%text>
104 104 buffer-size=65535
105 105
106 106 <%text>## socket and http timeouts ##</%text>
107 107 http-timeout=3600
108 108 socket-timeout=3600
109 109
110 110 <%text>## Log requests slower than the specified number of milliseconds.</%text>
111 111 log-slow = 10
112 112
113 113 <%text>## Exit if no app can be loaded.</%text>
114 114 need-app = true
115 115
116 116 <%text>## Set lazy mode (load apps in workers instead of master).</%text>
117 117 lazy = true
118 118
119 119 <%text>## scaling ##</%text>
120 120 <%text>## set cheaper algorithm to use, if not set default will be used</%text>
121 121 cheaper-algo = spare
122 122
123 123 <%text>## minimum number of workers to keep at all times</%text>
124 124 cheaper = 1
125 125
126 126 <%text>## number of workers to spawn at startup</%text>
127 127 cheaper-initial = 1
128 128
129 129 <%text>## maximum number of workers that can be spawned</%text>
130 130 workers = 4
131 131
132 132 <%text>## how many workers should be spawned at a time</%text>
133 133 cheaper-step = 1
134 134 %endif
135 135 <%text>## COMMON ##</%text>
136 136 host = ${host}
137 137 port = ${port}
138 138
139 139 <%text>## prefix middleware for rc</%text>
140 140 #[filter:proxy-prefix]
141 141 #use = egg:PasteDeploy#prefix
142 142 #prefix = /<your-prefix>
143 143
144 144 [app:main]
145 145 use = egg:rhodecode
146 146 <%text>## enable proxy prefix middleware</%text>
147 147 #filter-with = proxy-prefix
148 148
149 149 full_stack = true
150 150 static_files = true
151 151 <%text>## Optional Languages</%text>
152 152 <%text>## en, fr, ja, pt_BR, zh_CN, zh_TW, pl, ru</%text>
153 153 lang = ${lang}
154 154 cache_dir = ${here}/data
155 155 index_dir = ${here}/data/index
156 156
157 157 <%text>## perform a full repository scan on each server start, this should be</%text>
158 158 <%text>## set to false after first startup, to allow faster server restarts.</%text>
159 159 initial_repo_scan = false
160 160
161 161 <%text>## uncomment and set this path to use archive download cache</%text>
162 162 archive_cache_dir = ${here}/tarballcache
163 163
164 164 <%text>## change this to unique ID for security</%text>
165 165 app_instance_uuid = ${uuid()}
166 166
167 167 <%text>## cut off limit for large diffs (size in bytes)</%text>
168 168 cut_off_limit = 256000
169 169
170 170 <%text>## use cache version of scm repo everywhere</%text>
171 171 vcs_full_cache = true
172 172
173 173 <%text>## force https in RhodeCode, fixes https redirects, assumes it's always https</%text>
174 174 force_https = false
175 175
176 176 <%text>## use Strict-Transport-Security headers</%text>
177 177 use_htsts = false
178 178
179 179 <%text>## number of commits stats will parse on each iteration</%text>
180 180 commit_parse_limit = 25
181 181
182 182 <%text>## use gravatar service to display avatars</%text>
183 183 use_gravatar = true
184 184
185 185 <%text>## path to git executable</%text>
186 186 git_path = git
187 187
188 188 <%text>## git rev filter option, --all is the default filter, if you need to</%text>
189 189 <%text>## hide all refs in changelog switch this to --branches --tags</%text>
190 190 git_rev_filter=--branches --tags
191 191
192 192 <%text>## RSS feed options</%text>
193 193 rss_cut_off_limit = 256000
194 194 rss_items_per_page = 10
195 195 rss_include_diff = false
196 196
197 197 <%text>## options for showing and identifying changesets</%text>
198 198 show_sha_length = 12
199 199 show_revision_number = true
200 200
201 201 <%text>## gist URL alias, used to create nicer urls for gist. This should be an</%text>
202 202 <%text>## url that does rewrites to _admin/gists/<gistid>.</%text>
203 203 <%text>## example: http://gist.rhodecode.org/{gistid}. Empty means use the internal</%text>
204 204 <%text>## RhodeCode url, ie. http[s]://rhodecode.server/_admin/gists/<gistid></%text>
205 205 gist_alias_url =
206 206
207 207 <%text>## white list of API enabled controllers. This allows to add list of</%text>
208 208 <%text>## controllers to which access will be enabled by api_key. eg: to enable</%text>
209 209 <%text>## api access to raw_files put `FilesController:raw`, to enable access to patches</%text>
210 210 <%text>## add `ChangesetController:changeset_patch`. This list should be "," separated</%text>
211 211 <%text>## Syntax is <ControllerClass>:<function>. Check debug logs for generated names</%text>
212 212 api_access_controllers_whitelist =
213 213
214 214 <%text>## alternative_gravatar_url allows you to use your own avatar server application</%text>
215 215 <%text>## the following parts of the URL will be replaced</%text>
216 216 <%text>## {email} user email</%text>
217 217 <%text>## {md5email} md5 hash of the user email (like at gravatar.com)</%text>
218 218 <%text>## {size} size of the image that is expected from the server application</%text>
219 219 <%text>## {scheme} http/https from RhodeCode server</%text>
220 220 <%text>## {netloc} network location from RhodeCode server</%text>
221 221 #alternative_gravatar_url = http://myavatarserver.com/getbyemail/{email}/{size}
222 222 #alternative_gravatar_url = http://myavatarserver.com/getbymd5/{md5email}?s={size}
223 223
224 224
225 225 <%text>## container auth options</%text>
226 226 container_auth_enabled = false
227 227 proxypass_auth_enabled = false
228 228
229 229 <%text>## default encoding used to convert from and to unicode</%text>
230 230 <%text>## can be also a comma seperated list of encoding in case of mixed encodings</%text>
231 231 default_encoding = utf8
232 232
233 233 <%text>## overwrite schema of clone url</%text>
234 234 <%text>## available vars:</%text>
235 235 <%text>## scheme - http/https</%text>
236 236 <%text>## user - current user</%text>
237 237 <%text>## pass - password</%text>
238 238 <%text>## netloc - network location</%text>
239 239 <%text>## path - usually repo_name</%text>
240 240
241 241 #clone_uri = {scheme}://{user}{pass}{netloc}{path}
242 242
243 243 <%text>## issue tracker for RhodeCode (leave blank to disable, absent for default)</%text>
244 #bugtracker = http://bitbucket.org/marcinkuzminski/rhodecode/issues
244 #bugtracker = https://bitbucket.org/conservancy/kallithea/issues
245 245
246 246 <%text>## issue tracking mapping for commits messages</%text>
247 247 <%text>## comment out issue_pat, issue_server, issue_prefix to enable</%text>
248 248
249 249 <%text>## pattern to get the issues from commit messages</%text>
250 250 <%text>## default one used here is #<numbers> with a regex passive group for `#`</%text>
251 251 <%text>## {id} will be all groups matched from this pattern</%text>
252 252
253 253 issue_pat = (?:\s*#)(\d+)
254 254
255 255 <%text>## server url to the issue, each {id} will be replaced with match</%text>
256 256 <%text>## fetched from the regex and {repo} is replaced with full repository name</%text>
257 257 <%text>## including groups {repo_name} is replaced with just name of repo</%text>
258 258
259 259 issue_server_link = https://myissueserver.com/{repo}/issue/{id}
260 260
261 261 <%text>## prefix to add to link to indicate it's an url</%text>
262 262 <%text>## #314 will be replaced by <issue_prefix><id></%text>
263 263
264 264 issue_prefix = #
265 265
266 266 <%text>## issue_pat, issue_server_link, issue_prefix can have suffixes to specify</%text>
267 267 <%text>## multiple patterns, to other issues server, wiki or others</%text>
268 268 <%text>## below an example how to create a wiki pattern</%text>
269 269 <%text>## wiki-some-id -> https://mywiki.com/some-id</%text>
270 270
271 271 #issue_pat_wiki = (?:wiki-)(.+)
272 272 #issue_server_link_wiki = https://mywiki.com/{id}
273 273 #issue_prefix_wiki = WIKI-
274 274
275 275
276 276 <%text>## instance-id prefix</%text>
277 277 <%text>## a prefix key for this instance used for cache invalidation when running</%text>
278 278 <%text>## multiple instances of rhodecode, make sure it's globally unique for</%text>
279 279 <%text>## all running rhodecode instances. Leave empty if you don't use it</%text>
280 280 instance_id =
281 281
282 282 <%text>## alternative return HTTP header for failed authentication. Default HTTP</%text>
283 283 <%text>## response is 401 HTTPUnauthorized. Currently HG clients have troubles with</%text>
284 284 <%text>## handling that. Set this variable to 403 to return HTTPForbidden</%text>
285 285 auth_ret_code =
286 286
287 287 <%text>## locking return code. When repository is locked return this HTTP code. 2XX</%text>
288 288 <%text>## codes don't break the transactions while 4XX codes do</%text>
289 289 lock_ret_code = 423
290 290
291 291 <%text>## allows to change the repository location in settings page</%text>
292 292 allow_repo_location_change = True
293 293
294 294 <%text>## allows to setup custom hooks in settings page</%text>
295 295 allow_custom_hooks_settings = True
296 296
297 297 <%text>
298 298 ####################################
299 299 ### CELERY CONFIG ####
300 300 ####################################
301 301 </%text>
302 302 use_celery = false
303 303 broker.host = localhost
304 304 broker.vhost = rabbitmqhost
305 305 broker.port = 5672
306 306 broker.user = rabbitmq
307 307 broker.password = qweqwe
308 308
309 309 celery.imports = rhodecode.lib.celerylib.tasks
310 310
311 311 celery.result.backend = amqp
312 312 celery.result.dburi = amqp://
313 313 celery.result.serialier = json
314 314
315 315 #celery.send.task.error.emails = true
316 316 #celery.amqp.task.result.expires = 18000
317 317
318 318 celeryd.concurrency = 2
319 319 #celeryd.log.file = celeryd.log
320 320 celeryd.log.level = debug
321 321 celeryd.max.tasks.per.child = 1
322 322
323 323 <%text>## tasks will never be sent to the queue, but executed locally instead.</%text>
324 324 celery.always.eager = false
325 325 <%text>
326 326 ####################################
327 327 ### BEAKER CACHE ####
328 328 ####################################
329 329 </%text>
330 330 beaker.cache.data_dir=${here}/data/cache/data
331 331 beaker.cache.lock_dir=${here}/data/cache/lock
332 332
333 333 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
334 334
335 335 beaker.cache.super_short_term.type=memory
336 336 beaker.cache.super_short_term.expire=10
337 337 beaker.cache.super_short_term.key_length = 256
338 338
339 339 beaker.cache.short_term.type=memory
340 340 beaker.cache.short_term.expire=60
341 341 beaker.cache.short_term.key_length = 256
342 342
343 343 beaker.cache.long_term.type=memory
344 344 beaker.cache.long_term.expire=36000
345 345 beaker.cache.long_term.key_length = 256
346 346
347 347 beaker.cache.sql_cache_short.type=memory
348 348 beaker.cache.sql_cache_short.expire=10
349 349 beaker.cache.sql_cache_short.key_length = 256
350 350
351 351 beaker.cache.sql_cache_med.type=memory
352 352 beaker.cache.sql_cache_med.expire=360
353 353 beaker.cache.sql_cache_med.key_length = 256
354 354
355 355 beaker.cache.sql_cache_long.type=file
356 356 beaker.cache.sql_cache_long.expire=3600
357 357 beaker.cache.sql_cache_long.key_length = 256
358 358 <%text>
359 359 ####################################
360 360 ### BEAKER SESSION ####
361 361 ####################################
362 362 ## Type of storage used for the session, current types are
363 363 ## dbm, file, memcached, database, and memory.
364 364 ## The storage uses the Container API
365 365 ## that is also used by the cache system.
366 366 </%text>
367 367 <%text>## db session ##</%text>
368 368 #beaker.session.type = ext:database
369 369 #beaker.session.sa.url = postgresql://postgres:qwe@localhost/rhodecode
370 370 #beaker.session.table_name = db_session
371 371
372 372 <%text>## encrypted cookie client side session, good for many instances ##</%text>
373 373 #beaker.session.type = cookie
374 374
375 375 <%text>## file based cookies (default) ##</%text>
376 376 #beaker.session.type = file
377 377
378 378 beaker.session.key = rhodecode
379 379 beaker.session.secret = ${uuid()}
380 380
381 381 <%text>## Secure encrypted cookie. Requires AES and AES python libraries</%text>
382 382 <%text>## you must disable beaker.session.secret to use this</%text>
383 383 #beaker.session.encrypt_key = <key_for_encryption>
384 384 #beaker.session.validate_key = <validation_key>
385 385
386 386 <%text>## sets session as invalid if it haven't been accessed for given amount of time</%text>
387 387 beaker.session.timeout = 2592000
388 388 beaker.session.httponly = true
389 389 #beaker.session.cookie_path = /<your-prefix>
390 390
391 391 <%text>## uncomment for https secure cookie</%text>
392 392 beaker.session.secure = false
393 393
394 394 <%text>## auto save the session to not to use .save()</%text>
395 395 beaker.session.auto = False
396 396
397 397 <%text>## default cookie expiration time in seconds `true` expire at browser close ##</%text>
398 398 #beaker.session.cookie_expires = 3600
399 399
400 400 %if error_aggregation_service == 'errormator':
401 401 <%text>
402 402 ############################
403 403 ## ERROR HANDLING SYSTEMS ##
404 404 ############################
405 405
406 406 ####################
407 407 ### [errormator] ###
408 408 ####################
409 409
410 410 ## Errormator is tailored to work with RhodeCode, see
411 411 ## http://errormator.com for details how to obtain an account
412 412 ## you must install python package `errormator_client` to make it work
413 413 </%text>
414 414 <%text>## errormator enabled</%text>
415 415 errormator = false
416 416
417 417 errormator.server_url = https://api.errormator.com
418 418 errormator.api_key = YOUR_API_KEY
419 419
420 420 <%text>## TWEAK AMOUNT OF INFO SENT HERE</%text>
421 421
422 422 <%text>## enables 404 error logging (default False)</%text>
423 423 errormator.report_404 = false
424 424
425 425 <%text>## time in seconds after request is considered being slow (default 1)</%text>
426 426 errormator.slow_request_time = 1
427 427
428 428 <%text>## record slow requests in application</%text>
429 429 <%text>## (needs to be enabled for slow datastore recording and time tracking)</%text>
430 430 errormator.slow_requests = true
431 431
432 432 <%text>## enable hooking to application loggers</%text>
433 433 # errormator.logging = true
434 434
435 435 <%text>## minimum log level for log capture</%text>
436 436 # errormator.logging.level = WARNING
437 437
438 438 <%text>## send logs only from erroneous/slow requests</%text>
439 439 <%text>## (saves API quota for intensive logging)</%text>
440 440 errormator.logging_on_error = false
441 441
442 442 <%text>## list of additonal keywords that should be grabbed from environ object</%text>
443 443 <%text>## can be string with comma separated list of words in lowercase</%text>
444 444 <%text>## (by default client will always send following info:</%text>
445 445 <%text>## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that</%text>
446 446 <%text>## start with HTTP* this list be extended with additional keywords here</%text>
447 447 errormator.environ_keys_whitelist =
448 448
449 449
450 450 <%text>## list of keywords that should be blanked from request object</%text>
451 451 <%text>## can be string with comma separated list of words in lowercase</%text>
452 452 <%text>## (by default client will always blank keys that contain following words</%text>
453 453 <%text>## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'</%text>
454 454 <%text>## this list be extended with additional keywords set here</%text>
455 455 errormator.request_keys_blacklist =
456 456
457 457
458 458 <%text>## list of namespaces that should be ignores when gathering log entries</%text>
459 459 <%text>## can be string with comma separated list of namespaces</%text>
460 460 <%text>## (by default the client ignores own entries: errormator_client.client)</%text>
461 461 errormator.log_namespace_blacklist =
462 462 %elif error_aggregation_service == 'sentry':
463 463 <%text>
464 464 ################
465 465 ### [sentry] ###
466 466 ################
467 467
468 468 ## sentry is a alternative open source error aggregator
469 469 ## you must install python packages `sentry` and `raven` to enable
470 470 </%text>
471 471 sentry.dsn = YOUR_DNS
472 472 sentry.servers =
473 473 sentry.name =
474 474 sentry.key =
475 475 sentry.public_key =
476 476 sentry.secret_key =
477 477 sentry.project =
478 478 sentry.site =
479 479 sentry.include_paths =
480 480 sentry.exclude_paths =
481 481 %endif
482 482 <%text>
483 483 ################################################################################
484 484 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
485 485 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
486 486 ## execute malicious code after an exception is raised. ##
487 487 ################################################################################
488 488 </%text>
489 489 set debug = false
490 490 <%text>
491 491 ##################################
492 492 ### LOGVIEW CONFIG ###
493 493 ##################################
494 494 </%text>
495 495 logview.sqlalchemy = #faa
496 496 logview.pylons.templating = #bfb
497 497 logview.pylons.util = #eee
498 498 <%text>
499 499 #########################################################
500 500 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
501 501 #########################################################
502 502 </%text>
503 503 %if database_engine == 'sqlite':
504 504 # SQLITE [default]
505 505 sqlalchemy.db1.url = sqlite:///${here}/rhodecode.db?timeout=60
506 506 %elif database_engine == 'postgres':
507 507 # POSTGRESQL
508 508 sqlalchemy.db1.url = postgresql://user:pass@localhost/rhodecode
509 509 %elif database_engine == 'mysql':
510 510 # MySQL
511 511 sqlalchemy.db1.url = mysql://user:pass@localhost/rhodecode
512 512 %endif
513 513 # see sqlalchemy docs for others
514 514
515 515 sqlalchemy.db1.echo = false
516 516 sqlalchemy.db1.pool_recycle = 3600
517 517 sqlalchemy.db1.convert_unicode = true
518 518 <%text>
519 519 ################################
520 520 ### LOGGING CONFIGURATION ####
521 521 ################################
522 522 </%text>
523 523 [loggers]
524 524 keys = root, routes, rhodecode, sqlalchemy, beaker, templates, whoosh_indexer
525 525
526 526 [handlers]
527 527 keys = console, console_sql
528 528
529 529 [formatters]
530 530 keys = generic, color_formatter, color_formatter_sql
531 531 <%text>
532 532 #############
533 533 ## LOGGERS ##
534 534 #############
535 535 </%text>
536 536 [logger_root]
537 537 level = NOTSET
538 538 handlers = console
539 539
540 540 [logger_routes]
541 541 level = DEBUG
542 542 handlers =
543 543 qualname = routes.middleware
544 544 <%text>## "level = DEBUG" logs the route matched and routing variables.</%text>
545 545 propagate = 1
546 546
547 547 [logger_beaker]
548 548 level = DEBUG
549 549 handlers =
550 550 qualname = beaker.container
551 551 propagate = 1
552 552
553 553 [logger_templates]
554 554 level = INFO
555 555 handlers =
556 556 qualname = pylons.templating
557 557 propagate = 1
558 558
559 559 [logger_rhodecode]
560 560 level = DEBUG
561 561 handlers =
562 562 qualname = rhodecode
563 563 propagate = 1
564 564
565 565 [logger_sqlalchemy]
566 566 level = INFO
567 567 handlers = console_sql
568 568 qualname = sqlalchemy.engine
569 569 propagate = 0
570 570
571 571 [logger_whoosh_indexer]
572 572 level = DEBUG
573 573 handlers =
574 574 qualname = whoosh_indexer
575 575 propagate = 1
576 576 <%text>
577 577 ##############
578 578 ## HANDLERS ##
579 579 ##############
580 580 </%text>
581 581 [handler_console]
582 582 class = StreamHandler
583 583 args = (sys.stderr,)
584 584 level = INFO
585 585 formatter = generic
586 586
587 587 [handler_console_sql]
588 588 class = StreamHandler
589 589 args = (sys.stderr,)
590 590 level = WARN
591 591 formatter = generic
592 592 <%text>
593 593 ################
594 594 ## FORMATTERS ##
595 595 ################
596 596 </%text>
597 597 [formatter_generic]
598 598 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
599 599 datefmt = %Y-%m-%d %H:%M:%S
600 600
601 601 [formatter_color_formatter]
602 602 class=rhodecode.lib.colored_formatter.ColorFormatter
603 603 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
604 604 datefmt = %Y-%m-%d %H:%M:%S
605 605
606 606 [formatter_color_formatter_sql]
607 607 class=rhodecode.lib.colored_formatter.ColorFormatterSql
608 608 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
609 609 datefmt = %Y-%m-%d %H:%M:%S
@@ -1,597 +1,597 b''
1 1 ################################################################################
2 2 ################################################################################
3 3 # RhodeCode - Pylons environment configuration #
4 4 # #
5 5 # The %(here)s variable will be replaced with the parent directory of this file#
6 6 ################################################################################
7 7
8 8 [DEFAULT]
9 9 debug = true
10 10 pdebug = false
11 11 ################################################################################
12 12 ## Uncomment and replace with the address which should receive ##
13 13 ## any error reports after application crash ##
14 14 ## Additionally those settings will be used by RhodeCode mailing system ##
15 15 ################################################################################
16 16 #email_to = admin@localhost
17 17 #error_email_from = paste_error@localhost
18 18 #app_email_from = rhodecode-noreply@localhost
19 19 #error_message =
20 20 #email_prefix = [RhodeCode]
21 21
22 22 #smtp_server = mail.server.com
23 23 #smtp_username =
24 24 #smtp_password =
25 25 #smtp_port =
26 26 #smtp_use_tls = false
27 27 #smtp_use_ssl = true
28 28 ## Specify available auth parameters here (e.g. LOGIN PLAIN CRAM-MD5, etc.)
29 29 #smtp_auth =
30 30
31 31 [server:main]
32 32 ## PASTE ##
33 33 #use = egg:Paste#http
34 34 ## nr of worker threads to spawn
35 35 #threadpool_workers = 5
36 36 ## max request before thread respawn
37 37 #threadpool_max_requests = 10
38 38 ## option to use threads of process
39 39 #use_threadpool = true
40 40
41 41 ## WAITRESS ##
42 42 use = egg:waitress#main
43 43 ## number of worker threads
44 44 threads = 5
45 45 ## MAX BODY SIZE 100GB
46 46 max_request_body_size = 107374182400
47 47 ## use poll instead of select, fixes fd limits, may not work on old
48 48 ## windows systems.
49 49 #asyncore_use_poll = True
50 50
51 51 ## GUNICORN ##
52 52 #use = egg:gunicorn#main
53 53 ## number of process workers. You must set `instance_id = *` when this option
54 54 ## is set to more than one worker
55 55 #workers = 1
56 56 ## process name
57 57 #proc_name = rhodecode
58 58 ## type of worker class, one of sync, eventlet, gevent, tornado
59 59 ## recommended for bigger setup is using of of other than sync one
60 60 #worker_class = sync
61 61 #max_requests = 5
62 62 ## ammount of time a worker can handle request before it gets killed and
63 63 ## restarted
64 64 #timeout = 3600
65 65
66 66 ## UWSGI ##
67 67 ## run with uwsgi --ini-paste-logged <inifile.ini>
68 68 #[uwsgi]
69 69 #socket = /tmp/uwsgi.sock
70 70 #master = true
71 71 #http = 127.0.0.1:5000
72 72
73 73 ## set as deamon and redirect all output to file
74 74 #daemonize = ./uwsgi_rhodecode.log
75 75
76 76 ## master process PID
77 77 #pidfile = ./uwsgi_rhodecode.pid
78 78
79 79 ## stats server with workers statistics, use uwsgitop
80 80 ## for monitoring, `uwsgitop 127.0.0.1:1717`
81 81 #stats = 127.0.0.1:1717
82 82 #memory-report = true
83 83
84 84 ## log 5XX errors
85 85 #log-5xx = true
86 86
87 87 ## Set the socket listen queue size.
88 88 #listen = 256
89 89
90 90 ## Gracefully Reload workers after the specified amount of managed requests
91 91 ## (avoid memory leaks).
92 92 #max-requests = 1000
93 93
94 94 ## enable large buffers
95 95 #buffer-size=65535
96 96
97 97 ## socket and http timeouts ##
98 98 #http-timeout=3600
99 99 #socket-timeout=3600
100 100
101 101 ## Log requests slower than the specified number of milliseconds.
102 102 #log-slow = 10
103 103
104 104 ## Exit if no app can be loaded.
105 105 #need-app = true
106 106
107 107 ## Set lazy mode (load apps in workers instead of master).
108 108 #lazy = true
109 109
110 110 ## scaling ##
111 111 ## set cheaper algorithm to use, if not set default will be used
112 112 #cheaper-algo = spare
113 113
114 114 ## minimum number of workers to keep at all times
115 115 #cheaper = 1
116 116
117 117 ## number of workers to spawn at startup
118 118 #cheaper-initial = 1
119 119
120 120 ## maximum number of workers that can be spawned
121 121 #workers = 4
122 122
123 123 ## how many workers should be spawned at a time
124 124 #cheaper-step = 1
125 125
126 126 ## COMMON ##
127 127 host = 127.0.0.1
128 128 port = 5000
129 129
130 130 ## prefix middleware for rc
131 131 #[filter:proxy-prefix]
132 132 #use = egg:PasteDeploy#prefix
133 133 #prefix = /<your-prefix>
134 134
135 135 [app:main]
136 136 use = egg:rhodecode
137 137 ## enable proxy prefix middleware
138 138 #filter-with = proxy-prefix
139 139
140 140 full_stack = true
141 141 static_files = true
142 142 ## Optional Languages
143 143 ## en, fr, ja, pt_BR, zh_CN, zh_TW, pl
144 144 lang = en
145 145 cache_dir = %(here)s/data
146 146 index_dir = %(here)s/data/index
147 147
148 148 ## perform a full repository scan on each server start, this should be
149 149 ## set to false after first startup, to allow faster server restarts.
150 150 initial_repo_scan = true
151 151
152 152 ## uncomment and set this path to use archive download cache
153 153 #archive_cache_dir = /tmp/tarballcache
154 154
155 155 ## change this to unique ID for security
156 156 app_instance_uuid = ${app_instance_uuid}
157 157
158 158 ## cut off limit for large diffs (size in bytes)
159 159 cut_off_limit = 256000
160 160
161 161 ## use cache version of scm repo everywhere
162 162 vcs_full_cache = true
163 163
164 164 ## force https in RhodeCode, fixes https redirects, assumes it's always https
165 165 force_https = false
166 166
167 167 ## use Strict-Transport-Security headers
168 168 use_htsts = false
169 169
170 170 ## number of commits stats will parse on each iteration
171 171 commit_parse_limit = 25
172 172
173 173 ## use gravatar service to display avatars
174 174 use_gravatar = true
175 175
176 176 ## path to git executable
177 177 git_path = git
178 178
179 179 ## git rev filter option, --all is the default filter, if you need to
180 180 ## hide all refs in changelog switch this to --branches --tags
181 181 git_rev_filter=--all
182 182
183 183 ## RSS feed options
184 184 rss_cut_off_limit = 256000
185 185 rss_items_per_page = 10
186 186 rss_include_diff = false
187 187
188 188 ## options for showing and identifying changesets
189 189 show_sha_length = 12
190 190 show_revision_number = true
191 191
192 192 ## gist URL alias, used to create nicer urls for gist. This should be an
193 193 ## url that does rewrites to _admin/gists/<gistid>.
194 194 ## example: http://gist.rhodecode.org/{gistid}. Empty means use the internal
195 195 ## RhodeCode url, ie. http[s]://rhodecode.server/_admin/gists/<gistid>
196 196 gist_alias_url =
197 197
198 198 ## white list of API enabled controllers. This allows to add list of
199 199 ## controllers to which access will be enabled by api_key. eg: to enable
200 200 ## api access to raw_files put `FilesController:raw`, to enable access to patches
201 201 ## add `ChangesetController:changeset_patch`. This list should be "," separated
202 202 ## Syntax is <ControllerClass>:<function>. Check debug logs for generated names
203 203 ## Recommended settings bellow are commented out:
204 204 api_access_controllers_whitelist =
205 205 # ChangesetController:changeset_patch,
206 206 # ChangesetController:changeset_raw,
207 207 # FilesController:raw,
208 208 # FilesController:archivefile
209 209
210 210 ## alternative_gravatar_url allows you to use your own avatar server application
211 211 ## the following parts of the URL will be replaced
212 212 ## {email} user email
213 213 ## {md5email} md5 hash of the user email (like at gravatar.com)
214 214 ## {size} size of the image that is expected from the server application
215 215 ## {scheme} http/https from RhodeCode server
216 216 ## {netloc} network location from RhodeCode server
217 217 #alternative_gravatar_url = http://myavatarserver.com/getbyemail/{email}/{size}
218 218 #alternative_gravatar_url = http://myavatarserver.com/getbymd5/{md5email}?s={size}
219 219
220 220
221 221 ## container auth options
222 222 container_auth_enabled = false
223 223 proxypass_auth_enabled = false
224 224
225 225 ## default encoding used to convert from and to unicode
226 226 ## can be also a comma seperated list of encoding in case of mixed encodings
227 227 default_encoding = utf8
228 228
229 229 ## overwrite schema of clone url
230 230 ## available vars:
231 231 ## scheme - http/https
232 232 ## user - current user
233 233 ## pass - password
234 234 ## netloc - network location
235 235 ## path - usually repo_name
236 236
237 237 #clone_uri = {scheme}://{user}{pass}{netloc}{path}
238 238
239 239 ## issue tracker for RhodeCode (leave blank to disable, absent for default)
240 #bugtracker = http://bitbucket.org/marcinkuzminski/rhodecode/issues
240 #bugtracker = https://bitbucket.org/conservancy/kallithea/issues
241 241
242 242 ## issue tracking mapping for commits messages
243 243 ## comment out issue_pat, issue_server, issue_prefix to enable
244 244
245 245 ## pattern to get the issues from commit messages
246 246 ## default one used here is #<numbers> with a regex passive group for `#`
247 247 ## {id} will be all groups matched from this pattern
248 248
249 249 issue_pat = (?:\s*#)(\d+)
250 250
251 251 ## server url to the issue, each {id} will be replaced with match
252 252 ## fetched from the regex and {repo} is replaced with full repository name
253 253 ## including groups {repo_name} is replaced with just name of repo
254 254
255 255 issue_server_link = https://myissueserver.com/{repo}/issue/{id}
256 256
257 257 ## prefix to add to link to indicate it's an url
258 258 ## #314 will be replaced by <issue_prefix><id>
259 259
260 260 issue_prefix = #
261 261
262 262 ## issue_pat, issue_server_link, issue_prefix can have suffixes to specify
263 263 ## multiple patterns, to other issues server, wiki or others
264 264 ## below an example how to create a wiki pattern
265 265 # #wiki-some-id -> https://mywiki.com/some-id
266 266
267 267 #issue_pat_wiki = (?:wiki-)(.+)
268 268 #issue_server_link_wiki = https://mywiki.com/{id}
269 269 #issue_prefix_wiki = WIKI-
270 270
271 271
272 272 ## instance-id prefix
273 273 ## a prefix key for this instance used for cache invalidation when running
274 274 ## multiple instances of rhodecode, make sure it's globally unique for
275 275 ## all running rhodecode instances. Leave empty if you don't use it
276 276 instance_id =
277 277
278 278 ## alternative return HTTP header for failed authentication. Default HTTP
279 279 ## response is 401 HTTPUnauthorized. Currently HG clients have troubles with
280 280 ## handling that. Set this variable to 403 to return HTTPForbidden
281 281 auth_ret_code =
282 282
283 283 ## locking return code. When repository is locked return this HTTP code. 2XX
284 284 ## codes don't break the transactions while 4XX codes do
285 285 lock_ret_code = 423
286 286
287 287 ## allows to change the repository location in settings page
288 288 allow_repo_location_change = True
289 289
290 290 ## allows to setup custom hooks in settings page
291 291 allow_custom_hooks_settings = True
292 292
293 293
294 294 ####################################
295 295 ### CELERY CONFIG ####
296 296 ####################################
297 297 use_celery = false
298 298 broker.host = localhost
299 299 broker.vhost = rabbitmqhost
300 300 broker.port = 5672
301 301 broker.user = rabbitmq
302 302 broker.password = qweqwe
303 303
304 304 celery.imports = rhodecode.lib.celerylib.tasks
305 305
306 306 celery.result.backend = amqp
307 307 celery.result.dburi = amqp://
308 308 celery.result.serialier = json
309 309
310 310 #celery.send.task.error.emails = true
311 311 #celery.amqp.task.result.expires = 18000
312 312
313 313 celeryd.concurrency = 2
314 314 #celeryd.log.file = celeryd.log
315 315 celeryd.log.level = debug
316 316 celeryd.max.tasks.per.child = 1
317 317
318 318 ## tasks will never be sent to the queue, but executed locally instead.
319 319 celery.always.eager = false
320 320
321 321 ####################################
322 322 ### BEAKER CACHE ####
323 323 ####################################
324 324 beaker.cache.data_dir=%(here)s/data/cache/data
325 325 beaker.cache.lock_dir=%(here)s/data/cache/lock
326 326
327 327 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
328 328
329 329 beaker.cache.super_short_term.type=memory
330 330 beaker.cache.super_short_term.expire=10
331 331 beaker.cache.super_short_term.key_length = 256
332 332
333 333 beaker.cache.short_term.type=memory
334 334 beaker.cache.short_term.expire=60
335 335 beaker.cache.short_term.key_length = 256
336 336
337 337 beaker.cache.long_term.type=memory
338 338 beaker.cache.long_term.expire=36000
339 339 beaker.cache.long_term.key_length = 256
340 340
341 341 beaker.cache.sql_cache_short.type=memory
342 342 beaker.cache.sql_cache_short.expire=10
343 343 beaker.cache.sql_cache_short.key_length = 256
344 344
345 345 beaker.cache.sql_cache_med.type=memory
346 346 beaker.cache.sql_cache_med.expire=360
347 347 beaker.cache.sql_cache_med.key_length = 256
348 348
349 349 beaker.cache.sql_cache_long.type=file
350 350 beaker.cache.sql_cache_long.expire=3600
351 351 beaker.cache.sql_cache_long.key_length = 256
352 352
353 353 ####################################
354 354 ### BEAKER SESSION ####
355 355 ####################################
356 356 ## Type of storage used for the session, current types are
357 357 ## dbm, file, memcached, database, and memory.
358 358 ## The storage uses the Container API
359 359 ## that is also used by the cache system.
360 360
361 361 ## db session ##
362 362 #beaker.session.type = ext:database
363 363 #beaker.session.sa.url = postgresql://postgres:qwe@localhost/rhodecode
364 364 #beaker.session.table_name = db_session
365 365
366 366 ## encrypted cookie client side session, good for many instances ##
367 367 #beaker.session.type = cookie
368 368
369 369 ## file based cookies (default) ##
370 370 #beaker.session.type = file
371 371
372 372 beaker.session.key = rhodecode
373 373 beaker.session.secret = ${app_instance_uuid}
374 374
375 375 ## Secure encrypted cookie. Requires AES and AES python libraries
376 376 ## you must disable beaker.session.secret to use this
377 377 #beaker.session.encrypt_key = <key_for_encryption>
378 378 #beaker.session.validate_key = <validation_key>
379 379
380 380 ## sets session as invalid if it haven't been accessed for given amount of time
381 381 beaker.session.timeout = 2592000
382 382 beaker.session.httponly = true
383 383 #beaker.session.cookie_path = /<your-prefix>
384 384
385 385 ## uncomment for https secure cookie
386 386 beaker.session.secure = false
387 387
388 388 ## auto save the session to not to use .save()
389 389 beaker.session.auto = False
390 390
391 391 ## default cookie expiration time in seconds `true` expire at browser close ##
392 392 #beaker.session.cookie_expires = 3600
393 393
394 394
395 395 ############################
396 396 ## ERROR HANDLING SYSTEMS ##
397 397 ############################
398 398
399 399 ####################
400 400 ### [errormator] ###
401 401 ####################
402 402
403 403 ## Errormator is tailored to work with RhodeCode, see
404 404 ## http://errormator.com for details how to obtain an account
405 405 ## you must install python package `errormator_client` to make it work
406 406
407 407 ## errormator enabled
408 408 errormator = false
409 409
410 410 errormator.server_url = https://api.errormator.com
411 411 errormator.api_key = YOUR_API_KEY
412 412
413 413 ## TWEAK AMOUNT OF INFO SENT HERE
414 414
415 415 ## enables 404 error logging (default False)
416 416 errormator.report_404 = false
417 417
418 418 ## time in seconds after request is considered being slow (default 1)
419 419 errormator.slow_request_time = 1
420 420
421 421 ## record slow requests in application
422 422 ## (needs to be enabled for slow datastore recording and time tracking)
423 423 errormator.slow_requests = true
424 424
425 425 ## enable hooking to application loggers
426 426 # errormator.logging = true
427 427
428 428 ## minimum log level for log capture
429 429 # errormator.logging.level = WARNING
430 430
431 431 ## send logs only from erroneous/slow requests
432 432 ## (saves API quota for intensive logging)
433 433 errormator.logging_on_error = false
434 434
435 435 ## list of additonal keywords that should be grabbed from environ object
436 436 ## can be string with comma separated list of words in lowercase
437 437 ## (by default client will always send following info:
438 438 ## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that
439 439 ## start with HTTP* this list be extended with additional keywords here
440 440 errormator.environ_keys_whitelist =
441 441
442 442
443 443 ## list of keywords that should be blanked from request object
444 444 ## can be string with comma separated list of words in lowercase
445 445 ## (by default client will always blank keys that contain following words
446 446 ## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'
447 447 ## this list be extended with additional keywords set here
448 448 errormator.request_keys_blacklist =
449 449
450 450
451 451 ## list of namespaces that should be ignores when gathering log entries
452 452 ## can be string with comma separated list of namespaces
453 453 ## (by default the client ignores own entries: errormator_client.client)
454 454 errormator.log_namespace_blacklist =
455 455
456 456
457 457 ################
458 458 ### [sentry] ###
459 459 ################
460 460
461 461 ## sentry is a alternative open source error aggregator
462 462 ## you must install python packages `sentry` and `raven` to enable
463 463
464 464 sentry.dsn = YOUR_DNS
465 465 sentry.servers =
466 466 sentry.name =
467 467 sentry.key =
468 468 sentry.public_key =
469 469 sentry.secret_key =
470 470 sentry.project =
471 471 sentry.site =
472 472 sentry.include_paths =
473 473 sentry.exclude_paths =
474 474
475 475
476 476 ################################################################################
477 477 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
478 478 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
479 479 ## execute malicious code after an exception is raised. ##
480 480 ################################################################################
481 481 set debug = false
482 482
483 483 ##################################
484 484 ### LOGVIEW CONFIG ###
485 485 ##################################
486 486 logview.sqlalchemy = #faa
487 487 logview.pylons.templating = #bfb
488 488 logview.pylons.util = #eee
489 489
490 490 #########################################################
491 491 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
492 492 #########################################################
493 493
494 494 # SQLITE [default]
495 495 sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30
496 496
497 497 # POSTGRESQL
498 498 # sqlalchemy.db1.url = postgresql://user:pass@localhost/rhodecode
499 499
500 500 # MySQL
501 501 # sqlalchemy.db1.url = mysql://user:pass@localhost/rhodecode
502 502
503 503 # see sqlalchemy docs for others
504 504
505 505 sqlalchemy.db1.echo = false
506 506 sqlalchemy.db1.pool_recycle = 3600
507 507 sqlalchemy.db1.convert_unicode = true
508 508
509 509 ################################
510 510 ### LOGGING CONFIGURATION ####
511 511 ################################
512 512 [loggers]
513 513 keys = root, routes, rhodecode, sqlalchemy, beaker, templates, whoosh_indexer
514 514
515 515 [handlers]
516 516 keys = console, console_sql
517 517
518 518 [formatters]
519 519 keys = generic, color_formatter, color_formatter_sql
520 520
521 521 #############
522 522 ## LOGGERS ##
523 523 #############
524 524 [logger_root]
525 525 level = NOTSET
526 526 handlers = console
527 527
528 528 [logger_routes]
529 529 level = DEBUG
530 530 handlers =
531 531 qualname = routes.middleware
532 532 ## "level = DEBUG" logs the route matched and routing variables.
533 533 propagate = 1
534 534
535 535 [logger_beaker]
536 536 level = DEBUG
537 537 handlers =
538 538 qualname = beaker.container
539 539 propagate = 1
540 540
541 541 [logger_templates]
542 542 level = INFO
543 543 handlers =
544 544 qualname = pylons.templating
545 545 propagate = 1
546 546
547 547 [logger_rhodecode]
548 548 level = DEBUG
549 549 handlers =
550 550 qualname = rhodecode
551 551 propagate = 1
552 552
553 553 [logger_sqlalchemy]
554 554 level = INFO
555 555 handlers = console_sql
556 556 qualname = sqlalchemy.engine
557 557 propagate = 0
558 558
559 559 [logger_whoosh_indexer]
560 560 level = DEBUG
561 561 handlers =
562 562 qualname = whoosh_indexer
563 563 propagate = 1
564 564
565 565 ##############
566 566 ## HANDLERS ##
567 567 ##############
568 568
569 569 [handler_console]
570 570 class = StreamHandler
571 571 args = (sys.stderr,)
572 572 level = INFO
573 573 formatter = generic
574 574
575 575 [handler_console_sql]
576 576 class = StreamHandler
577 577 args = (sys.stderr,)
578 578 level = WARN
579 579 formatter = generic
580 580
581 581 ################
582 582 ## FORMATTERS ##
583 583 ################
584 584
585 585 [formatter_generic]
586 586 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
587 587 datefmt = %Y-%m-%d %H:%M:%S
588 588
589 589 [formatter_color_formatter]
590 590 class=rhodecode.lib.colored_formatter.ColorFormatter
591 591 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
592 592 datefmt = %Y-%m-%d %H:%M:%S
593 593
594 594 [formatter_color_formatter_sql]
595 595 class=rhodecode.lib.colored_formatter.ColorFormatterSql
596 596 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
597 597 datefmt = %Y-%m-%d %H:%M:%S
@@ -1,840 +1,840 b''
1 1 # -*- coding: utf-8 -*-
2 2 # This program is free software: you can redistribute it and/or modify
3 3 # it under the terms of the GNU General Public License as published by
4 4 # the Free Software Foundation, either version 3 of the License, or
5 5 # (at your option) any later version.
6 6 #
7 7 # This program is distributed in the hope that it will be useful,
8 8 # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 10 # GNU General Public License for more details.
11 11 #
12 12 # You should have received a copy of the GNU General Public License
13 13 # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 14 """
15 15 Routes configuration
16 16
17 17 The more specific and detailed routes should be defined first so they
18 18 may take precedent over the more generic routes. For more information
19 19 refer to the routes manual at http://routes.groovie.org/docs/
20 20 """
21 21
22 22 from __future__ import with_statement
23 23 from routes import Mapper
24 24
25 25 # prefix for non repository related links needs to be prefixed with `/`
26 26 ADMIN_PREFIX = '/_admin'
27 27
28 28
29 29 def make_map(config):
30 30 """Create, configure and return the routes Mapper"""
31 31 rmap = Mapper(directory=config['pylons.paths']['controllers'],
32 32 always_scan=config['debug'])
33 33 rmap.minimization = False
34 34 rmap.explicit = False
35 35
36 36 from rhodecode.lib.utils import (is_valid_repo, is_valid_repo_group,
37 37 get_repo_by_id)
38 38
39 39 def check_repo(environ, match_dict):
40 40 """
41 41 check for valid repository for proper 404 handling
42 42
43 43 :param environ:
44 44 :param match_dict:
45 45 """
46 46 repo_name = match_dict.get('repo_name')
47 47
48 48 if match_dict.get('f_path'):
49 49 #fix for multiple initial slashes that causes errors
50 50 match_dict['f_path'] = match_dict['f_path'].lstrip('/')
51 51
52 52 by_id_match = get_repo_by_id(repo_name)
53 53 if by_id_match:
54 54 repo_name = by_id_match
55 55 match_dict['repo_name'] = repo_name
56 56
57 57 return is_valid_repo(repo_name, config['base_path'])
58 58
59 59 def check_group(environ, match_dict):
60 60 """
61 61 check for valid repository group for proper 404 handling
62 62
63 63 :param environ:
64 64 :param match_dict:
65 65 """
66 66 repo_group_name = match_dict.get('group_name')
67 67 return is_valid_repo_group(repo_group_name, config['base_path'])
68 68
69 69 def check_group_skip_path(environ, match_dict):
70 70 """
71 71 check for valid repository group for proper 404 handling, but skips
72 72 verification of existing path
73 73
74 74 :param environ:
75 75 :param match_dict:
76 76 """
77 77 repo_group_name = match_dict.get('group_name')
78 78 return is_valid_repo_group(repo_group_name, config['base_path'],
79 79 skip_path_check=True)
80 80
81 81 def check_user_group(environ, match_dict):
82 82 """
83 83 check for valid user group for proper 404 handling
84 84
85 85 :param environ:
86 86 :param match_dict:
87 87 """
88 88 return True
89 89
90 90 def check_int(environ, match_dict):
91 91 return match_dict.get('id').isdigit()
92 92
93 93 # The ErrorController route (handles 404/500 error pages); it should
94 94 # likely stay at the top, ensuring it can always be resolved
95 95 rmap.connect('/error/{action}', controller='error')
96 96 rmap.connect('/error/{action}/{id}', controller='error')
97 97
98 98 #==========================================================================
99 99 # CUSTOM ROUTES HERE
100 100 #==========================================================================
101 101
102 102 #MAIN PAGE
103 103 rmap.connect('home', '/', controller='home', action='index')
104 104 rmap.connect('about', '/about', controller='home', action='about')
105 105 rmap.connect('repo_switcher_data', '/_repos', controller='home',
106 106 action='repo_switcher_data')
107 107
108 108 rmap.connect('rst_help',
109 109 "http://docutils.sourceforge.net/docs/user/rst/quickref.html",
110 110 _static=True)
111 111 rmap.connect('rhodecode_official', "https://rhodecode.com", _static=True)
112 rmap.connect('rc_issue_tracker', 'https://rhodecode.com/help/', _static=True)
112 rmap.connect('rc_issue_tracker', 'https://bitbucket.org/conservancy/kallithea/issues', _static=True)
113 113
114 114 #ADMIN REPOSITORY ROUTES
115 115 with rmap.submapper(path_prefix=ADMIN_PREFIX,
116 116 controller='admin/repos') as m:
117 117 m.connect("repos", "/repos",
118 118 action="create", conditions=dict(method=["POST"]))
119 119 m.connect("repos", "/repos",
120 120 action="index", conditions=dict(method=["GET"]))
121 121 m.connect("new_repo", "/create_repository",
122 122 action="create_repository", conditions=dict(method=["GET"]))
123 123 m.connect("/repos/{repo_name:.*?}",
124 124 action="update", conditions=dict(method=["PUT"],
125 125 function=check_repo))
126 126 m.connect("delete_repo", "/repos/{repo_name:.*?}",
127 127 action="delete", conditions=dict(method=["DELETE"],
128 128 ))
129 129 m.connect("repo", "/repos/{repo_name:.*?}",
130 130 action="show", conditions=dict(method=["GET"],
131 131 function=check_repo))
132 132
133 133 #ADMIN REPOSITORY GROUPS ROUTES
134 134 with rmap.submapper(path_prefix=ADMIN_PREFIX,
135 135 controller='admin/repo_groups') as m:
136 136 m.connect("repos_groups", "/repo_groups",
137 137 action="create", conditions=dict(method=["POST"]))
138 138 m.connect("repos_groups", "/repo_groups",
139 139 action="index", conditions=dict(method=["GET"]))
140 140 m.connect("new_repos_group", "/repo_groups/new",
141 141 action="new", conditions=dict(method=["GET"]))
142 142 m.connect("update_repos_group", "/repo_groups/{group_name:.*?}",
143 143 action="update", conditions=dict(method=["PUT"],
144 144 function=check_group))
145 145
146 146 m.connect("repos_group", "/repo_groups/{group_name:.*?}",
147 147 action="show", conditions=dict(method=["GET"],
148 148 function=check_group))
149 149
150 150 #EXTRAS REPO GROUP ROUTES
151 151 m.connect("edit_repo_group", "/repo_groups/{group_name:.*?}/edit",
152 152 action="edit",
153 153 conditions=dict(method=["GET"], function=check_group))
154 154 m.connect("edit_repo_group", "/repo_groups/{group_name:.*?}/edit",
155 155 action="edit",
156 156 conditions=dict(method=["PUT"], function=check_group))
157 157
158 158 m.connect("edit_repo_group_advanced", "/repo_groups/{group_name:.*?}/edit/advanced",
159 159 action="edit_repo_group_advanced",
160 160 conditions=dict(method=["GET"], function=check_group))
161 161 m.connect("edit_repo_group_advanced", "/repo_groups/{group_name:.*?}/edit/advanced",
162 162 action="edit_repo_group_advanced",
163 163 conditions=dict(method=["PUT"], function=check_group))
164 164
165 165 m.connect("edit_repo_group_perms", "/repo_groups/{group_name:.*?}/edit/permissions",
166 166 action="edit_repo_group_perms",
167 167 conditions=dict(method=["GET"], function=check_group))
168 168 m.connect("edit_repo_group_perms", "/repo_groups/{group_name:.*?}/edit/permissions",
169 169 action="update_perms",
170 170 conditions=dict(method=["PUT"], function=check_group))
171 171 m.connect("edit_repo_group_perms", "/repo_groups/{group_name:.*?}/edit/permissions",
172 172 action="delete_perms",
173 173 conditions=dict(method=["DELETE"], function=check_group))
174 174
175 175 m.connect("delete_repos_group", "/repo_groups/{group_name:.*?}",
176 176 action="delete", conditions=dict(method=["DELETE"],
177 177 function=check_group_skip_path))
178 178
179 179
180 180 #ADMIN USER ROUTES
181 181 with rmap.submapper(path_prefix=ADMIN_PREFIX,
182 182 controller='admin/users') as m:
183 183 m.connect("users", "/users",
184 184 action="create", conditions=dict(method=["POST"]))
185 185 m.connect("users", "/users",
186 186 action="index", conditions=dict(method=["GET"]))
187 187 m.connect("formatted_users", "/users.{format}",
188 188 action="index", conditions=dict(method=["GET"]))
189 189 m.connect("new_user", "/users/new",
190 190 action="new", conditions=dict(method=["GET"]))
191 191 m.connect("update_user", "/users/{id}",
192 192 action="update", conditions=dict(method=["PUT"]))
193 193 m.connect("delete_user", "/users/{id}",
194 194 action="delete", conditions=dict(method=["DELETE"]))
195 195 m.connect("edit_user", "/users/{id}/edit",
196 196 action="edit", conditions=dict(method=["GET"]))
197 197 m.connect("user", "/users/{id}",
198 198 action="show", conditions=dict(method=["GET"]))
199 199
200 200 #EXTRAS USER ROUTES
201 201 m.connect("edit_user_advanced", "/users/{id}/edit/advanced",
202 202 action="edit_advanced", conditions=dict(method=["GET"]))
203 203 m.connect("edit_user_advanced", "/users/{id}/edit/advanced",
204 204 action="update_advanced", conditions=dict(method=["PUT"]))
205 205
206 206 m.connect("edit_user_api_keys", "/users/{id}/edit/api_keys",
207 207 action="edit_api_keys", conditions=dict(method=["GET"]))
208 208 m.connect("edit_user_api_keys", "/users/{id}/edit/api_keys",
209 209 action="add_api_key", conditions=dict(method=["PUT"]))
210 210 m.connect("edit_user_api_keys", "/users/{id}/edit/api_keys",
211 211 action="delete_api_key", conditions=dict(method=["DELETE"]))
212 212
213 213 m.connect("edit_user_perms", "/users/{id}/edit/permissions",
214 214 action="edit_perms", conditions=dict(method=["GET"]))
215 215 m.connect("edit_user_perms", "/users/{id}/edit/permissions",
216 216 action="update_perms", conditions=dict(method=["PUT"]))
217 217
218 218 m.connect("edit_user_emails", "/users/{id}/edit/emails",
219 219 action="edit_emails", conditions=dict(method=["GET"]))
220 220 m.connect("edit_user_emails", "/users/{id}/edit/emails",
221 221 action="add_email", conditions=dict(method=["PUT"]))
222 222 m.connect("edit_user_emails", "/users/{id}/edit/emails",
223 223 action="delete_email", conditions=dict(method=["DELETE"]))
224 224
225 225 m.connect("edit_user_ips", "/users/{id}/edit/ips",
226 226 action="edit_ips", conditions=dict(method=["GET"]))
227 227 m.connect("edit_user_ips", "/users/{id}/edit/ips",
228 228 action="add_ip", conditions=dict(method=["PUT"]))
229 229 m.connect("edit_user_ips", "/users/{id}/edit/ips",
230 230 action="delete_ip", conditions=dict(method=["DELETE"]))
231 231
232 232 #ADMIN USER GROUPS REST ROUTES
233 233 with rmap.submapper(path_prefix=ADMIN_PREFIX,
234 234 controller='admin/user_groups') as m:
235 235 m.connect("users_groups", "/user_groups",
236 236 action="create", conditions=dict(method=["POST"]))
237 237 m.connect("users_groups", "/user_groups",
238 238 action="index", conditions=dict(method=["GET"]))
239 239 m.connect("new_users_group", "/user_groups/new",
240 240 action="new", conditions=dict(method=["GET"]))
241 241 m.connect("update_users_group", "/user_groups/{id}",
242 242 action="update", conditions=dict(method=["PUT"]))
243 243 m.connect("delete_users_group", "/user_groups/{id}",
244 244 action="delete", conditions=dict(method=["DELETE"]))
245 245 m.connect("edit_users_group", "/user_groups/{id}/edit",
246 246 action="edit", conditions=dict(method=["GET"]),
247 247 function=check_user_group)
248 248 m.connect("users_group", "/user_groups/{id}",
249 249 action="show", conditions=dict(method=["GET"]))
250 250
251 251 #EXTRAS USER GROUP ROUTES
252 252 m.connect("edit_user_group_default_perms", "/user_groups/{id}/edit/default_perms",
253 253 action="edit_default_perms", conditions=dict(method=["GET"]))
254 254 m.connect("edit_user_group_default_perms", "/user_groups/{id}/edit/default_perms",
255 255 action="update_default_perms", conditions=dict(method=["PUT"]))
256 256
257 257
258 258 m.connect("edit_user_group_perms", "/user_groups/{id}/edit/perms",
259 259 action="edit_perms", conditions=dict(method=["GET"]))
260 260 m.connect("edit_user_group_perms", "/user_groups/{id}/edit/perms",
261 261 action="update_perms", conditions=dict(method=["PUT"]))
262 262 m.connect("edit_user_group_perms", "/user_groups/{id}/edit/perms",
263 263 action="delete_perms", conditions=dict(method=["DELETE"]))
264 264
265 265 m.connect("edit_user_group_advanced", "/user_groups/{id}/edit/advanced",
266 266 action="edit_advanced", conditions=dict(method=["GET"]))
267 267
268 268 m.connect("edit_user_group_members", "/user_groups/{id}/edit/members",
269 269 action="edit_members", conditions=dict(method=["GET"]))
270 270
271 271
272 272
273 273 #ADMIN PERMISSIONS ROUTES
274 274 with rmap.submapper(path_prefix=ADMIN_PREFIX,
275 275 controller='admin/permissions') as m:
276 276 m.connect("admin_permissions", "/permissions",
277 277 action="permission_globals", conditions=dict(method=["POST"]))
278 278 m.connect("admin_permissions", "/permissions",
279 279 action="permission_globals", conditions=dict(method=["GET"]))
280 280
281 281 m.connect("admin_permissions_ips", "/permissions/ips",
282 282 action="permission_ips", conditions=dict(method=["POST"]))
283 283 m.connect("admin_permissions_ips", "/permissions/ips",
284 284 action="permission_ips", conditions=dict(method=["GET"]))
285 285
286 286 m.connect("admin_permissions_perms", "/permissions/perms",
287 287 action="permission_perms", conditions=dict(method=["POST"]))
288 288 m.connect("admin_permissions_perms", "/permissions/perms",
289 289 action="permission_perms", conditions=dict(method=["GET"]))
290 290
291 291
292 292 #ADMIN DEFAULTS REST ROUTES
293 293 rmap.resource('default', 'defaults',
294 294 controller='admin/defaults', path_prefix=ADMIN_PREFIX)
295 295
296 296 #ADMIN AUTH SETTINGS
297 297 rmap.connect('auth_settings', '%s/auth' % ADMIN_PREFIX,
298 298 controller='admin/auth_settings', action='auth_settings',
299 299 conditions=dict(method=["POST"]))
300 300 rmap.connect('auth_home', '%s/auth' % ADMIN_PREFIX,
301 301 controller='admin/auth_settings')
302 302
303 303 #ADMIN SETTINGS ROUTES
304 304 with rmap.submapper(path_prefix=ADMIN_PREFIX,
305 305 controller='admin/settings') as m:
306 306 m.connect("admin_settings", "/settings",
307 307 action="settings_vcs", conditions=dict(method=["POST"]))
308 308 m.connect("admin_settings", "/settings",
309 309 action="settings_vcs", conditions=dict(method=["GET"]))
310 310
311 311 m.connect("admin_settings_mapping", "/settings/mapping",
312 312 action="settings_mapping", conditions=dict(method=["POST"]))
313 313 m.connect("admin_settings_mapping", "/settings/mapping",
314 314 action="settings_mapping", conditions=dict(method=["GET"]))
315 315
316 316 m.connect("admin_settings_global", "/settings/global",
317 317 action="settings_global", conditions=dict(method=["POST"]))
318 318 m.connect("admin_settings_global", "/settings/global",
319 319 action="settings_global", conditions=dict(method=["GET"]))
320 320
321 321 m.connect("admin_settings_visual", "/settings/visual",
322 322 action="settings_visual", conditions=dict(method=["POST"]))
323 323 m.connect("admin_settings_visual", "/settings/visual",
324 324 action="settings_visual", conditions=dict(method=["GET"]))
325 325
326 326 m.connect("admin_settings_email", "/settings/email",
327 327 action="settings_email", conditions=dict(method=["POST"]))
328 328 m.connect("admin_settings_email", "/settings/email",
329 329 action="settings_email", conditions=dict(method=["GET"]))
330 330
331 331 m.connect("admin_settings_hooks", "/settings/hooks",
332 332 action="settings_hooks", conditions=dict(method=["POST"]))
333 333 m.connect("admin_settings_hooks", "/settings/hooks",
334 334 action="settings_hooks", conditions=dict(method=["DELETE"]))
335 335 m.connect("admin_settings_hooks", "/settings/hooks",
336 336 action="settings_hooks", conditions=dict(method=["GET"]))
337 337
338 338 m.connect("admin_settings_search", "/settings/search",
339 339 action="settings_search", conditions=dict(method=["POST"]))
340 340 m.connect("admin_settings_search", "/settings/search",
341 341 action="settings_search", conditions=dict(method=["GET"]))
342 342
343 343 m.connect("admin_settings_system", "/settings/system",
344 344 action="settings_system", conditions=dict(method=["POST"]))
345 345 m.connect("admin_settings_system", "/settings/system",
346 346 action="settings_system", conditions=dict(method=["GET"]))
347 347 m.connect("admin_settings_system_update", "/settings/system/updates",
348 348 action="settings_system_update", conditions=dict(method=["GET"]))
349 349
350 350 #ADMIN MY ACCOUNT
351 351 with rmap.submapper(path_prefix=ADMIN_PREFIX,
352 352 controller='admin/my_account') as m:
353 353
354 354 m.connect("my_account", "/my_account",
355 355 action="my_account", conditions=dict(method=["GET"]))
356 356 m.connect("my_account", "/my_account",
357 357 action="my_account", conditions=dict(method=["POST"]))
358 358
359 359 m.connect("my_account_password", "/my_account/password",
360 360 action="my_account_password", conditions=dict(method=["GET"]))
361 361 m.connect("my_account_password", "/my_account/password",
362 362 action="my_account_password", conditions=dict(method=["POST"]))
363 363
364 364 m.connect("my_account_repos", "/my_account/repos",
365 365 action="my_account_repos", conditions=dict(method=["GET"]))
366 366
367 367 m.connect("my_account_watched", "/my_account/watched",
368 368 action="my_account_watched", conditions=dict(method=["GET"]))
369 369
370 370 m.connect("my_account_pullrequests", "/my_account/pull_requests",
371 371 action="my_account_pullrequests", conditions=dict(method=["GET"]))
372 372
373 373 m.connect("my_account_perms", "/my_account/perms",
374 374 action="my_account_perms", conditions=dict(method=["GET"]))
375 375
376 376 m.connect("my_account_emails", "/my_account/emails",
377 377 action="my_account_emails", conditions=dict(method=["GET"]))
378 378 m.connect("my_account_emails", "/my_account/emails",
379 379 action="my_account_emails_add", conditions=dict(method=["POST"]))
380 380 m.connect("my_account_emails", "/my_account/emails",
381 381 action="my_account_emails_delete", conditions=dict(method=["DELETE"]))
382 382
383 383 m.connect("my_account_api_keys", "/my_account/api_keys",
384 384 action="my_account_api_keys", conditions=dict(method=["GET"]))
385 385 m.connect("my_account_api_keys", "/my_account/api_keys",
386 386 action="my_account_api_keys_add", conditions=dict(method=["POST"]))
387 387 m.connect("my_account_api_keys", "/my_account/api_keys",
388 388 action="my_account_api_keys_delete", conditions=dict(method=["DELETE"]))
389 389
390 390 #NOTIFICATION REST ROUTES
391 391 with rmap.submapper(path_prefix=ADMIN_PREFIX,
392 392 controller='admin/notifications') as m:
393 393 m.connect("notifications", "/notifications",
394 394 action="create", conditions=dict(method=["POST"]))
395 395 m.connect("notifications", "/notifications",
396 396 action="index", conditions=dict(method=["GET"]))
397 397 m.connect("notifications_mark_all_read", "/notifications/mark_all_read",
398 398 action="mark_all_read", conditions=dict(method=["GET"]))
399 399 m.connect("formatted_notifications", "/notifications.{format}",
400 400 action="index", conditions=dict(method=["GET"]))
401 401 m.connect("new_notification", "/notifications/new",
402 402 action="new", conditions=dict(method=["GET"]))
403 403 m.connect("formatted_new_notification", "/notifications/new.{format}",
404 404 action="new", conditions=dict(method=["GET"]))
405 405 m.connect("/notifications/{notification_id}",
406 406 action="update", conditions=dict(method=["PUT"]))
407 407 m.connect("/notifications/{notification_id}",
408 408 action="delete", conditions=dict(method=["DELETE"]))
409 409 m.connect("edit_notification", "/notifications/{notification_id}/edit",
410 410 action="edit", conditions=dict(method=["GET"]))
411 411 m.connect("formatted_edit_notification",
412 412 "/notifications/{notification_id}.{format}/edit",
413 413 action="edit", conditions=dict(method=["GET"]))
414 414 m.connect("notification", "/notifications/{notification_id}",
415 415 action="show", conditions=dict(method=["GET"]))
416 416 m.connect("formatted_notification", "/notifications/{notification_id}.{format}",
417 417 action="show", conditions=dict(method=["GET"]))
418 418
419 419 #ADMIN GIST
420 420 with rmap.submapper(path_prefix=ADMIN_PREFIX,
421 421 controller='admin/gists') as m:
422 422 m.connect("gists", "/gists",
423 423 action="create", conditions=dict(method=["POST"]))
424 424 m.connect("gists", "/gists",
425 425 action="index", conditions=dict(method=["GET"]))
426 426 m.connect("new_gist", "/gists/new",
427 427 action="new", conditions=dict(method=["GET"]))
428 428
429 429
430 430 m.connect("/gists/{gist_id}",
431 431 action="update", conditions=dict(method=["PUT"]))
432 432 m.connect("/gists/{gist_id}",
433 433 action="delete", conditions=dict(method=["DELETE"]))
434 434 m.connect("edit_gist", "/gists/{gist_id}/edit",
435 435 action="edit", conditions=dict(method=["GET", "POST"]))
436 436 m.connect("edit_gist_check_revision", "/gists/{gist_id}/edit/check_revision",
437 437 action="check_revision", conditions=dict(method=["POST"]))
438 438
439 439
440 440 m.connect("gist", "/gists/{gist_id}",
441 441 action="show", conditions=dict(method=["GET"]))
442 442 m.connect("gist_rev", "/gists/{gist_id}/{revision}",
443 443 revision="tip",
444 444 action="show", conditions=dict(method=["GET"]))
445 445 m.connect("formatted_gist", "/gists/{gist_id}/{revision}/{format}",
446 446 revision="tip",
447 447 action="show", conditions=dict(method=["GET"]))
448 448 m.connect("formatted_gist_file", "/gists/{gist_id}/{revision}/{format}/{f_path:.*}",
449 449 revision='tip',
450 450 action="show", conditions=dict(method=["GET"]))
451 451
452 452 #ADMIN MAIN PAGES
453 453 with rmap.submapper(path_prefix=ADMIN_PREFIX,
454 454 controller='admin/admin') as m:
455 455 m.connect('admin_home', '', action='index')
456 456 m.connect('admin_add_repo', '/add_repo/{new_repo:[a-z0-9\. _-]*}',
457 457 action='add_repo')
458 458 #==========================================================================
459 459 # API V2
460 460 #==========================================================================
461 461 with rmap.submapper(path_prefix=ADMIN_PREFIX,
462 462 controller='api/api') as m:
463 463 m.connect('api', '/api')
464 464
465 465 #USER JOURNAL
466 466 rmap.connect('journal', '%s/journal' % ADMIN_PREFIX,
467 467 controller='journal', action='index')
468 468 rmap.connect('journal_rss', '%s/journal/rss' % ADMIN_PREFIX,
469 469 controller='journal', action='journal_rss')
470 470 rmap.connect('journal_atom', '%s/journal/atom' % ADMIN_PREFIX,
471 471 controller='journal', action='journal_atom')
472 472
473 473 rmap.connect('public_journal', '%s/public_journal' % ADMIN_PREFIX,
474 474 controller='journal', action="public_journal")
475 475
476 476 rmap.connect('public_journal_rss', '%s/public_journal/rss' % ADMIN_PREFIX,
477 477 controller='journal', action="public_journal_rss")
478 478
479 479 rmap.connect('public_journal_rss_old', '%s/public_journal_rss' % ADMIN_PREFIX,
480 480 controller='journal', action="public_journal_rss")
481 481
482 482 rmap.connect('public_journal_atom',
483 483 '%s/public_journal/atom' % ADMIN_PREFIX, controller='journal',
484 484 action="public_journal_atom")
485 485
486 486 rmap.connect('public_journal_atom_old',
487 487 '%s/public_journal_atom' % ADMIN_PREFIX, controller='journal',
488 488 action="public_journal_atom")
489 489
490 490 rmap.connect('toggle_following', '%s/toggle_following' % ADMIN_PREFIX,
491 491 controller='journal', action='toggle_following',
492 492 conditions=dict(method=["POST"]))
493 493
494 494 #SEARCH
495 495 rmap.connect('search', '%s/search' % ADMIN_PREFIX, controller='search',)
496 496 rmap.connect('search_repo_admin', '%s/search/{repo_name:.*}' % ADMIN_PREFIX,
497 497 controller='search',
498 498 conditions=dict(function=check_repo))
499 499 rmap.connect('search_repo', '/{repo_name:.*?}/search',
500 500 controller='search',
501 501 conditions=dict(function=check_repo),
502 502 )
503 503
504 504 #LOGIN/LOGOUT/REGISTER/SIGN IN
505 505 rmap.connect('login_home', '%s/login' % ADMIN_PREFIX, controller='login')
506 506 rmap.connect('logout_home', '%s/logout' % ADMIN_PREFIX, controller='login',
507 507 action='logout')
508 508
509 509 rmap.connect('register', '%s/register' % ADMIN_PREFIX, controller='login',
510 510 action='register')
511 511
512 512 rmap.connect('reset_password', '%s/password_reset' % ADMIN_PREFIX,
513 513 controller='login', action='password_reset')
514 514
515 515 rmap.connect('reset_password_confirmation',
516 516 '%s/password_reset_confirmation' % ADMIN_PREFIX,
517 517 controller='login', action='password_reset_confirmation')
518 518
519 519 #FEEDS
520 520 rmap.connect('rss_feed_home', '/{repo_name:.*?}/feed/rss',
521 521 controller='feed', action='rss',
522 522 conditions=dict(function=check_repo))
523 523
524 524 rmap.connect('atom_feed_home', '/{repo_name:.*?}/feed/atom',
525 525 controller='feed', action='atom',
526 526 conditions=dict(function=check_repo))
527 527
528 528 #==========================================================================
529 529 # REPOSITORY ROUTES
530 530 #==========================================================================
531 531 rmap.connect('repo_creating_home', '/{repo_name:.*?}/repo_creating',
532 532 controller='admin/repos', action='repo_creating')
533 533 rmap.connect('repo_check_home', '/{repo_name:.*?}/crepo_check',
534 534 controller='admin/repos', action='repo_check')
535 535
536 536 rmap.connect('summary_home', '/{repo_name:.*?}',
537 537 controller='summary',
538 538 conditions=dict(function=check_repo))
539 539
540 540 # must be here for proper group/repo catching
541 541 rmap.connect('repos_group_home', '/{group_name:.*}',
542 542 controller='admin/repo_groups', action="show_by_name",
543 543 conditions=dict(function=check_group))
544 544 rmap.connect('repo_stats_home', '/{repo_name:.*?}/statistics',
545 545 controller='summary', action='statistics',
546 546 conditions=dict(function=check_repo))
547 547
548 548 rmap.connect('repo_size', '/{repo_name:.*?}/repo_size',
549 549 controller='summary', action='repo_size',
550 550 conditions=dict(function=check_repo))
551 551
552 552 rmap.connect('branch_tag_switcher', '/{repo_name:.*?}/branches-tags',
553 553 controller='home', action='branch_tag_switcher')
554 554 rmap.connect('repo_refs_data', '/{repo_name:.*?}/refs-data',
555 555 controller='home', action='repo_refs_data')
556 556
557 557 rmap.connect('changeset_home', '/{repo_name:.*?}/changeset/{revision}',
558 558 controller='changeset', revision='tip',
559 559 conditions=dict(function=check_repo))
560 560 rmap.connect('changeset_children', '/{repo_name:.*?}/changeset_children/{revision}',
561 561 controller='changeset', revision='tip', action="changeset_children",
562 562 conditions=dict(function=check_repo))
563 563 rmap.connect('changeset_parents', '/{repo_name:.*?}/changeset_parents/{revision}',
564 564 controller='changeset', revision='tip', action="changeset_parents",
565 565 conditions=dict(function=check_repo))
566 566
567 567 # repo edit options
568 568 rmap.connect("edit_repo", "/{repo_name:.*?}/settings",
569 569 controller='admin/repos', action="edit",
570 570 conditions=dict(method=["GET"], function=check_repo))
571 571
572 572 rmap.connect("edit_repo_perms", "/{repo_name:.*?}/settings/permissions",
573 573 controller='admin/repos', action="edit_permissions",
574 574 conditions=dict(method=["GET"], function=check_repo))
575 575 rmap.connect("edit_repo_perms_update", "/{repo_name:.*?}/settings/permissions",
576 576 controller='admin/repos', action="edit_permissions_update",
577 577 conditions=dict(method=["PUT"], function=check_repo))
578 578 rmap.connect("edit_repo_perms_revoke", "/{repo_name:.*?}/settings/permissions",
579 579 controller='admin/repos', action="edit_permissions_revoke",
580 580 conditions=dict(method=["DELETE"], function=check_repo))
581 581
582 582 rmap.connect("edit_repo_fields", "/{repo_name:.*?}/settings/fields",
583 583 controller='admin/repos', action="edit_fields",
584 584 conditions=dict(method=["GET"], function=check_repo))
585 585 rmap.connect('create_repo_fields', "/{repo_name:.*?}/settings/fields/new",
586 586 controller='admin/repos', action="create_repo_field",
587 587 conditions=dict(method=["PUT"], function=check_repo))
588 588 rmap.connect('delete_repo_fields', "/{repo_name:.*?}/settings/fields/{field_id}",
589 589 controller='admin/repos', action="delete_repo_field",
590 590 conditions=dict(method=["DELETE"], function=check_repo))
591 591
592 592
593 593 rmap.connect("edit_repo_advanced", "/{repo_name:.*?}/settings/advanced",
594 594 controller='admin/repos', action="edit_advanced",
595 595 conditions=dict(method=["GET"], function=check_repo))
596 596
597 597 rmap.connect("edit_repo_advanced_locking", "/{repo_name:.*?}/settings/advanced/locking",
598 598 controller='admin/repos', action="edit_advanced_locking",
599 599 conditions=dict(method=["PUT"], function=check_repo))
600 600 rmap.connect('toggle_locking', "/{repo_name:.*?}/settings/advanced/locking_toggle",
601 601 controller='admin/repos', action="toggle_locking",
602 602 conditions=dict(method=["GET"], function=check_repo))
603 603
604 604 rmap.connect("edit_repo_advanced_journal", "/{repo_name:.*?}/settings/advanced/journal",
605 605 controller='admin/repos', action="edit_advanced_journal",
606 606 conditions=dict(method=["PUT"], function=check_repo))
607 607
608 608 rmap.connect("edit_repo_advanced_fork", "/{repo_name:.*?}/settings/advanced/fork",
609 609 controller='admin/repos', action="edit_advanced_fork",
610 610 conditions=dict(method=["PUT"], function=check_repo))
611 611
612 612
613 613 rmap.connect("edit_repo_caches", "/{repo_name:.*?}/settings/caches",
614 614 controller='admin/repos', action="edit_caches",
615 615 conditions=dict(method=["GET"], function=check_repo))
616 616 rmap.connect("edit_repo_caches", "/{repo_name:.*?}/settings/caches",
617 617 controller='admin/repos', action="edit_caches",
618 618 conditions=dict(method=["PUT"], function=check_repo))
619 619
620 620
621 621 rmap.connect("edit_repo_remote", "/{repo_name:.*?}/settings/remote",
622 622 controller='admin/repos', action="edit_remote",
623 623 conditions=dict(method=["GET"], function=check_repo))
624 624 rmap.connect("edit_repo_remote", "/{repo_name:.*?}/settings/remote",
625 625 controller='admin/repos', action="edit_remote",
626 626 conditions=dict(method=["PUT"], function=check_repo))
627 627
628 628 rmap.connect("edit_repo_statistics", "/{repo_name:.*?}/settings/statistics",
629 629 controller='admin/repos', action="edit_statistics",
630 630 conditions=dict(method=["GET"], function=check_repo))
631 631 rmap.connect("edit_repo_statistics", "/{repo_name:.*?}/settings/statistics",
632 632 controller='admin/repos', action="edit_statistics",
633 633 conditions=dict(method=["PUT"], function=check_repo))
634 634
635 635 #still working url for backward compat.
636 636 rmap.connect('raw_changeset_home_depraced',
637 637 '/{repo_name:.*?}/raw-changeset/{revision}',
638 638 controller='changeset', action='changeset_raw',
639 639 revision='tip', conditions=dict(function=check_repo))
640 640
641 641 ## new URLs
642 642 rmap.connect('changeset_raw_home',
643 643 '/{repo_name:.*?}/changeset-diff/{revision}',
644 644 controller='changeset', action='changeset_raw',
645 645 revision='tip', conditions=dict(function=check_repo))
646 646
647 647 rmap.connect('changeset_patch_home',
648 648 '/{repo_name:.*?}/changeset-patch/{revision}',
649 649 controller='changeset', action='changeset_patch',
650 650 revision='tip', conditions=dict(function=check_repo))
651 651
652 652 rmap.connect('changeset_download_home',
653 653 '/{repo_name:.*?}/changeset-download/{revision}',
654 654 controller='changeset', action='changeset_download',
655 655 revision='tip', conditions=dict(function=check_repo))
656 656
657 657 rmap.connect('changeset_comment',
658 658 '/{repo_name:.*?}/changeset/{revision}/comment',
659 659 controller='changeset', revision='tip', action='comment',
660 660 conditions=dict(function=check_repo))
661 661
662 662 rmap.connect('changeset_comment_preview',
663 663 '/{repo_name:.*?}/changeset/comment/preview',
664 664 controller='changeset', action='preview_comment',
665 665 conditions=dict(function=check_repo, method=["POST"]))
666 666
667 667 rmap.connect('changeset_comment_delete',
668 668 '/{repo_name:.*?}/changeset/comment/{comment_id}/delete',
669 669 controller='changeset', action='delete_comment',
670 670 conditions=dict(function=check_repo, method=["DELETE"]))
671 671
672 672 rmap.connect('changeset_info', '/changeset_info/{repo_name:.*?}/{revision}',
673 673 controller='changeset', action='changeset_info')
674 674
675 675 rmap.connect('compare_home',
676 676 '/{repo_name:.*?}/compare',
677 677 controller='compare', action='index',
678 678 conditions=dict(function=check_repo))
679 679
680 680 rmap.connect('compare_url',
681 681 '/{repo_name:.*?}/compare/{org_ref_type}@{org_ref:.*?}...{other_ref_type}@{other_ref:.*?}',
682 682 controller='compare', action='compare',
683 683 conditions=dict(function=check_repo),
684 684 requirements=dict(
685 685 org_ref_type='(branch|book|tag|rev|__other_ref_type__)',
686 686 other_ref_type='(branch|book|tag|rev|__org_ref_type__)')
687 687 )
688 688
689 689 rmap.connect('pullrequest_home',
690 690 '/{repo_name:.*?}/pull-request/new', controller='pullrequests',
691 691 action='index', conditions=dict(function=check_repo,
692 692 method=["GET"]))
693 693
694 694 rmap.connect('pullrequest',
695 695 '/{repo_name:.*?}/pull-request/new', controller='pullrequests',
696 696 action='create', conditions=dict(function=check_repo,
697 697 method=["POST"]))
698 698
699 699 rmap.connect('pullrequest_show',
700 700 '/{repo_name:.*?}/pull-request/{pull_request_id}',
701 701 controller='pullrequests',
702 702 action='show', conditions=dict(function=check_repo,
703 703 method=["GET"]))
704 704 rmap.connect('pullrequest_update',
705 705 '/{repo_name:.*?}/pull-request/{pull_request_id}',
706 706 controller='pullrequests',
707 707 action='update', conditions=dict(function=check_repo,
708 708 method=["PUT"]))
709 709 rmap.connect('pullrequest_delete',
710 710 '/{repo_name:.*?}/pull-request/{pull_request_id}',
711 711 controller='pullrequests',
712 712 action='delete', conditions=dict(function=check_repo,
713 713 method=["DELETE"]))
714 714
715 715 rmap.connect('pullrequest_show_all',
716 716 '/{repo_name:.*?}/pull-request',
717 717 controller='pullrequests',
718 718 action='show_all', conditions=dict(function=check_repo,
719 719 method=["GET"]))
720 720
721 721 rmap.connect('pullrequest_comment',
722 722 '/{repo_name:.*?}/pull-request-comment/{pull_request_id}',
723 723 controller='pullrequests',
724 724 action='comment', conditions=dict(function=check_repo,
725 725 method=["POST"]))
726 726
727 727 rmap.connect('pullrequest_comment_delete',
728 728 '/{repo_name:.*?}/pull-request-comment/{comment_id}/delete',
729 729 controller='pullrequests', action='delete_comment',
730 730 conditions=dict(function=check_repo, method=["DELETE"]))
731 731
732 732 rmap.connect('summary_home_summary', '/{repo_name:.*?}/summary',
733 733 controller='summary', conditions=dict(function=check_repo))
734 734
735 735 rmap.connect('branches_home', '/{repo_name:.*?}/branches',
736 736 controller='branches', conditions=dict(function=check_repo))
737 737
738 738 rmap.connect('tags_home', '/{repo_name:.*?}/tags',
739 739 controller='tags', conditions=dict(function=check_repo))
740 740
741 741 rmap.connect('bookmarks_home', '/{repo_name:.*?}/bookmarks',
742 742 controller='bookmarks', conditions=dict(function=check_repo))
743 743
744 744 rmap.connect('changelog_home', '/{repo_name:.*?}/changelog',
745 745 controller='changelog', conditions=dict(function=check_repo))
746 746
747 747 rmap.connect('changelog_summary_home', '/{repo_name:.*?}/changelog_summary',
748 748 controller='changelog', action='changelog_summary',
749 749 conditions=dict(function=check_repo))
750 750
751 751 rmap.connect('changelog_file_home', '/{repo_name:.*?}/changelog/{revision}/{f_path:.*}',
752 752 controller='changelog', f_path=None,
753 753 conditions=dict(function=check_repo))
754 754
755 755 rmap.connect('changelog_details', '/{repo_name:.*?}/changelog_details/{cs}',
756 756 controller='changelog', action='changelog_details',
757 757 conditions=dict(function=check_repo))
758 758
759 759 rmap.connect('files_home', '/{repo_name:.*?}/files/{revision}/{f_path:.*}',
760 760 controller='files', revision='tip', f_path='',
761 761 conditions=dict(function=check_repo))
762 762
763 763 rmap.connect('files_home_nopath', '/{repo_name:.*?}/files/{revision}',
764 764 controller='files', revision='tip', f_path='',
765 765 conditions=dict(function=check_repo))
766 766
767 767 rmap.connect('files_history_home',
768 768 '/{repo_name:.*?}/history/{revision}/{f_path:.*}',
769 769 controller='files', action='history', revision='tip', f_path='',
770 770 conditions=dict(function=check_repo))
771 771
772 772 rmap.connect('files_authors_home',
773 773 '/{repo_name:.*?}/authors/{revision}/{f_path:.*}',
774 774 controller='files', action='authors', revision='tip', f_path='',
775 775 conditions=dict(function=check_repo))
776 776
777 777 rmap.connect('files_diff_home', '/{repo_name:.*?}/diff/{f_path:.*}',
778 778 controller='files', action='diff', revision='tip', f_path='',
779 779 conditions=dict(function=check_repo))
780 780
781 781 rmap.connect('files_diff_2way_home', '/{repo_name:.*?}/diff-2way/{f_path:.*}',
782 782 controller='files', action='diff_2way', revision='tip', f_path='',
783 783 conditions=dict(function=check_repo))
784 784
785 785 rmap.connect('files_rawfile_home',
786 786 '/{repo_name:.*?}/rawfile/{revision}/{f_path:.*}',
787 787 controller='files', action='rawfile', revision='tip',
788 788 f_path='', conditions=dict(function=check_repo))
789 789
790 790 rmap.connect('files_raw_home',
791 791 '/{repo_name:.*?}/raw/{revision}/{f_path:.*}',
792 792 controller='files', action='raw', revision='tip', f_path='',
793 793 conditions=dict(function=check_repo))
794 794
795 795 rmap.connect('files_annotate_home',
796 796 '/{repo_name:.*?}/annotate/{revision}/{f_path:.*}',
797 797 controller='files', action='index', revision='tip',
798 798 f_path='', annotate=True, conditions=dict(function=check_repo))
799 799
800 800 rmap.connect('files_edit_home',
801 801 '/{repo_name:.*?}/edit/{revision}/{f_path:.*}',
802 802 controller='files', action='edit', revision='tip',
803 803 f_path='', conditions=dict(function=check_repo))
804 804
805 805 rmap.connect('files_add_home',
806 806 '/{repo_name:.*?}/add/{revision}/{f_path:.*}',
807 807 controller='files', action='add', revision='tip',
808 808 f_path='', conditions=dict(function=check_repo))
809 809
810 810 rmap.connect('files_delete_home',
811 811 '/{repo_name:.*?}/delete/{revision}/{f_path:.*}',
812 812 controller='files', action='delete', revision='tip',
813 813 f_path='', conditions=dict(function=check_repo))
814 814
815 815 rmap.connect('files_archive_home', '/{repo_name:.*?}/archive/{fname}',
816 816 controller='files', action='archivefile',
817 817 conditions=dict(function=check_repo))
818 818
819 819 rmap.connect('files_nodelist_home',
820 820 '/{repo_name:.*?}/nodelist/{revision}/{f_path:.*}',
821 821 controller='files', action='nodelist',
822 822 conditions=dict(function=check_repo))
823 823
824 824 rmap.connect('repo_fork_create_home', '/{repo_name:.*?}/fork',
825 825 controller='forks', action='fork_create',
826 826 conditions=dict(function=check_repo, method=["POST"]))
827 827
828 828 rmap.connect('repo_fork_home', '/{repo_name:.*?}/fork',
829 829 controller='forks', action='fork',
830 830 conditions=dict(function=check_repo))
831 831
832 832 rmap.connect('repo_forks_home', '/{repo_name:.*?}/forks',
833 833 controller='forks', action='forks',
834 834 conditions=dict(function=check_repo))
835 835
836 836 rmap.connect('repo_followers_home', '/{repo_name:.*?}/followers',
837 837 controller='followers', action='followers',
838 838 conditions=dict(function=check_repo))
839 839
840 840 return rmap
General Comments 0
You need to be logged in to leave comments. Login now