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