##// END OF EJS Templates
git: remove GIT_REV_FILTER argument as it's now obsolete with libgit2 implementation
dan -
r3920:03ca5514 default
parent child Browse files
Show More
@@ -1,744 +1,740 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 ## process name visible in process list
64 ## process name visible in process list
65 #proc_name = rhodecode
65 #proc_name = rhodecode
66 ## type of worker class, one of sync, gevent
66 ## type of worker class, one of sync, gevent
67 ## recommended for bigger setup is using of of other than sync one
67 ## recommended for bigger setup is using of of other than sync one
68 #worker_class = gevent
68 #worker_class = gevent
69 ## The maximum number of simultaneous clients. Valid only for Gevent
69 ## The maximum number of simultaneous clients. Valid only for Gevent
70 #worker_connections = 10
70 #worker_connections = 10
71 ## max number of requests that worker will handle before being gracefully
71 ## max number of requests that worker will handle before being gracefully
72 ## restarted, could prevent memory leaks
72 ## restarted, could prevent memory leaks
73 #max_requests = 1000
73 #max_requests = 1000
74 #max_requests_jitter = 30
74 #max_requests_jitter = 30
75 ## amount of time a worker can spend with handling a request before it
75 ## amount of time a worker can spend with handling a request before it
76 ## gets killed and restarted. Set to 6hrs
76 ## gets killed and restarted. Set to 6hrs
77 #timeout = 21600
77 #timeout = 21600
78
78
79
79
80 ## prefix middleware for RhodeCode.
80 ## prefix middleware for RhodeCode.
81 ## recommended when using proxy setup.
81 ## recommended when using proxy setup.
82 ## allows to set RhodeCode under a prefix in server.
82 ## allows to set RhodeCode under a prefix in server.
83 ## eg https://server.com/custom_prefix. Enable `filter-with =` option below as well.
83 ## eg https://server.com/custom_prefix. Enable `filter-with =` option below as well.
84 ## And set your prefix like: `prefix = /custom_prefix`
84 ## And set your prefix like: `prefix = /custom_prefix`
85 ## be sure to also set beaker.session.cookie_path = /custom_prefix if you need
85 ## be sure to also set beaker.session.cookie_path = /custom_prefix if you need
86 ## to make your cookies only work on prefix url
86 ## to make your cookies only work on prefix url
87 [filter:proxy-prefix]
87 [filter:proxy-prefix]
88 use = egg:PasteDeploy#prefix
88 use = egg:PasteDeploy#prefix
89 prefix = /
89 prefix = /
90
90
91 [app:main]
91 [app:main]
92 ## The %(here)s variable will be replaced with the absolute path of parent directory
92 ## The %(here)s variable will be replaced with the absolute path of parent directory
93 ## of this file
93 ## of this file
94 ## In addition ENVIRONMENT variables usage is possible, e.g
94 ## In addition ENVIRONMENT variables usage is possible, e.g
95 ## sqlalchemy.db1.url = {ENV_RC_DB_URL}
95 ## sqlalchemy.db1.url = {ENV_RC_DB_URL}
96
96
97 use = egg:rhodecode-enterprise-ce
97 use = egg:rhodecode-enterprise-ce
98
98
99 ## enable proxy prefix middleware, defined above
99 ## enable proxy prefix middleware, defined above
100 #filter-with = proxy-prefix
100 #filter-with = proxy-prefix
101
101
102 # During development the we want to have the debug toolbar enabled
102 # During development the we want to have the debug toolbar enabled
103 pyramid.includes =
103 pyramid.includes =
104 pyramid_debugtoolbar
104 pyramid_debugtoolbar
105 rhodecode.lib.middleware.request_wrapper
105 rhodecode.lib.middleware.request_wrapper
106
106
107 pyramid.reload_templates = true
107 pyramid.reload_templates = true
108
108
109 debugtoolbar.hosts = 0.0.0.0/0
109 debugtoolbar.hosts = 0.0.0.0/0
110 debugtoolbar.exclude_prefixes =
110 debugtoolbar.exclude_prefixes =
111 /css
111 /css
112 /fonts
112 /fonts
113 /images
113 /images
114 /js
114 /js
115
115
116 ## RHODECODE PLUGINS ##
116 ## RHODECODE PLUGINS ##
117 rhodecode.includes =
117 rhodecode.includes =
118 rhodecode.api
118 rhodecode.api
119
119
120
120
121 # api prefix url
121 # api prefix url
122 rhodecode.api.url = /_admin/api
122 rhodecode.api.url = /_admin/api
123
123
124
124
125 ## END RHODECODE PLUGINS ##
125 ## END RHODECODE PLUGINS ##
126
126
127 ## encryption key used to encrypt social plugin tokens,
127 ## encryption key used to encrypt social plugin tokens,
128 ## remote_urls with credentials etc, if not set it defaults to
128 ## remote_urls with credentials etc, if not set it defaults to
129 ## `beaker.session.secret`
129 ## `beaker.session.secret`
130 #rhodecode.encrypted_values.secret =
130 #rhodecode.encrypted_values.secret =
131
131
132 ## decryption strict mode (enabled by default). It controls if decryption raises
132 ## decryption strict mode (enabled by default). It controls if decryption raises
133 ## `SignatureVerificationError` in case of wrong key, or damaged encryption data.
133 ## `SignatureVerificationError` in case of wrong key, or damaged encryption data.
134 #rhodecode.encrypted_values.strict = false
134 #rhodecode.encrypted_values.strict = false
135
135
136 ## Pick algorithm for encryption. Either fernet (more secure) or aes (default)
136 ## Pick algorithm for encryption. Either fernet (more secure) or aes (default)
137 ## fernet is safer, and we strongly recommend switching to it.
137 ## fernet is safer, and we strongly recommend switching to it.
138 ## Due to backward compatibility aes is used as default.
138 ## Due to backward compatibility aes is used as default.
139 #rhodecode.encrypted_values.algorithm = fernet
139 #rhodecode.encrypted_values.algorithm = fernet
140
140
141 ## return gzipped responses from RhodeCode (static files/application)
141 ## return gzipped responses from RhodeCode (static files/application)
142 gzip_responses = false
142 gzip_responses = false
143
143
144 ## auto-generate javascript routes file on startup
144 ## auto-generate javascript routes file on startup
145 generate_js_files = false
145 generate_js_files = false
146
146
147 ## System global default language.
147 ## System global default language.
148 ## All available languages: en(default), be, de, es, fr, it, ja, pl, pt, ru, zh
148 ## All available languages: en(default), be, de, es, fr, it, ja, pl, pt, ru, zh
149 lang = en
149 lang = en
150
150
151 ## Perform a full repository scan and import on each server start.
151 ## Perform a full repository scan and import on each server start.
152 ## Settings this to true could lead to very long startup time.
152 ## Settings this to true could lead to very long startup time.
153 startup.import_repos = false
153 startup.import_repos = false
154
154
155 ## Uncomment and set this path to use archive download cache.
155 ## Uncomment and set this path to use archive download cache.
156 ## Once enabled, generated archives will be cached at this location
156 ## Once enabled, generated archives will be cached at this location
157 ## and served from the cache during subsequent requests for the same archive of
157 ## and served from the cache during subsequent requests for the same archive of
158 ## the repository.
158 ## the repository.
159 #archive_cache_dir = /tmp/tarballcache
159 #archive_cache_dir = /tmp/tarballcache
160
160
161 ## URL at which the application is running. This is used for Bootstrapping
161 ## URL at which the application is running. This is used for Bootstrapping
162 ## requests in context when no web request is available. Used in ishell, or
162 ## requests in context when no web request is available. Used in ishell, or
163 ## SSH calls. Set this for events to receive proper url for SSH calls.
163 ## SSH calls. Set this for events to receive proper url for SSH calls.
164 app.base_url = http://rhodecode.local
164 app.base_url = http://rhodecode.local
165
165
166 ## Unique application ID. Should be a random unique string for security.
166 ## Unique application ID. Should be a random unique string for security.
167 app_instance_uuid = rc-production
167 app_instance_uuid = rc-production
168
168
169 ## Cut off limit for large diffs (size in bytes). If overall diff size on
169 ## Cut off limit for large diffs (size in bytes). If overall diff size on
170 ## commit, or pull request exceeds this limit this diff will be displayed
170 ## commit, or pull request exceeds this limit this diff will be displayed
171 ## partially. E.g 512000 == 512Kb
171 ## partially. E.g 512000 == 512Kb
172 cut_off_limit_diff = 512000
172 cut_off_limit_diff = 512000
173
173
174 ## Cut off limit for large files inside diffs (size in bytes). Each individual
174 ## Cut off limit for large files inside diffs (size in bytes). Each individual
175 ## file inside diff which exceeds this limit will be displayed partially.
175 ## file inside diff which exceeds this limit will be displayed partially.
176 ## E.g 128000 == 128Kb
176 ## E.g 128000 == 128Kb
177 cut_off_limit_file = 128000
177 cut_off_limit_file = 128000
178
178
179 ## use cached version of vcs repositories everywhere. Recommended to be `true`
179 ## use cached version of vcs repositories everywhere. Recommended to be `true`
180 vcs_full_cache = true
180 vcs_full_cache = true
181
181
182 ## Force https in RhodeCode, fixes https redirects, assumes it's always https.
182 ## Force https in RhodeCode, fixes https redirects, assumes it's always https.
183 ## Normally this is controlled by proper http flags sent from http server
183 ## Normally this is controlled by proper http flags sent from http server
184 force_https = false
184 force_https = false
185
185
186 ## use Strict-Transport-Security headers
186 ## use Strict-Transport-Security headers
187 use_htsts = false
187 use_htsts = false
188
188
189 ## git rev filter option, --all is the default filter, if you need to
190 ## hide all refs in changelog switch this to --branches --tags
191 git_rev_filter = --branches --tags
192
193 # Set to true if your repos are exposed using the dumb protocol
189 # Set to true if your repos are exposed using the dumb protocol
194 git_update_server_info = false
190 git_update_server_info = false
195
191
196 ## RSS/ATOM feed options
192 ## RSS/ATOM feed options
197 rss_cut_off_limit = 256000
193 rss_cut_off_limit = 256000
198 rss_items_per_page = 10
194 rss_items_per_page = 10
199 rss_include_diff = false
195 rss_include_diff = false
200
196
201 ## gist URL alias, used to create nicer urls for gist. This should be an
197 ## gist URL alias, used to create nicer urls for gist. This should be an
202 ## url that does rewrites to _admin/gists/{gistid}.
198 ## url that does rewrites to _admin/gists/{gistid}.
203 ## example: http://gist.rhodecode.org/{gistid}. Empty means use the internal
199 ## example: http://gist.rhodecode.org/{gistid}. Empty means use the internal
204 ## RhodeCode url, ie. http[s]://rhodecode.server/_admin/gists/{gistid}
200 ## RhodeCode url, ie. http[s]://rhodecode.server/_admin/gists/{gistid}
205 gist_alias_url =
201 gist_alias_url =
206
202
207 ## List of views (using glob pattern syntax) that AUTH TOKENS could be
203 ## List of views (using glob pattern syntax) that AUTH TOKENS could be
208 ## used for access.
204 ## used for access.
209 ## Adding ?auth_token=TOKEN_HASH to the url authenticates this request as if it
205 ## Adding ?auth_token=TOKEN_HASH to the url authenticates this request as if it
210 ## came from the the logged in user who own this authentication token.
206 ## came from the the logged in user who own this authentication token.
211 ## Additionally @TOKEN syntax can be used to bound the view to specific
207 ## Additionally @TOKEN syntax can be used to bound the view to specific
212 ## authentication token. Such view would be only accessible when used together
208 ## authentication token. Such view would be only accessible when used together
213 ## with this authentication token
209 ## with this authentication token
214 ##
210 ##
215 ## list of all views can be found under `/_admin/permissions/auth_token_access`
211 ## list of all views can be found under `/_admin/permissions/auth_token_access`
216 ## The list should be "," separated and on a single line.
212 ## The list should be "," separated and on a single line.
217 ##
213 ##
218 ## Most common views to enable:
214 ## Most common views to enable:
219 # RepoCommitsView:repo_commit_download
215 # RepoCommitsView:repo_commit_download
220 # RepoCommitsView:repo_commit_patch
216 # RepoCommitsView:repo_commit_patch
221 # RepoCommitsView:repo_commit_raw
217 # RepoCommitsView:repo_commit_raw
222 # RepoCommitsView:repo_commit_raw@TOKEN
218 # RepoCommitsView:repo_commit_raw@TOKEN
223 # RepoFilesView:repo_files_diff
219 # RepoFilesView:repo_files_diff
224 # RepoFilesView:repo_archivefile
220 # RepoFilesView:repo_archivefile
225 # RepoFilesView:repo_file_raw
221 # RepoFilesView:repo_file_raw
226 # GistView:*
222 # GistView:*
227 api_access_controllers_whitelist =
223 api_access_controllers_whitelist =
228
224
229 ## Default encoding used to convert from and to unicode
225 ## Default encoding used to convert from and to unicode
230 ## can be also a comma separated list of encoding in case of mixed encodings
226 ## can be also a comma separated list of encoding in case of mixed encodings
231 default_encoding = UTF-8
227 default_encoding = UTF-8
232
228
233 ## instance-id prefix
229 ## instance-id prefix
234 ## a prefix key for this instance used for cache invalidation when running
230 ## a prefix key for this instance used for cache invalidation when running
235 ## multiple instances of RhodeCode, make sure it's globally unique for
231 ## multiple instances of RhodeCode, make sure it's globally unique for
236 ## all running RhodeCode instances. Leave empty if you don't use it
232 ## all running RhodeCode instances. Leave empty if you don't use it
237 instance_id =
233 instance_id =
238
234
239 ## Fallback authentication plugin. Set this to a plugin ID to force the usage
235 ## Fallback authentication plugin. Set this to a plugin ID to force the usage
240 ## of an authentication plugin also if it is disabled by it's settings.
236 ## of an authentication plugin also if it is disabled by it's settings.
241 ## This could be useful if you are unable to log in to the system due to broken
237 ## This could be useful if you are unable to log in to the system due to broken
242 ## authentication settings. Then you can enable e.g. the internal RhodeCode auth
238 ## authentication settings. Then you can enable e.g. the internal RhodeCode auth
243 ## module to log in again and fix the settings.
239 ## module to log in again and fix the settings.
244 ##
240 ##
245 ## Available builtin plugin IDs (hash is part of the ID):
241 ## Available builtin plugin IDs (hash is part of the ID):
246 ## egg:rhodecode-enterprise-ce#rhodecode
242 ## egg:rhodecode-enterprise-ce#rhodecode
247 ## egg:rhodecode-enterprise-ce#pam
243 ## egg:rhodecode-enterprise-ce#pam
248 ## egg:rhodecode-enterprise-ce#ldap
244 ## egg:rhodecode-enterprise-ce#ldap
249 ## egg:rhodecode-enterprise-ce#jasig_cas
245 ## egg:rhodecode-enterprise-ce#jasig_cas
250 ## egg:rhodecode-enterprise-ce#headers
246 ## egg:rhodecode-enterprise-ce#headers
251 ## egg:rhodecode-enterprise-ce#crowd
247 ## egg:rhodecode-enterprise-ce#crowd
252 #rhodecode.auth_plugin_fallback = egg:rhodecode-enterprise-ce#rhodecode
248 #rhodecode.auth_plugin_fallback = egg:rhodecode-enterprise-ce#rhodecode
253
249
254 ## alternative return HTTP header for failed authentication. Default HTTP
250 ## alternative return HTTP header for failed authentication. Default HTTP
255 ## response is 401 HTTPUnauthorized. Currently HG clients have troubles with
251 ## response is 401 HTTPUnauthorized. Currently HG clients have troubles with
256 ## handling that causing a series of failed authentication calls.
252 ## handling that causing a series of failed authentication calls.
257 ## Set this variable to 403 to return HTTPForbidden, or any other HTTP code
253 ## Set this variable to 403 to return HTTPForbidden, or any other HTTP code
258 ## This will be served instead of default 401 on bad authentication
254 ## This will be served instead of default 401 on bad authentication
259 auth_ret_code =
255 auth_ret_code =
260
256
261 ## use special detection method when serving auth_ret_code, instead of serving
257 ## use special detection method when serving auth_ret_code, instead of serving
262 ## ret_code directly, use 401 initially (Which triggers credentials prompt)
258 ## ret_code directly, use 401 initially (Which triggers credentials prompt)
263 ## and then serve auth_ret_code to clients
259 ## and then serve auth_ret_code to clients
264 auth_ret_code_detection = false
260 auth_ret_code_detection = false
265
261
266 ## locking return code. When repository is locked return this HTTP code. 2XX
262 ## locking return code. When repository is locked return this HTTP code. 2XX
267 ## codes don't break the transactions while 4XX codes do
263 ## codes don't break the transactions while 4XX codes do
268 lock_ret_code = 423
264 lock_ret_code = 423
269
265
270 ## allows to change the repository location in settings page
266 ## allows to change the repository location in settings page
271 allow_repo_location_change = true
267 allow_repo_location_change = true
272
268
273 ## allows to setup custom hooks in settings page
269 ## allows to setup custom hooks in settings page
274 allow_custom_hooks_settings = true
270 allow_custom_hooks_settings = true
275
271
276 ## Generated license token required for EE edition license.
272 ## Generated license token required for EE edition license.
277 ## New generated token value can be found in Admin > settings > license page.
273 ## New generated token value can be found in Admin > settings > license page.
278 license_token =
274 license_token =
279
275
280 ## supervisor connection uri, for managing supervisor and logs.
276 ## supervisor connection uri, for managing supervisor and logs.
281 supervisor.uri =
277 supervisor.uri =
282 ## supervisord group name/id we only want this RC instance to handle
278 ## supervisord group name/id we only want this RC instance to handle
283 supervisor.group_id = dev
279 supervisor.group_id = dev
284
280
285 ## Display extended labs settings
281 ## Display extended labs settings
286 labs_settings_active = true
282 labs_settings_active = true
287
283
288 ## Custom exception store path, defaults to TMPDIR
284 ## Custom exception store path, defaults to TMPDIR
289 ## This is used to store exception from RhodeCode in shared directory
285 ## This is used to store exception from RhodeCode in shared directory
290 #exception_tracker.store_path =
286 #exception_tracker.store_path =
291
287
292 ## File store configuration. This is used to store and serve uploaded files
288 ## File store configuration. This is used to store and serve uploaded files
293 file_store.enabled = true
289 file_store.enabled = true
294 ## Storage backend, available options are: local
290 ## Storage backend, available options are: local
295 file_store.backend = local
291 file_store.backend = local
296 ## path to store the uploaded binaries
292 ## path to store the uploaded binaries
297 file_store.storage_path = %(here)s/data/file_store
293 file_store.storage_path = %(here)s/data/file_store
298
294
299
295
300 ####################################
296 ####################################
301 ### CELERY CONFIG ####
297 ### CELERY CONFIG ####
302 ####################################
298 ####################################
303 ## run: /path/to/celery worker \
299 ## run: /path/to/celery worker \
304 ## -E --beat --app rhodecode.lib.celerylib.loader \
300 ## -E --beat --app rhodecode.lib.celerylib.loader \
305 ## --scheduler rhodecode.lib.celerylib.scheduler.RcScheduler \
301 ## --scheduler rhodecode.lib.celerylib.scheduler.RcScheduler \
306 ## --loglevel DEBUG --ini /path/to/rhodecode.ini
302 ## --loglevel DEBUG --ini /path/to/rhodecode.ini
307
303
308 use_celery = false
304 use_celery = false
309
305
310 ## connection url to the message broker (default redis)
306 ## connection url to the message broker (default redis)
311 celery.broker_url = redis://localhost:6379/8
307 celery.broker_url = redis://localhost:6379/8
312
308
313 ## rabbitmq example
309 ## rabbitmq example
314 #celery.broker_url = amqp://rabbitmq:qweqwe@localhost:5672/rabbitmqhost
310 #celery.broker_url = amqp://rabbitmq:qweqwe@localhost:5672/rabbitmqhost
315
311
316 ## maximum tasks to execute before worker restart
312 ## maximum tasks to execute before worker restart
317 celery.max_tasks_per_child = 100
313 celery.max_tasks_per_child = 100
318
314
319 ## tasks will never be sent to the queue, but executed locally instead.
315 ## tasks will never be sent to the queue, but executed locally instead.
320 celery.task_always_eager = false
316 celery.task_always_eager = false
321
317
322 #####################################
318 #####################################
323 ### DOGPILE CACHE ####
319 ### DOGPILE CACHE ####
324 #####################################
320 #####################################
325 ## Default cache dir for caches. Putting this into a ramdisk
321 ## Default cache dir for caches. Putting this into a ramdisk
326 ## can boost performance, eg. /tmpfs/data_ramdisk, however this directory might require
322 ## can boost performance, eg. /tmpfs/data_ramdisk, however this directory might require
327 ## large amount of space
323 ## large amount of space
328 cache_dir = %(here)s/data
324 cache_dir = %(here)s/data
329
325
330 ## `cache_perms` cache settings for permission tree, auth TTL.
326 ## `cache_perms` cache settings for permission tree, auth TTL.
331 rc_cache.cache_perms.backend = dogpile.cache.rc.file_namespace
327 rc_cache.cache_perms.backend = dogpile.cache.rc.file_namespace
332 rc_cache.cache_perms.expiration_time = 300
328 rc_cache.cache_perms.expiration_time = 300
333
329
334 ## alternative `cache_perms` redis backend with distributed lock
330 ## alternative `cache_perms` redis backend with distributed lock
335 #rc_cache.cache_perms.backend = dogpile.cache.rc.redis
331 #rc_cache.cache_perms.backend = dogpile.cache.rc.redis
336 #rc_cache.cache_perms.expiration_time = 300
332 #rc_cache.cache_perms.expiration_time = 300
337 ## redis_expiration_time needs to be greater then expiration_time
333 ## redis_expiration_time needs to be greater then expiration_time
338 #rc_cache.cache_perms.arguments.redis_expiration_time = 7200
334 #rc_cache.cache_perms.arguments.redis_expiration_time = 7200
339 #rc_cache.cache_perms.arguments.socket_timeout = 30
335 #rc_cache.cache_perms.arguments.socket_timeout = 30
340 #rc_cache.cache_perms.arguments.host = localhost
336 #rc_cache.cache_perms.arguments.host = localhost
341 #rc_cache.cache_perms.arguments.port = 6379
337 #rc_cache.cache_perms.arguments.port = 6379
342 #rc_cache.cache_perms.arguments.db = 0
338 #rc_cache.cache_perms.arguments.db = 0
343 ## more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends
339 ## more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends
344 #rc_cache.cache_perms.arguments.distributed_lock = true
340 #rc_cache.cache_perms.arguments.distributed_lock = true
345
341
346 ## `cache_repo` cache settings for FileTree, Readme, RSS FEEDS
342 ## `cache_repo` cache settings for FileTree, Readme, RSS FEEDS
347 rc_cache.cache_repo.backend = dogpile.cache.rc.file_namespace
343 rc_cache.cache_repo.backend = dogpile.cache.rc.file_namespace
348 rc_cache.cache_repo.expiration_time = 2592000
344 rc_cache.cache_repo.expiration_time = 2592000
349
345
350 ## alternative `cache_repo` redis backend with distributed lock
346 ## alternative `cache_repo` redis backend with distributed lock
351 #rc_cache.cache_repo.backend = dogpile.cache.rc.redis
347 #rc_cache.cache_repo.backend = dogpile.cache.rc.redis
352 #rc_cache.cache_repo.expiration_time = 2592000
348 #rc_cache.cache_repo.expiration_time = 2592000
353 ## redis_expiration_time needs to be greater then expiration_time
349 ## redis_expiration_time needs to be greater then expiration_time
354 #rc_cache.cache_repo.arguments.redis_expiration_time = 2678400
350 #rc_cache.cache_repo.arguments.redis_expiration_time = 2678400
355 #rc_cache.cache_repo.arguments.socket_timeout = 30
351 #rc_cache.cache_repo.arguments.socket_timeout = 30
356 #rc_cache.cache_repo.arguments.host = localhost
352 #rc_cache.cache_repo.arguments.host = localhost
357 #rc_cache.cache_repo.arguments.port = 6379
353 #rc_cache.cache_repo.arguments.port = 6379
358 #rc_cache.cache_repo.arguments.db = 1
354 #rc_cache.cache_repo.arguments.db = 1
359 ## more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends
355 ## more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends
360 #rc_cache.cache_repo.arguments.distributed_lock = true
356 #rc_cache.cache_repo.arguments.distributed_lock = true
361
357
362 ## cache settings for SQL queries, this needs to use memory type backend
358 ## cache settings for SQL queries, this needs to use memory type backend
363 rc_cache.sql_cache_short.backend = dogpile.cache.rc.memory_lru
359 rc_cache.sql_cache_short.backend = dogpile.cache.rc.memory_lru
364 rc_cache.sql_cache_short.expiration_time = 30
360 rc_cache.sql_cache_short.expiration_time = 30
365
361
366 ## `cache_repo_longterm` cache for repo object instances, this needs to use memory
362 ## `cache_repo_longterm` cache for repo object instances, this needs to use memory
367 ## type backend as the objects kept are not pickle serializable
363 ## type backend as the objects kept are not pickle serializable
368 rc_cache.cache_repo_longterm.backend = dogpile.cache.rc.memory_lru
364 rc_cache.cache_repo_longterm.backend = dogpile.cache.rc.memory_lru
369 ## by default we use 96H, this is using invalidation on push anyway
365 ## by default we use 96H, this is using invalidation on push anyway
370 rc_cache.cache_repo_longterm.expiration_time = 345600
366 rc_cache.cache_repo_longterm.expiration_time = 345600
371 ## max items in LRU cache, reduce this number to save memory, and expire last used
367 ## max items in LRU cache, reduce this number to save memory, and expire last used
372 ## cached objects
368 ## cached objects
373 rc_cache.cache_repo_longterm.max_size = 10000
369 rc_cache.cache_repo_longterm.max_size = 10000
374
370
375
371
376 ####################################
372 ####################################
377 ### BEAKER SESSION ####
373 ### BEAKER SESSION ####
378 ####################################
374 ####################################
379
375
380 ## .session.type is type of storage options for the session, current allowed
376 ## .session.type is type of storage options for the session, current allowed
381 ## types are file, ext:memcached, ext:redis, ext:database, and memory (default).
377 ## types are file, ext:memcached, ext:redis, ext:database, and memory (default).
382 beaker.session.type = file
378 beaker.session.type = file
383 beaker.session.data_dir = %(here)s/data/sessions
379 beaker.session.data_dir = %(here)s/data/sessions
384
380
385 ## redis sessions
381 ## redis sessions
386 #beaker.session.type = ext:redis
382 #beaker.session.type = ext:redis
387 #beaker.session.url = redis://127.0.0.1:6379/2
383 #beaker.session.url = redis://127.0.0.1:6379/2
388
384
389 ## db based session, fast, and allows easy management over logged in users
385 ## db based session, fast, and allows easy management over logged in users
390 #beaker.session.type = ext:database
386 #beaker.session.type = ext:database
391 #beaker.session.table_name = db_session
387 #beaker.session.table_name = db_session
392 #beaker.session.sa.url = postgresql://postgres:secret@localhost/rhodecode
388 #beaker.session.sa.url = postgresql://postgres:secret@localhost/rhodecode
393 #beaker.session.sa.url = mysql://root:secret@127.0.0.1/rhodecode
389 #beaker.session.sa.url = mysql://root:secret@127.0.0.1/rhodecode
394 #beaker.session.sa.pool_recycle = 3600
390 #beaker.session.sa.pool_recycle = 3600
395 #beaker.session.sa.echo = false
391 #beaker.session.sa.echo = false
396
392
397 beaker.session.key = rhodecode
393 beaker.session.key = rhodecode
398 beaker.session.secret = develop-rc-uytcxaz
394 beaker.session.secret = develop-rc-uytcxaz
399 beaker.session.lock_dir = %(here)s/data/sessions/lock
395 beaker.session.lock_dir = %(here)s/data/sessions/lock
400
396
401 ## Secure encrypted cookie. Requires AES and AES python libraries
397 ## Secure encrypted cookie. Requires AES and AES python libraries
402 ## you must disable beaker.session.secret to use this
398 ## you must disable beaker.session.secret to use this
403 #beaker.session.encrypt_key = key_for_encryption
399 #beaker.session.encrypt_key = key_for_encryption
404 #beaker.session.validate_key = validation_key
400 #beaker.session.validate_key = validation_key
405
401
406 ## sets session as invalid(also logging out user) if it haven not been
402 ## sets session as invalid(also logging out user) if it haven not been
407 ## accessed for given amount of time in seconds
403 ## accessed for given amount of time in seconds
408 beaker.session.timeout = 2592000
404 beaker.session.timeout = 2592000
409 beaker.session.httponly = true
405 beaker.session.httponly = true
410 ## Path to use for the cookie. Set to prefix if you use prefix middleware
406 ## Path to use for the cookie. Set to prefix if you use prefix middleware
411 #beaker.session.cookie_path = /custom_prefix
407 #beaker.session.cookie_path = /custom_prefix
412
408
413 ## uncomment for https secure cookie
409 ## uncomment for https secure cookie
414 beaker.session.secure = false
410 beaker.session.secure = false
415
411
416 ## auto save the session to not to use .save()
412 ## auto save the session to not to use .save()
417 beaker.session.auto = false
413 beaker.session.auto = false
418
414
419 ## default cookie expiration time in seconds, set to `true` to set expire
415 ## default cookie expiration time in seconds, set to `true` to set expire
420 ## at browser close
416 ## at browser close
421 #beaker.session.cookie_expires = 3600
417 #beaker.session.cookie_expires = 3600
422
418
423 ###################################
419 ###################################
424 ## SEARCH INDEXING CONFIGURATION ##
420 ## SEARCH INDEXING CONFIGURATION ##
425 ###################################
421 ###################################
426 ## Full text search indexer is available in rhodecode-tools under
422 ## Full text search indexer is available in rhodecode-tools under
427 ## `rhodecode-tools index` command
423 ## `rhodecode-tools index` command
428
424
429 ## WHOOSH Backend, doesn't require additional services to run
425 ## WHOOSH Backend, doesn't require additional services to run
430 ## it works good with few dozen repos
426 ## it works good with few dozen repos
431 search.module = rhodecode.lib.index.whoosh
427 search.module = rhodecode.lib.index.whoosh
432 search.location = %(here)s/data/index
428 search.location = %(here)s/data/index
433
429
434 ########################################
430 ########################################
435 ### CHANNELSTREAM CONFIG ####
431 ### CHANNELSTREAM CONFIG ####
436 ########################################
432 ########################################
437 ## channelstream enables persistent connections and live notification
433 ## channelstream enables persistent connections and live notification
438 ## in the system. It's also used by the chat system
434 ## in the system. It's also used by the chat system
439
435
440 channelstream.enabled = false
436 channelstream.enabled = false
441
437
442 ## server address for channelstream server on the backend
438 ## server address for channelstream server on the backend
443 channelstream.server = 127.0.0.1:9800
439 channelstream.server = 127.0.0.1:9800
444
440
445 ## location of the channelstream server from outside world
441 ## location of the channelstream server from outside world
446 ## use ws:// for http or wss:// for https. This address needs to be handled
442 ## use ws:// for http or wss:// for https. This address needs to be handled
447 ## by external HTTP server such as Nginx or Apache
443 ## by external HTTP server such as Nginx or Apache
448 ## see Nginx/Apache configuration examples in our docs
444 ## see Nginx/Apache configuration examples in our docs
449 channelstream.ws_url = ws://rhodecode.yourserver.com/_channelstream
445 channelstream.ws_url = ws://rhodecode.yourserver.com/_channelstream
450 channelstream.secret = secret
446 channelstream.secret = secret
451 channelstream.history.location = %(here)s/channelstream_history
447 channelstream.history.location = %(here)s/channelstream_history
452
448
453 ## Internal application path that Javascript uses to connect into.
449 ## Internal application path that Javascript uses to connect into.
454 ## If you use proxy-prefix the prefix should be added before /_channelstream
450 ## If you use proxy-prefix the prefix should be added before /_channelstream
455 channelstream.proxy_path = /_channelstream
451 channelstream.proxy_path = /_channelstream
456
452
457
453
458 ###################################
454 ###################################
459 ## APPENLIGHT CONFIG ##
455 ## APPENLIGHT CONFIG ##
460 ###################################
456 ###################################
461
457
462 ## Appenlight is tailored to work with RhodeCode, see
458 ## Appenlight is tailored to work with RhodeCode, see
463 ## http://appenlight.com for details how to obtain an account
459 ## http://appenlight.com for details how to obtain an account
464
460
465 ## Appenlight integration enabled
461 ## Appenlight integration enabled
466 appenlight = false
462 appenlight = false
467
463
468 appenlight.server_url = https://api.appenlight.com
464 appenlight.server_url = https://api.appenlight.com
469 appenlight.api_key = YOUR_API_KEY
465 appenlight.api_key = YOUR_API_KEY
470 #appenlight.transport_config = https://api.appenlight.com?threaded=1&timeout=5
466 #appenlight.transport_config = https://api.appenlight.com?threaded=1&timeout=5
471
467
472 ## used for JS client
468 ## used for JS client
473 appenlight.api_public_key = YOUR_API_PUBLIC_KEY
469 appenlight.api_public_key = YOUR_API_PUBLIC_KEY
474
470
475 ## TWEAK AMOUNT OF INFO SENT HERE
471 ## TWEAK AMOUNT OF INFO SENT HERE
476
472
477 ## enables 404 error logging (default False)
473 ## enables 404 error logging (default False)
478 appenlight.report_404 = false
474 appenlight.report_404 = false
479
475
480 ## time in seconds after request is considered being slow (default 1)
476 ## time in seconds after request is considered being slow (default 1)
481 appenlight.slow_request_time = 1
477 appenlight.slow_request_time = 1
482
478
483 ## record slow requests in application
479 ## record slow requests in application
484 ## (needs to be enabled for slow datastore recording and time tracking)
480 ## (needs to be enabled for slow datastore recording and time tracking)
485 appenlight.slow_requests = true
481 appenlight.slow_requests = true
486
482
487 ## enable hooking to application loggers
483 ## enable hooking to application loggers
488 appenlight.logging = true
484 appenlight.logging = true
489
485
490 ## minimum log level for log capture
486 ## minimum log level for log capture
491 appenlight.logging.level = WARNING
487 appenlight.logging.level = WARNING
492
488
493 ## send logs only from erroneous/slow requests
489 ## send logs only from erroneous/slow requests
494 ## (saves API quota for intensive logging)
490 ## (saves API quota for intensive logging)
495 appenlight.logging_on_error = false
491 appenlight.logging_on_error = false
496
492
497 ## list of additional keywords that should be grabbed from environ object
493 ## list of additional keywords that should be grabbed from environ object
498 ## can be string with comma separated list of words in lowercase
494 ## can be string with comma separated list of words in lowercase
499 ## (by default client will always send following info:
495 ## (by default client will always send following info:
500 ## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that
496 ## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that
501 ## start with HTTP* this list be extended with additional keywords here
497 ## start with HTTP* this list be extended with additional keywords here
502 appenlight.environ_keys_whitelist =
498 appenlight.environ_keys_whitelist =
503
499
504 ## list of keywords that should be blanked from request object
500 ## list of keywords that should be blanked from request object
505 ## can be string with comma separated list of words in lowercase
501 ## can be string with comma separated list of words in lowercase
506 ## (by default client will always blank keys that contain following words
502 ## (by default client will always blank keys that contain following words
507 ## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'
503 ## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'
508 ## this list be extended with additional keywords set here
504 ## this list be extended with additional keywords set here
509 appenlight.request_keys_blacklist =
505 appenlight.request_keys_blacklist =
510
506
511 ## list of namespaces that should be ignores when gathering log entries
507 ## list of namespaces that should be ignores when gathering log entries
512 ## can be string with comma separated list of namespaces
508 ## can be string with comma separated list of namespaces
513 ## (by default the client ignores own entries: appenlight_client.client)
509 ## (by default the client ignores own entries: appenlight_client.client)
514 appenlight.log_namespace_blacklist =
510 appenlight.log_namespace_blacklist =
515
511
516 # enable debug style page
512 # enable debug style page
517 debug_style = true
513 debug_style = true
518
514
519 ###########################################
515 ###########################################
520 ### MAIN RHODECODE DATABASE CONFIG ###
516 ### MAIN RHODECODE DATABASE CONFIG ###
521 ###########################################
517 ###########################################
522 #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30
518 #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30
523 #sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode
519 #sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode
524 #sqlalchemy.db1.url = mysql://root:qweqwe@localhost/rhodecode?charset=utf8
520 #sqlalchemy.db1.url = mysql://root:qweqwe@localhost/rhodecode?charset=utf8
525 # pymysql is an alternative driver for MySQL, use in case of problems with default one
521 # pymysql is an alternative driver for MySQL, use in case of problems with default one
526 #sqlalchemy.db1.url = mysql+pymysql://root:qweqwe@localhost/rhodecode
522 #sqlalchemy.db1.url = mysql+pymysql://root:qweqwe@localhost/rhodecode
527
523
528 sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30
524 sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30
529
525
530 # see sqlalchemy docs for other advanced settings
526 # see sqlalchemy docs for other advanced settings
531
527
532 ## print the sql statements to output
528 ## print the sql statements to output
533 sqlalchemy.db1.echo = false
529 sqlalchemy.db1.echo = false
534 ## recycle the connections after this amount of seconds
530 ## recycle the connections after this amount of seconds
535 sqlalchemy.db1.pool_recycle = 3600
531 sqlalchemy.db1.pool_recycle = 3600
536 sqlalchemy.db1.convert_unicode = true
532 sqlalchemy.db1.convert_unicode = true
537
533
538 ## the number of connections to keep open inside the connection pool.
534 ## the number of connections to keep open inside the connection pool.
539 ## 0 indicates no limit
535 ## 0 indicates no limit
540 #sqlalchemy.db1.pool_size = 5
536 #sqlalchemy.db1.pool_size = 5
541
537
542 ## the number of connections to allow in connection pool "overflow", that is
538 ## the number of connections to allow in connection pool "overflow", that is
543 ## connections that can be opened above and beyond the pool_size setting,
539 ## connections that can be opened above and beyond the pool_size setting,
544 ## which defaults to five.
540 ## which defaults to five.
545 #sqlalchemy.db1.max_overflow = 10
541 #sqlalchemy.db1.max_overflow = 10
546
542
547 ## Connection check ping, used to detect broken database connections
543 ## Connection check ping, used to detect broken database connections
548 ## could be enabled to better handle cases if MySQL has gone away errors
544 ## could be enabled to better handle cases if MySQL has gone away errors
549 #sqlalchemy.db1.ping_connection = true
545 #sqlalchemy.db1.ping_connection = true
550
546
551 ##################
547 ##################
552 ### VCS CONFIG ###
548 ### VCS CONFIG ###
553 ##################
549 ##################
554 vcs.server.enable = true
550 vcs.server.enable = true
555 vcs.server = localhost:9900
551 vcs.server = localhost:9900
556
552
557 ## Web server connectivity protocol, responsible for web based VCS operations
553 ## Web server connectivity protocol, responsible for web based VCS operations
558 ## Available protocols are:
554 ## Available protocols are:
559 ## `http` - use http-rpc backend (default)
555 ## `http` - use http-rpc backend (default)
560 vcs.server.protocol = http
556 vcs.server.protocol = http
561
557
562 ## Push/Pull operations protocol, available options are:
558 ## Push/Pull operations protocol, available options are:
563 ## `http` - use http-rpc backend (default)
559 ## `http` - use http-rpc backend (default)
564 vcs.scm_app_implementation = http
560 vcs.scm_app_implementation = http
565
561
566 ## Push/Pull operations hooks protocol, available options are:
562 ## Push/Pull operations hooks protocol, available options are:
567 ## `http` - use http-rpc backend (default)
563 ## `http` - use http-rpc backend (default)
568 vcs.hooks.protocol = http
564 vcs.hooks.protocol = http
569
565
570 ## Host on which this instance is listening for hooks. If vcsserver is in other location
566 ## Host on which this instance is listening for hooks. If vcsserver is in other location
571 ## this should be adjusted.
567 ## this should be adjusted.
572 vcs.hooks.host = 127.0.0.1
568 vcs.hooks.host = 127.0.0.1
573
569
574 vcs.server.log_level = debug
570 vcs.server.log_level = debug
575 ## Start VCSServer with this instance as a subprocess, useful for development
571 ## Start VCSServer with this instance as a subprocess, useful for development
576 vcs.start_server = false
572 vcs.start_server = false
577
573
578 ## List of enabled VCS backends, available options are:
574 ## List of enabled VCS backends, available options are:
579 ## `hg` - mercurial
575 ## `hg` - mercurial
580 ## `git` - git
576 ## `git` - git
581 ## `svn` - subversion
577 ## `svn` - subversion
582 vcs.backends = hg, git, svn
578 vcs.backends = hg, git, svn
583
579
584 vcs.connection_timeout = 3600
580 vcs.connection_timeout = 3600
585 ## Compatibility version when creating SVN repositories. Defaults to newest version when commented out.
581 ## Compatibility version when creating SVN repositories. Defaults to newest version when commented out.
586 ## Available options are: pre-1.4-compatible, pre-1.5-compatible, pre-1.6-compatible, pre-1.8-compatible, pre-1.9-compatible
582 ## Available options are: pre-1.4-compatible, pre-1.5-compatible, pre-1.6-compatible, pre-1.8-compatible, pre-1.9-compatible
587 #vcs.svn.compatible_version = pre-1.8-compatible
583 #vcs.svn.compatible_version = pre-1.8-compatible
588
584
589
585
590 ############################################################
586 ############################################################
591 ### Subversion proxy support (mod_dav_svn) ###
587 ### Subversion proxy support (mod_dav_svn) ###
592 ### Maps RhodeCode repo groups into SVN paths for Apache ###
588 ### Maps RhodeCode repo groups into SVN paths for Apache ###
593 ############################################################
589 ############################################################
594 ## Enable or disable the config file generation.
590 ## Enable or disable the config file generation.
595 svn.proxy.generate_config = false
591 svn.proxy.generate_config = false
596 ## Generate config file with `SVNListParentPath` set to `On`.
592 ## Generate config file with `SVNListParentPath` set to `On`.
597 svn.proxy.list_parent_path = true
593 svn.proxy.list_parent_path = true
598 ## Set location and file name of generated config file.
594 ## Set location and file name of generated config file.
599 svn.proxy.config_file_path = %(here)s/mod_dav_svn.conf
595 svn.proxy.config_file_path = %(here)s/mod_dav_svn.conf
600 ## alternative mod_dav config template. This needs to be a mako template
596 ## alternative mod_dav config template. This needs to be a mako template
601 #svn.proxy.config_template = ~/.rccontrol/enterprise-1/custom_svn_conf.mako
597 #svn.proxy.config_template = ~/.rccontrol/enterprise-1/custom_svn_conf.mako
602 ## Used as a prefix to the `Location` block in the generated config file.
598 ## Used as a prefix to the `Location` block in the generated config file.
603 ## In most cases it should be set to `/`.
599 ## In most cases it should be set to `/`.
604 svn.proxy.location_root = /
600 svn.proxy.location_root = /
605 ## Command to reload the mod dav svn configuration on change.
601 ## Command to reload the mod dav svn configuration on change.
606 ## Example: `/etc/init.d/apache2 reload` or /home/USER/apache_reload.sh
602 ## Example: `/etc/init.d/apache2 reload` or /home/USER/apache_reload.sh
607 ## Make sure user who runs RhodeCode process is allowed to reload Apache
603 ## Make sure user who runs RhodeCode process is allowed to reload Apache
608 #svn.proxy.reload_cmd = /etc/init.d/apache2 reload
604 #svn.proxy.reload_cmd = /etc/init.d/apache2 reload
609 ## If the timeout expires before the reload command finishes, the command will
605 ## If the timeout expires before the reload command finishes, the command will
610 ## be killed. Setting it to zero means no timeout. Defaults to 10 seconds.
606 ## be killed. Setting it to zero means no timeout. Defaults to 10 seconds.
611 #svn.proxy.reload_timeout = 10
607 #svn.proxy.reload_timeout = 10
612
608
613 ############################################################
609 ############################################################
614 ### SSH Support Settings ###
610 ### SSH Support Settings ###
615 ############################################################
611 ############################################################
616
612
617 ## Defines if a custom authorized_keys file should be created and written on
613 ## Defines if a custom authorized_keys file should be created and written on
618 ## any change user ssh keys. Setting this to false also disables possibility
614 ## any change user ssh keys. Setting this to false also disables possibility
619 ## of adding SSH keys by users from web interface. Super admins can still
615 ## of adding SSH keys by users from web interface. Super admins can still
620 ## manage SSH Keys.
616 ## manage SSH Keys.
621 ssh.generate_authorized_keyfile = false
617 ssh.generate_authorized_keyfile = false
622
618
623 ## Options for ssh, default is `no-pty,no-port-forwarding,no-X11-forwarding,no-agent-forwarding`
619 ## Options for ssh, default is `no-pty,no-port-forwarding,no-X11-forwarding,no-agent-forwarding`
624 # ssh.authorized_keys_ssh_opts =
620 # ssh.authorized_keys_ssh_opts =
625
621
626 ## Path to the authorized_keys file where the generate entries are placed.
622 ## Path to the authorized_keys file where the generate entries are placed.
627 ## It is possible to have multiple key files specified in `sshd_config` e.g.
623 ## It is possible to have multiple key files specified in `sshd_config` e.g.
628 ## AuthorizedKeysFile %h/.ssh/authorized_keys %h/.ssh/authorized_keys_rhodecode
624 ## AuthorizedKeysFile %h/.ssh/authorized_keys %h/.ssh/authorized_keys_rhodecode
629 ssh.authorized_keys_file_path = ~/.ssh/authorized_keys_rhodecode
625 ssh.authorized_keys_file_path = ~/.ssh/authorized_keys_rhodecode
630
626
631 ## Command to execute the SSH wrapper. The binary is available in the
627 ## Command to execute the SSH wrapper. The binary is available in the
632 ## RhodeCode installation directory.
628 ## RhodeCode installation directory.
633 ## e.g ~/.rccontrol/community-1/profile/bin/rc-ssh-wrapper
629 ## e.g ~/.rccontrol/community-1/profile/bin/rc-ssh-wrapper
634 ssh.wrapper_cmd = ~/.rccontrol/community-1/rc-ssh-wrapper
630 ssh.wrapper_cmd = ~/.rccontrol/community-1/rc-ssh-wrapper
635
631
636 ## Allow shell when executing the ssh-wrapper command
632 ## Allow shell when executing the ssh-wrapper command
637 ssh.wrapper_cmd_allow_shell = false
633 ssh.wrapper_cmd_allow_shell = false
638
634
639 ## Enables logging, and detailed output send back to the client during SSH
635 ## Enables logging, and detailed output send back to the client during SSH
640 ## operations. Useful for debugging, shouldn't be used in production.
636 ## operations. Useful for debugging, shouldn't be used in production.
641 ssh.enable_debug_logging = true
637 ssh.enable_debug_logging = true
642
638
643 ## Paths to binary executable, by default they are the names, but we can
639 ## Paths to binary executable, by default they are the names, but we can
644 ## override them if we want to use a custom one
640 ## override them if we want to use a custom one
645 ssh.executable.hg = ~/.rccontrol/vcsserver-1/profile/bin/hg
641 ssh.executable.hg = ~/.rccontrol/vcsserver-1/profile/bin/hg
646 ssh.executable.git = ~/.rccontrol/vcsserver-1/profile/bin/git
642 ssh.executable.git = ~/.rccontrol/vcsserver-1/profile/bin/git
647 ssh.executable.svn = ~/.rccontrol/vcsserver-1/profile/bin/svnserve
643 ssh.executable.svn = ~/.rccontrol/vcsserver-1/profile/bin/svnserve
648
644
649 ## Enables SSH key generator web interface. Disabling this still allows users
645 ## Enables SSH key generator web interface. Disabling this still allows users
650 ## to add their own keys.
646 ## to add their own keys.
651 ssh.enable_ui_key_generator = true
647 ssh.enable_ui_key_generator = true
652
648
653
649
654 ## Dummy marker to add new entries after.
650 ## Dummy marker to add new entries after.
655 ## Add any custom entries below. Please don't remove.
651 ## Add any custom entries below. Please don't remove.
656 custom.conf = 1
652 custom.conf = 1
657
653
658
654
659 ################################
655 ################################
660 ### LOGGING CONFIGURATION ####
656 ### LOGGING CONFIGURATION ####
661 ################################
657 ################################
662 [loggers]
658 [loggers]
663 keys = root, sqlalchemy, beaker, celery, rhodecode, ssh_wrapper
659 keys = root, sqlalchemy, beaker, celery, rhodecode, ssh_wrapper
664
660
665 [handlers]
661 [handlers]
666 keys = console, console_sql
662 keys = console, console_sql
667
663
668 [formatters]
664 [formatters]
669 keys = generic, color_formatter, color_formatter_sql
665 keys = generic, color_formatter, color_formatter_sql
670
666
671 #############
667 #############
672 ## LOGGERS ##
668 ## LOGGERS ##
673 #############
669 #############
674 [logger_root]
670 [logger_root]
675 level = NOTSET
671 level = NOTSET
676 handlers = console
672 handlers = console
677
673
678 [logger_sqlalchemy]
674 [logger_sqlalchemy]
679 level = INFO
675 level = INFO
680 handlers = console_sql
676 handlers = console_sql
681 qualname = sqlalchemy.engine
677 qualname = sqlalchemy.engine
682 propagate = 0
678 propagate = 0
683
679
684 [logger_beaker]
680 [logger_beaker]
685 level = DEBUG
681 level = DEBUG
686 handlers =
682 handlers =
687 qualname = beaker.container
683 qualname = beaker.container
688 propagate = 1
684 propagate = 1
689
685
690 [logger_rhodecode]
686 [logger_rhodecode]
691 level = DEBUG
687 level = DEBUG
692 handlers =
688 handlers =
693 qualname = rhodecode
689 qualname = rhodecode
694 propagate = 1
690 propagate = 1
695
691
696 [logger_ssh_wrapper]
692 [logger_ssh_wrapper]
697 level = DEBUG
693 level = DEBUG
698 handlers =
694 handlers =
699 qualname = ssh_wrapper
695 qualname = ssh_wrapper
700 propagate = 1
696 propagate = 1
701
697
702 [logger_celery]
698 [logger_celery]
703 level = DEBUG
699 level = DEBUG
704 handlers =
700 handlers =
705 qualname = celery
701 qualname = celery
706
702
707
703
708 ##############
704 ##############
709 ## HANDLERS ##
705 ## HANDLERS ##
710 ##############
706 ##############
711
707
712 [handler_console]
708 [handler_console]
713 class = StreamHandler
709 class = StreamHandler
714 args = (sys.stderr, )
710 args = (sys.stderr, )
715 level = DEBUG
711 level = DEBUG
716 formatter = color_formatter
712 formatter = color_formatter
717
713
718 [handler_console_sql]
714 [handler_console_sql]
719 # "level = DEBUG" logs SQL queries and results.
715 # "level = DEBUG" logs SQL queries and results.
720 # "level = INFO" logs SQL queries.
716 # "level = INFO" logs SQL queries.
721 # "level = WARN" logs neither. (Recommended for production systems.)
717 # "level = WARN" logs neither. (Recommended for production systems.)
722 class = StreamHandler
718 class = StreamHandler
723 args = (sys.stderr, )
719 args = (sys.stderr, )
724 level = WARN
720 level = WARN
725 formatter = color_formatter_sql
721 formatter = color_formatter_sql
726
722
727 ################
723 ################
728 ## FORMATTERS ##
724 ## FORMATTERS ##
729 ################
725 ################
730
726
731 [formatter_generic]
727 [formatter_generic]
732 class = rhodecode.lib.logging_formatter.ExceptionAwareFormatter
728 class = rhodecode.lib.logging_formatter.ExceptionAwareFormatter
733 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
729 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
734 datefmt = %Y-%m-%d %H:%M:%S
730 datefmt = %Y-%m-%d %H:%M:%S
735
731
736 [formatter_color_formatter]
732 [formatter_color_formatter]
737 class = rhodecode.lib.logging_formatter.ColorFormatter
733 class = rhodecode.lib.logging_formatter.ColorFormatter
738 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
734 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
739 datefmt = %Y-%m-%d %H:%M:%S
735 datefmt = %Y-%m-%d %H:%M:%S
740
736
741 [formatter_color_formatter_sql]
737 [formatter_color_formatter_sql]
742 class = rhodecode.lib.logging_formatter.ColorFormatterSql
738 class = rhodecode.lib.logging_formatter.ColorFormatterSql
743 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
739 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
744 datefmt = %Y-%m-%d %H:%M:%S
740 datefmt = %Y-%m-%d %H:%M:%S
@@ -1,717 +1,713 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 ## process name visible in process list
64 ## process name visible in process list
65 proc_name = rhodecode
65 proc_name = rhodecode
66 ## type of worker class, one of sync, gevent
66 ## type of worker class, one of sync, gevent
67 ## recommended for bigger setup is using of of other than sync one
67 ## recommended for bigger setup is using of of other than sync one
68 worker_class = gevent
68 worker_class = gevent
69 ## The maximum number of simultaneous clients. Valid only for Gevent
69 ## The maximum number of simultaneous clients. Valid only for Gevent
70 worker_connections = 10
70 worker_connections = 10
71 ## max number of requests that worker will handle before being gracefully
71 ## max number of requests that worker will handle before being gracefully
72 ## restarted, could prevent memory leaks
72 ## restarted, could prevent memory leaks
73 max_requests = 1000
73 max_requests = 1000
74 max_requests_jitter = 30
74 max_requests_jitter = 30
75 ## amount of time a worker can spend with handling a request before it
75 ## amount of time a worker can spend with handling a request before it
76 ## gets killed and restarted. Set to 6hrs
76 ## gets killed and restarted. Set to 6hrs
77 timeout = 21600
77 timeout = 21600
78
78
79
79
80 ## prefix middleware for RhodeCode.
80 ## prefix middleware for RhodeCode.
81 ## recommended when using proxy setup.
81 ## recommended when using proxy setup.
82 ## allows to set RhodeCode under a prefix in server.
82 ## allows to set RhodeCode under a prefix in server.
83 ## eg https://server.com/custom_prefix. Enable `filter-with =` option below as well.
83 ## eg https://server.com/custom_prefix. Enable `filter-with =` option below as well.
84 ## And set your prefix like: `prefix = /custom_prefix`
84 ## And set your prefix like: `prefix = /custom_prefix`
85 ## be sure to also set beaker.session.cookie_path = /custom_prefix if you need
85 ## be sure to also set beaker.session.cookie_path = /custom_prefix if you need
86 ## to make your cookies only work on prefix url
86 ## to make your cookies only work on prefix url
87 [filter:proxy-prefix]
87 [filter:proxy-prefix]
88 use = egg:PasteDeploy#prefix
88 use = egg:PasteDeploy#prefix
89 prefix = /
89 prefix = /
90
90
91 [app:main]
91 [app:main]
92 ## The %(here)s variable will be replaced with the absolute path of parent directory
92 ## The %(here)s variable will be replaced with the absolute path of parent directory
93 ## of this file
93 ## of this file
94 ## In addition ENVIRONMENT variables usage is possible, e.g
94 ## In addition ENVIRONMENT variables usage is possible, e.g
95 ## sqlalchemy.db1.url = {ENV_RC_DB_URL}
95 ## sqlalchemy.db1.url = {ENV_RC_DB_URL}
96
96
97 use = egg:rhodecode-enterprise-ce
97 use = egg:rhodecode-enterprise-ce
98
98
99 ## enable proxy prefix middleware, defined above
99 ## enable proxy prefix middleware, defined above
100 #filter-with = proxy-prefix
100 #filter-with = proxy-prefix
101
101
102 ## encryption key used to encrypt social plugin tokens,
102 ## encryption key used to encrypt social plugin tokens,
103 ## remote_urls with credentials etc, if not set it defaults to
103 ## remote_urls with credentials etc, if not set it defaults to
104 ## `beaker.session.secret`
104 ## `beaker.session.secret`
105 #rhodecode.encrypted_values.secret =
105 #rhodecode.encrypted_values.secret =
106
106
107 ## decryption strict mode (enabled by default). It controls if decryption raises
107 ## decryption strict mode (enabled by default). It controls if decryption raises
108 ## `SignatureVerificationError` in case of wrong key, or damaged encryption data.
108 ## `SignatureVerificationError` in case of wrong key, or damaged encryption data.
109 #rhodecode.encrypted_values.strict = false
109 #rhodecode.encrypted_values.strict = false
110
110
111 ## Pick algorithm for encryption. Either fernet (more secure) or aes (default)
111 ## Pick algorithm for encryption. Either fernet (more secure) or aes (default)
112 ## fernet is safer, and we strongly recommend switching to it.
112 ## fernet is safer, and we strongly recommend switching to it.
113 ## Due to backward compatibility aes is used as default.
113 ## Due to backward compatibility aes is used as default.
114 #rhodecode.encrypted_values.algorithm = fernet
114 #rhodecode.encrypted_values.algorithm = fernet
115
115
116 ## return gzipped responses from RhodeCode (static files/application)
116 ## return gzipped responses from RhodeCode (static files/application)
117 gzip_responses = false
117 gzip_responses = false
118
118
119 ## auto-generate javascript routes file on startup
119 ## auto-generate javascript routes file on startup
120 generate_js_files = false
120 generate_js_files = false
121
121
122 ## System global default language.
122 ## System global default language.
123 ## All available languages: en(default), be, de, es, fr, it, ja, pl, pt, ru, zh
123 ## All available languages: en(default), be, de, es, fr, it, ja, pl, pt, ru, zh
124 lang = en
124 lang = en
125
125
126 ## Perform a full repository scan and import on each server start.
126 ## Perform a full repository scan and import on each server start.
127 ## Settings this to true could lead to very long startup time.
127 ## Settings this to true could lead to very long startup time.
128 startup.import_repos = false
128 startup.import_repos = false
129
129
130 ## Uncomment and set this path to use archive download cache.
130 ## Uncomment and set this path to use archive download cache.
131 ## Once enabled, generated archives will be cached at this location
131 ## Once enabled, generated archives will be cached at this location
132 ## and served from the cache during subsequent requests for the same archive of
132 ## and served from the cache during subsequent requests for the same archive of
133 ## the repository.
133 ## the repository.
134 #archive_cache_dir = /tmp/tarballcache
134 #archive_cache_dir = /tmp/tarballcache
135
135
136 ## URL at which the application is running. This is used for Bootstrapping
136 ## URL at which the application is running. This is used for Bootstrapping
137 ## requests in context when no web request is available. Used in ishell, or
137 ## requests in context when no web request is available. Used in ishell, or
138 ## SSH calls. Set this for events to receive proper url for SSH calls.
138 ## SSH calls. Set this for events to receive proper url for SSH calls.
139 app.base_url = http://rhodecode.local
139 app.base_url = http://rhodecode.local
140
140
141 ## Unique application ID. Should be a random unique string for security.
141 ## Unique application ID. Should be a random unique string for security.
142 app_instance_uuid = rc-production
142 app_instance_uuid = rc-production
143
143
144 ## Cut off limit for large diffs (size in bytes). If overall diff size on
144 ## Cut off limit for large diffs (size in bytes). If overall diff size on
145 ## commit, or pull request exceeds this limit this diff will be displayed
145 ## commit, or pull request exceeds this limit this diff will be displayed
146 ## partially. E.g 512000 == 512Kb
146 ## partially. E.g 512000 == 512Kb
147 cut_off_limit_diff = 512000
147 cut_off_limit_diff = 512000
148
148
149 ## Cut off limit for large files inside diffs (size in bytes). Each individual
149 ## Cut off limit for large files inside diffs (size in bytes). Each individual
150 ## file inside diff which exceeds this limit will be displayed partially.
150 ## file inside diff which exceeds this limit will be displayed partially.
151 ## E.g 128000 == 128Kb
151 ## E.g 128000 == 128Kb
152 cut_off_limit_file = 128000
152 cut_off_limit_file = 128000
153
153
154 ## use cached version of vcs repositories everywhere. Recommended to be `true`
154 ## use cached version of vcs repositories everywhere. Recommended to be `true`
155 vcs_full_cache = true
155 vcs_full_cache = true
156
156
157 ## Force https in RhodeCode, fixes https redirects, assumes it's always https.
157 ## Force https in RhodeCode, fixes https redirects, assumes it's always https.
158 ## Normally this is controlled by proper http flags sent from http server
158 ## Normally this is controlled by proper http flags sent from http server
159 force_https = false
159 force_https = false
160
160
161 ## use Strict-Transport-Security headers
161 ## use Strict-Transport-Security headers
162 use_htsts = false
162 use_htsts = false
163
163
164 ## git rev filter option, --all is the default filter, if you need to
165 ## hide all refs in changelog switch this to --branches --tags
166 git_rev_filter = --branches --tags
167
168 # Set to true if your repos are exposed using the dumb protocol
164 # Set to true if your repos are exposed using the dumb protocol
169 git_update_server_info = false
165 git_update_server_info = false
170
166
171 ## RSS/ATOM feed options
167 ## RSS/ATOM feed options
172 rss_cut_off_limit = 256000
168 rss_cut_off_limit = 256000
173 rss_items_per_page = 10
169 rss_items_per_page = 10
174 rss_include_diff = false
170 rss_include_diff = false
175
171
176 ## gist URL alias, used to create nicer urls for gist. This should be an
172 ## gist URL alias, used to create nicer urls for gist. This should be an
177 ## url that does rewrites to _admin/gists/{gistid}.
173 ## url that does rewrites to _admin/gists/{gistid}.
178 ## example: http://gist.rhodecode.org/{gistid}. Empty means use the internal
174 ## example: http://gist.rhodecode.org/{gistid}. Empty means use the internal
179 ## RhodeCode url, ie. http[s]://rhodecode.server/_admin/gists/{gistid}
175 ## RhodeCode url, ie. http[s]://rhodecode.server/_admin/gists/{gistid}
180 gist_alias_url =
176 gist_alias_url =
181
177
182 ## List of views (using glob pattern syntax) that AUTH TOKENS could be
178 ## List of views (using glob pattern syntax) that AUTH TOKENS could be
183 ## used for access.
179 ## used for access.
184 ## Adding ?auth_token=TOKEN_HASH to the url authenticates this request as if it
180 ## Adding ?auth_token=TOKEN_HASH to the url authenticates this request as if it
185 ## came from the the logged in user who own this authentication token.
181 ## came from the the logged in user who own this authentication token.
186 ## Additionally @TOKEN syntax can be used to bound the view to specific
182 ## Additionally @TOKEN syntax can be used to bound the view to specific
187 ## authentication token. Such view would be only accessible when used together
183 ## authentication token. Such view would be only accessible when used together
188 ## with this authentication token
184 ## with this authentication token
189 ##
185 ##
190 ## list of all views can be found under `/_admin/permissions/auth_token_access`
186 ## list of all views can be found under `/_admin/permissions/auth_token_access`
191 ## The list should be "," separated and on a single line.
187 ## The list should be "," separated and on a single line.
192 ##
188 ##
193 ## Most common views to enable:
189 ## Most common views to enable:
194 # RepoCommitsView:repo_commit_download
190 # RepoCommitsView:repo_commit_download
195 # RepoCommitsView:repo_commit_patch
191 # RepoCommitsView:repo_commit_patch
196 # RepoCommitsView:repo_commit_raw
192 # RepoCommitsView:repo_commit_raw
197 # RepoCommitsView:repo_commit_raw@TOKEN
193 # RepoCommitsView:repo_commit_raw@TOKEN
198 # RepoFilesView:repo_files_diff
194 # RepoFilesView:repo_files_diff
199 # RepoFilesView:repo_archivefile
195 # RepoFilesView:repo_archivefile
200 # RepoFilesView:repo_file_raw
196 # RepoFilesView:repo_file_raw
201 # GistView:*
197 # GistView:*
202 api_access_controllers_whitelist =
198 api_access_controllers_whitelist =
203
199
204 ## Default encoding used to convert from and to unicode
200 ## Default encoding used to convert from and to unicode
205 ## can be also a comma separated list of encoding in case of mixed encodings
201 ## can be also a comma separated list of encoding in case of mixed encodings
206 default_encoding = UTF-8
202 default_encoding = UTF-8
207
203
208 ## instance-id prefix
204 ## instance-id prefix
209 ## a prefix key for this instance used for cache invalidation when running
205 ## a prefix key for this instance used for cache invalidation when running
210 ## multiple instances of RhodeCode, make sure it's globally unique for
206 ## multiple instances of RhodeCode, make sure it's globally unique for
211 ## all running RhodeCode instances. Leave empty if you don't use it
207 ## all running RhodeCode instances. Leave empty if you don't use it
212 instance_id =
208 instance_id =
213
209
214 ## Fallback authentication plugin. Set this to a plugin ID to force the usage
210 ## Fallback authentication plugin. Set this to a plugin ID to force the usage
215 ## of an authentication plugin also if it is disabled by it's settings.
211 ## of an authentication plugin also if it is disabled by it's settings.
216 ## This could be useful if you are unable to log in to the system due to broken
212 ## This could be useful if you are unable to log in to the system due to broken
217 ## authentication settings. Then you can enable e.g. the internal RhodeCode auth
213 ## authentication settings. Then you can enable e.g. the internal RhodeCode auth
218 ## module to log in again and fix the settings.
214 ## module to log in again and fix the settings.
219 ##
215 ##
220 ## Available builtin plugin IDs (hash is part of the ID):
216 ## Available builtin plugin IDs (hash is part of the ID):
221 ## egg:rhodecode-enterprise-ce#rhodecode
217 ## egg:rhodecode-enterprise-ce#rhodecode
222 ## egg:rhodecode-enterprise-ce#pam
218 ## egg:rhodecode-enterprise-ce#pam
223 ## egg:rhodecode-enterprise-ce#ldap
219 ## egg:rhodecode-enterprise-ce#ldap
224 ## egg:rhodecode-enterprise-ce#jasig_cas
220 ## egg:rhodecode-enterprise-ce#jasig_cas
225 ## egg:rhodecode-enterprise-ce#headers
221 ## egg:rhodecode-enterprise-ce#headers
226 ## egg:rhodecode-enterprise-ce#crowd
222 ## egg:rhodecode-enterprise-ce#crowd
227 #rhodecode.auth_plugin_fallback = egg:rhodecode-enterprise-ce#rhodecode
223 #rhodecode.auth_plugin_fallback = egg:rhodecode-enterprise-ce#rhodecode
228
224
229 ## alternative return HTTP header for failed authentication. Default HTTP
225 ## alternative return HTTP header for failed authentication. Default HTTP
230 ## response is 401 HTTPUnauthorized. Currently HG clients have troubles with
226 ## response is 401 HTTPUnauthorized. Currently HG clients have troubles with
231 ## handling that causing a series of failed authentication calls.
227 ## handling that causing a series of failed authentication calls.
232 ## Set this variable to 403 to return HTTPForbidden, or any other HTTP code
228 ## Set this variable to 403 to return HTTPForbidden, or any other HTTP code
233 ## This will be served instead of default 401 on bad authentication
229 ## This will be served instead of default 401 on bad authentication
234 auth_ret_code =
230 auth_ret_code =
235
231
236 ## use special detection method when serving auth_ret_code, instead of serving
232 ## use special detection method when serving auth_ret_code, instead of serving
237 ## ret_code directly, use 401 initially (Which triggers credentials prompt)
233 ## ret_code directly, use 401 initially (Which triggers credentials prompt)
238 ## and then serve auth_ret_code to clients
234 ## and then serve auth_ret_code to clients
239 auth_ret_code_detection = false
235 auth_ret_code_detection = false
240
236
241 ## locking return code. When repository is locked return this HTTP code. 2XX
237 ## locking return code. When repository is locked return this HTTP code. 2XX
242 ## codes don't break the transactions while 4XX codes do
238 ## codes don't break the transactions while 4XX codes do
243 lock_ret_code = 423
239 lock_ret_code = 423
244
240
245 ## allows to change the repository location in settings page
241 ## allows to change the repository location in settings page
246 allow_repo_location_change = true
242 allow_repo_location_change = true
247
243
248 ## allows to setup custom hooks in settings page
244 ## allows to setup custom hooks in settings page
249 allow_custom_hooks_settings = true
245 allow_custom_hooks_settings = true
250
246
251 ## Generated license token required for EE edition license.
247 ## Generated license token required for EE edition license.
252 ## New generated token value can be found in Admin > settings > license page.
248 ## New generated token value can be found in Admin > settings > license page.
253 license_token =
249 license_token =
254
250
255 ## supervisor connection uri, for managing supervisor and logs.
251 ## supervisor connection uri, for managing supervisor and logs.
256 supervisor.uri =
252 supervisor.uri =
257 ## supervisord group name/id we only want this RC instance to handle
253 ## supervisord group name/id we only want this RC instance to handle
258 supervisor.group_id = prod
254 supervisor.group_id = prod
259
255
260 ## Display extended labs settings
256 ## Display extended labs settings
261 labs_settings_active = true
257 labs_settings_active = true
262
258
263 ## Custom exception store path, defaults to TMPDIR
259 ## Custom exception store path, defaults to TMPDIR
264 ## This is used to store exception from RhodeCode in shared directory
260 ## This is used to store exception from RhodeCode in shared directory
265 #exception_tracker.store_path =
261 #exception_tracker.store_path =
266
262
267 ## File store configuration. This is used to store and serve uploaded files
263 ## File store configuration. This is used to store and serve uploaded files
268 file_store.enabled = true
264 file_store.enabled = true
269 ## Storage backend, available options are: local
265 ## Storage backend, available options are: local
270 file_store.backend = local
266 file_store.backend = local
271 ## path to store the uploaded binaries
267 ## path to store the uploaded binaries
272 file_store.storage_path = %(here)s/data/file_store
268 file_store.storage_path = %(here)s/data/file_store
273
269
274
270
275 ####################################
271 ####################################
276 ### CELERY CONFIG ####
272 ### CELERY CONFIG ####
277 ####################################
273 ####################################
278 ## run: /path/to/celery worker \
274 ## run: /path/to/celery worker \
279 ## -E --beat --app rhodecode.lib.celerylib.loader \
275 ## -E --beat --app rhodecode.lib.celerylib.loader \
280 ## --scheduler rhodecode.lib.celerylib.scheduler.RcScheduler \
276 ## --scheduler rhodecode.lib.celerylib.scheduler.RcScheduler \
281 ## --loglevel DEBUG --ini /path/to/rhodecode.ini
277 ## --loglevel DEBUG --ini /path/to/rhodecode.ini
282
278
283 use_celery = false
279 use_celery = false
284
280
285 ## connection url to the message broker (default redis)
281 ## connection url to the message broker (default redis)
286 celery.broker_url = redis://localhost:6379/8
282 celery.broker_url = redis://localhost:6379/8
287
283
288 ## rabbitmq example
284 ## rabbitmq example
289 #celery.broker_url = amqp://rabbitmq:qweqwe@localhost:5672/rabbitmqhost
285 #celery.broker_url = amqp://rabbitmq:qweqwe@localhost:5672/rabbitmqhost
290
286
291 ## maximum tasks to execute before worker restart
287 ## maximum tasks to execute before worker restart
292 celery.max_tasks_per_child = 100
288 celery.max_tasks_per_child = 100
293
289
294 ## tasks will never be sent to the queue, but executed locally instead.
290 ## tasks will never be sent to the queue, but executed locally instead.
295 celery.task_always_eager = false
291 celery.task_always_eager = false
296
292
297 #####################################
293 #####################################
298 ### DOGPILE CACHE ####
294 ### DOGPILE CACHE ####
299 #####################################
295 #####################################
300 ## Default cache dir for caches. Putting this into a ramdisk
296 ## Default cache dir for caches. Putting this into a ramdisk
301 ## can boost performance, eg. /tmpfs/data_ramdisk, however this directory might require
297 ## can boost performance, eg. /tmpfs/data_ramdisk, however this directory might require
302 ## large amount of space
298 ## large amount of space
303 cache_dir = %(here)s/data
299 cache_dir = %(here)s/data
304
300
305 ## `cache_perms` cache settings for permission tree, auth TTL.
301 ## `cache_perms` cache settings for permission tree, auth TTL.
306 rc_cache.cache_perms.backend = dogpile.cache.rc.file_namespace
302 rc_cache.cache_perms.backend = dogpile.cache.rc.file_namespace
307 rc_cache.cache_perms.expiration_time = 300
303 rc_cache.cache_perms.expiration_time = 300
308
304
309 ## alternative `cache_perms` redis backend with distributed lock
305 ## alternative `cache_perms` redis backend with distributed lock
310 #rc_cache.cache_perms.backend = dogpile.cache.rc.redis
306 #rc_cache.cache_perms.backend = dogpile.cache.rc.redis
311 #rc_cache.cache_perms.expiration_time = 300
307 #rc_cache.cache_perms.expiration_time = 300
312 ## redis_expiration_time needs to be greater then expiration_time
308 ## redis_expiration_time needs to be greater then expiration_time
313 #rc_cache.cache_perms.arguments.redis_expiration_time = 7200
309 #rc_cache.cache_perms.arguments.redis_expiration_time = 7200
314 #rc_cache.cache_perms.arguments.socket_timeout = 30
310 #rc_cache.cache_perms.arguments.socket_timeout = 30
315 #rc_cache.cache_perms.arguments.host = localhost
311 #rc_cache.cache_perms.arguments.host = localhost
316 #rc_cache.cache_perms.arguments.port = 6379
312 #rc_cache.cache_perms.arguments.port = 6379
317 #rc_cache.cache_perms.arguments.db = 0
313 #rc_cache.cache_perms.arguments.db = 0
318 ## more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends
314 ## more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends
319 #rc_cache.cache_perms.arguments.distributed_lock = true
315 #rc_cache.cache_perms.arguments.distributed_lock = true
320
316
321 ## `cache_repo` cache settings for FileTree, Readme, RSS FEEDS
317 ## `cache_repo` cache settings for FileTree, Readme, RSS FEEDS
322 rc_cache.cache_repo.backend = dogpile.cache.rc.file_namespace
318 rc_cache.cache_repo.backend = dogpile.cache.rc.file_namespace
323 rc_cache.cache_repo.expiration_time = 2592000
319 rc_cache.cache_repo.expiration_time = 2592000
324
320
325 ## alternative `cache_repo` redis backend with distributed lock
321 ## alternative `cache_repo` redis backend with distributed lock
326 #rc_cache.cache_repo.backend = dogpile.cache.rc.redis
322 #rc_cache.cache_repo.backend = dogpile.cache.rc.redis
327 #rc_cache.cache_repo.expiration_time = 2592000
323 #rc_cache.cache_repo.expiration_time = 2592000
328 ## redis_expiration_time needs to be greater then expiration_time
324 ## redis_expiration_time needs to be greater then expiration_time
329 #rc_cache.cache_repo.arguments.redis_expiration_time = 2678400
325 #rc_cache.cache_repo.arguments.redis_expiration_time = 2678400
330 #rc_cache.cache_repo.arguments.socket_timeout = 30
326 #rc_cache.cache_repo.arguments.socket_timeout = 30
331 #rc_cache.cache_repo.arguments.host = localhost
327 #rc_cache.cache_repo.arguments.host = localhost
332 #rc_cache.cache_repo.arguments.port = 6379
328 #rc_cache.cache_repo.arguments.port = 6379
333 #rc_cache.cache_repo.arguments.db = 1
329 #rc_cache.cache_repo.arguments.db = 1
334 ## more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends
330 ## more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends
335 #rc_cache.cache_repo.arguments.distributed_lock = true
331 #rc_cache.cache_repo.arguments.distributed_lock = true
336
332
337 ## cache settings for SQL queries, this needs to use memory type backend
333 ## cache settings for SQL queries, this needs to use memory type backend
338 rc_cache.sql_cache_short.backend = dogpile.cache.rc.memory_lru
334 rc_cache.sql_cache_short.backend = dogpile.cache.rc.memory_lru
339 rc_cache.sql_cache_short.expiration_time = 30
335 rc_cache.sql_cache_short.expiration_time = 30
340
336
341 ## `cache_repo_longterm` cache for repo object instances, this needs to use memory
337 ## `cache_repo_longterm` cache for repo object instances, this needs to use memory
342 ## type backend as the objects kept are not pickle serializable
338 ## type backend as the objects kept are not pickle serializable
343 rc_cache.cache_repo_longterm.backend = dogpile.cache.rc.memory_lru
339 rc_cache.cache_repo_longterm.backend = dogpile.cache.rc.memory_lru
344 ## by default we use 96H, this is using invalidation on push anyway
340 ## by default we use 96H, this is using invalidation on push anyway
345 rc_cache.cache_repo_longterm.expiration_time = 345600
341 rc_cache.cache_repo_longterm.expiration_time = 345600
346 ## max items in LRU cache, reduce this number to save memory, and expire last used
342 ## max items in LRU cache, reduce this number to save memory, and expire last used
347 ## cached objects
343 ## cached objects
348 rc_cache.cache_repo_longterm.max_size = 10000
344 rc_cache.cache_repo_longterm.max_size = 10000
349
345
350
346
351 ####################################
347 ####################################
352 ### BEAKER SESSION ####
348 ### BEAKER SESSION ####
353 ####################################
349 ####################################
354
350
355 ## .session.type is type of storage options for the session, current allowed
351 ## .session.type is type of storage options for the session, current allowed
356 ## types are file, ext:memcached, ext:redis, ext:database, and memory (default).
352 ## types are file, ext:memcached, ext:redis, ext:database, and memory (default).
357 beaker.session.type = file
353 beaker.session.type = file
358 beaker.session.data_dir = %(here)s/data/sessions
354 beaker.session.data_dir = %(here)s/data/sessions
359
355
360 ## redis sessions
356 ## redis sessions
361 #beaker.session.type = ext:redis
357 #beaker.session.type = ext:redis
362 #beaker.session.url = redis://127.0.0.1:6379/2
358 #beaker.session.url = redis://127.0.0.1:6379/2
363
359
364 ## db based session, fast, and allows easy management over logged in users
360 ## db based session, fast, and allows easy management over logged in users
365 #beaker.session.type = ext:database
361 #beaker.session.type = ext:database
366 #beaker.session.table_name = db_session
362 #beaker.session.table_name = db_session
367 #beaker.session.sa.url = postgresql://postgres:secret@localhost/rhodecode
363 #beaker.session.sa.url = postgresql://postgres:secret@localhost/rhodecode
368 #beaker.session.sa.url = mysql://root:secret@127.0.0.1/rhodecode
364 #beaker.session.sa.url = mysql://root:secret@127.0.0.1/rhodecode
369 #beaker.session.sa.pool_recycle = 3600
365 #beaker.session.sa.pool_recycle = 3600
370 #beaker.session.sa.echo = false
366 #beaker.session.sa.echo = false
371
367
372 beaker.session.key = rhodecode
368 beaker.session.key = rhodecode
373 beaker.session.secret = production-rc-uytcxaz
369 beaker.session.secret = production-rc-uytcxaz
374 beaker.session.lock_dir = %(here)s/data/sessions/lock
370 beaker.session.lock_dir = %(here)s/data/sessions/lock
375
371
376 ## Secure encrypted cookie. Requires AES and AES python libraries
372 ## Secure encrypted cookie. Requires AES and AES python libraries
377 ## you must disable beaker.session.secret to use this
373 ## you must disable beaker.session.secret to use this
378 #beaker.session.encrypt_key = key_for_encryption
374 #beaker.session.encrypt_key = key_for_encryption
379 #beaker.session.validate_key = validation_key
375 #beaker.session.validate_key = validation_key
380
376
381 ## sets session as invalid(also logging out user) if it haven not been
377 ## sets session as invalid(also logging out user) if it haven not been
382 ## accessed for given amount of time in seconds
378 ## accessed for given amount of time in seconds
383 beaker.session.timeout = 2592000
379 beaker.session.timeout = 2592000
384 beaker.session.httponly = true
380 beaker.session.httponly = true
385 ## Path to use for the cookie. Set to prefix if you use prefix middleware
381 ## Path to use for the cookie. Set to prefix if you use prefix middleware
386 #beaker.session.cookie_path = /custom_prefix
382 #beaker.session.cookie_path = /custom_prefix
387
383
388 ## uncomment for https secure cookie
384 ## uncomment for https secure cookie
389 beaker.session.secure = false
385 beaker.session.secure = false
390
386
391 ## auto save the session to not to use .save()
387 ## auto save the session to not to use .save()
392 beaker.session.auto = false
388 beaker.session.auto = false
393
389
394 ## default cookie expiration time in seconds, set to `true` to set expire
390 ## default cookie expiration time in seconds, set to `true` to set expire
395 ## at browser close
391 ## at browser close
396 #beaker.session.cookie_expires = 3600
392 #beaker.session.cookie_expires = 3600
397
393
398 ###################################
394 ###################################
399 ## SEARCH INDEXING CONFIGURATION ##
395 ## SEARCH INDEXING CONFIGURATION ##
400 ###################################
396 ###################################
401 ## Full text search indexer is available in rhodecode-tools under
397 ## Full text search indexer is available in rhodecode-tools under
402 ## `rhodecode-tools index` command
398 ## `rhodecode-tools index` command
403
399
404 ## WHOOSH Backend, doesn't require additional services to run
400 ## WHOOSH Backend, doesn't require additional services to run
405 ## it works good with few dozen repos
401 ## it works good with few dozen repos
406 search.module = rhodecode.lib.index.whoosh
402 search.module = rhodecode.lib.index.whoosh
407 search.location = %(here)s/data/index
403 search.location = %(here)s/data/index
408
404
409 ########################################
405 ########################################
410 ### CHANNELSTREAM CONFIG ####
406 ### CHANNELSTREAM CONFIG ####
411 ########################################
407 ########################################
412 ## channelstream enables persistent connections and live notification
408 ## channelstream enables persistent connections and live notification
413 ## in the system. It's also used by the chat system
409 ## in the system. It's also used by the chat system
414
410
415 channelstream.enabled = false
411 channelstream.enabled = false
416
412
417 ## server address for channelstream server on the backend
413 ## server address for channelstream server on the backend
418 channelstream.server = 127.0.0.1:9800
414 channelstream.server = 127.0.0.1:9800
419
415
420 ## location of the channelstream server from outside world
416 ## location of the channelstream server from outside world
421 ## use ws:// for http or wss:// for https. This address needs to be handled
417 ## use ws:// for http or wss:// for https. This address needs to be handled
422 ## by external HTTP server such as Nginx or Apache
418 ## by external HTTP server such as Nginx or Apache
423 ## see Nginx/Apache configuration examples in our docs
419 ## see Nginx/Apache configuration examples in our docs
424 channelstream.ws_url = ws://rhodecode.yourserver.com/_channelstream
420 channelstream.ws_url = ws://rhodecode.yourserver.com/_channelstream
425 channelstream.secret = secret
421 channelstream.secret = secret
426 channelstream.history.location = %(here)s/channelstream_history
422 channelstream.history.location = %(here)s/channelstream_history
427
423
428 ## Internal application path that Javascript uses to connect into.
424 ## Internal application path that Javascript uses to connect into.
429 ## If you use proxy-prefix the prefix should be added before /_channelstream
425 ## If you use proxy-prefix the prefix should be added before /_channelstream
430 channelstream.proxy_path = /_channelstream
426 channelstream.proxy_path = /_channelstream
431
427
432
428
433 ###################################
429 ###################################
434 ## APPENLIGHT CONFIG ##
430 ## APPENLIGHT CONFIG ##
435 ###################################
431 ###################################
436
432
437 ## Appenlight is tailored to work with RhodeCode, see
433 ## Appenlight is tailored to work with RhodeCode, see
438 ## http://appenlight.com for details how to obtain an account
434 ## http://appenlight.com for details how to obtain an account
439
435
440 ## Appenlight integration enabled
436 ## Appenlight integration enabled
441 appenlight = false
437 appenlight = false
442
438
443 appenlight.server_url = https://api.appenlight.com
439 appenlight.server_url = https://api.appenlight.com
444 appenlight.api_key = YOUR_API_KEY
440 appenlight.api_key = YOUR_API_KEY
445 #appenlight.transport_config = https://api.appenlight.com?threaded=1&timeout=5
441 #appenlight.transport_config = https://api.appenlight.com?threaded=1&timeout=5
446
442
447 ## used for JS client
443 ## used for JS client
448 appenlight.api_public_key = YOUR_API_PUBLIC_KEY
444 appenlight.api_public_key = YOUR_API_PUBLIC_KEY
449
445
450 ## TWEAK AMOUNT OF INFO SENT HERE
446 ## TWEAK AMOUNT OF INFO SENT HERE
451
447
452 ## enables 404 error logging (default False)
448 ## enables 404 error logging (default False)
453 appenlight.report_404 = false
449 appenlight.report_404 = false
454
450
455 ## time in seconds after request is considered being slow (default 1)
451 ## time in seconds after request is considered being slow (default 1)
456 appenlight.slow_request_time = 1
452 appenlight.slow_request_time = 1
457
453
458 ## record slow requests in application
454 ## record slow requests in application
459 ## (needs to be enabled for slow datastore recording and time tracking)
455 ## (needs to be enabled for slow datastore recording and time tracking)
460 appenlight.slow_requests = true
456 appenlight.slow_requests = true
461
457
462 ## enable hooking to application loggers
458 ## enable hooking to application loggers
463 appenlight.logging = true
459 appenlight.logging = true
464
460
465 ## minimum log level for log capture
461 ## minimum log level for log capture
466 appenlight.logging.level = WARNING
462 appenlight.logging.level = WARNING
467
463
468 ## send logs only from erroneous/slow requests
464 ## send logs only from erroneous/slow requests
469 ## (saves API quota for intensive logging)
465 ## (saves API quota for intensive logging)
470 appenlight.logging_on_error = false
466 appenlight.logging_on_error = false
471
467
472 ## list of additional keywords that should be grabbed from environ object
468 ## list of additional keywords that should be grabbed from environ object
473 ## can be string with comma separated list of words in lowercase
469 ## can be string with comma separated list of words in lowercase
474 ## (by default client will always send following info:
470 ## (by default client will always send following info:
475 ## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that
471 ## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that
476 ## start with HTTP* this list be extended with additional keywords here
472 ## start with HTTP* this list be extended with additional keywords here
477 appenlight.environ_keys_whitelist =
473 appenlight.environ_keys_whitelist =
478
474
479 ## list of keywords that should be blanked from request object
475 ## list of keywords that should be blanked from request object
480 ## can be string with comma separated list of words in lowercase
476 ## can be string with comma separated list of words in lowercase
481 ## (by default client will always blank keys that contain following words
477 ## (by default client will always blank keys that contain following words
482 ## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'
478 ## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'
483 ## this list be extended with additional keywords set here
479 ## this list be extended with additional keywords set here
484 appenlight.request_keys_blacklist =
480 appenlight.request_keys_blacklist =
485
481
486 ## list of namespaces that should be ignores when gathering log entries
482 ## list of namespaces that should be ignores when gathering log entries
487 ## can be string with comma separated list of namespaces
483 ## can be string with comma separated list of namespaces
488 ## (by default the client ignores own entries: appenlight_client.client)
484 ## (by default the client ignores own entries: appenlight_client.client)
489 appenlight.log_namespace_blacklist =
485 appenlight.log_namespace_blacklist =
490
486
491
487
492 ###########################################
488 ###########################################
493 ### MAIN RHODECODE DATABASE CONFIG ###
489 ### MAIN RHODECODE DATABASE CONFIG ###
494 ###########################################
490 ###########################################
495 #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30
491 #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db?timeout=30
496 #sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode
492 #sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode
497 #sqlalchemy.db1.url = mysql://root:qweqwe@localhost/rhodecode?charset=utf8
493 #sqlalchemy.db1.url = mysql://root:qweqwe@localhost/rhodecode?charset=utf8
498 # pymysql is an alternative driver for MySQL, use in case of problems with default one
494 # pymysql is an alternative driver for MySQL, use in case of problems with default one
499 #sqlalchemy.db1.url = mysql+pymysql://root:qweqwe@localhost/rhodecode
495 #sqlalchemy.db1.url = mysql+pymysql://root:qweqwe@localhost/rhodecode
500
496
501 sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode
497 sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode
502
498
503 # see sqlalchemy docs for other advanced settings
499 # see sqlalchemy docs for other advanced settings
504
500
505 ## print the sql statements to output
501 ## print the sql statements to output
506 sqlalchemy.db1.echo = false
502 sqlalchemy.db1.echo = false
507 ## recycle the connections after this amount of seconds
503 ## recycle the connections after this amount of seconds
508 sqlalchemy.db1.pool_recycle = 3600
504 sqlalchemy.db1.pool_recycle = 3600
509 sqlalchemy.db1.convert_unicode = true
505 sqlalchemy.db1.convert_unicode = true
510
506
511 ## the number of connections to keep open inside the connection pool.
507 ## the number of connections to keep open inside the connection pool.
512 ## 0 indicates no limit
508 ## 0 indicates no limit
513 #sqlalchemy.db1.pool_size = 5
509 #sqlalchemy.db1.pool_size = 5
514
510
515 ## the number of connections to allow in connection pool "overflow", that is
511 ## the number of connections to allow in connection pool "overflow", that is
516 ## connections that can be opened above and beyond the pool_size setting,
512 ## connections that can be opened above and beyond the pool_size setting,
517 ## which defaults to five.
513 ## which defaults to five.
518 #sqlalchemy.db1.max_overflow = 10
514 #sqlalchemy.db1.max_overflow = 10
519
515
520 ## Connection check ping, used to detect broken database connections
516 ## Connection check ping, used to detect broken database connections
521 ## could be enabled to better handle cases if MySQL has gone away errors
517 ## could be enabled to better handle cases if MySQL has gone away errors
522 #sqlalchemy.db1.ping_connection = true
518 #sqlalchemy.db1.ping_connection = true
523
519
524 ##################
520 ##################
525 ### VCS CONFIG ###
521 ### VCS CONFIG ###
526 ##################
522 ##################
527 vcs.server.enable = true
523 vcs.server.enable = true
528 vcs.server = localhost:9900
524 vcs.server = localhost:9900
529
525
530 ## Web server connectivity protocol, responsible for web based VCS operations
526 ## Web server connectivity protocol, responsible for web based VCS operations
531 ## Available protocols are:
527 ## Available protocols are:
532 ## `http` - use http-rpc backend (default)
528 ## `http` - use http-rpc backend (default)
533 vcs.server.protocol = http
529 vcs.server.protocol = http
534
530
535 ## Push/Pull operations protocol, available options are:
531 ## Push/Pull operations protocol, available options are:
536 ## `http` - use http-rpc backend (default)
532 ## `http` - use http-rpc backend (default)
537 vcs.scm_app_implementation = http
533 vcs.scm_app_implementation = http
538
534
539 ## Push/Pull operations hooks protocol, available options are:
535 ## Push/Pull operations hooks protocol, available options are:
540 ## `http` - use http-rpc backend (default)
536 ## `http` - use http-rpc backend (default)
541 vcs.hooks.protocol = http
537 vcs.hooks.protocol = http
542
538
543 ## Host on which this instance is listening for hooks. If vcsserver is in other location
539 ## Host on which this instance is listening for hooks. If vcsserver is in other location
544 ## this should be adjusted.
540 ## this should be adjusted.
545 vcs.hooks.host = 127.0.0.1
541 vcs.hooks.host = 127.0.0.1
546
542
547 vcs.server.log_level = info
543 vcs.server.log_level = info
548 ## Start VCSServer with this instance as a subprocess, useful for development
544 ## Start VCSServer with this instance as a subprocess, useful for development
549 vcs.start_server = false
545 vcs.start_server = false
550
546
551 ## List of enabled VCS backends, available options are:
547 ## List of enabled VCS backends, available options are:
552 ## `hg` - mercurial
548 ## `hg` - mercurial
553 ## `git` - git
549 ## `git` - git
554 ## `svn` - subversion
550 ## `svn` - subversion
555 vcs.backends = hg, git, svn
551 vcs.backends = hg, git, svn
556
552
557 vcs.connection_timeout = 3600
553 vcs.connection_timeout = 3600
558 ## Compatibility version when creating SVN repositories. Defaults to newest version when commented out.
554 ## Compatibility version when creating SVN repositories. Defaults to newest version when commented out.
559 ## Available options are: pre-1.4-compatible, pre-1.5-compatible, pre-1.6-compatible, pre-1.8-compatible, pre-1.9-compatible
555 ## Available options are: pre-1.4-compatible, pre-1.5-compatible, pre-1.6-compatible, pre-1.8-compatible, pre-1.9-compatible
560 #vcs.svn.compatible_version = pre-1.8-compatible
556 #vcs.svn.compatible_version = pre-1.8-compatible
561
557
562
558
563 ############################################################
559 ############################################################
564 ### Subversion proxy support (mod_dav_svn) ###
560 ### Subversion proxy support (mod_dav_svn) ###
565 ### Maps RhodeCode repo groups into SVN paths for Apache ###
561 ### Maps RhodeCode repo groups into SVN paths for Apache ###
566 ############################################################
562 ############################################################
567 ## Enable or disable the config file generation.
563 ## Enable or disable the config file generation.
568 svn.proxy.generate_config = false
564 svn.proxy.generate_config = false
569 ## Generate config file with `SVNListParentPath` set to `On`.
565 ## Generate config file with `SVNListParentPath` set to `On`.
570 svn.proxy.list_parent_path = true
566 svn.proxy.list_parent_path = true
571 ## Set location and file name of generated config file.
567 ## Set location and file name of generated config file.
572 svn.proxy.config_file_path = %(here)s/mod_dav_svn.conf
568 svn.proxy.config_file_path = %(here)s/mod_dav_svn.conf
573 ## alternative mod_dav config template. This needs to be a mako template
569 ## alternative mod_dav config template. This needs to be a mako template
574 #svn.proxy.config_template = ~/.rccontrol/enterprise-1/custom_svn_conf.mako
570 #svn.proxy.config_template = ~/.rccontrol/enterprise-1/custom_svn_conf.mako
575 ## Used as a prefix to the `Location` block in the generated config file.
571 ## Used as a prefix to the `Location` block in the generated config file.
576 ## In most cases it should be set to `/`.
572 ## In most cases it should be set to `/`.
577 svn.proxy.location_root = /
573 svn.proxy.location_root = /
578 ## Command to reload the mod dav svn configuration on change.
574 ## Command to reload the mod dav svn configuration on change.
579 ## Example: `/etc/init.d/apache2 reload` or /home/USER/apache_reload.sh
575 ## Example: `/etc/init.d/apache2 reload` or /home/USER/apache_reload.sh
580 ## Make sure user who runs RhodeCode process is allowed to reload Apache
576 ## Make sure user who runs RhodeCode process is allowed to reload Apache
581 #svn.proxy.reload_cmd = /etc/init.d/apache2 reload
577 #svn.proxy.reload_cmd = /etc/init.d/apache2 reload
582 ## If the timeout expires before the reload command finishes, the command will
578 ## If the timeout expires before the reload command finishes, the command will
583 ## be killed. Setting it to zero means no timeout. Defaults to 10 seconds.
579 ## be killed. Setting it to zero means no timeout. Defaults to 10 seconds.
584 #svn.proxy.reload_timeout = 10
580 #svn.proxy.reload_timeout = 10
585
581
586 ############################################################
582 ############################################################
587 ### SSH Support Settings ###
583 ### SSH Support Settings ###
588 ############################################################
584 ############################################################
589
585
590 ## Defines if a custom authorized_keys file should be created and written on
586 ## Defines if a custom authorized_keys file should be created and written on
591 ## any change user ssh keys. Setting this to false also disables possibility
587 ## any change user ssh keys. Setting this to false also disables possibility
592 ## of adding SSH keys by users from web interface. Super admins can still
588 ## of adding SSH keys by users from web interface. Super admins can still
593 ## manage SSH Keys.
589 ## manage SSH Keys.
594 ssh.generate_authorized_keyfile = false
590 ssh.generate_authorized_keyfile = false
595
591
596 ## Options for ssh, default is `no-pty,no-port-forwarding,no-X11-forwarding,no-agent-forwarding`
592 ## Options for ssh, default is `no-pty,no-port-forwarding,no-X11-forwarding,no-agent-forwarding`
597 # ssh.authorized_keys_ssh_opts =
593 # ssh.authorized_keys_ssh_opts =
598
594
599 ## Path to the authorized_keys file where the generate entries are placed.
595 ## Path to the authorized_keys file where the generate entries are placed.
600 ## It is possible to have multiple key files specified in `sshd_config` e.g.
596 ## It is possible to have multiple key files specified in `sshd_config` e.g.
601 ## AuthorizedKeysFile %h/.ssh/authorized_keys %h/.ssh/authorized_keys_rhodecode
597 ## AuthorizedKeysFile %h/.ssh/authorized_keys %h/.ssh/authorized_keys_rhodecode
602 ssh.authorized_keys_file_path = ~/.ssh/authorized_keys_rhodecode
598 ssh.authorized_keys_file_path = ~/.ssh/authorized_keys_rhodecode
603
599
604 ## Command to execute the SSH wrapper. The binary is available in the
600 ## Command to execute the SSH wrapper. The binary is available in the
605 ## RhodeCode installation directory.
601 ## RhodeCode installation directory.
606 ## e.g ~/.rccontrol/community-1/profile/bin/rc-ssh-wrapper
602 ## e.g ~/.rccontrol/community-1/profile/bin/rc-ssh-wrapper
607 ssh.wrapper_cmd = ~/.rccontrol/community-1/rc-ssh-wrapper
603 ssh.wrapper_cmd = ~/.rccontrol/community-1/rc-ssh-wrapper
608
604
609 ## Allow shell when executing the ssh-wrapper command
605 ## Allow shell when executing the ssh-wrapper command
610 ssh.wrapper_cmd_allow_shell = false
606 ssh.wrapper_cmd_allow_shell = false
611
607
612 ## Enables logging, and detailed output send back to the client during SSH
608 ## Enables logging, and detailed output send back to the client during SSH
613 ## operations. Useful for debugging, shouldn't be used in production.
609 ## operations. Useful for debugging, shouldn't be used in production.
614 ssh.enable_debug_logging = false
610 ssh.enable_debug_logging = false
615
611
616 ## Paths to binary executable, by default they are the names, but we can
612 ## Paths to binary executable, by default they are the names, but we can
617 ## override them if we want to use a custom one
613 ## override them if we want to use a custom one
618 ssh.executable.hg = ~/.rccontrol/vcsserver-1/profile/bin/hg
614 ssh.executable.hg = ~/.rccontrol/vcsserver-1/profile/bin/hg
619 ssh.executable.git = ~/.rccontrol/vcsserver-1/profile/bin/git
615 ssh.executable.git = ~/.rccontrol/vcsserver-1/profile/bin/git
620 ssh.executable.svn = ~/.rccontrol/vcsserver-1/profile/bin/svnserve
616 ssh.executable.svn = ~/.rccontrol/vcsserver-1/profile/bin/svnserve
621
617
622 ## Enables SSH key generator web interface. Disabling this still allows users
618 ## Enables SSH key generator web interface. Disabling this still allows users
623 ## to add their own keys.
619 ## to add their own keys.
624 ssh.enable_ui_key_generator = true
620 ssh.enable_ui_key_generator = true
625
621
626
622
627 ## Dummy marker to add new entries after.
623 ## Dummy marker to add new entries after.
628 ## Add any custom entries below. Please don't remove.
624 ## Add any custom entries below. Please don't remove.
629 custom.conf = 1
625 custom.conf = 1
630
626
631
627
632 ################################
628 ################################
633 ### LOGGING CONFIGURATION ####
629 ### LOGGING CONFIGURATION ####
634 ################################
630 ################################
635 [loggers]
631 [loggers]
636 keys = root, sqlalchemy, beaker, celery, rhodecode, ssh_wrapper
632 keys = root, sqlalchemy, beaker, celery, rhodecode, ssh_wrapper
637
633
638 [handlers]
634 [handlers]
639 keys = console, console_sql
635 keys = console, console_sql
640
636
641 [formatters]
637 [formatters]
642 keys = generic, color_formatter, color_formatter_sql
638 keys = generic, color_formatter, color_formatter_sql
643
639
644 #############
640 #############
645 ## LOGGERS ##
641 ## LOGGERS ##
646 #############
642 #############
647 [logger_root]
643 [logger_root]
648 level = NOTSET
644 level = NOTSET
649 handlers = console
645 handlers = console
650
646
651 [logger_sqlalchemy]
647 [logger_sqlalchemy]
652 level = INFO
648 level = INFO
653 handlers = console_sql
649 handlers = console_sql
654 qualname = sqlalchemy.engine
650 qualname = sqlalchemy.engine
655 propagate = 0
651 propagate = 0
656
652
657 [logger_beaker]
653 [logger_beaker]
658 level = DEBUG
654 level = DEBUG
659 handlers =
655 handlers =
660 qualname = beaker.container
656 qualname = beaker.container
661 propagate = 1
657 propagate = 1
662
658
663 [logger_rhodecode]
659 [logger_rhodecode]
664 level = DEBUG
660 level = DEBUG
665 handlers =
661 handlers =
666 qualname = rhodecode
662 qualname = rhodecode
667 propagate = 1
663 propagate = 1
668
664
669 [logger_ssh_wrapper]
665 [logger_ssh_wrapper]
670 level = DEBUG
666 level = DEBUG
671 handlers =
667 handlers =
672 qualname = ssh_wrapper
668 qualname = ssh_wrapper
673 propagate = 1
669 propagate = 1
674
670
675 [logger_celery]
671 [logger_celery]
676 level = DEBUG
672 level = DEBUG
677 handlers =
673 handlers =
678 qualname = celery
674 qualname = celery
679
675
680
676
681 ##############
677 ##############
682 ## HANDLERS ##
678 ## HANDLERS ##
683 ##############
679 ##############
684
680
685 [handler_console]
681 [handler_console]
686 class = StreamHandler
682 class = StreamHandler
687 args = (sys.stderr, )
683 args = (sys.stderr, )
688 level = INFO
684 level = INFO
689 formatter = generic
685 formatter = generic
690
686
691 [handler_console_sql]
687 [handler_console_sql]
692 # "level = DEBUG" logs SQL queries and results.
688 # "level = DEBUG" logs SQL queries and results.
693 # "level = INFO" logs SQL queries.
689 # "level = INFO" logs SQL queries.
694 # "level = WARN" logs neither. (Recommended for production systems.)
690 # "level = WARN" logs neither. (Recommended for production systems.)
695 class = StreamHandler
691 class = StreamHandler
696 args = (sys.stderr, )
692 args = (sys.stderr, )
697 level = WARN
693 level = WARN
698 formatter = generic
694 formatter = generic
699
695
700 ################
696 ################
701 ## FORMATTERS ##
697 ## FORMATTERS ##
702 ################
698 ################
703
699
704 [formatter_generic]
700 [formatter_generic]
705 class = rhodecode.lib.logging_formatter.ExceptionAwareFormatter
701 class = rhodecode.lib.logging_formatter.ExceptionAwareFormatter
706 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
702 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
707 datefmt = %Y-%m-%d %H:%M:%S
703 datefmt = %Y-%m-%d %H:%M:%S
708
704
709 [formatter_color_formatter]
705 [formatter_color_formatter]
710 class = rhodecode.lib.logging_formatter.ColorFormatter
706 class = rhodecode.lib.logging_formatter.ColorFormatter
711 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
707 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
712 datefmt = %Y-%m-%d %H:%M:%S
708 datefmt = %Y-%m-%d %H:%M:%S
713
709
714 [formatter_color_formatter_sql]
710 [formatter_color_formatter_sql]
715 class = rhodecode.lib.logging_formatter.ColorFormatterSql
711 class = rhodecode.lib.logging_formatter.ColorFormatterSql
716 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
712 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
717 datefmt = %Y-%m-%d %H:%M:%S
713 datefmt = %Y-%m-%d %H:%M:%S
@@ -1,755 +1,754 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2
2
3 # Copyright (C) 2010-2019 RhodeCode GmbH
3 # Copyright (C) 2010-2019 RhodeCode GmbH
4 #
4 #
5 # This program is free software: you can redistribute it and/or modify
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License, version 3
6 # it under the terms of the GNU Affero General Public License, version 3
7 # (only), as published by the Free Software Foundation.
7 # (only), as published by the Free Software Foundation.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU Affero General Public License
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #
16 #
17 # This program is dual-licensed. If you wish to learn more about the
17 # This program is dual-licensed. If you wish to learn more about the
18 # RhodeCode Enterprise Edition, including its added features, Support services,
18 # RhodeCode Enterprise Edition, including its added features, Support services,
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20
20
21 import os
21 import os
22 import sys
22 import sys
23 import logging
23 import logging
24 import collections
24 import collections
25 import tempfile
25 import tempfile
26 import time
26 import time
27
27
28 from paste.gzipper import make_gzip_middleware
28 from paste.gzipper import make_gzip_middleware
29 import pyramid.events
29 import pyramid.events
30 from pyramid.wsgi import wsgiapp
30 from pyramid.wsgi import wsgiapp
31 from pyramid.authorization import ACLAuthorizationPolicy
31 from pyramid.authorization import ACLAuthorizationPolicy
32 from pyramid.config import Configurator
32 from pyramid.config import Configurator
33 from pyramid.settings import asbool, aslist
33 from pyramid.settings import asbool, aslist
34 from pyramid.httpexceptions import (
34 from pyramid.httpexceptions import (
35 HTTPException, HTTPError, HTTPInternalServerError, HTTPFound, HTTPNotFound)
35 HTTPException, HTTPError, HTTPInternalServerError, HTTPFound, HTTPNotFound)
36 from pyramid.renderers import render_to_response
36 from pyramid.renderers import render_to_response
37
37
38 from rhodecode.model import meta
38 from rhodecode.model import meta
39 from rhodecode.config import patches
39 from rhodecode.config import patches
40 from rhodecode.config import utils as config_utils
40 from rhodecode.config import utils as config_utils
41 from rhodecode.config.environment import load_pyramid_environment
41 from rhodecode.config.environment import load_pyramid_environment
42
42
43 import rhodecode.events
43 import rhodecode.events
44 from rhodecode.lib.middleware.vcs import VCSMiddleware
44 from rhodecode.lib.middleware.vcs import VCSMiddleware
45 from rhodecode.lib.request import Request
45 from rhodecode.lib.request import Request
46 from rhodecode.lib.vcs import VCSCommunicationError
46 from rhodecode.lib.vcs import VCSCommunicationError
47 from rhodecode.lib.exceptions import VCSServerUnavailable
47 from rhodecode.lib.exceptions import VCSServerUnavailable
48 from rhodecode.lib.middleware.appenlight import wrap_in_appenlight_if_enabled
48 from rhodecode.lib.middleware.appenlight import wrap_in_appenlight_if_enabled
49 from rhodecode.lib.middleware.https_fixup import HttpsFixup
49 from rhodecode.lib.middleware.https_fixup import HttpsFixup
50 from rhodecode.lib.celerylib.loader import configure_celery
50 from rhodecode.lib.celerylib.loader import configure_celery
51 from rhodecode.lib.plugins.utils import register_rhodecode_plugin
51 from rhodecode.lib.plugins.utils import register_rhodecode_plugin
52 from rhodecode.lib.utils2 import aslist as rhodecode_aslist, AttributeDict
52 from rhodecode.lib.utils2 import aslist as rhodecode_aslist, AttributeDict
53 from rhodecode.lib.exc_tracking import store_exception
53 from rhodecode.lib.exc_tracking import store_exception
54 from rhodecode.subscribers import (
54 from rhodecode.subscribers import (
55 scan_repositories_if_enabled, write_js_routes_if_enabled,
55 scan_repositories_if_enabled, write_js_routes_if_enabled,
56 write_metadata_if_needed, inject_app_settings)
56 write_metadata_if_needed, inject_app_settings)
57
57
58
58
59 log = logging.getLogger(__name__)
59 log = logging.getLogger(__name__)
60
60
61
61
62 def is_http_error(response):
62 def is_http_error(response):
63 # error which should have traceback
63 # error which should have traceback
64 return response.status_code > 499
64 return response.status_code > 499
65
65
66
66
67 def should_load_all():
67 def should_load_all():
68 """
68 """
69 Returns if all application components should be loaded. In some cases it's
69 Returns if all application components should be loaded. In some cases it's
70 desired to skip apps loading for faster shell script execution
70 desired to skip apps loading for faster shell script execution
71 """
71 """
72 ssh_cmd = os.environ.get('RC_CMD_SSH_WRAPPER')
72 ssh_cmd = os.environ.get('RC_CMD_SSH_WRAPPER')
73 if ssh_cmd:
73 if ssh_cmd:
74 return False
74 return False
75
75
76 return True
76 return True
77
77
78
78
79 def make_pyramid_app(global_config, **settings):
79 def make_pyramid_app(global_config, **settings):
80 """
80 """
81 Constructs the WSGI application based on Pyramid.
81 Constructs the WSGI application based on Pyramid.
82
82
83 Specials:
83 Specials:
84
84
85 * The application can also be integrated like a plugin via the call to
85 * The application can also be integrated like a plugin via the call to
86 `includeme`. This is accompanied with the other utility functions which
86 `includeme`. This is accompanied with the other utility functions which
87 are called. Changing this should be done with great care to not break
87 are called. Changing this should be done with great care to not break
88 cases when these fragments are assembled from another place.
88 cases when these fragments are assembled from another place.
89
89
90 """
90 """
91
91
92 # Allows to use format style "{ENV_NAME}" placeholders in the configuration. It
92 # Allows to use format style "{ENV_NAME}" placeholders in the configuration. It
93 # will be replaced by the value of the environment variable "NAME" in this case.
93 # will be replaced by the value of the environment variable "NAME" in this case.
94 start_time = time.time()
94 start_time = time.time()
95
95
96 debug = asbool(global_config.get('debug'))
96 debug = asbool(global_config.get('debug'))
97 if debug:
97 if debug:
98 enable_debug()
98 enable_debug()
99
99
100 environ = {'ENV_{}'.format(key): value for key, value in os.environ.items()}
100 environ = {'ENV_{}'.format(key): value for key, value in os.environ.items()}
101
101
102 global_config = _substitute_values(global_config, environ)
102 global_config = _substitute_values(global_config, environ)
103 settings = _substitute_values(settings, environ)
103 settings = _substitute_values(settings, environ)
104
104
105 sanitize_settings_and_apply_defaults(global_config, settings)
105 sanitize_settings_and_apply_defaults(global_config, settings)
106
106
107 config = Configurator(settings=settings)
107 config = Configurator(settings=settings)
108
108
109 # Apply compatibility patches
109 # Apply compatibility patches
110 patches.inspect_getargspec()
110 patches.inspect_getargspec()
111
111
112 load_pyramid_environment(global_config, settings)
112 load_pyramid_environment(global_config, settings)
113
113
114 # Static file view comes first
114 # Static file view comes first
115 includeme_first(config)
115 includeme_first(config)
116
116
117 includeme(config)
117 includeme(config)
118
118
119 pyramid_app = config.make_wsgi_app()
119 pyramid_app = config.make_wsgi_app()
120 pyramid_app = wrap_app_in_wsgi_middlewares(pyramid_app, config)
120 pyramid_app = wrap_app_in_wsgi_middlewares(pyramid_app, config)
121 pyramid_app.config = config
121 pyramid_app.config = config
122
122
123 config.configure_celery(global_config['__file__'])
123 config.configure_celery(global_config['__file__'])
124 # creating the app uses a connection - return it after we are done
124 # creating the app uses a connection - return it after we are done
125 meta.Session.remove()
125 meta.Session.remove()
126 total_time = time.time() - start_time
126 total_time = time.time() - start_time
127 log.info('Pyramid app `%s` created and configured in %.2fs',
127 log.info('Pyramid app `%s` created and configured in %.2fs',
128 pyramid_app.func_name, total_time)
128 pyramid_app.func_name, total_time)
129
129
130 return pyramid_app
130 return pyramid_app
131
131
132
132
133 def not_found_view(request):
133 def not_found_view(request):
134 """
134 """
135 This creates the view which should be registered as not-found-view to
135 This creates the view which should be registered as not-found-view to
136 pyramid.
136 pyramid.
137 """
137 """
138
138
139 if not getattr(request, 'vcs_call', None):
139 if not getattr(request, 'vcs_call', None):
140 # handle like regular case with our error_handler
140 # handle like regular case with our error_handler
141 return error_handler(HTTPNotFound(), request)
141 return error_handler(HTTPNotFound(), request)
142
142
143 # handle not found view as a vcs call
143 # handle not found view as a vcs call
144 settings = request.registry.settings
144 settings = request.registry.settings
145 ae_client = getattr(request, 'ae_client', None)
145 ae_client = getattr(request, 'ae_client', None)
146 vcs_app = VCSMiddleware(
146 vcs_app = VCSMiddleware(
147 HTTPNotFound(), request.registry, settings,
147 HTTPNotFound(), request.registry, settings,
148 appenlight_client=ae_client)
148 appenlight_client=ae_client)
149
149
150 return wsgiapp(vcs_app)(None, request)
150 return wsgiapp(vcs_app)(None, request)
151
151
152
152
153 def error_handler(exception, request):
153 def error_handler(exception, request):
154 import rhodecode
154 import rhodecode
155 from rhodecode.lib import helpers
155 from rhodecode.lib import helpers
156
156
157 rhodecode_title = rhodecode.CONFIG.get('rhodecode_title') or 'RhodeCode'
157 rhodecode_title = rhodecode.CONFIG.get('rhodecode_title') or 'RhodeCode'
158
158
159 base_response = HTTPInternalServerError()
159 base_response = HTTPInternalServerError()
160 # prefer original exception for the response since it may have headers set
160 # prefer original exception for the response since it may have headers set
161 if isinstance(exception, HTTPException):
161 if isinstance(exception, HTTPException):
162 base_response = exception
162 base_response = exception
163 elif isinstance(exception, VCSCommunicationError):
163 elif isinstance(exception, VCSCommunicationError):
164 base_response = VCSServerUnavailable()
164 base_response = VCSServerUnavailable()
165
165
166 if is_http_error(base_response):
166 if is_http_error(base_response):
167 log.exception(
167 log.exception(
168 'error occurred handling this request for path: %s', request.path)
168 'error occurred handling this request for path: %s', request.path)
169
169
170 error_explanation = base_response.explanation or str(base_response)
170 error_explanation = base_response.explanation or str(base_response)
171 if base_response.status_code == 404:
171 if base_response.status_code == 404:
172 error_explanation += " Optionally you don't have permission to access this page."
172 error_explanation += " Optionally you don't have permission to access this page."
173 c = AttributeDict()
173 c = AttributeDict()
174 c.error_message = base_response.status
174 c.error_message = base_response.status
175 c.error_explanation = error_explanation
175 c.error_explanation = error_explanation
176 c.visual = AttributeDict()
176 c.visual = AttributeDict()
177
177
178 c.visual.rhodecode_support_url = (
178 c.visual.rhodecode_support_url = (
179 request.registry.settings.get('rhodecode_support_url') or
179 request.registry.settings.get('rhodecode_support_url') or
180 request.route_url('rhodecode_support')
180 request.route_url('rhodecode_support')
181 )
181 )
182 c.redirect_time = 0
182 c.redirect_time = 0
183 c.rhodecode_name = rhodecode_title
183 c.rhodecode_name = rhodecode_title
184 if not c.rhodecode_name:
184 if not c.rhodecode_name:
185 c.rhodecode_name = 'Rhodecode'
185 c.rhodecode_name = 'Rhodecode'
186
186
187 c.causes = []
187 c.causes = []
188 if is_http_error(base_response):
188 if is_http_error(base_response):
189 c.causes.append('Server is overloaded.')
189 c.causes.append('Server is overloaded.')
190 c.causes.append('Server database connection is lost.')
190 c.causes.append('Server database connection is lost.')
191 c.causes.append('Server expected unhandled error.')
191 c.causes.append('Server expected unhandled error.')
192
192
193 if hasattr(base_response, 'causes'):
193 if hasattr(base_response, 'causes'):
194 c.causes = base_response.causes
194 c.causes = base_response.causes
195
195
196 c.messages = helpers.flash.pop_messages(request=request)
196 c.messages = helpers.flash.pop_messages(request=request)
197
197
198 exc_info = sys.exc_info()
198 exc_info = sys.exc_info()
199 c.exception_id = id(exc_info)
199 c.exception_id = id(exc_info)
200 c.show_exception_id = isinstance(base_response, VCSServerUnavailable) \
200 c.show_exception_id = isinstance(base_response, VCSServerUnavailable) \
201 or base_response.status_code > 499
201 or base_response.status_code > 499
202 c.exception_id_url = request.route_url(
202 c.exception_id_url = request.route_url(
203 'admin_settings_exception_tracker_show', exception_id=c.exception_id)
203 'admin_settings_exception_tracker_show', exception_id=c.exception_id)
204
204
205 if c.show_exception_id:
205 if c.show_exception_id:
206 store_exception(c.exception_id, exc_info)
206 store_exception(c.exception_id, exc_info)
207
207
208 response = render_to_response(
208 response = render_to_response(
209 '/errors/error_document.mako', {'c': c, 'h': helpers}, request=request,
209 '/errors/error_document.mako', {'c': c, 'h': helpers}, request=request,
210 response=base_response)
210 response=base_response)
211
211
212 return response
212 return response
213
213
214
214
215 def includeme_first(config):
215 def includeme_first(config):
216 # redirect automatic browser favicon.ico requests to correct place
216 # redirect automatic browser favicon.ico requests to correct place
217 def favicon_redirect(context, request):
217 def favicon_redirect(context, request):
218 return HTTPFound(
218 return HTTPFound(
219 request.static_path('rhodecode:public/images/favicon.ico'))
219 request.static_path('rhodecode:public/images/favicon.ico'))
220
220
221 config.add_view(favicon_redirect, route_name='favicon')
221 config.add_view(favicon_redirect, route_name='favicon')
222 config.add_route('favicon', '/favicon.ico')
222 config.add_route('favicon', '/favicon.ico')
223
223
224 def robots_redirect(context, request):
224 def robots_redirect(context, request):
225 return HTTPFound(
225 return HTTPFound(
226 request.static_path('rhodecode:public/robots.txt'))
226 request.static_path('rhodecode:public/robots.txt'))
227
227
228 config.add_view(robots_redirect, route_name='robots')
228 config.add_view(robots_redirect, route_name='robots')
229 config.add_route('robots', '/robots.txt')
229 config.add_route('robots', '/robots.txt')
230
230
231 config.add_static_view(
231 config.add_static_view(
232 '_static/deform', 'deform:static')
232 '_static/deform', 'deform:static')
233 config.add_static_view(
233 config.add_static_view(
234 '_static/rhodecode', path='rhodecode:public', cache_max_age=3600 * 24)
234 '_static/rhodecode', path='rhodecode:public', cache_max_age=3600 * 24)
235
235
236
236
237 def includeme(config):
237 def includeme(config):
238 log.debug('Initializing main includeme from %s', os.path.basename(__file__))
238 log.debug('Initializing main includeme from %s', os.path.basename(__file__))
239 settings = config.registry.settings
239 settings = config.registry.settings
240 config.set_request_factory(Request)
240 config.set_request_factory(Request)
241
241
242 # plugin information
242 # plugin information
243 config.registry.rhodecode_plugins = collections.OrderedDict()
243 config.registry.rhodecode_plugins = collections.OrderedDict()
244
244
245 config.add_directive(
245 config.add_directive(
246 'register_rhodecode_plugin', register_rhodecode_plugin)
246 'register_rhodecode_plugin', register_rhodecode_plugin)
247
247
248 config.add_directive('configure_celery', configure_celery)
248 config.add_directive('configure_celery', configure_celery)
249
249
250 if asbool(settings.get('appenlight', 'false')):
250 if asbool(settings.get('appenlight', 'false')):
251 config.include('appenlight_client.ext.pyramid_tween')
251 config.include('appenlight_client.ext.pyramid_tween')
252
252
253 load_all = should_load_all()
253 load_all = should_load_all()
254
254
255 # Includes which are required. The application would fail without them.
255 # Includes which are required. The application would fail without them.
256 config.include('pyramid_mako')
256 config.include('pyramid_mako')
257 config.include('rhodecode.lib.rc_beaker')
257 config.include('rhodecode.lib.rc_beaker')
258 config.include('rhodecode.lib.rc_cache')
258 config.include('rhodecode.lib.rc_cache')
259
259
260 config.include('rhodecode.apps._base.navigation')
260 config.include('rhodecode.apps._base.navigation')
261 config.include('rhodecode.apps._base.subscribers')
261 config.include('rhodecode.apps._base.subscribers')
262 config.include('rhodecode.tweens')
262 config.include('rhodecode.tweens')
263 config.include('rhodecode.authentication')
263 config.include('rhodecode.authentication')
264
264
265 if load_all:
265 if load_all:
266 config.include('rhodecode.integrations')
266 config.include('rhodecode.integrations')
267
267
268 if load_all:
268 if load_all:
269 from rhodecode.authentication import discover_legacy_plugins
269 from rhodecode.authentication import discover_legacy_plugins
270 # load CE authentication plugins
270 # load CE authentication plugins
271 config.include('rhodecode.authentication.plugins.auth_crowd')
271 config.include('rhodecode.authentication.plugins.auth_crowd')
272 config.include('rhodecode.authentication.plugins.auth_headers')
272 config.include('rhodecode.authentication.plugins.auth_headers')
273 config.include('rhodecode.authentication.plugins.auth_jasig_cas')
273 config.include('rhodecode.authentication.plugins.auth_jasig_cas')
274 config.include('rhodecode.authentication.plugins.auth_ldap')
274 config.include('rhodecode.authentication.plugins.auth_ldap')
275 config.include('rhodecode.authentication.plugins.auth_pam')
275 config.include('rhodecode.authentication.plugins.auth_pam')
276 config.include('rhodecode.authentication.plugins.auth_rhodecode')
276 config.include('rhodecode.authentication.plugins.auth_rhodecode')
277 config.include('rhodecode.authentication.plugins.auth_token')
277 config.include('rhodecode.authentication.plugins.auth_token')
278
278
279 # Auto discover authentication plugins and include their configuration.
279 # Auto discover authentication plugins and include their configuration.
280 discover_legacy_plugins(config)
280 discover_legacy_plugins(config)
281
281
282 # apps
282 # apps
283 if load_all:
283 if load_all:
284 config.include('rhodecode.apps._base')
284 config.include('rhodecode.apps._base')
285 config.include('rhodecode.apps.ops')
285 config.include('rhodecode.apps.ops')
286 config.include('rhodecode.apps.admin')
286 config.include('rhodecode.apps.admin')
287 config.include('rhodecode.apps.channelstream')
287 config.include('rhodecode.apps.channelstream')
288 config.include('rhodecode.apps.file_store')
288 config.include('rhodecode.apps.file_store')
289 config.include('rhodecode.apps.login')
289 config.include('rhodecode.apps.login')
290 config.include('rhodecode.apps.home')
290 config.include('rhodecode.apps.home')
291 config.include('rhodecode.apps.journal')
291 config.include('rhodecode.apps.journal')
292 config.include('rhodecode.apps.repository')
292 config.include('rhodecode.apps.repository')
293 config.include('rhodecode.apps.repo_group')
293 config.include('rhodecode.apps.repo_group')
294 config.include('rhodecode.apps.user_group')
294 config.include('rhodecode.apps.user_group')
295 config.include('rhodecode.apps.search')
295 config.include('rhodecode.apps.search')
296 config.include('rhodecode.apps.user_profile')
296 config.include('rhodecode.apps.user_profile')
297 config.include('rhodecode.apps.user_group_profile')
297 config.include('rhodecode.apps.user_group_profile')
298 config.include('rhodecode.apps.my_account')
298 config.include('rhodecode.apps.my_account')
299 config.include('rhodecode.apps.svn_support')
299 config.include('rhodecode.apps.svn_support')
300 config.include('rhodecode.apps.ssh_support')
300 config.include('rhodecode.apps.ssh_support')
301 config.include('rhodecode.apps.gist')
301 config.include('rhodecode.apps.gist')
302 config.include('rhodecode.apps.debug_style')
302 config.include('rhodecode.apps.debug_style')
303 config.include('rhodecode.api')
303 config.include('rhodecode.api')
304
304
305 config.add_route('rhodecode_support', 'https://rhodecode.com/help/', static=True)
305 config.add_route('rhodecode_support', 'https://rhodecode.com/help/', static=True)
306 config.add_translation_dirs('rhodecode:i18n/')
306 config.add_translation_dirs('rhodecode:i18n/')
307 settings['default_locale_name'] = settings.get('lang', 'en')
307 settings['default_locale_name'] = settings.get('lang', 'en')
308
308
309 # Add subscribers.
309 # Add subscribers.
310 if load_all:
310 if load_all:
311 config.add_subscriber(inject_app_settings,
311 config.add_subscriber(inject_app_settings,
312 pyramid.events.ApplicationCreated)
312 pyramid.events.ApplicationCreated)
313 config.add_subscriber(scan_repositories_if_enabled,
313 config.add_subscriber(scan_repositories_if_enabled,
314 pyramid.events.ApplicationCreated)
314 pyramid.events.ApplicationCreated)
315 config.add_subscriber(write_metadata_if_needed,
315 config.add_subscriber(write_metadata_if_needed,
316 pyramid.events.ApplicationCreated)
316 pyramid.events.ApplicationCreated)
317 config.add_subscriber(write_js_routes_if_enabled,
317 config.add_subscriber(write_js_routes_if_enabled,
318 pyramid.events.ApplicationCreated)
318 pyramid.events.ApplicationCreated)
319
319
320 # request custom methods
320 # request custom methods
321 config.add_request_method(
321 config.add_request_method(
322 'rhodecode.lib.partial_renderer.get_partial_renderer',
322 'rhodecode.lib.partial_renderer.get_partial_renderer',
323 'get_partial_renderer')
323 'get_partial_renderer')
324
324
325 config.add_request_method(
325 config.add_request_method(
326 'rhodecode.lib.request_counter.get_request_counter',
326 'rhodecode.lib.request_counter.get_request_counter',
327 'request_count')
327 'request_count')
328
328
329 # Set the authorization policy.
329 # Set the authorization policy.
330 authz_policy = ACLAuthorizationPolicy()
330 authz_policy = ACLAuthorizationPolicy()
331 config.set_authorization_policy(authz_policy)
331 config.set_authorization_policy(authz_policy)
332
332
333 # Set the default renderer for HTML templates to mako.
333 # Set the default renderer for HTML templates to mako.
334 config.add_mako_renderer('.html')
334 config.add_mako_renderer('.html')
335
335
336 config.add_renderer(
336 config.add_renderer(
337 name='json_ext',
337 name='json_ext',
338 factory='rhodecode.lib.ext_json_renderer.pyramid_ext_json')
338 factory='rhodecode.lib.ext_json_renderer.pyramid_ext_json')
339
339
340 # include RhodeCode plugins
340 # include RhodeCode plugins
341 includes = aslist(settings.get('rhodecode.includes', []))
341 includes = aslist(settings.get('rhodecode.includes', []))
342 for inc in includes:
342 for inc in includes:
343 config.include(inc)
343 config.include(inc)
344
344
345 # custom not found view, if our pyramid app doesn't know how to handle
345 # custom not found view, if our pyramid app doesn't know how to handle
346 # the request pass it to potential VCS handling ap
346 # the request pass it to potential VCS handling ap
347 config.add_notfound_view(not_found_view)
347 config.add_notfound_view(not_found_view)
348 if not settings.get('debugtoolbar.enabled', False):
348 if not settings.get('debugtoolbar.enabled', False):
349 # disabled debugtoolbar handle all exceptions via the error_handlers
349 # disabled debugtoolbar handle all exceptions via the error_handlers
350 config.add_view(error_handler, context=Exception)
350 config.add_view(error_handler, context=Exception)
351
351
352 # all errors including 403/404/50X
352 # all errors including 403/404/50X
353 config.add_view(error_handler, context=HTTPError)
353 config.add_view(error_handler, context=HTTPError)
354
354
355
355
356 def wrap_app_in_wsgi_middlewares(pyramid_app, config):
356 def wrap_app_in_wsgi_middlewares(pyramid_app, config):
357 """
357 """
358 Apply outer WSGI middlewares around the application.
358 Apply outer WSGI middlewares around the application.
359 """
359 """
360 registry = config.registry
360 registry = config.registry
361 settings = registry.settings
361 settings = registry.settings
362
362
363 # enable https redirects based on HTTP_X_URL_SCHEME set by proxy
363 # enable https redirects based on HTTP_X_URL_SCHEME set by proxy
364 pyramid_app = HttpsFixup(pyramid_app, settings)
364 pyramid_app = HttpsFixup(pyramid_app, settings)
365
365
366 pyramid_app, _ae_client = wrap_in_appenlight_if_enabled(
366 pyramid_app, _ae_client = wrap_in_appenlight_if_enabled(
367 pyramid_app, settings)
367 pyramid_app, settings)
368 registry.ae_client = _ae_client
368 registry.ae_client = _ae_client
369
369
370 if settings['gzip_responses']:
370 if settings['gzip_responses']:
371 pyramid_app = make_gzip_middleware(
371 pyramid_app = make_gzip_middleware(
372 pyramid_app, settings, compress_level=1)
372 pyramid_app, settings, compress_level=1)
373
373
374 # this should be the outer most middleware in the wsgi stack since
374 # this should be the outer most middleware in the wsgi stack since
375 # middleware like Routes make database calls
375 # middleware like Routes make database calls
376 def pyramid_app_with_cleanup(environ, start_response):
376 def pyramid_app_with_cleanup(environ, start_response):
377 try:
377 try:
378 return pyramid_app(environ, start_response)
378 return pyramid_app(environ, start_response)
379 finally:
379 finally:
380 # Dispose current database session and rollback uncommitted
380 # Dispose current database session and rollback uncommitted
381 # transactions.
381 # transactions.
382 meta.Session.remove()
382 meta.Session.remove()
383
383
384 # In a single threaded mode server, on non sqlite db we should have
384 # In a single threaded mode server, on non sqlite db we should have
385 # '0 Current Checked out connections' at the end of a request,
385 # '0 Current Checked out connections' at the end of a request,
386 # if not, then something, somewhere is leaving a connection open
386 # if not, then something, somewhere is leaving a connection open
387 pool = meta.Base.metadata.bind.engine.pool
387 pool = meta.Base.metadata.bind.engine.pool
388 log.debug('sa pool status: %s', pool.status())
388 log.debug('sa pool status: %s', pool.status())
389 log.debug('Request processing finalized')
389 log.debug('Request processing finalized')
390
390
391 return pyramid_app_with_cleanup
391 return pyramid_app_with_cleanup
392
392
393
393
394 def sanitize_settings_and_apply_defaults(global_config, settings):
394 def sanitize_settings_and_apply_defaults(global_config, settings):
395 """
395 """
396 Applies settings defaults and does all type conversion.
396 Applies settings defaults and does all type conversion.
397
397
398 We would move all settings parsing and preparation into this place, so that
398 We would move all settings parsing and preparation into this place, so that
399 we have only one place left which deals with this part. The remaining parts
399 we have only one place left which deals with this part. The remaining parts
400 of the application would start to rely fully on well prepared settings.
400 of the application would start to rely fully on well prepared settings.
401
401
402 This piece would later be split up per topic to avoid a big fat monster
402 This piece would later be split up per topic to avoid a big fat monster
403 function.
403 function.
404 """
404 """
405
405
406 settings.setdefault('rhodecode.edition', 'Community Edition')
406 settings.setdefault('rhodecode.edition', 'Community Edition')
407
407
408 if 'mako.default_filters' not in settings:
408 if 'mako.default_filters' not in settings:
409 # set custom default filters if we don't have it defined
409 # set custom default filters if we don't have it defined
410 settings['mako.imports'] = 'from rhodecode.lib.base import h_filter'
410 settings['mako.imports'] = 'from rhodecode.lib.base import h_filter'
411 settings['mako.default_filters'] = 'h_filter'
411 settings['mako.default_filters'] = 'h_filter'
412
412
413 if 'mako.directories' not in settings:
413 if 'mako.directories' not in settings:
414 mako_directories = settings.setdefault('mako.directories', [
414 mako_directories = settings.setdefault('mako.directories', [
415 # Base templates of the original application
415 # Base templates of the original application
416 'rhodecode:templates',
416 'rhodecode:templates',
417 ])
417 ])
418 log.debug(
418 log.debug(
419 "Using the following Mako template directories: %s",
419 "Using the following Mako template directories: %s",
420 mako_directories)
420 mako_directories)
421
421
422 # NOTE(marcink): fix redis requirement for schema of connection since 3.X
422 # NOTE(marcink): fix redis requirement for schema of connection since 3.X
423 if 'beaker.session.type' in settings and settings['beaker.session.type'] == 'ext:redis':
423 if 'beaker.session.type' in settings and settings['beaker.session.type'] == 'ext:redis':
424 raw_url = settings['beaker.session.url']
424 raw_url = settings['beaker.session.url']
425 if not raw_url.startswith(('redis://', 'rediss://', 'unix://')):
425 if not raw_url.startswith(('redis://', 'rediss://', 'unix://')):
426 settings['beaker.session.url'] = 'redis://' + raw_url
426 settings['beaker.session.url'] = 'redis://' + raw_url
427
427
428 # Default includes, possible to change as a user
428 # Default includes, possible to change as a user
429 pyramid_includes = settings.setdefault('pyramid.includes', [
429 pyramid_includes = settings.setdefault('pyramid.includes', [
430 'rhodecode.lib.middleware.request_wrapper',
430 'rhodecode.lib.middleware.request_wrapper',
431 ])
431 ])
432 log.debug(
432 log.debug(
433 "Using the following pyramid.includes: %s",
433 "Using the following pyramid.includes: %s",
434 pyramid_includes)
434 pyramid_includes)
435
435
436 # TODO: johbo: Re-think this, usually the call to config.include
436 # TODO: johbo: Re-think this, usually the call to config.include
437 # should allow to pass in a prefix.
437 # should allow to pass in a prefix.
438 settings.setdefault('rhodecode.api.url', '/_admin/api')
438 settings.setdefault('rhodecode.api.url', '/_admin/api')
439 settings.setdefault('__file__', global_config.get('__file__'))
439 settings.setdefault('__file__', global_config.get('__file__'))
440
440
441 # Sanitize generic settings.
441 # Sanitize generic settings.
442 _list_setting(settings, 'default_encoding', 'UTF-8')
442 _list_setting(settings, 'default_encoding', 'UTF-8')
443 _bool_setting(settings, 'is_test', 'false')
443 _bool_setting(settings, 'is_test', 'false')
444 _bool_setting(settings, 'gzip_responses', 'false')
444 _bool_setting(settings, 'gzip_responses', 'false')
445
445
446 # Call split out functions that sanitize settings for each topic.
446 # Call split out functions that sanitize settings for each topic.
447 _sanitize_appenlight_settings(settings)
447 _sanitize_appenlight_settings(settings)
448 _sanitize_vcs_settings(settings)
448 _sanitize_vcs_settings(settings)
449 _sanitize_cache_settings(settings)
449 _sanitize_cache_settings(settings)
450
450
451 # configure instance id
451 # configure instance id
452 config_utils.set_instance_id(settings)
452 config_utils.set_instance_id(settings)
453
453
454 return settings
454 return settings
455
455
456
456
457 def enable_debug():
457 def enable_debug():
458 """
458 """
459 Helper to enable debug on running instance
459 Helper to enable debug on running instance
460 :return:
460 :return:
461 """
461 """
462 import tempfile
462 import tempfile
463 import textwrap
463 import textwrap
464 import logging.config
464 import logging.config
465
465
466 ini_template = textwrap.dedent("""
466 ini_template = textwrap.dedent("""
467 #####################################
467 #####################################
468 ### DEBUG LOGGING CONFIGURATION ####
468 ### DEBUG LOGGING CONFIGURATION ####
469 #####################################
469 #####################################
470 [loggers]
470 [loggers]
471 keys = root, sqlalchemy, beaker, celery, rhodecode, ssh_wrapper
471 keys = root, sqlalchemy, beaker, celery, rhodecode, ssh_wrapper
472
472
473 [handlers]
473 [handlers]
474 keys = console, console_sql
474 keys = console, console_sql
475
475
476 [formatters]
476 [formatters]
477 keys = generic, color_formatter, color_formatter_sql
477 keys = generic, color_formatter, color_formatter_sql
478
478
479 #############
479 #############
480 ## LOGGERS ##
480 ## LOGGERS ##
481 #############
481 #############
482 [logger_root]
482 [logger_root]
483 level = NOTSET
483 level = NOTSET
484 handlers = console
484 handlers = console
485
485
486 [logger_sqlalchemy]
486 [logger_sqlalchemy]
487 level = INFO
487 level = INFO
488 handlers = console_sql
488 handlers = console_sql
489 qualname = sqlalchemy.engine
489 qualname = sqlalchemy.engine
490 propagate = 0
490 propagate = 0
491
491
492 [logger_beaker]
492 [logger_beaker]
493 level = DEBUG
493 level = DEBUG
494 handlers =
494 handlers =
495 qualname = beaker.container
495 qualname = beaker.container
496 propagate = 1
496 propagate = 1
497
497
498 [logger_rhodecode]
498 [logger_rhodecode]
499 level = DEBUG
499 level = DEBUG
500 handlers =
500 handlers =
501 qualname = rhodecode
501 qualname = rhodecode
502 propagate = 1
502 propagate = 1
503
503
504 [logger_ssh_wrapper]
504 [logger_ssh_wrapper]
505 level = DEBUG
505 level = DEBUG
506 handlers =
506 handlers =
507 qualname = ssh_wrapper
507 qualname = ssh_wrapper
508 propagate = 1
508 propagate = 1
509
509
510 [logger_celery]
510 [logger_celery]
511 level = DEBUG
511 level = DEBUG
512 handlers =
512 handlers =
513 qualname = celery
513 qualname = celery
514
514
515
515
516 ##############
516 ##############
517 ## HANDLERS ##
517 ## HANDLERS ##
518 ##############
518 ##############
519
519
520 [handler_console]
520 [handler_console]
521 class = StreamHandler
521 class = StreamHandler
522 args = (sys.stderr, )
522 args = (sys.stderr, )
523 level = DEBUG
523 level = DEBUG
524 formatter = color_formatter
524 formatter = color_formatter
525
525
526 [handler_console_sql]
526 [handler_console_sql]
527 # "level = DEBUG" logs SQL queries and results.
527 # "level = DEBUG" logs SQL queries and results.
528 # "level = INFO" logs SQL queries.
528 # "level = INFO" logs SQL queries.
529 # "level = WARN" logs neither. (Recommended for production systems.)
529 # "level = WARN" logs neither. (Recommended for production systems.)
530 class = StreamHandler
530 class = StreamHandler
531 args = (sys.stderr, )
531 args = (sys.stderr, )
532 level = WARN
532 level = WARN
533 formatter = color_formatter_sql
533 formatter = color_formatter_sql
534
534
535 ################
535 ################
536 ## FORMATTERS ##
536 ## FORMATTERS ##
537 ################
537 ################
538
538
539 [formatter_generic]
539 [formatter_generic]
540 class = rhodecode.lib.logging_formatter.ExceptionAwareFormatter
540 class = rhodecode.lib.logging_formatter.ExceptionAwareFormatter
541 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s | %(req_id)s
541 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s | %(req_id)s
542 datefmt = %Y-%m-%d %H:%M:%S
542 datefmt = %Y-%m-%d %H:%M:%S
543
543
544 [formatter_color_formatter]
544 [formatter_color_formatter]
545 class = rhodecode.lib.logging_formatter.ColorRequestTrackingFormatter
545 class = rhodecode.lib.logging_formatter.ColorRequestTrackingFormatter
546 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s | %(req_id)s
546 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s | %(req_id)s
547 datefmt = %Y-%m-%d %H:%M:%S
547 datefmt = %Y-%m-%d %H:%M:%S
548
548
549 [formatter_color_formatter_sql]
549 [formatter_color_formatter_sql]
550 class = rhodecode.lib.logging_formatter.ColorFormatterSql
550 class = rhodecode.lib.logging_formatter.ColorFormatterSql
551 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
551 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
552 datefmt = %Y-%m-%d %H:%M:%S
552 datefmt = %Y-%m-%d %H:%M:%S
553 """)
553 """)
554
554
555 with tempfile.NamedTemporaryFile(prefix='rc_debug_logging_', suffix='.ini',
555 with tempfile.NamedTemporaryFile(prefix='rc_debug_logging_', suffix='.ini',
556 delete=False) as f:
556 delete=False) as f:
557 log.info('Saved Temporary DEBUG config at %s', f.name)
557 log.info('Saved Temporary DEBUG config at %s', f.name)
558 f.write(ini_template)
558 f.write(ini_template)
559
559
560 logging.config.fileConfig(f.name)
560 logging.config.fileConfig(f.name)
561 log.debug('DEBUG MODE ON')
561 log.debug('DEBUG MODE ON')
562 os.remove(f.name)
562 os.remove(f.name)
563
563
564
564
565 def _sanitize_appenlight_settings(settings):
565 def _sanitize_appenlight_settings(settings):
566 _bool_setting(settings, 'appenlight', 'false')
566 _bool_setting(settings, 'appenlight', 'false')
567
567
568
568
569 def _sanitize_vcs_settings(settings):
569 def _sanitize_vcs_settings(settings):
570 """
570 """
571 Applies settings defaults and does type conversion for all VCS related
571 Applies settings defaults and does type conversion for all VCS related
572 settings.
572 settings.
573 """
573 """
574 _string_setting(settings, 'vcs.svn.compatible_version', '')
574 _string_setting(settings, 'vcs.svn.compatible_version', '')
575 _string_setting(settings, 'git_rev_filter', '--all')
576 _string_setting(settings, 'vcs.hooks.protocol', 'http')
575 _string_setting(settings, 'vcs.hooks.protocol', 'http')
577 _string_setting(settings, 'vcs.hooks.host', '127.0.0.1')
576 _string_setting(settings, 'vcs.hooks.host', '127.0.0.1')
578 _string_setting(settings, 'vcs.scm_app_implementation', 'http')
577 _string_setting(settings, 'vcs.scm_app_implementation', 'http')
579 _string_setting(settings, 'vcs.server', '')
578 _string_setting(settings, 'vcs.server', '')
580 _string_setting(settings, 'vcs.server.log_level', 'debug')
579 _string_setting(settings, 'vcs.server.log_level', 'debug')
581 _string_setting(settings, 'vcs.server.protocol', 'http')
580 _string_setting(settings, 'vcs.server.protocol', 'http')
582 _bool_setting(settings, 'startup.import_repos', 'false')
581 _bool_setting(settings, 'startup.import_repos', 'false')
583 _bool_setting(settings, 'vcs.hooks.direct_calls', 'false')
582 _bool_setting(settings, 'vcs.hooks.direct_calls', 'false')
584 _bool_setting(settings, 'vcs.server.enable', 'true')
583 _bool_setting(settings, 'vcs.server.enable', 'true')
585 _bool_setting(settings, 'vcs.start_server', 'false')
584 _bool_setting(settings, 'vcs.start_server', 'false')
586 _list_setting(settings, 'vcs.backends', 'hg, git, svn')
585 _list_setting(settings, 'vcs.backends', 'hg, git, svn')
587 _int_setting(settings, 'vcs.connection_timeout', 3600)
586 _int_setting(settings, 'vcs.connection_timeout', 3600)
588
587
589 # Support legacy values of vcs.scm_app_implementation. Legacy
588 # Support legacy values of vcs.scm_app_implementation. Legacy
590 # configurations may use 'rhodecode.lib.middleware.utils.scm_app_http', or
589 # configurations may use 'rhodecode.lib.middleware.utils.scm_app_http', or
591 # disabled since 4.13 'vcsserver.scm_app' which is now mapped to 'http'.
590 # disabled since 4.13 'vcsserver.scm_app' which is now mapped to 'http'.
592 scm_app_impl = settings['vcs.scm_app_implementation']
591 scm_app_impl = settings['vcs.scm_app_implementation']
593 if scm_app_impl in ['rhodecode.lib.middleware.utils.scm_app_http', 'vcsserver.scm_app']:
592 if scm_app_impl in ['rhodecode.lib.middleware.utils.scm_app_http', 'vcsserver.scm_app']:
594 settings['vcs.scm_app_implementation'] = 'http'
593 settings['vcs.scm_app_implementation'] = 'http'
595
594
596
595
597 def _sanitize_cache_settings(settings):
596 def _sanitize_cache_settings(settings):
598 temp_store = tempfile.gettempdir()
597 temp_store = tempfile.gettempdir()
599 default_cache_dir = os.path.join(temp_store, 'rc_cache')
598 default_cache_dir = os.path.join(temp_store, 'rc_cache')
600
599
601 # save default, cache dir, and use it for all backends later.
600 # save default, cache dir, and use it for all backends later.
602 default_cache_dir = _string_setting(
601 default_cache_dir = _string_setting(
603 settings,
602 settings,
604 'cache_dir',
603 'cache_dir',
605 default_cache_dir, lower=False, default_when_empty=True)
604 default_cache_dir, lower=False, default_when_empty=True)
606
605
607 # ensure we have our dir created
606 # ensure we have our dir created
608 if not os.path.isdir(default_cache_dir):
607 if not os.path.isdir(default_cache_dir):
609 os.makedirs(default_cache_dir, mode=0o755)
608 os.makedirs(default_cache_dir, mode=0o755)
610
609
611 # exception store cache
610 # exception store cache
612 _string_setting(
611 _string_setting(
613 settings,
612 settings,
614 'exception_tracker.store_path',
613 'exception_tracker.store_path',
615 temp_store, lower=False, default_when_empty=True)
614 temp_store, lower=False, default_when_empty=True)
616
615
617 # cache_perms
616 # cache_perms
618 _string_setting(
617 _string_setting(
619 settings,
618 settings,
620 'rc_cache.cache_perms.backend',
619 'rc_cache.cache_perms.backend',
621 'dogpile.cache.rc.file_namespace', lower=False)
620 'dogpile.cache.rc.file_namespace', lower=False)
622 _int_setting(
621 _int_setting(
623 settings,
622 settings,
624 'rc_cache.cache_perms.expiration_time',
623 'rc_cache.cache_perms.expiration_time',
625 60)
624 60)
626 _string_setting(
625 _string_setting(
627 settings,
626 settings,
628 'rc_cache.cache_perms.arguments.filename',
627 'rc_cache.cache_perms.arguments.filename',
629 os.path.join(default_cache_dir, 'rc_cache_1'), lower=False)
628 os.path.join(default_cache_dir, 'rc_cache_1'), lower=False)
630
629
631 # cache_repo
630 # cache_repo
632 _string_setting(
631 _string_setting(
633 settings,
632 settings,
634 'rc_cache.cache_repo.backend',
633 'rc_cache.cache_repo.backend',
635 'dogpile.cache.rc.file_namespace', lower=False)
634 'dogpile.cache.rc.file_namespace', lower=False)
636 _int_setting(
635 _int_setting(
637 settings,
636 settings,
638 'rc_cache.cache_repo.expiration_time',
637 'rc_cache.cache_repo.expiration_time',
639 60)
638 60)
640 _string_setting(
639 _string_setting(
641 settings,
640 settings,
642 'rc_cache.cache_repo.arguments.filename',
641 'rc_cache.cache_repo.arguments.filename',
643 os.path.join(default_cache_dir, 'rc_cache_2'), lower=False)
642 os.path.join(default_cache_dir, 'rc_cache_2'), lower=False)
644
643
645 # cache_license
644 # cache_license
646 _string_setting(
645 _string_setting(
647 settings,
646 settings,
648 'rc_cache.cache_license.backend',
647 'rc_cache.cache_license.backend',
649 'dogpile.cache.rc.file_namespace', lower=False)
648 'dogpile.cache.rc.file_namespace', lower=False)
650 _int_setting(
649 _int_setting(
651 settings,
650 settings,
652 'rc_cache.cache_license.expiration_time',
651 'rc_cache.cache_license.expiration_time',
653 5*60)
652 5*60)
654 _string_setting(
653 _string_setting(
655 settings,
654 settings,
656 'rc_cache.cache_license.arguments.filename',
655 'rc_cache.cache_license.arguments.filename',
657 os.path.join(default_cache_dir, 'rc_cache_3'), lower=False)
656 os.path.join(default_cache_dir, 'rc_cache_3'), lower=False)
658
657
659 # cache_repo_longterm memory, 96H
658 # cache_repo_longterm memory, 96H
660 _string_setting(
659 _string_setting(
661 settings,
660 settings,
662 'rc_cache.cache_repo_longterm.backend',
661 'rc_cache.cache_repo_longterm.backend',
663 'dogpile.cache.rc.memory_lru', lower=False)
662 'dogpile.cache.rc.memory_lru', lower=False)
664 _int_setting(
663 _int_setting(
665 settings,
664 settings,
666 'rc_cache.cache_repo_longterm.expiration_time',
665 'rc_cache.cache_repo_longterm.expiration_time',
667 345600)
666 345600)
668 _int_setting(
667 _int_setting(
669 settings,
668 settings,
670 'rc_cache.cache_repo_longterm.max_size',
669 'rc_cache.cache_repo_longterm.max_size',
671 10000)
670 10000)
672
671
673 # sql_cache_short
672 # sql_cache_short
674 _string_setting(
673 _string_setting(
675 settings,
674 settings,
676 'rc_cache.sql_cache_short.backend',
675 'rc_cache.sql_cache_short.backend',
677 'dogpile.cache.rc.memory_lru', lower=False)
676 'dogpile.cache.rc.memory_lru', lower=False)
678 _int_setting(
677 _int_setting(
679 settings,
678 settings,
680 'rc_cache.sql_cache_short.expiration_time',
679 'rc_cache.sql_cache_short.expiration_time',
681 30)
680 30)
682 _int_setting(
681 _int_setting(
683 settings,
682 settings,
684 'rc_cache.sql_cache_short.max_size',
683 'rc_cache.sql_cache_short.max_size',
685 10000)
684 10000)
686
685
687
686
688 def _int_setting(settings, name, default):
687 def _int_setting(settings, name, default):
689 settings[name] = int(settings.get(name, default))
688 settings[name] = int(settings.get(name, default))
690 return settings[name]
689 return settings[name]
691
690
692
691
693 def _bool_setting(settings, name, default):
692 def _bool_setting(settings, name, default):
694 input_val = settings.get(name, default)
693 input_val = settings.get(name, default)
695 if isinstance(input_val, unicode):
694 if isinstance(input_val, unicode):
696 input_val = input_val.encode('utf8')
695 input_val = input_val.encode('utf8')
697 settings[name] = asbool(input_val)
696 settings[name] = asbool(input_val)
698 return settings[name]
697 return settings[name]
699
698
700
699
701 def _list_setting(settings, name, default):
700 def _list_setting(settings, name, default):
702 raw_value = settings.get(name, default)
701 raw_value = settings.get(name, default)
703
702
704 old_separator = ','
703 old_separator = ','
705 if old_separator in raw_value:
704 if old_separator in raw_value:
706 # If we get a comma separated list, pass it to our own function.
705 # If we get a comma separated list, pass it to our own function.
707 settings[name] = rhodecode_aslist(raw_value, sep=old_separator)
706 settings[name] = rhodecode_aslist(raw_value, sep=old_separator)
708 else:
707 else:
709 # Otherwise we assume it uses pyramids space/newline separation.
708 # Otherwise we assume it uses pyramids space/newline separation.
710 settings[name] = aslist(raw_value)
709 settings[name] = aslist(raw_value)
711 return settings[name]
710 return settings[name]
712
711
713
712
714 def _string_setting(settings, name, default, lower=True, default_when_empty=False):
713 def _string_setting(settings, name, default, lower=True, default_when_empty=False):
715 value = settings.get(name, default)
714 value = settings.get(name, default)
716
715
717 if default_when_empty and not value:
716 if default_when_empty and not value:
718 # use default value when value is empty
717 # use default value when value is empty
719 value = default
718 value = default
720
719
721 if lower:
720 if lower:
722 value = value.lower()
721 value = value.lower()
723 settings[name] = value
722 settings[name] = value
724 return settings[name]
723 return settings[name]
725
724
726
725
727 def _substitute_values(mapping, substitutions):
726 def _substitute_values(mapping, substitutions):
728 result = {}
727 result = {}
729
728
730 try:
729 try:
731 for key, value in mapping.items():
730 for key, value in mapping.items():
732 # initialize without substitution first
731 # initialize without substitution first
733 result[key] = value
732 result[key] = value
734
733
735 # Note: Cannot use regular replacements, since they would clash
734 # Note: Cannot use regular replacements, since they would clash
736 # with the implementation of ConfigParser. Using "format" instead.
735 # with the implementation of ConfigParser. Using "format" instead.
737 try:
736 try:
738 result[key] = value.format(**substitutions)
737 result[key] = value.format(**substitutions)
739 except KeyError as e:
738 except KeyError as e:
740 env_var = '{}'.format(e.args[0])
739 env_var = '{}'.format(e.args[0])
741
740
742 msg = 'Failed to substitute: `{key}={{{var}}}` with environment entry. ' \
741 msg = 'Failed to substitute: `{key}={{{var}}}` with environment entry. ' \
743 'Make sure your environment has {var} set, or remove this ' \
742 'Make sure your environment has {var} set, or remove this ' \
744 'variable from config file'.format(key=key, var=env_var)
743 'variable from config file'.format(key=key, var=env_var)
745
744
746 if env_var.startswith('ENV_'):
745 if env_var.startswith('ENV_'):
747 raise ValueError(msg)
746 raise ValueError(msg)
748 else:
747 else:
749 log.warning(msg)
748 log.warning(msg)
750
749
751 except ValueError as e:
750 except ValueError as e:
752 log.warning('Failed to substitute ENV variable: %s', e)
751 log.warning('Failed to substitute ENV variable: %s', e)
753 result = mapping
752 result = mapping
754
753
755 return result
754 return result
@@ -1,94 +1,93 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2
2
3 # Copyright (C) 2010-2019 RhodeCode GmbH
3 # Copyright (C) 2010-2019 RhodeCode GmbH
4 #
4 #
5 # This program is free software: you can redistribute it and/or modify
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License, version 3
6 # it under the terms of the GNU Affero General Public License, version 3
7 # (only), as published by the Free Software Foundation.
7 # (only), as published by the Free Software Foundation.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU Affero General Public License
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #
16 #
17 # This program is dual-licensed. If you wish to learn more about the
17 # This program is dual-licensed. If you wish to learn more about the
18 # RhodeCode Enterprise Edition, including its added features, Support services,
18 # RhodeCode Enterprise Edition, including its added features, Support services,
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20
20
21 import os
21 import os
22 import shlex
22 import shlex
23 import platform
23 import platform
24
24
25 from rhodecode.model import init_model
25 from rhodecode.model import init_model
26
26
27
27
28 def configure_vcs(config):
28 def configure_vcs(config):
29 """
29 """
30 Patch VCS config with some RhodeCode specific stuff
30 Patch VCS config with some RhodeCode specific stuff
31 """
31 """
32 from rhodecode.lib.vcs import conf
32 from rhodecode.lib.vcs import conf
33 import rhodecode.lib.vcs.conf.settings
33 import rhodecode.lib.vcs.conf.settings
34
34
35 conf.settings.BACKENDS = {
35 conf.settings.BACKENDS = {
36 'hg': 'rhodecode.lib.vcs.backends.hg.MercurialRepository',
36 'hg': 'rhodecode.lib.vcs.backends.hg.MercurialRepository',
37 'git': 'rhodecode.lib.vcs.backends.git.GitRepository',
37 'git': 'rhodecode.lib.vcs.backends.git.GitRepository',
38 'svn': 'rhodecode.lib.vcs.backends.svn.SubversionRepository',
38 'svn': 'rhodecode.lib.vcs.backends.svn.SubversionRepository',
39 }
39 }
40
40
41 conf.settings.HOOKS_PROTOCOL = config['vcs.hooks.protocol']
41 conf.settings.HOOKS_PROTOCOL = config['vcs.hooks.protocol']
42 conf.settings.HOOKS_HOST = config['vcs.hooks.host']
42 conf.settings.HOOKS_HOST = config['vcs.hooks.host']
43 conf.settings.HOOKS_DIRECT_CALLS = config['vcs.hooks.direct_calls']
43 conf.settings.HOOKS_DIRECT_CALLS = config['vcs.hooks.direct_calls']
44 conf.settings.GIT_REV_FILTER = shlex.split(config['git_rev_filter'])
45 conf.settings.DEFAULT_ENCODINGS = config['default_encoding']
44 conf.settings.DEFAULT_ENCODINGS = config['default_encoding']
46 conf.settings.ALIASES[:] = config['vcs.backends']
45 conf.settings.ALIASES[:] = config['vcs.backends']
47 conf.settings.SVN_COMPATIBLE_VERSION = config['vcs.svn.compatible_version']
46 conf.settings.SVN_COMPATIBLE_VERSION = config['vcs.svn.compatible_version']
48
47
49
48
50 def initialize_database(config):
49 def initialize_database(config):
51 from rhodecode.lib.utils2 import engine_from_config, get_encryption_key
50 from rhodecode.lib.utils2 import engine_from_config, get_encryption_key
52 engine = engine_from_config(config, 'sqlalchemy.db1.')
51 engine = engine_from_config(config, 'sqlalchemy.db1.')
53 init_model(engine, encryption_key=get_encryption_key(config))
52 init_model(engine, encryption_key=get_encryption_key(config))
54
53
55
54
56 def initialize_test_environment(settings, test_env=None):
55 def initialize_test_environment(settings, test_env=None):
57 if test_env is None:
56 if test_env is None:
58 test_env = not int(os.environ.get('RC_NO_TMP_PATH', 0))
57 test_env = not int(os.environ.get('RC_NO_TMP_PATH', 0))
59
58
60 from rhodecode.lib.utils import (
59 from rhodecode.lib.utils import (
61 create_test_directory, create_test_database, create_test_repositories,
60 create_test_directory, create_test_database, create_test_repositories,
62 create_test_index)
61 create_test_index)
63 from rhodecode.tests import TESTS_TMP_PATH
62 from rhodecode.tests import TESTS_TMP_PATH
64 from rhodecode.lib.vcs.backends.hg import largefiles_store
63 from rhodecode.lib.vcs.backends.hg import largefiles_store
65 from rhodecode.lib.vcs.backends.git import lfs_store
64 from rhodecode.lib.vcs.backends.git import lfs_store
66
65
67 # test repos
66 # test repos
68 if test_env:
67 if test_env:
69 create_test_directory(TESTS_TMP_PATH)
68 create_test_directory(TESTS_TMP_PATH)
70 # large object stores
69 # large object stores
71 create_test_directory(largefiles_store(TESTS_TMP_PATH))
70 create_test_directory(largefiles_store(TESTS_TMP_PATH))
72 create_test_directory(lfs_store(TESTS_TMP_PATH))
71 create_test_directory(lfs_store(TESTS_TMP_PATH))
73
72
74 create_test_database(TESTS_TMP_PATH, settings)
73 create_test_database(TESTS_TMP_PATH, settings)
75 create_test_repositories(TESTS_TMP_PATH, settings)
74 create_test_repositories(TESTS_TMP_PATH, settings)
76 create_test_index(TESTS_TMP_PATH, settings)
75 create_test_index(TESTS_TMP_PATH, settings)
77
76
78
77
79 def get_vcs_server_protocol(config):
78 def get_vcs_server_protocol(config):
80 return config['vcs.server.protocol']
79 return config['vcs.server.protocol']
81
80
82
81
83 def set_instance_id(config):
82 def set_instance_id(config):
84 """
83 """
85 Sets a dynamic generated config['instance_id'] if missing or '*'
84 Sets a dynamic generated config['instance_id'] if missing or '*'
86 E.g instance_id = *cluster-1 or instance_id = *
85 E.g instance_id = *cluster-1 or instance_id = *
87 """
86 """
88
87
89 config['instance_id'] = config.get('instance_id') or ''
88 config['instance_id'] = config.get('instance_id') or ''
90 instance_id = config['instance_id']
89 instance_id = config['instance_id']
91 if instance_id.startswith('*') or not instance_id:
90 if instance_id.startswith('*') or not instance_id:
92 prefix = instance_id.lstrip('*')
91 prefix = instance_id.lstrip('*')
93 _platform_id = platform.uname()[1] or 'instance'
92 _platform_id = platform.uname()[1] or 'instance'
94 config['instance_id'] = '%s%s-%s' % (prefix, _platform_id, os.getpid())
93 config['instance_id'] = '%s%s-%s' % (prefix, _platform_id, os.getpid())
@@ -1,79 +1,76 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2
2
3 # Copyright (C) 2014-2019 RhodeCode GmbH
3 # Copyright (C) 2014-2019 RhodeCode GmbH
4 #
4 #
5 # This program is free software: you can redistribute it and/or modify
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License, version 3
6 # it under the terms of the GNU Affero General Public License, version 3
7 # (only), as published by the Free Software Foundation.
7 # (only), as published by the Free Software Foundation.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU Affero General Public License
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #
16 #
17 # This program is dual-licensed. If you wish to learn more about the
17 # This program is dual-licensed. If you wish to learn more about the
18 # RhodeCode Enterprise Edition, including its added features, Support services,
18 # RhodeCode Enterprise Edition, including its added features, Support services,
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20
20
21 """
21 """
22 Internal settings for vcs-lib
22 Internal settings for vcs-lib
23 """
23 """
24
24
25 # list of default encoding used in safe_unicode/safe_str methods
25 # list of default encoding used in safe_unicode/safe_str methods
26 DEFAULT_ENCODINGS = ['utf8']
26 DEFAULT_ENCODINGS = ['utf8']
27
27
28 # Optional arguments to rev-filter, it has to be a list
29 # It can also be ['--branches', '--tags']
30 GIT_REV_FILTER = ['--all']
31
28
32 # Compatibility version when creating SVN repositories. None means newest.
29 # Compatibility version when creating SVN repositories. None means newest.
33 # Other available options are: pre-1.4-compatible, pre-1.5-compatible,
30 # Other available options are: pre-1.4-compatible, pre-1.5-compatible,
34 # pre-1.6-compatible, pre-1.8-compatible
31 # pre-1.6-compatible, pre-1.8-compatible
35 SVN_COMPATIBLE_VERSION = None
32 SVN_COMPATIBLE_VERSION = None
36
33
37 ALIASES = ['hg', 'git', 'svn']
34 ALIASES = ['hg', 'git', 'svn']
38
35
39 BACKENDS = {
36 BACKENDS = {
40 'hg': 'rhodecode.lib.vcs.backends.hg.MercurialRepository',
37 'hg': 'rhodecode.lib.vcs.backends.hg.MercurialRepository',
41 'git': 'rhodecode.lib.vcs.backends.git.GitRepository',
38 'git': 'rhodecode.lib.vcs.backends.git.GitRepository',
42 'svn': 'rhodecode.lib.vcs.backends.svn.SubversionRepository',
39 'svn': 'rhodecode.lib.vcs.backends.svn.SubversionRepository',
43 }
40 }
44
41
45
42
46 ARCHIVE_SPECS = [
43 ARCHIVE_SPECS = [
47 ('tbz2', 'application/x-bzip2', 'tbz2'),
44 ('tbz2', 'application/x-bzip2', 'tbz2'),
48 ('tbz2', 'application/x-bzip2', '.tar.bz2'),
45 ('tbz2', 'application/x-bzip2', '.tar.bz2'),
49
46
50 ('tgz', 'application/x-gzip', '.tgz'),
47 ('tgz', 'application/x-gzip', '.tgz'),
51 ('tgz', 'application/x-gzip', '.tar.gz'),
48 ('tgz', 'application/x-gzip', '.tar.gz'),
52
49
53 ('zip', 'application/zip', '.zip'),
50 ('zip', 'application/zip', '.zip'),
54 ]
51 ]
55
52
56 HOOKS_PROTOCOL = None
53 HOOKS_PROTOCOL = None
57 HOOKS_DIRECT_CALLS = False
54 HOOKS_DIRECT_CALLS = False
58 HOOKS_HOST = '127.0.0.1'
55 HOOKS_HOST = '127.0.0.1'
59
56
60
57
61 MERGE_MESSAGE_TMPL = (
58 MERGE_MESSAGE_TMPL = (
62 u'Merge pull request #{pr_id} from {source_repo} {source_ref_name}\n\n '
59 u'Merge pull request #{pr_id} from {source_repo} {source_ref_name}\n\n '
63 u'{pr_title}')
60 u'{pr_title}')
64 MERGE_DRY_RUN_MESSAGE = 'dry_run_merge_message_from_rhodecode'
61 MERGE_DRY_RUN_MESSAGE = 'dry_run_merge_message_from_rhodecode'
65 MERGE_DRY_RUN_USER = 'Dry-Run User'
62 MERGE_DRY_RUN_USER = 'Dry-Run User'
66 MERGE_DRY_RUN_EMAIL = 'dry-run-merge@rhodecode.com'
63 MERGE_DRY_RUN_EMAIL = 'dry-run-merge@rhodecode.com'
67
64
68
65
69 def available_aliases():
66 def available_aliases():
70 """
67 """
71 Mercurial is required for the system to work, so in case vcs.backends does
68 Mercurial is required for the system to work, so in case vcs.backends does
72 not include it, we make sure it will be available internally
69 not include it, we make sure it will be available internally
73 TODO: anderson: refactor vcs.backends so it won't be necessary, VCS server
70 TODO: anderson: refactor vcs.backends so it won't be necessary, VCS server
74 should be responsible to dictate available backends.
71 should be responsible to dictate available backends.
75 """
72 """
76 aliases = ALIASES[:]
73 aliases = ALIASES[:]
77 if 'hg' not in aliases:
74 if 'hg' not in aliases:
78 aliases += ['hg']
75 aliases += ['hg']
79 return aliases
76 return aliases
@@ -1,205 +1,204 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2
2
3 # Copyright (C) 2016-2019 RhodeCode GmbH
3 # Copyright (C) 2016-2019 RhodeCode GmbH
4 #
4 #
5 # This program is free software: you can redistribute it and/or modify
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License, version 3
6 # it under the terms of the GNU Affero General Public License, version 3
7 # (only), as published by the Free Software Foundation.
7 # (only), as published by the Free Software Foundation.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU Affero General Public License
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #
16 #
17 # This program is dual-licensed. If you wish to learn more about the
17 # This program is dual-licensed. If you wish to learn more about the
18 # RhodeCode Enterprise Edition, including its added features, Support services,
18 # RhodeCode Enterprise Edition, including its added features, Support services,
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20
20
21
21
22 import pytest
22 import pytest
23
23
24 from rhodecode.tests import no_newline_id_generator
24 from rhodecode.tests import no_newline_id_generator
25 from rhodecode.config.middleware import (
25 from rhodecode.config.middleware import (
26 _sanitize_vcs_settings, _bool_setting, _string_setting, _list_setting,
26 _sanitize_vcs_settings, _bool_setting, _string_setting, _list_setting,
27 _int_setting)
27 _int_setting)
28
28
29
29
30 class TestHelperFunctions(object):
30 class TestHelperFunctions(object):
31 @pytest.mark.parametrize('raw, expected', [
31 @pytest.mark.parametrize('raw, expected', [
32 ('true', True), (u'true', True),
32 ('true', True), (u'true', True),
33 ('yes', True), (u'yes', True),
33 ('yes', True), (u'yes', True),
34 ('on', True), (u'on', True),
34 ('on', True), (u'on', True),
35 ('false', False), (u'false', False),
35 ('false', False), (u'false', False),
36 ('no', False), (u'no', False),
36 ('no', False), (u'no', False),
37 ('off', False), (u'off', False),
37 ('off', False), (u'off', False),
38 ('invalid-bool-value', False),
38 ('invalid-bool-value', False),
39 ('invalid-∫øø@-√Γ₯@¨€', False),
39 ('invalid-∫øø@-√Γ₯@¨€', False),
40 (u'invalid-∫øø@-√Γ₯@¨€', False),
40 (u'invalid-∫øø@-√Γ₯@¨€', False),
41 ])
41 ])
42 def test_bool_setting_helper(self, raw, expected):
42 def test_bool_setting_helper(self, raw, expected):
43 key = 'dummy-key'
43 key = 'dummy-key'
44 settings = {key: raw}
44 settings = {key: raw}
45 _bool_setting(settings, key, None)
45 _bool_setting(settings, key, None)
46 assert settings[key] is expected
46 assert settings[key] is expected
47
47
48 @pytest.mark.parametrize('raw, expected', [
48 @pytest.mark.parametrize('raw, expected', [
49 ('', ''),
49 ('', ''),
50 ('test-string', 'test-string'),
50 ('test-string', 'test-string'),
51 ('CaSe-TeSt', 'case-test'),
51 ('CaSe-TeSt', 'case-test'),
52 ('test-string-烩€', 'test-string-烩€'),
52 ('test-string-烩€', 'test-string-烩€'),
53 (u'test-string-烩€', u'test-string-烩€'),
53 (u'test-string-烩€', u'test-string-烩€'),
54 ])
54 ])
55 def test_string_setting_helper(self, raw, expected):
55 def test_string_setting_helper(self, raw, expected):
56 key = 'dummy-key'
56 key = 'dummy-key'
57 settings = {key: raw}
57 settings = {key: raw}
58 _string_setting(settings, key, None)
58 _string_setting(settings, key, None)
59 assert settings[key] == expected
59 assert settings[key] == expected
60
60
61 @pytest.mark.parametrize('raw, expected', [
61 @pytest.mark.parametrize('raw, expected', [
62 ('', []),
62 ('', []),
63 ('test', ['test']),
63 ('test', ['test']),
64 ('CaSe-TeSt', ['CaSe-TeSt']),
64 ('CaSe-TeSt', ['CaSe-TeSt']),
65 ('test-string-烩€', ['test-string-烩€']),
65 ('test-string-烩€', ['test-string-烩€']),
66 (u'test-string-烩€', [u'test-string-烩€']),
66 (u'test-string-烩€', [u'test-string-烩€']),
67 ('hg git svn', ['hg', 'git', 'svn']),
67 ('hg git svn', ['hg', 'git', 'svn']),
68 ('hg,git,svn', ['hg', 'git', 'svn']),
68 ('hg,git,svn', ['hg', 'git', 'svn']),
69 ('hg, git, svn', ['hg', 'git', 'svn']),
69 ('hg, git, svn', ['hg', 'git', 'svn']),
70 ('hg\ngit\nsvn', ['hg', 'git', 'svn']),
70 ('hg\ngit\nsvn', ['hg', 'git', 'svn']),
71 (' hg\n git\n svn ', ['hg', 'git', 'svn']),
71 (' hg\n git\n svn ', ['hg', 'git', 'svn']),
72 (', hg , git , svn , ', ['', 'hg', 'git', 'svn', '']),
72 (', hg , git , svn , ', ['', 'hg', 'git', 'svn', '']),
73 ('cheese,free node,other', ['cheese', 'free node', 'other']),
73 ('cheese,free node,other', ['cheese', 'free node', 'other']),
74 ], ids=no_newline_id_generator)
74 ], ids=no_newline_id_generator)
75 def test_list_setting_helper(self, raw, expected):
75 def test_list_setting_helper(self, raw, expected):
76 key = 'dummy-key'
76 key = 'dummy-key'
77 settings = {key: raw}
77 settings = {key: raw}
78 _list_setting(settings, key, None)
78 _list_setting(settings, key, None)
79 assert settings[key] == expected
79 assert settings[key] == expected
80
80
81 @pytest.mark.parametrize('raw, expected', [
81 @pytest.mark.parametrize('raw, expected', [
82 ('0', 0),
82 ('0', 0),
83 ('-0', 0),
83 ('-0', 0),
84 ('12345', 12345),
84 ('12345', 12345),
85 ('-12345', -12345),
85 ('-12345', -12345),
86 (u'-12345', -12345),
86 (u'-12345', -12345),
87 ])
87 ])
88 def test_int_setting_helper(self, raw, expected):
88 def test_int_setting_helper(self, raw, expected):
89 key = 'dummy-key'
89 key = 'dummy-key'
90 settings = {key: raw}
90 settings = {key: raw}
91 _int_setting(settings, key, None)
91 _int_setting(settings, key, None)
92 assert settings[key] == expected
92 assert settings[key] == expected
93
93
94 @pytest.mark.parametrize('raw', [
94 @pytest.mark.parametrize('raw', [
95 ('0xff'),
95 ('0xff'),
96 (''),
96 (''),
97 ('invalid-int'),
97 ('invalid-int'),
98 ('invalid-⁄~†'),
98 ('invalid-⁄~†'),
99 (u'invalid-⁄~†'),
99 (u'invalid-⁄~†'),
100 ])
100 ])
101 def test_int_setting_helper_invalid_input(self, raw):
101 def test_int_setting_helper_invalid_input(self, raw):
102 key = 'dummy-key'
102 key = 'dummy-key'
103 settings = {key: raw}
103 settings = {key: raw}
104 with pytest.raises(Exception):
104 with pytest.raises(Exception):
105 _int_setting(settings, key, None)
105 _int_setting(settings, key, None)
106
106
107
107
108 class TestSanitizeVcsSettings(object):
108 class TestSanitizeVcsSettings(object):
109 _bool_settings = [
109 _bool_settings = [
110 ('vcs.hooks.direct_calls', False),
110 ('vcs.hooks.direct_calls', False),
111 ('vcs.server.enable', True),
111 ('vcs.server.enable', True),
112 ('vcs.start_server', False),
112 ('vcs.start_server', False),
113 ('startup.import_repos', False),
113 ('startup.import_repos', False),
114 ]
114 ]
115
115
116 _string_settings = [
116 _string_settings = [
117 ('vcs.svn.compatible_version', ''),
117 ('vcs.svn.compatible_version', ''),
118 ('git_rev_filter', '--all'),
119 ('vcs.hooks.protocol', 'http'),
118 ('vcs.hooks.protocol', 'http'),
120 ('vcs.hooks.host', '127.0.0.1'),
119 ('vcs.hooks.host', '127.0.0.1'),
121 ('vcs.scm_app_implementation', 'http'),
120 ('vcs.scm_app_implementation', 'http'),
122 ('vcs.server', ''),
121 ('vcs.server', ''),
123 ('vcs.server.log_level', 'debug'),
122 ('vcs.server.log_level', 'debug'),
124 ('vcs.server.protocol', 'http'),
123 ('vcs.server.protocol', 'http'),
125 ]
124 ]
126
125
127 _list_settings = [
126 _list_settings = [
128 ('vcs.backends', 'hg git'),
127 ('vcs.backends', 'hg git'),
129 ]
128 ]
130
129
131 @pytest.mark.parametrize('key, default', _list_settings)
130 @pytest.mark.parametrize('key, default', _list_settings)
132 def test_list_setting_spacesep_list(self, key, default):
131 def test_list_setting_spacesep_list(self, key, default):
133 test_list = ['test', 'list', 'values', 'for', key]
132 test_list = ['test', 'list', 'values', 'for', key]
134 input_value = ' '.join(test_list)
133 input_value = ' '.join(test_list)
135 settings = {key: input_value}
134 settings = {key: input_value}
136 _sanitize_vcs_settings(settings)
135 _sanitize_vcs_settings(settings)
137 assert settings[key] == test_list
136 assert settings[key] == test_list
138
137
139 @pytest.mark.parametrize('key, default', _list_settings)
138 @pytest.mark.parametrize('key, default', _list_settings)
140 def test_list_setting_newlinesep_list(self, key, default):
139 def test_list_setting_newlinesep_list(self, key, default):
141 test_list = ['test', 'list', 'values', 'for', key]
140 test_list = ['test', 'list', 'values', 'for', key]
142 input_value = '\n'.join(test_list)
141 input_value = '\n'.join(test_list)
143 settings = {key: input_value}
142 settings = {key: input_value}
144 _sanitize_vcs_settings(settings)
143 _sanitize_vcs_settings(settings)
145 assert settings[key] == test_list
144 assert settings[key] == test_list
146
145
147 @pytest.mark.parametrize('key, default', _list_settings)
146 @pytest.mark.parametrize('key, default', _list_settings)
148 def test_list_setting_commasep_list(self, key, default):
147 def test_list_setting_commasep_list(self, key, default):
149 test_list = ['test', 'list', 'values', 'for', key]
148 test_list = ['test', 'list', 'values', 'for', key]
150 input_value = ','.join(test_list)
149 input_value = ','.join(test_list)
151 settings = {key: input_value}
150 settings = {key: input_value}
152 _sanitize_vcs_settings(settings)
151 _sanitize_vcs_settings(settings)
153 assert settings[key] == test_list
152 assert settings[key] == test_list
154
153
155 @pytest.mark.parametrize('key, default', _list_settings)
154 @pytest.mark.parametrize('key, default', _list_settings)
156 def test_list_setting_comma_and_space_sep_list(self, key, default):
155 def test_list_setting_comma_and_space_sep_list(self, key, default):
157 test_list = ['test', 'list', 'values', 'for', key]
156 test_list = ['test', 'list', 'values', 'for', key]
158 input_value = ', '.join(test_list)
157 input_value = ', '.join(test_list)
159 settings = {key: input_value}
158 settings = {key: input_value}
160 _sanitize_vcs_settings(settings)
159 _sanitize_vcs_settings(settings)
161 assert settings[key] == test_list
160 assert settings[key] == test_list
162
161
163 @pytest.mark.parametrize('key, default', _string_settings)
162 @pytest.mark.parametrize('key, default', _string_settings)
164 def test_string_setting_string(self, key, default):
163 def test_string_setting_string(self, key, default):
165 test_value = 'test-string-for-{}'.format(key)
164 test_value = 'test-string-for-{}'.format(key)
166 settings = {key: test_value}
165 settings = {key: test_value}
167 _sanitize_vcs_settings(settings)
166 _sanitize_vcs_settings(settings)
168 assert settings[key] == test_value
167 assert settings[key] == test_value
169
168
170 @pytest.mark.parametrize('key, default', _string_settings)
169 @pytest.mark.parametrize('key, default', _string_settings)
171 def test_string_setting_default(self, key, default):
170 def test_string_setting_default(self, key, default):
172 settings = {}
171 settings = {}
173 _sanitize_vcs_settings(settings)
172 _sanitize_vcs_settings(settings)
174 assert settings[key] == default
173 assert settings[key] == default
175
174
176 @pytest.mark.parametrize('key, default', _string_settings)
175 @pytest.mark.parametrize('key, default', _string_settings)
177 def test_string_setting_lowercase(self, key, default):
176 def test_string_setting_lowercase(self, key, default):
178 test_value = 'Test-String-For-{}'.format(key)
177 test_value = 'Test-String-For-{}'.format(key)
179 settings = {key: test_value}
178 settings = {key: test_value}
180 _sanitize_vcs_settings(settings)
179 _sanitize_vcs_settings(settings)
181 assert settings[key] == test_value.lower()
180 assert settings[key] == test_value.lower()
182
181
183 @pytest.mark.parametrize('key, default', _bool_settings)
182 @pytest.mark.parametrize('key, default', _bool_settings)
184 def test_bool_setting_true(self, key, default):
183 def test_bool_setting_true(self, key, default):
185 settings = {key: 'true'}
184 settings = {key: 'true'}
186 _sanitize_vcs_settings(settings)
185 _sanitize_vcs_settings(settings)
187 assert settings[key] is True
186 assert settings[key] is True
188
187
189 @pytest.mark.parametrize('key, default', _bool_settings)
188 @pytest.mark.parametrize('key, default', _bool_settings)
190 def test_bool_setting_false(self, key, default):
189 def test_bool_setting_false(self, key, default):
191 settings = {key: 'false'}
190 settings = {key: 'false'}
192 _sanitize_vcs_settings(settings)
191 _sanitize_vcs_settings(settings)
193 assert settings[key] is False
192 assert settings[key] is False
194
193
195 @pytest.mark.parametrize('key, default', _bool_settings)
194 @pytest.mark.parametrize('key, default', _bool_settings)
196 def test_bool_setting_invalid_string(self, key, default):
195 def test_bool_setting_invalid_string(self, key, default):
197 settings = {key: 'no-bool-val-string'}
196 settings = {key: 'no-bool-val-string'}
198 _sanitize_vcs_settings(settings)
197 _sanitize_vcs_settings(settings)
199 assert settings[key] is False
198 assert settings[key] is False
200
199
201 @pytest.mark.parametrize('key, default', _bool_settings)
200 @pytest.mark.parametrize('key, default', _bool_settings)
202 def test_bool_setting_default(self, key, default):
201 def test_bool_setting_default(self, key, default):
203 settings = {}
202 settings = {}
204 _sanitize_vcs_settings(settings)
203 _sanitize_vcs_settings(settings)
205 assert settings[key] is default
204 assert settings[key] is default
@@ -1,669 +1,665 b''
1
1
2
2
3 ################################################################################
3 ################################################################################
4 ## RHODECODE COMMUNITY EDITION CONFIGURATION ##
4 ## RHODECODE COMMUNITY EDITION CONFIGURATION ##
5 # The %(here)s variable will be replaced with the parent directory of this file#
5 # The %(here)s variable will be replaced with the parent directory of this file#
6 ################################################################################
6 ################################################################################
7
7
8 [DEFAULT]
8 [DEFAULT]
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 ## Uncomment and replace with the address which should receive any error report
24 ## Uncomment and replace with the address which should receive any error report
25 ## note: using appenlight for error handling doesn't need this to be uncommented
25 ## note: using appenlight for error handling doesn't need this to be uncommented
26 #email_to = admin@localhost
26 #email_to = admin@localhost
27
27
28 #smtp_server = mail.server.com
28 #smtp_server = mail.server.com
29 #smtp_username =
29 #smtp_username =
30 #smtp_password =
30 #smtp_password =
31 #smtp_port =
31 #smtp_port =
32 #smtp_use_tls = false
32 #smtp_use_tls = false
33 #smtp_use_ssl = true
33 #smtp_use_ssl = true
34
34
35 [server:main]
35 [server:main]
36 ## COMMON ##
36 ## COMMON ##
37 host = 0.0.0.0
37 host = 0.0.0.0
38 port = 5000
38 port = 5000
39
39
40 ##########################
40 ##########################
41 ## GUNICORN WSGI SERVER ##
41 ## GUNICORN WSGI SERVER ##
42 ##########################
42 ##########################
43 ## run with gunicorn --log-config rhodecode.ini --paste rhodecode.ini
43 ## run with gunicorn --log-config rhodecode.ini --paste rhodecode.ini
44
44
45 use = egg:gunicorn#main
45 use = egg:gunicorn#main
46 ## Sets the number of process workers. You must set `instance_id = *`
46 ## Sets the number of process workers. You must set `instance_id = *`
47 ## when this option is set to more than one worker, recommended
47 ## when this option is set to more than one worker, recommended
48 ## value is (2 * NUMBER_OF_CPUS + 1), eg 2CPU = 5 workers
48 ## value is (2 * NUMBER_OF_CPUS + 1), eg 2CPU = 5 workers
49 ## The `instance_id = *` must be set in the [app:main] section below
49 ## The `instance_id = *` must be set in the [app:main] section below
50 #workers = 2
50 #workers = 2
51 ## number of threads for each of the worker, must be set to 1 for gevent
51 ## number of threads for each of the worker, must be set to 1 for gevent
52 ## generally recommened to be at 1
52 ## generally recommened to be at 1
53 #threads = 1
53 #threads = 1
54 ## process name
54 ## process name
55 #proc_name = rhodecode
55 #proc_name = rhodecode
56 ## type of worker class, one of sync, gevent
56 ## type of worker class, one of sync, gevent
57 ## recommended for bigger setup is using of of other than sync one
57 ## recommended for bigger setup is using of of other than sync one
58 #worker_class = sync
58 #worker_class = sync
59 ## The maximum number of simultaneous clients. Valid only for Gevent
59 ## The maximum number of simultaneous clients. Valid only for Gevent
60 #worker_connections = 10
60 #worker_connections = 10
61 ## max number of requests that worker will handle before being gracefully
61 ## max number of requests that worker will handle before being gracefully
62 ## restarted, could prevent memory leaks
62 ## restarted, could prevent memory leaks
63 #max_requests = 1000
63 #max_requests = 1000
64 #max_requests_jitter = 30
64 #max_requests_jitter = 30
65 ## amount of time a worker can spend with handling a request before it
65 ## amount of time a worker can spend with handling a request before it
66 ## gets killed and restarted. Set to 6hrs
66 ## gets killed and restarted. Set to 6hrs
67 #timeout = 21600
67 #timeout = 21600
68
68
69 ## prefix middleware for RhodeCode.
69 ## prefix middleware for RhodeCode.
70 ## recommended when using proxy setup.
70 ## recommended when using proxy setup.
71 ## allows to set RhodeCode under a prefix in server.
71 ## allows to set RhodeCode under a prefix in server.
72 ## eg https://server.com/custom_prefix. Enable `filter-with =` option below as well.
72 ## eg https://server.com/custom_prefix. Enable `filter-with =` option below as well.
73 ## And set your prefix like: `prefix = /custom_prefix`
73 ## And set your prefix like: `prefix = /custom_prefix`
74 ## be sure to also set beaker.session.cookie_path = /custom_prefix if you need
74 ## be sure to also set beaker.session.cookie_path = /custom_prefix if you need
75 ## to make your cookies only work on prefix url
75 ## to make your cookies only work on prefix url
76 [filter:proxy-prefix]
76 [filter:proxy-prefix]
77 use = egg:PasteDeploy#prefix
77 use = egg:PasteDeploy#prefix
78 prefix = /
78 prefix = /
79
79
80 [app:main]
80 [app:main]
81 is_test = True
81 is_test = True
82 use = egg:rhodecode-enterprise-ce
82 use = egg:rhodecode-enterprise-ce
83
83
84 ## enable proxy prefix middleware, defined above
84 ## enable proxy prefix middleware, defined above
85 #filter-with = proxy-prefix
85 #filter-with = proxy-prefix
86
86
87
87
88 ## RHODECODE PLUGINS ##
88 ## RHODECODE PLUGINS ##
89 rhodecode.includes = rhodecode.api
89 rhodecode.includes = rhodecode.api
90
90
91 # api prefix url
91 # api prefix url
92 rhodecode.api.url = /_admin/api
92 rhodecode.api.url = /_admin/api
93
93
94
94
95 ## END RHODECODE PLUGINS ##
95 ## END RHODECODE PLUGINS ##
96
96
97 ## encryption key used to encrypt social plugin tokens,
97 ## encryption key used to encrypt social plugin tokens,
98 ## remote_urls with credentials etc, if not set it defaults to
98 ## remote_urls with credentials etc, if not set it defaults to
99 ## `beaker.session.secret`
99 ## `beaker.session.secret`
100 #rhodecode.encrypted_values.secret =
100 #rhodecode.encrypted_values.secret =
101
101
102 ## decryption strict mode (enabled by default). It controls if decryption raises
102 ## decryption strict mode (enabled by default). It controls if decryption raises
103 ## `SignatureVerificationError` in case of wrong key, or damaged encryption data.
103 ## `SignatureVerificationError` in case of wrong key, or damaged encryption data.
104 #rhodecode.encrypted_values.strict = false
104 #rhodecode.encrypted_values.strict = false
105
105
106 ## return gzipped responses from Rhodecode (static files/application)
106 ## return gzipped responses from Rhodecode (static files/application)
107 gzip_responses = false
107 gzip_responses = false
108
108
109 ## autogenerate javascript routes file on startup
109 ## autogenerate javascript routes file on startup
110 generate_js_files = false
110 generate_js_files = false
111
111
112 ## Optional Languages
112 ## Optional Languages
113 ## en(default), be, de, es, fr, it, ja, pl, pt, ru, zh
113 ## en(default), be, de, es, fr, it, ja, pl, pt, ru, zh
114 lang = en
114 lang = en
115
115
116 ## perform a full repository scan on each server start, this should be
116 ## perform a full repository scan on each server start, this should be
117 ## set to false after first startup, to allow faster server restarts.
117 ## set to false after first startup, to allow faster server restarts.
118 startup.import_repos = true
118 startup.import_repos = true
119
119
120 ## Uncomment and set this path to use archive download cache.
120 ## Uncomment and set this path to use archive download cache.
121 ## Once enabled, generated archives will be cached at this location
121 ## Once enabled, generated archives will be cached at this location
122 ## and served from the cache during subsequent requests for the same archive of
122 ## and served from the cache during subsequent requests for the same archive of
123 ## the repository.
123 ## the repository.
124 #archive_cache_dir = /tmp/tarballcache
124 #archive_cache_dir = /tmp/tarballcache
125
125
126 ## URL at which the application is running. This is used for bootstraping
126 ## URL at which the application is running. This is used for bootstraping
127 ## requests in context when no web request is available. Used in ishell, or
127 ## requests in context when no web request is available. Used in ishell, or
128 ## SSH calls. Set this for events to receive proper url for SSH calls.
128 ## SSH calls. Set this for events to receive proper url for SSH calls.
129 app.base_url = http://rhodecode.local
129 app.base_url = http://rhodecode.local
130
130
131 ## change this to unique ID for security
131 ## change this to unique ID for security
132 app_instance_uuid = rc-production
132 app_instance_uuid = rc-production
133
133
134 ## cut off limit for large diffs (size in bytes)
134 ## cut off limit for large diffs (size in bytes)
135 cut_off_limit_diff = 1024000
135 cut_off_limit_diff = 1024000
136 cut_off_limit_file = 256000
136 cut_off_limit_file = 256000
137
137
138 ## use cache version of scm repo everywhere
138 ## use cache version of scm repo everywhere
139 vcs_full_cache = false
139 vcs_full_cache = false
140
140
141 ## force https in RhodeCode, fixes https redirects, assumes it's always https
141 ## force https in RhodeCode, fixes https redirects, assumes it's always https
142 ## Normally this is controlled by proper http flags sent from http server
142 ## Normally this is controlled by proper http flags sent from http server
143 force_https = false
143 force_https = false
144
144
145 ## use Strict-Transport-Security headers
145 ## use Strict-Transport-Security headers
146 use_htsts = false
146 use_htsts = false
147
147
148 ## git rev filter option, --all is the default filter, if you need to
149 ## hide all refs in changelog switch this to --branches --tags
150 git_rev_filter = --all
151
152 # Set to true if your repos are exposed using the dumb protocol
148 # Set to true if your repos are exposed using the dumb protocol
153 git_update_server_info = false
149 git_update_server_info = false
154
150
155 ## RSS/ATOM feed options
151 ## RSS/ATOM feed options
156 rss_cut_off_limit = 256000
152 rss_cut_off_limit = 256000
157 rss_items_per_page = 10
153 rss_items_per_page = 10
158 rss_include_diff = false
154 rss_include_diff = false
159
155
160 ## gist URL alias, used to create nicer urls for gist. This should be an
156 ## gist URL alias, used to create nicer urls for gist. This should be an
161 ## url that does rewrites to _admin/gists/{gistid}.
157 ## url that does rewrites to _admin/gists/{gistid}.
162 ## example: http://gist.rhodecode.org/{gistid}. Empty means use the internal
158 ## example: http://gist.rhodecode.org/{gistid}. Empty means use the internal
163 ## RhodeCode url, ie. http[s]://rhodecode.server/_admin/gists/{gistid}
159 ## RhodeCode url, ie. http[s]://rhodecode.server/_admin/gists/{gistid}
164 gist_alias_url =
160 gist_alias_url =
165
161
166 ## List of views (using glob pattern syntax) that AUTH TOKENS could be
162 ## List of views (using glob pattern syntax) that AUTH TOKENS could be
167 ## used for access.
163 ## used for access.
168 ## Adding ?auth_token=TOKEN_HASH to the url authenticates this request as if it
164 ## Adding ?auth_token=TOKEN_HASH to the url authenticates this request as if it
169 ## came from the the logged in user who own this authentication token.
165 ## came from the the logged in user who own this authentication token.
170 ## Additionally @TOKEN syntaxt can be used to bound the view to specific
166 ## Additionally @TOKEN syntaxt can be used to bound the view to specific
171 ## authentication token. Such view would be only accessible when used together
167 ## authentication token. Such view would be only accessible when used together
172 ## with this authentication token
168 ## with this authentication token
173 ##
169 ##
174 ## list of all views can be found under `/_admin/permissions/auth_token_access`
170 ## list of all views can be found under `/_admin/permissions/auth_token_access`
175 ## The list should be "," separated and on a single line.
171 ## The list should be "," separated and on a single line.
176 ##
172 ##
177 ## Most common views to enable:
173 ## Most common views to enable:
178 # RepoCommitsView:repo_commit_download
174 # RepoCommitsView:repo_commit_download
179 # RepoCommitsView:repo_commit_patch
175 # RepoCommitsView:repo_commit_patch
180 # RepoCommitsView:repo_commit_raw
176 # RepoCommitsView:repo_commit_raw
181 # RepoCommitsView:repo_commit_raw@TOKEN
177 # RepoCommitsView:repo_commit_raw@TOKEN
182 # RepoFilesView:repo_files_diff
178 # RepoFilesView:repo_files_diff
183 # RepoFilesView:repo_archivefile
179 # RepoFilesView:repo_archivefile
184 # RepoFilesView:repo_file_raw
180 # RepoFilesView:repo_file_raw
185 # GistView:*
181 # GistView:*
186 api_access_controllers_whitelist =
182 api_access_controllers_whitelist =
187
183
188 ## default encoding used to convert from and to unicode
184 ## default encoding used to convert from and to unicode
189 ## can be also a comma separated list of encoding in case of mixed encodings
185 ## can be also a comma separated list of encoding in case of mixed encodings
190 default_encoding = UTF-8
186 default_encoding = UTF-8
191
187
192 ## instance-id prefix
188 ## instance-id prefix
193 ## a prefix key for this instance used for cache invalidation when running
189 ## a prefix key for this instance used for cache invalidation when running
194 ## multiple instances of rhodecode, make sure it's globally unique for
190 ## multiple instances of rhodecode, make sure it's globally unique for
195 ## all running rhodecode instances. Leave empty if you don't use it
191 ## all running rhodecode instances. Leave empty if you don't use it
196 instance_id =
192 instance_id =
197
193
198 ## Fallback authentication plugin. Set this to a plugin ID to force the usage
194 ## Fallback authentication plugin. Set this to a plugin ID to force the usage
199 ## of an authentication plugin also if it is disabled by it's settings.
195 ## of an authentication plugin also if it is disabled by it's settings.
200 ## This could be useful if you are unable to log in to the system due to broken
196 ## This could be useful if you are unable to log in to the system due to broken
201 ## authentication settings. Then you can enable e.g. the internal rhodecode auth
197 ## authentication settings. Then you can enable e.g. the internal rhodecode auth
202 ## module to log in again and fix the settings.
198 ## module to log in again and fix the settings.
203 ##
199 ##
204 ## Available builtin plugin IDs (hash is part of the ID):
200 ## Available builtin plugin IDs (hash is part of the ID):
205 ## egg:rhodecode-enterprise-ce#rhodecode
201 ## egg:rhodecode-enterprise-ce#rhodecode
206 ## egg:rhodecode-enterprise-ce#pam
202 ## egg:rhodecode-enterprise-ce#pam
207 ## egg:rhodecode-enterprise-ce#ldap
203 ## egg:rhodecode-enterprise-ce#ldap
208 ## egg:rhodecode-enterprise-ce#jasig_cas
204 ## egg:rhodecode-enterprise-ce#jasig_cas
209 ## egg:rhodecode-enterprise-ce#headers
205 ## egg:rhodecode-enterprise-ce#headers
210 ## egg:rhodecode-enterprise-ce#crowd
206 ## egg:rhodecode-enterprise-ce#crowd
211 #rhodecode.auth_plugin_fallback = egg:rhodecode-enterprise-ce#rhodecode
207 #rhodecode.auth_plugin_fallback = egg:rhodecode-enterprise-ce#rhodecode
212
208
213 ## alternative return HTTP header for failed authentication. Default HTTP
209 ## alternative return HTTP header for failed authentication. Default HTTP
214 ## response is 401 HTTPUnauthorized. Currently HG clients have troubles with
210 ## response is 401 HTTPUnauthorized. Currently HG clients have troubles with
215 ## handling that causing a series of failed authentication calls.
211 ## handling that causing a series of failed authentication calls.
216 ## Set this variable to 403 to return HTTPForbidden, or any other HTTP code
212 ## Set this variable to 403 to return HTTPForbidden, or any other HTTP code
217 ## This will be served instead of default 401 on bad authnetication
213 ## This will be served instead of default 401 on bad authnetication
218 auth_ret_code =
214 auth_ret_code =
219
215
220 ## use special detection method when serving auth_ret_code, instead of serving
216 ## use special detection method when serving auth_ret_code, instead of serving
221 ## ret_code directly, use 401 initially (Which triggers credentials prompt)
217 ## ret_code directly, use 401 initially (Which triggers credentials prompt)
222 ## and then serve auth_ret_code to clients
218 ## and then serve auth_ret_code to clients
223 auth_ret_code_detection = false
219 auth_ret_code_detection = false
224
220
225 ## locking return code. When repository is locked return this HTTP code. 2XX
221 ## locking return code. When repository is locked return this HTTP code. 2XX
226 ## codes don't break the transactions while 4XX codes do
222 ## codes don't break the transactions while 4XX codes do
227 lock_ret_code = 423
223 lock_ret_code = 423
228
224
229 ## allows to change the repository location in settings page
225 ## allows to change the repository location in settings page
230 allow_repo_location_change = true
226 allow_repo_location_change = true
231
227
232 ## allows to setup custom hooks in settings page
228 ## allows to setup custom hooks in settings page
233 allow_custom_hooks_settings = true
229 allow_custom_hooks_settings = true
234
230
235 ## generated license token, goto license page in RhodeCode settings to obtain
231 ## generated license token, goto license page in RhodeCode settings to obtain
236 ## new token
232 ## new token
237 license_token = abra-cada-bra1-rce3
233 license_token = abra-cada-bra1-rce3
238
234
239 ## supervisor connection uri, for managing supervisor and logs.
235 ## supervisor connection uri, for managing supervisor and logs.
240 supervisor.uri =
236 supervisor.uri =
241 ## supervisord group name/id we only want this RC instance to handle
237 ## supervisord group name/id we only want this RC instance to handle
242 supervisor.group_id = dev
238 supervisor.group_id = dev
243
239
244 ## Display extended labs settings
240 ## Display extended labs settings
245 labs_settings_active = true
241 labs_settings_active = true
246
242
247 ####################################
243 ####################################
248 ### CELERY CONFIG ####
244 ### CELERY CONFIG ####
249 ####################################
245 ####################################
250 use_celery = false
246 use_celery = false
251 broker.host = localhost
247 broker.host = localhost
252 broker.vhost = rabbitmqhost
248 broker.vhost = rabbitmqhost
253 broker.port = 5672
249 broker.port = 5672
254 broker.user = rabbitmq
250 broker.user = rabbitmq
255 broker.password = qweqwe
251 broker.password = qweqwe
256
252
257 celery.imports = rhodecode.lib.celerylib.tasks
253 celery.imports = rhodecode.lib.celerylib.tasks
258
254
259 celery.result.backend = amqp
255 celery.result.backend = amqp
260 celery.result.dburi = amqp://
256 celery.result.dburi = amqp://
261 celery.result.serialier = json
257 celery.result.serialier = json
262
258
263 #celery.send.task.error.emails = true
259 #celery.send.task.error.emails = true
264 #celery.amqp.task.result.expires = 18000
260 #celery.amqp.task.result.expires = 18000
265
261
266 celeryd.concurrency = 2
262 celeryd.concurrency = 2
267 #celeryd.log.file = celeryd.log
263 #celeryd.log.file = celeryd.log
268 celeryd.log.level = debug
264 celeryd.log.level = debug
269 celeryd.max.tasks.per.child = 1
265 celeryd.max.tasks.per.child = 1
270
266
271 ## tasks will never be sent to the queue, but executed locally instead.
267 ## tasks will never be sent to the queue, but executed locally instead.
272 celery.always.eager = false
268 celery.always.eager = false
273
269
274 ####################################
270 ####################################
275 ### BEAKER CACHE ####
271 ### BEAKER CACHE ####
276 ####################################
272 ####################################
277 # default cache dir for templates. Putting this into a ramdisk
273 # default cache dir for templates. Putting this into a ramdisk
278 ## can boost performance, eg. %(here)s/data_ramdisk
274 ## can boost performance, eg. %(here)s/data_ramdisk
279 cache_dir = %(here)s/data
275 cache_dir = %(here)s/data
280
276
281 ## locking and default file storage for Beaker. Putting this into a ramdisk
277 ## locking and default file storage for Beaker. Putting this into a ramdisk
282 ## can boost performance, eg. %(here)s/data_ramdisk/cache/beaker_data
278 ## can boost performance, eg. %(here)s/data_ramdisk/cache/beaker_data
283 beaker.cache.data_dir = %(here)s/rc/data/cache/beaker_data
279 beaker.cache.data_dir = %(here)s/rc/data/cache/beaker_data
284 beaker.cache.lock_dir = %(here)s/rc/data/cache/beaker_lock
280 beaker.cache.lock_dir = %(here)s/rc/data/cache/beaker_lock
285
281
286 beaker.cache.regions = long_term
282 beaker.cache.regions = long_term
287
283
288 beaker.cache.long_term.type = memory
284 beaker.cache.long_term.type = memory
289 beaker.cache.long_term.expire = 36000
285 beaker.cache.long_term.expire = 36000
290 beaker.cache.long_term.key_length = 256
286 beaker.cache.long_term.key_length = 256
291
287
292
288
293 #####################################
289 #####################################
294 ### DOGPILE CACHE ####
290 ### DOGPILE CACHE ####
295 #####################################
291 #####################################
296
292
297 ## permission tree cache settings
293 ## permission tree cache settings
298 rc_cache.cache_perms.backend = dogpile.cache.rc.file_namespace
294 rc_cache.cache_perms.backend = dogpile.cache.rc.file_namespace
299 rc_cache.cache_perms.expiration_time = 0
295 rc_cache.cache_perms.expiration_time = 0
300 rc_cache.cache_perms.arguments.filename = /tmp/rc_cache_1
296 rc_cache.cache_perms.arguments.filename = /tmp/rc_cache_1
301
297
302
298
303 ## cache settings for SQL queries
299 ## cache settings for SQL queries
304 rc_cache.sql_cache_short.backend = dogpile.cache.rc.memory_lru
300 rc_cache.sql_cache_short.backend = dogpile.cache.rc.memory_lru
305 rc_cache.sql_cache_short.expiration_time = 0
301 rc_cache.sql_cache_short.expiration_time = 0
306
302
307
303
308 ####################################
304 ####################################
309 ### BEAKER SESSION ####
305 ### BEAKER SESSION ####
310 ####################################
306 ####################################
311
307
312 ## .session.type is type of storage options for the session, current allowed
308 ## .session.type is type of storage options for the session, current allowed
313 ## types are file, ext:memcached, ext:database, and memory (default).
309 ## types are file, ext:memcached, ext:database, and memory (default).
314 beaker.session.type = file
310 beaker.session.type = file
315 beaker.session.data_dir = %(here)s/rc/data/sessions/data
311 beaker.session.data_dir = %(here)s/rc/data/sessions/data
316
312
317 ## db based session, fast, and allows easy management over logged in users
313 ## db based session, fast, and allows easy management over logged in users
318 #beaker.session.type = ext:database
314 #beaker.session.type = ext:database
319 #beaker.session.table_name = db_session
315 #beaker.session.table_name = db_session
320 #beaker.session.sa.url = postgresql://postgres:secret@localhost/rhodecode
316 #beaker.session.sa.url = postgresql://postgres:secret@localhost/rhodecode
321 #beaker.session.sa.url = mysql://root:secret@127.0.0.1/rhodecode
317 #beaker.session.sa.url = mysql://root:secret@127.0.0.1/rhodecode
322 #beaker.session.sa.pool_recycle = 3600
318 #beaker.session.sa.pool_recycle = 3600
323 #beaker.session.sa.echo = false
319 #beaker.session.sa.echo = false
324
320
325 beaker.session.key = rhodecode
321 beaker.session.key = rhodecode
326 beaker.session.secret = test-rc-uytcxaz
322 beaker.session.secret = test-rc-uytcxaz
327 beaker.session.lock_dir = %(here)s/rc/data/sessions/lock
323 beaker.session.lock_dir = %(here)s/rc/data/sessions/lock
328
324
329 ## Secure encrypted cookie. Requires AES and AES python libraries
325 ## Secure encrypted cookie. Requires AES and AES python libraries
330 ## you must disable beaker.session.secret to use this
326 ## you must disable beaker.session.secret to use this
331 #beaker.session.encrypt_key = key_for_encryption
327 #beaker.session.encrypt_key = key_for_encryption
332 #beaker.session.validate_key = validation_key
328 #beaker.session.validate_key = validation_key
333
329
334 ## sets session as invalid(also logging out user) if it haven not been
330 ## sets session as invalid(also logging out user) if it haven not been
335 ## accessed for given amount of time in seconds
331 ## accessed for given amount of time in seconds
336 beaker.session.timeout = 2592000
332 beaker.session.timeout = 2592000
337 beaker.session.httponly = true
333 beaker.session.httponly = true
338 ## Path to use for the cookie. Set to prefix if you use prefix middleware
334 ## Path to use for the cookie. Set to prefix if you use prefix middleware
339 #beaker.session.cookie_path = /custom_prefix
335 #beaker.session.cookie_path = /custom_prefix
340
336
341 ## uncomment for https secure cookie
337 ## uncomment for https secure cookie
342 beaker.session.secure = false
338 beaker.session.secure = false
343
339
344 ## auto save the session to not to use .save()
340 ## auto save the session to not to use .save()
345 beaker.session.auto = false
341 beaker.session.auto = false
346
342
347 ## default cookie expiration time in seconds, set to `true` to set expire
343 ## default cookie expiration time in seconds, set to `true` to set expire
348 ## at browser close
344 ## at browser close
349 #beaker.session.cookie_expires = 3600
345 #beaker.session.cookie_expires = 3600
350
346
351 ###################################
347 ###################################
352 ## SEARCH INDEXING CONFIGURATION ##
348 ## SEARCH INDEXING CONFIGURATION ##
353 ###################################
349 ###################################
354 ## Full text search indexer is available in rhodecode-tools under
350 ## Full text search indexer is available in rhodecode-tools under
355 ## `rhodecode-tools index` command
351 ## `rhodecode-tools index` command
356
352
357 ## WHOOSH Backend, doesn't require additional services to run
353 ## WHOOSH Backend, doesn't require additional services to run
358 ## it works good with few dozen repos
354 ## it works good with few dozen repos
359 search.module = rhodecode.lib.index.whoosh
355 search.module = rhodecode.lib.index.whoosh
360 search.location = %(here)s/data/index
356 search.location = %(here)s/data/index
361
357
362 ########################################
358 ########################################
363 ### CHANNELSTREAM CONFIG ####
359 ### CHANNELSTREAM CONFIG ####
364 ########################################
360 ########################################
365 ## channelstream enables persistent connections and live notification
361 ## channelstream enables persistent connections and live notification
366 ## in the system. It's also used by the chat system
362 ## in the system. It's also used by the chat system
367
363
368 channelstream.enabled = false
364 channelstream.enabled = false
369
365
370 ## server address for channelstream server on the backend
366 ## server address for channelstream server on the backend
371 channelstream.server = 127.0.0.1:9800
367 channelstream.server = 127.0.0.1:9800
372 ## location of the channelstream server from outside world
368 ## location of the channelstream server from outside world
373 ## use ws:// for http or wss:// for https. This address needs to be handled
369 ## use ws:// for http or wss:// for https. This address needs to be handled
374 ## by external HTTP server such as Nginx or Apache
370 ## by external HTTP server such as Nginx or Apache
375 ## see nginx/apache configuration examples in our docs
371 ## see nginx/apache configuration examples in our docs
376 channelstream.ws_url = ws://rhodecode.yourserver.com/_channelstream
372 channelstream.ws_url = ws://rhodecode.yourserver.com/_channelstream
377 channelstream.secret = secret
373 channelstream.secret = secret
378 channelstream.history.location = %(here)s/channelstream_history
374 channelstream.history.location = %(here)s/channelstream_history
379
375
380 ## Internal application path that Javascript uses to connect into.
376 ## Internal application path that Javascript uses to connect into.
381 ## If you use proxy-prefix the prefix should be added before /_channelstream
377 ## If you use proxy-prefix the prefix should be added before /_channelstream
382 channelstream.proxy_path = /_channelstream
378 channelstream.proxy_path = /_channelstream
383
379
384
380
385 ###################################
381 ###################################
386 ## APPENLIGHT CONFIG ##
382 ## APPENLIGHT CONFIG ##
387 ###################################
383 ###################################
388
384
389 ## Appenlight is tailored to work with RhodeCode, see
385 ## Appenlight is tailored to work with RhodeCode, see
390 ## http://appenlight.com for details how to obtain an account
386 ## http://appenlight.com for details how to obtain an account
391
387
392 ## appenlight integration enabled
388 ## appenlight integration enabled
393 appenlight = false
389 appenlight = false
394
390
395 appenlight.server_url = https://api.appenlight.com
391 appenlight.server_url = https://api.appenlight.com
396 appenlight.api_key = YOUR_API_KEY
392 appenlight.api_key = YOUR_API_KEY
397 #appenlight.transport_config = https://api.appenlight.com?threaded=1&timeout=5
393 #appenlight.transport_config = https://api.appenlight.com?threaded=1&timeout=5
398
394
399 # used for JS client
395 # used for JS client
400 appenlight.api_public_key = YOUR_API_PUBLIC_KEY
396 appenlight.api_public_key = YOUR_API_PUBLIC_KEY
401
397
402 ## TWEAK AMOUNT OF INFO SENT HERE
398 ## TWEAK AMOUNT OF INFO SENT HERE
403
399
404 ## enables 404 error logging (default False)
400 ## enables 404 error logging (default False)
405 appenlight.report_404 = false
401 appenlight.report_404 = false
406
402
407 ## time in seconds after request is considered being slow (default 1)
403 ## time in seconds after request is considered being slow (default 1)
408 appenlight.slow_request_time = 1
404 appenlight.slow_request_time = 1
409
405
410 ## record slow requests in application
406 ## record slow requests in application
411 ## (needs to be enabled for slow datastore recording and time tracking)
407 ## (needs to be enabled for slow datastore recording and time tracking)
412 appenlight.slow_requests = true
408 appenlight.slow_requests = true
413
409
414 ## enable hooking to application loggers
410 ## enable hooking to application loggers
415 appenlight.logging = true
411 appenlight.logging = true
416
412
417 ## minimum log level for log capture
413 ## minimum log level for log capture
418 appenlight.logging.level = WARNING
414 appenlight.logging.level = WARNING
419
415
420 ## send logs only from erroneous/slow requests
416 ## send logs only from erroneous/slow requests
421 ## (saves API quota for intensive logging)
417 ## (saves API quota for intensive logging)
422 appenlight.logging_on_error = false
418 appenlight.logging_on_error = false
423
419
424 ## list of additonal keywords that should be grabbed from environ object
420 ## list of additonal keywords that should be grabbed from environ object
425 ## can be string with comma separated list of words in lowercase
421 ## can be string with comma separated list of words in lowercase
426 ## (by default client will always send following info:
422 ## (by default client will always send following info:
427 ## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that
423 ## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that
428 ## start with HTTP* this list be extended with additional keywords here
424 ## start with HTTP* this list be extended with additional keywords here
429 appenlight.environ_keys_whitelist =
425 appenlight.environ_keys_whitelist =
430
426
431 ## list of keywords that should be blanked from request object
427 ## list of keywords that should be blanked from request object
432 ## can be string with comma separated list of words in lowercase
428 ## can be string with comma separated list of words in lowercase
433 ## (by default client will always blank keys that contain following words
429 ## (by default client will always blank keys that contain following words
434 ## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'
430 ## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'
435 ## this list be extended with additional keywords set here
431 ## this list be extended with additional keywords set here
436 appenlight.request_keys_blacklist =
432 appenlight.request_keys_blacklist =
437
433
438 ## list of namespaces that should be ignores when gathering log entries
434 ## list of namespaces that should be ignores when gathering log entries
439 ## can be string with comma separated list of namespaces
435 ## can be string with comma separated list of namespaces
440 ## (by default the client ignores own entries: appenlight_client.client)
436 ## (by default the client ignores own entries: appenlight_client.client)
441 appenlight.log_namespace_blacklist =
437 appenlight.log_namespace_blacklist =
442
438
443
439
444 ################################################################################
440 ################################################################################
445 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
441 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
446 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
442 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
447 ## execute malicious code after an exception is raised. ##
443 ## execute malicious code after an exception is raised. ##
448 ################################################################################
444 ################################################################################
449 set debug = false
445 set debug = false
450
446
451
447
452 ##############
448 ##############
453 ## STYLING ##
449 ## STYLING ##
454 ##############
450 ##############
455 debug_style = false
451 debug_style = false
456
452
457 ###########################################
453 ###########################################
458 ### MAIN RHODECODE DATABASE CONFIG ###
454 ### MAIN RHODECODE DATABASE CONFIG ###
459 ###########################################
455 ###########################################
460 #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode_test.db?timeout=30
456 #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode_test.db?timeout=30
461 #sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode_test
457 #sqlalchemy.db1.url = postgresql://postgres:qweqwe@localhost/rhodecode_test
462 #sqlalchemy.db1.url = mysql://root:qweqwe@localhost/rhodecode_test
458 #sqlalchemy.db1.url = mysql://root:qweqwe@localhost/rhodecode_test
463 sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode_test.db?timeout=30
459 sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode_test.db?timeout=30
464
460
465 # see sqlalchemy docs for other advanced settings
461 # see sqlalchemy docs for other advanced settings
466
462
467 ## print the sql statements to output
463 ## print the sql statements to output
468 sqlalchemy.db1.echo = false
464 sqlalchemy.db1.echo = false
469 ## recycle the connections after this amount of seconds
465 ## recycle the connections after this amount of seconds
470 sqlalchemy.db1.pool_recycle = 3600
466 sqlalchemy.db1.pool_recycle = 3600
471 sqlalchemy.db1.convert_unicode = true
467 sqlalchemy.db1.convert_unicode = true
472
468
473 ## the number of connections to keep open inside the connection pool.
469 ## the number of connections to keep open inside the connection pool.
474 ## 0 indicates no limit
470 ## 0 indicates no limit
475 #sqlalchemy.db1.pool_size = 5
471 #sqlalchemy.db1.pool_size = 5
476
472
477 ## the number of connections to allow in connection pool "overflow", that is
473 ## the number of connections to allow in connection pool "overflow", that is
478 ## connections that can be opened above and beyond the pool_size setting,
474 ## connections that can be opened above and beyond the pool_size setting,
479 ## which defaults to five.
475 ## which defaults to five.
480 #sqlalchemy.db1.max_overflow = 10
476 #sqlalchemy.db1.max_overflow = 10
481
477
482
478
483 ##################
479 ##################
484 ### VCS CONFIG ###
480 ### VCS CONFIG ###
485 ##################
481 ##################
486 vcs.server.enable = true
482 vcs.server.enable = true
487 vcs.server = localhost:9901
483 vcs.server = localhost:9901
488
484
489 ## Web server connectivity protocol, responsible for web based VCS operatations
485 ## Web server connectivity protocol, responsible for web based VCS operatations
490 ## Available protocols are:
486 ## Available protocols are:
491 ## `http` - use http-rpc backend (default)
487 ## `http` - use http-rpc backend (default)
492 vcs.server.protocol = http
488 vcs.server.protocol = http
493
489
494 ## Push/Pull operations protocol, available options are:
490 ## Push/Pull operations protocol, available options are:
495 ## `http` - use http-rpc backend (default)
491 ## `http` - use http-rpc backend (default)
496 ## `vcsserver.scm_app` - internal app (EE only)
492 ## `vcsserver.scm_app` - internal app (EE only)
497 vcs.scm_app_implementation = http
493 vcs.scm_app_implementation = http
498
494
499 ## Push/Pull operations hooks protocol, available options are:
495 ## Push/Pull operations hooks protocol, available options are:
500 ## `http` - use http-rpc backend (default)
496 ## `http` - use http-rpc backend (default)
501 vcs.hooks.protocol = http
497 vcs.hooks.protocol = http
502 vcs.hooks.host = 127.0.0.1
498 vcs.hooks.host = 127.0.0.1
503
499
504 vcs.server.log_level = debug
500 vcs.server.log_level = debug
505 ## Start VCSServer with this instance as a subprocess, Useful for development
501 ## Start VCSServer with this instance as a subprocess, Useful for development
506 vcs.start_server = false
502 vcs.start_server = false
507
503
508 ## List of enabled VCS backends, available options are:
504 ## List of enabled VCS backends, available options are:
509 ## `hg` - mercurial
505 ## `hg` - mercurial
510 ## `git` - git
506 ## `git` - git
511 ## `svn` - subversion
507 ## `svn` - subversion
512 vcs.backends = hg, git, svn
508 vcs.backends = hg, git, svn
513
509
514 vcs.connection_timeout = 3600
510 vcs.connection_timeout = 3600
515 ## Compatibility version when creating SVN repositories. Defaults to newest version when commented out.
511 ## Compatibility version when creating SVN repositories. Defaults to newest version when commented out.
516 ## Available options are: pre-1.4-compatible, pre-1.5-compatible, pre-1.6-compatible, pre-1.8-compatible, pre-1.9-compatible
512 ## Available options are: pre-1.4-compatible, pre-1.5-compatible, pre-1.6-compatible, pre-1.8-compatible, pre-1.9-compatible
517 #vcs.svn.compatible_version = pre-1.8-compatible
513 #vcs.svn.compatible_version = pre-1.8-compatible
518
514
519
515
520 ############################################################
516 ############################################################
521 ### Subversion proxy support (mod_dav_svn) ###
517 ### Subversion proxy support (mod_dav_svn) ###
522 ### Maps RhodeCode repo groups into SVN paths for Apache ###
518 ### Maps RhodeCode repo groups into SVN paths for Apache ###
523 ############################################################
519 ############################################################
524 ## Enable or disable the config file generation.
520 ## Enable or disable the config file generation.
525 svn.proxy.generate_config = false
521 svn.proxy.generate_config = false
526 ## Generate config file with `SVNListParentPath` set to `On`.
522 ## Generate config file with `SVNListParentPath` set to `On`.
527 svn.proxy.list_parent_path = true
523 svn.proxy.list_parent_path = true
528 ## Set location and file name of generated config file.
524 ## Set location and file name of generated config file.
529 svn.proxy.config_file_path = %(here)s/mod_dav_svn.conf
525 svn.proxy.config_file_path = %(here)s/mod_dav_svn.conf
530 ## Used as a prefix to the `Location` block in the generated config file.
526 ## Used as a prefix to the `Location` block in the generated config file.
531 ## In most cases it should be set to `/`.
527 ## In most cases it should be set to `/`.
532 svn.proxy.location_root = /
528 svn.proxy.location_root = /
533 ## Command to reload the mod dav svn configuration on change.
529 ## Command to reload the mod dav svn configuration on change.
534 ## Example: `/etc/init.d/apache2 reload`
530 ## Example: `/etc/init.d/apache2 reload`
535 #svn.proxy.reload_cmd = /etc/init.d/apache2 reload
531 #svn.proxy.reload_cmd = /etc/init.d/apache2 reload
536 ## If the timeout expires before the reload command finishes, the command will
532 ## If the timeout expires before the reload command finishes, the command will
537 ## be killed. Setting it to zero means no timeout. Defaults to 10 seconds.
533 ## be killed. Setting it to zero means no timeout. Defaults to 10 seconds.
538 #svn.proxy.reload_timeout = 10
534 #svn.proxy.reload_timeout = 10
539
535
540 ############################################################
536 ############################################################
541 ### SSH Support Settings ###
537 ### SSH Support Settings ###
542 ############################################################
538 ############################################################
543
539
544 ## Defines if the authorized_keys file should be written on any change of
540 ## Defines if the authorized_keys file should be written on any change of
545 ## user ssh keys, setting this to false also disables posibility of adding
541 ## user ssh keys, setting this to false also disables posibility of adding
546 ## ssh keys for users from web interface.
542 ## ssh keys for users from web interface.
547 ssh.generate_authorized_keyfile = true
543 ssh.generate_authorized_keyfile = true
548
544
549 ## Options for ssh, default is `no-pty,no-port-forwarding,no-X11-forwarding,no-agent-forwarding`
545 ## Options for ssh, default is `no-pty,no-port-forwarding,no-X11-forwarding,no-agent-forwarding`
550 # ssh.authorized_keys_ssh_opts =
546 # ssh.authorized_keys_ssh_opts =
551
547
552 ## File to generate the authorized keys together with options
548 ## File to generate the authorized keys together with options
553 ## It is possible to have multiple key files specified in `sshd_config` e.g.
549 ## It is possible to have multiple key files specified in `sshd_config` e.g.
554 ## AuthorizedKeysFile %h/.ssh/authorized_keys %h/.ssh/authorized_keys_rhodecode
550 ## AuthorizedKeysFile %h/.ssh/authorized_keys %h/.ssh/authorized_keys_rhodecode
555 ssh.authorized_keys_file_path = %(here)s/rc/authorized_keys_rhodecode
551 ssh.authorized_keys_file_path = %(here)s/rc/authorized_keys_rhodecode
556
552
557 ## Command to execute the SSH wrapper. The binary is available in the
553 ## Command to execute the SSH wrapper. The binary is available in the
558 ## rhodecode installation directory.
554 ## rhodecode installation directory.
559 ## e.g ~/.rccontrol/community-1/profile/bin/rc-ssh-wrapper
555 ## e.g ~/.rccontrol/community-1/profile/bin/rc-ssh-wrapper
560 ssh.wrapper_cmd = ~/.rccontrol/community-1/rc-ssh-wrapper
556 ssh.wrapper_cmd = ~/.rccontrol/community-1/rc-ssh-wrapper
561
557
562 ## Allow shell when executing the ssh-wrapper command
558 ## Allow shell when executing the ssh-wrapper command
563 ssh.wrapper_cmd_allow_shell = false
559 ssh.wrapper_cmd_allow_shell = false
564
560
565 ## Enables logging, and detailed output send back to the client. Useful for
561 ## Enables logging, and detailed output send back to the client. Useful for
566 ## debugging, shouldn't be used in production.
562 ## debugging, shouldn't be used in production.
567 ssh.enable_debug_logging = false
563 ssh.enable_debug_logging = false
568
564
569 ## Paths to binary executrables, by default they are the names, but we can
565 ## Paths to binary executrables, by default they are the names, but we can
570 ## override them if we want to use a custom one
566 ## override them if we want to use a custom one
571 ssh.executable.hg = ~/.rccontrol/vcsserver-1/profile/bin/hg
567 ssh.executable.hg = ~/.rccontrol/vcsserver-1/profile/bin/hg
572 ssh.executable.git = ~/.rccontrol/vcsserver-1/profile/bin/git
568 ssh.executable.git = ~/.rccontrol/vcsserver-1/profile/bin/git
573 ssh.executable.svn = ~/.rccontrol/vcsserver-1/profile/bin/svnserve
569 ssh.executable.svn = ~/.rccontrol/vcsserver-1/profile/bin/svnserve
574
570
575 ## Enables SSH key generator web interface. Disabling this still allows users
571 ## Enables SSH key generator web interface. Disabling this still allows users
576 ## to add their own keys.
572 ## to add their own keys.
577 ssh.enable_ui_key_generator = true
573 ssh.enable_ui_key_generator = true
578
574
579
575
580 ## Dummy marker to add new entries after.
576 ## Dummy marker to add new entries after.
581 ## Add any custom entries below. Please don't remove.
577 ## Add any custom entries below. Please don't remove.
582 custom.conf = 1
578 custom.conf = 1
583
579
584
580
585 ################################
581 ################################
586 ### LOGGING CONFIGURATION ####
582 ### LOGGING CONFIGURATION ####
587 ################################
583 ################################
588 [loggers]
584 [loggers]
589 keys = root, sqlalchemy, beaker, rhodecode, ssh_wrapper
585 keys = root, sqlalchemy, beaker, rhodecode, ssh_wrapper
590
586
591 [handlers]
587 [handlers]
592 keys = console, console_sql
588 keys = console, console_sql
593
589
594 [formatters]
590 [formatters]
595 keys = generic, color_formatter, color_formatter_sql
591 keys = generic, color_formatter, color_formatter_sql
596
592
597 #############
593 #############
598 ## LOGGERS ##
594 ## LOGGERS ##
599 #############
595 #############
600 [logger_root]
596 [logger_root]
601 level = NOTSET
597 level = NOTSET
602 handlers = console
598 handlers = console
603
599
604 [logger_routes]
600 [logger_routes]
605 level = DEBUG
601 level = DEBUG
606 handlers =
602 handlers =
607 qualname = routes.middleware
603 qualname = routes.middleware
608 ## "level = DEBUG" logs the route matched and routing variables.
604 ## "level = DEBUG" logs the route matched and routing variables.
609 propagate = 1
605 propagate = 1
610
606
611 [logger_beaker]
607 [logger_beaker]
612 level = DEBUG
608 level = DEBUG
613 handlers =
609 handlers =
614 qualname = beaker.container
610 qualname = beaker.container
615 propagate = 1
611 propagate = 1
616
612
617 [logger_rhodecode]
613 [logger_rhodecode]
618 level = DEBUG
614 level = DEBUG
619 handlers =
615 handlers =
620 qualname = rhodecode
616 qualname = rhodecode
621 propagate = 1
617 propagate = 1
622
618
623 [logger_sqlalchemy]
619 [logger_sqlalchemy]
624 level = ERROR
620 level = ERROR
625 handlers = console_sql
621 handlers = console_sql
626 qualname = sqlalchemy.engine
622 qualname = sqlalchemy.engine
627 propagate = 0
623 propagate = 0
628
624
629 [logger_ssh_wrapper]
625 [logger_ssh_wrapper]
630 level = DEBUG
626 level = DEBUG
631 handlers =
627 handlers =
632 qualname = ssh_wrapper
628 qualname = ssh_wrapper
633 propagate = 1
629 propagate = 1
634
630
635
631
636 ##############
632 ##############
637 ## HANDLERS ##
633 ## HANDLERS ##
638 ##############
634 ##############
639
635
640 [handler_console]
636 [handler_console]
641 class = StreamHandler
637 class = StreamHandler
642 args = (sys.stderr,)
638 args = (sys.stderr,)
643 level = DEBUG
639 level = DEBUG
644 formatter = generic
640 formatter = generic
645
641
646 [handler_console_sql]
642 [handler_console_sql]
647 class = StreamHandler
643 class = StreamHandler
648 args = (sys.stderr,)
644 args = (sys.stderr,)
649 level = WARN
645 level = WARN
650 formatter = generic
646 formatter = generic
651
647
652 ################
648 ################
653 ## FORMATTERS ##
649 ## FORMATTERS ##
654 ################
650 ################
655
651
656 [formatter_generic]
652 [formatter_generic]
657 class = rhodecode.lib.logging_formatter.ExceptionAwareFormatter
653 class = rhodecode.lib.logging_formatter.ExceptionAwareFormatter
658 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
654 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
659 datefmt = %Y-%m-%d %H:%M:%S
655 datefmt = %Y-%m-%d %H:%M:%S
660
656
661 [formatter_color_formatter]
657 [formatter_color_formatter]
662 class = rhodecode.lib.logging_formatter.ColorFormatter
658 class = rhodecode.lib.logging_formatter.ColorFormatter
663 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
659 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
664 datefmt = %Y-%m-%d %H:%M:%S
660 datefmt = %Y-%m-%d %H:%M:%S
665
661
666 [formatter_color_formatter_sql]
662 [formatter_color_formatter_sql]
667 class = rhodecode.lib.logging_formatter.ColorFormatterSql
663 class = rhodecode.lib.logging_formatter.ColorFormatterSql
668 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
664 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
669 datefmt = %Y-%m-%d %H:%M:%S
665 datefmt = %Y-%m-%d %H:%M:%S
General Comments 0
You need to be logged in to leave comments. Login now