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