Show More
@@ -1,444 +1,446 b'' | |||||
1 | ################################################################################ |
|
1 | ################################################################################ | |
2 | ################################################################################ |
|
2 | ################################################################################ | |
3 | # Kallithea - Development config: # |
|
3 | # Kallithea - Development config: # | |
4 | # listening on *:5000 # |
|
4 | # listening on *:5000 # | |
5 | # sqlite and kallithea.db # |
|
5 | # sqlite and kallithea.db # | |
6 | # initial_repo_scan = true # |
|
6 | # initial_repo_scan = true # | |
7 | # debug = true # |
|
7 | # debug = true # | |
8 | # verbose and colorful logging # |
|
8 | # verbose and colorful logging # | |
9 | # # |
|
9 | # # | |
10 | # The %(here)s variable will be replaced with the parent directory of this file# |
|
10 | # The %(here)s variable will be replaced with the parent directory of this file# | |
11 | ################################################################################ |
|
11 | ################################################################################ | |
12 | ################################################################################ |
|
12 | ################################################################################ | |
13 |
|
13 | |||
14 | [DEFAULT] |
|
14 | [DEFAULT] | |
15 |
|
15 | |||
16 | ################################################################################ |
|
16 | ################################################################################ | |
17 | ## Email settings ## |
|
17 | ## Email settings ## | |
18 | ## ## |
|
18 | ## ## | |
19 | ## Refer to the documentation ("Email settings") for more details. ## |
|
19 | ## Refer to the documentation ("Email settings") for more details. ## | |
20 | ## ## |
|
20 | ## ## | |
21 | ## It is recommended to use a valid sender address that passes access ## |
|
21 | ## It is recommended to use a valid sender address that passes access ## | |
22 | ## validation and spam filtering in mail servers. ## |
|
22 | ## validation and spam filtering in mail servers. ## | |
23 | ################################################################################ |
|
23 | ################################################################################ | |
24 |
|
24 | |||
25 | ## 'From' header for application emails. You can optionally add a name. |
|
25 | ## 'From' header for application emails. You can optionally add a name. | |
26 | ## Default: |
|
26 | ## Default: | |
27 | #app_email_from = Kallithea |
|
27 | #app_email_from = Kallithea | |
28 | ## Examples: |
|
28 | ## Examples: | |
29 | #app_email_from = Kallithea <kallithea-noreply@example.com> |
|
29 | #app_email_from = Kallithea <kallithea-noreply@example.com> | |
30 | #app_email_from = kallithea-noreply@example.com |
|
30 | #app_email_from = kallithea-noreply@example.com | |
31 |
|
31 | |||
32 | ## Subject prefix for application emails. |
|
32 | ## Subject prefix for application emails. | |
33 | ## A space between this prefix and the real subject is automatically added. |
|
33 | ## A space between this prefix and the real subject is automatically added. | |
34 | ## Default: |
|
34 | ## Default: | |
35 | #email_prefix = |
|
35 | #email_prefix = | |
36 | ## Example: |
|
36 | ## Example: | |
37 | #email_prefix = [Kallithea] |
|
37 | #email_prefix = [Kallithea] | |
38 |
|
38 | |||
39 | ## Recipients for error emails and fallback recipients of application mails. |
|
39 | ## Recipients for error emails and fallback recipients of application mails. | |
40 | ## Multiple addresses can be specified, space-separated. |
|
40 | ## Multiple addresses can be specified, space-separated. | |
41 | ## Only addresses are allowed, do not add any name part. |
|
41 | ## Only addresses are allowed, do not add any name part. | |
42 | ## Default: |
|
42 | ## Default: | |
43 | #email_to = |
|
43 | #email_to = | |
44 | ## Examples: |
|
44 | ## Examples: | |
45 | #email_to = admin@example.com |
|
45 | #email_to = admin@example.com | |
46 | #email_to = admin@example.com another_admin@example.com |
|
46 | #email_to = admin@example.com another_admin@example.com | |
47 | email_to = |
|
47 | email_to = | |
48 |
|
48 | |||
49 | ## 'From' header for error emails. You can optionally add a name. |
|
49 | ## 'From' header for error emails. You can optionally add a name. | |
50 | ## Default: (none) |
|
50 | ## Default: (none) | |
51 | ## Examples: |
|
51 | ## Examples: | |
52 | #error_email_from = Kallithea Errors <kallithea-noreply@example.com> |
|
52 | #error_email_from = Kallithea Errors <kallithea-noreply@example.com> | |
53 | #error_email_from = kallithea_errors@example.com |
|
53 | #error_email_from = kallithea_errors@example.com | |
54 | error_email_from = |
|
54 | error_email_from = | |
55 |
|
55 | |||
56 | ## SMTP server settings |
|
56 | ## SMTP server settings | |
57 | ## If specifying credentials, make sure to use secure connections. |
|
57 | ## If specifying credentials, make sure to use secure connections. | |
58 | ## Default: Send unencrypted unauthenticated mails to the specified smtp_server. |
|
58 | ## Default: Send unencrypted unauthenticated mails to the specified smtp_server. | |
59 | ## For "SSL", use smtp_use_ssl = true and smtp_port = 465. |
|
59 | ## For "SSL", use smtp_use_ssl = true and smtp_port = 465. | |
60 | ## For "STARTTLS", use smtp_use_tls = true and smtp_port = 587. |
|
60 | ## For "STARTTLS", use smtp_use_tls = true and smtp_port = 587. | |
61 | smtp_server = |
|
61 | smtp_server = | |
62 | #smtp_username = |
|
62 | #smtp_username = | |
63 | #smtp_password = |
|
63 | #smtp_password = | |
64 | smtp_port = |
|
64 | smtp_port = | |
65 | #smtp_use_ssl = false |
|
65 | #smtp_use_ssl = false | |
66 | #smtp_use_tls = false |
|
66 | #smtp_use_tls = false | |
67 |
|
67 | |||
68 | [server:main] |
|
68 | [server:main] | |
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 | ## COMMON ## |
|
79 | ## COMMON ## | |
80 | #host = 127.0.0.1 |
|
80 | #host = 127.0.0.1 | |
81 | host = 0.0.0.0 |
|
81 | host = 0.0.0.0 | |
82 | port = 5000 |
|
82 | port = 5000 | |
83 |
|
83 | |||
84 | ## middleware for hosting the WSGI application under a URL prefix |
|
84 | ## middleware for hosting the WSGI application under a URL prefix | |
85 | #[filter:proxy-prefix] |
|
85 | #[filter:proxy-prefix] | |
86 | #use = egg:PasteDeploy#prefix |
|
86 | #use = egg:PasteDeploy#prefix | |
87 | #prefix = /<your-prefix> |
|
87 | #prefix = /<your-prefix> | |
88 |
|
88 | |||
89 | [app:main] |
|
89 | [app:main] | |
90 | use = egg:kallithea |
|
90 | use = egg:kallithea | |
91 | ## enable proxy prefix middleware |
|
91 | ## enable proxy prefix middleware | |
92 | #filter-with = proxy-prefix |
|
92 | #filter-with = proxy-prefix | |
93 |
|
93 | |||
94 | full_stack = true |
|
94 | full_stack = true | |
95 | static_files = true |
|
95 | static_files = true | |
96 |
|
96 | |||
97 | ## Internationalization (see setup documentation for details) |
|
97 | ## Internationalization (see setup documentation for details) | |
98 | ## By default, the language requested by the browser is used if available. |
|
98 | ## By default, the language requested by the browser is used if available. | |
99 | #i18n.enable = false |
|
99 | #i18n.enable = false | |
100 | ## Fallback language, empty for English (valid values are the names of subdirectories in kallithea/i18n): |
|
100 | ## Fallback language, empty for English (valid values are the names of subdirectories in kallithea/i18n): | |
101 | i18n.lang = |
|
101 | i18n.lang = | |
102 |
|
102 | |||
103 | cache_dir = %(here)s/data |
|
103 | cache_dir = %(here)s/data | |
104 | index_dir = %(here)s/data/index |
|
104 | index_dir = %(here)s/data/index | |
105 |
|
105 | |||
106 | ## perform a full repository scan on each server start, this should be |
|
106 | ## perform a full repository scan on each server start, this should be | |
107 | ## set to false after first startup, to allow faster server restarts. |
|
107 | ## set to false after first startup, to allow faster server restarts. | |
108 | #initial_repo_scan = false |
|
108 | #initial_repo_scan = false | |
109 | initial_repo_scan = true |
|
109 | initial_repo_scan = true | |
110 |
|
110 | |||
111 | ## uncomment and set this path to use archive download cache |
|
111 | ## uncomment and set this path to use archive download cache | |
112 | archive_cache_dir = %(here)s/tarballcache |
|
112 | archive_cache_dir = %(here)s/tarballcache | |
113 |
|
113 | |||
114 | ## change this to unique ID for security |
|
114 | ## change this to unique ID for security | |
|
115 | #app_instance_uuid = VERY-SECRET | |||
115 | app_instance_uuid = development-not-secret |
|
116 | app_instance_uuid = development-not-secret | |
116 |
|
117 | |||
117 | ## cut off limit for large diffs (size in bytes) |
|
118 | ## cut off limit for large diffs (size in bytes) | |
118 | cut_off_limit = 256000 |
|
119 | cut_off_limit = 256000 | |
119 |
|
120 | |||
120 | ## force https in Kallithea, fixes https redirects, assumes it's always https |
|
121 | ## force https in Kallithea, fixes https redirects, assumes it's always https | |
121 | force_https = false |
|
122 | force_https = false | |
122 |
|
123 | |||
123 | ## use Strict-Transport-Security headers |
|
124 | ## use Strict-Transport-Security headers | |
124 | use_htsts = false |
|
125 | use_htsts = false | |
125 |
|
126 | |||
126 | ## number of commits stats will parse on each iteration |
|
127 | ## number of commits stats will parse on each iteration | |
127 | commit_parse_limit = 25 |
|
128 | commit_parse_limit = 25 | |
128 |
|
129 | |||
129 | ## path to git executable |
|
130 | ## path to git executable | |
130 | git_path = git |
|
131 | git_path = git | |
131 |
|
132 | |||
132 | ## git rev filter option, --all is the default filter, if you need to |
|
133 | ## git rev filter option, --all is the default filter, if you need to | |
133 | ## hide all refs in changelog switch this to --branches --tags |
|
134 | ## hide all refs in changelog switch this to --branches --tags | |
134 | #git_rev_filter = --branches --tags |
|
135 | #git_rev_filter = --branches --tags | |
135 |
|
136 | |||
136 | ## RSS feed options |
|
137 | ## RSS feed options | |
137 | rss_cut_off_limit = 256000 |
|
138 | rss_cut_off_limit = 256000 | |
138 | rss_items_per_page = 10 |
|
139 | rss_items_per_page = 10 | |
139 | rss_include_diff = false |
|
140 | rss_include_diff = false | |
140 |
|
141 | |||
141 | ## options for showing and identifying changesets |
|
142 | ## options for showing and identifying changesets | |
142 | show_sha_length = 12 |
|
143 | show_sha_length = 12 | |
143 | show_revision_number = false |
|
144 | show_revision_number = false | |
144 |
|
145 | |||
145 | ## Canonical URL to use when creating full URLs in UI and texts. |
|
146 | ## Canonical URL to use when creating full URLs in UI and texts. | |
146 | ## Useful when the site is available under different names or protocols. |
|
147 | ## Useful when the site is available under different names or protocols. | |
147 | ## Defaults to what is provided in the WSGI environment. |
|
148 | ## Defaults to what is provided in the WSGI environment. | |
148 | #canonical_url = https://kallithea.example.com/repos |
|
149 | #canonical_url = https://kallithea.example.com/repos | |
149 |
|
150 | |||
150 | ## gist URL alias, used to create nicer urls for gist. This should be an |
|
151 | ## gist URL alias, used to create nicer urls for gist. This should be an | |
151 | ## url that does rewrites to _admin/gists/<gistid>. |
|
152 | ## url that does rewrites to _admin/gists/<gistid>. | |
152 | ## example: http://gist.example.com/{gistid}. Empty means use the internal |
|
153 | ## example: http://gist.example.com/{gistid}. Empty means use the internal | |
153 | ## Kallithea url, ie. http[s]://kallithea.example.com/_admin/gists/<gistid> |
|
154 | ## Kallithea url, ie. http[s]://kallithea.example.com/_admin/gists/<gistid> | |
154 | gist_alias_url = |
|
155 | gist_alias_url = | |
155 |
|
156 | |||
156 | ## white list of API enabled controllers. This allows to add list of |
|
157 | ## white list of API enabled controllers. This allows to add list of | |
157 | ## controllers to which access will be enabled by api_key. eg: to enable |
|
158 | ## controllers to which access will be enabled by api_key. eg: to enable | |
158 | ## api access to raw_files put `FilesController:raw`, to enable access to patches |
|
159 | ## api access to raw_files put `FilesController:raw`, to enable access to patches | |
159 | ## add `ChangesetController:changeset_patch`. This list should be "," separated |
|
160 | ## add `ChangesetController:changeset_patch`. This list should be "," separated | |
160 | ## Syntax is <ControllerClass>:<function>. Check debug logs for generated names |
|
161 | ## Syntax is <ControllerClass>:<function>. Check debug logs for generated names | |
161 | ## Recommended settings below are commented out: |
|
162 | ## Recommended settings below are commented out: | |
162 | api_access_controllers_whitelist = |
|
163 | api_access_controllers_whitelist = | |
163 | # ChangesetController:changeset_patch, |
|
164 | # ChangesetController:changeset_patch, | |
164 | # ChangesetController:changeset_raw, |
|
165 | # ChangesetController:changeset_raw, | |
165 | # FilesController:raw, |
|
166 | # FilesController:raw, | |
166 | # FilesController:archivefile |
|
167 | # FilesController:archivefile | |
167 |
|
168 | |||
168 | ## default encoding used to convert from and to unicode |
|
169 | ## default encoding used to convert from and to unicode | |
169 | ## can be also a comma separated list of encoding in case of mixed encodings |
|
170 | ## can be also a comma separated list of encoding in case of mixed encodings | |
170 | default_encoding = utf8 |
|
171 | default_encoding = utf8 | |
171 |
|
172 | |||
172 | ## issue tracker for Kallithea (leave blank to disable, absent for default) |
|
173 | ## issue tracker for Kallithea (leave blank to disable, absent for default) | |
173 | #bugtracker = https://bitbucket.org/conservancy/kallithea/issues |
|
174 | #bugtracker = https://bitbucket.org/conservancy/kallithea/issues | |
174 |
|
175 | |||
175 | ## issue tracking mapping for commits messages |
|
176 | ## issue tracking mapping for commits messages | |
176 | ## comment out issue_pat, issue_server, issue_prefix to enable |
|
177 | ## comment out issue_pat, issue_server, issue_prefix to enable | |
177 |
|
178 | |||
178 | ## pattern to get the issues from commit messages |
|
179 | ## pattern to get the issues from commit messages | |
179 | ## default one used here is #<numbers> with a regex passive group for `#` |
|
180 | ## default one used here is #<numbers> with a regex passive group for `#` | |
180 | ## {id} will be all groups matched from this pattern |
|
181 | ## {id} will be all groups matched from this pattern | |
181 |
|
182 | |||
182 | issue_pat = (?:\s*#)(\d+) |
|
183 | issue_pat = (?:\s*#)(\d+) | |
183 |
|
184 | |||
184 | ## server url to the issue, each {id} will be replaced with match |
|
185 | ## server url to the issue, each {id} will be replaced with match | |
185 | ## fetched from the regex and {repo} is replaced with full repository name |
|
186 | ## fetched from the regex and {repo} is replaced with full repository name | |
186 | ## including groups {repo_name} is replaced with just name of repo |
|
187 | ## including groups {repo_name} is replaced with just name of repo | |
187 |
|
188 | |||
188 | issue_server_link = https://issues.example.com/{repo}/issue/{id} |
|
189 | issue_server_link = https://issues.example.com/{repo}/issue/{id} | |
189 |
|
190 | |||
190 | ## prefix to add to link to indicate it's an url |
|
191 | ## prefix to add to link to indicate it's an url | |
191 | ## #314 will be replaced by <issue_prefix><id> |
|
192 | ## #314 will be replaced by <issue_prefix><id> | |
192 |
|
193 | |||
193 | issue_prefix = # |
|
194 | issue_prefix = # | |
194 |
|
195 | |||
195 | ## issue_pat, issue_server_link, issue_prefix can have suffixes to specify |
|
196 | ## issue_pat, issue_server_link, issue_prefix can have suffixes to specify | |
196 | ## multiple patterns, to other issues server, wiki or others |
|
197 | ## multiple patterns, to other issues server, wiki or others | |
197 | ## below an example how to create a wiki pattern |
|
198 | ## below an example how to create a wiki pattern | |
198 | # wiki-some-id -> https://wiki.example.com/some-id |
|
199 | # wiki-some-id -> https://wiki.example.com/some-id | |
199 |
|
200 | |||
200 | #issue_pat_wiki = (?:wiki-)(.+) |
|
201 | #issue_pat_wiki = (?:wiki-)(.+) | |
201 | #issue_server_link_wiki = https://wiki.example.com/{id} |
|
202 | #issue_server_link_wiki = https://wiki.example.com/{id} | |
202 | #issue_prefix_wiki = WIKI- |
|
203 | #issue_prefix_wiki = WIKI- | |
203 |
|
204 | |||
204 | ## alternative return HTTP header for failed authentication. Default HTTP |
|
205 | ## alternative return HTTP header for failed authentication. Default HTTP | |
205 | ## response is 401 HTTPUnauthorized. Currently Mercurial clients have trouble with |
|
206 | ## response is 401 HTTPUnauthorized. Currently Mercurial clients have trouble with | |
206 | ## handling that. Set this variable to 403 to return HTTPForbidden |
|
207 | ## handling that. Set this variable to 403 to return HTTPForbidden | |
207 | auth_ret_code = |
|
208 | auth_ret_code = | |
208 |
|
209 | |||
209 | ## locking return code. When repository is locked return this HTTP code. 2XX |
|
210 | ## locking return code. When repository is locked return this HTTP code. 2XX | |
210 | ## codes don't break the transactions while 4XX codes do |
|
211 | ## codes don't break the transactions while 4XX codes do | |
211 | lock_ret_code = 423 |
|
212 | lock_ret_code = 423 | |
212 |
|
213 | |||
213 | ## allows to change the repository location in settings page |
|
214 | ## allows to change the repository location in settings page | |
214 | allow_repo_location_change = True |
|
215 | allow_repo_location_change = True | |
215 |
|
216 | |||
216 | ## allows to setup custom hooks in settings page |
|
217 | ## allows to setup custom hooks in settings page | |
217 | allow_custom_hooks_settings = True |
|
218 | allow_custom_hooks_settings = True | |
218 |
|
219 | |||
219 | ## extra extensions for indexing, space separated and without the leading '.'. |
|
220 | ## extra extensions for indexing, space separated and without the leading '.'. | |
220 | # index.extensions = |
|
221 | # index.extensions = | |
221 | # gemfile |
|
222 | # gemfile | |
222 | # lock |
|
223 | # lock | |
223 |
|
224 | |||
224 | ## extra filenames for indexing, space separated |
|
225 | ## extra filenames for indexing, space separated | |
225 | # index.filenames = |
|
226 | # index.filenames = | |
226 | # .dockerignore |
|
227 | # .dockerignore | |
227 | # .editorconfig |
|
228 | # .editorconfig | |
228 | # INSTALL |
|
229 | # INSTALL | |
229 | # CHANGELOG |
|
230 | # CHANGELOG | |
230 |
|
231 | |||
231 | #################################### |
|
232 | #################################### | |
232 | ### CELERY CONFIG #### |
|
233 | ### CELERY CONFIG #### | |
233 | #################################### |
|
234 | #################################### | |
234 |
|
235 | |||
235 | use_celery = false |
|
236 | use_celery = false | |
236 |
|
237 | |||
237 | ## Example: connect to the virtual host 'rabbitmqhost' on localhost as rabbitmq: |
|
238 | ## Example: connect to the virtual host 'rabbitmqhost' on localhost as rabbitmq: | |
238 | broker.url = amqp://rabbitmq:qewqew@localhost:5672/rabbitmqhost |
|
239 | broker.url = amqp://rabbitmq:qewqew@localhost:5672/rabbitmqhost | |
239 |
|
240 | |||
240 | celery.imports = kallithea.lib.celerylib.tasks |
|
241 | celery.imports = kallithea.lib.celerylib.tasks | |
241 | celery.accept.content = pickle |
|
242 | celery.accept.content = pickle | |
242 | celery.result.backend = amqp |
|
243 | celery.result.backend = amqp | |
243 | celery.result.dburi = amqp:// |
|
244 | celery.result.dburi = amqp:// | |
244 | celery.result.serialier = json |
|
245 | celery.result.serialier = json | |
245 |
|
246 | |||
246 | #celery.send.task.error.emails = true |
|
247 | #celery.send.task.error.emails = true | |
247 | #celery.amqp.task.result.expires = 18000 |
|
248 | #celery.amqp.task.result.expires = 18000 | |
248 |
|
249 | |||
249 | celeryd.concurrency = 2 |
|
250 | celeryd.concurrency = 2 | |
250 | celeryd.max.tasks.per.child = 1 |
|
251 | celeryd.max.tasks.per.child = 1 | |
251 |
|
252 | |||
252 | ## If true, tasks will never be sent to the queue, but executed locally instead. |
|
253 | ## If true, tasks will never be sent to the queue, but executed locally instead. | |
253 | celery.always.eager = false |
|
254 | celery.always.eager = false | |
254 |
|
255 | |||
255 | #################################### |
|
256 | #################################### | |
256 | ### BEAKER CACHE #### |
|
257 | ### BEAKER CACHE #### | |
257 | #################################### |
|
258 | #################################### | |
258 |
|
259 | |||
259 | beaker.cache.data_dir = %(here)s/data/cache/data |
|
260 | beaker.cache.data_dir = %(here)s/data/cache/data | |
260 | beaker.cache.lock_dir = %(here)s/data/cache/lock |
|
261 | beaker.cache.lock_dir = %(here)s/data/cache/lock | |
261 |
|
262 | |||
262 | beaker.cache.regions = short_term,long_term,sql_cache_short |
|
263 | beaker.cache.regions = short_term,long_term,sql_cache_short | |
263 |
|
264 | |||
264 | beaker.cache.short_term.type = memory |
|
265 | beaker.cache.short_term.type = memory | |
265 | beaker.cache.short_term.expire = 60 |
|
266 | beaker.cache.short_term.expire = 60 | |
266 | beaker.cache.short_term.key_length = 256 |
|
267 | beaker.cache.short_term.key_length = 256 | |
267 |
|
268 | |||
268 | beaker.cache.long_term.type = memory |
|
269 | beaker.cache.long_term.type = memory | |
269 | beaker.cache.long_term.expire = 36000 |
|
270 | beaker.cache.long_term.expire = 36000 | |
270 | beaker.cache.long_term.key_length = 256 |
|
271 | beaker.cache.long_term.key_length = 256 | |
271 |
|
272 | |||
272 | beaker.cache.sql_cache_short.type = memory |
|
273 | beaker.cache.sql_cache_short.type = memory | |
273 | beaker.cache.sql_cache_short.expire = 10 |
|
274 | beaker.cache.sql_cache_short.expire = 10 | |
274 | beaker.cache.sql_cache_short.key_length = 256 |
|
275 | beaker.cache.sql_cache_short.key_length = 256 | |
275 |
|
276 | |||
276 | #################################### |
|
277 | #################################### | |
277 | ### BEAKER SESSION #### |
|
278 | ### BEAKER SESSION #### | |
278 | #################################### |
|
279 | #################################### | |
279 |
|
280 | |||
280 | ## Name of session cookie. Should be unique for a given host and path, even when running |
|
281 | ## Name of session cookie. Should be unique for a given host and path, even when running | |
281 | ## on different ports. Otherwise, cookie sessions will be shared and messed up. |
|
282 | ## on different ports. Otherwise, cookie sessions will be shared and messed up. | |
282 | beaker.session.key = kallithea |
|
283 | beaker.session.key = kallithea | |
283 | ## Sessions should always only be accessible by the browser, not directly by JavaScript. |
|
284 | ## Sessions should always only be accessible by the browser, not directly by JavaScript. | |
284 | beaker.session.httponly = true |
|
285 | beaker.session.httponly = true | |
285 | ## Session lifetime. 2592000 seconds is 30 days. |
|
286 | ## Session lifetime. 2592000 seconds is 30 days. | |
286 | beaker.session.timeout = 2592000 |
|
287 | beaker.session.timeout = 2592000 | |
287 |
|
288 | |||
288 | ## Server secret used with HMAC to ensure integrity of cookies. |
|
289 | ## Server secret used with HMAC to ensure integrity of cookies. | |
|
290 | #beaker.session.secret = VERY-SECRET | |||
289 | beaker.session.secret = development-not-secret |
|
291 | beaker.session.secret = development-not-secret | |
290 | ## Further, encrypt the data with AES. |
|
292 | ## Further, encrypt the data with AES. | |
291 | #beaker.session.encrypt_key = <key_for_encryption> |
|
293 | #beaker.session.encrypt_key = <key_for_encryption> | |
292 | #beaker.session.validate_key = <validation_key> |
|
294 | #beaker.session.validate_key = <validation_key> | |
293 |
|
295 | |||
294 | ## Type of storage used for the session, current types are |
|
296 | ## Type of storage used for the session, current types are | |
295 | ## dbm, file, memcached, database, and memory. |
|
297 | ## dbm, file, memcached, database, and memory. | |
296 |
|
298 | |||
297 | ## File system storage of session data. (default) |
|
299 | ## File system storage of session data. (default) | |
298 | #beaker.session.type = file |
|
300 | #beaker.session.type = file | |
299 |
|
301 | |||
300 | ## Cookie only, store all session data inside the cookie. Requires secure secrets. |
|
302 | ## Cookie only, store all session data inside the cookie. Requires secure secrets. | |
301 | #beaker.session.type = cookie |
|
303 | #beaker.session.type = cookie | |
302 |
|
304 | |||
303 | ## Database storage of session data. |
|
305 | ## Database storage of session data. | |
304 | #beaker.session.type = ext:database |
|
306 | #beaker.session.type = ext:database | |
305 | #beaker.session.sa.url = postgresql://postgres:qwe@localhost/kallithea |
|
307 | #beaker.session.sa.url = postgresql://postgres:qwe@localhost/kallithea | |
306 | #beaker.session.table_name = db_session |
|
308 | #beaker.session.table_name = db_session | |
307 |
|
309 | |||
308 | ################################################################################ |
|
310 | ################################################################################ | |
309 | ## WARNING: *DEBUG MODE MUST BE OFF IN A PRODUCTION ENVIRONMENT* ## |
|
311 | ## WARNING: *DEBUG MODE MUST BE OFF IN A PRODUCTION ENVIRONMENT* ## | |
310 | ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ## |
|
312 | ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ## | |
311 | ## execute malicious code after an exception is raised. ## |
|
313 | ## execute malicious code after an exception is raised. ## | |
312 | ################################################################################ |
|
314 | ################################################################################ | |
313 | #debug = false |
|
315 | #debug = false | |
314 | debug = true |
|
316 | debug = true | |
315 |
|
317 | |||
316 | ################################## |
|
318 | ################################## | |
317 | ### LOGVIEW CONFIG ### |
|
319 | ### LOGVIEW CONFIG ### | |
318 | ################################## |
|
320 | ################################## | |
319 |
|
321 | |||
320 | logview.sqlalchemy = #faa |
|
322 | logview.sqlalchemy = #faa | |
321 | logview.pylons.templating = #bfb |
|
323 | logview.pylons.templating = #bfb | |
322 | logview.pylons.util = #eee |
|
324 | logview.pylons.util = #eee | |
323 |
|
325 | |||
324 | ######################################################### |
|
326 | ######################################################### | |
325 | ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ### |
|
327 | ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ### | |
326 | ######################################################### |
|
328 | ######################################################### | |
327 |
|
329 | |||
328 | # SQLITE [default] |
|
330 | # SQLITE [default] | |
329 | sqlalchemy.url = sqlite:///%(here)s/kallithea.db?timeout=60 |
|
331 | sqlalchemy.url = sqlite:///%(here)s/kallithea.db?timeout=60 | |
330 |
|
332 | |||
331 | # see sqlalchemy docs for others |
|
333 | # see sqlalchemy docs for others | |
332 |
|
334 | |||
333 | sqlalchemy.pool_recycle = 3600 |
|
335 | sqlalchemy.pool_recycle = 3600 | |
334 |
|
336 | |||
335 | ################################ |
|
337 | ################################ | |
336 | ### ALEMBIC CONFIGURATION #### |
|
338 | ### ALEMBIC CONFIGURATION #### | |
337 | ################################ |
|
339 | ################################ | |
338 |
|
340 | |||
339 | [alembic] |
|
341 | [alembic] | |
340 | script_location = kallithea:alembic |
|
342 | script_location = kallithea:alembic | |
341 |
|
343 | |||
342 | ################################ |
|
344 | ################################ | |
343 | ### LOGGING CONFIGURATION #### |
|
345 | ### LOGGING CONFIGURATION #### | |
344 | ################################ |
|
346 | ################################ | |
345 |
|
347 | |||
346 | [loggers] |
|
348 | [loggers] | |
347 | keys = root, routes, kallithea, sqlalchemy, tg, gearbox, beaker, templates, whoosh_indexer |
|
349 | keys = root, routes, kallithea, sqlalchemy, tg, gearbox, beaker, templates, whoosh_indexer | |
348 |
|
350 | |||
349 | [handlers] |
|
351 | [handlers] | |
350 | keys = console, console_sql |
|
352 | keys = console, console_sql | |
351 |
|
353 | |||
352 | [formatters] |
|
354 | [formatters] | |
353 | keys = generic, color_formatter, color_formatter_sql |
|
355 | keys = generic, color_formatter, color_formatter_sql | |
354 |
|
356 | |||
355 | ############# |
|
357 | ############# | |
356 | ## LOGGERS ## |
|
358 | ## LOGGERS ## | |
357 | ############# |
|
359 | ############# | |
358 |
|
360 | |||
359 | [logger_root] |
|
361 | [logger_root] | |
360 | level = NOTSET |
|
362 | level = NOTSET | |
361 | handlers = console |
|
363 | handlers = console | |
362 |
|
364 | |||
363 | [logger_routes] |
|
365 | [logger_routes] | |
364 | level = DEBUG |
|
366 | level = DEBUG | |
365 | handlers = |
|
367 | handlers = | |
366 | qualname = routes.middleware |
|
368 | qualname = routes.middleware | |
367 | ## "level = DEBUG" logs the route matched and routing variables. |
|
369 | ## "level = DEBUG" logs the route matched and routing variables. | |
368 | propagate = 1 |
|
370 | propagate = 1 | |
369 |
|
371 | |||
370 | [logger_beaker] |
|
372 | [logger_beaker] | |
371 | level = DEBUG |
|
373 | level = DEBUG | |
372 | handlers = |
|
374 | handlers = | |
373 | qualname = beaker.container |
|
375 | qualname = beaker.container | |
374 | propagate = 1 |
|
376 | propagate = 1 | |
375 |
|
377 | |||
376 | [logger_templates] |
|
378 | [logger_templates] | |
377 | level = INFO |
|
379 | level = INFO | |
378 | handlers = |
|
380 | handlers = | |
379 | qualname = pylons.templating |
|
381 | qualname = pylons.templating | |
380 | propagate = 1 |
|
382 | propagate = 1 | |
381 |
|
383 | |||
382 | [logger_kallithea] |
|
384 | [logger_kallithea] | |
383 | level = DEBUG |
|
385 | level = DEBUG | |
384 | handlers = |
|
386 | handlers = | |
385 | qualname = kallithea |
|
387 | qualname = kallithea | |
386 | propagate = 1 |
|
388 | propagate = 1 | |
387 |
|
389 | |||
388 | [logger_tg] |
|
390 | [logger_tg] | |
389 | level = DEBUG |
|
391 | level = DEBUG | |
390 | handlers = |
|
392 | handlers = | |
391 | qualname = tg |
|
393 | qualname = tg | |
392 | propagate = 1 |
|
394 | propagate = 1 | |
393 |
|
395 | |||
394 | [logger_gearbox] |
|
396 | [logger_gearbox] | |
395 | level = DEBUG |
|
397 | level = DEBUG | |
396 | handlers = |
|
398 | handlers = | |
397 | qualname = gearbox |
|
399 | qualname = gearbox | |
398 | propagate = 1 |
|
400 | propagate = 1 | |
399 |
|
401 | |||
400 | [logger_sqlalchemy] |
|
402 | [logger_sqlalchemy] | |
401 | level = WARN |
|
403 | level = WARN | |
402 | handlers = console_sql |
|
404 | handlers = console_sql | |
403 | qualname = sqlalchemy.engine |
|
405 | qualname = sqlalchemy.engine | |
404 | propagate = 0 |
|
406 | propagate = 0 | |
405 |
|
407 | |||
406 | [logger_whoosh_indexer] |
|
408 | [logger_whoosh_indexer] | |
407 | level = DEBUG |
|
409 | level = DEBUG | |
408 | handlers = |
|
410 | handlers = | |
409 | qualname = whoosh_indexer |
|
411 | qualname = whoosh_indexer | |
410 | propagate = 1 |
|
412 | propagate = 1 | |
411 |
|
413 | |||
412 | ############## |
|
414 | ############## | |
413 | ## HANDLERS ## |
|
415 | ## HANDLERS ## | |
414 | ############## |
|
416 | ############## | |
415 |
|
417 | |||
416 | [handler_console] |
|
418 | [handler_console] | |
417 | class = StreamHandler |
|
419 | class = StreamHandler | |
418 | args = (sys.stderr,) |
|
420 | args = (sys.stderr,) | |
419 | #formatter = generic |
|
421 | #formatter = generic | |
420 | formatter = color_formatter |
|
422 | formatter = color_formatter | |
421 |
|
423 | |||
422 | [handler_console_sql] |
|
424 | [handler_console_sql] | |
423 | class = StreamHandler |
|
425 | class = StreamHandler | |
424 | args = (sys.stderr,) |
|
426 | args = (sys.stderr,) | |
425 | #formatter = generic |
|
427 | #formatter = generic | |
426 | formatter = color_formatter_sql |
|
428 | formatter = color_formatter_sql | |
427 |
|
429 | |||
428 | ################ |
|
430 | ################ | |
429 | ## FORMATTERS ## |
|
431 | ## FORMATTERS ## | |
430 | ################ |
|
432 | ################ | |
431 |
|
433 | |||
432 | [formatter_generic] |
|
434 | [formatter_generic] | |
433 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s |
|
435 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s | |
434 | datefmt = %Y-%m-%d %H:%M:%S |
|
436 | datefmt = %Y-%m-%d %H:%M:%S | |
435 |
|
437 | |||
436 | [formatter_color_formatter] |
|
438 | [formatter_color_formatter] | |
437 | class = kallithea.lib.colored_formatter.ColorFormatter |
|
439 | class = kallithea.lib.colored_formatter.ColorFormatter | |
438 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s |
|
440 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s | |
439 | datefmt = %Y-%m-%d %H:%M:%S |
|
441 | datefmt = %Y-%m-%d %H:%M:%S | |
440 |
|
442 | |||
441 | [formatter_color_formatter_sql] |
|
443 | [formatter_color_formatter_sql] | |
442 | class = kallithea.lib.colored_formatter.ColorFormatterSql |
|
444 | class = kallithea.lib.colored_formatter.ColorFormatterSql | |
443 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s |
|
445 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s | |
444 | datefmt = %Y-%m-%d %H:%M:%S |
|
446 | datefmt = %Y-%m-%d %H:%M:%S |
@@ -1,118 +1,117 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 | """ |
|
15 | """ | |
16 | kallithea.lib.inifile |
|
16 | kallithea.lib.inifile | |
17 | ~~~~~~~~~~~~~~~~~~~~~ |
|
17 | ~~~~~~~~~~~~~~~~~~~~~ | |
18 |
|
18 | |||
19 | Handling of .ini files, mainly creating them from Mako templates and adding |
|
19 | Handling of .ini files, mainly creating them from Mako templates and adding | |
20 | other custom values. |
|
20 | other custom values. | |
21 | """ |
|
21 | """ | |
22 |
|
22 | |||
23 | import logging |
|
23 | import logging | |
24 | import re |
|
24 | import re | |
25 |
|
25 | |||
26 | import mako.template |
|
26 | import mako.template | |
27 |
|
27 | |||
28 |
|
28 | |||
29 | log = logging.getLogger(__name__) |
|
29 | log = logging.getLogger(__name__) | |
30 |
|
30 | |||
31 |
|
31 | |||
32 | def expand(template, desc, mako_variable_values, settings): |
|
32 | def expand(template, desc, mako_variable_values, settings): | |
33 | """Expand mako template and tweak it. |
|
33 | """Expand mako template and tweak it. | |
34 | Not entirely stable for random templates as input, but good enough for our |
|
34 | Not entirely stable for random templates as input, but good enough for our | |
35 | single template. |
|
35 | single template. | |
36 |
|
36 | |||
37 | >>> template = ''' |
|
37 | >>> template = ''' | |
38 | ... [first-section] |
|
38 | ... [first-section] | |
39 | ... |
|
39 | ... | |
40 | ... variable=${mako_variable} |
|
40 | ... variable=${mako_variable} | |
41 | ... variable2 =\tvalue after tab |
|
41 | ... variable2 =\tvalue after tab | |
42 | ... ## This section had some whitespace and stuff |
|
42 | ... ## This section had some whitespace and stuff | |
43 | ... |
|
43 | ... | |
44 | ... |
|
44 | ... | |
45 | ... # ${mako_function()} |
|
45 | ... # ${mako_function()} | |
46 | ... [second-section] |
|
46 | ... [second-section] | |
47 | ... %if conditional_options == 'option-a': |
|
47 | ... %if conditional_options == 'option-a': | |
48 | ... # Kallithea - config file generated with kallithea-config # |
|
48 | ... # Kallithea - config file generated with kallithea-config # | |
49 | ... %elif conditional_options == 'option-b': |
|
49 | ... %elif conditional_options == 'option-b': | |
50 | ... some_variable = "never mind - option-b will not be used anyway ..." |
|
50 | ... some_variable = "never mind - option-b will not be used anyway ..." | |
51 | ... %endif |
|
51 | ... %endif | |
52 | ... ''' |
|
52 | ... ''' | |
53 | >>> desc = 'Description\\nof this config file' |
|
53 | >>> desc = 'Description\\nof this config file' | |
54 | >>> selected_mako_conditionals = [] |
|
54 | >>> selected_mako_conditionals = [] | |
55 | >>> mako_variable_values = {'mako_variable': 'VALUE', 'mako_function': (lambda: 'FUNCTION RESULT'), |
|
55 | >>> mako_variable_values = {'mako_variable': 'VALUE', 'mako_function': (lambda: 'FUNCTION RESULT'), | |
56 | ... 'conditional_options': 'option-a'} |
|
56 | ... 'conditional_options': 'option-a'} | |
57 | >>> settings = { # only partially used |
|
57 | >>> settings = { # only partially used | |
58 | ... '[first-section]': {'variable2': 'VAL2', 'first_extra': 'EXTRA'}, |
|
58 | ... '[first-section]': {'variable2': 'VAL2', 'first_extra': 'EXTRA'}, | |
59 | ... '[third-section]': {'third_extra': ' 3'}, |
|
59 | ... '[third-section]': {'third_extra': ' 3'}, | |
60 | ... '[fourth-section]': {'fourth_extra': '4', 'fourth': '"four"'}, |
|
60 | ... '[fourth-section]': {'fourth_extra': '4', 'fourth': '"four"'}, | |
61 | ... } |
|
61 | ... } | |
62 | >>> print expand(template, desc, mako_variable_values, settings) |
|
62 | >>> print expand(template, desc, mako_variable_values, settings) | |
63 | <BLANKLINE> |
|
63 | <BLANKLINE> | |
64 | [first-section] |
|
64 | [first-section] | |
65 | <BLANKLINE> |
|
65 | <BLANKLINE> | |
66 | variable=VALUE |
|
66 | variable=VALUE | |
67 | #variable2 = value after tab |
|
67 | #variable2 = value after tab | |
68 | variable2 = VAL2 |
|
68 | variable2 = VAL2 | |
69 | <BLANKLINE> |
|
69 | <BLANKLINE> | |
70 | <BLANKLINE> |
|
70 | <BLANKLINE> | |
71 | # FUNCTION RESULT |
|
71 | # FUNCTION RESULT | |
72 | [second-section] |
|
72 | [second-section] | |
73 | # Description # |
|
73 | # Description # | |
74 | # of this config file # |
|
74 | # of this config file # | |
75 | <BLANKLINE> |
|
75 | <BLANKLINE> | |
76 | """ |
|
76 | """ | |
77 | ini_lines = mako.template.Template(template).render(**mako_variable_values) |
|
77 | ini_lines = mako.template.Template(template).render(**mako_variable_values) | |
78 |
|
78 | |||
79 | ini_lines = re.sub( |
|
79 | ini_lines = re.sub( | |
80 | '# Kallithea - config file generated with kallithea-config *#\n', |
|
80 | '# Kallithea - config file generated with kallithea-config *#\n', | |
81 | ''.join('# %-77s#\n' % l.strip() for l in desc.strip().split('\n')), |
|
81 | ''.join('# %-77s#\n' % l.strip() for l in desc.strip().split('\n')), | |
82 | ini_lines) |
|
82 | ini_lines) | |
83 |
|
83 | |||
84 | def process_section(m): |
|
84 | def process_section(m): | |
85 | """process a ini section, replacing values as necessary""" |
|
85 | """process a ini section, replacing values as necessary""" | |
86 | sectionname, lines = m.groups() |
|
86 | sectionname, lines = m.groups() | |
87 | if sectionname in settings: |
|
87 | if sectionname in settings: | |
88 | section_settings = settings[sectionname] |
|
88 | section_settings = settings[sectionname] | |
89 |
|
89 | |||
90 | def process_line(m): |
|
90 | def process_line(m): | |
91 | """process a section line and update value if necessary""" |
|
91 | """process a section line and update value if necessary""" | |
92 | key, value = m.groups() |
|
92 | key, value = m.groups() | |
93 | line = m.group(0) |
|
93 | line = m.group(0) | |
94 | if key in section_settings: |
|
94 | if key in section_settings: | |
95 | line = '%s = %s' % (key, section_settings[key]) |
|
95 | # keep old entry as example - comments might refer to it | |
96 | if '$' not in value: |
|
96 | line = '#%s\n%s = %s' % (line, key, section_settings[key]) | |
97 | line = '#%s = %s\n%s' % (key, value, line) |
|
|||
98 | return line.rstrip() |
|
97 | return line.rstrip() | |
99 |
|
98 | |||
100 | # process lines that not are comments or empty and look like name=value |
|
99 | # process lines that not are comments or empty and look like name=value | |
101 | lines = re.sub(r'^([^#\n\s]*)[ \t]*=[ \t]*(.*)$', process_line, lines, flags=re.MULTILINE) |
|
100 | lines = re.sub(r'^([^#\n\s]*)[ \t]*=[ \t]*(.*)$', process_line, lines, flags=re.MULTILINE) | |
102 |
|
101 | |||
103 | return sectionname + '\n' + lines |
|
102 | return sectionname + '\n' + lines | |
104 |
|
103 | |||
105 | # process sections until next section start or end |
|
104 | # process sections until next section start or end | |
106 | ini_lines = re.sub(r'''^ |
|
105 | ini_lines = re.sub(r'''^ | |
107 | (\[.*\])\n |
|
106 | (\[.*\])\n | |
108 | # after the section name, a number of chunks with: |
|
107 | # after the section name, a number of chunks with: | |
109 | ( |
|
108 | ( | |
110 | (?: |
|
109 | (?: | |
111 | # a number of empty or non-section-start lines |
|
110 | # a number of empty or non-section-start lines | |
112 | (?:[^\n[].*)?\n |
|
111 | (?:[^\n[].*)?\n | |
113 | )* |
|
112 | )* | |
114 | ) |
|
113 | ) | |
115 | ''', |
|
114 | ''', | |
116 | process_section, ini_lines, flags=re.MULTILINE|re.VERBOSE) |
|
115 | process_section, ini_lines, flags=re.MULTILINE|re.VERBOSE) | |
117 |
|
116 | |||
118 | return ini_lines |
|
117 | return ini_lines |
@@ -1,441 +1,443 b'' | |||||
1 | ################################################################################ |
|
1 | ################################################################################ | |
2 | ################################################################################ |
|
2 | ################################################################################ | |
3 | # Kallithea - config for tests: # |
|
3 | # Kallithea - config for tests: # | |
4 | # sqlalchemy and kallithea_test.sqlite # |
|
4 | # sqlalchemy and kallithea_test.sqlite # | |
5 | # custom logging # |
|
5 | # custom logging # | |
6 | # # |
|
6 | # # | |
7 | # The %(here)s variable will be replaced with the parent directory of this file# |
|
7 | # The %(here)s variable will be replaced with the parent directory of this file# | |
8 | ################################################################################ |
|
8 | ################################################################################ | |
9 | ################################################################################ |
|
9 | ################################################################################ | |
10 |
|
10 | |||
11 | [DEFAULT] |
|
11 | [DEFAULT] | |
12 |
|
12 | |||
13 | ################################################################################ |
|
13 | ################################################################################ | |
14 | ## Email settings ## |
|
14 | ## Email settings ## | |
15 | ## ## |
|
15 | ## ## | |
16 | ## Refer to the documentation ("Email settings") for more details. ## |
|
16 | ## Refer to the documentation ("Email settings") for more details. ## | |
17 | ## ## |
|
17 | ## ## | |
18 | ## It is recommended to use a valid sender address that passes access ## |
|
18 | ## It is recommended to use a valid sender address that passes access ## | |
19 | ## validation and spam filtering in mail servers. ## |
|
19 | ## validation and spam filtering in mail servers. ## | |
20 | ################################################################################ |
|
20 | ################################################################################ | |
21 |
|
21 | |||
22 | ## 'From' header for application emails. You can optionally add a name. |
|
22 | ## 'From' header for application emails. You can optionally add a name. | |
23 | ## Default: |
|
23 | ## Default: | |
24 | #app_email_from = Kallithea |
|
24 | #app_email_from = Kallithea | |
25 | ## Examples: |
|
25 | ## Examples: | |
26 | #app_email_from = Kallithea <kallithea-noreply@example.com> |
|
26 | #app_email_from = Kallithea <kallithea-noreply@example.com> | |
27 | #app_email_from = kallithea-noreply@example.com |
|
27 | #app_email_from = kallithea-noreply@example.com | |
28 |
|
28 | |||
29 | ## Subject prefix for application emails. |
|
29 | ## Subject prefix for application emails. | |
30 | ## A space between this prefix and the real subject is automatically added. |
|
30 | ## A space between this prefix and the real subject is automatically added. | |
31 | ## Default: |
|
31 | ## Default: | |
32 | #email_prefix = |
|
32 | #email_prefix = | |
33 | ## Example: |
|
33 | ## Example: | |
34 | #email_prefix = [Kallithea] |
|
34 | #email_prefix = [Kallithea] | |
35 |
|
35 | |||
36 | ## Recipients for error emails and fallback recipients of application mails. |
|
36 | ## Recipients for error emails and fallback recipients of application mails. | |
37 | ## Multiple addresses can be specified, space-separated. |
|
37 | ## Multiple addresses can be specified, space-separated. | |
38 | ## Only addresses are allowed, do not add any name part. |
|
38 | ## Only addresses are allowed, do not add any name part. | |
39 | ## Default: |
|
39 | ## Default: | |
40 | #email_to = |
|
40 | #email_to = | |
41 | ## Examples: |
|
41 | ## Examples: | |
42 | #email_to = admin@example.com |
|
42 | #email_to = admin@example.com | |
43 | #email_to = admin@example.com another_admin@example.com |
|
43 | #email_to = admin@example.com another_admin@example.com | |
44 | email_to = |
|
44 | email_to = | |
45 |
|
45 | |||
46 | ## 'From' header for error emails. You can optionally add a name. |
|
46 | ## 'From' header for error emails. You can optionally add a name. | |
47 | ## Default: (none) |
|
47 | ## Default: (none) | |
48 | ## Examples: |
|
48 | ## Examples: | |
49 | #error_email_from = Kallithea Errors <kallithea-noreply@example.com> |
|
49 | #error_email_from = Kallithea Errors <kallithea-noreply@example.com> | |
50 | #error_email_from = kallithea_errors@example.com |
|
50 | #error_email_from = kallithea_errors@example.com | |
51 | error_email_from = |
|
51 | error_email_from = | |
52 |
|
52 | |||
53 | ## SMTP server settings |
|
53 | ## SMTP server settings | |
54 | ## If specifying credentials, make sure to use secure connections. |
|
54 | ## If specifying credentials, make sure to use secure connections. | |
55 | ## Default: Send unencrypted unauthenticated mails to the specified smtp_server. |
|
55 | ## Default: Send unencrypted unauthenticated mails to the specified smtp_server. | |
56 | ## For "SSL", use smtp_use_ssl = true and smtp_port = 465. |
|
56 | ## For "SSL", use smtp_use_ssl = true and smtp_port = 465. | |
57 | ## For "STARTTLS", use smtp_use_tls = true and smtp_port = 587. |
|
57 | ## For "STARTTLS", use smtp_use_tls = true and smtp_port = 587. | |
58 | smtp_server = |
|
58 | smtp_server = | |
59 | #smtp_username = |
|
59 | #smtp_username = | |
60 | #smtp_password = |
|
60 | #smtp_password = | |
61 | smtp_port = |
|
61 | smtp_port = | |
62 | #smtp_use_ssl = false |
|
62 | #smtp_use_ssl = false | |
63 | #smtp_use_tls = false |
|
63 | #smtp_use_tls = false | |
64 |
|
64 | |||
65 | [server:main] |
|
65 | [server:main] | |
66 | ## WAITRESS ## |
|
66 | ## WAITRESS ## | |
67 | use = egg:waitress#main |
|
67 | use = egg:waitress#main | |
68 | ## number of worker threads |
|
68 | ## number of worker threads | |
69 | threads = 1 |
|
69 | threads = 1 | |
70 | ## MAX BODY SIZE 100GB |
|
70 | ## MAX BODY SIZE 100GB | |
71 | max_request_body_size = 107374182400 |
|
71 | max_request_body_size = 107374182400 | |
72 | ## use poll instead of select, fixes fd limits, may not work on old |
|
72 | ## use poll instead of select, fixes fd limits, may not work on old | |
73 | ## windows systems. |
|
73 | ## windows systems. | |
74 | #asyncore_use_poll = True |
|
74 | #asyncore_use_poll = True | |
75 |
|
75 | |||
76 | ## COMMON ## |
|
76 | ## COMMON ## | |
77 | host = 127.0.0.1 |
|
77 | host = 127.0.0.1 | |
78 | #port = 5000 |
|
78 | #port = 5000 | |
79 | port = 4999 |
|
79 | port = 4999 | |
80 |
|
80 | |||
81 | ## middleware for hosting the WSGI application under a URL prefix |
|
81 | ## middleware for hosting the WSGI application under a URL prefix | |
82 | #[filter:proxy-prefix] |
|
82 | #[filter:proxy-prefix] | |
83 | #use = egg:PasteDeploy#prefix |
|
83 | #use = egg:PasteDeploy#prefix | |
84 | #prefix = /<your-prefix> |
|
84 | #prefix = /<your-prefix> | |
85 |
|
85 | |||
86 | [app:main] |
|
86 | [app:main] | |
87 | use = egg:kallithea |
|
87 | use = egg:kallithea | |
88 | ## enable proxy prefix middleware |
|
88 | ## enable proxy prefix middleware | |
89 | #filter-with = proxy-prefix |
|
89 | #filter-with = proxy-prefix | |
90 |
|
90 | |||
91 | full_stack = true |
|
91 | full_stack = true | |
92 | static_files = true |
|
92 | static_files = true | |
93 |
|
93 | |||
94 | ## Internationalization (see setup documentation for details) |
|
94 | ## Internationalization (see setup documentation for details) | |
95 | ## By default, the language requested by the browser is used if available. |
|
95 | ## By default, the language requested by the browser is used if available. | |
96 | #i18n.enable = false |
|
96 | #i18n.enable = false | |
97 | ## Fallback language, empty for English (valid values are the names of subdirectories in kallithea/i18n): |
|
97 | ## Fallback language, empty for English (valid values are the names of subdirectories in kallithea/i18n): | |
98 | i18n.lang = |
|
98 | i18n.lang = | |
99 |
|
99 | |||
100 | cache_dir = %(here)s/data |
|
100 | cache_dir = %(here)s/data | |
101 | index_dir = %(here)s/data/index |
|
101 | index_dir = %(here)s/data/index | |
102 |
|
102 | |||
103 | ## perform a full repository scan on each server start, this should be |
|
103 | ## perform a full repository scan on each server start, this should be | |
104 | ## set to false after first startup, to allow faster server restarts. |
|
104 | ## set to false after first startup, to allow faster server restarts. | |
105 | initial_repo_scan = false |
|
105 | initial_repo_scan = false | |
106 |
|
106 | |||
107 | ## uncomment and set this path to use archive download cache |
|
107 | ## uncomment and set this path to use archive download cache | |
108 | archive_cache_dir = %(here)s/tarballcache |
|
108 | archive_cache_dir = %(here)s/tarballcache | |
109 |
|
109 | |||
110 | ## change this to unique ID for security |
|
110 | ## change this to unique ID for security | |
|
111 | #app_instance_uuid = VERY-SECRET | |||
111 | app_instance_uuid = test |
|
112 | app_instance_uuid = test | |
112 |
|
113 | |||
113 | ## cut off limit for large diffs (size in bytes) |
|
114 | ## cut off limit for large diffs (size in bytes) | |
114 | cut_off_limit = 256000 |
|
115 | cut_off_limit = 256000 | |
115 |
|
116 | |||
116 | ## force https in Kallithea, fixes https redirects, assumes it's always https |
|
117 | ## force https in Kallithea, fixes https redirects, assumes it's always https | |
117 | force_https = false |
|
118 | force_https = false | |
118 |
|
119 | |||
119 | ## use Strict-Transport-Security headers |
|
120 | ## use Strict-Transport-Security headers | |
120 | use_htsts = false |
|
121 | use_htsts = false | |
121 |
|
122 | |||
122 | ## number of commits stats will parse on each iteration |
|
123 | ## number of commits stats will parse on each iteration | |
123 | commit_parse_limit = 25 |
|
124 | commit_parse_limit = 25 | |
124 |
|
125 | |||
125 | ## path to git executable |
|
126 | ## path to git executable | |
126 | git_path = git |
|
127 | git_path = git | |
127 |
|
128 | |||
128 | ## git rev filter option, --all is the default filter, if you need to |
|
129 | ## git rev filter option, --all is the default filter, if you need to | |
129 | ## hide all refs in changelog switch this to --branches --tags |
|
130 | ## hide all refs in changelog switch this to --branches --tags | |
130 | #git_rev_filter = --branches --tags |
|
131 | #git_rev_filter = --branches --tags | |
131 |
|
132 | |||
132 | ## RSS feed options |
|
133 | ## RSS feed options | |
133 | rss_cut_off_limit = 256000 |
|
134 | rss_cut_off_limit = 256000 | |
134 | rss_items_per_page = 10 |
|
135 | rss_items_per_page = 10 | |
135 | rss_include_diff = false |
|
136 | rss_include_diff = false | |
136 |
|
137 | |||
137 | ## options for showing and identifying changesets |
|
138 | ## options for showing and identifying changesets | |
138 | show_sha_length = 12 |
|
139 | show_sha_length = 12 | |
139 | #show_revision_number = false |
|
140 | #show_revision_number = false | |
140 | show_revision_number = true |
|
141 | show_revision_number = true | |
141 |
|
142 | |||
142 | ## Canonical URL to use when creating full URLs in UI and texts. |
|
143 | ## Canonical URL to use when creating full URLs in UI and texts. | |
143 | ## Useful when the site is available under different names or protocols. |
|
144 | ## Useful when the site is available under different names or protocols. | |
144 | ## Defaults to what is provided in the WSGI environment. |
|
145 | ## Defaults to what is provided in the WSGI environment. | |
145 | #canonical_url = https://kallithea.example.com/repos |
|
146 | #canonical_url = https://kallithea.example.com/repos | |
146 |
|
147 | |||
147 | ## gist URL alias, used to create nicer urls for gist. This should be an |
|
148 | ## gist URL alias, used to create nicer urls for gist. This should be an | |
148 | ## url that does rewrites to _admin/gists/<gistid>. |
|
149 | ## url that does rewrites to _admin/gists/<gistid>. | |
149 | ## example: http://gist.example.com/{gistid}. Empty means use the internal |
|
150 | ## example: http://gist.example.com/{gistid}. Empty means use the internal | |
150 | ## Kallithea url, ie. http[s]://kallithea.example.com/_admin/gists/<gistid> |
|
151 | ## Kallithea url, ie. http[s]://kallithea.example.com/_admin/gists/<gistid> | |
151 | gist_alias_url = |
|
152 | gist_alias_url = | |
152 |
|
153 | |||
153 | ## white list of API enabled controllers. This allows to add list of |
|
154 | ## white list of API enabled controllers. This allows to add list of | |
154 | ## controllers to which access will be enabled by api_key. eg: to enable |
|
155 | ## controllers to which access will be enabled by api_key. eg: to enable | |
155 | ## api access to raw_files put `FilesController:raw`, to enable access to patches |
|
156 | ## api access to raw_files put `FilesController:raw`, to enable access to patches | |
156 | ## add `ChangesetController:changeset_patch`. This list should be "," separated |
|
157 | ## add `ChangesetController:changeset_patch`. This list should be "," separated | |
157 | ## Syntax is <ControllerClass>:<function>. Check debug logs for generated names |
|
158 | ## Syntax is <ControllerClass>:<function>. Check debug logs for generated names | |
158 | ## Recommended settings below are commented out: |
|
159 | ## Recommended settings below are commented out: | |
159 | api_access_controllers_whitelist = |
|
160 | api_access_controllers_whitelist = | |
160 | # ChangesetController:changeset_patch, |
|
161 | # ChangesetController:changeset_patch, | |
161 | # ChangesetController:changeset_raw, |
|
162 | # ChangesetController:changeset_raw, | |
162 | # FilesController:raw, |
|
163 | # FilesController:raw, | |
163 | # FilesController:archivefile |
|
164 | # FilesController:archivefile | |
164 |
|
165 | |||
165 | ## default encoding used to convert from and to unicode |
|
166 | ## default encoding used to convert from and to unicode | |
166 | ## can be also a comma separated list of encoding in case of mixed encodings |
|
167 | ## can be also a comma separated list of encoding in case of mixed encodings | |
167 | default_encoding = utf8 |
|
168 | default_encoding = utf8 | |
168 |
|
169 | |||
169 | ## issue tracker for Kallithea (leave blank to disable, absent for default) |
|
170 | ## issue tracker for Kallithea (leave blank to disable, absent for default) | |
170 | #bugtracker = https://bitbucket.org/conservancy/kallithea/issues |
|
171 | #bugtracker = https://bitbucket.org/conservancy/kallithea/issues | |
171 |
|
172 | |||
172 | ## issue tracking mapping for commits messages |
|
173 | ## issue tracking mapping for commits messages | |
173 | ## comment out issue_pat, issue_server, issue_prefix to enable |
|
174 | ## comment out issue_pat, issue_server, issue_prefix to enable | |
174 |
|
175 | |||
175 | ## pattern to get the issues from commit messages |
|
176 | ## pattern to get the issues from commit messages | |
176 | ## default one used here is #<numbers> with a regex passive group for `#` |
|
177 | ## default one used here is #<numbers> with a regex passive group for `#` | |
177 | ## {id} will be all groups matched from this pattern |
|
178 | ## {id} will be all groups matched from this pattern | |
178 |
|
179 | |||
179 | issue_pat = (?:\s*#)(\d+) |
|
180 | issue_pat = (?:\s*#)(\d+) | |
180 |
|
181 | |||
181 | ## server url to the issue, each {id} will be replaced with match |
|
182 | ## server url to the issue, each {id} will be replaced with match | |
182 | ## fetched from the regex and {repo} is replaced with full repository name |
|
183 | ## fetched from the regex and {repo} is replaced with full repository name | |
183 | ## including groups {repo_name} is replaced with just name of repo |
|
184 | ## including groups {repo_name} is replaced with just name of repo | |
184 |
|
185 | |||
185 | issue_server_link = https://issues.example.com/{repo}/issue/{id} |
|
186 | issue_server_link = https://issues.example.com/{repo}/issue/{id} | |
186 |
|
187 | |||
187 | ## prefix to add to link to indicate it's an url |
|
188 | ## prefix to add to link to indicate it's an url | |
188 | ## #314 will be replaced by <issue_prefix><id> |
|
189 | ## #314 will be replaced by <issue_prefix><id> | |
189 |
|
190 | |||
190 | issue_prefix = # |
|
191 | issue_prefix = # | |
191 |
|
192 | |||
192 | ## issue_pat, issue_server_link, issue_prefix can have suffixes to specify |
|
193 | ## issue_pat, issue_server_link, issue_prefix can have suffixes to specify | |
193 | ## multiple patterns, to other issues server, wiki or others |
|
194 | ## multiple patterns, to other issues server, wiki or others | |
194 | ## below an example how to create a wiki pattern |
|
195 | ## below an example how to create a wiki pattern | |
195 | # wiki-some-id -> https://wiki.example.com/some-id |
|
196 | # wiki-some-id -> https://wiki.example.com/some-id | |
196 |
|
197 | |||
197 | #issue_pat_wiki = (?:wiki-)(.+) |
|
198 | #issue_pat_wiki = (?:wiki-)(.+) | |
198 | #issue_server_link_wiki = https://wiki.example.com/{id} |
|
199 | #issue_server_link_wiki = https://wiki.example.com/{id} | |
199 | #issue_prefix_wiki = WIKI- |
|
200 | #issue_prefix_wiki = WIKI- | |
200 |
|
201 | |||
201 | ## alternative return HTTP header for failed authentication. Default HTTP |
|
202 | ## alternative return HTTP header for failed authentication. Default HTTP | |
202 | ## response is 401 HTTPUnauthorized. Currently Mercurial clients have trouble with |
|
203 | ## response is 401 HTTPUnauthorized. Currently Mercurial clients have trouble with | |
203 | ## handling that. Set this variable to 403 to return HTTPForbidden |
|
204 | ## handling that. Set this variable to 403 to return HTTPForbidden | |
204 | auth_ret_code = |
|
205 | auth_ret_code = | |
205 |
|
206 | |||
206 | ## locking return code. When repository is locked return this HTTP code. 2XX |
|
207 | ## locking return code. When repository is locked return this HTTP code. 2XX | |
207 | ## codes don't break the transactions while 4XX codes do |
|
208 | ## codes don't break the transactions while 4XX codes do | |
208 | lock_ret_code = 423 |
|
209 | lock_ret_code = 423 | |
209 |
|
210 | |||
210 | ## allows to change the repository location in settings page |
|
211 | ## allows to change the repository location in settings page | |
211 | allow_repo_location_change = True |
|
212 | allow_repo_location_change = True | |
212 |
|
213 | |||
213 | ## allows to setup custom hooks in settings page |
|
214 | ## allows to setup custom hooks in settings page | |
214 | allow_custom_hooks_settings = True |
|
215 | allow_custom_hooks_settings = True | |
215 |
|
216 | |||
216 | ## extra extensions for indexing, space separated and without the leading '.'. |
|
217 | ## extra extensions for indexing, space separated and without the leading '.'. | |
217 | # index.extensions = |
|
218 | # index.extensions = | |
218 | # gemfile |
|
219 | # gemfile | |
219 | # lock |
|
220 | # lock | |
220 |
|
221 | |||
221 | ## extra filenames for indexing, space separated |
|
222 | ## extra filenames for indexing, space separated | |
222 | # index.filenames = |
|
223 | # index.filenames = | |
223 | # .dockerignore |
|
224 | # .dockerignore | |
224 | # .editorconfig |
|
225 | # .editorconfig | |
225 | # INSTALL |
|
226 | # INSTALL | |
226 | # CHANGELOG |
|
227 | # CHANGELOG | |
227 |
|
228 | |||
228 | #################################### |
|
229 | #################################### | |
229 | ### CELERY CONFIG #### |
|
230 | ### CELERY CONFIG #### | |
230 | #################################### |
|
231 | #################################### | |
231 |
|
232 | |||
232 | use_celery = false |
|
233 | use_celery = false | |
233 |
|
234 | |||
234 | ## Example: connect to the virtual host 'rabbitmqhost' on localhost as rabbitmq: |
|
235 | ## Example: connect to the virtual host 'rabbitmqhost' on localhost as rabbitmq: | |
235 | broker.url = amqp://rabbitmq:qewqew@localhost:5672/rabbitmqhost |
|
236 | broker.url = amqp://rabbitmq:qewqew@localhost:5672/rabbitmqhost | |
236 |
|
237 | |||
237 | celery.imports = kallithea.lib.celerylib.tasks |
|
238 | celery.imports = kallithea.lib.celerylib.tasks | |
238 | celery.accept.content = pickle |
|
239 | celery.accept.content = pickle | |
239 | celery.result.backend = amqp |
|
240 | celery.result.backend = amqp | |
240 | celery.result.dburi = amqp:// |
|
241 | celery.result.dburi = amqp:// | |
241 | celery.result.serialier = json |
|
242 | celery.result.serialier = json | |
242 |
|
243 | |||
243 | #celery.send.task.error.emails = true |
|
244 | #celery.send.task.error.emails = true | |
244 | #celery.amqp.task.result.expires = 18000 |
|
245 | #celery.amqp.task.result.expires = 18000 | |
245 |
|
246 | |||
246 | celeryd.concurrency = 2 |
|
247 | celeryd.concurrency = 2 | |
247 | celeryd.max.tasks.per.child = 1 |
|
248 | celeryd.max.tasks.per.child = 1 | |
248 |
|
249 | |||
249 | ## If true, tasks will never be sent to the queue, but executed locally instead. |
|
250 | ## If true, tasks will never be sent to the queue, but executed locally instead. | |
250 | celery.always.eager = false |
|
251 | celery.always.eager = false | |
251 |
|
252 | |||
252 | #################################### |
|
253 | #################################### | |
253 | ### BEAKER CACHE #### |
|
254 | ### BEAKER CACHE #### | |
254 | #################################### |
|
255 | #################################### | |
255 |
|
256 | |||
256 | beaker.cache.data_dir = %(here)s/data/cache/data |
|
257 | beaker.cache.data_dir = %(here)s/data/cache/data | |
257 | beaker.cache.lock_dir = %(here)s/data/cache/lock |
|
258 | beaker.cache.lock_dir = %(here)s/data/cache/lock | |
258 |
|
259 | |||
259 | beaker.cache.regions = short_term,long_term,sql_cache_short |
|
260 | beaker.cache.regions = short_term,long_term,sql_cache_short | |
260 |
|
261 | |||
261 | beaker.cache.short_term.type = memory |
|
262 | beaker.cache.short_term.type = memory | |
262 | beaker.cache.short_term.expire = 60 |
|
263 | beaker.cache.short_term.expire = 60 | |
263 | beaker.cache.short_term.key_length = 256 |
|
264 | beaker.cache.short_term.key_length = 256 | |
264 |
|
265 | |||
265 | beaker.cache.long_term.type = memory |
|
266 | beaker.cache.long_term.type = memory | |
266 | beaker.cache.long_term.expire = 36000 |
|
267 | beaker.cache.long_term.expire = 36000 | |
267 | beaker.cache.long_term.key_length = 256 |
|
268 | beaker.cache.long_term.key_length = 256 | |
268 |
|
269 | |||
269 | beaker.cache.sql_cache_short.type = memory |
|
270 | beaker.cache.sql_cache_short.type = memory | |
270 | #beaker.cache.sql_cache_short.expire = 10 |
|
271 | #beaker.cache.sql_cache_short.expire = 10 | |
271 | beaker.cache.sql_cache_short.expire = 1 |
|
272 | beaker.cache.sql_cache_short.expire = 1 | |
272 | beaker.cache.sql_cache_short.key_length = 256 |
|
273 | beaker.cache.sql_cache_short.key_length = 256 | |
273 |
|
274 | |||
274 | #################################### |
|
275 | #################################### | |
275 | ### BEAKER SESSION #### |
|
276 | ### BEAKER SESSION #### | |
276 | #################################### |
|
277 | #################################### | |
277 |
|
278 | |||
278 | ## Name of session cookie. Should be unique for a given host and path, even when running |
|
279 | ## Name of session cookie. Should be unique for a given host and path, even when running | |
279 | ## on different ports. Otherwise, cookie sessions will be shared and messed up. |
|
280 | ## on different ports. Otherwise, cookie sessions will be shared and messed up. | |
280 | beaker.session.key = kallithea |
|
281 | beaker.session.key = kallithea | |
281 | ## Sessions should always only be accessible by the browser, not directly by JavaScript. |
|
282 | ## Sessions should always only be accessible by the browser, not directly by JavaScript. | |
282 | beaker.session.httponly = true |
|
283 | beaker.session.httponly = true | |
283 | ## Session lifetime. 2592000 seconds is 30 days. |
|
284 | ## Session lifetime. 2592000 seconds is 30 days. | |
284 | beaker.session.timeout = 2592000 |
|
285 | beaker.session.timeout = 2592000 | |
285 |
|
286 | |||
286 | ## Server secret used with HMAC to ensure integrity of cookies. |
|
287 | ## Server secret used with HMAC to ensure integrity of cookies. | |
|
288 | #beaker.session.secret = VERY-SECRET | |||
287 | beaker.session.secret = {74e0cd75-b339-478b-b129-07dd221def1f} |
|
289 | beaker.session.secret = {74e0cd75-b339-478b-b129-07dd221def1f} | |
288 | ## Further, encrypt the data with AES. |
|
290 | ## Further, encrypt the data with AES. | |
289 | #beaker.session.encrypt_key = <key_for_encryption> |
|
291 | #beaker.session.encrypt_key = <key_for_encryption> | |
290 | #beaker.session.validate_key = <validation_key> |
|
292 | #beaker.session.validate_key = <validation_key> | |
291 |
|
293 | |||
292 | ## Type of storage used for the session, current types are |
|
294 | ## Type of storage used for the session, current types are | |
293 | ## dbm, file, memcached, database, and memory. |
|
295 | ## dbm, file, memcached, database, and memory. | |
294 |
|
296 | |||
295 | ## File system storage of session data. (default) |
|
297 | ## File system storage of session data. (default) | |
296 | #beaker.session.type = file |
|
298 | #beaker.session.type = file | |
297 |
|
299 | |||
298 | ## Cookie only, store all session data inside the cookie. Requires secure secrets. |
|
300 | ## Cookie only, store all session data inside the cookie. Requires secure secrets. | |
299 | #beaker.session.type = cookie |
|
301 | #beaker.session.type = cookie | |
300 |
|
302 | |||
301 | ## Database storage of session data. |
|
303 | ## Database storage of session data. | |
302 | #beaker.session.type = ext:database |
|
304 | #beaker.session.type = ext:database | |
303 | #beaker.session.sa.url = postgresql://postgres:qwe@localhost/kallithea |
|
305 | #beaker.session.sa.url = postgresql://postgres:qwe@localhost/kallithea | |
304 | #beaker.session.table_name = db_session |
|
306 | #beaker.session.table_name = db_session | |
305 |
|
307 | |||
306 | ################################################################################ |
|
308 | ################################################################################ | |
307 | ## WARNING: *DEBUG MODE MUST BE OFF IN A PRODUCTION ENVIRONMENT* ## |
|
309 | ## WARNING: *DEBUG MODE MUST BE OFF IN A PRODUCTION ENVIRONMENT* ## | |
308 | ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ## |
|
310 | ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ## | |
309 | ## execute malicious code after an exception is raised. ## |
|
311 | ## execute malicious code after an exception is raised. ## | |
310 | ################################################################################ |
|
312 | ################################################################################ | |
311 | debug = false |
|
313 | debug = false | |
312 |
|
314 | |||
313 | ################################## |
|
315 | ################################## | |
314 | ### LOGVIEW CONFIG ### |
|
316 | ### LOGVIEW CONFIG ### | |
315 | ################################## |
|
317 | ################################## | |
316 |
|
318 | |||
317 | logview.sqlalchemy = #faa |
|
319 | logview.sqlalchemy = #faa | |
318 | logview.pylons.templating = #bfb |
|
320 | logview.pylons.templating = #bfb | |
319 | logview.pylons.util = #eee |
|
321 | logview.pylons.util = #eee | |
320 |
|
322 | |||
321 | ######################################################### |
|
323 | ######################################################### | |
322 | ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ### |
|
324 | ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ### | |
323 | ######################################################### |
|
325 | ######################################################### | |
324 |
|
326 | |||
325 | # SQLITE [default] |
|
327 | # SQLITE [default] | |
326 | sqlalchemy.url = sqlite:///%(here)s/kallithea.db?timeout=60 |
|
328 | sqlalchemy.url = sqlite:///%(here)s/kallithea.db?timeout=60 | |
327 |
|
329 | |||
328 | # see sqlalchemy docs for others |
|
330 | # see sqlalchemy docs for others | |
329 |
|
331 | |||
330 | sqlalchemy.pool_recycle = 3600 |
|
332 | sqlalchemy.pool_recycle = 3600 | |
331 |
|
333 | |||
332 | ################################ |
|
334 | ################################ | |
333 | ### ALEMBIC CONFIGURATION #### |
|
335 | ### ALEMBIC CONFIGURATION #### | |
334 | ################################ |
|
336 | ################################ | |
335 |
|
337 | |||
336 | [alembic] |
|
338 | [alembic] | |
337 | script_location = kallithea:alembic |
|
339 | script_location = kallithea:alembic | |
338 |
|
340 | |||
339 | ################################ |
|
341 | ################################ | |
340 | ### LOGGING CONFIGURATION #### |
|
342 | ### LOGGING CONFIGURATION #### | |
341 | ################################ |
|
343 | ################################ | |
342 |
|
344 | |||
343 | [loggers] |
|
345 | [loggers] | |
344 | keys = root, routes, kallithea, sqlalchemy, tg, gearbox, beaker, templates, whoosh_indexer |
|
346 | keys = root, routes, kallithea, sqlalchemy, tg, gearbox, beaker, templates, whoosh_indexer | |
345 |
|
347 | |||
346 | [handlers] |
|
348 | [handlers] | |
347 | keys = console, console_sql |
|
349 | keys = console, console_sql | |
348 |
|
350 | |||
349 | [formatters] |
|
351 | [formatters] | |
350 | keys = generic, color_formatter, color_formatter_sql |
|
352 | keys = generic, color_formatter, color_formatter_sql | |
351 |
|
353 | |||
352 | ############# |
|
354 | ############# | |
353 | ## LOGGERS ## |
|
355 | ## LOGGERS ## | |
354 | ############# |
|
356 | ############# | |
355 |
|
357 | |||
356 | [logger_root] |
|
358 | [logger_root] | |
357 | level = NOTSET |
|
359 | level = NOTSET | |
358 | handlers = console |
|
360 | handlers = console | |
359 |
|
361 | |||
360 | [logger_routes] |
|
362 | [logger_routes] | |
361 | level = DEBUG |
|
363 | level = DEBUG | |
362 | handlers = |
|
364 | handlers = | |
363 | qualname = routes.middleware |
|
365 | qualname = routes.middleware | |
364 | ## "level = DEBUG" logs the route matched and routing variables. |
|
366 | ## "level = DEBUG" logs the route matched and routing variables. | |
365 | propagate = 1 |
|
367 | propagate = 1 | |
366 |
|
368 | |||
367 | [logger_beaker] |
|
369 | [logger_beaker] | |
368 | level = DEBUG |
|
370 | level = DEBUG | |
369 | handlers = |
|
371 | handlers = | |
370 | qualname = beaker.container |
|
372 | qualname = beaker.container | |
371 | propagate = 1 |
|
373 | propagate = 1 | |
372 |
|
374 | |||
373 | [logger_templates] |
|
375 | [logger_templates] | |
374 | level = INFO |
|
376 | level = INFO | |
375 | handlers = |
|
377 | handlers = | |
376 | qualname = pylons.templating |
|
378 | qualname = pylons.templating | |
377 | propagate = 1 |
|
379 | propagate = 1 | |
378 |
|
380 | |||
379 | [logger_kallithea] |
|
381 | [logger_kallithea] | |
380 | level = DEBUG |
|
382 | level = DEBUG | |
381 | handlers = |
|
383 | handlers = | |
382 | qualname = kallithea |
|
384 | qualname = kallithea | |
383 | propagate = 1 |
|
385 | propagate = 1 | |
384 |
|
386 | |||
385 | [logger_tg] |
|
387 | [logger_tg] | |
386 | level = DEBUG |
|
388 | level = DEBUG | |
387 | handlers = |
|
389 | handlers = | |
388 | qualname = tg |
|
390 | qualname = tg | |
389 | propagate = 1 |
|
391 | propagate = 1 | |
390 |
|
392 | |||
391 | [logger_gearbox] |
|
393 | [logger_gearbox] | |
392 | level = DEBUG |
|
394 | level = DEBUG | |
393 | handlers = |
|
395 | handlers = | |
394 | qualname = gearbox |
|
396 | qualname = gearbox | |
395 | propagate = 1 |
|
397 | propagate = 1 | |
396 |
|
398 | |||
397 | [logger_sqlalchemy] |
|
399 | [logger_sqlalchemy] | |
398 | level = WARN |
|
400 | level = WARN | |
399 | handlers = console_sql |
|
401 | handlers = console_sql | |
400 | qualname = sqlalchemy.engine |
|
402 | qualname = sqlalchemy.engine | |
401 | propagate = 0 |
|
403 | propagate = 0 | |
402 |
|
404 | |||
403 | [logger_whoosh_indexer] |
|
405 | [logger_whoosh_indexer] | |
404 | level = DEBUG |
|
406 | level = DEBUG | |
405 | handlers = |
|
407 | handlers = | |
406 | qualname = whoosh_indexer |
|
408 | qualname = whoosh_indexer | |
407 | propagate = 1 |
|
409 | propagate = 1 | |
408 |
|
410 | |||
409 | ############## |
|
411 | ############## | |
410 | ## HANDLERS ## |
|
412 | ## HANDLERS ## | |
411 | ############## |
|
413 | ############## | |
412 |
|
414 | |||
413 | [handler_console] |
|
415 | [handler_console] | |
414 | class = StreamHandler |
|
416 | class = StreamHandler | |
415 | args = (sys.stderr,) |
|
417 | args = (sys.stderr,) | |
416 | #formatter = generic |
|
418 | #formatter = generic | |
417 | formatter = color_formatter |
|
419 | formatter = color_formatter | |
418 |
|
420 | |||
419 | [handler_console_sql] |
|
421 | [handler_console_sql] | |
420 | class = StreamHandler |
|
422 | class = StreamHandler | |
421 | args = (sys.stderr,) |
|
423 | args = (sys.stderr,) | |
422 | #formatter = generic |
|
424 | #formatter = generic | |
423 | formatter = color_formatter_sql |
|
425 | formatter = color_formatter_sql | |
424 |
|
426 | |||
425 | ################ |
|
427 | ################ | |
426 | ## FORMATTERS ## |
|
428 | ## FORMATTERS ## | |
427 | ################ |
|
429 | ################ | |
428 |
|
430 | |||
429 | [formatter_generic] |
|
431 | [formatter_generic] | |
430 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s |
|
432 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s | |
431 | datefmt = %Y-%m-%d %H:%M:%S |
|
433 | datefmt = %Y-%m-%d %H:%M:%S | |
432 |
|
434 | |||
433 | [formatter_color_formatter] |
|
435 | [formatter_color_formatter] | |
434 | class = kallithea.lib.colored_formatter.ColorFormatter |
|
436 | class = kallithea.lib.colored_formatter.ColorFormatter | |
435 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s |
|
437 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s | |
436 | datefmt = %Y-%m-%d %H:%M:%S |
|
438 | datefmt = %Y-%m-%d %H:%M:%S | |
437 |
|
439 | |||
438 | [formatter_color_formatter_sql] |
|
440 | [formatter_color_formatter_sql] | |
439 | class = kallithea.lib.colored_formatter.ColorFormatterSql |
|
441 | class = kallithea.lib.colored_formatter.ColorFormatterSql | |
440 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s |
|
442 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s | |
441 | datefmt = %Y-%m-%d %H:%M:%S |
|
443 | datefmt = %Y-%m-%d %H:%M:%S |
@@ -1,100 +1,100 b'' | |||||
1 | #!/usr/bin/env python2 |
|
1 | #!/usr/bin/env python2 | |
2 | """ |
|
2 | """ | |
3 | Based on kallithea/lib/paster_commands/template.ini.mako, generate |
|
3 | Based on kallithea/lib/paster_commands/template.ini.mako, generate | |
4 | development.ini |
|
4 | development.ini | |
5 | kallithea/tests/test.ini |
|
5 | kallithea/tests/test.ini | |
6 | """ |
|
6 | """ | |
7 |
|
7 | |||
8 | import re |
|
8 | import re | |
9 |
|
9 | |||
10 | from kallithea.lib import inifile |
|
10 | from kallithea.lib import inifile | |
11 |
|
11 | |||
12 | makofile = 'kallithea/lib/paster_commands/template.ini.mako' |
|
12 | makofile = 'kallithea/lib/paster_commands/template.ini.mako' | |
13 |
|
13 | |||
14 | # the mako variables used in all other ini files and templates |
|
14 | # the mako variables used in all other ini files and templates | |
15 | mako_variable_values = { |
|
15 | mako_variable_values = { | |
16 | 'database_engine': 'sqlite', |
|
16 | 'database_engine': 'sqlite', | |
17 | 'http_server': 'waitress', |
|
17 | 'http_server': 'waitress', | |
18 | 'host': '127.0.0.1', |
|
18 | 'host': '127.0.0.1', | |
19 | 'port': '5000', |
|
19 | 'port': '5000', | |
20 | 'uuid': lambda: '${app_instance_uuid}', |
|
20 | 'uuid': lambda: 'VERY-SECRET', | |
21 | } |
|
21 | } | |
22 |
|
22 | |||
23 | # files to be generated from the mako template |
|
23 | # files to be generated from the mako template | |
24 | ini_files = [ |
|
24 | ini_files = [ | |
25 | ('kallithea/tests/test.ini', |
|
25 | ('kallithea/tests/test.ini', | |
26 | ''' |
|
26 | ''' | |
27 | Kallithea - config for tests: |
|
27 | Kallithea - config for tests: | |
28 | sqlalchemy and kallithea_test.sqlite |
|
28 | sqlalchemy and kallithea_test.sqlite | |
29 | custom logging |
|
29 | custom logging | |
30 | ''', |
|
30 | ''', | |
31 | { |
|
31 | { | |
32 | '[server:main]': { |
|
32 | '[server:main]': { | |
33 | 'port': '4999', |
|
33 | 'port': '4999', | |
34 | }, |
|
34 | }, | |
35 | '[app:main]': { |
|
35 | '[app:main]': { | |
36 | 'app_instance_uuid': 'test', |
|
36 | 'app_instance_uuid': 'test', | |
37 | 'show_revision_number': 'true', |
|
37 | 'show_revision_number': 'true', | |
38 | 'beaker.cache.sql_cache_short.expire': '1', |
|
38 | 'beaker.cache.sql_cache_short.expire': '1', | |
39 | 'beaker.session.secret': '{74e0cd75-b339-478b-b129-07dd221def1f}', |
|
39 | 'beaker.session.secret': '{74e0cd75-b339-478b-b129-07dd221def1f}', | |
40 | }, |
|
40 | }, | |
41 | '[handler_console]': { |
|
41 | '[handler_console]': { | |
42 | 'formatter': 'color_formatter', |
|
42 | 'formatter': 'color_formatter', | |
43 | }, |
|
43 | }, | |
44 | # The 'handler_console_sql' block is very similar to the one in |
|
44 | # The 'handler_console_sql' block is very similar to the one in | |
45 | # development.ini, but without the explicit 'level=DEBUG' setting: |
|
45 | # development.ini, but without the explicit 'level=DEBUG' setting: | |
46 | # it causes duplicate sqlalchemy debug logs, one through |
|
46 | # it causes duplicate sqlalchemy debug logs, one through | |
47 | # handler_console_sql and another through another path. |
|
47 | # handler_console_sql and another through another path. | |
48 | '[handler_console_sql]': { |
|
48 | '[handler_console_sql]': { | |
49 | 'formatter': 'color_formatter_sql', |
|
49 | 'formatter': 'color_formatter_sql', | |
50 | }, |
|
50 | }, | |
51 | }, |
|
51 | }, | |
52 | ), |
|
52 | ), | |
53 | ('development.ini', |
|
53 | ('development.ini', | |
54 | ''' |
|
54 | ''' | |
55 | Kallithea - Development config: |
|
55 | Kallithea - Development config: | |
56 | listening on *:5000 |
|
56 | listening on *:5000 | |
57 | sqlite and kallithea.db |
|
57 | sqlite and kallithea.db | |
58 | initial_repo_scan = true |
|
58 | initial_repo_scan = true | |
59 | debug = true |
|
59 | debug = true | |
60 | verbose and colorful logging |
|
60 | verbose and colorful logging | |
61 | ''', |
|
61 | ''', | |
62 | { |
|
62 | { | |
63 | '[server:main]': { |
|
63 | '[server:main]': { | |
64 | 'host': '0.0.0.0', |
|
64 | 'host': '0.0.0.0', | |
65 | }, |
|
65 | }, | |
66 | '[app:main]': { |
|
66 | '[app:main]': { | |
67 | 'initial_repo_scan': 'true', |
|
67 | 'initial_repo_scan': 'true', | |
68 | 'debug': 'true', |
|
68 | 'debug': 'true', | |
69 | 'app_instance_uuid': 'development-not-secret', |
|
69 | 'app_instance_uuid': 'development-not-secret', | |
70 | 'beaker.session.secret': 'development-not-secret', |
|
70 | 'beaker.session.secret': 'development-not-secret', | |
71 | }, |
|
71 | }, | |
72 | '[handler_console]': { |
|
72 | '[handler_console]': { | |
73 | 'formatter': 'color_formatter', |
|
73 | 'formatter': 'color_formatter', | |
74 | }, |
|
74 | }, | |
75 | '[handler_console_sql]': { |
|
75 | '[handler_console_sql]': { | |
76 | 'formatter': 'color_formatter_sql', |
|
76 | 'formatter': 'color_formatter_sql', | |
77 | }, |
|
77 | }, | |
78 | }, |
|
78 | }, | |
79 | ), |
|
79 | ), | |
80 | ] |
|
80 | ] | |
81 |
|
81 | |||
82 |
|
82 | |||
83 | def main(): |
|
83 | def main(): | |
84 | # make sure all mako lines starting with '#' (the '##' comments) are marked up as <text> |
|
84 | # make sure all mako lines starting with '#' (the '##' comments) are marked up as <text> | |
85 | print 'reading:', makofile |
|
85 | print 'reading:', makofile | |
86 | mako_org = open(makofile).read() |
|
86 | mako_org = open(makofile).read() | |
87 | mako_no_text_markup = re.sub(r'</?%text>', '', mako_org) |
|
87 | mako_no_text_markup = re.sub(r'</?%text>', '', mako_org) | |
88 | mako_marked_up = re.sub(r'\n(##.*)', r'\n<%text>\1</%text>', mako_no_text_markup, flags=re.MULTILINE) |
|
88 | mako_marked_up = re.sub(r'\n(##.*)', r'\n<%text>\1</%text>', mako_no_text_markup, flags=re.MULTILINE) | |
89 | if mako_marked_up != mako_org: |
|
89 | if mako_marked_up != mako_org: | |
90 | print 'writing:', makofile |
|
90 | print 'writing:', makofile | |
91 | open(makofile, 'w').write(mako_marked_up) |
|
91 | open(makofile, 'w').write(mako_marked_up) | |
92 |
|
92 | |||
93 | # create ini files |
|
93 | # create ini files | |
94 | for fn, desc, settings in ini_files: |
|
94 | for fn, desc, settings in ini_files: | |
95 | print 'updating:', fn |
|
95 | print 'updating:', fn | |
96 | ini_lines = inifile.expand(mako_marked_up, desc, mako_variable_values, settings) |
|
96 | ini_lines = inifile.expand(mako_marked_up, desc, mako_variable_values, settings) | |
97 | open(fn, 'w').write(ini_lines) |
|
97 | open(fn, 'w').write(ini_lines) | |
98 |
|
98 | |||
99 | if __name__ == '__main__': |
|
99 | if __name__ == '__main__': | |
100 | main() |
|
100 | main() |
General Comments 0
You need to be logged in to leave comments.
Login now