##// END OF EJS Templates
docs: clarify that force_https trumps anything else
Mads Kiilerich -
r8676:fb40978c default
parent child Browse files
Show More
@@ -1,512 +1,512 b''
1 1 ###################################################################################
2 2 ###################################################################################
3 3 ## Kallithea config file generated with kallithea-cli ##
4 4 ## ##
5 5 ## The %(here)s variable will generally be replaced with the parent directory of ##
6 6 ## this file. Other use of % must be escaped as %% . ##
7 7 ###################################################################################
8 8 ###################################################################################
9 9
10 10 [DEFAULT]
11 11
12 12 ################################################################################
13 13 ## Email settings ##
14 14 ## ##
15 15 ## Refer to the documentation ("Email settings") for more details. ##
16 16 ## ##
17 17 ## It is recommended to use a valid sender address that passes access ##
18 18 ## validation and spam filtering in mail servers. ##
19 19 ################################################################################
20 20
21 21 ## 'From' header for application emails. You can optionally add a name.
22 22 ## Default:
23 23 #app_email_from = Kallithea
24 24 ## Examples:
25 25 #app_email_from = Kallithea <kallithea-noreply@example.com>
26 26 #app_email_from = kallithea-noreply@example.com
27 27
28 28 ## Subject prefix for application emails.
29 29 ## A space between this prefix and the real subject is automatically added.
30 30 ## Default:
31 31 #email_prefix =
32 32 ## Example:
33 33 #email_prefix = [Kallithea]
34 34
35 35 ## Recipients for error emails and fallback recipients of application mails.
36 36 ## Multiple addresses can be specified, comma-separated.
37 37 ## Only addresses are allowed, do not add any name part.
38 38 ## Default:
39 39 #email_to =
40 40 ## Examples:
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 ## 'From' header for error emails. You can optionally add a name.
46 46 ## Default: (none)
47 47 ## Examples:
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 ## SMTP server settings
53 53 ## If specifying credentials, make sure to use secure connections.
54 54 ## Default: Send unencrypted unauthenticated mails to the specified smtp_server.
55 55 ## For "SSL", use smtp_use_ssl = true and smtp_port = 465.
56 56 ## For "STARTTLS", use smtp_use_tls = true and smtp_port = 587.
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 ## Entry point for 'gearbox serve'
65 65 [server:main]
66 66 #host = 127.0.0.1
67 67 host = 0.0.0.0
68 68 port = 5000
69 69
70 70 ## Gearbox serve uses the Waitress web server ##
71 71 use = egg:waitress#main
72 72 ## avoid multi threading
73 73 threads = 1
74 74 ## allow push of repos bigger than the default of 1 GB
75 75 max_request_body_size = 107374182400
76 76 ## use poll instead of select, fixes fd limits, may not work on old
77 77 ## windows systems.
78 78 #asyncore_use_poll = True
79 79
80 80 ## middleware for hosting the WSGI application under a URL prefix
81 81 #[filter:proxy-prefix]
82 82 #use = egg:PasteDeploy#prefix
83 83 #prefix = /<your-prefix>
84 84
85 85 [app:main]
86 86 use = egg:kallithea
87 87 ## enable proxy prefix middleware
88 88 #filter-with = proxy-prefix
89 89
90 90 full_stack = true
91 91 static_files = true
92 92
93 93 ## Internationalization (see setup documentation for details)
94 94 ## By default, the languages requested by the browser are used if available, with English as default.
95 95 ## Set i18n.enabled=false to disable automatic language choice.
96 96 #i18n.enabled = true
97 97 ## To Force a language, set i18n.enabled=false and specify the language in i18n.lang.
98 98 ## Valid values are the names of subdirectories in kallithea/i18n with a LC_MESSAGES/kallithea.mo
99 99 #i18n.lang = en
100 100
101 101 cache_dir = %(here)s/data
102 102 index_dir = %(here)s/data/index
103 103
104 104 ## uncomment and set this path to use archive download cache
105 105 archive_cache_dir = %(here)s/data/tarballcache
106 106
107 107 ## change this to unique ID for security
108 108 #app_instance_uuid = VERY-SECRET
109 109 app_instance_uuid = development-not-secret
110 110
111 111 ## cut off limit for large diffs (size in bytes)
112 112 cut_off_limit = 256000
113 113
114 ## force https in Kallithea, fixes https redirects, assumes it's always https
115 force_https = false
114 ## always pretend the client connected using HTTPS (default false)
115 #force_https = true
116 116
117 ## use Strict-Transport-Security headers
118 use_htsts = false
117 ## use Strict-Transport-Security headers (default false)
118 #use_htsts = true
119 119
120 120 ## number of commits stats will parse on each iteration
121 121 commit_parse_limit = 25
122 122
123 123 ## Path to Python executable to be used for git hooks.
124 124 ## This value will be written inside the git hook scripts as the text
125 125 ## after '#!' (shebang). When empty or not defined, the value of
126 126 ## 'sys.executable' at the time of installation of the git hooks is
127 127 ## used, which is correct in many cases but for example not when using uwsgi.
128 128 ## If you change this setting, you should reinstall the Git hooks via
129 129 ## Admin > Settings > Remap and Rescan.
130 130 #git_hook_interpreter = /srv/kallithea/venv/bin/python3
131 131
132 132 ## path to git executable
133 133 git_path = git
134 134
135 135 ## git rev filter option, --all is the default filter, if you need to
136 136 ## hide all refs in changelog switch this to --branches --tags
137 137 #git_rev_filter = --branches --tags
138 138
139 139 ## RSS feed options
140 140 rss_cut_off_limit = 256000
141 141 rss_items_per_page = 10
142 142 rss_include_diff = false
143 143
144 144 ## options for showing and identifying changesets
145 145 show_sha_length = 12
146 146 show_revision_number = false
147 147
148 148 ## Canonical URL to use when creating full URLs in UI and texts.
149 149 ## Useful when the site is available under different names or protocols.
150 150 ## Defaults to what is provided in the WSGI environment.
151 151 #canonical_url = https://kallithea.example.com/repos
152 152
153 153 ## gist URL alias, used to create nicer urls for gist. This should be an
154 154 ## url that does rewrites to _admin/gists/<gistid>.
155 155 ## example: http://gist.example.com/{gistid}. Empty means use the internal
156 156 ## Kallithea url, ie. http[s]://kallithea.example.com/_admin/gists/<gistid>
157 157 gist_alias_url =
158 158
159 159 ## default encoding used to convert from and to unicode
160 160 ## can be also a comma separated list of encoding in case of mixed encodings
161 161 default_encoding = utf-8
162 162
163 163 ## Set Mercurial encoding, similar to setting HGENCODING before launching Kallithea
164 164 hgencoding = utf-8
165 165
166 166 ## issue tracker for Kallithea (leave blank to disable, absent for default)
167 167 #bugtracker = https://bitbucket.org/conservancy/kallithea/issues
168 168
169 169 ## issue tracking mapping for commit messages, comments, PR descriptions, ...
170 170 ## Refer to the documentation ("Integration with issue trackers") for more details.
171 171
172 172 ## regular expression to match issue references
173 173 ## This pattern may/should contain parenthesized groups, that can
174 174 ## be referred to in issue_server_link or issue_sub using Python backreferences
175 175 ## (e.g. \1, \2, ...). You can also create named groups with '(?P<groupname>)'.
176 176 ## To require mandatory whitespace before the issue pattern, use:
177 177 ## (?:^|(?<=\s)) before the actual pattern, and for mandatory whitespace
178 178 ## behind the issue pattern, use (?:$|(?=\s)) after the actual pattern.
179 179
180 180 issue_pat = #(\d+)
181 181
182 182 ## server url to the issue
183 183 ## This pattern may/should contain backreferences to parenthesized groups in issue_pat.
184 184 ## A backreference can be \1, \2, ... or \g<groupname> if you specified a named group
185 185 ## called 'groupname' in issue_pat.
186 186 ## The special token {repo} is replaced with the full repository name
187 187 ## including repository groups, while {repo_name} is replaced with just
188 188 ## the name of the repository.
189 189
190 190 issue_server_link = https://issues.example.com/{repo}/issue/\1
191 191
192 192 ## substitution pattern to use as the link text
193 193 ## If issue_sub is empty, the text matched by issue_pat is retained verbatim
194 194 ## for the link text. Otherwise, the link text is that of issue_sub, with any
195 195 ## backreferences to groups in issue_pat replaced.
196 196
197 197 issue_sub =
198 198
199 199 ## issue_pat, issue_server_link and issue_sub can have suffixes to specify
200 200 ## multiple patterns, to other issues server, wiki or others
201 201 ## below an example how to create a wiki pattern
202 202 ## wiki-some-id -> https://wiki.example.com/some-id
203 203
204 204 #issue_pat_wiki = wiki-(\S+)
205 205 #issue_server_link_wiki = https://wiki.example.com/\1
206 206 #issue_sub_wiki = WIKI-\1
207 207
208 208 ## alternative return HTTP header for failed authentication. Default HTTP
209 209 ## response is 401 HTTPUnauthorized. Currently Mercurial clients have trouble with
210 210 ## handling that. Set this variable to 403 to return HTTPForbidden
211 211 auth_ret_code =
212 212
213 213 ## allows to change the repository location in settings page
214 214 allow_repo_location_change = True
215 215
216 216 ## allows to setup custom hooks in settings page
217 217 allow_custom_hooks_settings = True
218 218
219 219 ## extra extensions for indexing, space separated and without the leading '.'.
220 220 #index.extensions =
221 221 # gemfile
222 222 # lock
223 223
224 224 ## extra filenames for indexing, space separated
225 225 #index.filenames =
226 226 # .dockerignore
227 227 # .editorconfig
228 228 # INSTALL
229 229 # CHANGELOG
230 230
231 231 ####################################
232 232 ## SSH CONFIG ##
233 233 ####################################
234 234
235 235 ## SSH is disabled by default, until an Administrator decides to enable it.
236 236 ssh_enabled = false
237 237
238 238 ## File where users' SSH keys will be stored *if* ssh_enabled is true.
239 239 #ssh_authorized_keys = /home/kallithea/.ssh/authorized_keys
240 240
241 241 ## Path to be used in ssh_authorized_keys file to invoke kallithea-cli with ssh-serve.
242 242 #kallithea_cli_path = /srv/kallithea/venv/bin/kallithea-cli
243 243
244 244 ## Locale to be used in the ssh-serve command.
245 245 ## This is needed because an SSH client may try to use its own locale
246 246 ## settings, which may not be available on the server.
247 247 ## See `locale -a` for valid values on this system.
248 248 #ssh_locale = C.UTF-8
249 249
250 250 ####################################
251 251 ## CELERY CONFIG ##
252 252 ####################################
253 253
254 254 ## Note: Celery doesn't support Windows.
255 255 use_celery = false
256 256
257 257 ## Celery config settings from https://docs.celeryproject.org/en/4.4.0/userguide/configuration.html prefixed with 'celery.'.
258 258
259 259 ## Example: use the message queue on the local virtual host 'kallitheavhost' as the RabbitMQ user 'kallithea':
260 260 celery.broker_url = amqp://kallithea:thepassword@localhost:5672/kallitheavhost
261 261
262 262 celery.worker_concurrency = 2
263 263 celery.worker_max_tasks_per_child = 100
264 264
265 265 ####################################
266 266 ## BEAKER CACHE ##
267 267 ####################################
268 268
269 269 beaker.cache.data_dir = %(here)s/data/cache/data
270 270 beaker.cache.lock_dir = %(here)s/data/cache/lock
271 271
272 272 beaker.cache.regions = long_term,long_term_file
273 273
274 274 beaker.cache.long_term.type = memory
275 275 beaker.cache.long_term.expire = 36000
276 276 beaker.cache.long_term.key_length = 256
277 277
278 278 beaker.cache.long_term_file.type = file
279 279 beaker.cache.long_term_file.expire = 604800
280 280 beaker.cache.long_term_file.key_length = 256
281 281
282 282 ####################################
283 283 ## BEAKER SESSION ##
284 284 ####################################
285 285
286 286 ## Name of session cookie. Should be unique for a given host and path, even when running
287 287 ## on different ports. Otherwise, cookie sessions will be shared and messed up.
288 288 session.key = kallithea
289 289 ## Sessions should always only be accessible by the browser, not directly by JavaScript.
290 290 session.httponly = true
291 291 ## Session lifetime. 2592000 seconds is 30 days.
292 292 session.timeout = 2592000
293 293
294 294 ## Server secret used with HMAC to ensure integrity of cookies.
295 295 #session.secret = VERY-SECRET
296 296 session.secret = development-not-secret
297 297 ## Further, encrypt the data with AES.
298 298 #session.encrypt_key = <key_for_encryption>
299 299 #session.validate_key = <validation_key>
300 300
301 301 ## Type of storage used for the session, current types are
302 302 ## dbm, file, memcached, database, and memory.
303 303
304 304 ## File system storage of session data. (default)
305 305 #session.type = file
306 306
307 307 ## Cookie only, store all session data inside the cookie. Requires secure secrets.
308 308 #session.type = cookie
309 309
310 310 ## Database storage of session data.
311 311 #session.type = ext:database
312 312 #session.sa.url = postgresql://postgres:qwe@localhost/kallithea
313 313 #session.table_name = db_session
314 314
315 315 ####################################
316 316 ## ERROR HANDLING ##
317 317 ####################################
318 318
319 319 ## Show a nice error page for application HTTP errors and exceptions (default true)
320 320 #errorpage.enabled = true
321 321
322 322 ## Enable Backlash client-side interactive debugger (default false)
323 323 ## WARNING: *THIS MUST BE false IN PRODUCTION ENVIRONMENTS!!!*
324 324 ## This debug mode will allow all visitors to execute malicious code.
325 325 #debug = false
326 326 debug = true
327 327
328 328 ## Enable Backlash server-side error reporting (unless debug mode handles it client-side) (default true)
329 329 #trace_errors.enable = true
330 330 ## Errors will be reported by mail if trace_errors.error_email is set.
331 331
332 332 ## Propagate email settings to ErrorReporter of TurboGears2
333 333 ## You do not normally need to change these lines
334 334 get trace_errors.smtp_server = smtp_server
335 335 get trace_errors.smtp_port = smtp_port
336 336 get trace_errors.from_address = error_email_from
337 337 get trace_errors.error_email = email_to
338 338 get trace_errors.smtp_username = smtp_username
339 339 get trace_errors.smtp_password = smtp_password
340 340 get trace_errors.smtp_use_tls = smtp_use_tls
341 341
342 342 ##################################
343 343 ## LOGVIEW CONFIG ##
344 344 ##################################
345 345
346 346 logview.sqlalchemy = #faa
347 347 logview.pylons.templating = #bfb
348 348 logview.pylons.util = #eee
349 349
350 350 #########################
351 351 ## DB CONFIG ##
352 352 #########################
353 353
354 354 sqlalchemy.url = sqlite:///%(here)s/kallithea.db?timeout=60
355 355 #sqlalchemy.url = postgresql://kallithea:password@localhost/kallithea
356 356 #sqlalchemy.url = mysql://kallithea:password@localhost/kallithea?charset=utf8mb4
357 357 ## Note: the mysql:// prefix should also be used for MariaDB
358 358
359 359 sqlalchemy.pool_recycle = 3600
360 360
361 361 ################################
362 362 ## ALEMBIC CONFIGURATION ##
363 363 ################################
364 364
365 365 [alembic]
366 366 script_location = kallithea:alembic
367 367
368 368 ################################
369 369 ## LOGGING CONFIGURATION ##
370 370 ################################
371 371
372 372 [loggers]
373 373 keys = root, routes, kallithea, sqlalchemy, tg, gearbox, beaker, templates, whoosh_indexer, werkzeug, backlash
374 374
375 375 [handlers]
376 376 keys = console, console_color, console_color_sql, null
377 377
378 378 [formatters]
379 379 keys = generic, color_formatter, color_formatter_sql
380 380
381 381 #############
382 382 ## LOGGERS ##
383 383 #############
384 384
385 385 [logger_root]
386 386 level = NOTSET
387 387 #handlers = console
388 388 ## For coloring based on log level:
389 389 handlers = console_color
390 390
391 391 [logger_routes]
392 392 #level = WARN
393 393 level = DEBUG
394 394 handlers =
395 395 qualname = routes.middleware
396 396 ## "level = DEBUG" logs the route matched and routing variables.
397 397
398 398 [logger_beaker]
399 399 #level = WARN
400 400 level = DEBUG
401 401 handlers =
402 402 qualname = beaker.container
403 403
404 404 [logger_templates]
405 405 #level = WARN
406 406 level = INFO
407 407 handlers =
408 408 qualname = pylons.templating
409 409
410 410 [logger_kallithea]
411 411 #level = WARN
412 412 level = DEBUG
413 413 handlers =
414 414 qualname = kallithea
415 415
416 416 [logger_tg]
417 417 #level = WARN
418 418 level = DEBUG
419 419 handlers =
420 420 qualname = tg
421 421
422 422 [logger_gearbox]
423 423 #level = WARN
424 424 level = DEBUG
425 425 handlers =
426 426 qualname = gearbox
427 427
428 428 [logger_sqlalchemy]
429 429 level = WARN
430 430 handlers =
431 431 qualname = sqlalchemy.engine
432 432 ## For coloring based on log level and pretty printing of SQL:
433 433 #level = INFO
434 434 #handlers = console_color_sql
435 435 #propagate = 0
436 436
437 437 [logger_whoosh_indexer]
438 438 #level = WARN
439 439 level = DEBUG
440 440 handlers =
441 441 qualname = whoosh_indexer
442 442
443 443 [logger_werkzeug]
444 444 level = WARN
445 445 handlers =
446 446 qualname = werkzeug
447 447
448 448 [logger_backlash]
449 449 level = WARN
450 450 handlers =
451 451 qualname = backlash
452 452
453 453 ##############
454 454 ## HANDLERS ##
455 455 ##############
456 456
457 457 [handler_console]
458 458 class = StreamHandler
459 459 args = (sys.stderr,)
460 460 formatter = generic
461 461
462 462 [handler_console_color]
463 463 ## ANSI color coding based on log level
464 464 class = StreamHandler
465 465 args = (sys.stderr,)
466 466 formatter = color_formatter
467 467
468 468 [handler_console_color_sql]
469 469 ## ANSI color coding and pretty printing of SQL statements
470 470 class = StreamHandler
471 471 args = (sys.stderr,)
472 472 formatter = color_formatter_sql
473 473
474 474 [handler_null]
475 475 class = NullHandler
476 476 args = ()
477 477
478 478 ################
479 479 ## FORMATTERS ##
480 480 ################
481 481
482 482 [formatter_generic]
483 483 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
484 484 datefmt = %Y-%m-%d %H:%M:%S
485 485
486 486 [formatter_color_formatter]
487 487 class = kallithea.lib.colored_formatter.ColorFormatter
488 488 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
489 489 datefmt = %Y-%m-%d %H:%M:%S
490 490
491 491 [formatter_color_formatter_sql]
492 492 class = kallithea.lib.colored_formatter.ColorFormatterSql
493 493 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
494 494 datefmt = %Y-%m-%d %H:%M:%S
495 495
496 496 #################
497 497 ## SSH LOGGING ##
498 498 #################
499 499
500 500 ## The default loggers use 'handler_console' that uses StreamHandler with
501 501 ## destination 'sys.stderr'. In the context of the SSH server process, these log
502 502 ## messages would be sent to the client, which is normally not what you want.
503 503 ## By default, when running ssh-serve, just use NullHandler and disable logging
504 504 ## completely. For other logging options, see:
505 505 ## https://docs.python.org/2/library/logging.handlers.html
506 506
507 507 [ssh_serve:logger_root]
508 508 level = CRITICAL
509 509 handlers = null
510 510
511 511 ## Note: If logging is configured with other handlers, they might need similar
512 512 ## muting for ssh-serve too.
@@ -1,659 +1,659 b''
1 1 .. _setup:
2 2
3 3 =====
4 4 Setup
5 5 =====
6 6
7 7
8 8 Setting up a Kallithea instance
9 9 -------------------------------
10 10
11 11 Some further details to the steps mentioned in the overview.
12 12
13 13 Create low level configuration file
14 14 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15 15
16 16 First, you will need to create a Kallithea configuration file. The
17 17 configuration file is a ``.ini`` file that contains various low level settings
18 18 for Kallithea, e.g. configuration of how to use database, web server, email,
19 19 and logging.
20 20
21 21 Change to the desired directory (such as ``/srv/kallithea``) as the right user
22 22 and run the following command to create the file ``my.ini`` in the current
23 23 directory::
24 24
25 25 kallithea-cli config-create my.ini http_server=waitress
26 26
27 27 To get a good starting point for your configuration, specify the http server
28 28 you intend to use. It can be ``waitress``, ``gearbox``, ``gevent``,
29 29 ``gunicorn``, or ``uwsgi``. (Apache ``mod_wsgi`` will not use this
30 30 configuration file, and it is fine to keep the default http_server configuration
31 31 unused. ``mod_wsgi`` is configured using ``httpd.conf`` directives and a WSGI
32 32 wrapper script.)
33 33
34 34 Extra custom settings can be specified like::
35 35
36 36 kallithea-cli config-create my.ini host=8.8.8.8 "[handler_console]" formatter=color_formatter
37 37
38 38 Populate the database
39 39 ^^^^^^^^^^^^^^^^^^^^^
40 40
41 41 Next, you need to create the databases used by Kallithea. Kallithea currently
42 42 supports PostgreSQL, SQLite and MariaDB/MySQL databases. It is recommended to
43 43 start out using SQLite (the default) and move to PostgreSQL if it becomes a
44 44 bottleneck or to get a "proper" database. MariaDB/MySQL is also supported.
45 45
46 46 For PostgreSQL, run ``pip install psycopg2`` to get the database driver. Make
47 47 sure the PostgreSQL server is initialized and running. Make sure you have a
48 48 database user with password authentication with permissions to create databases
49 49 - for example by running::
50 50
51 51 sudo -u postgres createuser 'kallithea' --pwprompt --createdb
52 52
53 53 For MariaDB/MySQL, run ``pip install mysqlclient`` to get the ``MySQLdb``
54 54 database driver. Make sure the database server is initialized and running. Make
55 55 sure you have a database user with password authentication with permissions to
56 56 create the database - for example by running::
57 57
58 58 echo 'CREATE USER "kallithea"@"localhost" IDENTIFIED BY "password"' | sudo -u mysql mysql
59 59 echo 'GRANT ALL PRIVILEGES ON `kallithea`.* TO "kallithea"@"localhost"' | sudo -u mysql mysql
60 60
61 61 Check and adjust ``sqlalchemy.url`` in your ``my.ini`` configuration file to use
62 62 this database.
63 63
64 64 Create the database, tables, and initial content by running the following
65 65 command::
66 66
67 67 kallithea-cli db-create -c my.ini
68 68
69 69 This will first prompt you for a "root" path. This "root" path is the location
70 70 where Kallithea will store all of its repositories on the current machine. This
71 71 location must be writable for the running Kallithea application. Next,
72 72 ``db-create`` will prompt you for a username and password for the initial admin
73 73 account it sets up for you.
74 74
75 75 The ``db-create`` values can also be given on the command line.
76 76 Example::
77 77
78 78 kallithea-cli db-create -c my.ini --user=nn --password=secret --email=nn@example.com --repos=/srv/repos
79 79
80 80 The ``db-create`` command will create all needed tables and an
81 81 admin account. When choosing a root path you can either use a new
82 82 empty location, or a location which already contains existing
83 83 repositories. If you choose a location which contains existing
84 84 repositories Kallithea will add all of the repositories at the chosen
85 85 location to its database. (Note: make sure you specify the correct
86 86 path to the root).
87 87
88 88 .. note:: It is also possible to use an existing database. For example,
89 89 when using PostgreSQL without granting general createdb privileges to
90 90 the PostgreSQL kallithea user, set ``sqlalchemy.url =
91 91 postgresql://kallithea:password@localhost/kallithea`` and create the
92 92 database like::
93 93
94 94 sudo -u postgres createdb 'kallithea' --owner 'kallithea'
95 95 kallithea-cli db-create -c my.ini --reuse
96 96
97 97 Running
98 98 ^^^^^^^
99 99
100 100 You are now ready to use Kallithea. To run it using a gearbox web server,
101 101 simply execute::
102 102
103 103 gearbox serve -c my.ini
104 104
105 105 - This command runs the Kallithea server. The web app should be available at
106 106 http://127.0.0.1:5000. The IP address and port is configurable via the
107 107 configuration file created in the previous step.
108 108 - Log in to Kallithea using the admin account created when running ``db-create``.
109 109 - The default permissions on each repository is read, and the owner is admin.
110 110 Remember to update these if needed.
111 111 - In the admin panel you can toggle LDAP, anonymous, and permissions
112 112 settings, as well as edit more advanced options on users and
113 113 repositories.
114 114
115 115
116 116 Internationalization (i18n support)
117 117 -----------------------------------
118 118
119 119 The Kallithea web interface is automatically displayed in the user's preferred
120 120 language, as indicated by the browser. Thus, different users may see the
121 121 application in different languages. If the requested language is not available
122 122 (because the translation file for that language does not yet exist or is
123 123 incomplete), English is used.
124 124
125 125 If you want to disable automatic language detection and instead configure a
126 126 fixed language regardless of user preference, set ``i18n.enabled = false`` and
127 127 specify another language by setting ``i18n.lang`` in the Kallithea
128 128 configuration file.
129 129
130 130
131 131 Using Kallithea with SSH
132 132 ------------------------
133 133
134 134 Kallithea supports repository access via SSH key based authentication.
135 135 This means:
136 136
137 137 - repository URLs like ``ssh://kallithea@example.com/name/of/repository``
138 138
139 139 - all network traffic for both read and write happens over the SSH protocol on
140 140 port 22, without using HTTP/HTTPS nor the Kallithea WSGI application
141 141
142 142 - encryption and authentication protocols are managed by the system's ``sshd``
143 143 process, with all users using the same Kallithea system user (e.g.
144 144 ``kallithea``) when connecting to the SSH server, but with users' public keys
145 145 in the Kallithea system user's `.ssh/authorized_keys` file granting each user
146 146 sandboxed access to the repositories.
147 147
148 148 - users and admins can manage SSH public keys in the web UI
149 149
150 150 - in their SSH client configuration, users can configure how the client should
151 151 control access to their SSH key - without passphrase, with passphrase, and
152 152 optionally with passphrase caching in the local shell session (``ssh-agent``).
153 153 This is standard SSH functionality, not something Kallithea provides or
154 154 interferes with.
155 155
156 156 - network communication between client and server happens in a bidirectional
157 157 stateful stream, and will in some cases be faster than HTTP/HTTPS with several
158 158 stateless round-trips.
159 159
160 160 .. note:: At this moment, repository access via SSH has been tested on Unix
161 161 only. Windows users that care about SSH are invited to test it and report
162 162 problems, ideally contributing patches that solve these problems.
163 163
164 164 Users and admins can upload SSH public keys (e.g. ``.ssh/id_rsa.pub``) through
165 165 the web interface. The server's ``.ssh/authorized_keys`` file is automatically
166 166 maintained with an entry for each SSH key. Each entry will tell ``sshd`` to run
167 167 ``kallithea-cli`` with the ``ssh-serve`` sub-command and the right Kallithea user ID
168 168 when encountering the corresponding SSH key.
169 169
170 170 To enable SSH repository access, Kallithea must be configured with the path to
171 171 the ``.ssh/authorized_keys`` file for the Kallithea user, and the path to the
172 172 ``kallithea-cli`` command. Put something like this in the ``.ini`` file::
173 173
174 174 ssh_enabled = true
175 175 ssh_authorized_keys = /home/kallithea/.ssh/authorized_keys
176 176 kallithea_cli_path = /srv/kallithea/venv/bin/kallithea-cli
177 177
178 178 The SSH service must be running, and the Kallithea user account must be active
179 179 (not necessarily with password access, but public key access must be enabled),
180 180 all file permissions must be set as sshd wants it, and ``authorized_keys`` must
181 181 be writeable by the Kallithea user.
182 182
183 183 .. note:: The ``authorized_keys`` file will be rewritten from scratch on
184 184 each update. If it already exists with other data, Kallithea will not
185 185 overwrite the existing ``authorized_keys``, and the server process will
186 186 instead throw an exception. The system administrator thus cannot ssh
187 187 directly to the Kallithea user but must use su/sudo from another account.
188 188
189 189 If ``/home/kallithea/.ssh/`` (the directory of the path specified in the
190 190 ``ssh_authorized_keys`` setting of the ``.ini`` file) does not exist as a
191 191 directory, Kallithea will attempt to create it. If that path exists but is
192 192 *not* a directory, or is not readable-writable-executable by the server
193 193 process, the server process will raise an exception each time it attempts to
194 194 write the ``authorized_keys`` file.
195 195
196 196 .. note:: It is possible to configure the SSH server to look for authorized
197 197 keys in multiple files, for example reserving ``ssh/authorized_keys`` to be
198 198 used for normal SSH and with Kallithea using
199 199 ``.ssh/authorized_keys_kallithea``. In ``/etc/ssh/sshd_config`` set
200 200 ``AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys_kallithea``
201 201 and restart sshd, and in ``my.ini`` set ``ssh_authorized_keys =
202 202 /home/kallithea/.ssh/authorized_keys_kallithea``. Note that this new
203 203 location will apply to all system users, and that multiple entries for the
204 204 same SSH key will shadow each other.
205 205
206 206 .. warning:: The handling of SSH access is steered directly by the command
207 207 specified in the ``authorized_keys`` file. There is no interaction with the
208 208 web UI. Once SSH access is correctly configured and enabled, it will work
209 209 regardless of whether the Kallithea web process is actually running. Hence,
210 210 if you want to perform repository or server maintenance and want to fully
211 211 disable all access to the repositories, disable SSH access by setting
212 212 ``ssh_enabled = false`` in the correct ``.ini`` file (i.e. the ``.ini`` file
213 213 specified in the ``authorized_keys`` file.)
214 214
215 215 The ``authorized_keys`` file can be updated manually with ``kallithea-cli
216 216 ssh-update-authorized-keys -c my.ini``. This command is not needed in normal
217 217 operation but is for example useful after changing SSH-related settings in the
218 218 ``.ini`` file or renaming that file. (The path to the ``.ini`` file is used in
219 219 the generated ``authorized_keys`` file).
220 220
221 221
222 222 Setting up Whoosh full text search
223 223 ----------------------------------
224 224
225 225 Kallithea provides full text search of repositories using `Whoosh`__.
226 226
227 227 .. __: https://whoosh.readthedocs.io/
228 228
229 229 For an incremental index build, run::
230 230
231 231 kallithea-cli index-create -c my.ini
232 232
233 233 For a full index rebuild, run::
234 234
235 235 kallithea-cli index-create -c my.ini --full
236 236
237 237 The ``--repo-location`` option allows the location of the repositories to be overridden;
238 238 usually, the location is retrieved from the Kallithea database.
239 239
240 240 The ``--index-only`` option can be used to limit the indexed repositories to a comma-separated list::
241 241
242 242 kallithea-cli index-create -c my.ini --index-only=vcs,kallithea
243 243
244 244 To keep your index up-to-date it is necessary to do periodic index builds;
245 245 for this, it is recommended to use a crontab entry. Example::
246 246
247 247 0 3 * * * /path/to/virtualenv/bin/kallithea-cli index-create -c /path/to/kallithea/my.ini
248 248
249 249 When using incremental mode (the default), Whoosh will check the last
250 250 modification date of each file and add it to be reindexed if a newer file is
251 251 available. The indexing daemon checks for any removed files and removes them
252 252 from index.
253 253
254 254 If you want to rebuild the index from scratch, you can use the ``-f`` flag as above,
255 255 or in the admin panel you can check the "build from scratch" checkbox.
256 256
257 257
258 258 Integration with issue trackers
259 259 -------------------------------
260 260
261 261 Kallithea provides a simple integration with issue trackers. It's possible
262 262 to define a regular expression that will match an issue ID in commit messages,
263 263 and have that replaced with a URL to the issue.
264 264
265 265 This is achieved with following three variables in the ini file::
266 266
267 267 issue_pat = #(\d+)
268 268 issue_server_link = https://issues.example.com/{repo}/issue/\1
269 269 issue_sub =
270 270
271 271 ``issue_pat`` is the regular expression describing which strings in
272 272 commit messages will be treated as issue references. The expression can/should
273 273 have one or more parenthesized groups that can later be referred to in
274 274 ``issue_server_link`` and ``issue_sub`` (see below). If you prefer, named groups
275 275 can be used instead of simple parenthesized groups.
276 276
277 277 If the pattern should only match if it is preceded by whitespace, add the
278 278 following string before the actual pattern: ``(?:^|(?<=\s))``.
279 279 If the pattern should only match if it is followed by whitespace, add the
280 280 following string after the actual pattern: ``(?:$|(?=\s))``.
281 281 These expressions use lookbehind and lookahead assertions of the Python regular
282 282 expression module to avoid the whitespace to be part of the actual pattern,
283 283 otherwise the link text will also contain that whitespace.
284 284
285 285 Matched issue references are replaced with the link specified in
286 286 ``issue_server_link``, in which any backreferences are resolved. Backreferences
287 287 can be ``\1``, ``\2``, ... or for named groups ``\g<groupname>``.
288 288 The special token ``{repo}`` is replaced with the full repository path
289 289 (including repository groups), while token ``{repo_name}`` is replaced with the
290 290 repository name (without repository groups).
291 291
292 292 The link text is determined by ``issue_sub``, which can be a string containing
293 293 backreferences to the groups specified in ``issue_pat``. If ``issue_sub`` is
294 294 empty, then the text matched by ``issue_pat`` is used verbatim.
295 295
296 296 The example settings shown above match issues in the format ``#<number>``.
297 297 This will cause the text ``#300`` to be transformed into a link:
298 298
299 299 .. code-block:: html
300 300
301 301 <a href="https://issues.example.com/example_repo/issue/300">#300</a>
302 302
303 303 The following example transforms a text starting with either of 'pullrequest',
304 304 'pull request' or 'PR', followed by an optional space, then a pound character
305 305 (#) and one or more digits, into a link with the text 'PR #' followed by the
306 306 digits::
307 307
308 308 issue_pat = (pullrequest|pull request|PR) ?#(\d+)
309 309 issue_server_link = https://issues.example.com/\2
310 310 issue_sub = PR #\2
311 311
312 312 The following example demonstrates how to require whitespace before the issue
313 313 reference in order for it to be recognized, such that the text ``issue#123`` will
314 314 not cause a match, but ``issue #123`` will::
315 315
316 316 issue_pat = (?:^|(?<=\s))#(\d+)
317 317 issue_server_link = https://issues.example.com/\1
318 318 issue_sub =
319 319
320 320 If needed, more than one pattern can be specified by appending a unique suffix to
321 321 the variables. For example, also demonstrating the use of named groups::
322 322
323 323 issue_pat_wiki = wiki-(?P<pagename>\S+)
324 324 issue_server_link_wiki = https://wiki.example.com/\g<pagename>
325 325 issue_sub_wiki = WIKI-\g<pagename>
326 326
327 327 With these settings, wiki pages can be referenced as wiki-some-id, and every
328 328 such reference will be transformed into:
329 329
330 330 .. code-block:: html
331 331
332 332 <a href="https://wiki.example.com/some-id">WIKI-some-id</a>
333 333
334 334 Refer to the `Python regular expression documentation`_ for more details about
335 335 the supported syntax in ``issue_pat``, ``issue_server_link`` and ``issue_sub``.
336 336
337 337
338 338 Hook management
339 339 ---------------
340 340
341 341 Custom Mercurial hooks can be managed in a similar way to that used in ``.hgrc`` files.
342 342 To manage hooks, choose *Admin > Settings > Hooks*.
343 343
344 344 To add another custom hook simply fill in the first textbox with
345 345 ``<name>.<hook_type>`` and the second with the hook path. Example hooks
346 346 can be found in ``kallithea.lib.hooks``.
347 347
348 348 Kallithea will also use some hooks internally. They cannot be modified, but
349 349 some of them can be enabled or disabled in the *VCS* section.
350 350
351 351 Kallithea does not actively support custom Git hooks, but hooks can be installed
352 352 manually in the file system. Kallithea will install and use the
353 353 ``post-receive`` Git hook internally, but it will then invoke
354 354 ``post-receive-custom`` if present.
355 355
356 356
357 357 Changing default encoding
358 358 -------------------------
359 359
360 360 By default, Kallithea uses UTF-8 encoding.
361 361 This is configurable as ``default_encoding`` in the .ini file.
362 362 This affects many parts in Kallithea including user names, filenames, and
363 363 encoding of commit messages. In addition Kallithea can detect if the ``chardet``
364 364 library is installed. If ``chardet`` is detected Kallithea will fallback to it
365 365 when there are encode/decode errors.
366 366
367 367 The Mercurial encoding is configurable as ``hgencoding``. It is similar to
368 368 setting the ``HGENCODING`` environment variable, but will override it.
369 369
370 370
371 371 Celery configuration
372 372 --------------------
373 373
374 374 Kallithea can use the distributed task queue system Celery_ to run tasks like
375 375 cloning repositories or sending emails.
376 376
377 377 Kallithea will in most setups work perfectly fine out of the box (without
378 378 Celery), executing all tasks in the web server process. Some tasks can however
379 379 take some time to run and it can be better to run such tasks asynchronously in
380 380 a separate process so the web server can focus on serving web requests.
381 381
382 382 For installation and configuration of Celery, see the `Celery documentation`_.
383 383 Note that Celery requires a message broker service like RabbitMQ_ (recommended)
384 384 or Redis_.
385 385
386 386 The use of Celery is configured in the Kallithea ini configuration file.
387 387 To enable it, simply set::
388 388
389 389 use_celery = true
390 390
391 391 and add or change the ``celery.*`` configuration variables.
392 392
393 393 Configuration settings are prefixed with 'celery.', so for example setting
394 394 `broker_url` in Celery means setting `celery.broker_url` in the configuration
395 395 file.
396 396
397 397 To start the Celery process, run::
398 398
399 399 kallithea-cli celery-run -c my.ini
400 400
401 401 Extra options to the Celery worker can be passed after ``--`` - see ``-- -h``
402 402 for more info.
403 403
404 404 .. note::
405 405 Make sure you run this command from the same virtualenv, and with the same
406 406 user that Kallithea runs.
407 407
408 408
409 409 HTTPS support
410 410 -------------
411 411
412 412 Kallithea will by default generate URLs based on the WSGI environment.
413 413
414 414 Alternatively, you can use some special configuration settings to control
415 415 directly which scheme/protocol Kallithea will use when generating URLs:
416 416
417 417 - With ``https_fixup = true``, the scheme will be taken from the
418 418 ``X-Url-Scheme``, ``X-Forwarded-Scheme`` or ``X-Forwarded-Proto`` HTTP header
419 419 (default ``http``).
420 - With ``force_https = true`` the default will be ``https``.
420 - With ``force_https = true``, the scheme will be seen as ``https``.
421 421 - With ``use_htsts = true``, Kallithea will set ``Strict-Transport-Security`` when using https.
422 422
423 423 .. _nginx_virtual_host:
424 424
425 425
426 426 Nginx virtual host example
427 427 --------------------------
428 428
429 429 Sample config for Nginx using proxy:
430 430
431 431 .. code-block:: nginx
432 432
433 433 upstream kallithea {
434 434 server 127.0.0.1:5000;
435 435 # add more instances for load balancing
436 436 #server 127.0.0.1:5001;
437 437 #server 127.0.0.1:5002;
438 438 }
439 439
440 440 ## gist alias
441 441 server {
442 442 listen 443;
443 443 server_name gist.example.com;
444 444 access_log /var/log/nginx/gist.access.log;
445 445 error_log /var/log/nginx/gist.error.log;
446 446
447 447 ssl on;
448 448 ssl_certificate gist.your.kallithea.server.crt;
449 449 ssl_certificate_key gist.your.kallithea.server.key;
450 450
451 451 ssl_session_timeout 5m;
452 452
453 453 ssl_protocols SSLv3 TLSv1;
454 454 ssl_ciphers DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:EDH-RSA-DES-CBC3-SHA:AES256-SHA:DES-CBC3-SHA:AES128-SHA:RC4-SHA:RC4-MD5;
455 455 ssl_prefer_server_ciphers on;
456 456
457 457 rewrite ^/(.+)$ https://kallithea.example.com/_admin/gists/$1;
458 458 rewrite (.*) https://kallithea.example.com/_admin/gists;
459 459 }
460 460
461 461 server {
462 462 listen 443;
463 463 server_name kallithea.example.com
464 464 access_log /var/log/nginx/kallithea.access.log;
465 465 error_log /var/log/nginx/kallithea.error.log;
466 466
467 467 ssl on;
468 468 ssl_certificate your.kallithea.server.crt;
469 469 ssl_certificate_key your.kallithea.server.key;
470 470
471 471 ssl_session_timeout 5m;
472 472
473 473 ssl_protocols SSLv3 TLSv1;
474 474 ssl_ciphers DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:EDH-RSA-DES-CBC3-SHA:AES256-SHA:DES-CBC3-SHA:AES128-SHA:RC4-SHA:RC4-MD5;
475 475 ssl_prefer_server_ciphers on;
476 476
477 477 ## uncomment root directive if you want to serve static files by nginx
478 478 ## requires static_files = false in .ini file
479 479 #root /srv/kallithea/kallithea/kallithea/public;
480 480 include /etc/nginx/proxy.conf;
481 481 location / {
482 482 try_files $uri @kallithea;
483 483 }
484 484
485 485 location @kallithea {
486 486 proxy_pass http://127.0.0.1:5000;
487 487 }
488 488
489 489 }
490 490
491 491 Here's the proxy.conf. It's tuned so it will not timeout on long
492 492 pushes or large pushes::
493 493
494 494 proxy_redirect off;
495 495 proxy_set_header Host $host;
496 496 ## needed for container auth
497 497 #proxy_set_header REMOTE_USER $remote_user;
498 498 #proxy_set_header X-Forwarded-User $remote_user;
499 499 proxy_set_header X-Url-Scheme $scheme;
500 500 proxy_set_header X-Host $http_host;
501 501 proxy_set_header X-Real-IP $remote_addr;
502 502 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
503 503 proxy_set_header Proxy-host $proxy_host;
504 504 proxy_buffering off;
505 505 proxy_connect_timeout 7200;
506 506 proxy_send_timeout 7200;
507 507 proxy_read_timeout 7200;
508 508 proxy_buffers 8 32k;
509 509 client_max_body_size 1024m;
510 510 client_body_buffer_size 128k;
511 511 large_client_header_buffers 8 64k;
512 512
513 513 .. _apache_virtual_host_reverse_proxy:
514 514
515 515
516 516 Apache virtual host reverse proxy example
517 517 -----------------------------------------
518 518
519 519 Here is a sample configuration file for Apache using proxy:
520 520
521 521 .. code-block:: apache
522 522
523 523 <VirtualHost *:80>
524 524 ServerName kallithea.example.com
525 525
526 526 <Proxy *>
527 527 # For Apache 2.4 and later:
528 528 Require all granted
529 529
530 530 # For Apache 2.2 and earlier, instead use:
531 531 # Order allow,deny
532 532 # Allow from all
533 533 </Proxy>
534 534
535 535 #important !
536 536 #Directive to properly generate url (clone url) for Kallithea
537 537 ProxyPreserveHost On
538 538
539 539 #kallithea instance
540 540 ProxyPass / http://127.0.0.1:5000/
541 541 ProxyPassReverse / http://127.0.0.1:5000/
542 542
543 543 #to enable https use line below
544 544 #SetEnvIf X-Url-Scheme https HTTPS=1
545 545 </VirtualHost>
546 546
547 547 Additional tutorial
548 548 http://pylonsbook.com/en/1.1/deployment.html#using-apache-to-proxy-requests-to-pylons
549 549
550 550 .. _apache_subdirectory:
551 551
552 552
553 553 Apache as subdirectory
554 554 ----------------------
555 555
556 556 Apache subdirectory part:
557 557
558 558 .. code-block:: apache
559 559
560 560 <Location /PREFIX >
561 561 ProxyPass http://127.0.0.1:5000/PREFIX
562 562 ProxyPassReverse http://127.0.0.1:5000/PREFIX
563 563 SetEnvIf X-Url-Scheme https HTTPS=1
564 564 </Location>
565 565
566 566 Besides the regular apache setup you will need to add the following line
567 567 into ``[app:main]`` section of your .ini file::
568 568
569 569 filter-with = proxy-prefix
570 570
571 571 Add the following at the end of the .ini file::
572 572
573 573 [filter:proxy-prefix]
574 574 use = egg:PasteDeploy#prefix
575 575 prefix = /PREFIX
576 576
577 577 then change ``PREFIX`` into your chosen prefix
578 578
579 579 .. _apache_mod_wsgi:
580 580
581 581
582 582 Apache with mod_wsgi
583 583 --------------------
584 584
585 585 Alternatively, Kallithea can be set up with Apache under mod_wsgi. For
586 586 that, you'll need to:
587 587
588 588 - Install mod_wsgi. If using a Debian-based distro, you can install
589 589 the package libapache2-mod-wsgi::
590 590
591 591 aptitude install libapache2-mod-wsgi
592 592
593 593 - Enable mod_wsgi::
594 594
595 595 a2enmod wsgi
596 596
597 597 - Add global Apache configuration to tell mod_wsgi that Python only will be
598 598 used in the WSGI processes and shouldn't be initialized in the Apache
599 599 processes::
600 600
601 601 WSGIRestrictEmbedded On
602 602
603 603 - Create a WSGI dispatch script, like the one below. The ``WSGIDaemonProcess``
604 604 ``python-home`` directive will make sure it uses the right Python Virtual
605 605 Environment and that paste thus can pick up the right Kallithea
606 606 application.
607 607
608 608 .. code-block:: python
609 609
610 610 ini = '/srv/kallithea/my.ini'
611 611 from logging.config import fileConfig
612 612 fileConfig(ini, {'__file__': ini, 'here': '/srv/kallithea'})
613 613 from paste.deploy import loadapp
614 614 application = loadapp('config:' + ini)
615 615
616 616 - Add the necessary ``WSGI*`` directives to the Apache Virtual Host configuration
617 617 file, like in the example below. Notice that the WSGI dispatch script created
618 618 above is referred to with the ``WSGIScriptAlias`` directive.
619 619 The default locale settings Apache provides for web services are often not
620 620 adequate, with `C` as the default language and `ASCII` as the encoding.
621 621 Instead, use the ``lang`` parameter of ``WSGIDaemonProcess`` to specify a
622 622 suitable locale. See also the :ref:`overview` section and the
623 623 `WSGIDaemonProcess documentation`_.
624 624
625 625 Apache will by default run as a special Apache user, on Linux systems
626 626 usually ``www-data`` or ``apache``. If you need to have the repositories
627 627 directory owned by a different user, use the user and group options to
628 628 WSGIDaemonProcess to set the name of the user and group.
629 629
630 630 Once again, check that all paths are correctly specified.
631 631
632 632 .. code-block:: apache
633 633
634 634 WSGIDaemonProcess kallithea processes=5 threads=1 maximum-requests=100 \
635 635 python-home=/srv/kallithea/venv lang=C.UTF-8
636 636 WSGIProcessGroup kallithea
637 637 WSGIScriptAlias / /srv/kallithea/dispatch.wsgi
638 638 WSGIPassAuthorization On
639 639
640 640
641 641 Other configuration files
642 642 -------------------------
643 643
644 644 A number of `example init.d scripts`__ can be found in
645 645 the ``init.d`` directory of the Kallithea source.
646 646
647 647 .. __: https://kallithea-scm.org/repos/kallithea/files/tip/init.d/ .
648 648
649 649
650 650 .. _python: http://www.python.org/
651 651 .. _Python regular expression documentation: https://docs.python.org/2/library/re.html
652 652 .. _Mercurial: https://www.mercurial-scm.org/
653 653 .. _Celery: http://celeryproject.org/
654 654 .. _Celery documentation: http://docs.celeryproject.org/en/latest/getting-started/index.html
655 655 .. _RabbitMQ: http://www.rabbitmq.com/
656 656 .. _Redis: http://redis.io/
657 657 .. _mercurial-server: http://www.lshift.net/mercurial-server.html
658 658 .. _PublishingRepositories: https://www.mercurial-scm.org/wiki/PublishingRepositories
659 659 .. _WSGIDaemonProcess documentation: https://modwsgi.readthedocs.io/en/develop/configuration-directives/WSGIDaemonProcess.html
@@ -1,590 +1,590 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%text>##</%text>#################################################################################
3 3 <%text>##</%text>#################################################################################
4 4 <%text>##</%text> Kallithea config file generated with kallithea-cli ${'%-27s' % version }##
5 5 <%text>##</%text> ##
6 6 <%text>##</%text> The %(here)s variable will generally be replaced with the parent directory of ##
7 7 <%text>##</%text> this file. Other use of % must be escaped as %% . ##
8 8 <%text>##</%text>#################################################################################
9 9 <%text>##</%text>#################################################################################
10 10
11 11 [DEFAULT]
12 12
13 13 <%text>##</%text>##############################################################################
14 14 <%text>##</%text> Email settings ##
15 15 <%text>##</%text> ##
16 16 <%text>##</%text> Refer to the documentation ("Email settings") for more details. ##
17 17 <%text>##</%text> ##
18 18 <%text>##</%text> It is recommended to use a valid sender address that passes access ##
19 19 <%text>##</%text> validation and spam filtering in mail servers. ##
20 20 <%text>##</%text>##############################################################################
21 21
22 22 <%text>##</%text> 'From' header for application emails. You can optionally add a name.
23 23 <%text>##</%text> Default:
24 24 #app_email_from = Kallithea
25 25 <%text>##</%text> Examples:
26 26 #app_email_from = Kallithea <kallithea-noreply@example.com>
27 27 #app_email_from = kallithea-noreply@example.com
28 28
29 29 <%text>##</%text> Subject prefix for application emails.
30 30 <%text>##</%text> A space between this prefix and the real subject is automatically added.
31 31 <%text>##</%text> Default:
32 32 #email_prefix =
33 33 <%text>##</%text> Example:
34 34 #email_prefix = [Kallithea]
35 35
36 36 <%text>##</%text> Recipients for error emails and fallback recipients of application mails.
37 37 <%text>##</%text> Multiple addresses can be specified, comma-separated.
38 38 <%text>##</%text> Only addresses are allowed, do not add any name part.
39 39 <%text>##</%text> Default:
40 40 #email_to =
41 41 <%text>##</%text> Examples:
42 42 #email_to = admin@example.com
43 43 #email_to = admin@example.com,another_admin@example.com
44 44 email_to =
45 45
46 46 <%text>##</%text> 'From' header for error emails. You can optionally add a name.
47 47 <%text>##</%text> Default: (none)
48 48 <%text>##</%text> Examples:
49 49 #error_email_from = Kallithea Errors <kallithea-noreply@example.com>
50 50 #error_email_from = kallithea_errors@example.com
51 51 error_email_from =
52 52
53 53 <%text>##</%text> SMTP server settings
54 54 <%text>##</%text> If specifying credentials, make sure to use secure connections.
55 55 <%text>##</%text> Default: Send unencrypted unauthenticated mails to the specified smtp_server.
56 56 <%text>##</%text> For "SSL", use smtp_use_ssl = true and smtp_port = 465.
57 57 <%text>##</%text> For "STARTTLS", use smtp_use_tls = true and smtp_port = 587.
58 58 smtp_server =
59 59 smtp_username =
60 60 smtp_password =
61 61 smtp_port =
62 62 smtp_use_ssl = false
63 63 smtp_use_tls = false
64 64
65 65 %if http_server != 'uwsgi':
66 66 <%text>##</%text> Entry point for 'gearbox serve'
67 67 [server:main]
68 68 host = ${host}
69 69 port = ${port}
70 70
71 71 %if http_server == 'gearbox':
72 72 <%text>##</%text> Gearbox serve uses the built-in development web server ##
73 73 use = egg:gearbox#wsgiref
74 74 <%text>##</%text> nr of worker threads to spawn
75 75 threadpool_workers = 1
76 76 <%text>##</%text> max request before thread respawn
77 77 threadpool_max_requests = 100
78 78 <%text>##</%text> option to use threads of process
79 79 use_threadpool = true
80 80
81 81 %elif http_server == 'gevent':
82 82 <%text>##</%text> Gearbox serve uses the gevent web server ##
83 83 use = egg:gearbox#gevent
84 84
85 85 %elif http_server == 'waitress':
86 86 <%text>##</%text> Gearbox serve uses the Waitress web server ##
87 87 use = egg:waitress#main
88 88 <%text>##</%text> avoid multi threading
89 89 threads = 1
90 90 <%text>##</%text> allow push of repos bigger than the default of 1 GB
91 91 max_request_body_size = 107374182400
92 92 <%text>##</%text> use poll instead of select, fixes fd limits, may not work on old
93 93 <%text>##</%text> windows systems.
94 94 #asyncore_use_poll = True
95 95
96 96 %elif http_server == 'gunicorn':
97 97 <%text>##</%text> Gearbox serve uses the Gunicorn web server ##
98 98 use = egg:gunicorn#main
99 99 <%text>##</%text> number of process workers. You must set `instance_id = *` when this option
100 100 <%text>##</%text> is set to more than one worker
101 101 workers = 4
102 102 <%text>##</%text> process name
103 103 proc_name = kallithea
104 104 <%text>##</%text> type of worker class, one of sync, eventlet, gevent, tornado
105 105 <%text>##</%text> recommended for bigger setup is using of of other than sync one
106 106 worker_class = sync
107 107 max_requests = 1000
108 108 <%text>##</%text> amount of time a worker can handle request before it gets killed and
109 109 <%text>##</%text> restarted
110 110 timeout = 3600
111 111
112 112 %endif
113 113 %else:
114 114 <%text>##</%text> UWSGI ##
115 115 [uwsgi]
116 116 <%text>##</%text> Note: this section is parsed by the uWSGI .ini parser when run as:
117 117 <%text>##</%text> uwsgi --venv /srv/kallithea/venv --ini-paste-logged my.ini
118 118 <%text>##</%text> Note: in uWSGI 2.0.18 or older, pastescript needs to be installed to
119 119 <%text>##</%text> get correct application logging. In later versions this is not necessary.
120 120 <%text>##</%text> pip install pastescript
121 121
122 122 <%text>##</%text> HTTP Basics:
123 123 http-socket = ${host}:${port}
124 124 buffer-size = 65535 ; Mercurial will use huge GET headers for discovery
125 125
126 126 <%text>##</%text> Scaling:
127 127 master = true ; Use separate master and worker processes
128 128 auto-procname = true ; Name worker processes accordingly
129 129 lazy = true ; App *must* be loaded in workers - db connections can't be shared
130 130 workers = 4 ; On demand scaling up to this many worker processes
131 131 cheaper = 1 ; Initial and on demand scaling down to this many worker processes
132 132 max-requests = 1000 ; Graceful reload of worker processes to avoid leaks
133 133
134 134 <%text>##</%text> Tweak defaults:
135 135 strict = true ; Fail on unknown config directives
136 136 enable-threads = true ; Enable Python threads (not threaded workers)
137 137 vacuum = true ; Delete sockets during shutdown
138 138 single-interpreter = true
139 139 die-on-term = true ; Shutdown when receiving SIGTERM (default is respawn)
140 140 need-app = true ; Exit early if no app can be loaded.
141 141 reload-on-exception = true ; Don't assume that the application worker can process more requests after a severe error
142 142
143 143 %endif
144 144 <%text>##</%text> middleware for hosting the WSGI application under a URL prefix
145 145 #[filter:proxy-prefix]
146 146 #use = egg:PasteDeploy#prefix
147 147 #prefix = /<your-prefix>
148 148
149 149 [app:main]
150 150 use = egg:kallithea
151 151 <%text>##</%text> enable proxy prefix middleware
152 152 #filter-with = proxy-prefix
153 153
154 154 full_stack = true
155 155 static_files = true
156 156
157 157 <%text>##</%text> Internationalization (see setup documentation for details)
158 158 <%text>##</%text> By default, the languages requested by the browser are used if available, with English as default.
159 159 <%text>##</%text> Set i18n.enabled=false to disable automatic language choice.
160 160 #i18n.enabled = true
161 161 <%text>##</%text> To Force a language, set i18n.enabled=false and specify the language in i18n.lang.
162 162 <%text>##</%text> Valid values are the names of subdirectories in kallithea/i18n with a LC_MESSAGES/kallithea.mo
163 163 #i18n.lang = en
164 164
165 165 cache_dir = %(here)s/data
166 166 index_dir = %(here)s/data/index
167 167
168 168 <%text>##</%text> uncomment and set this path to use archive download cache
169 169 archive_cache_dir = %(here)s/data/tarballcache
170 170
171 171 <%text>##</%text> change this to unique ID for security
172 172 app_instance_uuid = ${uuid()}
173 173
174 174 <%text>##</%text> cut off limit for large diffs (size in bytes)
175 175 cut_off_limit = 256000
176 176
177 <%text>##</%text> force https in Kallithea, fixes https redirects, assumes it's always https
178 force_https = false
177 <%text>##</%text> always pretend the client connected using HTTPS (default false)
178 #force_https = true
179 179
180 <%text>##</%text> use Strict-Transport-Security headers
181 use_htsts = false
180 <%text>##</%text> use Strict-Transport-Security headers (default false)
181 #use_htsts = true
182 182
183 183 <%text>##</%text> number of commits stats will parse on each iteration
184 184 commit_parse_limit = 25
185 185
186 186 <%text>##</%text> Path to Python executable to be used for git hooks.
187 187 <%text>##</%text> This value will be written inside the git hook scripts as the text
188 188 <%text>##</%text> after '#!' (shebang). When empty or not defined, the value of
189 189 <%text>##</%text> 'sys.executable' at the time of installation of the git hooks is
190 190 <%text>##</%text> used, which is correct in many cases but for example not when using uwsgi.
191 191 <%text>##</%text> If you change this setting, you should reinstall the Git hooks via
192 192 <%text>##</%text> Admin > Settings > Remap and Rescan.
193 193 #git_hook_interpreter = /srv/kallithea/venv/bin/python3
194 194 %if git_hook_interpreter:
195 195 git_hook_interpreter = ${git_hook_interpreter}
196 196 %endif
197 197
198 198 <%text>##</%text> path to git executable
199 199 git_path = git
200 200
201 201 <%text>##</%text> git rev filter option, --all is the default filter, if you need to
202 202 <%text>##</%text> hide all refs in changelog switch this to --branches --tags
203 203 #git_rev_filter = --branches --tags
204 204
205 205 <%text>##</%text> RSS feed options
206 206 rss_cut_off_limit = 256000
207 207 rss_items_per_page = 10
208 208 rss_include_diff = false
209 209
210 210 <%text>##</%text> options for showing and identifying changesets
211 211 show_sha_length = 12
212 212 show_revision_number = false
213 213
214 214 <%text>##</%text> Canonical URL to use when creating full URLs in UI and texts.
215 215 <%text>##</%text> Useful when the site is available under different names or protocols.
216 216 <%text>##</%text> Defaults to what is provided in the WSGI environment.
217 217 #canonical_url = https://kallithea.example.com/repos
218 218
219 219 <%text>##</%text> gist URL alias, used to create nicer urls for gist. This should be an
220 220 <%text>##</%text> url that does rewrites to _admin/gists/<gistid>.
221 221 <%text>##</%text> example: http://gist.example.com/{gistid}. Empty means use the internal
222 222 <%text>##</%text> Kallithea url, ie. http[s]://kallithea.example.com/_admin/gists/<gistid>
223 223 gist_alias_url =
224 224
225 225 <%text>##</%text> default encoding used to convert from and to unicode
226 226 <%text>##</%text> can be also a comma separated list of encoding in case of mixed encodings
227 227 default_encoding = utf-8
228 228
229 229 <%text>##</%text> Set Mercurial encoding, similar to setting HGENCODING before launching Kallithea
230 230 hgencoding = utf-8
231 231
232 232 <%text>##</%text> issue tracker for Kallithea (leave blank to disable, absent for default)
233 233 #bugtracker = https://bitbucket.org/conservancy/kallithea/issues
234 234
235 235 <%text>##</%text> issue tracking mapping for commit messages, comments, PR descriptions, ...
236 236 <%text>##</%text> Refer to the documentation ("Integration with issue trackers") for more details.
237 237
238 238 <%text>##</%text> regular expression to match issue references
239 239 <%text>##</%text> This pattern may/should contain parenthesized groups, that can
240 240 <%text>##</%text> be referred to in issue_server_link or issue_sub using Python backreferences
241 241 <%text>##</%text> (e.g. \1, \2, ...). You can also create named groups with '(?P<groupname>)'.
242 242 <%text>##</%text> To require mandatory whitespace before the issue pattern, use:
243 243 <%text>##</%text> (?:^|(?<=\s)) before the actual pattern, and for mandatory whitespace
244 244 <%text>##</%text> behind the issue pattern, use (?:$|(?=\s)) after the actual pattern.
245 245
246 246 issue_pat = #(\d+)
247 247
248 248 <%text>##</%text> server url to the issue
249 249 <%text>##</%text> This pattern may/should contain backreferences to parenthesized groups in issue_pat.
250 250 <%text>##</%text> A backreference can be \1, \2, ... or \g<groupname> if you specified a named group
251 251 <%text>##</%text> called 'groupname' in issue_pat.
252 252 <%text>##</%text> The special token {repo} is replaced with the full repository name
253 253 <%text>##</%text> including repository groups, while {repo_name} is replaced with just
254 254 <%text>##</%text> the name of the repository.
255 255
256 256 issue_server_link = https://issues.example.com/{repo}/issue/\1
257 257
258 258 <%text>##</%text> substitution pattern to use as the link text
259 259 <%text>##</%text> If issue_sub is empty, the text matched by issue_pat is retained verbatim
260 260 <%text>##</%text> for the link text. Otherwise, the link text is that of issue_sub, with any
261 261 <%text>##</%text> backreferences to groups in issue_pat replaced.
262 262
263 263 issue_sub =
264 264
265 265 <%text>##</%text> issue_pat, issue_server_link and issue_sub can have suffixes to specify
266 266 <%text>##</%text> multiple patterns, to other issues server, wiki or others
267 267 <%text>##</%text> below an example how to create a wiki pattern
268 268 <%text>##</%text> wiki-some-id -> https://wiki.example.com/some-id
269 269
270 270 #issue_pat_wiki = wiki-(\S+)
271 271 #issue_server_link_wiki = https://wiki.example.com/\1
272 272 #issue_sub_wiki = WIKI-\1
273 273
274 274 <%text>##</%text> alternative return HTTP header for failed authentication. Default HTTP
275 275 <%text>##</%text> response is 401 HTTPUnauthorized. Currently Mercurial clients have trouble with
276 276 <%text>##</%text> handling that. Set this variable to 403 to return HTTPForbidden
277 277 auth_ret_code =
278 278
279 279 <%text>##</%text> allows to change the repository location in settings page
280 280 allow_repo_location_change = True
281 281
282 282 <%text>##</%text> allows to setup custom hooks in settings page
283 283 allow_custom_hooks_settings = True
284 284
285 285 <%text>##</%text> extra extensions for indexing, space separated and without the leading '.'.
286 286 #index.extensions =
287 287 # gemfile
288 288 # lock
289 289
290 290 <%text>##</%text> extra filenames for indexing, space separated
291 291 #index.filenames =
292 292 # .dockerignore
293 293 # .editorconfig
294 294 # INSTALL
295 295 # CHANGELOG
296 296
297 297 <%text>##</%text>##################################
298 298 <%text>##</%text> SSH CONFIG ##
299 299 <%text>##</%text>##################################
300 300
301 301 <%text>##</%text> SSH is disabled by default, until an Administrator decides to enable it.
302 302 ssh_enabled = false
303 303
304 304 <%text>##</%text> File where users' SSH keys will be stored *if* ssh_enabled is true.
305 305 #ssh_authorized_keys = /home/kallithea/.ssh/authorized_keys
306 306 %if user_home_path:
307 307 ssh_authorized_keys = ${user_home_path}/.ssh/authorized_keys
308 308 %endif
309 309
310 310 <%text>##</%text> Path to be used in ssh_authorized_keys file to invoke kallithea-cli with ssh-serve.
311 311 #kallithea_cli_path = /srv/kallithea/venv/bin/kallithea-cli
312 312 %if kallithea_cli_path:
313 313 kallithea_cli_path = ${kallithea_cli_path}
314 314 %endif
315 315
316 316 <%text>##</%text> Locale to be used in the ssh-serve command.
317 317 <%text>##</%text> This is needed because an SSH client may try to use its own locale
318 318 <%text>##</%text> settings, which may not be available on the server.
319 319 <%text>##</%text> See `locale -a` for valid values on this system.
320 320 #ssh_locale = C.UTF-8
321 321 %if ssh_locale:
322 322 ssh_locale = ${ssh_locale}
323 323 %endif
324 324
325 325 <%text>##</%text>##################################
326 326 <%text>##</%text> CELERY CONFIG ##
327 327 <%text>##</%text>##################################
328 328
329 329 <%text>##</%text> Note: Celery doesn't support Windows.
330 330 use_celery = false
331 331
332 332 <%text>##</%text> Celery config settings from https://docs.celeryproject.org/en/4.4.0/userguide/configuration.html prefixed with 'celery.'.
333 333
334 334 <%text>##</%text> Example: use the message queue on the local virtual host 'kallitheavhost' as the RabbitMQ user 'kallithea':
335 335 celery.broker_url = amqp://kallithea:thepassword@localhost:5672/kallitheavhost
336 336
337 337 celery.worker_concurrency = 2
338 338 celery.worker_max_tasks_per_child = 100
339 339
340 340 <%text>##</%text>##################################
341 341 <%text>##</%text> BEAKER CACHE ##
342 342 <%text>##</%text>##################################
343 343
344 344 beaker.cache.data_dir = %(here)s/data/cache/data
345 345 beaker.cache.lock_dir = %(here)s/data/cache/lock
346 346
347 347 beaker.cache.regions = long_term,long_term_file
348 348
349 349 beaker.cache.long_term.type = memory
350 350 beaker.cache.long_term.expire = 36000
351 351 beaker.cache.long_term.key_length = 256
352 352
353 353 beaker.cache.long_term_file.type = file
354 354 beaker.cache.long_term_file.expire = 604800
355 355 beaker.cache.long_term_file.key_length = 256
356 356
357 357 <%text>##</%text>##################################
358 358 <%text>##</%text> BEAKER SESSION ##
359 359 <%text>##</%text>##################################
360 360
361 361 <%text>##</%text> Name of session cookie. Should be unique for a given host and path, even when running
362 362 <%text>##</%text> on different ports. Otherwise, cookie sessions will be shared and messed up.
363 363 session.key = kallithea
364 364 <%text>##</%text> Sessions should always only be accessible by the browser, not directly by JavaScript.
365 365 session.httponly = true
366 366 <%text>##</%text> Session lifetime. 2592000 seconds is 30 days.
367 367 session.timeout = 2592000
368 368
369 369 <%text>##</%text> Server secret used with HMAC to ensure integrity of cookies.
370 370 session.secret = ${uuid()}
371 371 <%text>##</%text> Further, encrypt the data with AES.
372 372 #session.encrypt_key = <key_for_encryption>
373 373 #session.validate_key = <validation_key>
374 374
375 375 <%text>##</%text> Type of storage used for the session, current types are
376 376 <%text>##</%text> dbm, file, memcached, database, and memory.
377 377
378 378 <%text>##</%text> File system storage of session data. (default)
379 379 #session.type = file
380 380
381 381 <%text>##</%text> Cookie only, store all session data inside the cookie. Requires secure secrets.
382 382 #session.type = cookie
383 383
384 384 <%text>##</%text> Database storage of session data.
385 385 #session.type = ext:database
386 386 #session.sa.url = postgresql://postgres:qwe@localhost/kallithea
387 387 #session.table_name = db_session
388 388
389 389 <%text>##</%text>##################################
390 390 <%text>##</%text> ERROR HANDLING ##
391 391 <%text>##</%text>##################################
392 392
393 393 <%text>##</%text> Show a nice error page for application HTTP errors and exceptions (default true)
394 394 #errorpage.enabled = true
395 395
396 396 <%text>##</%text> Enable Backlash client-side interactive debugger (default false)
397 397 <%text>##</%text> WARNING: *THIS MUST BE false IN PRODUCTION ENVIRONMENTS!!!*
398 398 <%text>##</%text> This debug mode will allow all visitors to execute malicious code.
399 399 #debug = false
400 400
401 401 <%text>##</%text> Enable Backlash server-side error reporting (unless debug mode handles it client-side) (default true)
402 402 #trace_errors.enable = true
403 403 <%text>##</%text> Errors will be reported by mail if trace_errors.error_email is set.
404 404
405 405 <%text>##</%text> Propagate email settings to ErrorReporter of TurboGears2
406 406 <%text>##</%text> You do not normally need to change these lines
407 407 get trace_errors.smtp_server = smtp_server
408 408 get trace_errors.smtp_port = smtp_port
409 409 get trace_errors.from_address = error_email_from
410 410 get trace_errors.error_email = email_to
411 411 get trace_errors.smtp_username = smtp_username
412 412 get trace_errors.smtp_password = smtp_password
413 413 get trace_errors.smtp_use_tls = smtp_use_tls
414 414
415 415 <%text>##</%text>################################
416 416 <%text>##</%text> LOGVIEW CONFIG ##
417 417 <%text>##</%text>################################
418 418
419 419 logview.sqlalchemy = #faa
420 420 logview.pylons.templating = #bfb
421 421 logview.pylons.util = #eee
422 422
423 423 <%text>##</%text>#######################
424 424 <%text>##</%text> DB CONFIG ##
425 425 <%text>##</%text>#######################
426 426
427 427 %if database_engine == 'sqlite':
428 428 sqlalchemy.url = sqlite:///%(here)s/kallithea.db?timeout=60
429 429 %else:
430 430 #sqlalchemy.url = sqlite:///%(here)s/kallithea.db?timeout=60
431 431 %endif
432 432 %if database_engine == 'postgres':
433 433 sqlalchemy.url = postgresql://kallithea:password@localhost/kallithea
434 434 %else:
435 435 #sqlalchemy.url = postgresql://kallithea:password@localhost/kallithea
436 436 %endif
437 437 %if database_engine == 'mysql':
438 438 sqlalchemy.url = mysql://kallithea:password@localhost/kallithea?charset=utf8mb4
439 439 %else:
440 440 #sqlalchemy.url = mysql://kallithea:password@localhost/kallithea?charset=utf8mb4
441 441 %endif
442 442 <%text>##</%text> Note: the mysql:// prefix should also be used for MariaDB
443 443
444 444 sqlalchemy.pool_recycle = 3600
445 445
446 446 <%text>##</%text>##############################
447 447 <%text>##</%text> ALEMBIC CONFIGURATION ##
448 448 <%text>##</%text>##############################
449 449
450 450 [alembic]
451 451 script_location = kallithea:alembic
452 452
453 453 <%text>##</%text>##############################
454 454 <%text>##</%text> LOGGING CONFIGURATION ##
455 455 <%text>##</%text>##############################
456 456
457 457 [loggers]
458 458 keys = root, routes, kallithea, sqlalchemy, tg, gearbox, beaker, templates, whoosh_indexer, werkzeug, backlash
459 459
460 460 [handlers]
461 461 keys = console, console_color, console_color_sql, null
462 462
463 463 [formatters]
464 464 keys = generic, color_formatter, color_formatter_sql
465 465
466 466 <%text>##</%text>###########
467 467 <%text>##</%text> LOGGERS ##
468 468 <%text>##</%text>###########
469 469
470 470 [logger_root]
471 471 level = NOTSET
472 472 handlers = console
473 473 <%text>##</%text> For coloring based on log level:
474 474 #handlers = console_color
475 475
476 476 [logger_routes]
477 477 level = WARN
478 478 handlers =
479 479 qualname = routes.middleware
480 480 <%text>##</%text> "level = DEBUG" logs the route matched and routing variables.
481 481
482 482 [logger_beaker]
483 483 level = WARN
484 484 handlers =
485 485 qualname = beaker.container
486 486
487 487 [logger_templates]
488 488 level = WARN
489 489 handlers =
490 490 qualname = pylons.templating
491 491
492 492 [logger_kallithea]
493 493 level = WARN
494 494 handlers =
495 495 qualname = kallithea
496 496
497 497 [logger_tg]
498 498 level = WARN
499 499 handlers =
500 500 qualname = tg
501 501
502 502 [logger_gearbox]
503 503 level = WARN
504 504 handlers =
505 505 qualname = gearbox
506 506
507 507 [logger_sqlalchemy]
508 508 level = WARN
509 509 handlers =
510 510 qualname = sqlalchemy.engine
511 511 <%text>##</%text> For coloring based on log level and pretty printing of SQL:
512 512 #level = INFO
513 513 #handlers = console_color_sql
514 514 #propagate = 0
515 515
516 516 [logger_whoosh_indexer]
517 517 level = WARN
518 518 handlers =
519 519 qualname = whoosh_indexer
520 520
521 521 [logger_werkzeug]
522 522 level = WARN
523 523 handlers =
524 524 qualname = werkzeug
525 525
526 526 [logger_backlash]
527 527 level = WARN
528 528 handlers =
529 529 qualname = backlash
530 530
531 531 <%text>##</%text>############
532 532 <%text>##</%text> HANDLERS ##
533 533 <%text>##</%text>############
534 534
535 535 [handler_console]
536 536 class = StreamHandler
537 537 args = (sys.stderr,)
538 538 formatter = generic
539 539
540 540 [handler_console_color]
541 541 <%text>##</%text> ANSI color coding based on log level
542 542 class = StreamHandler
543 543 args = (sys.stderr,)
544 544 formatter = color_formatter
545 545
546 546 [handler_console_color_sql]
547 547 <%text>##</%text> ANSI color coding and pretty printing of SQL statements
548 548 class = StreamHandler
549 549 args = (sys.stderr,)
550 550 formatter = color_formatter_sql
551 551
552 552 [handler_null]
553 553 class = NullHandler
554 554 args = ()
555 555
556 556 <%text>##</%text>##############
557 557 <%text>##</%text> FORMATTERS ##
558 558 <%text>##</%text>##############
559 559
560 560 [formatter_generic]
561 561 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
562 562 datefmt = %Y-%m-%d %H:%M:%S
563 563
564 564 [formatter_color_formatter]
565 565 class = kallithea.lib.colored_formatter.ColorFormatter
566 566 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
567 567 datefmt = %Y-%m-%d %H:%M:%S
568 568
569 569 [formatter_color_formatter_sql]
570 570 class = kallithea.lib.colored_formatter.ColorFormatterSql
571 571 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
572 572 datefmt = %Y-%m-%d %H:%M:%S
573 573
574 574 <%text>##</%text>###############
575 575 <%text>##</%text> SSH LOGGING ##
576 576 <%text>##</%text>###############
577 577
578 578 <%text>##</%text> The default loggers use 'handler_console' that uses StreamHandler with
579 579 <%text>##</%text> destination 'sys.stderr'. In the context of the SSH server process, these log
580 580 <%text>##</%text> messages would be sent to the client, which is normally not what you want.
581 581 <%text>##</%text> By default, when running ssh-serve, just use NullHandler and disable logging
582 582 <%text>##</%text> completely. For other logging options, see:
583 583 <%text>##</%text> https://docs.python.org/2/library/logging.handlers.html
584 584
585 585 [ssh_serve:logger_root]
586 586 level = CRITICAL
587 587 handlers = null
588 588
589 589 <%text>##</%text> Note: If logging is configured with other handlers, they might need similar
590 590 <%text>##</%text> muting for ssh-serve too.
General Comments 0
You need to be logged in to leave comments. Login now