##// END OF EJS Templates
ini: create separate log handlers for color and null, and add comments hinting how they can be used...
Mads Kiilerich -
r7675:609d52bb default
parent child Browse files
Show More
@@ -1,463 +1,478 b''
1 1 ################################################################################
2 2 ################################################################################
3 3 # Kallithea - config file generated with kallithea-config #
4 4 # #
5 5 # The %(here)s variable will be replaced with the parent directory of this file#
6 6 ################################################################################
7 7 ################################################################################
8 8
9 9 [DEFAULT]
10 10
11 11 ################################################################################
12 12 ## Email settings ##
13 13 ## ##
14 14 ## Refer to the documentation ("Email settings") for more details. ##
15 15 ## ##
16 16 ## It is recommended to use a valid sender address that passes access ##
17 17 ## validation and spam filtering in mail servers. ##
18 18 ################################################################################
19 19
20 20 ## 'From' header for application emails. You can optionally add a name.
21 21 ## Default:
22 22 #app_email_from = Kallithea
23 23 ## Examples:
24 24 #app_email_from = Kallithea <kallithea-noreply@example.com>
25 25 #app_email_from = kallithea-noreply@example.com
26 26
27 27 ## Subject prefix for application emails.
28 28 ## A space between this prefix and the real subject is automatically added.
29 29 ## Default:
30 30 #email_prefix =
31 31 ## Example:
32 32 #email_prefix = [Kallithea]
33 33
34 34 ## Recipients for error emails and fallback recipients of application mails.
35 35 ## Multiple addresses can be specified, comma-separated.
36 36 ## Only addresses are allowed, do not add any name part.
37 37 ## Default:
38 38 #email_to =
39 39 ## Examples:
40 40 #email_to = admin@example.com
41 41 #email_to = admin@example.com,another_admin@example.com
42 42 email_to =
43 43
44 44 ## 'From' header for error emails. You can optionally add a name.
45 45 ## Default: (none)
46 46 ## Examples:
47 47 #error_email_from = Kallithea Errors <kallithea-noreply@example.com>
48 48 #error_email_from = kallithea_errors@example.com
49 49 error_email_from =
50 50
51 51 ## SMTP server settings
52 52 ## If specifying credentials, make sure to use secure connections.
53 53 ## Default: Send unencrypted unauthenticated mails to the specified smtp_server.
54 54 ## For "SSL", use smtp_use_ssl = true and smtp_port = 465.
55 55 ## For "STARTTLS", use smtp_use_tls = true and smtp_port = 587.
56 56 smtp_server =
57 57 #smtp_username =
58 58 #smtp_password =
59 59 smtp_port =
60 60 #smtp_use_ssl = false
61 61 #smtp_use_tls = false
62 62
63 63 ## Entry point for 'gearbox serve'
64 64 [server:main]
65 65 #host = 127.0.0.1
66 66 host = 0.0.0.0
67 67 port = 5000
68 68
69 69 ## WAITRESS ##
70 70 use = egg:waitress#main
71 71 ## number of worker threads
72 72 threads = 1
73 73 ## MAX BODY SIZE 100GB
74 74 max_request_body_size = 107374182400
75 75 ## use poll instead of select, fixes fd limits, may not work on old
76 76 ## windows systems.
77 77 #asyncore_use_poll = True
78 78
79 79 ## middleware for hosting the WSGI application under a URL prefix
80 80 #[filter:proxy-prefix]
81 81 #use = egg:PasteDeploy#prefix
82 82 #prefix = /<your-prefix>
83 83
84 84 [app:main]
85 85 use = egg:kallithea
86 86 ## enable proxy prefix middleware
87 87 #filter-with = proxy-prefix
88 88
89 89 full_stack = true
90 90 static_files = true
91 91
92 92 ## Internationalization (see setup documentation for details)
93 93 ## By default, the language requested by the browser is used if available.
94 94 #i18n.enabled = false
95 95 ## Fallback language, empty for English (valid values are the names of subdirectories in kallithea/i18n):
96 96 i18n.lang =
97 97
98 98 cache_dir = %(here)s/data
99 99 index_dir = %(here)s/data/index
100 100
101 101 ## uncomment and set this path to use archive download cache
102 102 archive_cache_dir = %(here)s/tarballcache
103 103
104 104 ## change this to unique ID for security
105 105 #app_instance_uuid = VERY-SECRET
106 106 app_instance_uuid = development-not-secret
107 107
108 108 ## cut off limit for large diffs (size in bytes)
109 109 cut_off_limit = 256000
110 110
111 111 ## force https in Kallithea, fixes https redirects, assumes it's always https
112 112 force_https = false
113 113
114 114 ## use Strict-Transport-Security headers
115 115 use_htsts = false
116 116
117 117 ## number of commits stats will parse on each iteration
118 118 commit_parse_limit = 25
119 119
120 120 ## Path to Python executable to be used for git hooks.
121 121 ## This value will be written inside the git hook scripts as the text
122 122 ## after '#!' (shebang). When empty or not defined, the value of
123 123 ## 'sys.executable' at the time of installation of the git hooks is
124 124 ## used, which is correct in many cases but for example not when using uwsgi.
125 125 ## If you change this setting, you should reinstall the Git hooks via
126 126 ## Admin > Settings > Remap and Rescan.
127 127 # git_hook_interpreter = /srv/kallithea/venv/bin/python2
128 128
129 129 ## path to git executable
130 130 git_path = git
131 131
132 132 ## git rev filter option, --all is the default filter, if you need to
133 133 ## hide all refs in changelog switch this to --branches --tags
134 134 #git_rev_filter = --branches --tags
135 135
136 136 ## RSS feed options
137 137 rss_cut_off_limit = 256000
138 138 rss_items_per_page = 10
139 139 rss_include_diff = false
140 140
141 141 ## options for showing and identifying changesets
142 142 show_sha_length = 12
143 143 show_revision_number = false
144 144
145 145 ## Canonical URL to use when creating full URLs in UI and texts.
146 146 ## Useful when the site is available under different names or protocols.
147 147 ## Defaults to what is provided in the WSGI environment.
148 148 #canonical_url = https://kallithea.example.com/repos
149 149
150 150 ## gist URL alias, used to create nicer urls for gist. This should be an
151 151 ## url that does rewrites to _admin/gists/<gistid>.
152 152 ## example: http://gist.example.com/{gistid}. Empty means use the internal
153 153 ## Kallithea url, ie. http[s]://kallithea.example.com/_admin/gists/<gistid>
154 154 gist_alias_url =
155 155
156 156 ## default encoding used to convert from and to unicode
157 157 ## can be also a comma separated list of encoding in case of mixed encodings
158 158 default_encoding = utf-8
159 159
160 160 ## Set Mercurial encoding, similar to setting HGENCODING before launching Kallithea
161 161 hgencoding = utf-8
162 162
163 163 ## issue tracker for Kallithea (leave blank to disable, absent for default)
164 164 #bugtracker = https://bitbucket.org/conservancy/kallithea/issues
165 165
166 166 ## issue tracking mapping for commit messages, comments, PR descriptions, ...
167 167 ## Refer to the documentation ("Integration with issue trackers") for more details.
168 168
169 169 ## regular expression to match issue references
170 170 ## This pattern may/should contain parenthesized groups, that can
171 171 ## be referred to in issue_server_link or issue_sub using Python backreferences
172 172 ## (e.g. \1, \2, ...). You can also create named groups with '(?P<groupname>)'.
173 173 ## To require mandatory whitespace before the issue pattern, use:
174 174 ## (?:^|(?<=\s)) before the actual pattern, and for mandatory whitespace
175 175 ## behind the issue pattern, use (?:$|(?=\s)) after the actual pattern.
176 176
177 177 issue_pat = #(\d+)
178 178
179 179 ## server url to the issue
180 180 ## This pattern may/should contain backreferences to parenthesized groups in issue_pat.
181 181 ## A backreference can be \1, \2, ... or \g<groupname> if you specified a named group
182 182 ## called 'groupname' in issue_pat.
183 183 ## The special token {repo} is replaced with the full repository name
184 184 ## including repository groups, while {repo_name} is replaced with just
185 185 ## the name of the repository.
186 186
187 187 issue_server_link = https://issues.example.com/{repo}/issue/\1
188 188
189 189 ## substitution pattern to use as the link text
190 190 ## If issue_sub is empty, the text matched by issue_pat is retained verbatim
191 191 ## for the link text. Otherwise, the link text is that of issue_sub, with any
192 192 ## backreferences to groups in issue_pat replaced.
193 193
194 194 issue_sub =
195 195
196 196 ## issue_pat, issue_server_link and issue_sub can have suffixes to specify
197 197 ## multiple patterns, to other issues server, wiki or others
198 198 ## below an example how to create a wiki pattern
199 199 # wiki-some-id -> https://wiki.example.com/some-id
200 200
201 201 #issue_pat_wiki = wiki-(\S+)
202 202 #issue_server_link_wiki = https://wiki.example.com/\1
203 203 #issue_sub_wiki = WIKI-\1
204 204
205 205 ## alternative return HTTP header for failed authentication. Default HTTP
206 206 ## response is 401 HTTPUnauthorized. Currently Mercurial clients have trouble with
207 207 ## handling that. Set this variable to 403 to return HTTPForbidden
208 208 auth_ret_code =
209 209
210 210 ## allows to change the repository location in settings page
211 211 allow_repo_location_change = True
212 212
213 213 ## allows to setup custom hooks in settings page
214 214 allow_custom_hooks_settings = True
215 215
216 216 ## extra extensions for indexing, space separated and without the leading '.'.
217 217 # index.extensions =
218 218 # gemfile
219 219 # lock
220 220
221 221 ## extra filenames for indexing, space separated
222 222 # index.filenames =
223 223 # .dockerignore
224 224 # .editorconfig
225 225 # INSTALL
226 226 # CHANGELOG
227 227
228 228 ####################################
229 229 ### CELERY CONFIG ####
230 230 ####################################
231 231
232 232 use_celery = false
233 233
234 234 ## Example: connect to the virtual host 'rabbitmqhost' on localhost as rabbitmq:
235 235 broker.url = amqp://rabbitmq:qewqew@localhost:5672/rabbitmqhost
236 236
237 237 celery.imports = kallithea.lib.celerylib.tasks
238 238 celery.accept.content = pickle
239 239 celery.result.backend = amqp
240 240 celery.result.dburi = amqp://
241 241 celery.result.serialier = json
242 242
243 243 #celery.send.task.error.emails = true
244 244 #celery.amqp.task.result.expires = 18000
245 245
246 246 celeryd.concurrency = 2
247 247 celeryd.max.tasks.per.child = 1
248 248
249 249 ## If true, tasks will never be sent to the queue, but executed locally instead.
250 250 celery.always.eager = false
251 251
252 252 ####################################
253 253 ### BEAKER CACHE ####
254 254 ####################################
255 255
256 256 beaker.cache.data_dir = %(here)s/data/cache/data
257 257 beaker.cache.lock_dir = %(here)s/data/cache/lock
258 258
259 259 beaker.cache.regions = short_term,long_term,sql_cache_short
260 260
261 261 beaker.cache.short_term.type = memory
262 262 beaker.cache.short_term.expire = 60
263 263 beaker.cache.short_term.key_length = 256
264 264
265 265 beaker.cache.long_term.type = memory
266 266 beaker.cache.long_term.expire = 36000
267 267 beaker.cache.long_term.key_length = 256
268 268
269 269 beaker.cache.sql_cache_short.type = memory
270 270 beaker.cache.sql_cache_short.expire = 10
271 271 beaker.cache.sql_cache_short.key_length = 256
272 272
273 273 ####################################
274 274 ### BEAKER SESSION ####
275 275 ####################################
276 276
277 277 ## Name of session cookie. Should be unique for a given host and path, even when running
278 278 ## on different ports. Otherwise, cookie sessions will be shared and messed up.
279 279 session.key = kallithea
280 280 ## Sessions should always only be accessible by the browser, not directly by JavaScript.
281 281 session.httponly = true
282 282 ## Session lifetime. 2592000 seconds is 30 days.
283 283 session.timeout = 2592000
284 284
285 285 ## Server secret used with HMAC to ensure integrity of cookies.
286 286 #session.secret = VERY-SECRET
287 287 session.secret = development-not-secret
288 288 ## Further, encrypt the data with AES.
289 289 #session.encrypt_key = <key_for_encryption>
290 290 #session.validate_key = <validation_key>
291 291
292 292 ## Type of storage used for the session, current types are
293 293 ## dbm, file, memcached, database, and memory.
294 294
295 295 ## File system storage of session data. (default)
296 296 #session.type = file
297 297
298 298 ## Cookie only, store all session data inside the cookie. Requires secure secrets.
299 299 #session.type = cookie
300 300
301 301 ## Database storage of session data.
302 302 #session.type = ext:database
303 303 #session.sa.url = postgresql://postgres:qwe@localhost/kallithea
304 304 #session.table_name = db_session
305 305
306 306 ############################
307 307 ## ERROR HANDLING SYSTEMS ##
308 308 ############################
309 309
310 310 # Propagate email settings to ErrorReporter of TurboGears2
311 311 # You do not normally need to change these lines
312 312 get trace_errors.error_email = email_to
313 313 get trace_errors.smtp_server = smtp_server
314 314 get trace_errors.smtp_port = smtp_port
315 315 get trace_errors.from_address = error_email_from
316 316
317 317 ################################################################################
318 318 ## WARNING: *DEBUG MODE MUST BE OFF IN A PRODUCTION ENVIRONMENT* ##
319 319 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
320 320 ## execute malicious code after an exception is raised. ##
321 321 ################################################################################
322 322 #debug = false
323 323 debug = true
324 324
325 325 ##################################
326 326 ### LOGVIEW CONFIG ###
327 327 ##################################
328 328
329 329 logview.sqlalchemy = #faa
330 330 logview.pylons.templating = #bfb
331 331 logview.pylons.util = #eee
332 332
333 333 #########################################################
334 334 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
335 335 #########################################################
336 336
337 337 # SQLITE [default]
338 338 sqlalchemy.url = sqlite:///%(here)s/kallithea.db?timeout=60
339 339
340 340 # see sqlalchemy docs for others
341 341
342 342 sqlalchemy.pool_recycle = 3600
343 343
344 344 ################################
345 345 ### ALEMBIC CONFIGURATION ####
346 346 ################################
347 347
348 348 [alembic]
349 349 script_location = kallithea:alembic
350 350
351 351 ################################
352 352 ### LOGGING CONFIGURATION ####
353 353 ################################
354 354
355 355 [loggers]
356 356 keys = root, routes, kallithea, sqlalchemy, tg, gearbox, beaker, templates, whoosh_indexer, werkzeug, backlash
357 357
358 358 [handlers]
359 keys = console, console_sql
359 keys = console, console_color, console_color_sql, null
360 360
361 361 [formatters]
362 362 keys = generic, color_formatter, color_formatter_sql
363 363
364 364 #############
365 365 ## LOGGERS ##
366 366 #############
367 367
368 368 [logger_root]
369 369 level = NOTSET
370 handlers = console
370 #handlers = console
371 handlers = console_color
372 # For coloring based on log level:
373 # handlers = console_color
371 374
372 375 [logger_routes]
373 376 #level = WARN
374 377 level = DEBUG
375 378 handlers =
376 379 qualname = routes.middleware
377 380 ## "level = DEBUG" logs the route matched and routing variables.
378 381
379 382 [logger_beaker]
380 383 #level = WARN
381 384 level = DEBUG
382 385 handlers =
383 386 qualname = beaker.container
384 387
385 388 [logger_templates]
386 389 #level = WARN
387 390 level = INFO
388 391 handlers =
389 392 qualname = pylons.templating
390 393
391 394 [logger_kallithea]
392 395 #level = WARN
393 396 level = DEBUG
394 397 handlers =
395 398 qualname = kallithea
396 399
397 400 [logger_tg]
398 401 #level = WARN
399 402 level = DEBUG
400 403 handlers =
401 404 qualname = tg
402 405
403 406 [logger_gearbox]
404 407 #level = WARN
405 408 level = DEBUG
406 409 handlers =
407 410 qualname = gearbox
408 411
409 412 [logger_sqlalchemy]
410 413 level = WARN
411 handlers = console_sql
414 handlers =
412 415 qualname = sqlalchemy.engine
413 propagate = 0
416 # For coloring based on log level and pretty printing of SQL:
417 # level = INFO
418 # handlers = console_color_sql
419 # propagate = 0
414 420
415 421 [logger_whoosh_indexer]
416 422 #level = WARN
417 423 level = DEBUG
418 424 handlers =
419 425 qualname = whoosh_indexer
420 426
421 427 [logger_werkzeug]
422 428 level = WARN
423 429 handlers =
424 430 qualname = werkzeug
425 431
426 432 [logger_backlash]
427 433 level = WARN
428 434 handlers =
429 435 qualname = backlash
430 436
431 437 ##############
432 438 ## HANDLERS ##
433 439 ##############
434 440
435 441 [handler_console]
436 442 class = StreamHandler
437 443 args = (sys.stderr,)
438 #formatter = generic
444 formatter = generic
445
446 [handler_console_color]
447 # ANSI color coding based on log level
448 class = StreamHandler
449 args = (sys.stderr,)
439 450 formatter = color_formatter
440 451
441 [handler_console_sql]
452 [handler_console_color_sql]
453 # ANSI color coding and pretty printing of SQL statements
442 454 class = StreamHandler
443 455 args = (sys.stderr,)
444 #formatter = generic
445 456 formatter = color_formatter_sql
446 457
458 [handler_null]
459 class = NullHandler
460 args = ()
461
447 462 ################
448 463 ## FORMATTERS ##
449 464 ################
450 465
451 466 [formatter_generic]
452 467 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
453 468 datefmt = %Y-%m-%d %H:%M:%S
454 469
455 470 [formatter_color_formatter]
456 471 class = kallithea.lib.colored_formatter.ColorFormatter
457 472 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
458 473 datefmt = %Y-%m-%d %H:%M:%S
459 474
460 475 [formatter_color_formatter_sql]
461 476 class = kallithea.lib.colored_formatter.ColorFormatterSql
462 477 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
463 478 datefmt = %Y-%m-%d %H:%M:%S
@@ -1,635 +1,651 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%text>################################################################################</%text>
3 3 <%text>################################################################################</%text>
4 4 # Kallithea - config file generated with kallithea-config #
5 5 # #
6 6 # The %(here)s variable will be replaced with the parent directory of this file#
7 7 <%text>################################################################################</%text>
8 8 <%text>################################################################################</%text>
9 9
10 10 [DEFAULT]
11 11
12 12 <%text>################################################################################</%text>
13 13 <%text>## Email settings ##</%text>
14 14 <%text>## ##</%text>
15 15 <%text>## Refer to the documentation ("Email settings") for more details. ##</%text>
16 16 <%text>## ##</%text>
17 17 <%text>## It is recommended to use a valid sender address that passes access ##</%text>
18 18 <%text>## validation and spam filtering in mail servers. ##</%text>
19 19 <%text>################################################################################</%text>
20 20
21 21 <%text>## 'From' header for application emails. You can optionally add a name.</%text>
22 22 <%text>## Default:</%text>
23 23 #app_email_from = Kallithea
24 24 <%text>## Examples:</%text>
25 25 #app_email_from = Kallithea <kallithea-noreply@example.com>
26 26 #app_email_from = kallithea-noreply@example.com
27 27
28 28 <%text>## Subject prefix for application emails.</%text>
29 29 <%text>## A space between this prefix and the real subject is automatically added.</%text>
30 30 <%text>## Default:</%text>
31 31 #email_prefix =
32 32 <%text>## Example:</%text>
33 33 #email_prefix = [Kallithea]
34 34
35 35 <%text>## Recipients for error emails and fallback recipients of application mails.</%text>
36 36 <%text>## Multiple addresses can be specified, comma-separated.</%text>
37 37 <%text>## Only addresses are allowed, do not add any name part.</%text>
38 38 <%text>## Default:</%text>
39 39 #email_to =
40 40 <%text>## Examples:</%text>
41 41 #email_to = admin@example.com
42 42 #email_to = admin@example.com,another_admin@example.com
43 43 email_to =
44 44
45 45 <%text>## 'From' header for error emails. You can optionally add a name.</%text>
46 46 <%text>## Default: (none)</%text>
47 47 <%text>## Examples:</%text>
48 48 #error_email_from = Kallithea Errors <kallithea-noreply@example.com>
49 49 #error_email_from = kallithea_errors@example.com
50 50 error_email_from =
51 51
52 52 <%text>## SMTP server settings</%text>
53 53 <%text>## If specifying credentials, make sure to use secure connections.</%text>
54 54 <%text>## Default: Send unencrypted unauthenticated mails to the specified smtp_server.</%text>
55 55 <%text>## For "SSL", use smtp_use_ssl = true and smtp_port = 465.</%text>
56 56 <%text>## For "STARTTLS", use smtp_use_tls = true and smtp_port = 587.</%text>
57 57 smtp_server =
58 58 #smtp_username =
59 59 #smtp_password =
60 60 smtp_port =
61 61 #smtp_use_ssl = false
62 62 #smtp_use_tls = false
63 63
64 64 %if http_server != 'uwsgi':
65 65 <%text>## Entry point for 'gearbox serve'</%text>
66 66 [server:main]
67 67 host = ${host}
68 68 port = ${port}
69 69
70 70 %if http_server == 'gearbox':
71 71 <%text>## Gearbox default web server ##</%text>
72 72 use = egg:gearbox#wsgiref
73 73 <%text>## nr of worker threads to spawn</%text>
74 74 threadpool_workers = 1
75 75 <%text>## max request before thread respawn</%text>
76 76 threadpool_max_requests = 100
77 77 <%text>## option to use threads of process</%text>
78 78 use_threadpool = true
79 79
80 80 %elif http_server == 'gevent':
81 81 <%text>## Gearbox gevent web server ##</%text>
82 82 use = egg:gearbox#gevent
83 83
84 84 %elif http_server == 'waitress':
85 85 <%text>## WAITRESS ##</%text>
86 86 use = egg:waitress#main
87 87 <%text>## number of worker threads</%text>
88 88 threads = 1
89 89 <%text>## MAX BODY SIZE 100GB</%text>
90 90 max_request_body_size = 107374182400
91 91 <%text>## use poll instead of select, fixes fd limits, may not work on old</%text>
92 92 <%text>## windows systems.</%text>
93 93 #asyncore_use_poll = True
94 94
95 95 %elif http_server == 'gunicorn':
96 96 <%text>## GUNICORN ##</%text>
97 97 use = egg:gunicorn#main
98 98 <%text>## number of process workers. You must set `instance_id = *` when this option</%text>
99 99 <%text>## is set to more than one worker</%text>
100 100 workers = 4
101 101 <%text>## process name</%text>
102 102 proc_name = kallithea
103 103 <%text>## type of worker class, one of sync, eventlet, gevent, tornado</%text>
104 104 <%text>## recommended for bigger setup is using of of other than sync one</%text>
105 105 worker_class = sync
106 106 max_requests = 1000
107 107 <%text>## amount of time a worker can handle request before it gets killed and</%text>
108 108 <%text>## restarted</%text>
109 109 timeout = 3600
110 110
111 111 %endif
112 112 %else:
113 113 <%text>## UWSGI ##</%text>
114 114 <%text>## run with uwsgi --ini-paste-logged <inifile.ini></%text>
115 115 [uwsgi]
116 116 socket = /tmp/uwsgi.sock
117 117 master = true
118 118 http = ${host}:${port}
119 119
120 120 <%text>## set as daemon and redirect all output to file</%text>
121 121 #daemonize = ./uwsgi_kallithea.log
122 122
123 123 <%text>## master process PID</%text>
124 124 pidfile = ./uwsgi_kallithea.pid
125 125
126 126 <%text>## stats server with workers statistics, use uwsgitop</%text>
127 127 <%text>## for monitoring, `uwsgitop 127.0.0.1:1717`</%text>
128 128 stats = 127.0.0.1:1717
129 129 memory-report = true
130 130
131 131 <%text>## log 5XX errors</%text>
132 132 log-5xx = true
133 133
134 134 <%text>## Set the socket listen queue size.</%text>
135 135 listen = 128
136 136
137 137 <%text>## Gracefully Reload workers after the specified amount of managed requests</%text>
138 138 <%text>## (avoid memory leaks).</%text>
139 139 max-requests = 1000
140 140
141 141 <%text>## enable large buffers</%text>
142 142 buffer-size = 65535
143 143
144 144 <%text>## socket and http timeouts ##</%text>
145 145 http-timeout = 3600
146 146 socket-timeout = 3600
147 147
148 148 <%text>## Log requests slower than the specified number of milliseconds.</%text>
149 149 log-slow = 10
150 150
151 151 <%text>## Exit if no app can be loaded.</%text>
152 152 need-app = true
153 153
154 154 <%text>## Set lazy mode (load apps in workers instead of master).</%text>
155 155 lazy = true
156 156
157 157 <%text>## scaling ##</%text>
158 158 <%text>## set cheaper algorithm to use, if not set default will be used</%text>
159 159 cheaper-algo = spare
160 160
161 161 <%text>## minimum number of workers to keep at all times</%text>
162 162 cheaper = 1
163 163
164 164 <%text>## number of workers to spawn at startup</%text>
165 165 cheaper-initial = 1
166 166
167 167 <%text>## maximum number of workers that can be spawned</%text>
168 168 workers = 4
169 169
170 170 <%text>## how many workers should be spawned at a time</%text>
171 171 cheaper-step = 1
172 172
173 173 %endif
174 174 <%text>## middleware for hosting the WSGI application under a URL prefix</%text>
175 175 #[filter:proxy-prefix]
176 176 #use = egg:PasteDeploy#prefix
177 177 #prefix = /<your-prefix>
178 178
179 179 [app:main]
180 180 use = egg:kallithea
181 181 <%text>## enable proxy prefix middleware</%text>
182 182 #filter-with = proxy-prefix
183 183
184 184 full_stack = true
185 185 static_files = true
186 186
187 187 <%text>## Internationalization (see setup documentation for details)</%text>
188 188 <%text>## By default, the language requested by the browser is used if available.</%text>
189 189 #i18n.enabled = false
190 190 <%text>## Fallback language, empty for English (valid values are the names of subdirectories in kallithea/i18n):</%text>
191 191 i18n.lang =
192 192
193 193 cache_dir = %(here)s/data
194 194 index_dir = %(here)s/data/index
195 195
196 196 <%text>## uncomment and set this path to use archive download cache</%text>
197 197 archive_cache_dir = %(here)s/tarballcache
198 198
199 199 <%text>## change this to unique ID for security</%text>
200 200 app_instance_uuid = ${uuid()}
201 201
202 202 <%text>## cut off limit for large diffs (size in bytes)</%text>
203 203 cut_off_limit = 256000
204 204
205 205 <%text>## force https in Kallithea, fixes https redirects, assumes it's always https</%text>
206 206 force_https = false
207 207
208 208 <%text>## use Strict-Transport-Security headers</%text>
209 209 use_htsts = false
210 210
211 211 <%text>## number of commits stats will parse on each iteration</%text>
212 212 commit_parse_limit = 25
213 213
214 214 <%text>## Path to Python executable to be used for git hooks.</%text>
215 215 <%text>## This value will be written inside the git hook scripts as the text</%text>
216 216 <%text>## after '#!' (shebang). When empty or not defined, the value of</%text>
217 217 <%text>## 'sys.executable' at the time of installation of the git hooks is</%text>
218 218 <%text>## used, which is correct in many cases but for example not when using uwsgi.</%text>
219 219 <%text>## If you change this setting, you should reinstall the Git hooks via</%text>
220 220 <%text>## Admin > Settings > Remap and Rescan.</%text>
221 221 # git_hook_interpreter = /srv/kallithea/venv/bin/python2
222 222 %if git_hook_interpreter:
223 223 git_hook_interpreter = ${git_hook_interpreter}
224 224 %endif
225 225
226 226 <%text>## path to git executable</%text>
227 227 git_path = git
228 228
229 229 <%text>## git rev filter option, --all is the default filter, if you need to</%text>
230 230 <%text>## hide all refs in changelog switch this to --branches --tags</%text>
231 231 #git_rev_filter = --branches --tags
232 232
233 233 <%text>## RSS feed options</%text>
234 234 rss_cut_off_limit = 256000
235 235 rss_items_per_page = 10
236 236 rss_include_diff = false
237 237
238 238 <%text>## options for showing and identifying changesets</%text>
239 239 show_sha_length = 12
240 240 show_revision_number = false
241 241
242 242 <%text>## Canonical URL to use when creating full URLs in UI and texts.</%text>
243 243 <%text>## Useful when the site is available under different names or protocols.</%text>
244 244 <%text>## Defaults to what is provided in the WSGI environment.</%text>
245 245 #canonical_url = https://kallithea.example.com/repos
246 246
247 247 <%text>## gist URL alias, used to create nicer urls for gist. This should be an</%text>
248 248 <%text>## url that does rewrites to _admin/gists/<gistid>.</%text>
249 249 <%text>## example: http://gist.example.com/{gistid}. Empty means use the internal</%text>
250 250 <%text>## Kallithea url, ie. http[s]://kallithea.example.com/_admin/gists/<gistid></%text>
251 251 gist_alias_url =
252 252
253 253 <%text>## default encoding used to convert from and to unicode</%text>
254 254 <%text>## can be also a comma separated list of encoding in case of mixed encodings</%text>
255 255 default_encoding = utf-8
256 256
257 257 <%text>## Set Mercurial encoding, similar to setting HGENCODING before launching Kallithea</%text>
258 258 hgencoding = utf-8
259 259
260 260 <%text>## issue tracker for Kallithea (leave blank to disable, absent for default)</%text>
261 261 #bugtracker = https://bitbucket.org/conservancy/kallithea/issues
262 262
263 263 <%text>## issue tracking mapping for commit messages, comments, PR descriptions, ...</%text>
264 264 <%text>## Refer to the documentation ("Integration with issue trackers") for more details.</%text>
265 265
266 266 <%text>## regular expression to match issue references</%text>
267 267 <%text>## This pattern may/should contain parenthesized groups, that can</%text>
268 268 <%text>## be referred to in issue_server_link or issue_sub using Python backreferences</%text>
269 269 <%text>## (e.g. \1, \2, ...). You can also create named groups with '(?P<groupname>)'.</%text>
270 270 <%text>## To require mandatory whitespace before the issue pattern, use:</%text>
271 271 <%text>## (?:^|(?<=\s)) before the actual pattern, and for mandatory whitespace</%text>
272 272 <%text>## behind the issue pattern, use (?:$|(?=\s)) after the actual pattern.</%text>
273 273
274 274 issue_pat = #(\d+)
275 275
276 276 <%text>## server url to the issue</%text>
277 277 <%text>## This pattern may/should contain backreferences to parenthesized groups in issue_pat.</%text>
278 278 <%text>## A backreference can be \1, \2, ... or \g<groupname> if you specified a named group</%text>
279 279 <%text>## called 'groupname' in issue_pat.</%text>
280 280 <%text>## The special token {repo} is replaced with the full repository name</%text>
281 281 <%text>## including repository groups, while {repo_name} is replaced with just</%text>
282 282 <%text>## the name of the repository.</%text>
283 283
284 284 issue_server_link = https://issues.example.com/{repo}/issue/\1
285 285
286 286 <%text>## substitution pattern to use as the link text</%text>
287 287 <%text>## If issue_sub is empty, the text matched by issue_pat is retained verbatim</%text>
288 288 <%text>## for the link text. Otherwise, the link text is that of issue_sub, with any</%text>
289 289 <%text>## backreferences to groups in issue_pat replaced.</%text>
290 290
291 291 issue_sub =
292 292
293 293 <%text>## issue_pat, issue_server_link and issue_sub can have suffixes to specify</%text>
294 294 <%text>## multiple patterns, to other issues server, wiki or others</%text>
295 295 <%text>## below an example how to create a wiki pattern</%text>
296 296 # wiki-some-id -> https://wiki.example.com/some-id
297 297
298 298 #issue_pat_wiki = wiki-(\S+)
299 299 #issue_server_link_wiki = https://wiki.example.com/\1
300 300 #issue_sub_wiki = WIKI-\1
301 301
302 302 <%text>## alternative return HTTP header for failed authentication. Default HTTP</%text>
303 303 <%text>## response is 401 HTTPUnauthorized. Currently Mercurial clients have trouble with</%text>
304 304 <%text>## handling that. Set this variable to 403 to return HTTPForbidden</%text>
305 305 auth_ret_code =
306 306
307 307 <%text>## allows to change the repository location in settings page</%text>
308 308 allow_repo_location_change = True
309 309
310 310 <%text>## allows to setup custom hooks in settings page</%text>
311 311 allow_custom_hooks_settings = True
312 312
313 313 <%text>## extra extensions for indexing, space separated and without the leading '.'.</%text>
314 314 # index.extensions =
315 315 # gemfile
316 316 # lock
317 317
318 318 <%text>## extra filenames for indexing, space separated</%text>
319 319 # index.filenames =
320 320 # .dockerignore
321 321 # .editorconfig
322 322 # INSTALL
323 323 # CHANGELOG
324 324
325 325 <%text>####################################</%text>
326 326 <%text>### CELERY CONFIG ####</%text>
327 327 <%text>####################################</%text>
328 328
329 329 use_celery = false
330 330
331 331 <%text>## Example: connect to the virtual host 'rabbitmqhost' on localhost as rabbitmq:</%text>
332 332 broker.url = amqp://rabbitmq:qewqew@localhost:5672/rabbitmqhost
333 333
334 334 celery.imports = kallithea.lib.celerylib.tasks
335 335 celery.accept.content = pickle
336 336 celery.result.backend = amqp
337 337 celery.result.dburi = amqp://
338 338 celery.result.serialier = json
339 339
340 340 #celery.send.task.error.emails = true
341 341 #celery.amqp.task.result.expires = 18000
342 342
343 343 celeryd.concurrency = 2
344 344 celeryd.max.tasks.per.child = 1
345 345
346 346 <%text>## If true, tasks will never be sent to the queue, but executed locally instead.</%text>
347 347 celery.always.eager = false
348 348
349 349 <%text>####################################</%text>
350 350 <%text>### BEAKER CACHE ####</%text>
351 351 <%text>####################################</%text>
352 352
353 353 beaker.cache.data_dir = %(here)s/data/cache/data
354 354 beaker.cache.lock_dir = %(here)s/data/cache/lock
355 355
356 356 beaker.cache.regions = short_term,long_term,sql_cache_short
357 357
358 358 beaker.cache.short_term.type = memory
359 359 beaker.cache.short_term.expire = 60
360 360 beaker.cache.short_term.key_length = 256
361 361
362 362 beaker.cache.long_term.type = memory
363 363 beaker.cache.long_term.expire = 36000
364 364 beaker.cache.long_term.key_length = 256
365 365
366 366 beaker.cache.sql_cache_short.type = memory
367 367 beaker.cache.sql_cache_short.expire = 10
368 368 beaker.cache.sql_cache_short.key_length = 256
369 369
370 370 <%text>####################################</%text>
371 371 <%text>### BEAKER SESSION ####</%text>
372 372 <%text>####################################</%text>
373 373
374 374 <%text>## Name of session cookie. Should be unique for a given host and path, even when running</%text>
375 375 <%text>## on different ports. Otherwise, cookie sessions will be shared and messed up.</%text>
376 376 session.key = kallithea
377 377 <%text>## Sessions should always only be accessible by the browser, not directly by JavaScript.</%text>
378 378 session.httponly = true
379 379 <%text>## Session lifetime. 2592000 seconds is 30 days.</%text>
380 380 session.timeout = 2592000
381 381
382 382 <%text>## Server secret used with HMAC to ensure integrity of cookies.</%text>
383 383 session.secret = ${uuid()}
384 384 <%text>## Further, encrypt the data with AES.</%text>
385 385 #session.encrypt_key = <key_for_encryption>
386 386 #session.validate_key = <validation_key>
387 387
388 388 <%text>## Type of storage used for the session, current types are</%text>
389 389 <%text>## dbm, file, memcached, database, and memory.</%text>
390 390
391 391 <%text>## File system storage of session data. (default)</%text>
392 392 #session.type = file
393 393
394 394 <%text>## Cookie only, store all session data inside the cookie. Requires secure secrets.</%text>
395 395 #session.type = cookie
396 396
397 397 <%text>## Database storage of session data.</%text>
398 398 #session.type = ext:database
399 399 #session.sa.url = postgresql://postgres:qwe@localhost/kallithea
400 400 #session.table_name = db_session
401 401
402 402 <%text>############################</%text>
403 403 <%text>## ERROR HANDLING SYSTEMS ##</%text>
404 404 <%text>############################</%text>
405 405
406 406 # Propagate email settings to ErrorReporter of TurboGears2
407 407 # You do not normally need to change these lines
408 408 get trace_errors.error_email = email_to
409 409 get trace_errors.smtp_server = smtp_server
410 410 get trace_errors.smtp_port = smtp_port
411 411 get trace_errors.from_address = error_email_from
412 412
413 413 %if error_aggregation_service == 'appenlight':
414 414 <%text>####################</%text>
415 415 <%text>### [appenlight] ###</%text>
416 416 <%text>####################</%text>
417 417
418 418 <%text>## AppEnlight is tailored to work with Kallithea, see</%text>
419 419 <%text>## http://appenlight.com for details how to obtain an account</%text>
420 420 <%text>## you must install python package `appenlight_client` to make it work</%text>
421 421
422 422 <%text>## appenlight enabled</%text>
423 423 appenlight = false
424 424
425 425 appenlight.server_url = https://api.appenlight.com
426 426 appenlight.api_key = YOUR_API_KEY
427 427
428 428 <%text>## TWEAK AMOUNT OF INFO SENT HERE</%text>
429 429
430 430 <%text>## enables 404 error logging (default False)</%text>
431 431 appenlight.report_404 = false
432 432
433 433 <%text>## time in seconds after request is considered being slow (default 1)</%text>
434 434 appenlight.slow_request_time = 1
435 435
436 436 <%text>## record slow requests in application</%text>
437 437 <%text>## (needs to be enabled for slow datastore recording and time tracking)</%text>
438 438 appenlight.slow_requests = true
439 439
440 440 <%text>## enable hooking to application loggers</%text>
441 441 #appenlight.logging = true
442 442
443 443 <%text>## minimum log level for log capture</%text>
444 444 #appenlight.logging.level = WARNING
445 445
446 446 <%text>## send logs only from erroneous/slow requests</%text>
447 447 <%text>## (saves API quota for intensive logging)</%text>
448 448 appenlight.logging_on_error = false
449 449
450 450 <%text>## list of additional keywords that should be grabbed from environ object</%text>
451 451 <%text>## can be string with comma separated list of words in lowercase</%text>
452 452 <%text>## (by default client will always send following info:</%text>
453 453 <%text>## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that</%text>
454 454 <%text>## start with HTTP* this list be extended with additional keywords here</%text>
455 455 appenlight.environ_keys_whitelist =
456 456
457 457 <%text>## list of keywords that should be blanked from request object</%text>
458 458 <%text>## can be string with comma separated list of words in lowercase</%text>
459 459 <%text>## (by default client will always blank keys that contain following words</%text>
460 460 <%text>## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'</%text>
461 461 <%text>## this list be extended with additional keywords set here</%text>
462 462 appenlight.request_keys_blacklist =
463 463
464 464 <%text>## list of namespaces that should be ignores when gathering log entries</%text>
465 465 <%text>## can be string with comma separated list of namespaces</%text>
466 466 <%text>## (by default the client ignores own entries: appenlight_client.client)</%text>
467 467 appenlight.log_namespace_blacklist =
468 468
469 469 %elif error_aggregation_service == 'sentry':
470 470 <%text>################</%text>
471 471 <%text>### [sentry] ###</%text>
472 472 <%text>################</%text>
473 473
474 474 <%text>## sentry is a alternative open source error aggregator</%text>
475 475 <%text>## you must install python packages `sentry` and `raven` to enable</%text>
476 476
477 477 sentry.dsn = YOUR_DNS
478 478 sentry.servers =
479 479 sentry.name =
480 480 sentry.key =
481 481 sentry.public_key =
482 482 sentry.secret_key =
483 483 sentry.project =
484 484 sentry.site =
485 485 sentry.include_paths =
486 486 sentry.exclude_paths =
487 487
488 488 %endif
489 489 <%text>################################################################################</%text>
490 490 <%text>## WARNING: *DEBUG MODE MUST BE OFF IN A PRODUCTION ENVIRONMENT* ##</%text>
491 491 <%text>## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##</%text>
492 492 <%text>## execute malicious code after an exception is raised. ##</%text>
493 493 <%text>################################################################################</%text>
494 494 debug = false
495 495
496 496 <%text>##################################</%text>
497 497 <%text>### LOGVIEW CONFIG ###</%text>
498 498 <%text>##################################</%text>
499 499
500 500 logview.sqlalchemy = #faa
501 501 logview.pylons.templating = #bfb
502 502 logview.pylons.util = #eee
503 503
504 504 <%text>#########################################################</%text>
505 505 <%text>### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###</%text>
506 506 <%text>#########################################################</%text>
507 507
508 508 %if database_engine == 'sqlite':
509 509 # SQLITE [default]
510 510 sqlalchemy.url = sqlite:///%(here)s/kallithea.db?timeout=60
511 511
512 512 %elif database_engine == 'postgres':
513 513 # POSTGRESQL
514 514 sqlalchemy.url = postgresql://user:pass@localhost/kallithea
515 515
516 516 %elif database_engine == 'mysql':
517 517 # MySQL
518 518 sqlalchemy.url = mysql://user:pass@localhost/kallithea?charset=utf8
519 519
520 520 %endif
521 521 # see sqlalchemy docs for others
522 522
523 523 sqlalchemy.pool_recycle = 3600
524 524
525 525 <%text>################################</%text>
526 526 <%text>### ALEMBIC CONFIGURATION ####</%text>
527 527 <%text>################################</%text>
528 528
529 529 [alembic]
530 530 script_location = kallithea:alembic
531 531
532 532 <%text>################################</%text>
533 533 <%text>### LOGGING CONFIGURATION ####</%text>
534 534 <%text>################################</%text>
535 535
536 536 [loggers]
537 537 keys = root, routes, kallithea, sqlalchemy, tg, gearbox, beaker, templates, whoosh_indexer, werkzeug, backlash
538 538
539 539 [handlers]
540 keys = console, console_sql
540 keys = console, console_color, console_color_sql, null
541 541
542 542 [formatters]
543 543 keys = generic, color_formatter, color_formatter_sql
544 544
545 545 <%text>#############</%text>
546 546 <%text>## LOGGERS ##</%text>
547 547 <%text>#############</%text>
548 548
549 549 [logger_root]
550 550 level = NOTSET
551 551 handlers = console
552 # For coloring based on log level:
553 # handlers = console_color
552 554
553 555 [logger_routes]
554 556 level = WARN
555 557 handlers =
556 558 qualname = routes.middleware
557 559 <%text>## "level = DEBUG" logs the route matched and routing variables.</%text>
558 560
559 561 [logger_beaker]
560 562 level = WARN
561 563 handlers =
562 564 qualname = beaker.container
563 565
564 566 [logger_templates]
565 567 level = WARN
566 568 handlers =
567 569 qualname = pylons.templating
568 570
569 571 [logger_kallithea]
570 572 level = WARN
571 573 handlers =
572 574 qualname = kallithea
573 575
574 576 [logger_tg]
575 577 level = WARN
576 578 handlers =
577 579 qualname = tg
578 580
579 581 [logger_gearbox]
580 582 level = WARN
581 583 handlers =
582 584 qualname = gearbox
583 585
584 586 [logger_sqlalchemy]
585 587 level = WARN
586 handlers = console_sql
588 handlers =
587 589 qualname = sqlalchemy.engine
588 propagate = 0
590 # For coloring based on log level and pretty printing of SQL:
591 # level = INFO
592 # handlers = console_color_sql
593 # propagate = 0
589 594
590 595 [logger_whoosh_indexer]
591 596 level = WARN
592 597 handlers =
593 598 qualname = whoosh_indexer
594 599
595 600 [logger_werkzeug]
596 601 level = WARN
597 602 handlers =
598 603 qualname = werkzeug
599 604
600 605 [logger_backlash]
601 606 level = WARN
602 607 handlers =
603 608 qualname = backlash
604 609
605 610 <%text>##############</%text>
606 611 <%text>## HANDLERS ##</%text>
607 612 <%text>##############</%text>
608 613
609 614 [handler_console]
610 615 class = StreamHandler
611 616 args = (sys.stderr,)
612 617 formatter = generic
613 618
614 [handler_console_sql]
619 [handler_console_color]
620 # ANSI color coding based on log level
615 621 class = StreamHandler
616 622 args = (sys.stderr,)
617 formatter = generic
623 formatter = color_formatter
624
625 [handler_console_color_sql]
626 # ANSI color coding and pretty printing of SQL statements
627 class = StreamHandler
628 args = (sys.stderr,)
629 formatter = color_formatter_sql
630
631 [handler_null]
632 class = NullHandler
633 args = ()
618 634
619 635 <%text>################</%text>
620 636 <%text>## FORMATTERS ##</%text>
621 637 <%text>################</%text>
622 638
623 639 [formatter_generic]
624 640 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
625 641 datefmt = %Y-%m-%d %H:%M:%S
626 642
627 643 [formatter_color_formatter]
628 644 class = kallithea.lib.colored_formatter.ColorFormatter
629 645 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
630 646 datefmt = %Y-%m-%d %H:%M:%S
631 647
632 648 [formatter_color_formatter_sql]
633 649 class = kallithea.lib.colored_formatter.ColorFormatterSql
634 650 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
635 651 datefmt = %Y-%m-%d %H:%M:%S
@@ -1,72 +1,69 b''
1 1 #!/usr/bin/env python2
2 2 """
3 3 Based on kallithea/lib/paster_commands/template.ini.mako, generate development.ini
4 4 """
5 5
6 6 import re
7 7
8 8 from kallithea.lib import inifile
9 9
10 10 # files to be generated from the mako template
11 11 ini_files = [
12 12 ('development.ini',
13 13 {
14 14 '[server:main]': {
15 15 'host': '0.0.0.0',
16 16 },
17 17 '[app:main]': {
18 18 'debug': 'true',
19 19 'app_instance_uuid': 'development-not-secret',
20 20 'session.secret': 'development-not-secret',
21 21 },
22 '[handler_console]': {
23 'formatter': 'color_formatter',
24 },
25 '[handler_console_sql]': {
26 'formatter': 'color_formatter_sql',
22 '[logger_root]': {
23 'handlers': 'console_color',
27 24 },
28 25 '[logger_routes]': {
29 26 'level': 'DEBUG',
30 27 },
31 28 '[logger_beaker]': {
32 29 'level': 'DEBUG',
33 30 },
34 31 '[logger_templates]': {
35 32 'level': 'INFO',
36 33 },
37 34 '[logger_kallithea]': {
38 35 'level': 'DEBUG',
39 36 },
40 37 '[logger_tg]': {
41 38 'level': 'DEBUG',
42 39 },
43 40 '[logger_gearbox]': {
44 41 'level': 'DEBUG',
45 42 },
46 43 '[logger_whoosh_indexer]': {
47 44 'level': 'DEBUG',
48 45 },
49 46 },
50 47 ),
51 48 ]
52 49
53 50
54 51 def main():
55 52 # make sure all mako lines starting with '#' (the '##' comments) are marked up as <text>
56 53 makofile = inifile.template_file
57 54 print 'reading:', makofile
58 55 mako_org = open(makofile).read()
59 56 mako_no_text_markup = re.sub(r'</?%text>', '', mako_org)
60 57 mako_marked_up = re.sub(r'\n(##.*)', r'\n<%text>\1</%text>', mako_no_text_markup, flags=re.MULTILINE)
61 58 if mako_marked_up != mako_org:
62 59 print 'writing:', makofile
63 60 open(makofile, 'w').write(mako_marked_up)
64 61
65 62 # create ini files
66 63 for fn, settings in ini_files:
67 64 print 'updating:', fn
68 65 inifile.create(fn, None, settings)
69 66
70 67
71 68 if __name__ == '__main__':
72 69 main()
General Comments 0
You need to be logged in to leave comments. Login now