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