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