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