Show More
@@ -1,470 +1,465 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.enable = false |
|
94 | #i18n.enable = 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 | ## perform a full repository scan on each server start, this should be |
|
|||
102 | ## set to false after first startup, to allow faster server restarts. |
|
|||
103 | #initial_repo_scan = false |
|
|||
104 | initial_repo_scan = true |
|
|||
105 |
|
||||
106 | ## uncomment and set this path to use archive download cache |
|
101 | ## uncomment and set this path to use archive download cache | |
107 | archive_cache_dir = %(here)s/tarballcache |
|
102 | archive_cache_dir = %(here)s/tarballcache | |
108 |
|
103 | |||
109 | ## change this to unique ID for security |
|
104 | ## change this to unique ID for security | |
110 | #app_instance_uuid = VERY-SECRET |
|
105 | #app_instance_uuid = VERY-SECRET | |
111 | app_instance_uuid = development-not-secret |
|
106 | app_instance_uuid = development-not-secret | |
112 |
|
107 | |||
113 | ## cut off limit for large diffs (size in bytes) |
|
108 | ## cut off limit for large diffs (size in bytes) | |
114 | cut_off_limit = 256000 |
|
109 | cut_off_limit = 256000 | |
115 |
|
110 | |||
116 | ## 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 | |
117 | force_https = false |
|
112 | force_https = false | |
118 |
|
113 | |||
119 | ## use Strict-Transport-Security headers |
|
114 | ## use Strict-Transport-Security headers | |
120 | use_htsts = false |
|
115 | use_htsts = false | |
121 |
|
116 | |||
122 | ## number of commits stats will parse on each iteration |
|
117 | ## number of commits stats will parse on each iteration | |
123 | commit_parse_limit = 25 |
|
118 | commit_parse_limit = 25 | |
124 |
|
119 | |||
125 | ## path to git executable |
|
120 | ## path to git executable | |
126 | git_path = git |
|
121 | git_path = git | |
127 |
|
122 | |||
128 | ## git rev filter option, --all is the default filter, if you need to |
|
123 | ## git rev filter option, --all is the default filter, if you need to | |
129 | ## hide all refs in changelog switch this to --branches --tags |
|
124 | ## hide all refs in changelog switch this to --branches --tags | |
130 | #git_rev_filter = --branches --tags |
|
125 | #git_rev_filter = --branches --tags | |
131 |
|
126 | |||
132 | ## RSS feed options |
|
127 | ## RSS feed options | |
133 | rss_cut_off_limit = 256000 |
|
128 | rss_cut_off_limit = 256000 | |
134 | rss_items_per_page = 10 |
|
129 | rss_items_per_page = 10 | |
135 | rss_include_diff = false |
|
130 | rss_include_diff = false | |
136 |
|
131 | |||
137 | ## options for showing and identifying changesets |
|
132 | ## options for showing and identifying changesets | |
138 | show_sha_length = 12 |
|
133 | show_sha_length = 12 | |
139 | show_revision_number = false |
|
134 | show_revision_number = false | |
140 |
|
135 | |||
141 | ## Canonical URL to use when creating full URLs in UI and texts. |
|
136 | ## Canonical URL to use when creating full URLs in UI and texts. | |
142 | ## Useful when the site is available under different names or protocols. |
|
137 | ## Useful when the site is available under different names or protocols. | |
143 | ## Defaults to what is provided in the WSGI environment. |
|
138 | ## Defaults to what is provided in the WSGI environment. | |
144 | #canonical_url = https://kallithea.example.com/repos |
|
139 | #canonical_url = https://kallithea.example.com/repos | |
145 |
|
140 | |||
146 | ## gist URL alias, used to create nicer urls for gist. This should be an |
|
141 | ## gist URL alias, used to create nicer urls for gist. This should be an | |
147 | ## url that does rewrites to _admin/gists/<gistid>. |
|
142 | ## url that does rewrites to _admin/gists/<gistid>. | |
148 | ## example: http://gist.example.com/{gistid}. Empty means use the internal |
|
143 | ## example: http://gist.example.com/{gistid}. Empty means use the internal | |
149 | ## Kallithea url, ie. http[s]://kallithea.example.com/_admin/gists/<gistid> |
|
144 | ## Kallithea url, ie. http[s]://kallithea.example.com/_admin/gists/<gistid> | |
150 | gist_alias_url = |
|
145 | gist_alias_url = | |
151 |
|
146 | |||
152 | ## white list of API enabled controllers. This allows to add list of |
|
147 | ## white list of API enabled controllers. This allows to add list of | |
153 | ## controllers to which access will be enabled by api_key. eg: to enable |
|
148 | ## controllers to which access will be enabled by api_key. eg: to enable | |
154 | ## api access to raw_files put `FilesController:raw`, to enable access to patches |
|
149 | ## api access to raw_files put `FilesController:raw`, to enable access to patches | |
155 | ## add `ChangesetController:changeset_patch`. This list should be "," separated |
|
150 | ## add `ChangesetController:changeset_patch`. This list should be "," separated | |
156 | ## Syntax is <ControllerClass>:<function>. Check debug logs for generated names |
|
151 | ## Syntax is <ControllerClass>:<function>. Check debug logs for generated names | |
157 | ## Recommended settings below are commented out: |
|
152 | ## Recommended settings below are commented out: | |
158 | api_access_controllers_whitelist = |
|
153 | api_access_controllers_whitelist = | |
159 | # ChangesetController:changeset_patch, |
|
154 | # ChangesetController:changeset_patch, | |
160 | # ChangesetController:changeset_raw, |
|
155 | # ChangesetController:changeset_raw, | |
161 | # FilesController:raw, |
|
156 | # FilesController:raw, | |
162 | # FilesController:archivefile |
|
157 | # FilesController:archivefile | |
163 |
|
158 | |||
164 | ## default encoding used to convert from and to unicode |
|
159 | ## default encoding used to convert from and to unicode | |
165 | ## can be also a comma separated list of encoding in case of mixed encodings |
|
160 | ## can be also a comma separated list of encoding in case of mixed encodings | |
166 | default_encoding = utf8 |
|
161 | default_encoding = utf8 | |
167 |
|
162 | |||
168 | ## issue tracker for Kallithea (leave blank to disable, absent for default) |
|
163 | ## issue tracker for Kallithea (leave blank to disable, absent for default) | |
169 | #bugtracker = https://bitbucket.org/conservancy/kallithea/issues |
|
164 | #bugtracker = https://bitbucket.org/conservancy/kallithea/issues | |
170 |
|
165 | |||
171 | ## issue tracking mapping for commit messages, comments, PR descriptions, ... |
|
166 | ## issue tracking mapping for commit messages, comments, PR descriptions, ... | |
172 | ## Refer to the documentation ("Integration with issue trackers") for more details. |
|
167 | ## Refer to the documentation ("Integration with issue trackers") for more details. | |
173 |
|
168 | |||
174 | ## regular expression to match issue references |
|
169 | ## regular expression to match issue references | |
175 | ## This pattern may/should contain parenthesized groups, that can |
|
170 | ## This pattern may/should contain parenthesized groups, that can | |
176 | ## 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 | |
177 | ## (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>)'. | |
178 | ## To require mandatory whitespace before the issue pattern, use: |
|
173 | ## To require mandatory whitespace before the issue pattern, use: | |
179 | ## (?:^|(?<=\s)) before the actual pattern, and for mandatory whitespace |
|
174 | ## (?:^|(?<=\s)) before the actual pattern, and for mandatory whitespace | |
180 | ## behind the issue pattern, use (?:$|(?=\s)) after the actual pattern. |
|
175 | ## behind the issue pattern, use (?:$|(?=\s)) after the actual pattern. | |
181 |
|
176 | |||
182 | issue_pat = #(\d+) |
|
177 | issue_pat = #(\d+) | |
183 |
|
178 | |||
184 | ## server url to the issue |
|
179 | ## server url to the issue | |
185 | ## 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. | |
186 | ## 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 | |
187 | ## called 'groupname' in issue_pat. |
|
182 | ## called 'groupname' in issue_pat. | |
188 | ## The special token {repo} is replaced with the full repository name |
|
183 | ## The special token {repo} is replaced with the full repository name | |
189 | ## including repository groups, while {repo_name} is replaced with just |
|
184 | ## including repository groups, while {repo_name} is replaced with just | |
190 | ## the name of the repository. |
|
185 | ## the name of the repository. | |
191 |
|
186 | |||
192 | issue_server_link = https://issues.example.com/{repo}/issue/\1 |
|
187 | issue_server_link = https://issues.example.com/{repo}/issue/\1 | |
193 |
|
188 | |||
194 | ## substitution pattern to use as the link text |
|
189 | ## substitution pattern to use as the link text | |
195 | ## 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 | |
196 | ## 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 | |
197 | ## backreferences to groups in issue_pat replaced. |
|
192 | ## backreferences to groups in issue_pat replaced. | |
198 |
|
193 | |||
199 | issue_sub = |
|
194 | issue_sub = | |
200 |
|
195 | |||
201 | ## 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 | |
202 | ## multiple patterns, to other issues server, wiki or others |
|
197 | ## multiple patterns, to other issues server, wiki or others | |
203 | ## below an example how to create a wiki pattern |
|
198 | ## below an example how to create a wiki pattern | |
204 | # wiki-some-id -> https://wiki.example.com/some-id |
|
199 | # wiki-some-id -> https://wiki.example.com/some-id | |
205 |
|
200 | |||
206 | #issue_pat_wiki = wiki-(\S+) |
|
201 | #issue_pat_wiki = wiki-(\S+) | |
207 | #issue_server_link_wiki = https://wiki.example.com/\1 |
|
202 | #issue_server_link_wiki = https://wiki.example.com/\1 | |
208 | #issue_sub_wiki = WIKI-\1 |
|
203 | #issue_sub_wiki = WIKI-\1 | |
209 |
|
204 | |||
210 | ## alternative return HTTP header for failed authentication. Default HTTP |
|
205 | ## alternative return HTTP header for failed authentication. Default HTTP | |
211 | ## response is 401 HTTPUnauthorized. Currently Mercurial clients have trouble with |
|
206 | ## response is 401 HTTPUnauthorized. Currently Mercurial clients have trouble with | |
212 | ## handling that. Set this variable to 403 to return HTTPForbidden |
|
207 | ## handling that. Set this variable to 403 to return HTTPForbidden | |
213 | auth_ret_code = |
|
208 | auth_ret_code = | |
214 |
|
209 | |||
215 | ## 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 | |
216 | ## codes don't break the transactions while 4XX codes do |
|
211 | ## codes don't break the transactions while 4XX codes do | |
217 | lock_ret_code = 423 |
|
212 | lock_ret_code = 423 | |
218 |
|
213 | |||
219 | ## allows to change the repository location in settings page |
|
214 | ## allows to change the repository location in settings page | |
220 | allow_repo_location_change = True |
|
215 | allow_repo_location_change = True | |
221 |
|
216 | |||
222 | ## allows to setup custom hooks in settings page |
|
217 | ## allows to setup custom hooks in settings page | |
223 | allow_custom_hooks_settings = True |
|
218 | allow_custom_hooks_settings = True | |
224 |
|
219 | |||
225 | ## extra extensions for indexing, space separated and without the leading '.'. |
|
220 | ## extra extensions for indexing, space separated and without the leading '.'. | |
226 | # index.extensions = |
|
221 | # index.extensions = | |
227 | # gemfile |
|
222 | # gemfile | |
228 | # lock |
|
223 | # lock | |
229 |
|
224 | |||
230 | ## extra filenames for indexing, space separated |
|
225 | ## extra filenames for indexing, space separated | |
231 | # index.filenames = |
|
226 | # index.filenames = | |
232 | # .dockerignore |
|
227 | # .dockerignore | |
233 | # .editorconfig |
|
228 | # .editorconfig | |
234 | # INSTALL |
|
229 | # INSTALL | |
235 | # CHANGELOG |
|
230 | # CHANGELOG | |
236 |
|
231 | |||
237 | #################################### |
|
232 | #################################### | |
238 | ### CELERY CONFIG #### |
|
233 | ### CELERY CONFIG #### | |
239 | #################################### |
|
234 | #################################### | |
240 |
|
235 | |||
241 | use_celery = false |
|
236 | use_celery = false | |
242 |
|
237 | |||
243 | ## Example: connect to the virtual host 'rabbitmqhost' on localhost as rabbitmq: |
|
238 | ## Example: connect to the virtual host 'rabbitmqhost' on localhost as rabbitmq: | |
244 | broker.url = amqp://rabbitmq:qewqew@localhost:5672/rabbitmqhost |
|
239 | broker.url = amqp://rabbitmq:qewqew@localhost:5672/rabbitmqhost | |
245 |
|
240 | |||
246 | celery.imports = kallithea.lib.celerylib.tasks |
|
241 | celery.imports = kallithea.lib.celerylib.tasks | |
247 | celery.accept.content = pickle |
|
242 | celery.accept.content = pickle | |
248 | celery.result.backend = amqp |
|
243 | celery.result.backend = amqp | |
249 | celery.result.dburi = amqp:// |
|
244 | celery.result.dburi = amqp:// | |
250 | celery.result.serialier = json |
|
245 | celery.result.serialier = json | |
251 |
|
246 | |||
252 | #celery.send.task.error.emails = true |
|
247 | #celery.send.task.error.emails = true | |
253 | #celery.amqp.task.result.expires = 18000 |
|
248 | #celery.amqp.task.result.expires = 18000 | |
254 |
|
249 | |||
255 | celeryd.concurrency = 2 |
|
250 | celeryd.concurrency = 2 | |
256 | celeryd.max.tasks.per.child = 1 |
|
251 | celeryd.max.tasks.per.child = 1 | |
257 |
|
252 | |||
258 | ## 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. | |
259 | celery.always.eager = false |
|
254 | celery.always.eager = false | |
260 |
|
255 | |||
261 | #################################### |
|
256 | #################################### | |
262 | ### BEAKER CACHE #### |
|
257 | ### BEAKER CACHE #### | |
263 | #################################### |
|
258 | #################################### | |
264 |
|
259 | |||
265 | beaker.cache.data_dir = %(here)s/data/cache/data |
|
260 | beaker.cache.data_dir = %(here)s/data/cache/data | |
266 | beaker.cache.lock_dir = %(here)s/data/cache/lock |
|
261 | beaker.cache.lock_dir = %(here)s/data/cache/lock | |
267 |
|
262 | |||
268 | beaker.cache.regions = short_term,long_term,sql_cache_short |
|
263 | beaker.cache.regions = short_term,long_term,sql_cache_short | |
269 |
|
264 | |||
270 | beaker.cache.short_term.type = memory |
|
265 | beaker.cache.short_term.type = memory | |
271 | beaker.cache.short_term.expire = 60 |
|
266 | beaker.cache.short_term.expire = 60 | |
272 | beaker.cache.short_term.key_length = 256 |
|
267 | beaker.cache.short_term.key_length = 256 | |
273 |
|
268 | |||
274 | beaker.cache.long_term.type = memory |
|
269 | beaker.cache.long_term.type = memory | |
275 | beaker.cache.long_term.expire = 36000 |
|
270 | beaker.cache.long_term.expire = 36000 | |
276 | beaker.cache.long_term.key_length = 256 |
|
271 | beaker.cache.long_term.key_length = 256 | |
277 |
|
272 | |||
278 | beaker.cache.sql_cache_short.type = memory |
|
273 | beaker.cache.sql_cache_short.type = memory | |
279 | beaker.cache.sql_cache_short.expire = 10 |
|
274 | beaker.cache.sql_cache_short.expire = 10 | |
280 | beaker.cache.sql_cache_short.key_length = 256 |
|
275 | beaker.cache.sql_cache_short.key_length = 256 | |
281 |
|
276 | |||
282 | #################################### |
|
277 | #################################### | |
283 | ### BEAKER SESSION #### |
|
278 | ### BEAKER SESSION #### | |
284 | #################################### |
|
279 | #################################### | |
285 |
|
280 | |||
286 | ## 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 | |
287 | ## 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. | |
288 | beaker.session.key = kallithea |
|
283 | beaker.session.key = kallithea | |
289 | ## 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. | |
290 | beaker.session.httponly = true |
|
285 | beaker.session.httponly = true | |
291 | ## Session lifetime. 2592000 seconds is 30 days. |
|
286 | ## Session lifetime. 2592000 seconds is 30 days. | |
292 | beaker.session.timeout = 2592000 |
|
287 | beaker.session.timeout = 2592000 | |
293 |
|
288 | |||
294 | ## Server secret used with HMAC to ensure integrity of cookies. |
|
289 | ## Server secret used with HMAC to ensure integrity of cookies. | |
295 | #beaker.session.secret = VERY-SECRET |
|
290 | #beaker.session.secret = VERY-SECRET | |
296 | beaker.session.secret = development-not-secret |
|
291 | beaker.session.secret = development-not-secret | |
297 | ## Further, encrypt the data with AES. |
|
292 | ## Further, encrypt the data with AES. | |
298 | #beaker.session.encrypt_key = <key_for_encryption> |
|
293 | #beaker.session.encrypt_key = <key_for_encryption> | |
299 | #beaker.session.validate_key = <validation_key> |
|
294 | #beaker.session.validate_key = <validation_key> | |
300 |
|
295 | |||
301 | ## Type of storage used for the session, current types are |
|
296 | ## Type of storage used for the session, current types are | |
302 | ## dbm, file, memcached, database, and memory. |
|
297 | ## dbm, file, memcached, database, and memory. | |
303 |
|
298 | |||
304 | ## File system storage of session data. (default) |
|
299 | ## File system storage of session data. (default) | |
305 | #beaker.session.type = file |
|
300 | #beaker.session.type = file | |
306 |
|
301 | |||
307 | ## 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. | |
308 | #beaker.session.type = cookie |
|
303 | #beaker.session.type = cookie | |
309 |
|
304 | |||
310 | ## Database storage of session data. |
|
305 | ## Database storage of session data. | |
311 | #beaker.session.type = ext:database |
|
306 | #beaker.session.type = ext:database | |
312 | #beaker.session.sa.url = postgresql://postgres:qwe@localhost/kallithea |
|
307 | #beaker.session.sa.url = postgresql://postgres:qwe@localhost/kallithea | |
313 | #beaker.session.table_name = db_session |
|
308 | #beaker.session.table_name = db_session | |
314 |
|
309 | |||
315 | ################################################################################ |
|
310 | ################################################################################ | |
316 | ## WARNING: *DEBUG MODE MUST BE OFF IN A PRODUCTION ENVIRONMENT* ## |
|
311 | ## WARNING: *DEBUG MODE MUST BE OFF IN A PRODUCTION ENVIRONMENT* ## | |
317 | ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ## |
|
312 | ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ## | |
318 | ## execute malicious code after an exception is raised. ## |
|
313 | ## execute malicious code after an exception is raised. ## | |
319 | ################################################################################ |
|
314 | ################################################################################ | |
320 | #debug = false |
|
315 | #debug = false | |
321 | debug = true |
|
316 | debug = true | |
322 |
|
317 | |||
323 | ################################## |
|
318 | ################################## | |
324 | ### LOGVIEW CONFIG ### |
|
319 | ### LOGVIEW CONFIG ### | |
325 | ################################## |
|
320 | ################################## | |
326 |
|
321 | |||
327 | logview.sqlalchemy = #faa |
|
322 | logview.sqlalchemy = #faa | |
328 | logview.pylons.templating = #bfb |
|
323 | logview.pylons.templating = #bfb | |
329 | logview.pylons.util = #eee |
|
324 | logview.pylons.util = #eee | |
330 |
|
325 | |||
331 | ######################################################### |
|
326 | ######################################################### | |
332 | ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ### |
|
327 | ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ### | |
333 | ######################################################### |
|
328 | ######################################################### | |
334 |
|
329 | |||
335 | # SQLITE [default] |
|
330 | # SQLITE [default] | |
336 | sqlalchemy.url = sqlite:///%(here)s/kallithea.db?timeout=60 |
|
331 | sqlalchemy.url = sqlite:///%(here)s/kallithea.db?timeout=60 | |
337 |
|
332 | |||
338 | # see sqlalchemy docs for others |
|
333 | # see sqlalchemy docs for others | |
339 |
|
334 | |||
340 | sqlalchemy.pool_recycle = 3600 |
|
335 | sqlalchemy.pool_recycle = 3600 | |
341 |
|
336 | |||
342 | ################################ |
|
337 | ################################ | |
343 | ### ALEMBIC CONFIGURATION #### |
|
338 | ### ALEMBIC CONFIGURATION #### | |
344 | ################################ |
|
339 | ################################ | |
345 |
|
340 | |||
346 | [alembic] |
|
341 | [alembic] | |
347 | script_location = kallithea:alembic |
|
342 | script_location = kallithea:alembic | |
348 |
|
343 | |||
349 | ################################ |
|
344 | ################################ | |
350 | ### LOGGING CONFIGURATION #### |
|
345 | ### LOGGING CONFIGURATION #### | |
351 | ################################ |
|
346 | ################################ | |
352 |
|
347 | |||
353 | [loggers] |
|
348 | [loggers] | |
354 | keys = root, routes, kallithea, sqlalchemy, tg, gearbox, beaker, templates, whoosh_indexer, werkzeug, backlash |
|
349 | keys = root, routes, kallithea, sqlalchemy, tg, gearbox, beaker, templates, whoosh_indexer, werkzeug, backlash | |
355 |
|
350 | |||
356 | [handlers] |
|
351 | [handlers] | |
357 | keys = console, console_sql |
|
352 | keys = console, console_sql | |
358 |
|
353 | |||
359 | [formatters] |
|
354 | [formatters] | |
360 | keys = generic, color_formatter, color_formatter_sql |
|
355 | keys = generic, color_formatter, color_formatter_sql | |
361 |
|
356 | |||
362 | ############# |
|
357 | ############# | |
363 | ## LOGGERS ## |
|
358 | ## LOGGERS ## | |
364 | ############# |
|
359 | ############# | |
365 |
|
360 | |||
366 | [logger_root] |
|
361 | [logger_root] | |
367 | level = NOTSET |
|
362 | level = NOTSET | |
368 | handlers = console |
|
363 | handlers = console | |
369 |
|
364 | |||
370 | [logger_routes] |
|
365 | [logger_routes] | |
371 | #level = WARN |
|
366 | #level = WARN | |
372 | level = DEBUG |
|
367 | level = DEBUG | |
373 | handlers = |
|
368 | handlers = | |
374 | qualname = routes.middleware |
|
369 | qualname = routes.middleware | |
375 | ## "level = DEBUG" logs the route matched and routing variables. |
|
370 | ## "level = DEBUG" logs the route matched and routing variables. | |
376 | propagate = 1 |
|
371 | propagate = 1 | |
377 |
|
372 | |||
378 | [logger_beaker] |
|
373 | [logger_beaker] | |
379 | #level = WARN |
|
374 | #level = WARN | |
380 | level = DEBUG |
|
375 | level = DEBUG | |
381 | handlers = |
|
376 | handlers = | |
382 | qualname = beaker.container |
|
377 | qualname = beaker.container | |
383 | propagate = 1 |
|
378 | propagate = 1 | |
384 |
|
379 | |||
385 | [logger_templates] |
|
380 | [logger_templates] | |
386 | #level = WARN |
|
381 | #level = WARN | |
387 | level = INFO |
|
382 | level = INFO | |
388 | handlers = |
|
383 | handlers = | |
389 | qualname = pylons.templating |
|
384 | qualname = pylons.templating | |
390 | propagate = 1 |
|
385 | propagate = 1 | |
391 |
|
386 | |||
392 | [logger_kallithea] |
|
387 | [logger_kallithea] | |
393 | #level = WARN |
|
388 | #level = WARN | |
394 | level = DEBUG |
|
389 | level = DEBUG | |
395 | handlers = |
|
390 | handlers = | |
396 | qualname = kallithea |
|
391 | qualname = kallithea | |
397 | propagate = 1 |
|
392 | propagate = 1 | |
398 |
|
393 | |||
399 | [logger_tg] |
|
394 | [logger_tg] | |
400 | #level = WARN |
|
395 | #level = WARN | |
401 | level = DEBUG |
|
396 | level = DEBUG | |
402 | handlers = |
|
397 | handlers = | |
403 | qualname = tg |
|
398 | qualname = tg | |
404 | propagate = 1 |
|
399 | propagate = 1 | |
405 |
|
400 | |||
406 | [logger_gearbox] |
|
401 | [logger_gearbox] | |
407 | #level = WARN |
|
402 | #level = WARN | |
408 | level = DEBUG |
|
403 | level = DEBUG | |
409 | handlers = |
|
404 | handlers = | |
410 | qualname = gearbox |
|
405 | qualname = gearbox | |
411 | propagate = 1 |
|
406 | propagate = 1 | |
412 |
|
407 | |||
413 | [logger_sqlalchemy] |
|
408 | [logger_sqlalchemy] | |
414 | level = WARN |
|
409 | level = WARN | |
415 | handlers = console_sql |
|
410 | handlers = console_sql | |
416 | qualname = sqlalchemy.engine |
|
411 | qualname = sqlalchemy.engine | |
417 | propagate = 0 |
|
412 | propagate = 0 | |
418 |
|
413 | |||
419 | [logger_whoosh_indexer] |
|
414 | [logger_whoosh_indexer] | |
420 | #level = WARN |
|
415 | #level = WARN | |
421 | level = DEBUG |
|
416 | level = DEBUG | |
422 | handlers = |
|
417 | handlers = | |
423 | qualname = whoosh_indexer |
|
418 | qualname = whoosh_indexer | |
424 | propagate = 1 |
|
419 | propagate = 1 | |
425 |
|
420 | |||
426 | [logger_werkzeug] |
|
421 | [logger_werkzeug] | |
427 | level = WARN |
|
422 | level = WARN | |
428 | handlers = |
|
423 | handlers = | |
429 | qualname = werkzeug |
|
424 | qualname = werkzeug | |
430 | propagate = 1 |
|
425 | propagate = 1 | |
431 |
|
426 | |||
432 | [logger_backlash] |
|
427 | [logger_backlash] | |
433 | level = WARN |
|
428 | level = WARN | |
434 | handlers = |
|
429 | handlers = | |
435 | qualname = backlash |
|
430 | qualname = backlash | |
436 | propagate = 1 |
|
431 | propagate = 1 | |
437 |
|
432 | |||
438 | ############## |
|
433 | ############## | |
439 | ## HANDLERS ## |
|
434 | ## HANDLERS ## | |
440 | ############## |
|
435 | ############## | |
441 |
|
436 | |||
442 | [handler_console] |
|
437 | [handler_console] | |
443 | class = StreamHandler |
|
438 | class = StreamHandler | |
444 | args = (sys.stderr,) |
|
439 | args = (sys.stderr,) | |
445 | #formatter = generic |
|
440 | #formatter = generic | |
446 | formatter = color_formatter |
|
441 | formatter = color_formatter | |
447 |
|
442 | |||
448 | [handler_console_sql] |
|
443 | [handler_console_sql] | |
449 | class = StreamHandler |
|
444 | class = StreamHandler | |
450 | args = (sys.stderr,) |
|
445 | args = (sys.stderr,) | |
451 | #formatter = generic |
|
446 | #formatter = generic | |
452 | formatter = color_formatter_sql |
|
447 | formatter = color_formatter_sql | |
453 |
|
448 | |||
454 | ################ |
|
449 | ################ | |
455 | ## FORMATTERS ## |
|
450 | ## FORMATTERS ## | |
456 | ################ |
|
451 | ################ | |
457 |
|
452 | |||
458 | [formatter_generic] |
|
453 | [formatter_generic] | |
459 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s |
|
454 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s | |
460 | datefmt = %Y-%m-%d %H:%M:%S |
|
455 | datefmt = %Y-%m-%d %H:%M:%S | |
461 |
|
456 | |||
462 | [formatter_color_formatter] |
|
457 | [formatter_color_formatter] | |
463 | class = kallithea.lib.colored_formatter.ColorFormatter |
|
458 | class = kallithea.lib.colored_formatter.ColorFormatter | |
464 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s |
|
459 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s | |
465 | datefmt = %Y-%m-%d %H:%M:%S |
|
460 | datefmt = %Y-%m-%d %H:%M:%S | |
466 |
|
461 | |||
467 | [formatter_color_formatter_sql] |
|
462 | [formatter_color_formatter_sql] | |
468 | class = kallithea.lib.colored_formatter.ColorFormatterSql |
|
463 | class = kallithea.lib.colored_formatter.ColorFormatterSql | |
469 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s |
|
464 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s | |
470 | datefmt = %Y-%m-%d %H:%M:%S |
|
465 | datefmt = %Y-%m-%d %H:%M:%S |
@@ -1,196 +1,192 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 | Global configuration file for TurboGears2 specific settings in Kallithea. |
|
15 | Global configuration file for TurboGears2 specific settings in Kallithea. | |
16 |
|
16 | |||
17 | This file complements the .ini file. |
|
17 | This file complements the .ini file. | |
18 | """ |
|
18 | """ | |
19 |
|
19 | |||
20 | import platform |
|
20 | import platform | |
21 | import os, sys, logging |
|
21 | import os, sys, logging | |
22 |
|
22 | |||
23 | import tg |
|
23 | import tg | |
24 | from tg import hooks |
|
24 | from tg import hooks | |
25 | from tg.configuration import AppConfig |
|
25 | from tg.configuration import AppConfig | |
26 | from tg.support.converters import asbool |
|
26 | from tg.support.converters import asbool | |
27 | import alembic.config |
|
27 | import alembic.config | |
28 | from alembic.script.base import ScriptDirectory |
|
28 | from alembic.script.base import ScriptDirectory | |
29 | from alembic.migration import MigrationContext |
|
29 | from alembic.migration import MigrationContext | |
30 | from sqlalchemy import create_engine |
|
30 | from sqlalchemy import create_engine | |
31 |
|
31 | |||
32 | from kallithea.lib.middleware.https_fixup import HttpsFixup |
|
32 | from kallithea.lib.middleware.https_fixup import HttpsFixup | |
33 | from kallithea.lib.middleware.simplegit import SimpleGit |
|
33 | from kallithea.lib.middleware.simplegit import SimpleGit | |
34 | from kallithea.lib.middleware.simplehg import SimpleHg |
|
34 | from kallithea.lib.middleware.simplehg import SimpleHg | |
35 | from kallithea.lib.auth import set_available_permissions |
|
35 | from kallithea.lib.auth import set_available_permissions | |
36 | from kallithea.lib.utils import load_rcextensions, make_ui, set_app_settings, set_vcs_config, \ |
|
36 | from kallithea.lib.utils import load_rcextensions, make_ui, set_app_settings, set_vcs_config, \ | |
37 | set_indexer_config, check_git_version, repo2db_mapper |
|
37 | set_indexer_config, check_git_version, repo2db_mapper | |
38 | from kallithea.lib.utils2 import str2bool |
|
38 | from kallithea.lib.utils2 import str2bool | |
39 | import kallithea.model.base |
|
39 | import kallithea.model.base | |
40 | from kallithea.model.scm import ScmModel |
|
40 | from kallithea.model.scm import ScmModel | |
41 |
|
41 | |||
42 | import formencode |
|
42 | import formencode | |
43 |
|
43 | |||
44 | log = logging.getLogger(__name__) |
|
44 | log = logging.getLogger(__name__) | |
45 |
|
45 | |||
46 |
|
46 | |||
47 | class KallitheaAppConfig(AppConfig): |
|
47 | class KallitheaAppConfig(AppConfig): | |
48 | # Note: AppConfig has a misleading name, as it's not the application |
|
48 | # Note: AppConfig has a misleading name, as it's not the application | |
49 | # configuration, but the application configurator. The AppConfig values are |
|
49 | # configuration, but the application configurator. The AppConfig values are | |
50 | # used as a template to create the actual configuration, which might |
|
50 | # used as a template to create the actual configuration, which might | |
51 | # overwrite or extend the one provided by the configurator template. |
|
51 | # overwrite or extend the one provided by the configurator template. | |
52 |
|
52 | |||
53 | # To make it clear, AppConfig creates the config and sets into it the same |
|
53 | # To make it clear, AppConfig creates the config and sets into it the same | |
54 | # values that AppConfig itself has. Then the values from the config file and |
|
54 | # values that AppConfig itself has. Then the values from the config file and | |
55 | # gearbox options are loaded and merged into the configuration. Then an |
|
55 | # gearbox options are loaded and merged into the configuration. Then an | |
56 | # after_init_config(conf) method of AppConfig is called for any change that |
|
56 | # after_init_config(conf) method of AppConfig is called for any change that | |
57 | # might depend on options provided by configuration files. |
|
57 | # might depend on options provided by configuration files. | |
58 |
|
58 | |||
59 | def __init__(self): |
|
59 | def __init__(self): | |
60 | super(KallitheaAppConfig, self).__init__() |
|
60 | super(KallitheaAppConfig, self).__init__() | |
61 |
|
61 | |||
62 | self['package'] = kallithea |
|
62 | self['package'] = kallithea | |
63 |
|
63 | |||
64 | self['prefer_toscawidgets2'] = False |
|
64 | self['prefer_toscawidgets2'] = False | |
65 | self['use_toscawidgets'] = False |
|
65 | self['use_toscawidgets'] = False | |
66 |
|
66 | |||
67 | self['renderers'] = [] |
|
67 | self['renderers'] = [] | |
68 |
|
68 | |||
69 | # Enable json in expose |
|
69 | # Enable json in expose | |
70 | self['renderers'].append('json') |
|
70 | self['renderers'].append('json') | |
71 |
|
71 | |||
72 | # Configure template rendering |
|
72 | # Configure template rendering | |
73 | self['renderers'].append('mako') |
|
73 | self['renderers'].append('mako') | |
74 | self['default_renderer'] = 'mako' |
|
74 | self['default_renderer'] = 'mako' | |
75 | self['use_dotted_templatenames'] = False |
|
75 | self['use_dotted_templatenames'] = False | |
76 |
|
76 | |||
77 | # Configure Sessions, store data as JSON to avoid pickle security issues |
|
77 | # Configure Sessions, store data as JSON to avoid pickle security issues | |
78 | self['session.enabled'] = True |
|
78 | self['session.enabled'] = True | |
79 | self['session.data_serializer'] = 'json' |
|
79 | self['session.data_serializer'] = 'json' | |
80 |
|
80 | |||
81 | # Configure the base SQLALchemy Setup |
|
81 | # Configure the base SQLALchemy Setup | |
82 | self['use_sqlalchemy'] = True |
|
82 | self['use_sqlalchemy'] = True | |
83 | self['model'] = kallithea.model.base |
|
83 | self['model'] = kallithea.model.base | |
84 | self['DBSession'] = kallithea.model.meta.Session |
|
84 | self['DBSession'] = kallithea.model.meta.Session | |
85 |
|
85 | |||
86 | # Configure App without an authentication backend. |
|
86 | # Configure App without an authentication backend. | |
87 | self['auth_backend'] = None |
|
87 | self['auth_backend'] = None | |
88 |
|
88 | |||
89 | # Use custom error page for these errors. By default, Turbogears2 does not add |
|
89 | # Use custom error page for these errors. By default, Turbogears2 does not add | |
90 | # 400 in this list. |
|
90 | # 400 in this list. | |
91 | # Explicitly listing all is considered more robust than appending to defaults, |
|
91 | # Explicitly listing all is considered more robust than appending to defaults, | |
92 | # in light of possible future framework changes. |
|
92 | # in light of possible future framework changes. | |
93 | self['errorpage.status_codes'] = [400, 401, 403, 404] |
|
93 | self['errorpage.status_codes'] = [400, 401, 403, 404] | |
94 |
|
94 | |||
95 | # Disable transaction manager -- currently Kallithea takes care of transactions itself |
|
95 | # Disable transaction manager -- currently Kallithea takes care of transactions itself | |
96 | self['tm.enabled'] = False |
|
96 | self['tm.enabled'] = False | |
97 |
|
97 | |||
98 |
|
98 | |||
99 | base_config = KallitheaAppConfig() |
|
99 | base_config = KallitheaAppConfig() | |
100 |
|
100 | |||
101 | # TODO still needed as long as we use pylonslib |
|
101 | # TODO still needed as long as we use pylonslib | |
102 | sys.modules['pylons'] = tg |
|
102 | sys.modules['pylons'] = tg | |
103 |
|
103 | |||
104 | # DebugBar, a debug toolbar for TurboGears2. |
|
104 | # DebugBar, a debug toolbar for TurboGears2. | |
105 | # (https://github.com/TurboGears/tgext.debugbar) |
|
105 | # (https://github.com/TurboGears/tgext.debugbar) | |
106 | # To enable it, install 'tgext.debugbar' and 'kajiki', and run Kallithea with |
|
106 | # To enable it, install 'tgext.debugbar' and 'kajiki', and run Kallithea with | |
107 | # 'debug = true' (not in production!) |
|
107 | # 'debug = true' (not in production!) | |
108 | # See the Kallithea documentation for more information. |
|
108 | # See the Kallithea documentation for more information. | |
109 | try: |
|
109 | try: | |
110 | from tgext.debugbar import enable_debugbar |
|
110 | from tgext.debugbar import enable_debugbar | |
111 | import kajiki # only to check its existence |
|
111 | import kajiki # only to check its existence | |
112 | except ImportError: |
|
112 | except ImportError: | |
113 | pass |
|
113 | pass | |
114 | else: |
|
114 | else: | |
115 | base_config['renderers'].append('kajiki') |
|
115 | base_config['renderers'].append('kajiki') | |
116 | enable_debugbar(base_config) |
|
116 | enable_debugbar(base_config) | |
117 |
|
117 | |||
118 |
|
118 | |||
119 | def setup_configuration(app): |
|
119 | def setup_configuration(app): | |
120 | config = app.config |
|
120 | config = app.config | |
121 |
|
121 | |||
122 | if config.get('ignore_alembic_revision', False): |
|
122 | if config.get('ignore_alembic_revision', False): | |
123 | log.warn('database alembic revision checking is disabled') |
|
123 | log.warn('database alembic revision checking is disabled') | |
124 | else: |
|
124 | else: | |
125 | dbconf = config['sqlalchemy.url'] |
|
125 | dbconf = config['sqlalchemy.url'] | |
126 | alembic_cfg = alembic.config.Config() |
|
126 | alembic_cfg = alembic.config.Config() | |
127 | alembic_cfg.set_main_option('script_location', 'kallithea:alembic') |
|
127 | alembic_cfg.set_main_option('script_location', 'kallithea:alembic') | |
128 | alembic_cfg.set_main_option('sqlalchemy.url', dbconf) |
|
128 | alembic_cfg.set_main_option('sqlalchemy.url', dbconf) | |
129 | script_dir = ScriptDirectory.from_config(alembic_cfg) |
|
129 | script_dir = ScriptDirectory.from_config(alembic_cfg) | |
130 | available_heads = sorted(script_dir.get_heads()) |
|
130 | available_heads = sorted(script_dir.get_heads()) | |
131 |
|
131 | |||
132 | engine = create_engine(dbconf) |
|
132 | engine = create_engine(dbconf) | |
133 | with engine.connect() as conn: |
|
133 | with engine.connect() as conn: | |
134 | context = MigrationContext.configure(conn) |
|
134 | context = MigrationContext.configure(conn) | |
135 | current_heads = sorted(str(s) for s in context.get_current_heads()) |
|
135 | current_heads = sorted(str(s) for s in context.get_current_heads()) | |
136 | if current_heads != available_heads: |
|
136 | if current_heads != available_heads: | |
137 | log.error('Failed to run Kallithea:\n\n' |
|
137 | log.error('Failed to run Kallithea:\n\n' | |
138 | 'The database version does not match the Kallithea version.\n' |
|
138 | 'The database version does not match the Kallithea version.\n' | |
139 | 'Please read the documentation on how to upgrade or downgrade the database.\n' |
|
139 | 'Please read the documentation on how to upgrade or downgrade the database.\n' | |
140 | 'Current database version id(s): %s\n' |
|
140 | 'Current database version id(s): %s\n' | |
141 | 'Expected database version id(s): %s\n' |
|
141 | 'Expected database version id(s): %s\n' | |
142 | 'If you are a developer and you know what you are doing, you can add `ignore_alembic_revision = True` ' |
|
142 | 'If you are a developer and you know what you are doing, you can add `ignore_alembic_revision = True` ' | |
143 | 'to your .ini file to skip the check.\n' % (' '.join(current_heads), ' '.join(available_heads))) |
|
143 | 'to your .ini file to skip the check.\n' % (' '.join(current_heads), ' '.join(available_heads))) | |
144 | sys.exit(1) |
|
144 | sys.exit(1) | |
145 |
|
145 | |||
146 | # store some globals into kallithea |
|
146 | # store some globals into kallithea | |
147 | kallithea.CELERY_ON = str2bool(config['app_conf'].get('use_celery')) |
|
147 | kallithea.CELERY_ON = str2bool(config['app_conf'].get('use_celery')) | |
148 | kallithea.CELERY_EAGER = str2bool(config['app_conf'].get('celery.always.eager')) |
|
148 | kallithea.CELERY_EAGER = str2bool(config['app_conf'].get('celery.always.eager')) | |
149 | kallithea.CONFIG = config |
|
149 | kallithea.CONFIG = config | |
150 |
|
150 | |||
151 | load_rcextensions(root_path=config['here']) |
|
151 | load_rcextensions(root_path=config['here']) | |
152 |
|
152 | |||
153 | set_available_permissions(config) |
|
153 | set_available_permissions(config) | |
154 | repos_path = make_ui('db').configitems('paths')[0][1] |
|
154 | repos_path = make_ui('db').configitems('paths')[0][1] | |
155 | config['base_path'] = repos_path |
|
155 | config['base_path'] = repos_path | |
156 | set_app_settings(config) |
|
156 | set_app_settings(config) | |
157 |
|
157 | |||
158 | instance_id = kallithea.CONFIG.get('instance_id', '*') |
|
158 | instance_id = kallithea.CONFIG.get('instance_id', '*') | |
159 | if instance_id == '*': |
|
159 | if instance_id == '*': | |
160 | instance_id = '%s-%s' % (platform.uname()[1], os.getpid()) |
|
160 | instance_id = '%s-%s' % (platform.uname()[1], os.getpid()) | |
161 | kallithea.CONFIG['instance_id'] = instance_id |
|
161 | kallithea.CONFIG['instance_id'] = instance_id | |
162 |
|
162 | |||
163 | # update kallithea.CONFIG with the meanwhile changed 'config' |
|
163 | # update kallithea.CONFIG with the meanwhile changed 'config' | |
164 | kallithea.CONFIG.update(config) |
|
164 | kallithea.CONFIG.update(config) | |
165 |
|
165 | |||
166 | # configure vcs and indexer libraries (they are supposed to be independent |
|
166 | # configure vcs and indexer libraries (they are supposed to be independent | |
167 | # as much as possible and thus avoid importing tg.config or |
|
167 | # as much as possible and thus avoid importing tg.config or | |
168 | # kallithea.CONFIG). |
|
168 | # kallithea.CONFIG). | |
169 | set_vcs_config(kallithea.CONFIG) |
|
169 | set_vcs_config(kallithea.CONFIG) | |
170 | set_indexer_config(kallithea.CONFIG) |
|
170 | set_indexer_config(kallithea.CONFIG) | |
171 |
|
171 | |||
172 | check_git_version() |
|
172 | check_git_version() | |
173 |
|
173 | |||
174 | if str2bool(config.get('initial_repo_scan', True)): |
|
|||
175 | repo2db_mapper(ScmModel().repo_scan(repos_path), |
|
|||
176 | remove_obsolete=False, install_git_hooks=False) |
|
|||
177 |
|
||||
178 |
|
174 | |||
179 | hooks.register('configure_new_app', setup_configuration) |
|
175 | hooks.register('configure_new_app', setup_configuration) | |
180 |
|
176 | |||
181 |
|
177 | |||
182 | def setup_application(app): |
|
178 | def setup_application(app): | |
183 | config = app.config |
|
179 | config = app.config | |
184 |
|
180 | |||
185 | # we want our low level middleware to get to the request ASAP. We don't |
|
181 | # we want our low level middleware to get to the request ASAP. We don't | |
186 | # need any stack middleware in them - especially no StatusCodeRedirect buffering |
|
182 | # need any stack middleware in them - especially no StatusCodeRedirect buffering | |
187 | app = SimpleHg(app, config) |
|
183 | app = SimpleHg(app, config) | |
188 | app = SimpleGit(app, config) |
|
184 | app = SimpleGit(app, config) | |
189 |
|
185 | |||
190 | # Enable https redirects based on HTTP_X_URL_SCHEME set by proxy |
|
186 | # Enable https redirects based on HTTP_X_URL_SCHEME set by proxy | |
191 | if any(asbool(config.get(x)) for x in ['https_fixup', 'force_https', 'use_htsts']): |
|
187 | if any(asbool(config.get(x)) for x in ['https_fixup', 'force_https', 'use_htsts']): | |
192 | app = HttpsFixup(app, config) |
|
188 | app = HttpsFixup(app, config) | |
193 | return app |
|
189 | return app | |
194 |
|
190 | |||
195 |
|
191 | |||
196 | hooks.register('before_config', setup_application) |
|
192 | hooks.register('before_config', setup_application) |
@@ -1,649 +1,645 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.enable = false |
|
189 | #i18n.enable = 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>## perform a full repository scan on each server start, this should be</%text> |
|
|||
197 | <%text>## set to false after first startup, to allow faster server restarts.</%text> |
|
|||
198 | initial_repo_scan = false |
|
|||
199 |
|
||||
200 | <%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> | |
201 | archive_cache_dir = %(here)s/tarballcache |
|
197 | archive_cache_dir = %(here)s/tarballcache | |
202 |
|
198 | |||
203 | <%text>## change this to unique ID for security</%text> |
|
199 | <%text>## change this to unique ID for security</%text> | |
204 | app_instance_uuid = ${uuid()} |
|
200 | app_instance_uuid = ${uuid()} | |
205 |
|
201 | |||
206 | <%text>## cut off limit for large diffs (size in bytes)</%text> |
|
202 | <%text>## cut off limit for large diffs (size in bytes)</%text> | |
207 | cut_off_limit = 256000 |
|
203 | cut_off_limit = 256000 | |
208 |
|
204 | |||
209 | <%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> | |
210 | force_https = false |
|
206 | force_https = false | |
211 |
|
207 | |||
212 | <%text>## use Strict-Transport-Security headers</%text> |
|
208 | <%text>## use Strict-Transport-Security headers</%text> | |
213 | use_htsts = false |
|
209 | use_htsts = false | |
214 |
|
210 | |||
215 | <%text>## number of commits stats will parse on each iteration</%text> |
|
211 | <%text>## number of commits stats will parse on each iteration</%text> | |
216 | commit_parse_limit = 25 |
|
212 | commit_parse_limit = 25 | |
217 |
|
213 | |||
218 | <%text>## path to git executable</%text> |
|
214 | <%text>## path to git executable</%text> | |
219 | git_path = git |
|
215 | git_path = git | |
220 |
|
216 | |||
221 | <%text>## git rev filter option, --all is the default filter, if you need to</%text> |
|
217 | <%text>## git rev filter option, --all is the default filter, if you need to</%text> | |
222 | <%text>## hide all refs in changelog switch this to --branches --tags</%text> |
|
218 | <%text>## hide all refs in changelog switch this to --branches --tags</%text> | |
223 | #git_rev_filter = --branches --tags |
|
219 | #git_rev_filter = --branches --tags | |
224 |
|
220 | |||
225 | <%text>## RSS feed options</%text> |
|
221 | <%text>## RSS feed options</%text> | |
226 | rss_cut_off_limit = 256000 |
|
222 | rss_cut_off_limit = 256000 | |
227 | rss_items_per_page = 10 |
|
223 | rss_items_per_page = 10 | |
228 | rss_include_diff = false |
|
224 | rss_include_diff = false | |
229 |
|
225 | |||
230 | <%text>## options for showing and identifying changesets</%text> |
|
226 | <%text>## options for showing and identifying changesets</%text> | |
231 | show_sha_length = 12 |
|
227 | show_sha_length = 12 | |
232 | show_revision_number = false |
|
228 | show_revision_number = false | |
233 |
|
229 | |||
234 | <%text>## Canonical URL to use when creating full URLs in UI and texts.</%text> |
|
230 | <%text>## Canonical URL to use when creating full URLs in UI and texts.</%text> | |
235 | <%text>## Useful when the site is available under different names or protocols.</%text> |
|
231 | <%text>## Useful when the site is available under different names or protocols.</%text> | |
236 | <%text>## Defaults to what is provided in the WSGI environment.</%text> |
|
232 | <%text>## Defaults to what is provided in the WSGI environment.</%text> | |
237 | #canonical_url = https://kallithea.example.com/repos |
|
233 | #canonical_url = https://kallithea.example.com/repos | |
238 |
|
234 | |||
239 | <%text>## gist URL alias, used to create nicer urls for gist. This should be an</%text> |
|
235 | <%text>## gist URL alias, used to create nicer urls for gist. This should be an</%text> | |
240 | <%text>## url that does rewrites to _admin/gists/<gistid>.</%text> |
|
236 | <%text>## url that does rewrites to _admin/gists/<gistid>.</%text> | |
241 | <%text>## example: http://gist.example.com/{gistid}. Empty means use the internal</%text> |
|
237 | <%text>## example: http://gist.example.com/{gistid}. Empty means use the internal</%text> | |
242 | <%text>## Kallithea url, ie. http[s]://kallithea.example.com/_admin/gists/<gistid></%text> |
|
238 | <%text>## Kallithea url, ie. http[s]://kallithea.example.com/_admin/gists/<gistid></%text> | |
243 | gist_alias_url = |
|
239 | gist_alias_url = | |
244 |
|
240 | |||
245 | <%text>## white list of API enabled controllers. This allows to add list of</%text> |
|
241 | <%text>## white list of API enabled controllers. This allows to add list of</%text> | |
246 | <%text>## controllers to which access will be enabled by api_key. eg: to enable</%text> |
|
242 | <%text>## controllers to which access will be enabled by api_key. eg: to enable</%text> | |
247 | <%text>## api access to raw_files put `FilesController:raw`, to enable access to patches</%text> |
|
243 | <%text>## api access to raw_files put `FilesController:raw`, to enable access to patches</%text> | |
248 | <%text>## add `ChangesetController:changeset_patch`. This list should be "," separated</%text> |
|
244 | <%text>## add `ChangesetController:changeset_patch`. This list should be "," separated</%text> | |
249 | <%text>## Syntax is <ControllerClass>:<function>. Check debug logs for generated names</%text> |
|
245 | <%text>## Syntax is <ControllerClass>:<function>. Check debug logs for generated names</%text> | |
250 | <%text>## Recommended settings below are commented out:</%text> |
|
246 | <%text>## Recommended settings below are commented out:</%text> | |
251 | api_access_controllers_whitelist = |
|
247 | api_access_controllers_whitelist = | |
252 | # ChangesetController:changeset_patch, |
|
248 | # ChangesetController:changeset_patch, | |
253 | # ChangesetController:changeset_raw, |
|
249 | # ChangesetController:changeset_raw, | |
254 | # FilesController:raw, |
|
250 | # FilesController:raw, | |
255 | # FilesController:archivefile |
|
251 | # FilesController:archivefile | |
256 |
|
252 | |||
257 | <%text>## default encoding used to convert from and to unicode</%text> |
|
253 | <%text>## default encoding used to convert from and to unicode</%text> | |
258 | <%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> | |
259 | default_encoding = utf8 |
|
255 | default_encoding = utf8 | |
260 |
|
256 | |||
261 | <%text>## issue tracker for Kallithea (leave blank to disable, absent for default)</%text> |
|
257 | <%text>## issue tracker for Kallithea (leave blank to disable, absent for default)</%text> | |
262 | #bugtracker = https://bitbucket.org/conservancy/kallithea/issues |
|
258 | #bugtracker = https://bitbucket.org/conservancy/kallithea/issues | |
263 |
|
259 | |||
264 | <%text>## issue tracking mapping for commit messages, comments, PR descriptions, ...</%text> |
|
260 | <%text>## issue tracking mapping for commit messages, comments, PR descriptions, ...</%text> | |
265 | <%text>## Refer to the documentation ("Integration with issue trackers") for more details.</%text> |
|
261 | <%text>## Refer to the documentation ("Integration with issue trackers") for more details.</%text> | |
266 |
|
262 | |||
267 | <%text>## regular expression to match issue references</%text> |
|
263 | <%text>## regular expression to match issue references</%text> | |
268 | <%text>## This pattern may/should contain parenthesized groups, that can</%text> |
|
264 | <%text>## This pattern may/should contain parenthesized groups, that can</%text> | |
269 | <%text>## be referred to in issue_server_link or issue_sub using Python backreferences</%text> |
|
265 | <%text>## be referred to in issue_server_link or issue_sub using Python backreferences</%text> | |
270 | <%text>## (e.g. \1, \2, ...). You can also create named groups with '(?P<groupname>)'.</%text> |
|
266 | <%text>## (e.g. \1, \2, ...). You can also create named groups with '(?P<groupname>)'.</%text> | |
271 | <%text>## To require mandatory whitespace before the issue pattern, use:</%text> |
|
267 | <%text>## To require mandatory whitespace before the issue pattern, use:</%text> | |
272 | <%text>## (?:^|(?<=\s)) before the actual pattern, and for mandatory whitespace</%text> |
|
268 | <%text>## (?:^|(?<=\s)) before the actual pattern, and for mandatory whitespace</%text> | |
273 | <%text>## behind the issue pattern, use (?:$|(?=\s)) after the actual pattern.</%text> |
|
269 | <%text>## behind the issue pattern, use (?:$|(?=\s)) after the actual pattern.</%text> | |
274 |
|
270 | |||
275 | issue_pat = #(\d+) |
|
271 | issue_pat = #(\d+) | |
276 |
|
272 | |||
277 | <%text>## server url to the issue</%text> |
|
273 | <%text>## server url to the issue</%text> | |
278 | <%text>## This pattern may/should contain backreferences to parenthesized groups in issue_pat.</%text> |
|
274 | <%text>## This pattern may/should contain backreferences to parenthesized groups in issue_pat.</%text> | |
279 | <%text>## A backreference can be \1, \2, ... or \g<groupname> if you specified a named group</%text> |
|
275 | <%text>## A backreference can be \1, \2, ... or \g<groupname> if you specified a named group</%text> | |
280 | <%text>## called 'groupname' in issue_pat.</%text> |
|
276 | <%text>## called 'groupname' in issue_pat.</%text> | |
281 | <%text>## The special token {repo} is replaced with the full repository name</%text> |
|
277 | <%text>## The special token {repo} is replaced with the full repository name</%text> | |
282 | <%text>## including repository groups, while {repo_name} is replaced with just</%text> |
|
278 | <%text>## including repository groups, while {repo_name} is replaced with just</%text> | |
283 | <%text>## the name of the repository.</%text> |
|
279 | <%text>## the name of the repository.</%text> | |
284 |
|
280 | |||
285 | issue_server_link = https://issues.example.com/{repo}/issue/\1 |
|
281 | issue_server_link = https://issues.example.com/{repo}/issue/\1 | |
286 |
|
282 | |||
287 | <%text>## substitution pattern to use as the link text</%text> |
|
283 | <%text>## substitution pattern to use as the link text</%text> | |
288 | <%text>## If issue_sub is empty, the text matched by issue_pat is retained verbatim</%text> |
|
284 | <%text>## If issue_sub is empty, the text matched by issue_pat is retained verbatim</%text> | |
289 | <%text>## for the link text. Otherwise, the link text is that of issue_sub, with any</%text> |
|
285 | <%text>## for the link text. Otherwise, the link text is that of issue_sub, with any</%text> | |
290 | <%text>## backreferences to groups in issue_pat replaced.</%text> |
|
286 | <%text>## backreferences to groups in issue_pat replaced.</%text> | |
291 |
|
287 | |||
292 | issue_sub = |
|
288 | issue_sub = | |
293 |
|
289 | |||
294 | <%text>## issue_pat, issue_server_link and issue_sub can have suffixes to specify</%text> |
|
290 | <%text>## issue_pat, issue_server_link and issue_sub can have suffixes to specify</%text> | |
295 | <%text>## multiple patterns, to other issues server, wiki or others</%text> |
|
291 | <%text>## multiple patterns, to other issues server, wiki or others</%text> | |
296 | <%text>## below an example how to create a wiki pattern</%text> |
|
292 | <%text>## below an example how to create a wiki pattern</%text> | |
297 | # wiki-some-id -> https://wiki.example.com/some-id |
|
293 | # wiki-some-id -> https://wiki.example.com/some-id | |
298 |
|
294 | |||
299 | #issue_pat_wiki = wiki-(\S+) |
|
295 | #issue_pat_wiki = wiki-(\S+) | |
300 | #issue_server_link_wiki = https://wiki.example.com/\1 |
|
296 | #issue_server_link_wiki = https://wiki.example.com/\1 | |
301 | #issue_sub_wiki = WIKI-\1 |
|
297 | #issue_sub_wiki = WIKI-\1 | |
302 |
|
298 | |||
303 | <%text>## alternative return HTTP header for failed authentication. Default HTTP</%text> |
|
299 | <%text>## alternative return HTTP header for failed authentication. Default HTTP</%text> | |
304 | <%text>## response is 401 HTTPUnauthorized. Currently Mercurial clients have trouble with</%text> |
|
300 | <%text>## response is 401 HTTPUnauthorized. Currently Mercurial clients have trouble with</%text> | |
305 | <%text>## handling that. Set this variable to 403 to return HTTPForbidden</%text> |
|
301 | <%text>## handling that. Set this variable to 403 to return HTTPForbidden</%text> | |
306 | auth_ret_code = |
|
302 | auth_ret_code = | |
307 |
|
303 | |||
308 | <%text>## locking return code. When repository is locked return this HTTP code. 2XX</%text> |
|
304 | <%text>## locking return code. When repository is locked return this HTTP code. 2XX</%text> | |
309 | <%text>## codes don't break the transactions while 4XX codes do</%text> |
|
305 | <%text>## codes don't break the transactions while 4XX codes do</%text> | |
310 | lock_ret_code = 423 |
|
306 | lock_ret_code = 423 | |
311 |
|
307 | |||
312 | <%text>## allows to change the repository location in settings page</%text> |
|
308 | <%text>## allows to change the repository location in settings page</%text> | |
313 | allow_repo_location_change = True |
|
309 | allow_repo_location_change = True | |
314 |
|
310 | |||
315 | <%text>## allows to setup custom hooks in settings page</%text> |
|
311 | <%text>## allows to setup custom hooks in settings page</%text> | |
316 | allow_custom_hooks_settings = True |
|
312 | allow_custom_hooks_settings = True | |
317 |
|
313 | |||
318 | <%text>## extra extensions for indexing, space separated and without the leading '.'.</%text> |
|
314 | <%text>## extra extensions for indexing, space separated and without the leading '.'.</%text> | |
319 | # index.extensions = |
|
315 | # index.extensions = | |
320 | # gemfile |
|
316 | # gemfile | |
321 | # lock |
|
317 | # lock | |
322 |
|
318 | |||
323 | <%text>## extra filenames for indexing, space separated</%text> |
|
319 | <%text>## extra filenames for indexing, space separated</%text> | |
324 | # index.filenames = |
|
320 | # index.filenames = | |
325 | # .dockerignore |
|
321 | # .dockerignore | |
326 | # .editorconfig |
|
322 | # .editorconfig | |
327 | # INSTALL |
|
323 | # INSTALL | |
328 | # CHANGELOG |
|
324 | # CHANGELOG | |
329 |
|
325 | |||
330 | <%text>####################################</%text> |
|
326 | <%text>####################################</%text> | |
331 | <%text>### CELERY CONFIG ####</%text> |
|
327 | <%text>### CELERY CONFIG ####</%text> | |
332 | <%text>####################################</%text> |
|
328 | <%text>####################################</%text> | |
333 |
|
329 | |||
334 | use_celery = false |
|
330 | use_celery = false | |
335 |
|
331 | |||
336 | <%text>## Example: connect to the virtual host 'rabbitmqhost' on localhost as rabbitmq:</%text> |
|
332 | <%text>## Example: connect to the virtual host 'rabbitmqhost' on localhost as rabbitmq:</%text> | |
337 | broker.url = amqp://rabbitmq:qewqew@localhost:5672/rabbitmqhost |
|
333 | broker.url = amqp://rabbitmq:qewqew@localhost:5672/rabbitmqhost | |
338 |
|
334 | |||
339 | celery.imports = kallithea.lib.celerylib.tasks |
|
335 | celery.imports = kallithea.lib.celerylib.tasks | |
340 | celery.accept.content = pickle |
|
336 | celery.accept.content = pickle | |
341 | celery.result.backend = amqp |
|
337 | celery.result.backend = amqp | |
342 | celery.result.dburi = amqp:// |
|
338 | celery.result.dburi = amqp:// | |
343 | celery.result.serialier = json |
|
339 | celery.result.serialier = json | |
344 |
|
340 | |||
345 | #celery.send.task.error.emails = true |
|
341 | #celery.send.task.error.emails = true | |
346 | #celery.amqp.task.result.expires = 18000 |
|
342 | #celery.amqp.task.result.expires = 18000 | |
347 |
|
343 | |||
348 | celeryd.concurrency = 2 |
|
344 | celeryd.concurrency = 2 | |
349 | celeryd.max.tasks.per.child = 1 |
|
345 | celeryd.max.tasks.per.child = 1 | |
350 |
|
346 | |||
351 | <%text>## If true, tasks will never be sent to the queue, but executed locally instead.</%text> |
|
347 | <%text>## If true, tasks will never be sent to the queue, but executed locally instead.</%text> | |
352 | celery.always.eager = false |
|
348 | celery.always.eager = false | |
353 |
|
349 | |||
354 | <%text>####################################</%text> |
|
350 | <%text>####################################</%text> | |
355 | <%text>### BEAKER CACHE ####</%text> |
|
351 | <%text>### BEAKER CACHE ####</%text> | |
356 | <%text>####################################</%text> |
|
352 | <%text>####################################</%text> | |
357 |
|
353 | |||
358 | beaker.cache.data_dir = %(here)s/data/cache/data |
|
354 | beaker.cache.data_dir = %(here)s/data/cache/data | |
359 | beaker.cache.lock_dir = %(here)s/data/cache/lock |
|
355 | beaker.cache.lock_dir = %(here)s/data/cache/lock | |
360 |
|
356 | |||
361 | beaker.cache.regions = short_term,long_term,sql_cache_short |
|
357 | beaker.cache.regions = short_term,long_term,sql_cache_short | |
362 |
|
358 | |||
363 | beaker.cache.short_term.type = memory |
|
359 | beaker.cache.short_term.type = memory | |
364 | beaker.cache.short_term.expire = 60 |
|
360 | beaker.cache.short_term.expire = 60 | |
365 | beaker.cache.short_term.key_length = 256 |
|
361 | beaker.cache.short_term.key_length = 256 | |
366 |
|
362 | |||
367 | beaker.cache.long_term.type = memory |
|
363 | beaker.cache.long_term.type = memory | |
368 | beaker.cache.long_term.expire = 36000 |
|
364 | beaker.cache.long_term.expire = 36000 | |
369 | beaker.cache.long_term.key_length = 256 |
|
365 | beaker.cache.long_term.key_length = 256 | |
370 |
|
366 | |||
371 | beaker.cache.sql_cache_short.type = memory |
|
367 | beaker.cache.sql_cache_short.type = memory | |
372 | beaker.cache.sql_cache_short.expire = 10 |
|
368 | beaker.cache.sql_cache_short.expire = 10 | |
373 | beaker.cache.sql_cache_short.key_length = 256 |
|
369 | beaker.cache.sql_cache_short.key_length = 256 | |
374 |
|
370 | |||
375 | <%text>####################################</%text> |
|
371 | <%text>####################################</%text> | |
376 | <%text>### BEAKER SESSION ####</%text> |
|
372 | <%text>### BEAKER SESSION ####</%text> | |
377 | <%text>####################################</%text> |
|
373 | <%text>####################################</%text> | |
378 |
|
374 | |||
379 | <%text>## Name of session cookie. Should be unique for a given host and path, even when running</%text> |
|
375 | <%text>## Name of session cookie. Should be unique for a given host and path, even when running</%text> | |
380 | <%text>## on different ports. Otherwise, cookie sessions will be shared and messed up.</%text> |
|
376 | <%text>## on different ports. Otherwise, cookie sessions will be shared and messed up.</%text> | |
381 | beaker.session.key = kallithea |
|
377 | beaker.session.key = kallithea | |
382 | <%text>## Sessions should always only be accessible by the browser, not directly by JavaScript.</%text> |
|
378 | <%text>## Sessions should always only be accessible by the browser, not directly by JavaScript.</%text> | |
383 | beaker.session.httponly = true |
|
379 | beaker.session.httponly = true | |
384 | <%text>## Session lifetime. 2592000 seconds is 30 days.</%text> |
|
380 | <%text>## Session lifetime. 2592000 seconds is 30 days.</%text> | |
385 | beaker.session.timeout = 2592000 |
|
381 | beaker.session.timeout = 2592000 | |
386 |
|
382 | |||
387 | <%text>## Server secret used with HMAC to ensure integrity of cookies.</%text> |
|
383 | <%text>## Server secret used with HMAC to ensure integrity of cookies.</%text> | |
388 | beaker.session.secret = ${uuid()} |
|
384 | beaker.session.secret = ${uuid()} | |
389 | <%text>## Further, encrypt the data with AES.</%text> |
|
385 | <%text>## Further, encrypt the data with AES.</%text> | |
390 | #beaker.session.encrypt_key = <key_for_encryption> |
|
386 | #beaker.session.encrypt_key = <key_for_encryption> | |
391 | #beaker.session.validate_key = <validation_key> |
|
387 | #beaker.session.validate_key = <validation_key> | |
392 |
|
388 | |||
393 | <%text>## Type of storage used for the session, current types are</%text> |
|
389 | <%text>## Type of storage used for the session, current types are</%text> | |
394 | <%text>## dbm, file, memcached, database, and memory.</%text> |
|
390 | <%text>## dbm, file, memcached, database, and memory.</%text> | |
395 |
|
391 | |||
396 | <%text>## File system storage of session data. (default)</%text> |
|
392 | <%text>## File system storage of session data. (default)</%text> | |
397 | #beaker.session.type = file |
|
393 | #beaker.session.type = file | |
398 |
|
394 | |||
399 | <%text>## Cookie only, store all session data inside the cookie. Requires secure secrets.</%text> |
|
395 | <%text>## Cookie only, store all session data inside the cookie. Requires secure secrets.</%text> | |
400 | #beaker.session.type = cookie |
|
396 | #beaker.session.type = cookie | |
401 |
|
397 | |||
402 | <%text>## Database storage of session data.</%text> |
|
398 | <%text>## Database storage of session data.</%text> | |
403 | #beaker.session.type = ext:database |
|
399 | #beaker.session.type = ext:database | |
404 | #beaker.session.sa.url = postgresql://postgres:qwe@localhost/kallithea |
|
400 | #beaker.session.sa.url = postgresql://postgres:qwe@localhost/kallithea | |
405 | #beaker.session.table_name = db_session |
|
401 | #beaker.session.table_name = db_session | |
406 |
|
402 | |||
407 | %if error_aggregation_service == 'appenlight': |
|
403 | %if error_aggregation_service == 'appenlight': | |
408 | <%text>############################</%text> |
|
404 | <%text>############################</%text> | |
409 | <%text>## ERROR HANDLING SYSTEMS ##</%text> |
|
405 | <%text>## ERROR HANDLING SYSTEMS ##</%text> | |
410 | <%text>############################</%text> |
|
406 | <%text>############################</%text> | |
411 |
|
407 | |||
412 | # Propagate email settings to ErrorReporter of TurboGears2 |
|
408 | # Propagate email settings to ErrorReporter of TurboGears2 | |
413 | # You do not normally need to change these lines |
|
409 | # You do not normally need to change these lines | |
414 | get trace_errors.error_email = email_to |
|
410 | get trace_errors.error_email = email_to | |
415 | get trace_errors.smtp_server = smtp_server |
|
411 | get trace_errors.smtp_server = smtp_server | |
416 | get trace_errors.smtp_port = smtp_port |
|
412 | get trace_errors.smtp_port = smtp_port | |
417 | get trace_errors.from_address = error_email_from |
|
413 | get trace_errors.from_address = error_email_from | |
418 |
|
414 | |||
419 | <%text>####################</%text> |
|
415 | <%text>####################</%text> | |
420 | <%text>### [appenlight] ###</%text> |
|
416 | <%text>### [appenlight] ###</%text> | |
421 | <%text>####################</%text> |
|
417 | <%text>####################</%text> | |
422 |
|
418 | |||
423 | <%text>## AppEnlight is tailored to work with Kallithea, see</%text> |
|
419 | <%text>## AppEnlight is tailored to work with Kallithea, see</%text> | |
424 | <%text>## http://appenlight.com for details how to obtain an account</%text> |
|
420 | <%text>## http://appenlight.com for details how to obtain an account</%text> | |
425 | <%text>## you must install python package `appenlight_client` to make it work</%text> |
|
421 | <%text>## you must install python package `appenlight_client` to make it work</%text> | |
426 |
|
422 | |||
427 | <%text>## appenlight enabled</%text> |
|
423 | <%text>## appenlight enabled</%text> | |
428 | appenlight = false |
|
424 | appenlight = false | |
429 |
|
425 | |||
430 | appenlight.server_url = https://api.appenlight.com |
|
426 | appenlight.server_url = https://api.appenlight.com | |
431 | appenlight.api_key = YOUR_API_KEY |
|
427 | appenlight.api_key = YOUR_API_KEY | |
432 |
|
428 | |||
433 | <%text>## TWEAK AMOUNT OF INFO SENT HERE</%text> |
|
429 | <%text>## TWEAK AMOUNT OF INFO SENT HERE</%text> | |
434 |
|
430 | |||
435 | <%text>## enables 404 error logging (default False)</%text> |
|
431 | <%text>## enables 404 error logging (default False)</%text> | |
436 | appenlight.report_404 = false |
|
432 | appenlight.report_404 = false | |
437 |
|
433 | |||
438 | <%text>## time in seconds after request is considered being slow (default 1)</%text> |
|
434 | <%text>## time in seconds after request is considered being slow (default 1)</%text> | |
439 | appenlight.slow_request_time = 1 |
|
435 | appenlight.slow_request_time = 1 | |
440 |
|
436 | |||
441 | <%text>## record slow requests in application</%text> |
|
437 | <%text>## record slow requests in application</%text> | |
442 | <%text>## (needs to be enabled for slow datastore recording and time tracking)</%text> |
|
438 | <%text>## (needs to be enabled for slow datastore recording and time tracking)</%text> | |
443 | appenlight.slow_requests = true |
|
439 | appenlight.slow_requests = true | |
444 |
|
440 | |||
445 | <%text>## enable hooking to application loggers</%text> |
|
441 | <%text>## enable hooking to application loggers</%text> | |
446 | #appenlight.logging = true |
|
442 | #appenlight.logging = true | |
447 |
|
443 | |||
448 | <%text>## minimum log level for log capture</%text> |
|
444 | <%text>## minimum log level for log capture</%text> | |
449 | #appenlight.logging.level = WARNING |
|
445 | #appenlight.logging.level = WARNING | |
450 |
|
446 | |||
451 | <%text>## send logs only from erroneous/slow requests</%text> |
|
447 | <%text>## send logs only from erroneous/slow requests</%text> | |
452 | <%text>## (saves API quota for intensive logging)</%text> |
|
448 | <%text>## (saves API quota for intensive logging)</%text> | |
453 | appenlight.logging_on_error = false |
|
449 | appenlight.logging_on_error = false | |
454 |
|
450 | |||
455 | <%text>## list of additional keywords that should be grabbed from environ object</%text> |
|
451 | <%text>## list of additional keywords that should be grabbed from environ object</%text> | |
456 | <%text>## can be string with comma separated list of words in lowercase</%text> |
|
452 | <%text>## can be string with comma separated list of words in lowercase</%text> | |
457 | <%text>## (by default client will always send following info:</%text> |
|
453 | <%text>## (by default client will always send following info:</%text> | |
458 | <%text>## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that</%text> |
|
454 | <%text>## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that</%text> | |
459 | <%text>## start with HTTP* this list be extended with additional keywords here</%text> |
|
455 | <%text>## start with HTTP* this list be extended with additional keywords here</%text> | |
460 | appenlight.environ_keys_whitelist = |
|
456 | appenlight.environ_keys_whitelist = | |
461 |
|
457 | |||
462 | <%text>## list of keywords that should be blanked from request object</%text> |
|
458 | <%text>## list of keywords that should be blanked from request object</%text> | |
463 | <%text>## can be string with comma separated list of words in lowercase</%text> |
|
459 | <%text>## can be string with comma separated list of words in lowercase</%text> | |
464 | <%text>## (by default client will always blank keys that contain following words</%text> |
|
460 | <%text>## (by default client will always blank keys that contain following words</%text> | |
465 | <%text>## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'</%text> |
|
461 | <%text>## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'</%text> | |
466 | <%text>## this list be extended with additional keywords set here</%text> |
|
462 | <%text>## this list be extended with additional keywords set here</%text> | |
467 | appenlight.request_keys_blacklist = |
|
463 | appenlight.request_keys_blacklist = | |
468 |
|
464 | |||
469 | <%text>## list of namespaces that should be ignores when gathering log entries</%text> |
|
465 | <%text>## list of namespaces that should be ignores when gathering log entries</%text> | |
470 | <%text>## can be string with comma separated list of namespaces</%text> |
|
466 | <%text>## can be string with comma separated list of namespaces</%text> | |
471 | <%text>## (by default the client ignores own entries: appenlight_client.client)</%text> |
|
467 | <%text>## (by default the client ignores own entries: appenlight_client.client)</%text> | |
472 | appenlight.log_namespace_blacklist = |
|
468 | appenlight.log_namespace_blacklist = | |
473 |
|
469 | |||
474 | %elif error_aggregation_service == 'sentry': |
|
470 | %elif error_aggregation_service == 'sentry': | |
475 | <%text>################</%text> |
|
471 | <%text>################</%text> | |
476 | <%text>### [sentry] ###</%text> |
|
472 | <%text>### [sentry] ###</%text> | |
477 | <%text>################</%text> |
|
473 | <%text>################</%text> | |
478 |
|
474 | |||
479 | <%text>## sentry is a alternative open source error aggregator</%text> |
|
475 | <%text>## sentry is a alternative open source error aggregator</%text> | |
480 | <%text>## you must install python packages `sentry` and `raven` to enable</%text> |
|
476 | <%text>## you must install python packages `sentry` and `raven` to enable</%text> | |
481 |
|
477 | |||
482 | sentry.dsn = YOUR_DNS |
|
478 | sentry.dsn = YOUR_DNS | |
483 | sentry.servers = |
|
479 | sentry.servers = | |
484 | sentry.name = |
|
480 | sentry.name = | |
485 | sentry.key = |
|
481 | sentry.key = | |
486 | sentry.public_key = |
|
482 | sentry.public_key = | |
487 | sentry.secret_key = |
|
483 | sentry.secret_key = | |
488 | sentry.project = |
|
484 | sentry.project = | |
489 | sentry.site = |
|
485 | sentry.site = | |
490 | sentry.include_paths = |
|
486 | sentry.include_paths = | |
491 | sentry.exclude_paths = |
|
487 | sentry.exclude_paths = | |
492 |
|
488 | |||
493 | %endif |
|
489 | %endif | |
494 | <%text>################################################################################</%text> |
|
490 | <%text>################################################################################</%text> | |
495 | <%text>## WARNING: *DEBUG MODE MUST BE OFF IN A PRODUCTION ENVIRONMENT* ##</%text> |
|
491 | <%text>## WARNING: *DEBUG MODE MUST BE OFF IN A PRODUCTION ENVIRONMENT* ##</%text> | |
496 | <%text>## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##</%text> |
|
492 | <%text>## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##</%text> | |
497 | <%text>## execute malicious code after an exception is raised. ##</%text> |
|
493 | <%text>## execute malicious code after an exception is raised. ##</%text> | |
498 | <%text>################################################################################</%text> |
|
494 | <%text>################################################################################</%text> | |
499 | debug = false |
|
495 | debug = false | |
500 |
|
496 | |||
501 | <%text>##################################</%text> |
|
497 | <%text>##################################</%text> | |
502 | <%text>### LOGVIEW CONFIG ###</%text> |
|
498 | <%text>### LOGVIEW CONFIG ###</%text> | |
503 | <%text>##################################</%text> |
|
499 | <%text>##################################</%text> | |
504 |
|
500 | |||
505 | logview.sqlalchemy = #faa |
|
501 | logview.sqlalchemy = #faa | |
506 | logview.pylons.templating = #bfb |
|
502 | logview.pylons.templating = #bfb | |
507 | logview.pylons.util = #eee |
|
503 | logview.pylons.util = #eee | |
508 |
|
504 | |||
509 | <%text>#########################################################</%text> |
|
505 | <%text>#########################################################</%text> | |
510 | <%text>### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###</%text> |
|
506 | <%text>### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###</%text> | |
511 | <%text>#########################################################</%text> |
|
507 | <%text>#########################################################</%text> | |
512 |
|
508 | |||
513 | %if database_engine == 'sqlite': |
|
509 | %if database_engine == 'sqlite': | |
514 | # SQLITE [default] |
|
510 | # SQLITE [default] | |
515 | sqlalchemy.url = sqlite:///%(here)s/kallithea.db?timeout=60 |
|
511 | sqlalchemy.url = sqlite:///%(here)s/kallithea.db?timeout=60 | |
516 |
|
512 | |||
517 | %elif database_engine == 'postgres': |
|
513 | %elif database_engine == 'postgres': | |
518 | # POSTGRESQL |
|
514 | # POSTGRESQL | |
519 | sqlalchemy.url = postgresql://user:pass@localhost/kallithea |
|
515 | sqlalchemy.url = postgresql://user:pass@localhost/kallithea | |
520 |
|
516 | |||
521 | %elif database_engine == 'mysql': |
|
517 | %elif database_engine == 'mysql': | |
522 | # MySQL |
|
518 | # MySQL | |
523 | sqlalchemy.url = mysql://user:pass@localhost/kallithea?charset=utf8 |
|
519 | sqlalchemy.url = mysql://user:pass@localhost/kallithea?charset=utf8 | |
524 |
|
520 | |||
525 | %endif |
|
521 | %endif | |
526 | # see sqlalchemy docs for others |
|
522 | # see sqlalchemy docs for others | |
527 |
|
523 | |||
528 | sqlalchemy.pool_recycle = 3600 |
|
524 | sqlalchemy.pool_recycle = 3600 | |
529 |
|
525 | |||
530 | <%text>################################</%text> |
|
526 | <%text>################################</%text> | |
531 | <%text>### ALEMBIC CONFIGURATION ####</%text> |
|
527 | <%text>### ALEMBIC CONFIGURATION ####</%text> | |
532 | <%text>################################</%text> |
|
528 | <%text>################################</%text> | |
533 |
|
529 | |||
534 | [alembic] |
|
530 | [alembic] | |
535 | script_location = kallithea:alembic |
|
531 | script_location = kallithea:alembic | |
536 |
|
532 | |||
537 | <%text>################################</%text> |
|
533 | <%text>################################</%text> | |
538 | <%text>### LOGGING CONFIGURATION ####</%text> |
|
534 | <%text>### LOGGING CONFIGURATION ####</%text> | |
539 | <%text>################################</%text> |
|
535 | <%text>################################</%text> | |
540 |
|
536 | |||
541 | [loggers] |
|
537 | [loggers] | |
542 | keys = root, routes, kallithea, sqlalchemy, tg, gearbox, beaker, templates, whoosh_indexer, werkzeug, backlash |
|
538 | keys = root, routes, kallithea, sqlalchemy, tg, gearbox, beaker, templates, whoosh_indexer, werkzeug, backlash | |
543 |
|
539 | |||
544 | [handlers] |
|
540 | [handlers] | |
545 | keys = console, console_sql |
|
541 | keys = console, console_sql | |
546 |
|
542 | |||
547 | [formatters] |
|
543 | [formatters] | |
548 | keys = generic, color_formatter, color_formatter_sql |
|
544 | keys = generic, color_formatter, color_formatter_sql | |
549 |
|
545 | |||
550 | <%text>#############</%text> |
|
546 | <%text>#############</%text> | |
551 | <%text>## LOGGERS ##</%text> |
|
547 | <%text>## LOGGERS ##</%text> | |
552 | <%text>#############</%text> |
|
548 | <%text>#############</%text> | |
553 |
|
549 | |||
554 | [logger_root] |
|
550 | [logger_root] | |
555 | level = NOTSET |
|
551 | level = NOTSET | |
556 | handlers = console |
|
552 | handlers = console | |
557 |
|
553 | |||
558 | [logger_routes] |
|
554 | [logger_routes] | |
559 | level = WARN |
|
555 | level = WARN | |
560 | handlers = |
|
556 | handlers = | |
561 | qualname = routes.middleware |
|
557 | qualname = routes.middleware | |
562 | <%text>## "level = DEBUG" logs the route matched and routing variables.</%text> |
|
558 | <%text>## "level = DEBUG" logs the route matched and routing variables.</%text> | |
563 | propagate = 1 |
|
559 | propagate = 1 | |
564 |
|
560 | |||
565 | [logger_beaker] |
|
561 | [logger_beaker] | |
566 | level = WARN |
|
562 | level = WARN | |
567 | handlers = |
|
563 | handlers = | |
568 | qualname = beaker.container |
|
564 | qualname = beaker.container | |
569 | propagate = 1 |
|
565 | propagate = 1 | |
570 |
|
566 | |||
571 | [logger_templates] |
|
567 | [logger_templates] | |
572 | level = WARN |
|
568 | level = WARN | |
573 | handlers = |
|
569 | handlers = | |
574 | qualname = pylons.templating |
|
570 | qualname = pylons.templating | |
575 | propagate = 1 |
|
571 | propagate = 1 | |
576 |
|
572 | |||
577 | [logger_kallithea] |
|
573 | [logger_kallithea] | |
578 | level = WARN |
|
574 | level = WARN | |
579 | handlers = |
|
575 | handlers = | |
580 | qualname = kallithea |
|
576 | qualname = kallithea | |
581 | propagate = 1 |
|
577 | propagate = 1 | |
582 |
|
578 | |||
583 | [logger_tg] |
|
579 | [logger_tg] | |
584 | level = WARN |
|
580 | level = WARN | |
585 | handlers = |
|
581 | handlers = | |
586 | qualname = tg |
|
582 | qualname = tg | |
587 | propagate = 1 |
|
583 | propagate = 1 | |
588 |
|
584 | |||
589 | [logger_gearbox] |
|
585 | [logger_gearbox] | |
590 | level = WARN |
|
586 | level = WARN | |
591 | handlers = |
|
587 | handlers = | |
592 | qualname = gearbox |
|
588 | qualname = gearbox | |
593 | propagate = 1 |
|
589 | propagate = 1 | |
594 |
|
590 | |||
595 | [logger_sqlalchemy] |
|
591 | [logger_sqlalchemy] | |
596 | level = WARN |
|
592 | level = WARN | |
597 | handlers = console_sql |
|
593 | handlers = console_sql | |
598 | qualname = sqlalchemy.engine |
|
594 | qualname = sqlalchemy.engine | |
599 | propagate = 0 |
|
595 | propagate = 0 | |
600 |
|
596 | |||
601 | [logger_whoosh_indexer] |
|
597 | [logger_whoosh_indexer] | |
602 | level = WARN |
|
598 | level = WARN | |
603 | handlers = |
|
599 | handlers = | |
604 | qualname = whoosh_indexer |
|
600 | qualname = whoosh_indexer | |
605 | propagate = 1 |
|
601 | propagate = 1 | |
606 |
|
602 | |||
607 | [logger_werkzeug] |
|
603 | [logger_werkzeug] | |
608 | level = WARN |
|
604 | level = WARN | |
609 | handlers = |
|
605 | handlers = | |
610 | qualname = werkzeug |
|
606 | qualname = werkzeug | |
611 | propagate = 1 |
|
607 | propagate = 1 | |
612 |
|
608 | |||
613 | [logger_backlash] |
|
609 | [logger_backlash] | |
614 | level = WARN |
|
610 | level = WARN | |
615 | handlers = |
|
611 | handlers = | |
616 | qualname = backlash |
|
612 | qualname = backlash | |
617 | propagate = 1 |
|
613 | propagate = 1 | |
618 |
|
614 | |||
619 | <%text>##############</%text> |
|
615 | <%text>##############</%text> | |
620 | <%text>## HANDLERS ##</%text> |
|
616 | <%text>## HANDLERS ##</%text> | |
621 | <%text>##############</%text> |
|
617 | <%text>##############</%text> | |
622 |
|
618 | |||
623 | [handler_console] |
|
619 | [handler_console] | |
624 | class = StreamHandler |
|
620 | class = StreamHandler | |
625 | args = (sys.stderr,) |
|
621 | args = (sys.stderr,) | |
626 | formatter = generic |
|
622 | formatter = generic | |
627 |
|
623 | |||
628 | [handler_console_sql] |
|
624 | [handler_console_sql] | |
629 | class = StreamHandler |
|
625 | class = StreamHandler | |
630 | args = (sys.stderr,) |
|
626 | args = (sys.stderr,) | |
631 | formatter = generic |
|
627 | formatter = generic | |
632 |
|
628 | |||
633 | <%text>################</%text> |
|
629 | <%text>################</%text> | |
634 | <%text>## FORMATTERS ##</%text> |
|
630 | <%text>## FORMATTERS ##</%text> | |
635 | <%text>################</%text> |
|
631 | <%text>################</%text> | |
636 |
|
632 | |||
637 | [formatter_generic] |
|
633 | [formatter_generic] | |
638 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s |
|
634 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s | |
639 | datefmt = %Y-%m-%d %H:%M:%S |
|
635 | datefmt = %Y-%m-%d %H:%M:%S | |
640 |
|
636 | |||
641 | [formatter_color_formatter] |
|
637 | [formatter_color_formatter] | |
642 | class = kallithea.lib.colored_formatter.ColorFormatter |
|
638 | class = kallithea.lib.colored_formatter.ColorFormatter | |
643 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s |
|
639 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s | |
644 | datefmt = %Y-%m-%d %H:%M:%S |
|
640 | datefmt = %Y-%m-%d %H:%M:%S | |
645 |
|
641 | |||
646 | [formatter_color_formatter_sql] |
|
642 | [formatter_color_formatter_sql] | |
647 | class = kallithea.lib.colored_formatter.ColorFormatterSql |
|
643 | class = kallithea.lib.colored_formatter.ColorFormatterSql | |
648 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s |
|
644 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s | |
649 | datefmt = %Y-%m-%d %H:%M:%S |
|
645 | datefmt = %Y-%m-%d %H:%M:%S |
@@ -1,75 +1,74 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 | # files to be generated from the mako template |
|
12 | # files to be generated from the mako template | |
13 | ini_files = [ |
|
13 | ini_files = [ | |
14 | ('development.ini', |
|
14 | ('development.ini', | |
15 | { |
|
15 | { | |
16 | '[server:main]': { |
|
16 | '[server:main]': { | |
17 | 'host': '0.0.0.0', |
|
17 | 'host': '0.0.0.0', | |
18 | }, |
|
18 | }, | |
19 | '[app:main]': { |
|
19 | '[app:main]': { | |
20 | 'initial_repo_scan': 'true', |
|
|||
21 | 'debug': 'true', |
|
20 | 'debug': 'true', | |
22 | 'app_instance_uuid': 'development-not-secret', |
|
21 | 'app_instance_uuid': 'development-not-secret', | |
23 | 'beaker.session.secret': 'development-not-secret', |
|
22 | 'beaker.session.secret': 'development-not-secret', | |
24 | }, |
|
23 | }, | |
25 | '[handler_console]': { |
|
24 | '[handler_console]': { | |
26 | 'formatter': 'color_formatter', |
|
25 | 'formatter': 'color_formatter', | |
27 | }, |
|
26 | }, | |
28 | '[handler_console_sql]': { |
|
27 | '[handler_console_sql]': { | |
29 | 'formatter': 'color_formatter_sql', |
|
28 | 'formatter': 'color_formatter_sql', | |
30 | }, |
|
29 | }, | |
31 | '[logger_routes]': { |
|
30 | '[logger_routes]': { | |
32 | 'level': 'DEBUG', |
|
31 | 'level': 'DEBUG', | |
33 | }, |
|
32 | }, | |
34 | '[logger_beaker]': { |
|
33 | '[logger_beaker]': { | |
35 | 'level': 'DEBUG', |
|
34 | 'level': 'DEBUG', | |
36 | }, |
|
35 | }, | |
37 | '[logger_templates]': { |
|
36 | '[logger_templates]': { | |
38 | 'level': 'INFO', |
|
37 | 'level': 'INFO', | |
39 | }, |
|
38 | }, | |
40 | '[logger_kallithea]': { |
|
39 | '[logger_kallithea]': { | |
41 | 'level': 'DEBUG', |
|
40 | 'level': 'DEBUG', | |
42 | }, |
|
41 | }, | |
43 | '[logger_tg]': { |
|
42 | '[logger_tg]': { | |
44 | 'level': 'DEBUG', |
|
43 | 'level': 'DEBUG', | |
45 | }, |
|
44 | }, | |
46 | '[logger_gearbox]': { |
|
45 | '[logger_gearbox]': { | |
47 | 'level': 'DEBUG', |
|
46 | 'level': 'DEBUG', | |
48 | }, |
|
47 | }, | |
49 | '[logger_whoosh_indexer]': { |
|
48 | '[logger_whoosh_indexer]': { | |
50 | 'level': 'DEBUG', |
|
49 | 'level': 'DEBUG', | |
51 | }, |
|
50 | }, | |
52 | }, |
|
51 | }, | |
53 | ), |
|
52 | ), | |
54 | ] |
|
53 | ] | |
55 |
|
54 | |||
56 |
|
55 | |||
57 | def main(): |
|
56 | def main(): | |
58 | # make sure all mako lines starting with '#' (the '##' comments) are marked up as <text> |
|
57 | # make sure all mako lines starting with '#' (the '##' comments) are marked up as <text> | |
59 | makofile = inifile.template_file |
|
58 | makofile = inifile.template_file | |
60 | print 'reading:', makofile |
|
59 | print 'reading:', makofile | |
61 | mako_org = open(makofile).read() |
|
60 | mako_org = open(makofile).read() | |
62 | mako_no_text_markup = re.sub(r'</?%text>', '', mako_org) |
|
61 | mako_no_text_markup = re.sub(r'</?%text>', '', mako_org) | |
63 | mako_marked_up = re.sub(r'\n(##.*)', r'\n<%text>\1</%text>', mako_no_text_markup, flags=re.MULTILINE) |
|
62 | mako_marked_up = re.sub(r'\n(##.*)', r'\n<%text>\1</%text>', mako_no_text_markup, flags=re.MULTILINE) | |
64 | if mako_marked_up != mako_org: |
|
63 | if mako_marked_up != mako_org: | |
65 | print 'writing:', makofile |
|
64 | print 'writing:', makofile | |
66 | open(makofile, 'w').write(mako_marked_up) |
|
65 | open(makofile, 'w').write(mako_marked_up) | |
67 |
|
66 | |||
68 | # create ini files |
|
67 | # create ini files | |
69 | for fn, settings in ini_files: |
|
68 | for fn, settings in ini_files: | |
70 | print 'updating:', fn |
|
69 | print 'updating:', fn | |
71 | inifile.create(fn, None, settings) |
|
70 | inifile.create(fn, None, settings) | |
72 |
|
71 | |||
73 |
|
72 | |||
74 | if __name__ == '__main__': |
|
73 | if __name__ == '__main__': | |
75 | main() |
|
74 | main() |
General Comments 0
You need to be logged in to leave comments.
Login now