##// END OF EJS Templates
gunicorn: moved all configuration of gunicorn workers to .ini files....
marcink -
r4098:ef7e0089 default
parent child Browse files
Show More
@@ -1,742 +1,782 b''
1 1
2 2
3 3 ################################################################################
4 4 ## RHODECODE COMMUNITY EDITION CONFIGURATION ##
5 5 ################################################################################
6 6
7 7 [DEFAULT]
8 8 ## Debug flag sets all loggers to debug, and enables request tracking
9 9 debug = true
10 10
11 11 ################################################################################
12 12 ## EMAIL CONFIGURATION ##
13 13 ## Uncomment and replace with the email address which should receive ##
14 14 ## any error reports after an application crash ##
15 15 ## Additionally these settings will be used by the RhodeCode mailing system ##
16 16 ################################################################################
17 17
18 18 ## prefix all emails subjects with given prefix, helps filtering out emails
19 19 #email_prefix = [RhodeCode]
20 20
21 21 ## email FROM address all mails will be sent
22 22 #app_email_from = rhodecode-noreply@localhost
23 23
24 24 #smtp_server = mail.server.com
25 25 #smtp_username =
26 26 #smtp_password =
27 27 #smtp_port =
28 28 #smtp_use_tls = false
29 29 #smtp_use_ssl = true
30 30
31 31 [server:main]
32 32 ## COMMON ##
33 33 host = 127.0.0.1
34 34 port = 5000
35 35
36 36 ###########################################################
37 37 ## WAITRESS WSGI SERVER - Recommended for Development ####
38 38 ###########################################################
39 39
40 40 use = egg:waitress#main
41 41 ## number of worker threads
42 42 threads = 5
43 43 ## MAX BODY SIZE 100GB
44 44 max_request_body_size = 107374182400
45 45 ## Use poll instead of select, fixes file descriptors limits problems.
46 46 ## May not work on old windows systems.
47 47 asyncore_use_poll = true
48 48
49 49
50 50 ##########################
51 51 ## GUNICORN WSGI SERVER ##
52 52 ##########################
53 53 ## run with gunicorn --log-config rhodecode.ini --paste rhodecode.ini
54 54
55 55 #use = egg:gunicorn#main
56 56 ## Sets the number of process workers. More workers means more concurrent connections
57 57 ## RhodeCode can handle at the same time. Each additional worker also it increases
58 58 ## memory usage as each has it's own set of caches.
59 59 ## Recommended value is (2 * NUMBER_OF_CPUS + 1), eg 2CPU = 5 workers, but no more
60 60 ## than 8-10 unless for really big deployments .e.g 700-1000 users.
61 61 ## `instance_id = *` must be set in the [app:main] section below (which is the default)
62 62 ## when using more than 1 worker.
63 63 #workers = 2
64
64 65 ## process name visible in process list
65 66 #proc_name = rhodecode
67
66 68 ## type of worker class, one of sync, gevent
67 69 ## recommended for bigger setup is using of of other than sync one
68 70 #worker_class = gevent
71
69 72 ## The maximum number of simultaneous clients. Valid only for Gevent
70 73 #worker_connections = 10
74
71 75 ## max number of requests that worker will handle before being gracefully
72 76 ## restarted, could prevent memory leaks
73 77 #max_requests = 1000
74 78 #max_requests_jitter = 30
79
75 80 ## amount of time a worker can spend with handling a request before it
76 81 ## gets killed and restarted. Set to 6hrs
77 82 #timeout = 21600
78 83
84 ## The maximum size of HTTP request line in bytes.
85 ## 0 for unlimited
86 #limit_request_line = 0
87
88 ## Limit the number of HTTP headers fields in a request.
89 ## By default this value is 100 and can't be larger than 32768.
90 #limit_request_fields = 32768
91
92 ## Limit the allowed size of an HTTP request header field.
93 ## Value is a positive number or 0.
94 ## Setting it to 0 will allow unlimited header field sizes.
95 #limit_request_field_size = 0
96
97 ## Timeout for graceful workers restart.
98 ## After receiving a restart signal, workers have this much time to finish
99 ## serving requests. Workers still alive after the timeout (starting from the
100 ## receipt of the restart signal) are force killed.
101 #graceful_timeout = 3600
102
103 # The number of seconds to wait for requests on a Keep-Alive connection.
104 # Generally set in the 1-5 seconds range.
105 #keepalive = 2
106
107 ## Maximum memory usage that each worker can use before it will receive a
108 ## graceful restart signal, e.g 10MB = 10485760 (10 * 1024 * 1024)
109 # 0 = memory monitoring is disabled
110 #memory_max_usage = 0
111
112 ## How often in seconds to check for memory usage for each gunicorn worker
113 #memory_usage_check_interval = 60
114
115 ## Threshold value for which we don't recycle worker if GarbageCollection
116 ## frees up enough resources. Before each restart we try to run GC on worker
117 ## in case we get enough free memory after that, restart will not happen.
118 #memory_usage_recovery_threshold = 0.8
79 119
80 120 ## prefix middleware for RhodeCode.
81 121 ## recommended when using proxy setup.
82 122 ## allows to set RhodeCode under a prefix in server.
83 123 ## eg https://server.com/custom_prefix. Enable `filter-with =` option below as well.
84 124 ## And set your prefix like: `prefix = /custom_prefix`
85 125 ## be sure to also set beaker.session.cookie_path = /custom_prefix if you need
86 126 ## to make your cookies only work on prefix url
87 127 [filter:proxy-prefix]
88 128 use = egg:PasteDeploy#prefix
89 129 prefix = /
90 130
91 131 [app:main]
92 132 ## The %(here)s variable will be replaced with the absolute path of parent directory
93 133 ## of this file
94 134 ## In addition ENVIRONMENT variables usage is possible, e.g
95 135 ## sqlalchemy.db1.url = {ENV_RC_DB_URL}
96 136
97 137 use = egg:rhodecode-enterprise-ce
98 138
99 139 ## enable proxy prefix middleware, defined above
100 140 #filter-with = proxy-prefix
101 141
102 142 # During development the we want to have the debug toolbar enabled
103 143 pyramid.includes =
104 144 pyramid_debugtoolbar
105 145 rhodecode.lib.middleware.request_wrapper
106 146
107 147 pyramid.reload_templates = true
108 148
109 149 debugtoolbar.hosts = 0.0.0.0/0
110 150 debugtoolbar.exclude_prefixes =
111 151 /css
112 152 /fonts
113 153 /images
114 154 /js
115 155
116 156 ## RHODECODE PLUGINS ##
117 157 rhodecode.includes =
118 158 rhodecode.api
119 159
120 160
121 161 # api prefix url
122 162 rhodecode.api.url = /_admin/api
123 163
124 164
125 165 ## END RHODECODE PLUGINS ##
126 166
127 167 ## encryption key used to encrypt social plugin tokens,
128 168 ## remote_urls with credentials etc, if not set it defaults to
129 169 ## `beaker.session.secret`
130 170 #rhodecode.encrypted_values.secret =
131 171
132 172 ## decryption strict mode (enabled by default). It controls if decryption raises
133 173 ## `SignatureVerificationError` in case of wrong key, or damaged encryption data.
134 174 #rhodecode.encrypted_values.strict = false
135 175
136 176 ## Pick algorithm for encryption. Either fernet (more secure) or aes (default)
137 177 ## fernet is safer, and we strongly recommend switching to it.
138 178 ## Due to backward compatibility aes is used as default.
139 179 #rhodecode.encrypted_values.algorithm = fernet
140 180
141 181 ## return gzipped responses from RhodeCode (static files/application)
142 182 gzip_responses = false
143 183
144 184 ## auto-generate javascript routes file on startup
145 185 generate_js_files = false
146 186
147 187 ## System global default language.
148 188 ## All available languages: en(default), be, de, es, fr, it, ja, pl, pt, ru, zh
149 189 lang = en
150 190
151 191 ## Perform a full repository scan and import on each server start.
152 192 ## Settings this to true could lead to very long startup time.
153 193 startup.import_repos = false
154 194
155 195 ## Uncomment and set this path to use archive download cache.
156 196 ## Once enabled, generated archives will be cached at this location
157 197 ## and served from the cache during subsequent requests for the same archive of
158 198 ## the repository.
159 199 #archive_cache_dir = /tmp/tarballcache
160 200
161 201 ## URL at which the application is running. This is used for Bootstrapping
162 202 ## requests in context when no web request is available. Used in ishell, or
163 203 ## SSH calls. Set this for events to receive proper url for SSH calls.
164 204 app.base_url = http://rhodecode.local
165 205
166 206 ## Unique application ID. Should be a random unique string for security.
167 207 app_instance_uuid = rc-production
168 208
169 209 ## Cut off limit for large diffs (size in bytes). If overall diff size on
170 210 ## commit, or pull request exceeds this limit this diff will be displayed
171 211 ## partially. E.g 512000 == 512Kb
172 212 cut_off_limit_diff = 512000
173 213
174 214 ## Cut off limit for large files inside diffs (size in bytes). Each individual
175 215 ## file inside diff which exceeds this limit will be displayed partially.
176 216 ## E.g 128000 == 128Kb
177 217 cut_off_limit_file = 128000
178 218
179 219 ## use cached version of vcs repositories everywhere. Recommended to be `true`
180 220 vcs_full_cache = true
181 221
182 222 ## Force https in RhodeCode, fixes https redirects, assumes it's always https.
183 223 ## Normally this is controlled by proper http flags sent from http server
184 224 force_https = false
185 225
186 226 ## use Strict-Transport-Security headers
187 227 use_htsts = false
188 228
189 229 # Set to true if your repos are exposed using the dumb protocol
190 230 git_update_server_info = false
191 231
192 232 ## RSS/ATOM feed options
193 233 rss_cut_off_limit = 256000
194 234 rss_items_per_page = 10
195 235 rss_include_diff = false
196 236
197 237 ## gist URL alias, used to create nicer urls for gist. This should be an
198 238 ## url that does rewrites to _admin/gists/{gistid}.
199 239 ## example: http://gist.rhodecode.org/{gistid}. Empty means use the internal
200 240 ## RhodeCode url, ie. http[s]://rhodecode.server/_admin/gists/{gistid}
201 241 gist_alias_url =
202 242
203 243 ## List of views (using glob pattern syntax) that AUTH TOKENS could be
204 244 ## used for access.
205 245 ## Adding ?auth_token=TOKEN_HASH to the url authenticates this request as if it
206 246 ## came from the the logged in user who own this authentication token.
207 247 ## Additionally @TOKEN syntax can be used to bound the view to specific
208 248 ## authentication token. Such view would be only accessible when used together
209 249 ## with this authentication token
210 250 ##
211 251 ## list of all views can be found under `/_admin/permissions/auth_token_access`
212 252 ## The list should be "," separated and on a single line.
213 253 ##
214 254 ## Most common views to enable:
215 255 # RepoCommitsView:repo_commit_download
216 256 # RepoCommitsView:repo_commit_patch
217 257 # RepoCommitsView:repo_commit_raw
218 258 # RepoCommitsView:repo_commit_raw@TOKEN
219 259 # RepoFilesView:repo_files_diff
220 260 # RepoFilesView:repo_archivefile
221 261 # RepoFilesView:repo_file_raw
222 262 # GistView:*
223 263 api_access_controllers_whitelist =
224 264
225 265 ## Default encoding used to convert from and to unicode
226 266 ## can be also a comma separated list of encoding in case of mixed encodings
227 267 default_encoding = UTF-8
228 268
229 269 ## instance-id prefix
230 270 ## a prefix key for this instance used for cache invalidation when running
231 271 ## multiple instances of RhodeCode, make sure it's globally unique for
232 272 ## all running RhodeCode instances. Leave empty if you don't use it
233 273 instance_id =
234 274
235 275 ## Fallback authentication plugin. Set this to a plugin ID to force the usage
236 276 ## of an authentication plugin also if it is disabled by it's settings.
237 277 ## This could be useful if you are unable to log in to the system due to broken
238 278 ## authentication settings. Then you can enable e.g. the internal RhodeCode auth
239 279 ## module to log in again and fix the settings.
240 280 ##
241 281 ## Available builtin plugin IDs (hash is part of the ID):
242 282 ## egg:rhodecode-enterprise-ce#rhodecode
243 283 ## egg:rhodecode-enterprise-ce#pam
244 284 ## egg:rhodecode-enterprise-ce#ldap
245 285 ## egg:rhodecode-enterprise-ce#jasig_cas
246 286 ## egg:rhodecode-enterprise-ce#headers
247 287 ## egg:rhodecode-enterprise-ce#crowd
248 288 #rhodecode.auth_plugin_fallback = egg:rhodecode-enterprise-ce#rhodecode
249 289
250 290 ## alternative return HTTP header for failed authentication. Default HTTP
251 291 ## response is 401 HTTPUnauthorized. Currently HG clients have troubles with
252 292 ## handling that causing a series of failed authentication calls.
253 293 ## Set this variable to 403 to return HTTPForbidden, or any other HTTP code
254 294 ## This will be served instead of default 401 on bad authentication
255 295 auth_ret_code =
256 296
257 297 ## use special detection method when serving auth_ret_code, instead of serving
258 298 ## ret_code directly, use 401 initially (Which triggers credentials prompt)
259 299 ## and then serve auth_ret_code to clients
260 300 auth_ret_code_detection = false
261 301
262 302 ## locking return code. When repository is locked return this HTTP code. 2XX
263 303 ## codes don't break the transactions while 4XX codes do
264 304 lock_ret_code = 423
265 305
266 306 ## allows to change the repository location in settings page
267 307 allow_repo_location_change = true
268 308
269 309 ## allows to setup custom hooks in settings page
270 310 allow_custom_hooks_settings = true
271 311
272 312 ## Generated license token required for EE edition license.
273 313 ## New generated token value can be found in Admin > settings > license page.
274 314 license_token =
275 315
276 316 ## This flag would hide sensitive information on the license page
277 317 license.hide_license_info = false
278 318
279 319 ## supervisor connection uri, for managing supervisor and logs.
280 320 supervisor.uri =
281 321 ## supervisord group name/id we only want this RC instance to handle
282 322 supervisor.group_id = dev
283 323
284 324 ## Display extended labs settings
285 325 labs_settings_active = true
286 326
287 327 ## Custom exception store path, defaults to TMPDIR
288 328 ## This is used to store exception from RhodeCode in shared directory
289 329 #exception_tracker.store_path =
290 330
291 331 ## File store configuration. This is used to store and serve uploaded files
292 332 file_store.enabled = true
293 333 ## Storage backend, available options are: local
294 334 file_store.backend = local
295 335 ## path to store the uploaded binaries
296 336 file_store.storage_path = %(here)s/data/file_store
297 337
298 338
299 339 ####################################
300 340 ### CELERY CONFIG ####
301 341 ####################################
302 342 ## run: /path/to/celery worker \
303 343 ## -E --beat --app rhodecode.lib.celerylib.loader \
304 344 ## --scheduler rhodecode.lib.celerylib.scheduler.RcScheduler \
305 345 ## --loglevel DEBUG --ini /path/to/rhodecode.ini
306 346
307 347 use_celery = false
308 348
309 349 ## connection url to the message broker (default redis)
310 350 celery.broker_url = redis://localhost:6379/8
311 351
312 352 ## rabbitmq example
313 353 #celery.broker_url = amqp://rabbitmq:qweqwe@localhost:5672/rabbitmqhost
314 354
315 355 ## maximum tasks to execute before worker restart
316 356 celery.max_tasks_per_child = 100
317 357
318 358 ## tasks will never be sent to the queue, but executed locally instead.
319 359 celery.task_always_eager = false
320 360
321 361 #####################################
322 362 ### DOGPILE CACHE ####
323 363 #####################################
324 364 ## Default cache dir for caches. Putting this into a ramdisk
325 365 ## can boost performance, eg. /tmpfs/data_ramdisk, however this directory might require
326 366 ## large amount of space
327 367 cache_dir = %(here)s/data
328 368
329 369 ## `cache_perms` cache settings for permission tree, auth TTL.
330 370 rc_cache.cache_perms.backend = dogpile.cache.rc.file_namespace
331 371 rc_cache.cache_perms.expiration_time = 300
332 372
333 373 ## alternative `cache_perms` redis backend with distributed lock
334 374 #rc_cache.cache_perms.backend = dogpile.cache.rc.redis
335 375 #rc_cache.cache_perms.expiration_time = 300
336 376 ## redis_expiration_time needs to be greater then expiration_time
337 377 #rc_cache.cache_perms.arguments.redis_expiration_time = 7200
338 378 #rc_cache.cache_perms.arguments.socket_timeout = 30
339 379 #rc_cache.cache_perms.arguments.host = localhost
340 380 #rc_cache.cache_perms.arguments.port = 6379
341 381 #rc_cache.cache_perms.arguments.db = 0
342 382 ## more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends
343 383 #rc_cache.cache_perms.arguments.distributed_lock = true
344 384
345 385 ## `cache_repo` cache settings for FileTree, Readme, RSS FEEDS
346 386 rc_cache.cache_repo.backend = dogpile.cache.rc.file_namespace
347 387 rc_cache.cache_repo.expiration_time = 2592000
348 388
349 389 ## alternative `cache_repo` redis backend with distributed lock
350 390 #rc_cache.cache_repo.backend = dogpile.cache.rc.redis
351 391 #rc_cache.cache_repo.expiration_time = 2592000
352 392 ## redis_expiration_time needs to be greater then expiration_time
353 393 #rc_cache.cache_repo.arguments.redis_expiration_time = 2678400
354 394 #rc_cache.cache_repo.arguments.socket_timeout = 30
355 395 #rc_cache.cache_repo.arguments.host = localhost
356 396 #rc_cache.cache_repo.arguments.port = 6379
357 397 #rc_cache.cache_repo.arguments.db = 1
358 398 ## more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends
359 399 #rc_cache.cache_repo.arguments.distributed_lock = true
360 400
361 401 ## cache settings for SQL queries, this needs to use memory type backend
362 402 rc_cache.sql_cache_short.backend = dogpile.cache.rc.memory_lru
363 403 rc_cache.sql_cache_short.expiration_time = 30
364 404
365 405 ## `cache_repo_longterm` cache for repo object instances, this needs to use memory
366 406 ## type backend as the objects kept are not pickle serializable
367 407 rc_cache.cache_repo_longterm.backend = dogpile.cache.rc.memory_lru
368 408 ## by default we use 96H, this is using invalidation on push anyway
369 409 rc_cache.cache_repo_longterm.expiration_time = 345600
370 410 ## max items in LRU cache, reduce this number to save memory, and expire last used
371 411 ## cached objects
372 412 rc_cache.cache_repo_longterm.max_size = 10000
373 413
374 414
375 415 ####################################
376 416 ### BEAKER SESSION ####
377 417 ####################################
378 418
379 419 ## .session.type is type of storage options for the session, current allowed
380 420 ## types are file, ext:memcached, ext:redis, ext:database, and memory (default).
381 421 beaker.session.type = file
382 422 beaker.session.data_dir = %(here)s/data/sessions
383 423
384 424 ## redis sessions
385 425 #beaker.session.type = ext:redis
386 426 #beaker.session.url = redis://127.0.0.1:6379/2
387 427
388 428 ## db based session, fast, and allows easy management over logged in users
389 429 #beaker.session.type = ext:database
390 430 #beaker.session.table_name = db_session
391 431 #beaker.session.sa.url = postgresql://postgres:secret@localhost/rhodecode
392 432 #beaker.session.sa.url = mysql://root:secret@127.0.0.1/rhodecode
393 433 #beaker.session.sa.pool_recycle = 3600
394 434 #beaker.session.sa.echo = false
395 435
396 436 beaker.session.key = rhodecode
397 437 beaker.session.secret = develop-rc-uytcxaz
398 438 beaker.session.lock_dir = %(here)s/data/sessions/lock
399 439
400 440 ## Secure encrypted cookie. Requires AES and AES python libraries
401 441 ## you must disable beaker.session.secret to use this
402 442 #beaker.session.encrypt_key = key_for_encryption
403 443 #beaker.session.validate_key = validation_key
404 444
405 445 ## sets session as invalid(also logging out user) if it haven not been
406 446 ## accessed for given amount of time in seconds
407 447 beaker.session.timeout = 2592000
408 448 beaker.session.httponly = true
409 449 ## Path to use for the cookie. Set to prefix if you use prefix middleware
410 450 #beaker.session.cookie_path = /custom_prefix
411 451
412 452 ## uncomment for https secure cookie
413 453 beaker.session.secure = false
414 454
415 455 ## auto save the session to not to use .save()
416 456 beaker.session.auto = false
417 457
418 458 ## default cookie expiration time in seconds, set to `true` to set expire
419 459 ## at browser close
420 460 #beaker.session.cookie_expires = 3600
421 461
422 462 ###################################
423 463 ## SEARCH INDEXING CONFIGURATION ##
424 464 ###################################
425 465 ## Full text search indexer is available in rhodecode-tools under
426 466 ## `rhodecode-tools index` command
427 467
428 468 ## WHOOSH Backend, doesn't require additional services to run
429 469 ## it works good with few dozen repos
430 470 search.module = rhodecode.lib.index.whoosh
431 471 search.location = %(here)s/data/index
432 472
433 473 ########################################
434 474 ### CHANNELSTREAM CONFIG ####
435 475 ########################################
436 476 ## channelstream enables persistent connections and live notification
437 477 ## in the system. It's also used by the chat system
438 478
439 479 channelstream.enabled = false
440 480
441 481 ## server address for channelstream server on the backend
442 482 channelstream.server = 127.0.0.1:9800
443 483
444 484 ## location of the channelstream server from outside world
445 485 ## use ws:// for http or wss:// for https. This address needs to be handled
446 486 ## by external HTTP server such as Nginx or Apache
447 487 ## see Nginx/Apache configuration examples in our docs
448 488 channelstream.ws_url = ws://rhodecode.yourserver.com/_channelstream
449 489 channelstream.secret = secret
450 490 channelstream.history.location = %(here)s/channelstream_history
451 491
452 492 ## Internal application path that Javascript uses to connect into.
453 493 ## If you use proxy-prefix the prefix should be added before /_channelstream
454 494 channelstream.proxy_path = /_channelstream
455 495
456 496
457 497 ###################################
458 498 ## APPENLIGHT CONFIG ##
459 499 ###################################
460 500
461 501 ## Appenlight is tailored to work with RhodeCode, see
462 502 ## http://appenlight.com for details how to obtain an account
463 503
464 504 ## Appenlight integration enabled
465 505 appenlight = false
466 506
467 507 appenlight.server_url = https://api.appenlight.com
468 508 appenlight.api_key = YOUR_API_KEY
469 509 #appenlight.transport_config = https://api.appenlight.com?threaded=1&timeout=5
470 510
471 511 ## used for JS client
472 512 appenlight.api_public_key = YOUR_API_PUBLIC_KEY
473 513
474 514 ## TWEAK AMOUNT OF INFO SENT HERE
475 515
476 516 ## enables 404 error logging (default False)
477 517 appenlight.report_404 = false
478 518
479 519 ## time in seconds after request is considered being slow (default 1)
480 520 appenlight.slow_request_time = 1
481 521
482 522 ## record slow requests in application
483 523 ## (needs to be enabled for slow datastore recording and time tracking)
484 524 appenlight.slow_requests = true
485 525
486 526 ## enable hooking to application loggers
487 527 appenlight.logging = true
488 528
489 529 ## minimum log level for log capture
490 530 appenlight.logging.level = WARNING
491 531
492 532 ## send logs only from erroneous/slow requests
493 533 ## (saves API quota for intensive logging)
494 534 appenlight.logging_on_error = false
495 535
496 536 ## list of additional keywords that should be grabbed from environ object
497 537 ## can be string with comma separated list of words in lowercase
498 538 ## (by default client will always send following info:
499 539 ## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that
500 540 ## start with HTTP* this list be extended with additional keywords here
501 541 appenlight.environ_keys_whitelist =
502 542
503 543 ## list of keywords that should be blanked from request object
504 544 ## can be string with comma separated list of words in lowercase
505 545 ## (by default client will always blank keys that contain following words
506 546 ## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'
507 547 ## this list be extended with additional keywords set here
508 548 appenlight.request_keys_blacklist =
509 549
510 550 ## list of namespaces that should be ignores when gathering log entries
511 551 ## can be string with comma separated list of namespaces
512 552 ## (by default the client ignores own entries: appenlight_client.client)
513 553 appenlight.log_namespace_blacklist =
514 554
515 555 # enable debug style page
516 556 debug_style = true
517 557
518 558 ###########################################
519 559 ### MAIN RHODECODE DATABASE CONFIG ###
520 560 ###########################################
521 561 #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30
522 562 #sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode
523 563 #sqlalchemy.db1.url = mysql://root:qweqwe@localhost/rhodecode?charset=utf8
524 564 # pymysql is an alternative driver for MySQL, use in case of problems with default one
525 565 #sqlalchemy.db1.url = mysql+pymysql://root:qweqwe@localhost/rhodecode
526 566
527 567 sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30
528 568
529 569 # see sqlalchemy docs for other advanced settings
530 570
531 571 ## print the sql statements to output
532 572 sqlalchemy.db1.echo = false
533 573 ## recycle the connections after this amount of seconds
534 574 sqlalchemy.db1.pool_recycle = 3600
535 575
536 576 ## the number of connections to keep open inside the connection pool.
537 577 ## 0 indicates no limit
538 578 #sqlalchemy.db1.pool_size = 5
539 579
540 580 ## the number of connections to allow in connection pool "overflow", that is
541 581 ## connections that can be opened above and beyond the pool_size setting,
542 582 ## which defaults to five.
543 583 #sqlalchemy.db1.max_overflow = 10
544 584
545 585 ## Connection check ping, used to detect broken database connections
546 586 ## could be enabled to better handle cases if MySQL has gone away errors
547 587 #sqlalchemy.db1.ping_connection = true
548 588
549 589 ##################
550 590 ### VCS CONFIG ###
551 591 ##################
552 592 vcs.server.enable = true
553 593 vcs.server = localhost:9900
554 594
555 595 ## Web server connectivity protocol, responsible for web based VCS operations
556 596 ## Available protocols are:
557 597 ## `http` - use http-rpc backend (default)
558 598 vcs.server.protocol = http
559 599
560 600 ## Push/Pull operations protocol, available options are:
561 601 ## `http` - use http-rpc backend (default)
562 602 vcs.scm_app_implementation = http
563 603
564 604 ## Push/Pull operations hooks protocol, available options are:
565 605 ## `http` - use http-rpc backend (default)
566 606 vcs.hooks.protocol = http
567 607
568 608 ## Host on which this instance is listening for hooks. If vcsserver is in other location
569 609 ## this should be adjusted.
570 610 vcs.hooks.host = 127.0.0.1
571 611
572 612 vcs.server.log_level = debug
573 613 ## Start VCSServer with this instance as a subprocess, useful for development
574 614 vcs.start_server = false
575 615
576 616 ## List of enabled VCS backends, available options are:
577 617 ## `hg` - mercurial
578 618 ## `git` - git
579 619 ## `svn` - subversion
580 620 vcs.backends = hg, git, svn
581 621
582 622 vcs.connection_timeout = 3600
583 623 ## Compatibility version when creating SVN repositories. Defaults to newest version when commented out.
584 624 ## Available options are: pre-1.4-compatible, pre-1.5-compatible, pre-1.6-compatible, pre-1.8-compatible, pre-1.9-compatible
585 625 #vcs.svn.compatible_version = pre-1.8-compatible
586 626
587 627
588 628 ############################################################
589 629 ### Subversion proxy support (mod_dav_svn) ###
590 630 ### Maps RhodeCode repo groups into SVN paths for Apache ###
591 631 ############################################################
592 632 ## Enable or disable the config file generation.
593 633 svn.proxy.generate_config = false
594 634 ## Generate config file with `SVNListParentPath` set to `On`.
595 635 svn.proxy.list_parent_path = true
596 636 ## Set location and file name of generated config file.
597 637 svn.proxy.config_file_path = %(here)s/mod_dav_svn.conf
598 638 ## alternative mod_dav config template. This needs to be a mako template
599 639 #svn.proxy.config_template = ~/.rccontrol/enterprise-1/custom_svn_conf.mako
600 640 ## Used as a prefix to the `Location` block in the generated config file.
601 641 ## In most cases it should be set to `/`.
602 642 svn.proxy.location_root = /
603 643 ## Command to reload the mod dav svn configuration on change.
604 644 ## Example: `/etc/init.d/apache2 reload` or /home/USER/apache_reload.sh
605 645 ## Make sure user who runs RhodeCode process is allowed to reload Apache
606 646 #svn.proxy.reload_cmd = /etc/init.d/apache2 reload
607 647 ## If the timeout expires before the reload command finishes, the command will
608 648 ## be killed. Setting it to zero means no timeout. Defaults to 10 seconds.
609 649 #svn.proxy.reload_timeout = 10
610 650
611 651 ############################################################
612 652 ### SSH Support Settings ###
613 653 ############################################################
614 654
615 655 ## Defines if a custom authorized_keys file should be created and written on
616 656 ## any change user ssh keys. Setting this to false also disables possibility
617 657 ## of adding SSH keys by users from web interface. Super admins can still
618 658 ## manage SSH Keys.
619 659 ssh.generate_authorized_keyfile = false
620 660
621 661 ## Options for ssh, default is `no-pty,no-port-forwarding,no-X11-forwarding,no-agent-forwarding`
622 662 # ssh.authorized_keys_ssh_opts =
623 663
624 664 ## Path to the authorized_keys file where the generate entries are placed.
625 665 ## It is possible to have multiple key files specified in `sshd_config` e.g.
626 666 ## AuthorizedKeysFile %h/.ssh/authorized_keys %h/.ssh/authorized_keys_rhodecode
627 667 ssh.authorized_keys_file_path = ~/.ssh/authorized_keys_rhodecode
628 668
629 669 ## Command to execute the SSH wrapper. The binary is available in the
630 670 ## RhodeCode installation directory.
631 671 ## e.g ~/.rccontrol/community-1/profile/bin/rc-ssh-wrapper
632 672 ssh.wrapper_cmd = ~/.rccontrol/community-1/rc-ssh-wrapper
633 673
634 674 ## Allow shell when executing the ssh-wrapper command
635 675 ssh.wrapper_cmd_allow_shell = false
636 676
637 677 ## Enables logging, and detailed output send back to the client during SSH
638 678 ## operations. Useful for debugging, shouldn't be used in production.
639 679 ssh.enable_debug_logging = true
640 680
641 681 ## Paths to binary executable, by default they are the names, but we can
642 682 ## override them if we want to use a custom one
643 683 ssh.executable.hg = ~/.rccontrol/vcsserver-1/profile/bin/hg
644 684 ssh.executable.git = ~/.rccontrol/vcsserver-1/profile/bin/git
645 685 ssh.executable.svn = ~/.rccontrol/vcsserver-1/profile/bin/svnserve
646 686
647 687 ## Enables SSH key generator web interface. Disabling this still allows users
648 688 ## to add their own keys.
649 689 ssh.enable_ui_key_generator = true
650 690
651 691
652 692 ## Dummy marker to add new entries after.
653 693 ## Add any custom entries below. Please don't remove.
654 694 custom.conf = 1
655 695
656 696
657 697 ################################
658 698 ### LOGGING CONFIGURATION ####
659 699 ################################
660 700 [loggers]
661 701 keys = root, sqlalchemy, beaker, celery, rhodecode, ssh_wrapper
662 702
663 703 [handlers]
664 704 keys = console, console_sql
665 705
666 706 [formatters]
667 707 keys = generic, color_formatter, color_formatter_sql
668 708
669 709 #############
670 710 ## LOGGERS ##
671 711 #############
672 712 [logger_root]
673 713 level = NOTSET
674 714 handlers = console
675 715
676 716 [logger_sqlalchemy]
677 717 level = INFO
678 718 handlers = console_sql
679 719 qualname = sqlalchemy.engine
680 720 propagate = 0
681 721
682 722 [logger_beaker]
683 723 level = DEBUG
684 724 handlers =
685 725 qualname = beaker.container
686 726 propagate = 1
687 727
688 728 [logger_rhodecode]
689 729 level = DEBUG
690 730 handlers =
691 731 qualname = rhodecode
692 732 propagate = 1
693 733
694 734 [logger_ssh_wrapper]
695 735 level = DEBUG
696 736 handlers =
697 737 qualname = ssh_wrapper
698 738 propagate = 1
699 739
700 740 [logger_celery]
701 741 level = DEBUG
702 742 handlers =
703 743 qualname = celery
704 744
705 745
706 746 ##############
707 747 ## HANDLERS ##
708 748 ##############
709 749
710 750 [handler_console]
711 751 class = StreamHandler
712 752 args = (sys.stderr, )
713 753 level = DEBUG
714 754 formatter = color_formatter
715 755
716 756 [handler_console_sql]
717 757 # "level = DEBUG" logs SQL queries and results.
718 758 # "level = INFO" logs SQL queries.
719 759 # "level = WARN" logs neither. (Recommended for production systems.)
720 760 class = StreamHandler
721 761 args = (sys.stderr, )
722 762 level = WARN
723 763 formatter = color_formatter_sql
724 764
725 765 ################
726 766 ## FORMATTERS ##
727 767 ################
728 768
729 769 [formatter_generic]
730 770 class = rhodecode.lib.logging_formatter.ExceptionAwareFormatter
731 771 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
732 772 datefmt = %Y-%m-%d %H:%M:%S
733 773
734 774 [formatter_color_formatter]
735 775 class = rhodecode.lib.logging_formatter.ColorFormatter
736 776 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
737 777 datefmt = %Y-%m-%d %H:%M:%S
738 778
739 779 [formatter_color_formatter_sql]
740 780 class = rhodecode.lib.logging_formatter.ColorFormatterSql
741 781 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
742 782 datefmt = %Y-%m-%d %H:%M:%S
@@ -1,259 +1,271 b''
1 1 """
2 2 gunicorn config extension and hooks. Sets additional configuration that is
3 3 available post the .ini config.
4 4
5 5 - workers = ${cpu_number}
6 6 - threads = 1
7 7 - proc_name = ${gunicorn_proc_name}
8 8 - worker_class = sync
9 9 - worker_connections = 10
10 10 - max_requests = 1000
11 11 - max_requests_jitter = 30
12 12 - timeout = 21600
13 13
14 14 """
15 15
16 import gc
17 import os
18 import sys
16 19 import math
17 import gc
18 import sys
19 20 import time
20 21 import threading
21 22 import traceback
22 23 import random
23 24 from gunicorn.glogging import Logger
24 25
25 26
26 27 def get_workers():
27 28 import multiprocessing
28 29 return multiprocessing.cpu_count() * 2 + 1
29 30
30 31 # GLOBAL
31 32 errorlog = '-'
32 33 accesslog = '-'
33 34 loglevel = 'info'
34 35
35 # SECURITY
36
37 # The maximum size of HTTP request line in bytes.
38 # 0 for unlimited
39 limit_request_line = 0
40
41 # Limit the number of HTTP headers fields in a request.
42 # By default this value is 100 and can't be larger than 32768.
43 limit_request_fields = 32768
44
45 # Limit the allowed size of an HTTP request header field.
46 # Value is a positive number or 0.
47 # Setting it to 0 will allow unlimited header field sizes.
48 limit_request_field_size = 0
49
50 # Timeout for graceful workers restart.
51 # After receiving a restart signal, workers have this much time to finish
52 # serving requests. Workers still alive after the timeout (starting from the
53 # receipt of the restart signal) are force killed.
54 graceful_timeout = 60 * 60
55
56 # The number of seconds to wait for requests on a Keep-Alive connection.
57 # Generally set in the 1-5 seconds range.
58 keepalive = 2
59 36
60 37 # SERVER MECHANICS
61 38 # None == system temp dir
62 39 # worker_tmp_dir is recommended to be set to some tmpfs
63 40 worker_tmp_dir = None
64 41 tmp_upload_dir = None
65 42
66 43 # Custom log format
67 44 access_log_format = (
68 45 '%(t)s %(p)s INFO [GNCRN] %(h)-15s rqt:%(L)s %(s)s %(b)-6s "%(m)s:%(U)s %(q)s" usr:%(u)s "%(f)s" "%(a)s"')
69 46
70 47 # self adjust workers based on CPU count
71 48 # workers = get_workers()
72 49
73 # n * 1024 * 0124 == n MBs, 0 = memory monitoring is disabled
74 MAX_MEMORY_USAGE = 0 * 1024 * 1024
75
76 # How often in seconds to check for memory usage
77 MEMORY_USAGE_CHECK_INTERVAL = 30
78
79 # If a gc brings us back below this threshold, we can avoid termination.
80 MEMORY_USAGE_RECOVERY_THRESHOLD = MAX_MEMORY_USAGE * 0.8
81
82 50
83 51 def _get_process_rss(pid=None):
84 52 try:
85 53 import psutil
86 54 if pid:
87 55 proc = psutil.Process(pid)
88 56 else:
89 57 proc = psutil.Process()
90 58 return proc.memory_info().rss
91 59 except Exception:
92 60 return None
93 61
94 62
95 def _time_with_offset():
96 return time.time() - random.randint(0, MEMORY_USAGE_CHECK_INTERVAL/2.0)
63 def _get_config(ini_path):
64
65 try:
66 import configparser
67 except ImportError:
68 import ConfigParser as configparser
69 try:
70 config = configparser.ConfigParser()
71 config.read(ini_path)
72 return config
73 except Exception:
74 return None
75
76
77 def _time_with_offset(memory_usage_check_interval):
78 return time.time() - random.randint(0, memory_usage_check_interval/2.0)
97 79
98 80
99 81 def pre_fork(server, worker):
100 82 pass
101 83
102 84
103 85 def post_fork(server, worker):
104 server.log.info("<%s> WORKER spawned", worker.pid)
86
87 # memory spec defaults
88 _memory_max_usage = 0
89 _memory_usage_check_interval = 60
90 _memory_usage_recovery_threshold = 0.8
91
92 ini_path = os.path.abspath(server.cfg.paste)
93 conf = _get_config(ini_path)
94 if conf and 'server:main' in conf:
95 section = conf['server:main']
96
97 if section.get('memory_max_usage'):
98 _memory_max_usage = int(section.get('memory_max_usage'))
99 if section.get('memory_usage_check_interval'):
100 _memory_usage_check_interval = int(section.get('memory_usage_check_interval'))
101 if section.get('memory_usage_recovery_threshold'):
102 _memory_usage_recovery_threshold = float(section.get('memory_usage_recovery_threshold'))
103
104 worker._memory_max_usage = _memory_max_usage
105 worker._memory_usage_check_interval = _memory_usage_check_interval
106 worker._memory_usage_recovery_threshold = _memory_usage_recovery_threshold
107
105 108 # register memory last check time, with some random offset so we don't recycle all
106 109 # at once
107 worker._last_memory_check_time = _time_with_offset()
110 worker._last_memory_check_time = _time_with_offset(_memory_usage_check_interval)
111
112 if _memory_max_usage:
113 server.log.info("[%-10s] WORKER spawned with max memory set at %s", worker.pid,
114 _format_data_size(_memory_max_usage))
115 else:
116 server.log.info("[%-10s] WORKER spawned", worker.pid)
108 117
109 118
110 119 def pre_exec(server):
111 120 server.log.info("Forked child, re-executing.")
112 121
113 122
114 123 def on_starting(server):
115 124 server_lbl = '{} {}'.format(server.proc_name, server.address)
116 125 server.log.info("Server %s is starting.", server_lbl)
117 126
118 127
119 128 def when_ready(server):
120 129 server.log.info("Server %s is ready. Spawning workers", server)
121 130
122 131
123 132 def on_reload(server):
124 133 pass
125 134
126 135
127 136 def _format_data_size(size, unit="B", precision=1, binary=True):
128 137 """Format a number using SI units (kilo, mega, etc.).
129 138
130 139 ``size``: The number as a float or int.
131 140
132 141 ``unit``: The unit name in plural form. Examples: "bytes", "B".
133 142
134 143 ``precision``: How many digits to the right of the decimal point. Default
135 144 is 1. 0 suppresses the decimal point.
136 145
137 146 ``binary``: If false, use base-10 decimal prefixes (kilo = K = 1000).
138 147 If true, use base-2 binary prefixes (kibi = Ki = 1024).
139 148
140 149 ``full_name``: If false (default), use the prefix abbreviation ("k" or
141 150 "Ki"). If true, use the full prefix ("kilo" or "kibi"). If false,
142 151 use abbreviation ("k" or "Ki").
143 152
144 153 """
145 154
146 155 if not binary:
147 156 base = 1000
148 157 multiples = ('', 'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y')
149 158 else:
150 159 base = 1024
151 160 multiples = ('', 'Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi', 'Yi')
152 161
153 162 sign = ""
154 163 if size > 0:
155 164 m = int(math.log(size, base))
156 165 elif size < 0:
157 166 sign = "-"
158 167 size = -size
159 168 m = int(math.log(size, base))
160 169 else:
161 170 m = 0
162 171 if m > 8:
163 172 m = 8
164 173
165 174 if m == 0:
166 175 precision = '%.0f'
167 176 else:
168 177 precision = '%%.%df' % precision
169 178
170 179 size = precision % (size / math.pow(base, m))
171 180
172 181 return '%s%s %s%s' % (sign, size.strip(), multiples[m], unit)
173 182
174 183
175 184 def _check_memory_usage(worker):
185 memory_max_usage = worker._memory_max_usage
186 if not memory_max_usage:
187 return
176 188
177 if not MAX_MEMORY_USAGE:
178 return
189 memory_usage_check_interval = worker._memory_usage_check_interval
190 memory_usage_recovery_threshold = memory_max_usage * worker._memory_usage_recovery_threshold
179 191
180 192 elapsed = time.time() - worker._last_memory_check_time
181 if elapsed > MEMORY_USAGE_CHECK_INTERVAL:
193 if elapsed > memory_usage_check_interval:
182 194 mem_usage = _get_process_rss()
183 if mem_usage and mem_usage > MAX_MEMORY_USAGE:
195 if mem_usage and mem_usage > memory_max_usage:
184 196 worker.log.info(
185 197 "memory usage %s > %s, forcing gc",
186 _format_data_size(mem_usage), _format_data_size(MAX_MEMORY_USAGE))
198 _format_data_size(mem_usage), _format_data_size(memory_max_usage))
187 199 # Try to clean it up by forcing a full collection.
188 200 gc.collect()
189 201 mem_usage = _get_process_rss()
190 if mem_usage > MEMORY_USAGE_RECOVERY_THRESHOLD:
202 if mem_usage > memory_usage_recovery_threshold:
191 203 # Didn't clean up enough, we'll have to terminate.
192 204 worker.log.warning(
193 205 "memory usage %s > %s after gc, quitting",
194 _format_data_size(mem_usage), _format_data_size(MAX_MEMORY_USAGE))
206 _format_data_size(mem_usage), _format_data_size(memory_max_usage))
195 207 # This will cause worker to auto-restart itself
196 208 worker.alive = False
197 209 worker._last_memory_check_time = time.time()
198 210
199 211
200 212 def worker_int(worker):
201 worker.log.info("[<%-10s>] worker received INT or QUIT signal", worker.pid)
213 worker.log.info("[%-10s] worker received INT or QUIT signal", worker.pid)
202 214
203 215 # get traceback info, on worker crash
204 216 id2name = dict([(th.ident, th.name) for th in threading.enumerate()])
205 217 code = []
206 218 for thread_id, stack in sys._current_frames().items():
207 219 code.append(
208 220 "\n# Thread: %s(%d)" % (id2name.get(thread_id, ""), thread_id))
209 221 for fname, lineno, name, line in traceback.extract_stack(stack):
210 222 code.append('File: "%s", line %d, in %s' % (fname, lineno, name))
211 223 if line:
212 224 code.append(" %s" % (line.strip()))
213 225 worker.log.debug("\n".join(code))
214 226
215 227
216 228 def worker_abort(worker):
217 worker.log.info("[<%-10s>] worker received SIGABRT signal", worker.pid)
229 worker.log.info("[%-10s] worker received SIGABRT signal", worker.pid)
218 230
219 231
220 232 def worker_exit(server, worker):
221 worker.log.info("[<%-10s>] worker exit", worker.pid)
233 worker.log.info("[%-10s] worker exit", worker.pid)
222 234
223 235
224 236 def child_exit(server, worker):
225 worker.log.info("[<%-10s>] worker child exit", worker.pid)
237 worker.log.info("[%-10s] worker child exit", worker.pid)
226 238
227 239
228 240 def pre_request(worker, req):
229 241 worker.start_time = time.time()
230 242 worker.log.debug(
231 243 "GNCRN PRE WORKER [cnt:%s]: %s %s", worker.nr, req.method, req.path)
232 244
233 245
234 246 def post_request(worker, req, environ, resp):
235 247 total_time = time.time() - worker.start_time
236 248 worker.log.debug(
237 249 "GNCRN POST WORKER [cnt:%s]: %s %s resp: %s, Load Time: %.4fs",
238 250 worker.nr, req.method, req.path, resp.status_code, total_time)
239 251 _check_memory_usage(worker)
240 252
241 253
242 254 class RhodeCodeLogger(Logger):
243 255 """
244 256 Custom Logger that allows some customization that gunicorn doesn't allow
245 257 """
246 258
247 259 datefmt = r"%Y-%m-%d %H:%M:%S"
248 260
249 261 def __init__(self, cfg):
250 262 Logger.__init__(self, cfg)
251 263
252 264 def now(self):
253 265 """ return date in RhodeCode Log format """
254 266 now = time.time()
255 267 msecs = int((now - long(now)) * 1000)
256 268 return time.strftime(self.datefmt, time.localtime(now)) + '.{0:03d}'.format(msecs)
257 269
258 270
259 271 logger_class = RhodeCodeLogger
@@ -1,719 +1,759 b''
1 1
2 2
3 3 ################################################################################
4 4 ## RHODECODE COMMUNITY EDITION CONFIGURATION ##
5 5 ################################################################################
6 6
7 7 [DEFAULT]
8 8 ## Debug flag sets all loggers to debug, and enables request tracking
9 9 debug = false
10 10
11 11 ################################################################################
12 12 ## EMAIL CONFIGURATION ##
13 13 ## Uncomment and replace with the email address which should receive ##
14 14 ## any error reports after an application crash ##
15 15 ## Additionally these settings will be used by the RhodeCode mailing system ##
16 16 ################################################################################
17 17
18 18 ## prefix all emails subjects with given prefix, helps filtering out emails
19 19 #email_prefix = [RhodeCode]
20 20
21 21 ## email FROM address all mails will be sent
22 22 #app_email_from = rhodecode-noreply@localhost
23 23
24 24 #smtp_server = mail.server.com
25 25 #smtp_username =
26 26 #smtp_password =
27 27 #smtp_port =
28 28 #smtp_use_tls = false
29 29 #smtp_use_ssl = true
30 30
31 31 [server:main]
32 32 ## COMMON ##
33 33 host = 127.0.0.1
34 34 port = 5000
35 35
36 36 ###########################################################
37 37 ## WAITRESS WSGI SERVER - Recommended for Development ####
38 38 ###########################################################
39 39
40 40 #use = egg:waitress#main
41 41 ## number of worker threads
42 42 #threads = 5
43 43 ## MAX BODY SIZE 100GB
44 44 #max_request_body_size = 107374182400
45 45 ## Use poll instead of select, fixes file descriptors limits problems.
46 46 ## May not work on old windows systems.
47 47 #asyncore_use_poll = true
48 48
49 49
50 50 ##########################
51 51 ## GUNICORN WSGI SERVER ##
52 52 ##########################
53 53 ## run with gunicorn --log-config rhodecode.ini --paste rhodecode.ini
54 54
55 55 use = egg:gunicorn#main
56 56 ## Sets the number of process workers. More workers means more concurrent connections
57 57 ## RhodeCode can handle at the same time. Each additional worker also it increases
58 58 ## memory usage as each has it's own set of caches.
59 59 ## Recommended value is (2 * NUMBER_OF_CPUS + 1), eg 2CPU = 5 workers, but no more
60 60 ## than 8-10 unless for really big deployments .e.g 700-1000 users.
61 61 ## `instance_id = *` must be set in the [app:main] section below (which is the default)
62 62 ## when using more than 1 worker.
63 63 workers = 2
64
64 65 ## process name visible in process list
65 66 proc_name = rhodecode
67
66 68 ## type of worker class, one of sync, gevent
67 69 ## recommended for bigger setup is using of of other than sync one
68 70 worker_class = gevent
71
69 72 ## The maximum number of simultaneous clients. Valid only for Gevent
70 73 worker_connections = 10
74
71 75 ## max number of requests that worker will handle before being gracefully
72 76 ## restarted, could prevent memory leaks
73 77 max_requests = 1000
74 78 max_requests_jitter = 30
79
75 80 ## amount of time a worker can spend with handling a request before it
76 81 ## gets killed and restarted. Set to 6hrs
77 82 timeout = 21600
78 83
84 ## The maximum size of HTTP request line in bytes.
85 ## 0 for unlimited
86 limit_request_line = 0
87
88 ## Limit the number of HTTP headers fields in a request.
89 ## By default this value is 100 and can't be larger than 32768.
90 limit_request_fields = 32768
91
92 ## Limit the allowed size of an HTTP request header field.
93 ## Value is a positive number or 0.
94 ## Setting it to 0 will allow unlimited header field sizes.
95 limit_request_field_size = 0
96
97 ## Timeout for graceful workers restart.
98 ## After receiving a restart signal, workers have this much time to finish
99 ## serving requests. Workers still alive after the timeout (starting from the
100 ## receipt of the restart signal) are force killed.
101 graceful_timeout = 3600
102
103 # The number of seconds to wait for requests on a Keep-Alive connection.
104 # Generally set in the 1-5 seconds range.
105 keepalive = 2
106
107 ## Maximum memory usage that each worker can use before it will receive a
108 ## graceful restart signal, e.g 10MB = 10485760 (10 * 1024 * 1024)
109 # 0 = memory monitoring is disabled
110 memory_max_usage = 0
111
112 ## How often in seconds to check for memory usage for each gunicorn worker
113 memory_usage_check_interval = 60
114
115 ## Threshold value for which we don't recycle worker if GarbageCollection
116 ## frees up enough resources. Before each restart we try to run GC on worker
117 ## in case we get enough free memory after that, restart will not happen.
118 memory_usage_recovery_threshold = 0.8
79 119
80 120 ## prefix middleware for RhodeCode.
81 121 ## recommended when using proxy setup.
82 122 ## allows to set RhodeCode under a prefix in server.
83 123 ## eg https://server.com/custom_prefix. Enable `filter-with =` option below as well.
84 124 ## And set your prefix like: `prefix = /custom_prefix`
85 125 ## be sure to also set beaker.session.cookie_path = /custom_prefix if you need
86 126 ## to make your cookies only work on prefix url
87 127 [filter:proxy-prefix]
88 128 use = egg:PasteDeploy#prefix
89 129 prefix = /
90 130
91 131 [app:main]
92 132 ## The %(here)s variable will be replaced with the absolute path of parent directory
93 133 ## of this file
94 134 ## In addition ENVIRONMENT variables usage is possible, e.g
95 135 ## sqlalchemy.db1.url = {ENV_RC_DB_URL}
96 136
97 137 use = egg:rhodecode-enterprise-ce
98 138
99 139 ## enable proxy prefix middleware, defined above
100 140 #filter-with = proxy-prefix
101 141
102 142 ## encryption key used to encrypt social plugin tokens,
103 143 ## remote_urls with credentials etc, if not set it defaults to
104 144 ## `beaker.session.secret`
105 145 #rhodecode.encrypted_values.secret =
106 146
107 147 ## decryption strict mode (enabled by default). It controls if decryption raises
108 148 ## `SignatureVerificationError` in case of wrong key, or damaged encryption data.
109 149 #rhodecode.encrypted_values.strict = false
110 150
111 151 ## Pick algorithm for encryption. Either fernet (more secure) or aes (default)
112 152 ## fernet is safer, and we strongly recommend switching to it.
113 153 ## Due to backward compatibility aes is used as default.
114 154 #rhodecode.encrypted_values.algorithm = fernet
115 155
116 156 ## return gzipped responses from RhodeCode (static files/application)
117 157 gzip_responses = false
118 158
119 159 ## auto-generate javascript routes file on startup
120 160 generate_js_files = false
121 161
122 162 ## System global default language.
123 163 ## All available languages: en(default), be, de, es, fr, it, ja, pl, pt, ru, zh
124 164 lang = en
125 165
126 166 ## Perform a full repository scan and import on each server start.
127 167 ## Settings this to true could lead to very long startup time.
128 168 startup.import_repos = false
129 169
130 170 ## Uncomment and set this path to use archive download cache.
131 171 ## Once enabled, generated archives will be cached at this location
132 172 ## and served from the cache during subsequent requests for the same archive of
133 173 ## the repository.
134 174 #archive_cache_dir = /tmp/tarballcache
135 175
136 176 ## URL at which the application is running. This is used for Bootstrapping
137 177 ## requests in context when no web request is available. Used in ishell, or
138 178 ## SSH calls. Set this for events to receive proper url for SSH calls.
139 179 app.base_url = http://rhodecode.local
140 180
141 181 ## Unique application ID. Should be a random unique string for security.
142 182 app_instance_uuid = rc-production
143 183
144 184 ## Cut off limit for large diffs (size in bytes). If overall diff size on
145 185 ## commit, or pull request exceeds this limit this diff will be displayed
146 186 ## partially. E.g 512000 == 512Kb
147 187 cut_off_limit_diff = 512000
148 188
149 189 ## Cut off limit for large files inside diffs (size in bytes). Each individual
150 190 ## file inside diff which exceeds this limit will be displayed partially.
151 191 ## E.g 128000 == 128Kb
152 192 cut_off_limit_file = 128000
153 193
154 194 ## use cached version of vcs repositories everywhere. Recommended to be `true`
155 195 vcs_full_cache = true
156 196
157 197 ## Force https in RhodeCode, fixes https redirects, assumes it's always https.
158 198 ## Normally this is controlled by proper http flags sent from http server
159 199 force_https = false
160 200
161 201 ## use Strict-Transport-Security headers
162 202 use_htsts = false
163 203
164 204 # Set to true if your repos are exposed using the dumb protocol
165 205 git_update_server_info = false
166 206
167 207 ## RSS/ATOM feed options
168 208 rss_cut_off_limit = 256000
169 209 rss_items_per_page = 10
170 210 rss_include_diff = false
171 211
172 212 ## gist URL alias, used to create nicer urls for gist. This should be an
173 213 ## url that does rewrites to _admin/gists/{gistid}.
174 214 ## example: http://gist.rhodecode.org/{gistid}. Empty means use the internal
175 215 ## RhodeCode url, ie. http[s]://rhodecode.server/_admin/gists/{gistid}
176 216 gist_alias_url =
177 217
178 218 ## List of views (using glob pattern syntax) that AUTH TOKENS could be
179 219 ## used for access.
180 220 ## Adding ?auth_token=TOKEN_HASH to the url authenticates this request as if it
181 221 ## came from the the logged in user who own this authentication token.
182 222 ## Additionally @TOKEN syntax can be used to bound the view to specific
183 223 ## authentication token. Such view would be only accessible when used together
184 224 ## with this authentication token
185 225 ##
186 226 ## list of all views can be found under `/_admin/permissions/auth_token_access`
187 227 ## The list should be "," separated and on a single line.
188 228 ##
189 229 ## Most common views to enable:
190 230 # RepoCommitsView:repo_commit_download
191 231 # RepoCommitsView:repo_commit_patch
192 232 # RepoCommitsView:repo_commit_raw
193 233 # RepoCommitsView:repo_commit_raw@TOKEN
194 234 # RepoFilesView:repo_files_diff
195 235 # RepoFilesView:repo_archivefile
196 236 # RepoFilesView:repo_file_raw
197 237 # GistView:*
198 238 api_access_controllers_whitelist =
199 239
200 240 ## Default encoding used to convert from and to unicode
201 241 ## can be also a comma separated list of encoding in case of mixed encodings
202 242 default_encoding = UTF-8
203 243
204 244 ## instance-id prefix
205 245 ## a prefix key for this instance used for cache invalidation when running
206 246 ## multiple instances of RhodeCode, make sure it's globally unique for
207 247 ## all running RhodeCode instances. Leave empty if you don't use it
208 248 instance_id =
209 249
210 250 ## Fallback authentication plugin. Set this to a plugin ID to force the usage
211 251 ## of an authentication plugin also if it is disabled by it's settings.
212 252 ## This could be useful if you are unable to log in to the system due to broken
213 253 ## authentication settings. Then you can enable e.g. the internal RhodeCode auth
214 254 ## module to log in again and fix the settings.
215 255 ##
216 256 ## Available builtin plugin IDs (hash is part of the ID):
217 257 ## egg:rhodecode-enterprise-ce#rhodecode
218 258 ## egg:rhodecode-enterprise-ce#pam
219 259 ## egg:rhodecode-enterprise-ce#ldap
220 260 ## egg:rhodecode-enterprise-ce#jasig_cas
221 261 ## egg:rhodecode-enterprise-ce#headers
222 262 ## egg:rhodecode-enterprise-ce#crowd
223 263 #rhodecode.auth_plugin_fallback = egg:rhodecode-enterprise-ce#rhodecode
224 264
225 265 ## alternative return HTTP header for failed authentication. Default HTTP
226 266 ## response is 401 HTTPUnauthorized. Currently HG clients have troubles with
227 267 ## handling that causing a series of failed authentication calls.
228 268 ## Set this variable to 403 to return HTTPForbidden, or any other HTTP code
229 269 ## This will be served instead of default 401 on bad authentication
230 270 auth_ret_code =
231 271
232 272 ## use special detection method when serving auth_ret_code, instead of serving
233 273 ## ret_code directly, use 401 initially (Which triggers credentials prompt)
234 274 ## and then serve auth_ret_code to clients
235 275 auth_ret_code_detection = false
236 276
237 277 ## locking return code. When repository is locked return this HTTP code. 2XX
238 278 ## codes don't break the transactions while 4XX codes do
239 279 lock_ret_code = 423
240 280
241 281 ## allows to change the repository location in settings page
242 282 allow_repo_location_change = true
243 283
244 284 ## allows to setup custom hooks in settings page
245 285 allow_custom_hooks_settings = true
246 286
247 287 ## Generated license token required for EE edition license.
248 288 ## New generated token value can be found in Admin > settings > license page.
249 289 license_token =
250 290
251 291 ## This flag would hide sensitive information on the license page
252 292 license.hide_license_info = false
253 293
254 294 ## supervisor connection uri, for managing supervisor and logs.
255 295 supervisor.uri =
256 296 ## supervisord group name/id we only want this RC instance to handle
257 297 supervisor.group_id = prod
258 298
259 299 ## Display extended labs settings
260 300 labs_settings_active = true
261 301
262 302 ## Custom exception store path, defaults to TMPDIR
263 303 ## This is used to store exception from RhodeCode in shared directory
264 304 #exception_tracker.store_path =
265 305
266 306 ## File store configuration. This is used to store and serve uploaded files
267 307 file_store.enabled = true
268 308 ## Storage backend, available options are: local
269 309 file_store.backend = local
270 310 ## path to store the uploaded binaries
271 311 file_store.storage_path = %(here)s/data/file_store
272 312
273 313
274 314 ####################################
275 315 ### CELERY CONFIG ####
276 316 ####################################
277 317 ## run: /path/to/celery worker \
278 318 ## -E --beat --app rhodecode.lib.celerylib.loader \
279 319 ## --scheduler rhodecode.lib.celerylib.scheduler.RcScheduler \
280 320 ## --loglevel DEBUG --ini /path/to/rhodecode.ini
281 321
282 322 use_celery = false
283 323
284 324 ## connection url to the message broker (default redis)
285 325 celery.broker_url = redis://localhost:6379/8
286 326
287 327 ## rabbitmq example
288 328 #celery.broker_url = amqp://rabbitmq:qweqwe@localhost:5672/rabbitmqhost
289 329
290 330 ## maximum tasks to execute before worker restart
291 331 celery.max_tasks_per_child = 100
292 332
293 333 ## tasks will never be sent to the queue, but executed locally instead.
294 334 celery.task_always_eager = false
295 335
296 336 #####################################
297 337 ### DOGPILE CACHE ####
298 338 #####################################
299 339 ## Default cache dir for caches. Putting this into a ramdisk
300 340 ## can boost performance, eg. /tmpfs/data_ramdisk, however this directory might require
301 341 ## large amount of space
302 342 cache_dir = %(here)s/data
303 343
304 344 ## `cache_perms` cache settings for permission tree, auth TTL.
305 345 rc_cache.cache_perms.backend = dogpile.cache.rc.file_namespace
306 346 rc_cache.cache_perms.expiration_time = 300
307 347
308 348 ## alternative `cache_perms` redis backend with distributed lock
309 349 #rc_cache.cache_perms.backend = dogpile.cache.rc.redis
310 350 #rc_cache.cache_perms.expiration_time = 300
311 351 ## redis_expiration_time needs to be greater then expiration_time
312 352 #rc_cache.cache_perms.arguments.redis_expiration_time = 7200
313 353 #rc_cache.cache_perms.arguments.socket_timeout = 30
314 354 #rc_cache.cache_perms.arguments.host = localhost
315 355 #rc_cache.cache_perms.arguments.port = 6379
316 356 #rc_cache.cache_perms.arguments.db = 0
317 357 ## more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends
318 358 #rc_cache.cache_perms.arguments.distributed_lock = true
319 359
320 360 ## `cache_repo` cache settings for FileTree, Readme, RSS FEEDS
321 361 rc_cache.cache_repo.backend = dogpile.cache.rc.file_namespace
322 362 rc_cache.cache_repo.expiration_time = 2592000
323 363
324 364 ## alternative `cache_repo` redis backend with distributed lock
325 365 #rc_cache.cache_repo.backend = dogpile.cache.rc.redis
326 366 #rc_cache.cache_repo.expiration_time = 2592000
327 367 ## redis_expiration_time needs to be greater then expiration_time
328 368 #rc_cache.cache_repo.arguments.redis_expiration_time = 2678400
329 369 #rc_cache.cache_repo.arguments.socket_timeout = 30
330 370 #rc_cache.cache_repo.arguments.host = localhost
331 371 #rc_cache.cache_repo.arguments.port = 6379
332 372 #rc_cache.cache_repo.arguments.db = 1
333 373 ## more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends
334 374 #rc_cache.cache_repo.arguments.distributed_lock = true
335 375
336 376 ## cache settings for SQL queries, this needs to use memory type backend
337 377 rc_cache.sql_cache_short.backend = dogpile.cache.rc.memory_lru
338 378 rc_cache.sql_cache_short.expiration_time = 30
339 379
340 380 ## `cache_repo_longterm` cache for repo object instances, this needs to use memory
341 381 ## type backend as the objects kept are not pickle serializable
342 382 rc_cache.cache_repo_longterm.backend = dogpile.cache.rc.memory_lru
343 383 ## by default we use 96H, this is using invalidation on push anyway
344 384 rc_cache.cache_repo_longterm.expiration_time = 345600
345 385 ## max items in LRU cache, reduce this number to save memory, and expire last used
346 386 ## cached objects
347 387 rc_cache.cache_repo_longterm.max_size = 10000
348 388
349 389
350 390 ####################################
351 391 ### BEAKER SESSION ####
352 392 ####################################
353 393
354 394 ## .session.type is type of storage options for the session, current allowed
355 395 ## types are file, ext:memcached, ext:redis, ext:database, and memory (default).
356 396 beaker.session.type = file
357 397 beaker.session.data_dir = %(here)s/data/sessions
358 398
359 399 ## redis sessions
360 400 #beaker.session.type = ext:redis
361 401 #beaker.session.url = redis://127.0.0.1:6379/2
362 402
363 403 ## db based session, fast, and allows easy management over logged in users
364 404 #beaker.session.type = ext:database
365 405 #beaker.session.table_name = db_session
366 406 #beaker.session.sa.url = postgresql://postgres:secret@localhost/rhodecode
367 407 #beaker.session.sa.url = mysql://root:secret@127.0.0.1/rhodecode
368 408 #beaker.session.sa.pool_recycle = 3600
369 409 #beaker.session.sa.echo = false
370 410
371 411 beaker.session.key = rhodecode
372 412 beaker.session.secret = production-rc-uytcxaz
373 413 beaker.session.lock_dir = %(here)s/data/sessions/lock
374 414
375 415 ## Secure encrypted cookie. Requires AES and AES python libraries
376 416 ## you must disable beaker.session.secret to use this
377 417 #beaker.session.encrypt_key = key_for_encryption
378 418 #beaker.session.validate_key = validation_key
379 419
380 420 ## sets session as invalid(also logging out user) if it haven not been
381 421 ## accessed for given amount of time in seconds
382 422 beaker.session.timeout = 2592000
383 423 beaker.session.httponly = true
384 424 ## Path to use for the cookie. Set to prefix if you use prefix middleware
385 425 #beaker.session.cookie_path = /custom_prefix
386 426
387 427 ## uncomment for https secure cookie
388 428 beaker.session.secure = false
389 429
390 430 ## auto save the session to not to use .save()
391 431 beaker.session.auto = false
392 432
393 433 ## default cookie expiration time in seconds, set to `true` to set expire
394 434 ## at browser close
395 435 #beaker.session.cookie_expires = 3600
396 436
397 437 ###################################
398 438 ## SEARCH INDEXING CONFIGURATION ##
399 439 ###################################
400 440 ## Full text search indexer is available in rhodecode-tools under
401 441 ## `rhodecode-tools index` command
402 442
403 443 ## WHOOSH Backend, doesn't require additional services to run
404 444 ## it works good with few dozen repos
405 445 search.module = rhodecode.lib.index.whoosh
406 446 search.location = %(here)s/data/index
407 447
408 448 ########################################
409 449 ### CHANNELSTREAM CONFIG ####
410 450 ########################################
411 451 ## channelstream enables persistent connections and live notification
412 452 ## in the system. It's also used by the chat system
413 453
414 454 channelstream.enabled = false
415 455
416 456 ## server address for channelstream server on the backend
417 457 channelstream.server = 127.0.0.1:9800
418 458
419 459 ## location of the channelstream server from outside world
420 460 ## use ws:// for http or wss:// for https. This address needs to be handled
421 461 ## by external HTTP server such as Nginx or Apache
422 462 ## see Nginx/Apache configuration examples in our docs
423 463 channelstream.ws_url = ws://rhodecode.yourserver.com/_channelstream
424 464 channelstream.secret = secret
425 465 channelstream.history.location = %(here)s/channelstream_history
426 466
427 467 ## Internal application path that Javascript uses to connect into.
428 468 ## If you use proxy-prefix the prefix should be added before /_channelstream
429 469 channelstream.proxy_path = /_channelstream
430 470
431 471 ## Live chat for commits/pull requests. Requires CHANNELSTREAM to be enabled
432 472 ## and configured. (EE edition only)
433 473 chat.enabled = true
434 474
435 475
436 476 ###################################
437 477 ## APPENLIGHT CONFIG ##
438 478 ###################################
439 479
440 480 ## Appenlight is tailored to work with RhodeCode, see
441 481 ## http://appenlight.com for details how to obtain an account
442 482
443 483 ## Appenlight integration enabled
444 484 appenlight = false
445 485
446 486 appenlight.server_url = https://api.appenlight.com
447 487 appenlight.api_key = YOUR_API_KEY
448 488 #appenlight.transport_config = https://api.appenlight.com?threaded=1&timeout=5
449 489
450 490 ## used for JS client
451 491 appenlight.api_public_key = YOUR_API_PUBLIC_KEY
452 492
453 493 ## TWEAK AMOUNT OF INFO SENT HERE
454 494
455 495 ## enables 404 error logging (default False)
456 496 appenlight.report_404 = false
457 497
458 498 ## time in seconds after request is considered being slow (default 1)
459 499 appenlight.slow_request_time = 1
460 500
461 501 ## record slow requests in application
462 502 ## (needs to be enabled for slow datastore recording and time tracking)
463 503 appenlight.slow_requests = true
464 504
465 505 ## enable hooking to application loggers
466 506 appenlight.logging = true
467 507
468 508 ## minimum log level for log capture
469 509 appenlight.logging.level = WARNING
470 510
471 511 ## send logs only from erroneous/slow requests
472 512 ## (saves API quota for intensive logging)
473 513 appenlight.logging_on_error = false
474 514
475 515 ## list of additional keywords that should be grabbed from environ object
476 516 ## can be string with comma separated list of words in lowercase
477 517 ## (by default client will always send following info:
478 518 ## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that
479 519 ## start with HTTP* this list be extended with additional keywords here
480 520 appenlight.environ_keys_whitelist =
481 521
482 522 ## list of keywords that should be blanked from request object
483 523 ## can be string with comma separated list of words in lowercase
484 524 ## (by default client will always blank keys that contain following words
485 525 ## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'
486 526 ## this list be extended with additional keywords set here
487 527 appenlight.request_keys_blacklist =
488 528
489 529 ## list of namespaces that should be ignores when gathering log entries
490 530 ## can be string with comma separated list of namespaces
491 531 ## (by default the client ignores own entries: appenlight_client.client)
492 532 appenlight.log_namespace_blacklist =
493 533
494 534
495 535 ###########################################
496 536 ### MAIN RHODECODE DATABASE CONFIG ###
497 537 ###########################################
498 538 #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30
499 539 #sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode
500 540 #sqlalchemy.db1.url = mysql://root:qweqwe@localhost/rhodecode?charset=utf8
501 541 # pymysql is an alternative driver for MySQL, use in case of problems with default one
502 542 #sqlalchemy.db1.url = mysql+pymysql://root:qweqwe@localhost/rhodecode
503 543
504 544 sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode
505 545
506 546 # see sqlalchemy docs for other advanced settings
507 547
508 548 ## print the sql statements to output
509 549 sqlalchemy.db1.echo = false
510 550 ## recycle the connections after this amount of seconds
511 551 sqlalchemy.db1.pool_recycle = 3600
512 552
513 553 ## the number of connections to keep open inside the connection pool.
514 554 ## 0 indicates no limit
515 555 #sqlalchemy.db1.pool_size = 5
516 556
517 557 ## the number of connections to allow in connection pool "overflow", that is
518 558 ## connections that can be opened above and beyond the pool_size setting,
519 559 ## which defaults to five.
520 560 #sqlalchemy.db1.max_overflow = 10
521 561
522 562 ## Connection check ping, used to detect broken database connections
523 563 ## could be enabled to better handle cases if MySQL has gone away errors
524 564 #sqlalchemy.db1.ping_connection = true
525 565
526 566 ##################
527 567 ### VCS CONFIG ###
528 568 ##################
529 569 vcs.server.enable = true
530 570 vcs.server = localhost:9900
531 571
532 572 ## Web server connectivity protocol, responsible for web based VCS operations
533 573 ## Available protocols are:
534 574 ## `http` - use http-rpc backend (default)
535 575 vcs.server.protocol = http
536 576
537 577 ## Push/Pull operations protocol, available options are:
538 578 ## `http` - use http-rpc backend (default)
539 579 vcs.scm_app_implementation = http
540 580
541 581 ## Push/Pull operations hooks protocol, available options are:
542 582 ## `http` - use http-rpc backend (default)
543 583 vcs.hooks.protocol = http
544 584
545 585 ## Host on which this instance is listening for hooks. If vcsserver is in other location
546 586 ## this should be adjusted.
547 587 vcs.hooks.host = 127.0.0.1
548 588
549 589 vcs.server.log_level = info
550 590 ## Start VCSServer with this instance as a subprocess, useful for development
551 591 vcs.start_server = false
552 592
553 593 ## List of enabled VCS backends, available options are:
554 594 ## `hg` - mercurial
555 595 ## `git` - git
556 596 ## `svn` - subversion
557 597 vcs.backends = hg, git, svn
558 598
559 599 vcs.connection_timeout = 3600
560 600 ## Compatibility version when creating SVN repositories. Defaults to newest version when commented out.
561 601 ## Available options are: pre-1.4-compatible, pre-1.5-compatible, pre-1.6-compatible, pre-1.8-compatible, pre-1.9-compatible
562 602 #vcs.svn.compatible_version = pre-1.8-compatible
563 603
564 604
565 605 ############################################################
566 606 ### Subversion proxy support (mod_dav_svn) ###
567 607 ### Maps RhodeCode repo groups into SVN paths for Apache ###
568 608 ############################################################
569 609 ## Enable or disable the config file generation.
570 610 svn.proxy.generate_config = false
571 611 ## Generate config file with `SVNListParentPath` set to `On`.
572 612 svn.proxy.list_parent_path = true
573 613 ## Set location and file name of generated config file.
574 614 svn.proxy.config_file_path = %(here)s/mod_dav_svn.conf
575 615 ## alternative mod_dav config template. This needs to be a mako template
576 616 #svn.proxy.config_template = ~/.rccontrol/enterprise-1/custom_svn_conf.mako
577 617 ## Used as a prefix to the `Location` block in the generated config file.
578 618 ## In most cases it should be set to `/`.
579 619 svn.proxy.location_root = /
580 620 ## Command to reload the mod dav svn configuration on change.
581 621 ## Example: `/etc/init.d/apache2 reload` or /home/USER/apache_reload.sh
582 622 ## Make sure user who runs RhodeCode process is allowed to reload Apache
583 623 #svn.proxy.reload_cmd = /etc/init.d/apache2 reload
584 624 ## If the timeout expires before the reload command finishes, the command will
585 625 ## be killed. Setting it to zero means no timeout. Defaults to 10 seconds.
586 626 #svn.proxy.reload_timeout = 10
587 627
588 628 ############################################################
589 629 ### SSH Support Settings ###
590 630 ############################################################
591 631
592 632 ## Defines if a custom authorized_keys file should be created and written on
593 633 ## any change user ssh keys. Setting this to false also disables possibility
594 634 ## of adding SSH keys by users from web interface. Super admins can still
595 635 ## manage SSH Keys.
596 636 ssh.generate_authorized_keyfile = false
597 637
598 638 ## Options for ssh, default is `no-pty,no-port-forwarding,no-X11-forwarding,no-agent-forwarding`
599 639 # ssh.authorized_keys_ssh_opts =
600 640
601 641 ## Path to the authorized_keys file where the generate entries are placed.
602 642 ## It is possible to have multiple key files specified in `sshd_config` e.g.
603 643 ## AuthorizedKeysFile %h/.ssh/authorized_keys %h/.ssh/authorized_keys_rhodecode
604 644 ssh.authorized_keys_file_path = ~/.ssh/authorized_keys_rhodecode
605 645
606 646 ## Command to execute the SSH wrapper. The binary is available in the
607 647 ## RhodeCode installation directory.
608 648 ## e.g ~/.rccontrol/community-1/profile/bin/rc-ssh-wrapper
609 649 ssh.wrapper_cmd = ~/.rccontrol/community-1/rc-ssh-wrapper
610 650
611 651 ## Allow shell when executing the ssh-wrapper command
612 652 ssh.wrapper_cmd_allow_shell = false
613 653
614 654 ## Enables logging, and detailed output send back to the client during SSH
615 655 ## operations. Useful for debugging, shouldn't be used in production.
616 656 ssh.enable_debug_logging = false
617 657
618 658 ## Paths to binary executable, by default they are the names, but we can
619 659 ## override them if we want to use a custom one
620 660 ssh.executable.hg = ~/.rccontrol/vcsserver-1/profile/bin/hg
621 661 ssh.executable.git = ~/.rccontrol/vcsserver-1/profile/bin/git
622 662 ssh.executable.svn = ~/.rccontrol/vcsserver-1/profile/bin/svnserve
623 663
624 664 ## Enables SSH key generator web interface. Disabling this still allows users
625 665 ## to add their own keys.
626 666 ssh.enable_ui_key_generator = true
627 667
628 668
629 669 ## Dummy marker to add new entries after.
630 670 ## Add any custom entries below. Please don't remove.
631 671 custom.conf = 1
632 672
633 673
634 674 ################################
635 675 ### LOGGING CONFIGURATION ####
636 676 ################################
637 677 [loggers]
638 678 keys = root, sqlalchemy, beaker, celery, rhodecode, ssh_wrapper
639 679
640 680 [handlers]
641 681 keys = console, console_sql
642 682
643 683 [formatters]
644 684 keys = generic, color_formatter, color_formatter_sql
645 685
646 686 #############
647 687 ## LOGGERS ##
648 688 #############
649 689 [logger_root]
650 690 level = NOTSET
651 691 handlers = console
652 692
653 693 [logger_sqlalchemy]
654 694 level = INFO
655 695 handlers = console_sql
656 696 qualname = sqlalchemy.engine
657 697 propagate = 0
658 698
659 699 [logger_beaker]
660 700 level = DEBUG
661 701 handlers =
662 702 qualname = beaker.container
663 703 propagate = 1
664 704
665 705 [logger_rhodecode]
666 706 level = DEBUG
667 707 handlers =
668 708 qualname = rhodecode
669 709 propagate = 1
670 710
671 711 [logger_ssh_wrapper]
672 712 level = DEBUG
673 713 handlers =
674 714 qualname = ssh_wrapper
675 715 propagate = 1
676 716
677 717 [logger_celery]
678 718 level = DEBUG
679 719 handlers =
680 720 qualname = celery
681 721
682 722
683 723 ##############
684 724 ## HANDLERS ##
685 725 ##############
686 726
687 727 [handler_console]
688 728 class = StreamHandler
689 729 args = (sys.stderr, )
690 730 level = INFO
691 731 formatter = generic
692 732
693 733 [handler_console_sql]
694 734 # "level = DEBUG" logs SQL queries and results.
695 735 # "level = INFO" logs SQL queries.
696 736 # "level = WARN" logs neither. (Recommended for production systems.)
697 737 class = StreamHandler
698 738 args = (sys.stderr, )
699 739 level = WARN
700 740 formatter = generic
701 741
702 742 ################
703 743 ## FORMATTERS ##
704 744 ################
705 745
706 746 [formatter_generic]
707 747 class = rhodecode.lib.logging_formatter.ExceptionAwareFormatter
708 748 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
709 749 datefmt = %Y-%m-%d %H:%M:%S
710 750
711 751 [formatter_color_formatter]
712 752 class = rhodecode.lib.logging_formatter.ColorFormatter
713 753 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
714 754 datefmt = %Y-%m-%d %H:%M:%S
715 755
716 756 [formatter_color_formatter_sql]
717 757 class = rhodecode.lib.logging_formatter.ColorFormatterSql
718 758 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
719 759 datefmt = %Y-%m-%d %H:%M:%S
General Comments 0
You need to be logged in to leave comments. Login now