##// END OF EJS Templates
make the htsts headers optional and stored in .ini file....
marcink -
r3359:c394a564 beta
parent child Browse files
Show More
@@ -1,439 +1,442 b''
1 ################################################################################
1 ################################################################################
2 ################################################################################
2 ################################################################################
3 # RhodeCode - Pylons environment configuration #
3 # RhodeCode - Pylons environment configuration #
4 # #
4 # #
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 pdebug = false
10 pdebug = false
11 ################################################################################
11 ################################################################################
12 ## Uncomment and replace with the address which should receive ##
12 ## Uncomment and replace with the address which should receive ##
13 ## any error reports after application crash ##
13 ## any error reports after application crash ##
14 ## Additionally those settings will be used by RhodeCode mailing system ##
14 ## Additionally those settings will be used by RhodeCode mailing system ##
15 ################################################################################
15 ################################################################################
16 #email_to = admin@localhost
16 #email_to = admin@localhost
17 #error_email_from = paste_error@localhost
17 #error_email_from = paste_error@localhost
18 #app_email_from = rhodecode-noreply@localhost
18 #app_email_from = rhodecode-noreply@localhost
19 #error_message =
19 #error_message =
20 #email_prefix = [RhodeCode]
20 #email_prefix = [RhodeCode]
21
21
22 #smtp_server = mail.server.com
22 #smtp_server = mail.server.com
23 #smtp_username =
23 #smtp_username =
24 #smtp_password =
24 #smtp_password =
25 #smtp_port =
25 #smtp_port =
26 #smtp_use_tls = false
26 #smtp_use_tls = false
27 #smtp_use_ssl = true
27 #smtp_use_ssl = true
28 # Specify available auth parameters here (e.g. LOGIN PLAIN CRAM-MD5, etc.)
28 # Specify available auth parameters here (e.g. LOGIN PLAIN CRAM-MD5, etc.)
29 #smtp_auth =
29 #smtp_auth =
30
30
31 [server:main]
31 [server:main]
32 ## PASTE
32 ## PASTE
33 ##nr of threads to spawn
33 ##nr of threads to spawn
34 #threadpool_workers = 5
34 #threadpool_workers = 5
35
35
36 ##max request before thread respawn
36 ##max request before thread respawn
37 #threadpool_max_requests = 10
37 #threadpool_max_requests = 10
38
38
39 ##option to use threads of process
39 ##option to use threads of process
40 #use_threadpool = true
40 #use_threadpool = true
41
41
42 #use = egg:Paste#http
42 #use = egg:Paste#http
43
43
44 #WAITRESS
44 #WAITRESS
45 threads = 5
45 threads = 5
46 use = egg:waitress#main
46 use = egg:waitress#main
47
47
48 host = 0.0.0.0
48 host = 0.0.0.0
49 port = 5000
49 port = 5000
50
50
51 [filter:proxy-prefix]
51 [filter:proxy-prefix]
52 # prefix middleware for rc
52 # prefix middleware for rc
53 use = egg:PasteDeploy#prefix
53 use = egg:PasteDeploy#prefix
54 prefix = /<your-prefix>
54 prefix = /<your-prefix>
55
55
56 [app:main]
56 [app:main]
57 use = egg:rhodecode
57 use = egg:rhodecode
58 #filter-with = proxy-prefix
58 #filter-with = proxy-prefix
59 full_stack = true
59 full_stack = true
60 static_files = true
60 static_files = true
61 # Optional Languages
61 # Optional Languages
62 # en, fr, ja, pt_BR, zh_CN, zh_TW, pl
62 # en, fr, ja, pt_BR, zh_CN, zh_TW, pl
63 lang = en
63 lang = en
64 cache_dir = %(here)s/data
64 cache_dir = %(here)s/data
65 index_dir = %(here)s/data/index
65 index_dir = %(here)s/data/index
66 app_instance_uuid = rc-develop
66 app_instance_uuid = rc-develop
67 cut_off_limit = 256000
67 cut_off_limit = 256000
68 vcs_full_cache = True
68 vcs_full_cache = True
69 # force https in RhodeCode, fixes https redirects, assumes it's always https
69 force_https = false
70 force_https = false
71 # use Strict-Transport-Security headers
72 use_htsts = false
70 commit_parse_limit = 25
73 commit_parse_limit = 25
71 # number of items displayed in lightweight dashboard before paginating
74 # number of items displayed in lightweight dashboard before paginating
72 dashboard_items = 100
75 dashboard_items = 100
73 use_gravatar = true
76 use_gravatar = true
74
77
75 ## RSS feed options
78 ## RSS feed options
76
79
77 rss_cut_off_limit = 256000
80 rss_cut_off_limit = 256000
78 rss_items_per_page = 10
81 rss_items_per_page = 10
79 rss_include_diff = false
82 rss_include_diff = false
80
83
81
84
82 ## alternative_gravatar_url allows you to use your own avatar server application
85 ## alternative_gravatar_url allows you to use your own avatar server application
83 ## the following parts of the URL will be replaced
86 ## the following parts of the URL will be replaced
84 ## {email} user email
87 ## {email} user email
85 ## {md5email} md5 hash of the user email (like at gravatar.com)
88 ## {md5email} md5 hash of the user email (like at gravatar.com)
86 ## {size} size of the image that is expected from the server application
89 ## {size} size of the image that is expected from the server application
87 ## {scheme} http/https from RhodeCode server
90 ## {scheme} http/https from RhodeCode server
88 ## {netloc} network location from RhodeCode server
91 ## {netloc} network location from RhodeCode server
89 #alternative_gravatar_url = http://myavatarserver.com/getbyemail/{email}/{size}
92 #alternative_gravatar_url = http://myavatarserver.com/getbyemail/{email}/{size}
90 #alternative_gravatar_url = http://myavatarserver.com/getbymd5/{md5email}?s={size}
93 #alternative_gravatar_url = http://myavatarserver.com/getbymd5/{md5email}?s={size}
91
94
92 container_auth_enabled = false
95 container_auth_enabled = false
93 proxypass_auth_enabled = false
96 proxypass_auth_enabled = false
94 ## default encoding used to convert from and to unicode
97 ## default encoding used to convert from and to unicode
95 ## can be also a comma seperated list of encoding in case of mixed encodings
98 ## can be also a comma seperated list of encoding in case of mixed encodings
96 default_encoding = utf8
99 default_encoding = utf8
97
100
98 ## overwrite schema of clone url
101 ## overwrite schema of clone url
99 ## available vars:
102 ## available vars:
100 ## scheme - http/https
103 ## scheme - http/https
101 ## user - current user
104 ## user - current user
102 ## pass - password
105 ## pass - password
103 ## netloc - network location
106 ## netloc - network location
104 ## path - usually repo_name
107 ## path - usually repo_name
105
108
106 #clone_uri = {scheme}://{user}{pass}{netloc}{path}
109 #clone_uri = {scheme}://{user}{pass}{netloc}{path}
107
110
108 ## issue tracking mapping for commits messages
111 ## issue tracking mapping for commits messages
109 ## comment out issue_pat, issue_server, issue_prefix to enable
112 ## comment out issue_pat, issue_server, issue_prefix to enable
110
113
111 ## pattern to get the issues from commit messages
114 ## pattern to get the issues from commit messages
112 ## default one used here is #<numbers> with a regex passive group for `#`
115 ## default one used here is #<numbers> with a regex passive group for `#`
113 ## {id} will be all groups matched from this pattern
116 ## {id} will be all groups matched from this pattern
114
117
115 issue_pat = (?:\s*#)(\d+)
118 issue_pat = (?:\s*#)(\d+)
116
119
117 ## server url to the issue, each {id} will be replaced with match
120 ## server url to the issue, each {id} will be replaced with match
118 ## fetched from the regex and {repo} is replaced with full repository name
121 ## fetched from the regex and {repo} is replaced with full repository name
119 ## including groups {repo_name} is replaced with just name of repo
122 ## including groups {repo_name} is replaced with just name of repo
120
123
121 issue_server_link = https://myissueserver.com/{repo}/issue/{id}
124 issue_server_link = https://myissueserver.com/{repo}/issue/{id}
122
125
123 ## prefix to add to link to indicate it's an url
126 ## prefix to add to link to indicate it's an url
124 ## #314 will be replaced by <issue_prefix><id>
127 ## #314 will be replaced by <issue_prefix><id>
125
128
126 issue_prefix = #
129 issue_prefix = #
127
130
128 ## issue_pat, issue_server_link, issue_prefix can have suffixes to specify
131 ## issue_pat, issue_server_link, issue_prefix can have suffixes to specify
129 ## multiple patterns, to other issues server, wiki or others
132 ## multiple patterns, to other issues server, wiki or others
130 ## below an example how to create a wiki pattern
133 ## below an example how to create a wiki pattern
131 # #wiki-some-id -> https://mywiki.com/some-id
134 # #wiki-some-id -> https://mywiki.com/some-id
132
135
133 #issue_pat_wiki = (?:wiki-)(.+)
136 #issue_pat_wiki = (?:wiki-)(.+)
134 #issue_server_link_wiki = https://mywiki.com/{id}
137 #issue_server_link_wiki = https://mywiki.com/{id}
135 #issue_prefix_wiki = WIKI-
138 #issue_prefix_wiki = WIKI-
136
139
137
140
138 ## instance-id prefix
141 ## instance-id prefix
139 ## a prefix key for this instance used for cache invalidation when running
142 ## a prefix key for this instance used for cache invalidation when running
140 ## multiple instances of rhodecode, make sure it's globally unique for
143 ## multiple instances of rhodecode, make sure it's globally unique for
141 ## all running rhodecode instances. Leave empty if you don't use it
144 ## all running rhodecode instances. Leave empty if you don't use it
142 instance_id =
145 instance_id =
143
146
144 ## alternative return HTTP header for failed authentication. Default HTTP
147 ## alternative return HTTP header for failed authentication. Default HTTP
145 ## response is 401 HTTPUnauthorized. Currently HG clients have troubles with
148 ## response is 401 HTTPUnauthorized. Currently HG clients have troubles with
146 ## handling that. Set this variable to 403 to return HTTPForbidden
149 ## handling that. Set this variable to 403 to return HTTPForbidden
147 auth_ret_code =
150 auth_ret_code =
148
151
149 ####################################
152 ####################################
150 ### CELERY CONFIG ####
153 ### CELERY CONFIG ####
151 ####################################
154 ####################################
152 use_celery = false
155 use_celery = false
153 broker.host = localhost
156 broker.host = localhost
154 broker.vhost = rabbitmqhost
157 broker.vhost = rabbitmqhost
155 broker.port = 5672
158 broker.port = 5672
156 broker.user = rabbitmq
159 broker.user = rabbitmq
157 broker.password = qweqwe
160 broker.password = qweqwe
158
161
159 celery.imports = rhodecode.lib.celerylib.tasks
162 celery.imports = rhodecode.lib.celerylib.tasks
160
163
161 celery.result.backend = amqp
164 celery.result.backend = amqp
162 celery.result.dburi = amqp://
165 celery.result.dburi = amqp://
163 celery.result.serialier = json
166 celery.result.serialier = json
164
167
165 #celery.send.task.error.emails = true
168 #celery.send.task.error.emails = true
166 #celery.amqp.task.result.expires = 18000
169 #celery.amqp.task.result.expires = 18000
167
170
168 celeryd.concurrency = 2
171 celeryd.concurrency = 2
169 #celeryd.log.file = celeryd.log
172 #celeryd.log.file = celeryd.log
170 celeryd.log.level = debug
173 celeryd.log.level = debug
171 celeryd.max.tasks.per.child = 1
174 celeryd.max.tasks.per.child = 1
172
175
173 #tasks will never be sent to the queue, but executed locally instead.
176 #tasks will never be sent to the queue, but executed locally instead.
174 celery.always.eager = false
177 celery.always.eager = false
175
178
176 ####################################
179 ####################################
177 ### BEAKER CACHE ####
180 ### BEAKER CACHE ####
178 ####################################
181 ####################################
179 beaker.cache.data_dir=%(here)s/data/cache/data
182 beaker.cache.data_dir=%(here)s/data/cache/data
180 beaker.cache.lock_dir=%(here)s/data/cache/lock
183 beaker.cache.lock_dir=%(here)s/data/cache/lock
181
184
182 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
185 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
183
186
184 beaker.cache.super_short_term.type=memory
187 beaker.cache.super_short_term.type=memory
185 beaker.cache.super_short_term.expire=10
188 beaker.cache.super_short_term.expire=10
186 beaker.cache.super_short_term.key_length = 256
189 beaker.cache.super_short_term.key_length = 256
187
190
188 beaker.cache.short_term.type=memory
191 beaker.cache.short_term.type=memory
189 beaker.cache.short_term.expire=60
192 beaker.cache.short_term.expire=60
190 beaker.cache.short_term.key_length = 256
193 beaker.cache.short_term.key_length = 256
191
194
192 beaker.cache.long_term.type=memory
195 beaker.cache.long_term.type=memory
193 beaker.cache.long_term.expire=36000
196 beaker.cache.long_term.expire=36000
194 beaker.cache.long_term.key_length = 256
197 beaker.cache.long_term.key_length = 256
195
198
196 beaker.cache.sql_cache_short.type=memory
199 beaker.cache.sql_cache_short.type=memory
197 beaker.cache.sql_cache_short.expire=10
200 beaker.cache.sql_cache_short.expire=10
198 beaker.cache.sql_cache_short.key_length = 256
201 beaker.cache.sql_cache_short.key_length = 256
199
202
200 beaker.cache.sql_cache_med.type=memory
203 beaker.cache.sql_cache_med.type=memory
201 beaker.cache.sql_cache_med.expire=360
204 beaker.cache.sql_cache_med.expire=360
202 beaker.cache.sql_cache_med.key_length = 256
205 beaker.cache.sql_cache_med.key_length = 256
203
206
204 beaker.cache.sql_cache_long.type=file
207 beaker.cache.sql_cache_long.type=file
205 beaker.cache.sql_cache_long.expire=3600
208 beaker.cache.sql_cache_long.expire=3600
206 beaker.cache.sql_cache_long.key_length = 256
209 beaker.cache.sql_cache_long.key_length = 256
207
210
208 ####################################
211 ####################################
209 ### BEAKER SESSION ####
212 ### BEAKER SESSION ####
210 ####################################
213 ####################################
211 ## Type of storage used for the session, current types are
214 ## Type of storage used for the session, current types are
212 ## dbm, file, memcached, database, and memory.
215 ## dbm, file, memcached, database, and memory.
213 ## The storage uses the Container API
216 ## The storage uses the Container API
214 ## that is also used by the cache system.
217 ## that is also used by the cache system.
215
218
216 ## db session ##
219 ## db session ##
217 #beaker.session.type = ext:database
220 #beaker.session.type = ext:database
218 #beaker.session.sa.url = postgresql://postgres:qwe@localhost/rhodecode
221 #beaker.session.sa.url = postgresql://postgres:qwe@localhost/rhodecode
219 #beaker.session.table_name = db_session
222 #beaker.session.table_name = db_session
220
223
221 ## encrypted cookie client side session, good for many instances ##
224 ## encrypted cookie client side session, good for many instances ##
222 #beaker.session.type = cookie
225 #beaker.session.type = cookie
223
226
224 ## file based cookies (default) ##
227 ## file based cookies (default) ##
225 #beaker.session.type = file
228 #beaker.session.type = file
226
229
227
230
228 beaker.session.key = rhodecode
231 beaker.session.key = rhodecode
229 ## secure cookie requires AES python libraries ##
232 ## secure cookie requires AES python libraries ##
230 #beaker.session.encrypt_key = g654dcno0-9873jhgfreyu
233 #beaker.session.encrypt_key = g654dcno0-9873jhgfreyu
231 #beaker.session.validate_key = 9712sds2212c--zxc123
234 #beaker.session.validate_key = 9712sds2212c--zxc123
232 ## sets session as invalid if it haven't been accessed for given amount of time
235 ## sets session as invalid if it haven't been accessed for given amount of time
233 beaker.session.timeout = 2592000
236 beaker.session.timeout = 2592000
234 beaker.session.httponly = true
237 beaker.session.httponly = true
235 #beaker.session.cookie_path = /<your-prefix>
238 #beaker.session.cookie_path = /<your-prefix>
236
239
237 ## uncomment for https secure cookie ##
240 ## uncomment for https secure cookie ##
238 beaker.session.secure = false
241 beaker.session.secure = false
239
242
240 ## auto save the session to not to use .save() ##
243 ## auto save the session to not to use .save() ##
241 beaker.session.auto = False
244 beaker.session.auto = False
242
245
243 ## default cookie expiration time in seconds `true` expire at browser close ##
246 ## default cookie expiration time in seconds `true` expire at browser close ##
244 #beaker.session.cookie_expires = 3600
247 #beaker.session.cookie_expires = 3600
245
248
246
249
247 ############################
250 ############################
248 ## ERROR HANDLING SYSTEMS ##
251 ## ERROR HANDLING SYSTEMS ##
249 ############################
252 ############################
250
253
251 ####################
254 ####################
252 ### [errormator] ###
255 ### [errormator] ###
253 ####################
256 ####################
254
257
255 # Errormator is tailored to work with RhodeCode, see
258 # Errormator is tailored to work with RhodeCode, see
256 # http://errormator.com for details how to obtain an account
259 # http://errormator.com for details how to obtain an account
257 # you must install python package `errormator_client` to make it work
260 # you must install python package `errormator_client` to make it work
258
261
259 # errormator enabled
262 # errormator enabled
260 errormator = true
263 errormator = true
261
264
262 errormator.server_url = https://api.errormator.com
265 errormator.server_url = https://api.errormator.com
263 errormator.api_key = YOUR_API_KEY
266 errormator.api_key = YOUR_API_KEY
264
267
265 # TWEAK AMOUNT OF INFO SENT HERE
268 # TWEAK AMOUNT OF INFO SENT HERE
266
269
267 # enables 404 error logging (default False)
270 # enables 404 error logging (default False)
268 errormator.report_404 = false
271 errormator.report_404 = false
269
272
270 # time in seconds after request is considered being slow (default 1)
273 # time in seconds after request is considered being slow (default 1)
271 errormator.slow_request_time = 1
274 errormator.slow_request_time = 1
272
275
273 # record slow requests in application
276 # record slow requests in application
274 # (needs to be enabled for slow datastore recording and time tracking)
277 # (needs to be enabled for slow datastore recording and time tracking)
275 errormator.slow_requests = true
278 errormator.slow_requests = true
276
279
277 # enable hooking to application loggers
280 # enable hooking to application loggers
278 # errormator.logging = true
281 # errormator.logging = true
279
282
280 # minimum log level for log capture
283 # minimum log level for log capture
281 # errormator.logging.level = WARNING
284 # errormator.logging.level = WARNING
282
285
283 # send logs only from erroneous/slow requests
286 # send logs only from erroneous/slow requests
284 # (saves API quota for intensive logging)
287 # (saves API quota for intensive logging)
285 errormator.logging_on_error = false
288 errormator.logging_on_error = false
286
289
287 # list of additonal keywords that should be grabbed from environ object
290 # list of additonal keywords that should be grabbed from environ object
288 # can be string with comma separated list of words in lowercase
291 # can be string with comma separated list of words in lowercase
289 # (by default client will always send following info:
292 # (by default client will always send following info:
290 # 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that
293 # 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that
291 # start with HTTP* this list be extended with additional keywords here
294 # start with HTTP* this list be extended with additional keywords here
292 errormator.environ_keys_whitelist =
295 errormator.environ_keys_whitelist =
293
296
294
297
295 # list of keywords that should be blanked from request object
298 # list of keywords that should be blanked from request object
296 # can be string with comma separated list of words in lowercase
299 # can be string with comma separated list of words in lowercase
297 # (by default client will always blank keys that contain following words
300 # (by default client will always blank keys that contain following words
298 # 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'
301 # 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'
299 # this list be extended with additional keywords set here
302 # this list be extended with additional keywords set here
300 errormator.request_keys_blacklist =
303 errormator.request_keys_blacklist =
301
304
302
305
303 # list of namespaces that should be ignores when gathering log entries
306 # list of namespaces that should be ignores when gathering log entries
304 # can be string with comma separated list of namespaces
307 # can be string with comma separated list of namespaces
305 # (by default the client ignores own entries: errormator_client.client)
308 # (by default the client ignores own entries: errormator_client.client)
306 errormator.log_namespace_blacklist =
309 errormator.log_namespace_blacklist =
307
310
308
311
309 ################
312 ################
310 ### [sentry] ###
313 ### [sentry] ###
311 ################
314 ################
312
315
313 # sentry is a alternative open source error aggregator
316 # sentry is a alternative open source error aggregator
314 # you must install python packages `sentry` and `raven` to enable
317 # you must install python packages `sentry` and `raven` to enable
315
318
316 sentry.dsn = YOUR_DNS
319 sentry.dsn = YOUR_DNS
317 sentry.servers =
320 sentry.servers =
318 sentry.name =
321 sentry.name =
319 sentry.key =
322 sentry.key =
320 sentry.public_key =
323 sentry.public_key =
321 sentry.secret_key =
324 sentry.secret_key =
322 sentry.project =
325 sentry.project =
323 sentry.site =
326 sentry.site =
324 sentry.include_paths =
327 sentry.include_paths =
325 sentry.exclude_paths =
328 sentry.exclude_paths =
326
329
327
330
328 ################################################################################
331 ################################################################################
329 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
332 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
330 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
333 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
331 ## execute malicious code after an exception is raised. ##
334 ## execute malicious code after an exception is raised. ##
332 ################################################################################
335 ################################################################################
333 #set debug = false
336 #set debug = false
334
337
335 ##################################
338 ##################################
336 ### LOGVIEW CONFIG ###
339 ### LOGVIEW CONFIG ###
337 ##################################
340 ##################################
338 logview.sqlalchemy = #faa
341 logview.sqlalchemy = #faa
339 logview.pylons.templating = #bfb
342 logview.pylons.templating = #bfb
340 logview.pylons.util = #eee
343 logview.pylons.util = #eee
341
344
342 #########################################################
345 #########################################################
343 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
346 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
344 #########################################################
347 #########################################################
345 #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
348 #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
346 sqlalchemy.db1.url = postgresql://postgres:qwe@localhost/rhodecode
349 sqlalchemy.db1.url = postgresql://postgres:qwe@localhost/rhodecode
347 sqlalchemy.db1.echo = false
350 sqlalchemy.db1.echo = false
348 sqlalchemy.db1.pool_recycle = 3600
351 sqlalchemy.db1.pool_recycle = 3600
349 sqlalchemy.db1.convert_unicode = true
352 sqlalchemy.db1.convert_unicode = true
350
353
351 ################################
354 ################################
352 ### LOGGING CONFIGURATION ####
355 ### LOGGING CONFIGURATION ####
353 ################################
356 ################################
354 [loggers]
357 [loggers]
355 keys = root, routes, rhodecode, sqlalchemy, beaker, templates, whoosh_indexer
358 keys = root, routes, rhodecode, sqlalchemy, beaker, templates, whoosh_indexer
356
359
357 [handlers]
360 [handlers]
358 keys = console, console_sql
361 keys = console, console_sql
359
362
360 [formatters]
363 [formatters]
361 keys = generic, color_formatter, color_formatter_sql
364 keys = generic, color_formatter, color_formatter_sql
362
365
363 #############
366 #############
364 ## LOGGERS ##
367 ## LOGGERS ##
365 #############
368 #############
366 [logger_root]
369 [logger_root]
367 level = NOTSET
370 level = NOTSET
368 handlers = console
371 handlers = console
369
372
370 [logger_routes]
373 [logger_routes]
371 level = DEBUG
374 level = DEBUG
372 handlers =
375 handlers =
373 qualname = routes.middleware
376 qualname = routes.middleware
374 # "level = DEBUG" logs the route matched and routing variables.
377 # "level = DEBUG" logs the route matched and routing variables.
375 propagate = 1
378 propagate = 1
376
379
377 [logger_beaker]
380 [logger_beaker]
378 level = DEBUG
381 level = DEBUG
379 handlers =
382 handlers =
380 qualname = beaker.container
383 qualname = beaker.container
381 propagate = 1
384 propagate = 1
382
385
383 [logger_templates]
386 [logger_templates]
384 level = INFO
387 level = INFO
385 handlers =
388 handlers =
386 qualname = pylons.templating
389 qualname = pylons.templating
387 propagate = 1
390 propagate = 1
388
391
389 [logger_rhodecode]
392 [logger_rhodecode]
390 level = DEBUG
393 level = DEBUG
391 handlers =
394 handlers =
392 qualname = rhodecode
395 qualname = rhodecode
393 propagate = 1
396 propagate = 1
394
397
395 [logger_sqlalchemy]
398 [logger_sqlalchemy]
396 level = INFO
399 level = INFO
397 handlers = console_sql
400 handlers = console_sql
398 qualname = sqlalchemy.engine
401 qualname = sqlalchemy.engine
399 propagate = 0
402 propagate = 0
400
403
401 [logger_whoosh_indexer]
404 [logger_whoosh_indexer]
402 level = DEBUG
405 level = DEBUG
403 handlers =
406 handlers =
404 qualname = whoosh_indexer
407 qualname = whoosh_indexer
405 propagate = 1
408 propagate = 1
406
409
407 ##############
410 ##############
408 ## HANDLERS ##
411 ## HANDLERS ##
409 ##############
412 ##############
410
413
411 [handler_console]
414 [handler_console]
412 class = StreamHandler
415 class = StreamHandler
413 args = (sys.stderr,)
416 args = (sys.stderr,)
414 level = DEBUG
417 level = DEBUG
415 formatter = color_formatter
418 formatter = color_formatter
416
419
417 [handler_console_sql]
420 [handler_console_sql]
418 class = StreamHandler
421 class = StreamHandler
419 args = (sys.stderr,)
422 args = (sys.stderr,)
420 level = DEBUG
423 level = DEBUG
421 formatter = color_formatter_sql
424 formatter = color_formatter_sql
422
425
423 ################
426 ################
424 ## FORMATTERS ##
427 ## FORMATTERS ##
425 ################
428 ################
426
429
427 [formatter_generic]
430 [formatter_generic]
428 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
431 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
429 datefmt = %Y-%m-%d %H:%M:%S
432 datefmt = %Y-%m-%d %H:%M:%S
430
433
431 [formatter_color_formatter]
434 [formatter_color_formatter]
432 class=rhodecode.lib.colored_formatter.ColorFormatter
435 class=rhodecode.lib.colored_formatter.ColorFormatter
433 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
436 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
434 datefmt = %Y-%m-%d %H:%M:%S
437 datefmt = %Y-%m-%d %H:%M:%S
435
438
436 [formatter_color_formatter_sql]
439 [formatter_color_formatter_sql]
437 class=rhodecode.lib.colored_formatter.ColorFormatterSql
440 class=rhodecode.lib.colored_formatter.ColorFormatterSql
438 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
441 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
439 datefmt = %Y-%m-%d %H:%M:%S
442 datefmt = %Y-%m-%d %H:%M:%S
@@ -1,439 +1,442 b''
1 ################################################################################
1 ################################################################################
2 ################################################################################
2 ################################################################################
3 # RhodeCode - Pylons environment configuration #
3 # RhodeCode - Pylons environment configuration #
4 # #
4 # #
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 pdebug = false
10 pdebug = false
11 ################################################################################
11 ################################################################################
12 ## Uncomment and replace with the address which should receive ##
12 ## Uncomment and replace with the address which should receive ##
13 ## any error reports after application crash ##
13 ## any error reports after application crash ##
14 ## Additionally those settings will be used by RhodeCode mailing system ##
14 ## Additionally those settings will be used by RhodeCode mailing system ##
15 ################################################################################
15 ################################################################################
16 #email_to = admin@localhost
16 #email_to = admin@localhost
17 #error_email_from = paste_error@localhost
17 #error_email_from = paste_error@localhost
18 #app_email_from = rhodecode-noreply@localhost
18 #app_email_from = rhodecode-noreply@localhost
19 #error_message =
19 #error_message =
20 #email_prefix = [RhodeCode]
20 #email_prefix = [RhodeCode]
21
21
22 #smtp_server = mail.server.com
22 #smtp_server = mail.server.com
23 #smtp_username =
23 #smtp_username =
24 #smtp_password =
24 #smtp_password =
25 #smtp_port =
25 #smtp_port =
26 #smtp_use_tls = false
26 #smtp_use_tls = false
27 #smtp_use_ssl = true
27 #smtp_use_ssl = true
28 # Specify available auth parameters here (e.g. LOGIN PLAIN CRAM-MD5, etc.)
28 # Specify available auth parameters here (e.g. LOGIN PLAIN CRAM-MD5, etc.)
29 #smtp_auth =
29 #smtp_auth =
30
30
31 [server:main]
31 [server:main]
32 ## PASTE
32 ## PASTE
33 ##nr of threads to spawn
33 ##nr of threads to spawn
34 #threadpool_workers = 5
34 #threadpool_workers = 5
35
35
36 ##max request before thread respawn
36 ##max request before thread respawn
37 #threadpool_max_requests = 10
37 #threadpool_max_requests = 10
38
38
39 ##option to use threads of process
39 ##option to use threads of process
40 #use_threadpool = true
40 #use_threadpool = true
41
41
42 #use = egg:Paste#http
42 #use = egg:Paste#http
43
43
44 #WAITRESS
44 #WAITRESS
45 threads = 5
45 threads = 5
46 use = egg:waitress#main
46 use = egg:waitress#main
47
47
48 host = 127.0.0.1
48 host = 127.0.0.1
49 port = 8001
49 port = 8001
50
50
51 [filter:proxy-prefix]
51 [filter:proxy-prefix]
52 # prefix middleware for rc
52 # prefix middleware for rc
53 use = egg:PasteDeploy#prefix
53 use = egg:PasteDeploy#prefix
54 prefix = /<your-prefix>
54 prefix = /<your-prefix>
55
55
56 [app:main]
56 [app:main]
57 use = egg:rhodecode
57 use = egg:rhodecode
58 #filter-with = proxy-prefix
58 #filter-with = proxy-prefix
59 full_stack = true
59 full_stack = true
60 static_files = true
60 static_files = true
61 # Optional Languages
61 # Optional Languages
62 # en, fr, ja, pt_BR, zh_CN, zh_TW, pl
62 # en, fr, ja, pt_BR, zh_CN, zh_TW, pl
63 lang = en
63 lang = en
64 cache_dir = %(here)s/data
64 cache_dir = %(here)s/data
65 index_dir = %(here)s/data/index
65 index_dir = %(here)s/data/index
66 app_instance_uuid = rc-production
66 app_instance_uuid = rc-production
67 cut_off_limit = 256000
67 cut_off_limit = 256000
68 vcs_full_cache = True
68 vcs_full_cache = True
69 # force https in RhodeCode, fixes https redirects, assumes it's always https
69 force_https = false
70 force_https = false
71 # use Strict-Transport-Security headers
72 use_htsts = false
70 commit_parse_limit = 50
73 commit_parse_limit = 50
71 # number of items displayed in lightweight dashboard before paginating
74 # number of items displayed in lightweight dashboard before paginating
72 dashboard_items = 100
75 dashboard_items = 100
73 use_gravatar = true
76 use_gravatar = true
74
77
75 ## RSS feed options
78 ## RSS feed options
76
79
77 rss_cut_off_limit = 256000
80 rss_cut_off_limit = 256000
78 rss_items_per_page = 10
81 rss_items_per_page = 10
79 rss_include_diff = false
82 rss_include_diff = false
80
83
81
84
82 ## alternative_gravatar_url allows you to use your own avatar server application
85 ## alternative_gravatar_url allows you to use your own avatar server application
83 ## the following parts of the URL will be replaced
86 ## the following parts of the URL will be replaced
84 ## {email} user email
87 ## {email} user email
85 ## {md5email} md5 hash of the user email (like at gravatar.com)
88 ## {md5email} md5 hash of the user email (like at gravatar.com)
86 ## {size} size of the image that is expected from the server application
89 ## {size} size of the image that is expected from the server application
87 ## {scheme} http/https from RhodeCode server
90 ## {scheme} http/https from RhodeCode server
88 ## {netloc} network location from RhodeCode server
91 ## {netloc} network location from RhodeCode server
89 #alternative_gravatar_url = http://myavatarserver.com/getbyemail/{email}/{size}
92 #alternative_gravatar_url = http://myavatarserver.com/getbyemail/{email}/{size}
90 #alternative_gravatar_url = http://myavatarserver.com/getbymd5/{md5email}?s={size}
93 #alternative_gravatar_url = http://myavatarserver.com/getbymd5/{md5email}?s={size}
91
94
92 container_auth_enabled = false
95 container_auth_enabled = false
93 proxypass_auth_enabled = false
96 proxypass_auth_enabled = false
94 ## default encoding used to convert from and to unicode
97 ## default encoding used to convert from and to unicode
95 ## can be also a comma seperated list of encoding in case of mixed encodings
98 ## can be also a comma seperated list of encoding in case of mixed encodings
96 default_encoding = utf8
99 default_encoding = utf8
97
100
98 ## overwrite schema of clone url
101 ## overwrite schema of clone url
99 ## available vars:
102 ## available vars:
100 ## scheme - http/https
103 ## scheme - http/https
101 ## user - current user
104 ## user - current user
102 ## pass - password
105 ## pass - password
103 ## netloc - network location
106 ## netloc - network location
104 ## path - usually repo_name
107 ## path - usually repo_name
105
108
106 #clone_uri = {scheme}://{user}{pass}{netloc}{path}
109 #clone_uri = {scheme}://{user}{pass}{netloc}{path}
107
110
108 ## issue tracking mapping for commits messages
111 ## issue tracking mapping for commits messages
109 ## comment out issue_pat, issue_server, issue_prefix to enable
112 ## comment out issue_pat, issue_server, issue_prefix to enable
110
113
111 ## pattern to get the issues from commit messages
114 ## pattern to get the issues from commit messages
112 ## default one used here is #<numbers> with a regex passive group for `#`
115 ## default one used here is #<numbers> with a regex passive group for `#`
113 ## {id} will be all groups matched from this pattern
116 ## {id} will be all groups matched from this pattern
114
117
115 issue_pat = (?:\s*#)(\d+)
118 issue_pat = (?:\s*#)(\d+)
116
119
117 ## server url to the issue, each {id} will be replaced with match
120 ## server url to the issue, each {id} will be replaced with match
118 ## fetched from the regex and {repo} is replaced with full repository name
121 ## fetched from the regex and {repo} is replaced with full repository name
119 ## including groups {repo_name} is replaced with just name of repo
122 ## including groups {repo_name} is replaced with just name of repo
120
123
121 issue_server_link = https://myissueserver.com/{repo}/issue/{id}
124 issue_server_link = https://myissueserver.com/{repo}/issue/{id}
122
125
123 ## prefix to add to link to indicate it's an url
126 ## prefix to add to link to indicate it's an url
124 ## #314 will be replaced by <issue_prefix><id>
127 ## #314 will be replaced by <issue_prefix><id>
125
128
126 issue_prefix = #
129 issue_prefix = #
127
130
128 ## issue_pat, issue_server_link, issue_prefix can have suffixes to specify
131 ## issue_pat, issue_server_link, issue_prefix can have suffixes to specify
129 ## multiple patterns, to other issues server, wiki or others
132 ## multiple patterns, to other issues server, wiki or others
130 ## below an example how to create a wiki pattern
133 ## below an example how to create a wiki pattern
131 # #wiki-some-id -> https://mywiki.com/some-id
134 # #wiki-some-id -> https://mywiki.com/some-id
132
135
133 #issue_pat_wiki = (?:wiki-)(.+)
136 #issue_pat_wiki = (?:wiki-)(.+)
134 #issue_server_link_wiki = https://mywiki.com/{id}
137 #issue_server_link_wiki = https://mywiki.com/{id}
135 #issue_prefix_wiki = WIKI-
138 #issue_prefix_wiki = WIKI-
136
139
137
140
138 ## instance-id prefix
141 ## instance-id prefix
139 ## a prefix key for this instance used for cache invalidation when running
142 ## a prefix key for this instance used for cache invalidation when running
140 ## multiple instances of rhodecode, make sure it's globally unique for
143 ## multiple instances of rhodecode, make sure it's globally unique for
141 ## all running rhodecode instances. Leave empty if you don't use it
144 ## all running rhodecode instances. Leave empty if you don't use it
142 instance_id =
145 instance_id =
143
146
144 ## alternative return HTTP header for failed authentication. Default HTTP
147 ## alternative return HTTP header for failed authentication. Default HTTP
145 ## response is 401 HTTPUnauthorized. Currently HG clients have troubles with
148 ## response is 401 HTTPUnauthorized. Currently HG clients have troubles with
146 ## handling that. Set this variable to 403 to return HTTPForbidden
149 ## handling that. Set this variable to 403 to return HTTPForbidden
147 auth_ret_code =
150 auth_ret_code =
148
151
149 ####################################
152 ####################################
150 ### CELERY CONFIG ####
153 ### CELERY CONFIG ####
151 ####################################
154 ####################################
152 use_celery = false
155 use_celery = false
153 broker.host = localhost
156 broker.host = localhost
154 broker.vhost = rabbitmqhost
157 broker.vhost = rabbitmqhost
155 broker.port = 5672
158 broker.port = 5672
156 broker.user = rabbitmq
159 broker.user = rabbitmq
157 broker.password = qweqwe
160 broker.password = qweqwe
158
161
159 celery.imports = rhodecode.lib.celerylib.tasks
162 celery.imports = rhodecode.lib.celerylib.tasks
160
163
161 celery.result.backend = amqp
164 celery.result.backend = amqp
162 celery.result.dburi = amqp://
165 celery.result.dburi = amqp://
163 celery.result.serialier = json
166 celery.result.serialier = json
164
167
165 #celery.send.task.error.emails = true
168 #celery.send.task.error.emails = true
166 #celery.amqp.task.result.expires = 18000
169 #celery.amqp.task.result.expires = 18000
167
170
168 celeryd.concurrency = 2
171 celeryd.concurrency = 2
169 #celeryd.log.file = celeryd.log
172 #celeryd.log.file = celeryd.log
170 celeryd.log.level = debug
173 celeryd.log.level = debug
171 celeryd.max.tasks.per.child = 1
174 celeryd.max.tasks.per.child = 1
172
175
173 #tasks will never be sent to the queue, but executed locally instead.
176 #tasks will never be sent to the queue, but executed locally instead.
174 celery.always.eager = false
177 celery.always.eager = false
175
178
176 ####################################
179 ####################################
177 ### BEAKER CACHE ####
180 ### BEAKER CACHE ####
178 ####################################
181 ####################################
179 beaker.cache.data_dir=%(here)s/data/cache/data
182 beaker.cache.data_dir=%(here)s/data/cache/data
180 beaker.cache.lock_dir=%(here)s/data/cache/lock
183 beaker.cache.lock_dir=%(here)s/data/cache/lock
181
184
182 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
185 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
183
186
184 beaker.cache.super_short_term.type=memory
187 beaker.cache.super_short_term.type=memory
185 beaker.cache.super_short_term.expire=10
188 beaker.cache.super_short_term.expire=10
186 beaker.cache.super_short_term.key_length = 256
189 beaker.cache.super_short_term.key_length = 256
187
190
188 beaker.cache.short_term.type=memory
191 beaker.cache.short_term.type=memory
189 beaker.cache.short_term.expire=60
192 beaker.cache.short_term.expire=60
190 beaker.cache.short_term.key_length = 256
193 beaker.cache.short_term.key_length = 256
191
194
192 beaker.cache.long_term.type=memory
195 beaker.cache.long_term.type=memory
193 beaker.cache.long_term.expire=36000
196 beaker.cache.long_term.expire=36000
194 beaker.cache.long_term.key_length = 256
197 beaker.cache.long_term.key_length = 256
195
198
196 beaker.cache.sql_cache_short.type=memory
199 beaker.cache.sql_cache_short.type=memory
197 beaker.cache.sql_cache_short.expire=10
200 beaker.cache.sql_cache_short.expire=10
198 beaker.cache.sql_cache_short.key_length = 256
201 beaker.cache.sql_cache_short.key_length = 256
199
202
200 beaker.cache.sql_cache_med.type=memory
203 beaker.cache.sql_cache_med.type=memory
201 beaker.cache.sql_cache_med.expire=360
204 beaker.cache.sql_cache_med.expire=360
202 beaker.cache.sql_cache_med.key_length = 256
205 beaker.cache.sql_cache_med.key_length = 256
203
206
204 beaker.cache.sql_cache_long.type=file
207 beaker.cache.sql_cache_long.type=file
205 beaker.cache.sql_cache_long.expire=3600
208 beaker.cache.sql_cache_long.expire=3600
206 beaker.cache.sql_cache_long.key_length = 256
209 beaker.cache.sql_cache_long.key_length = 256
207
210
208 ####################################
211 ####################################
209 ### BEAKER SESSION ####
212 ### BEAKER SESSION ####
210 ####################################
213 ####################################
211 ## Type of storage used for the session, current types are
214 ## Type of storage used for the session, current types are
212 ## dbm, file, memcached, database, and memory.
215 ## dbm, file, memcached, database, and memory.
213 ## The storage uses the Container API
216 ## The storage uses the Container API
214 ## that is also used by the cache system.
217 ## that is also used by the cache system.
215
218
216 ## db session ##
219 ## db session ##
217 #beaker.session.type = ext:database
220 #beaker.session.type = ext:database
218 #beaker.session.sa.url = postgresql://postgres:qwe@localhost/rhodecode
221 #beaker.session.sa.url = postgresql://postgres:qwe@localhost/rhodecode
219 #beaker.session.table_name = db_session
222 #beaker.session.table_name = db_session
220
223
221 ## encrypted cookie client side session, good for many instances ##
224 ## encrypted cookie client side session, good for many instances ##
222 #beaker.session.type = cookie
225 #beaker.session.type = cookie
223
226
224 ## file based cookies (default) ##
227 ## file based cookies (default) ##
225 #beaker.session.type = file
228 #beaker.session.type = file
226
229
227
230
228 beaker.session.key = rhodecode
231 beaker.session.key = rhodecode
229 ## secure cookie requires AES python libraries ##
232 ## secure cookie requires AES python libraries ##
230 #beaker.session.encrypt_key = g654dcno0-9873jhgfreyu
233 #beaker.session.encrypt_key = g654dcno0-9873jhgfreyu
231 #beaker.session.validate_key = 9712sds2212c--zxc123
234 #beaker.session.validate_key = 9712sds2212c--zxc123
232 ## sets session as invalid if it haven't been accessed for given amount of time
235 ## sets session as invalid if it haven't been accessed for given amount of time
233 beaker.session.timeout = 2592000
236 beaker.session.timeout = 2592000
234 beaker.session.httponly = true
237 beaker.session.httponly = true
235 #beaker.session.cookie_path = /<your-prefix>
238 #beaker.session.cookie_path = /<your-prefix>
236
239
237 ## uncomment for https secure cookie ##
240 ## uncomment for https secure cookie ##
238 beaker.session.secure = false
241 beaker.session.secure = false
239
242
240 ## auto save the session to not to use .save() ##
243 ## auto save the session to not to use .save() ##
241 beaker.session.auto = False
244 beaker.session.auto = False
242
245
243 ## default cookie expiration time in seconds `true` expire at browser close ##
246 ## default cookie expiration time in seconds `true` expire at browser close ##
244 #beaker.session.cookie_expires = 3600
247 #beaker.session.cookie_expires = 3600
245
248
246
249
247 ############################
250 ############################
248 ## ERROR HANDLING SYSTEMS ##
251 ## ERROR HANDLING SYSTEMS ##
249 ############################
252 ############################
250
253
251 ####################
254 ####################
252 ### [errormator] ###
255 ### [errormator] ###
253 ####################
256 ####################
254
257
255 # Errormator is tailored to work with RhodeCode, see
258 # Errormator is tailored to work with RhodeCode, see
256 # http://errormator.com for details how to obtain an account
259 # http://errormator.com for details how to obtain an account
257 # you must install python package `errormator_client` to make it work
260 # you must install python package `errormator_client` to make it work
258
261
259 # errormator enabled
262 # errormator enabled
260 errormator = true
263 errormator = true
261
264
262 errormator.server_url = https://api.errormator.com
265 errormator.server_url = https://api.errormator.com
263 errormator.api_key = YOUR_API_KEY
266 errormator.api_key = YOUR_API_KEY
264
267
265 # TWEAK AMOUNT OF INFO SENT HERE
268 # TWEAK AMOUNT OF INFO SENT HERE
266
269
267 # enables 404 error logging (default False)
270 # enables 404 error logging (default False)
268 errormator.report_404 = false
271 errormator.report_404 = false
269
272
270 # time in seconds after request is considered being slow (default 1)
273 # time in seconds after request is considered being slow (default 1)
271 errormator.slow_request_time = 1
274 errormator.slow_request_time = 1
272
275
273 # record slow requests in application
276 # record slow requests in application
274 # (needs to be enabled for slow datastore recording and time tracking)
277 # (needs to be enabled for slow datastore recording and time tracking)
275 errormator.slow_requests = true
278 errormator.slow_requests = true
276
279
277 # enable hooking to application loggers
280 # enable hooking to application loggers
278 # errormator.logging = true
281 # errormator.logging = true
279
282
280 # minimum log level for log capture
283 # minimum log level for log capture
281 # errormator.logging.level = WARNING
284 # errormator.logging.level = WARNING
282
285
283 # send logs only from erroneous/slow requests
286 # send logs only from erroneous/slow requests
284 # (saves API quota for intensive logging)
287 # (saves API quota for intensive logging)
285 errormator.logging_on_error = false
288 errormator.logging_on_error = false
286
289
287 # list of additonal keywords that should be grabbed from environ object
290 # list of additonal keywords that should be grabbed from environ object
288 # can be string with comma separated list of words in lowercase
291 # can be string with comma separated list of words in lowercase
289 # (by default client will always send following info:
292 # (by default client will always send following info:
290 # 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that
293 # 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that
291 # start with HTTP* this list be extended with additional keywords here
294 # start with HTTP* this list be extended with additional keywords here
292 errormator.environ_keys_whitelist =
295 errormator.environ_keys_whitelist =
293
296
294
297
295 # list of keywords that should be blanked from request object
298 # list of keywords that should be blanked from request object
296 # can be string with comma separated list of words in lowercase
299 # can be string with comma separated list of words in lowercase
297 # (by default client will always blank keys that contain following words
300 # (by default client will always blank keys that contain following words
298 # 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'
301 # 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'
299 # this list be extended with additional keywords set here
302 # this list be extended with additional keywords set here
300 errormator.request_keys_blacklist =
303 errormator.request_keys_blacklist =
301
304
302
305
303 # list of namespaces that should be ignores when gathering log entries
306 # list of namespaces that should be ignores when gathering log entries
304 # can be string with comma separated list of namespaces
307 # can be string with comma separated list of namespaces
305 # (by default the client ignores own entries: errormator_client.client)
308 # (by default the client ignores own entries: errormator_client.client)
306 errormator.log_namespace_blacklist =
309 errormator.log_namespace_blacklist =
307
310
308
311
309 ################
312 ################
310 ### [sentry] ###
313 ### [sentry] ###
311 ################
314 ################
312
315
313 # sentry is a alternative open source error aggregator
316 # sentry is a alternative open source error aggregator
314 # you must install python packages `sentry` and `raven` to enable
317 # you must install python packages `sentry` and `raven` to enable
315
318
316 sentry.dsn = YOUR_DNS
319 sentry.dsn = YOUR_DNS
317 sentry.servers =
320 sentry.servers =
318 sentry.name =
321 sentry.name =
319 sentry.key =
322 sentry.key =
320 sentry.public_key =
323 sentry.public_key =
321 sentry.secret_key =
324 sentry.secret_key =
322 sentry.project =
325 sentry.project =
323 sentry.site =
326 sentry.site =
324 sentry.include_paths =
327 sentry.include_paths =
325 sentry.exclude_paths =
328 sentry.exclude_paths =
326
329
327
330
328 ################################################################################
331 ################################################################################
329 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
332 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
330 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
333 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
331 ## execute malicious code after an exception is raised. ##
334 ## execute malicious code after an exception is raised. ##
332 ################################################################################
335 ################################################################################
333 set debug = false
336 set debug = false
334
337
335 ##################################
338 ##################################
336 ### LOGVIEW CONFIG ###
339 ### LOGVIEW CONFIG ###
337 ##################################
340 ##################################
338 logview.sqlalchemy = #faa
341 logview.sqlalchemy = #faa
339 logview.pylons.templating = #bfb
342 logview.pylons.templating = #bfb
340 logview.pylons.util = #eee
343 logview.pylons.util = #eee
341
344
342 #########################################################
345 #########################################################
343 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
346 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
344 #########################################################
347 #########################################################
345 #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
348 #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
346 sqlalchemy.db1.url = postgresql://postgres:qwe@localhost/rhodecode
349 sqlalchemy.db1.url = postgresql://postgres:qwe@localhost/rhodecode
347 sqlalchemy.db1.echo = false
350 sqlalchemy.db1.echo = false
348 sqlalchemy.db1.pool_recycle = 3600
351 sqlalchemy.db1.pool_recycle = 3600
349 sqlalchemy.db1.convert_unicode = true
352 sqlalchemy.db1.convert_unicode = true
350
353
351 ################################
354 ################################
352 ### LOGGING CONFIGURATION ####
355 ### LOGGING CONFIGURATION ####
353 ################################
356 ################################
354 [loggers]
357 [loggers]
355 keys = root, routes, rhodecode, sqlalchemy, beaker, templates, whoosh_indexer
358 keys = root, routes, rhodecode, sqlalchemy, beaker, templates, whoosh_indexer
356
359
357 [handlers]
360 [handlers]
358 keys = console, console_sql
361 keys = console, console_sql
359
362
360 [formatters]
363 [formatters]
361 keys = generic, color_formatter, color_formatter_sql
364 keys = generic, color_formatter, color_formatter_sql
362
365
363 #############
366 #############
364 ## LOGGERS ##
367 ## LOGGERS ##
365 #############
368 #############
366 [logger_root]
369 [logger_root]
367 level = NOTSET
370 level = NOTSET
368 handlers = console
371 handlers = console
369
372
370 [logger_routes]
373 [logger_routes]
371 level = DEBUG
374 level = DEBUG
372 handlers =
375 handlers =
373 qualname = routes.middleware
376 qualname = routes.middleware
374 # "level = DEBUG" logs the route matched and routing variables.
377 # "level = DEBUG" logs the route matched and routing variables.
375 propagate = 1
378 propagate = 1
376
379
377 [logger_beaker]
380 [logger_beaker]
378 level = DEBUG
381 level = DEBUG
379 handlers =
382 handlers =
380 qualname = beaker.container
383 qualname = beaker.container
381 propagate = 1
384 propagate = 1
382
385
383 [logger_templates]
386 [logger_templates]
384 level = INFO
387 level = INFO
385 handlers =
388 handlers =
386 qualname = pylons.templating
389 qualname = pylons.templating
387 propagate = 1
390 propagate = 1
388
391
389 [logger_rhodecode]
392 [logger_rhodecode]
390 level = DEBUG
393 level = DEBUG
391 handlers =
394 handlers =
392 qualname = rhodecode
395 qualname = rhodecode
393 propagate = 1
396 propagate = 1
394
397
395 [logger_sqlalchemy]
398 [logger_sqlalchemy]
396 level = INFO
399 level = INFO
397 handlers = console_sql
400 handlers = console_sql
398 qualname = sqlalchemy.engine
401 qualname = sqlalchemy.engine
399 propagate = 0
402 propagate = 0
400
403
401 [logger_whoosh_indexer]
404 [logger_whoosh_indexer]
402 level = DEBUG
405 level = DEBUG
403 handlers =
406 handlers =
404 qualname = whoosh_indexer
407 qualname = whoosh_indexer
405 propagate = 1
408 propagate = 1
406
409
407 ##############
410 ##############
408 ## HANDLERS ##
411 ## HANDLERS ##
409 ##############
412 ##############
410
413
411 [handler_console]
414 [handler_console]
412 class = StreamHandler
415 class = StreamHandler
413 args = (sys.stderr,)
416 args = (sys.stderr,)
414 level = INFO
417 level = INFO
415 formatter = generic
418 formatter = generic
416
419
417 [handler_console_sql]
420 [handler_console_sql]
418 class = StreamHandler
421 class = StreamHandler
419 args = (sys.stderr,)
422 args = (sys.stderr,)
420 level = WARN
423 level = WARN
421 formatter = generic
424 formatter = generic
422
425
423 ################
426 ################
424 ## FORMATTERS ##
427 ## FORMATTERS ##
425 ################
428 ################
426
429
427 [formatter_generic]
430 [formatter_generic]
428 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
431 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
429 datefmt = %Y-%m-%d %H:%M:%S
432 datefmt = %Y-%m-%d %H:%M:%S
430
433
431 [formatter_color_formatter]
434 [formatter_color_formatter]
432 class=rhodecode.lib.colored_formatter.ColorFormatter
435 class=rhodecode.lib.colored_formatter.ColorFormatter
433 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
436 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
434 datefmt = %Y-%m-%d %H:%M:%S
437 datefmt = %Y-%m-%d %H:%M:%S
435
438
436 [formatter_color_formatter_sql]
439 [formatter_color_formatter_sql]
437 class=rhodecode.lib.colored_formatter.ColorFormatterSql
440 class=rhodecode.lib.colored_formatter.ColorFormatterSql
438 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
441 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
439 datefmt = %Y-%m-%d %H:%M:%S
442 datefmt = %Y-%m-%d %H:%M:%S
@@ -1,449 +1,452 b''
1 ################################################################################
1 ################################################################################
2 ################################################################################
2 ################################################################################
3 # RhodeCode - Pylons environment configuration #
3 # RhodeCode - Pylons environment configuration #
4 # #
4 # #
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 pdebug = false
10 pdebug = false
11 ################################################################################
11 ################################################################################
12 ## Uncomment and replace with the address which should receive ##
12 ## Uncomment and replace with the address which should receive ##
13 ## any error reports after application crash ##
13 ## any error reports after application crash ##
14 ## Additionally those settings will be used by RhodeCode mailing system ##
14 ## Additionally those settings will be used by RhodeCode mailing system ##
15 ################################################################################
15 ################################################################################
16 #email_to = admin@localhost
16 #email_to = admin@localhost
17 #error_email_from = paste_error@localhost
17 #error_email_from = paste_error@localhost
18 #app_email_from = rhodecode-noreply@localhost
18 #app_email_from = rhodecode-noreply@localhost
19 #error_message =
19 #error_message =
20 #email_prefix = [RhodeCode]
20 #email_prefix = [RhodeCode]
21
21
22 #smtp_server = mail.server.com
22 #smtp_server = mail.server.com
23 #smtp_username =
23 #smtp_username =
24 #smtp_password =
24 #smtp_password =
25 #smtp_port =
25 #smtp_port =
26 #smtp_use_tls = false
26 #smtp_use_tls = false
27 #smtp_use_ssl = true
27 #smtp_use_ssl = true
28 # Specify available auth parameters here (e.g. LOGIN PLAIN CRAM-MD5, etc.)
28 # Specify available auth parameters here (e.g. LOGIN PLAIN CRAM-MD5, etc.)
29 #smtp_auth =
29 #smtp_auth =
30
30
31 [server:main]
31 [server:main]
32 ## PASTE
32 ## PASTE
33 ##nr of threads to spawn
33 ##nr of threads to spawn
34 #threadpool_workers = 5
34 #threadpool_workers = 5
35
35
36 ##max request before thread respawn
36 ##max request before thread respawn
37 #threadpool_max_requests = 10
37 #threadpool_max_requests = 10
38
38
39 ##option to use threads of process
39 ##option to use threads of process
40 #use_threadpool = true
40 #use_threadpool = true
41
41
42 #use = egg:Paste#http
42 #use = egg:Paste#http
43
43
44 #WAITRESS
44 #WAITRESS
45 threads = 5
45 threads = 5
46 use = egg:waitress#main
46 use = egg:waitress#main
47
47
48 host = 127.0.0.1
48 host = 127.0.0.1
49 port = 5000
49 port = 5000
50
50
51 [filter:proxy-prefix]
51 [filter:proxy-prefix]
52 # prefix middleware for rc
52 # prefix middleware for rc
53 use = egg:PasteDeploy#prefix
53 use = egg:PasteDeploy#prefix
54 prefix = /<your-prefix>
54 prefix = /<your-prefix>
55
55
56 [app:main]
56 [app:main]
57 use = egg:rhodecode
57 use = egg:rhodecode
58 #filter-with = proxy-prefix
58 #filter-with = proxy-prefix
59 full_stack = true
59 full_stack = true
60 static_files = true
60 static_files = true
61 # Optional Languages
61 # Optional Languages
62 # en, fr, ja, pt_BR, zh_CN, zh_TW, pl
62 # en, fr, ja, pt_BR, zh_CN, zh_TW, pl
63 lang = en
63 lang = en
64 cache_dir = %(here)s/data
64 cache_dir = %(here)s/data
65 index_dir = %(here)s/data/index
65 index_dir = %(here)s/data/index
66 app_instance_uuid = ${app_instance_uuid}
66 app_instance_uuid = ${app_instance_uuid}
67 cut_off_limit = 256000
67 cut_off_limit = 256000
68 vcs_full_cache = True
68 vcs_full_cache = True
69 # force https in RhodeCode, fixes https redirects, assumes it's always https
69 force_https = false
70 force_https = false
71 # use Strict-Transport-Security headers
72 use_htsts = false
70 commit_parse_limit = 50
73 commit_parse_limit = 50
71 # number of items displayed in lightweight dashboard before paginating
74 # number of items displayed in lightweight dashboard before paginating
72 dashboard_items = 100
75 dashboard_items = 100
73 use_gravatar = true
76 use_gravatar = true
74
77
75 ## RSS feed options
78 ## RSS feed options
76
79
77 rss_cut_off_limit = 256000
80 rss_cut_off_limit = 256000
78 rss_items_per_page = 10
81 rss_items_per_page = 10
79 rss_include_diff = false
82 rss_include_diff = false
80
83
81
84
82 ## alternative_gravatar_url allows you to use your own avatar server application
85 ## alternative_gravatar_url allows you to use your own avatar server application
83 ## the following parts of the URL will be replaced
86 ## the following parts of the URL will be replaced
84 ## {email} user email
87 ## {email} user email
85 ## {md5email} md5 hash of the user email (like at gravatar.com)
88 ## {md5email} md5 hash of the user email (like at gravatar.com)
86 ## {size} size of the image that is expected from the server application
89 ## {size} size of the image that is expected from the server application
87 ## {scheme} http/https from RhodeCode server
90 ## {scheme} http/https from RhodeCode server
88 ## {netloc} network location from RhodeCode server
91 ## {netloc} network location from RhodeCode server
89 #alternative_gravatar_url = http://myavatarserver.com/getbyemail/{email}/{size}
92 #alternative_gravatar_url = http://myavatarserver.com/getbyemail/{email}/{size}
90 #alternative_gravatar_url = http://myavatarserver.com/getbymd5/{md5email}?s={size}
93 #alternative_gravatar_url = http://myavatarserver.com/getbymd5/{md5email}?s={size}
91
94
92 container_auth_enabled = false
95 container_auth_enabled = false
93 proxypass_auth_enabled = false
96 proxypass_auth_enabled = false
94 ## default encoding used to convert from and to unicode
97 ## default encoding used to convert from and to unicode
95 ## can be also a comma seperated list of encoding in case of mixed encodings
98 ## can be also a comma seperated list of encoding in case of mixed encodings
96 default_encoding = utf8
99 default_encoding = utf8
97
100
98 ## overwrite schema of clone url
101 ## overwrite schema of clone url
99 ## available vars:
102 ## available vars:
100 ## scheme - http/https
103 ## scheme - http/https
101 ## user - current user
104 ## user - current user
102 ## pass - password
105 ## pass - password
103 ## netloc - network location
106 ## netloc - network location
104 ## path - usually repo_name
107 ## path - usually repo_name
105
108
106 #clone_uri = {scheme}://{user}{pass}{netloc}{path}
109 #clone_uri = {scheme}://{user}{pass}{netloc}{path}
107
110
108 ## issue tracking mapping for commits messages
111 ## issue tracking mapping for commits messages
109 ## comment out issue_pat, issue_server, issue_prefix to enable
112 ## comment out issue_pat, issue_server, issue_prefix to enable
110
113
111 ## pattern to get the issues from commit messages
114 ## pattern to get the issues from commit messages
112 ## default one used here is #<numbers> with a regex passive group for `#`
115 ## default one used here is #<numbers> with a regex passive group for `#`
113 ## {id} will be all groups matched from this pattern
116 ## {id} will be all groups matched from this pattern
114
117
115 issue_pat = (?:\s*#)(\d+)
118 issue_pat = (?:\s*#)(\d+)
116
119
117 ## server url to the issue, each {id} will be replaced with match
120 ## server url to the issue, each {id} will be replaced with match
118 ## fetched from the regex and {repo} is replaced with full repository name
121 ## fetched from the regex and {repo} is replaced with full repository name
119 ## including groups {repo_name} is replaced with just name of repo
122 ## including groups {repo_name} is replaced with just name of repo
120
123
121 issue_server_link = https://myissueserver.com/{repo}/issue/{id}
124 issue_server_link = https://myissueserver.com/{repo}/issue/{id}
122
125
123 ## prefix to add to link to indicate it's an url
126 ## prefix to add to link to indicate it's an url
124 ## #314 will be replaced by <issue_prefix><id>
127 ## #314 will be replaced by <issue_prefix><id>
125
128
126 issue_prefix = #
129 issue_prefix = #
127
130
128 ## issue_pat, issue_server_link, issue_prefix can have suffixes to specify
131 ## issue_pat, issue_server_link, issue_prefix can have suffixes to specify
129 ## multiple patterns, to other issues server, wiki or others
132 ## multiple patterns, to other issues server, wiki or others
130 ## below an example how to create a wiki pattern
133 ## below an example how to create a wiki pattern
131 # #wiki-some-id -> https://mywiki.com/some-id
134 # #wiki-some-id -> https://mywiki.com/some-id
132
135
133 #issue_pat_wiki = (?:wiki-)(.+)
136 #issue_pat_wiki = (?:wiki-)(.+)
134 #issue_server_link_wiki = https://mywiki.com/{id}
137 #issue_server_link_wiki = https://mywiki.com/{id}
135 #issue_prefix_wiki = WIKI-
138 #issue_prefix_wiki = WIKI-
136
139
137
140
138 ## instance-id prefix
141 ## instance-id prefix
139 ## a prefix key for this instance used for cache invalidation when running
142 ## a prefix key for this instance used for cache invalidation when running
140 ## multiple instances of rhodecode, make sure it's globally unique for
143 ## multiple instances of rhodecode, make sure it's globally unique for
141 ## all running rhodecode instances. Leave empty if you don't use it
144 ## all running rhodecode instances. Leave empty if you don't use it
142 instance_id =
145 instance_id =
143
146
144 ## alternative return HTTP header for failed authentication. Default HTTP
147 ## alternative return HTTP header for failed authentication. Default HTTP
145 ## response is 401 HTTPUnauthorized. Currently HG clients have troubles with
148 ## response is 401 HTTPUnauthorized. Currently HG clients have troubles with
146 ## handling that. Set this variable to 403 to return HTTPForbidden
149 ## handling that. Set this variable to 403 to return HTTPForbidden
147 auth_ret_code =
150 auth_ret_code =
148
151
149 ####################################
152 ####################################
150 ### CELERY CONFIG ####
153 ### CELERY CONFIG ####
151 ####################################
154 ####################################
152 use_celery = false
155 use_celery = false
153 broker.host = localhost
156 broker.host = localhost
154 broker.vhost = rabbitmqhost
157 broker.vhost = rabbitmqhost
155 broker.port = 5672
158 broker.port = 5672
156 broker.user = rabbitmq
159 broker.user = rabbitmq
157 broker.password = qweqwe
160 broker.password = qweqwe
158
161
159 celery.imports = rhodecode.lib.celerylib.tasks
162 celery.imports = rhodecode.lib.celerylib.tasks
160
163
161 celery.result.backend = amqp
164 celery.result.backend = amqp
162 celery.result.dburi = amqp://
165 celery.result.dburi = amqp://
163 celery.result.serialier = json
166 celery.result.serialier = json
164
167
165 #celery.send.task.error.emails = true
168 #celery.send.task.error.emails = true
166 #celery.amqp.task.result.expires = 18000
169 #celery.amqp.task.result.expires = 18000
167
170
168 celeryd.concurrency = 2
171 celeryd.concurrency = 2
169 #celeryd.log.file = celeryd.log
172 #celeryd.log.file = celeryd.log
170 celeryd.log.level = debug
173 celeryd.log.level = debug
171 celeryd.max.tasks.per.child = 1
174 celeryd.max.tasks.per.child = 1
172
175
173 #tasks will never be sent to the queue, but executed locally instead.
176 #tasks will never be sent to the queue, but executed locally instead.
174 celery.always.eager = false
177 celery.always.eager = false
175
178
176 ####################################
179 ####################################
177 ### BEAKER CACHE ####
180 ### BEAKER CACHE ####
178 ####################################
181 ####################################
179 beaker.cache.data_dir=%(here)s/data/cache/data
182 beaker.cache.data_dir=%(here)s/data/cache/data
180 beaker.cache.lock_dir=%(here)s/data/cache/lock
183 beaker.cache.lock_dir=%(here)s/data/cache/lock
181
184
182 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
185 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
183
186
184 beaker.cache.super_short_term.type=memory
187 beaker.cache.super_short_term.type=memory
185 beaker.cache.super_short_term.expire=10
188 beaker.cache.super_short_term.expire=10
186 beaker.cache.super_short_term.key_length = 256
189 beaker.cache.super_short_term.key_length = 256
187
190
188 beaker.cache.short_term.type=memory
191 beaker.cache.short_term.type=memory
189 beaker.cache.short_term.expire=60
192 beaker.cache.short_term.expire=60
190 beaker.cache.short_term.key_length = 256
193 beaker.cache.short_term.key_length = 256
191
194
192 beaker.cache.long_term.type=memory
195 beaker.cache.long_term.type=memory
193 beaker.cache.long_term.expire=36000
196 beaker.cache.long_term.expire=36000
194 beaker.cache.long_term.key_length = 256
197 beaker.cache.long_term.key_length = 256
195
198
196 beaker.cache.sql_cache_short.type=memory
199 beaker.cache.sql_cache_short.type=memory
197 beaker.cache.sql_cache_short.expire=10
200 beaker.cache.sql_cache_short.expire=10
198 beaker.cache.sql_cache_short.key_length = 256
201 beaker.cache.sql_cache_short.key_length = 256
199
202
200 beaker.cache.sql_cache_med.type=memory
203 beaker.cache.sql_cache_med.type=memory
201 beaker.cache.sql_cache_med.expire=360
204 beaker.cache.sql_cache_med.expire=360
202 beaker.cache.sql_cache_med.key_length = 256
205 beaker.cache.sql_cache_med.key_length = 256
203
206
204 beaker.cache.sql_cache_long.type=file
207 beaker.cache.sql_cache_long.type=file
205 beaker.cache.sql_cache_long.expire=3600
208 beaker.cache.sql_cache_long.expire=3600
206 beaker.cache.sql_cache_long.key_length = 256
209 beaker.cache.sql_cache_long.key_length = 256
207
210
208 ####################################
211 ####################################
209 ### BEAKER SESSION ####
212 ### BEAKER SESSION ####
210 ####################################
213 ####################################
211 ## Type of storage used for the session, current types are
214 ## Type of storage used for the session, current types are
212 ## dbm, file, memcached, database, and memory.
215 ## dbm, file, memcached, database, and memory.
213 ## The storage uses the Container API
216 ## The storage uses the Container API
214 ## that is also used by the cache system.
217 ## that is also used by the cache system.
215
218
216 ## db session ##
219 ## db session ##
217 #beaker.session.type = ext:database
220 #beaker.session.type = ext:database
218 #beaker.session.sa.url = postgresql://postgres:qwe@localhost/rhodecode
221 #beaker.session.sa.url = postgresql://postgres:qwe@localhost/rhodecode
219 #beaker.session.table_name = db_session
222 #beaker.session.table_name = db_session
220
223
221 ## encrypted cookie client side session, good for many instances ##
224 ## encrypted cookie client side session, good for many instances ##
222 #beaker.session.type = cookie
225 #beaker.session.type = cookie
223
226
224 ## file based cookies (default) ##
227 ## file based cookies (default) ##
225 #beaker.session.type = file
228 #beaker.session.type = file
226
229
227
230
228 beaker.session.key = rhodecode
231 beaker.session.key = rhodecode
229 ## secure cookie requires AES python libraries ##
232 ## secure cookie requires AES python libraries ##
230 #beaker.session.encrypt_key = g654dcno0-9873jhgfreyu
233 #beaker.session.encrypt_key = g654dcno0-9873jhgfreyu
231 #beaker.session.validate_key = 9712sds2212c--zxc123
234 #beaker.session.validate_key = 9712sds2212c--zxc123
232 ## sets session as invalid if it haven't been accessed for given amount of time
235 ## sets session as invalid if it haven't been accessed for given amount of time
233 beaker.session.timeout = 2592000
236 beaker.session.timeout = 2592000
234 beaker.session.httponly = true
237 beaker.session.httponly = true
235 #beaker.session.cookie_path = /<your-prefix>
238 #beaker.session.cookie_path = /<your-prefix>
236
239
237 ## uncomment for https secure cookie ##
240 ## uncomment for https secure cookie ##
238 beaker.session.secure = false
241 beaker.session.secure = false
239
242
240 ## auto save the session to not to use .save() ##
243 ## auto save the session to not to use .save() ##
241 beaker.session.auto = False
244 beaker.session.auto = False
242
245
243 ## default cookie expiration time in seconds `true` expire at browser close ##
246 ## default cookie expiration time in seconds `true` expire at browser close ##
244 #beaker.session.cookie_expires = 3600
247 #beaker.session.cookie_expires = 3600
245
248
246
249
247 ############################
250 ############################
248 ## ERROR HANDLING SYSTEMS ##
251 ## ERROR HANDLING SYSTEMS ##
249 ############################
252 ############################
250
253
251 ####################
254 ####################
252 ### [errormator] ###
255 ### [errormator] ###
253 ####################
256 ####################
254
257
255 # Errormator is tailored to work with RhodeCode, see
258 # Errormator is tailored to work with RhodeCode, see
256 # http://errormator.com for details how to obtain an account
259 # http://errormator.com for details how to obtain an account
257 # you must install python package `errormator_client` to make it work
260 # you must install python package `errormator_client` to make it work
258
261
259 # errormator enabled
262 # errormator enabled
260 errormator = true
263 errormator = true
261
264
262 errormator.server_url = https://api.errormator.com
265 errormator.server_url = https://api.errormator.com
263 errormator.api_key = YOUR_API_KEY
266 errormator.api_key = YOUR_API_KEY
264
267
265 # TWEAK AMOUNT OF INFO SENT HERE
268 # TWEAK AMOUNT OF INFO SENT HERE
266
269
267 # enables 404 error logging (default False)
270 # enables 404 error logging (default False)
268 errormator.report_404 = false
271 errormator.report_404 = false
269
272
270 # time in seconds after request is considered being slow (default 1)
273 # time in seconds after request is considered being slow (default 1)
271 errormator.slow_request_time = 1
274 errormator.slow_request_time = 1
272
275
273 # record slow requests in application
276 # record slow requests in application
274 # (needs to be enabled for slow datastore recording and time tracking)
277 # (needs to be enabled for slow datastore recording and time tracking)
275 errormator.slow_requests = true
278 errormator.slow_requests = true
276
279
277 # enable hooking to application loggers
280 # enable hooking to application loggers
278 # errormator.logging = true
281 # errormator.logging = true
279
282
280 # minimum log level for log capture
283 # minimum log level for log capture
281 # errormator.logging.level = WARNING
284 # errormator.logging.level = WARNING
282
285
283 # send logs only from erroneous/slow requests
286 # send logs only from erroneous/slow requests
284 # (saves API quota for intensive logging)
287 # (saves API quota for intensive logging)
285 errormator.logging_on_error = false
288 errormator.logging_on_error = false
286
289
287 # list of additonal keywords that should be grabbed from environ object
290 # list of additonal keywords that should be grabbed from environ object
288 # can be string with comma separated list of words in lowercase
291 # can be string with comma separated list of words in lowercase
289 # (by default client will always send following info:
292 # (by default client will always send following info:
290 # 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that
293 # 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that
291 # start with HTTP* this list be extended with additional keywords here
294 # start with HTTP* this list be extended with additional keywords here
292 errormator.environ_keys_whitelist =
295 errormator.environ_keys_whitelist =
293
296
294
297
295 # list of keywords that should be blanked from request object
298 # list of keywords that should be blanked from request object
296 # can be string with comma separated list of words in lowercase
299 # can be string with comma separated list of words in lowercase
297 # (by default client will always blank keys that contain following words
300 # (by default client will always blank keys that contain following words
298 # 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'
301 # 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'
299 # this list be extended with additional keywords set here
302 # this list be extended with additional keywords set here
300 errormator.request_keys_blacklist =
303 errormator.request_keys_blacklist =
301
304
302
305
303 # list of namespaces that should be ignores when gathering log entries
306 # list of namespaces that should be ignores when gathering log entries
304 # can be string with comma separated list of namespaces
307 # can be string with comma separated list of namespaces
305 # (by default the client ignores own entries: errormator_client.client)
308 # (by default the client ignores own entries: errormator_client.client)
306 errormator.log_namespace_blacklist =
309 errormator.log_namespace_blacklist =
307
310
308
311
309 ################
312 ################
310 ### [sentry] ###
313 ### [sentry] ###
311 ################
314 ################
312
315
313 # sentry is a alternative open source error aggregator
316 # sentry is a alternative open source error aggregator
314 # you must install python packages `sentry` and `raven` to enable
317 # you must install python packages `sentry` and `raven` to enable
315
318
316 sentry.dsn = YOUR_DNS
319 sentry.dsn = YOUR_DNS
317 sentry.servers =
320 sentry.servers =
318 sentry.name =
321 sentry.name =
319 sentry.key =
322 sentry.key =
320 sentry.public_key =
323 sentry.public_key =
321 sentry.secret_key =
324 sentry.secret_key =
322 sentry.project =
325 sentry.project =
323 sentry.site =
326 sentry.site =
324 sentry.include_paths =
327 sentry.include_paths =
325 sentry.exclude_paths =
328 sentry.exclude_paths =
326
329
327
330
328 ################################################################################
331 ################################################################################
329 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
332 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
330 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
333 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
331 ## execute malicious code after an exception is raised. ##
334 ## execute malicious code after an exception is raised. ##
332 ################################################################################
335 ################################################################################
333 set debug = false
336 set debug = false
334
337
335 ##################################
338 ##################################
336 ### LOGVIEW CONFIG ###
339 ### LOGVIEW CONFIG ###
337 ##################################
340 ##################################
338 logview.sqlalchemy = #faa
341 logview.sqlalchemy = #faa
339 logview.pylons.templating = #bfb
342 logview.pylons.templating = #bfb
340 logview.pylons.util = #eee
343 logview.pylons.util = #eee
341
344
342 #########################################################
345 #########################################################
343 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
346 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
344 #########################################################
347 #########################################################
345
348
346 # SQLITE [default]
349 # SQLITE [default]
347 sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
350 sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
348
351
349 # POSTGRESQL
352 # POSTGRESQL
350 # sqlalchemy.db1.url = postgresql://user:pass@localhost/rhodecode
353 # sqlalchemy.db1.url = postgresql://user:pass@localhost/rhodecode
351
354
352 # MySQL
355 # MySQL
353 # sqlalchemy.db1.url = mysql://user:pass@localhost/rhodecode
356 # sqlalchemy.db1.url = mysql://user:pass@localhost/rhodecode
354
357
355 # see sqlalchemy docs for others
358 # see sqlalchemy docs for others
356
359
357 sqlalchemy.db1.echo = false
360 sqlalchemy.db1.echo = false
358 sqlalchemy.db1.pool_recycle = 3600
361 sqlalchemy.db1.pool_recycle = 3600
359 sqlalchemy.db1.convert_unicode = true
362 sqlalchemy.db1.convert_unicode = true
360
363
361 ################################
364 ################################
362 ### LOGGING CONFIGURATION ####
365 ### LOGGING CONFIGURATION ####
363 ################################
366 ################################
364 [loggers]
367 [loggers]
365 keys = root, routes, rhodecode, sqlalchemy, beaker, templates, whoosh_indexer
368 keys = root, routes, rhodecode, sqlalchemy, beaker, templates, whoosh_indexer
366
369
367 [handlers]
370 [handlers]
368 keys = console, console_sql
371 keys = console, console_sql
369
372
370 [formatters]
373 [formatters]
371 keys = generic, color_formatter, color_formatter_sql
374 keys = generic, color_formatter, color_formatter_sql
372
375
373 #############
376 #############
374 ## LOGGERS ##
377 ## LOGGERS ##
375 #############
378 #############
376 [logger_root]
379 [logger_root]
377 level = NOTSET
380 level = NOTSET
378 handlers = console
381 handlers = console
379
382
380 [logger_routes]
383 [logger_routes]
381 level = DEBUG
384 level = DEBUG
382 handlers =
385 handlers =
383 qualname = routes.middleware
386 qualname = routes.middleware
384 # "level = DEBUG" logs the route matched and routing variables.
387 # "level = DEBUG" logs the route matched and routing variables.
385 propagate = 1
388 propagate = 1
386
389
387 [logger_beaker]
390 [logger_beaker]
388 level = DEBUG
391 level = DEBUG
389 handlers =
392 handlers =
390 qualname = beaker.container
393 qualname = beaker.container
391 propagate = 1
394 propagate = 1
392
395
393 [logger_templates]
396 [logger_templates]
394 level = INFO
397 level = INFO
395 handlers =
398 handlers =
396 qualname = pylons.templating
399 qualname = pylons.templating
397 propagate = 1
400 propagate = 1
398
401
399 [logger_rhodecode]
402 [logger_rhodecode]
400 level = DEBUG
403 level = DEBUG
401 handlers =
404 handlers =
402 qualname = rhodecode
405 qualname = rhodecode
403 propagate = 1
406 propagate = 1
404
407
405 [logger_sqlalchemy]
408 [logger_sqlalchemy]
406 level = INFO
409 level = INFO
407 handlers = console_sql
410 handlers = console_sql
408 qualname = sqlalchemy.engine
411 qualname = sqlalchemy.engine
409 propagate = 0
412 propagate = 0
410
413
411 [logger_whoosh_indexer]
414 [logger_whoosh_indexer]
412 level = DEBUG
415 level = DEBUG
413 handlers =
416 handlers =
414 qualname = whoosh_indexer
417 qualname = whoosh_indexer
415 propagate = 1
418 propagate = 1
416
419
417 ##############
420 ##############
418 ## HANDLERS ##
421 ## HANDLERS ##
419 ##############
422 ##############
420
423
421 [handler_console]
424 [handler_console]
422 class = StreamHandler
425 class = StreamHandler
423 args = (sys.stderr,)
426 args = (sys.stderr,)
424 level = INFO
427 level = INFO
425 formatter = generic
428 formatter = generic
426
429
427 [handler_console_sql]
430 [handler_console_sql]
428 class = StreamHandler
431 class = StreamHandler
429 args = (sys.stderr,)
432 args = (sys.stderr,)
430 level = WARN
433 level = WARN
431 formatter = generic
434 formatter = generic
432
435
433 ################
436 ################
434 ## FORMATTERS ##
437 ## FORMATTERS ##
435 ################
438 ################
436
439
437 [formatter_generic]
440 [formatter_generic]
438 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
441 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
439 datefmt = %Y-%m-%d %H:%M:%S
442 datefmt = %Y-%m-%d %H:%M:%S
440
443
441 [formatter_color_formatter]
444 [formatter_color_formatter]
442 class=rhodecode.lib.colored_formatter.ColorFormatter
445 class=rhodecode.lib.colored_formatter.ColorFormatter
443 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
446 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
444 datefmt = %Y-%m-%d %H:%M:%S
447 datefmt = %Y-%m-%d %H:%M:%S
445
448
446 [formatter_color_formatter_sql]
449 [formatter_color_formatter_sql]
447 class=rhodecode.lib.colored_formatter.ColorFormatterSql
450 class=rhodecode.lib.colored_formatter.ColorFormatterSql
448 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
451 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
449 datefmt = %Y-%m-%d %H:%M:%S
452 datefmt = %Y-%m-%d %H:%M:%S
@@ -1,66 +1,71 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """
2 """
3 rhodecode.lib.middleware.https_fixup
3 rhodecode.lib.middleware.https_fixup
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5
5
6 middleware to handle https correctly
6 middleware to handle https correctly
7
7
8 :created_on: May 23, 2010
8 :created_on: May 23, 2010
9 :author: marcink
9 :author: marcink
10 :copyright: (C) 2010-2012 Marcin Kuzminski <marcin@python-works.com>
10 :copyright: (C) 2010-2012 Marcin Kuzminski <marcin@python-works.com>
11 :license: GPLv3, see COPYING for more details.
11 :license: GPLv3, see COPYING for more details.
12 """
12 """
13 # This program is free software: you can redistribute it and/or modify
13 # This program is free software: you can redistribute it and/or modify
14 # it under the terms of the GNU General Public License as published by
14 # it under the terms of the GNU General Public License as published by
15 # the Free Software Foundation, either version 3 of the License, or
15 # the Free Software Foundation, either version 3 of the License, or
16 # (at your option) any later version.
16 # (at your option) any later version.
17 #
17 #
18 # This program is distributed in the hope that it will be useful,
18 # This program is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 # GNU General Public License for more details.
21 # GNU General Public License for more details.
22 #
22 #
23 # You should have received a copy of the GNU General Public License
23 # You should have received a copy of the GNU General Public License
24 # along with this program. If not, see <http://www.gnu.org/licenses/>.
24 # along with this program. If not, see <http://www.gnu.org/licenses/>.
25
25
26 from pylons.controllers.util import Request
26 from pylons.controllers.util import Request
27 from rhodecode.lib.utils2 import str2bool
27 from rhodecode.lib.utils2 import str2bool
28
28
29
29
30 class HttpsFixup(object):
30 class HttpsFixup(object):
31
31
32 def __init__(self, app, config):
32 def __init__(self, app, config):
33 self.application = app
33 self.application = app
34 self.config = config
34 self.config = config
35
35
36 def __call__(self, environ, start_response):
36 def __call__(self, environ, start_response):
37 self.__fixup(environ)
37 self.__fixup(environ)
38 req = Request(environ)
38 debug = str2bool(self.config.get('debug'))
39 resp = req.get_response(self.application)
39 if str2bool(self.config.get('use_htsts')) and not debug:
40 if environ['wsgi.url_scheme'] == 'https':
40 req = Request(environ, self.application)
41 resp.headers['Strict-Transport-Security'] = 'max-age=8640000; includeSubDomains'
41 resp = req.get_response(self.application)
42 return resp(environ, start_response)
42 if environ['wsgi.url_scheme'] == 'https':
43 resp.headers['Strict-Transport-Security'] = \
44 'max-age=8640000; includeSubDomains'
45 return resp(environ, start_response)
46
47 return self.application(environ, start_response)
43
48
44 def __fixup(self, environ):
49 def __fixup(self, environ):
45 """
50 """
46 Function to fixup the environ as needed. In order to use this
51 Function to fixup the environ as needed. In order to use this
47 middleware you should set this header inside your
52 middleware you should set this header inside your
48 proxy ie. nginx, apache etc.
53 proxy ie. nginx, apache etc.
49 """
54 """
50 # DETECT PROTOCOL !
55 # DETECT PROTOCOL !
51 if 'HTTP_X_URL_SCHEME' in environ:
56 if 'HTTP_X_URL_SCHEME' in environ:
52 proto = environ.get('HTTP_X_URL_SCHEME')
57 proto = environ.get('HTTP_X_URL_SCHEME')
53 elif 'HTTP_X_FORWARDED_SCHEME' in environ:
58 elif 'HTTP_X_FORWARDED_SCHEME' in environ:
54 proto = environ.get('HTTP_X_FORWARDED_SCHEME')
59 proto = environ.get('HTTP_X_FORWARDED_SCHEME')
55 elif 'HTTP_X_FORWARDED_PROTO' in environ:
60 elif 'HTTP_X_FORWARDED_PROTO' in environ:
56 proto = environ.get('HTTP_X_FORWARDED_PROTO')
61 proto = environ.get('HTTP_X_FORWARDED_PROTO')
57 else:
62 else:
58 proto = 'http'
63 proto = 'http'
59 org_proto = proto
64 org_proto = proto
60
65
61 # if we have force, just override
66 # if we have force, just override
62 if str2bool(self.config.get('force_https')):
67 if str2bool(self.config.get('force_https')):
63 proto = 'https'
68 proto = 'https'
64
69
65 environ['wsgi.url_scheme'] = proto
70 environ['wsgi.url_scheme'] = proto
66 environ['wsgi._org_proto'] = org_proto
71 environ['wsgi._org_proto'] = org_proto
General Comments 0
You need to be logged in to leave comments. Login now