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