Show More
@@ -1,515 +1,516 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 languages requested by the browser are used if available, with English as default. |
|
93 | ## By default, the languages requested by the browser are used if available, with English as default. | |
94 | ## Set i18n.enabled=false to disable automatic language choice. |
|
94 | ## Set i18n.enabled=false to disable automatic language choice. | |
95 | #i18n.enabled = true |
|
95 | #i18n.enabled = true | |
96 | ## To Force a language, set i18n.enabled=false and specify the language in i18n.lang. |
|
96 | ## To Force a language, set i18n.enabled=false and specify the language in i18n.lang. | |
97 | ## Valid values are the names of subdirectories in kallithea/i18n with a LC_MESSAGES/kallithea.mo |
|
97 | ## Valid values are the names of subdirectories in kallithea/i18n with a LC_MESSAGES/kallithea.mo | |
98 | #i18n.lang = en |
|
98 | #i18n.lang = en | |
99 |
|
99 | |||
100 | cache_dir = %(here)s/data |
|
100 | cache_dir = %(here)s/data | |
101 | index_dir = %(here)s/data/index |
|
101 | index_dir = %(here)s/data/index | |
102 |
|
102 | |||
103 | ## uncomment and set this path to use archive download cache |
|
103 | ## uncomment and set this path to use archive download cache | |
104 | archive_cache_dir = %(here)s/tarballcache |
|
104 | archive_cache_dir = %(here)s/tarballcache | |
105 |
|
105 | |||
106 | ## change this to unique ID for security |
|
106 | ## change this to unique ID for security | |
107 | #app_instance_uuid = VERY-SECRET |
|
107 | #app_instance_uuid = VERY-SECRET | |
108 | app_instance_uuid = development-not-secret |
|
108 | app_instance_uuid = development-not-secret | |
109 |
|
109 | |||
110 | ## cut off limit for large diffs (size in bytes) |
|
110 | ## cut off limit for large diffs (size in bytes) | |
111 | cut_off_limit = 256000 |
|
111 | cut_off_limit = 256000 | |
112 |
|
112 | |||
113 | ## force https in Kallithea, fixes https redirects, assumes it's always https |
|
113 | ## force https in Kallithea, fixes https redirects, assumes it's always https | |
114 | force_https = false |
|
114 | force_https = false | |
115 |
|
115 | |||
116 | ## use Strict-Transport-Security headers |
|
116 | ## use Strict-Transport-Security headers | |
117 | use_htsts = false |
|
117 | use_htsts = false | |
118 |
|
118 | |||
119 | ## number of commits stats will parse on each iteration |
|
119 | ## number of commits stats will parse on each iteration | |
120 | commit_parse_limit = 25 |
|
120 | commit_parse_limit = 25 | |
121 |
|
121 | |||
122 | ## Path to Python executable to be used for git hooks. |
|
122 | ## Path to Python executable to be used for git hooks. | |
123 | ## This value will be written inside the git hook scripts as the text |
|
123 | ## This value will be written inside the git hook scripts as the text | |
124 | ## after '#!' (shebang). When empty or not defined, the value of |
|
124 | ## after '#!' (shebang). When empty or not defined, the value of | |
125 | ## 'sys.executable' at the time of installation of the git hooks is |
|
125 | ## 'sys.executable' at the time of installation of the git hooks is | |
126 | ## used, which is correct in many cases but for example not when using uwsgi. |
|
126 | ## used, which is correct in many cases but for example not when using uwsgi. | |
127 | ## If you change this setting, you should reinstall the Git hooks via |
|
127 | ## If you change this setting, you should reinstall the Git hooks via | |
128 | ## Admin > Settings > Remap and Rescan. |
|
128 | ## Admin > Settings > Remap and Rescan. | |
129 | # git_hook_interpreter = /srv/kallithea/venv/bin/python3 |
|
129 | # git_hook_interpreter = /srv/kallithea/venv/bin/python3 | |
130 |
|
130 | |||
131 | ## path to git executable |
|
131 | ## path to git executable | |
132 | git_path = git |
|
132 | git_path = git | |
133 |
|
133 | |||
134 | ## git rev filter option, --all is the default filter, if you need to |
|
134 | ## git rev filter option, --all is the default filter, if you need to | |
135 | ## hide all refs in changelog switch this to --branches --tags |
|
135 | ## hide all refs in changelog switch this to --branches --tags | |
136 | #git_rev_filter = --branches --tags |
|
136 | #git_rev_filter = --branches --tags | |
137 |
|
137 | |||
138 | ## RSS feed options |
|
138 | ## RSS feed options | |
139 | rss_cut_off_limit = 256000 |
|
139 | rss_cut_off_limit = 256000 | |
140 | rss_items_per_page = 10 |
|
140 | rss_items_per_page = 10 | |
141 | rss_include_diff = false |
|
141 | rss_include_diff = false | |
142 |
|
142 | |||
143 | ## options for showing and identifying changesets |
|
143 | ## options for showing and identifying changesets | |
144 | show_sha_length = 12 |
|
144 | show_sha_length = 12 | |
145 | show_revision_number = false |
|
145 | show_revision_number = false | |
146 |
|
146 | |||
147 | ## Canonical URL to use when creating full URLs in UI and texts. |
|
147 | ## Canonical URL to use when creating full URLs in UI and texts. | |
148 | ## Useful when the site is available under different names or protocols. |
|
148 | ## Useful when the site is available under different names or protocols. | |
149 | ## Defaults to what is provided in the WSGI environment. |
|
149 | ## Defaults to what is provided in the WSGI environment. | |
150 | #canonical_url = https://kallithea.example.com/repos |
|
150 | #canonical_url = https://kallithea.example.com/repos | |
151 |
|
151 | |||
152 | ## gist URL alias, used to create nicer urls for gist. This should be an |
|
152 | ## gist URL alias, used to create nicer urls for gist. This should be an | |
153 | ## url that does rewrites to _admin/gists/<gistid>. |
|
153 | ## url that does rewrites to _admin/gists/<gistid>. | |
154 | ## example: http://gist.example.com/{gistid}. Empty means use the internal |
|
154 | ## example: http://gist.example.com/{gistid}. Empty means use the internal | |
155 | ## Kallithea url, ie. http[s]://kallithea.example.com/_admin/gists/<gistid> |
|
155 | ## Kallithea url, ie. http[s]://kallithea.example.com/_admin/gists/<gistid> | |
156 | gist_alias_url = |
|
156 | gist_alias_url = | |
157 |
|
157 | |||
158 | ## default encoding used to convert from and to unicode |
|
158 | ## default encoding used to convert from and to unicode | |
159 | ## can be also a comma separated list of encoding in case of mixed encodings |
|
159 | ## can be also a comma separated list of encoding in case of mixed encodings | |
160 | default_encoding = utf-8 |
|
160 | default_encoding = utf-8 | |
161 |
|
161 | |||
162 | ## Set Mercurial encoding, similar to setting HGENCODING before launching Kallithea |
|
162 | ## Set Mercurial encoding, similar to setting HGENCODING before launching Kallithea | |
163 | hgencoding = utf-8 |
|
163 | hgencoding = utf-8 | |
164 |
|
164 | |||
165 | ## issue tracker for Kallithea (leave blank to disable, absent for default) |
|
165 | ## issue tracker for Kallithea (leave blank to disable, absent for default) | |
166 | #bugtracker = https://bitbucket.org/conservancy/kallithea/issues |
|
166 | #bugtracker = https://bitbucket.org/conservancy/kallithea/issues | |
167 |
|
167 | |||
168 | ## issue tracking mapping for commit messages, comments, PR descriptions, ... |
|
168 | ## issue tracking mapping for commit messages, comments, PR descriptions, ... | |
169 | ## Refer to the documentation ("Integration with issue trackers") for more details. |
|
169 | ## Refer to the documentation ("Integration with issue trackers") for more details. | |
170 |
|
170 | |||
171 | ## regular expression to match issue references |
|
171 | ## regular expression to match issue references | |
172 | ## This pattern may/should contain parenthesized groups, that can |
|
172 | ## This pattern may/should contain parenthesized groups, that can | |
173 | ## be referred to in issue_server_link or issue_sub using Python backreferences |
|
173 | ## be referred to in issue_server_link or issue_sub using Python backreferences | |
174 | ## (e.g. \1, \2, ...). You can also create named groups with '(?P<groupname>)'. |
|
174 | ## (e.g. \1, \2, ...). You can also create named groups with '(?P<groupname>)'. | |
175 | ## To require mandatory whitespace before the issue pattern, use: |
|
175 | ## To require mandatory whitespace before the issue pattern, use: | |
176 | ## (?:^|(?<=\s)) before the actual pattern, and for mandatory whitespace |
|
176 | ## (?:^|(?<=\s)) before the actual pattern, and for mandatory whitespace | |
177 | ## behind the issue pattern, use (?:$|(?=\s)) after the actual pattern. |
|
177 | ## behind the issue pattern, use (?:$|(?=\s)) after the actual pattern. | |
178 |
|
178 | |||
179 | issue_pat = #(\d+) |
|
179 | issue_pat = #(\d+) | |
180 |
|
180 | |||
181 | ## server url to the issue |
|
181 | ## server url to the issue | |
182 | ## This pattern may/should contain backreferences to parenthesized groups in issue_pat. |
|
182 | ## This pattern may/should contain backreferences to parenthesized groups in issue_pat. | |
183 | ## A backreference can be \1, \2, ... or \g<groupname> if you specified a named group |
|
183 | ## A backreference can be \1, \2, ... or \g<groupname> if you specified a named group | |
184 | ## called 'groupname' in issue_pat. |
|
184 | ## called 'groupname' in issue_pat. | |
185 | ## The special token {repo} is replaced with the full repository name |
|
185 | ## The special token {repo} is replaced with the full repository name | |
186 | ## including repository groups, while {repo_name} is replaced with just |
|
186 | ## including repository groups, while {repo_name} is replaced with just | |
187 | ## the name of the repository. |
|
187 | ## the name of the repository. | |
188 |
|
188 | |||
189 | issue_server_link = https://issues.example.com/{repo}/issue/\1 |
|
189 | issue_server_link = https://issues.example.com/{repo}/issue/\1 | |
190 |
|
190 | |||
191 | ## substitution pattern to use as the link text |
|
191 | ## substitution pattern to use as the link text | |
192 | ## If issue_sub is empty, the text matched by issue_pat is retained verbatim |
|
192 | ## If issue_sub is empty, the text matched by issue_pat is retained verbatim | |
193 | ## for the link text. Otherwise, the link text is that of issue_sub, with any |
|
193 | ## for the link text. Otherwise, the link text is that of issue_sub, with any | |
194 | ## backreferences to groups in issue_pat replaced. |
|
194 | ## backreferences to groups in issue_pat replaced. | |
195 |
|
195 | |||
196 | issue_sub = |
|
196 | issue_sub = | |
197 |
|
197 | |||
198 | ## issue_pat, issue_server_link and issue_sub can have suffixes to specify |
|
198 | ## issue_pat, issue_server_link and issue_sub can have suffixes to specify | |
199 | ## multiple patterns, to other issues server, wiki or others |
|
199 | ## multiple patterns, to other issues server, wiki or others | |
200 | ## below an example how to create a wiki pattern |
|
200 | ## below an example how to create a wiki pattern | |
201 | # wiki-some-id -> https://wiki.example.com/some-id |
|
201 | # wiki-some-id -> https://wiki.example.com/some-id | |
202 |
|
202 | |||
203 | #issue_pat_wiki = wiki-(\S+) |
|
203 | #issue_pat_wiki = wiki-(\S+) | |
204 | #issue_server_link_wiki = https://wiki.example.com/\1 |
|
204 | #issue_server_link_wiki = https://wiki.example.com/\1 | |
205 | #issue_sub_wiki = WIKI-\1 |
|
205 | #issue_sub_wiki = WIKI-\1 | |
206 |
|
206 | |||
207 | ## alternative return HTTP header for failed authentication. Default HTTP |
|
207 | ## alternative return HTTP header for failed authentication. Default HTTP | |
208 | ## response is 401 HTTPUnauthorized. Currently Mercurial clients have trouble with |
|
208 | ## response is 401 HTTPUnauthorized. Currently Mercurial clients have trouble with | |
209 | ## handling that. Set this variable to 403 to return HTTPForbidden |
|
209 | ## handling that. Set this variable to 403 to return HTTPForbidden | |
210 | auth_ret_code = |
|
210 | auth_ret_code = | |
211 |
|
211 | |||
212 | ## allows to change the repository location in settings page |
|
212 | ## allows to change the repository location in settings page | |
213 | allow_repo_location_change = True |
|
213 | allow_repo_location_change = True | |
214 |
|
214 | |||
215 | ## allows to setup custom hooks in settings page |
|
215 | ## allows to setup custom hooks in settings page | |
216 | allow_custom_hooks_settings = True |
|
216 | allow_custom_hooks_settings = True | |
217 |
|
217 | |||
218 | ## extra extensions for indexing, space separated and without the leading '.'. |
|
218 | ## extra extensions for indexing, space separated and without the leading '.'. | |
219 | # index.extensions = |
|
219 | # index.extensions = | |
220 | # gemfile |
|
220 | # gemfile | |
221 | # lock |
|
221 | # lock | |
222 |
|
222 | |||
223 | ## extra filenames for indexing, space separated |
|
223 | ## extra filenames for indexing, space separated | |
224 | # index.filenames = |
|
224 | # index.filenames = | |
225 | # .dockerignore |
|
225 | # .dockerignore | |
226 | # .editorconfig |
|
226 | # .editorconfig | |
227 | # INSTALL |
|
227 | # INSTALL | |
228 | # CHANGELOG |
|
228 | # CHANGELOG | |
229 |
|
229 | |||
230 | #################################### |
|
230 | #################################### | |
231 | ### SSH CONFIG #### |
|
231 | ### SSH CONFIG #### | |
232 | #################################### |
|
232 | #################################### | |
233 |
|
233 | |||
234 | ## SSH is disabled by default, until an Administrator decides to enable it. |
|
234 | ## SSH is disabled by default, until an Administrator decides to enable it. | |
235 | ssh_enabled = false |
|
235 | ssh_enabled = false | |
236 |
|
236 | |||
237 | ## File where users' SSH keys will be stored *if* ssh_enabled is true. |
|
237 | ## File where users' SSH keys will be stored *if* ssh_enabled is true. | |
238 | #ssh_authorized_keys = /home/kallithea/.ssh/authorized_keys |
|
238 | #ssh_authorized_keys = /home/kallithea/.ssh/authorized_keys | |
239 |
|
239 | |||
240 | ## Path to be used in ssh_authorized_keys file to invoke kallithea-cli with ssh-serve. |
|
240 | ## Path to be used in ssh_authorized_keys file to invoke kallithea-cli with ssh-serve. | |
241 | #kallithea_cli_path = /srv/kallithea/venv/bin/kallithea-cli |
|
241 | #kallithea_cli_path = /srv/kallithea/venv/bin/kallithea-cli | |
242 |
|
242 | |||
243 | ## Locale to be used in the ssh-serve command. |
|
243 | ## Locale to be used in the ssh-serve command. | |
244 | ## This is needed because an SSH client may try to use its own locale |
|
244 | ## This is needed because an SSH client may try to use its own locale | |
245 | ## settings, which may not be available on the server. |
|
245 | ## settings, which may not be available on the server. | |
246 | ## See `locale -a` for valid values on this system. |
|
246 | ## See `locale -a` for valid values on this system. | |
247 | #ssh_locale = C.UTF-8 |
|
247 | #ssh_locale = C.UTF-8 | |
248 |
|
248 | |||
249 | #################################### |
|
249 | #################################### | |
250 | ### CELERY CONFIG #### |
|
250 | ### CELERY CONFIG #### | |
251 | #################################### |
|
251 | #################################### | |
252 |
|
252 | |||
|
253 | ## Note: Celery doesn't support Windows. | |||
253 | use_celery = false |
|
254 | use_celery = false | |
254 |
|
255 | |||
255 | ## Example: use the message queue on the local virtual host 'kallitheavhost' as the RabbitMQ user 'kallithea': |
|
256 | ## Example: use the message queue on the local virtual host 'kallitheavhost' as the RabbitMQ user 'kallithea': | |
256 | broker.url = amqp://kallithea:thepassword@localhost:5672/kallitheavhost |
|
257 | broker.url = amqp://kallithea:thepassword@localhost:5672/kallitheavhost | |
257 |
|
258 | |||
258 | celery.result.backend = db+sqlite:///celery-results.db |
|
259 | celery.result.backend = db+sqlite:///celery-results.db | |
259 |
|
260 | |||
260 | #celery.amqp.task.result.expires = 18000 |
|
261 | #celery.amqp.task.result.expires = 18000 | |
261 |
|
262 | |||
262 | celeryd.concurrency = 2 |
|
263 | celeryd.concurrency = 2 | |
263 | celeryd.max.tasks.per.child = 1 |
|
264 | celeryd.max.tasks.per.child = 1 | |
264 |
|
265 | |||
265 | ## If true, tasks will never be sent to the queue, but executed locally instead. |
|
266 | ## If true, tasks will never be sent to the queue, but executed locally instead. | |
266 | celery.always.eager = false |
|
267 | celery.always.eager = false | |
267 |
|
268 | |||
268 | #################################### |
|
269 | #################################### | |
269 | ### BEAKER CACHE #### |
|
270 | ### BEAKER CACHE #### | |
270 | #################################### |
|
271 | #################################### | |
271 |
|
272 | |||
272 | beaker.cache.data_dir = %(here)s/data/cache/data |
|
273 | beaker.cache.data_dir = %(here)s/data/cache/data | |
273 | beaker.cache.lock_dir = %(here)s/data/cache/lock |
|
274 | beaker.cache.lock_dir = %(here)s/data/cache/lock | |
274 |
|
275 | |||
275 | beaker.cache.regions = short_term,long_term,sql_cache_short |
|
276 | beaker.cache.regions = short_term,long_term,sql_cache_short | |
276 |
|
277 | |||
277 | beaker.cache.short_term.type = memory |
|
278 | beaker.cache.short_term.type = memory | |
278 | beaker.cache.short_term.expire = 60 |
|
279 | beaker.cache.short_term.expire = 60 | |
279 | beaker.cache.short_term.key_length = 256 |
|
280 | beaker.cache.short_term.key_length = 256 | |
280 |
|
281 | |||
281 | beaker.cache.long_term.type = memory |
|
282 | beaker.cache.long_term.type = memory | |
282 | beaker.cache.long_term.expire = 36000 |
|
283 | beaker.cache.long_term.expire = 36000 | |
283 | beaker.cache.long_term.key_length = 256 |
|
284 | beaker.cache.long_term.key_length = 256 | |
284 |
|
285 | |||
285 | beaker.cache.sql_cache_short.type = memory |
|
286 | beaker.cache.sql_cache_short.type = memory | |
286 | beaker.cache.sql_cache_short.expire = 10 |
|
287 | beaker.cache.sql_cache_short.expire = 10 | |
287 | beaker.cache.sql_cache_short.key_length = 256 |
|
288 | beaker.cache.sql_cache_short.key_length = 256 | |
288 |
|
289 | |||
289 | #################################### |
|
290 | #################################### | |
290 | ### BEAKER SESSION #### |
|
291 | ### BEAKER SESSION #### | |
291 | #################################### |
|
292 | #################################### | |
292 |
|
293 | |||
293 | ## Name of session cookie. Should be unique for a given host and path, even when running |
|
294 | ## Name of session cookie. Should be unique for a given host and path, even when running | |
294 | ## on different ports. Otherwise, cookie sessions will be shared and messed up. |
|
295 | ## on different ports. Otherwise, cookie sessions will be shared and messed up. | |
295 | session.key = kallithea |
|
296 | session.key = kallithea | |
296 | ## Sessions should always only be accessible by the browser, not directly by JavaScript. |
|
297 | ## Sessions should always only be accessible by the browser, not directly by JavaScript. | |
297 | session.httponly = true |
|
298 | session.httponly = true | |
298 | ## Session lifetime. 2592000 seconds is 30 days. |
|
299 | ## Session lifetime. 2592000 seconds is 30 days. | |
299 | session.timeout = 2592000 |
|
300 | session.timeout = 2592000 | |
300 |
|
301 | |||
301 | ## Server secret used with HMAC to ensure integrity of cookies. |
|
302 | ## Server secret used with HMAC to ensure integrity of cookies. | |
302 | #session.secret = VERY-SECRET |
|
303 | #session.secret = VERY-SECRET | |
303 | session.secret = development-not-secret |
|
304 | session.secret = development-not-secret | |
304 | ## Further, encrypt the data with AES. |
|
305 | ## Further, encrypt the data with AES. | |
305 | #session.encrypt_key = <key_for_encryption> |
|
306 | #session.encrypt_key = <key_for_encryption> | |
306 | #session.validate_key = <validation_key> |
|
307 | #session.validate_key = <validation_key> | |
307 |
|
308 | |||
308 | ## Type of storage used for the session, current types are |
|
309 | ## Type of storage used for the session, current types are | |
309 | ## dbm, file, memcached, database, and memory. |
|
310 | ## dbm, file, memcached, database, and memory. | |
310 |
|
311 | |||
311 | ## File system storage of session data. (default) |
|
312 | ## File system storage of session data. (default) | |
312 | #session.type = file |
|
313 | #session.type = file | |
313 |
|
314 | |||
314 | ## Cookie only, store all session data inside the cookie. Requires secure secrets. |
|
315 | ## Cookie only, store all session data inside the cookie. Requires secure secrets. | |
315 | #session.type = cookie |
|
316 | #session.type = cookie | |
316 |
|
317 | |||
317 | ## Database storage of session data. |
|
318 | ## Database storage of session data. | |
318 | #session.type = ext:database |
|
319 | #session.type = ext:database | |
319 | #session.sa.url = postgresql://postgres:qwe@localhost/kallithea |
|
320 | #session.sa.url = postgresql://postgres:qwe@localhost/kallithea | |
320 | #session.table_name = db_session |
|
321 | #session.table_name = db_session | |
321 |
|
322 | |||
322 | ############################ |
|
323 | ############################ | |
323 | ## ERROR HANDLING SYSTEMS ## |
|
324 | ## ERROR HANDLING SYSTEMS ## | |
324 | ############################ |
|
325 | ############################ | |
325 |
|
326 | |||
326 | # Propagate email settings to ErrorReporter of TurboGears2 |
|
327 | # Propagate email settings to ErrorReporter of TurboGears2 | |
327 | # You do not normally need to change these lines |
|
328 | # You do not normally need to change these lines | |
328 | get trace_errors.smtp_server = smtp_server |
|
329 | get trace_errors.smtp_server = smtp_server | |
329 | get trace_errors.smtp_port = smtp_port |
|
330 | get trace_errors.smtp_port = smtp_port | |
330 | get trace_errors.from_address = error_email_from |
|
331 | get trace_errors.from_address = error_email_from | |
331 | get trace_errors.error_email = email_to |
|
332 | get trace_errors.error_email = email_to | |
332 | get trace_errors.smtp_username = smtp_username |
|
333 | get trace_errors.smtp_username = smtp_username | |
333 | get trace_errors.smtp_password = smtp_password |
|
334 | get trace_errors.smtp_password = smtp_password | |
334 | get trace_errors.smtp_use_tls = smtp_use_tls |
|
335 | get trace_errors.smtp_use_tls = smtp_use_tls | |
335 |
|
336 | |||
336 | ################################################################################ |
|
337 | ################################################################################ | |
337 | ## WARNING: *DEBUG MODE MUST BE OFF IN A PRODUCTION ENVIRONMENT* ## |
|
338 | ## WARNING: *DEBUG MODE MUST BE OFF IN A PRODUCTION ENVIRONMENT* ## | |
338 | ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ## |
|
339 | ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ## | |
339 | ## execute malicious code after an exception is raised. ## |
|
340 | ## execute malicious code after an exception is raised. ## | |
340 | ################################################################################ |
|
341 | ################################################################################ | |
341 | #debug = false |
|
342 | #debug = false | |
342 | debug = true |
|
343 | debug = true | |
343 |
|
344 | |||
344 | ################################## |
|
345 | ################################## | |
345 | ### LOGVIEW CONFIG ### |
|
346 | ### LOGVIEW CONFIG ### | |
346 | ################################## |
|
347 | ################################## | |
347 |
|
348 | |||
348 | logview.sqlalchemy = #faa |
|
349 | logview.sqlalchemy = #faa | |
349 | logview.pylons.templating = #bfb |
|
350 | logview.pylons.templating = #bfb | |
350 | logview.pylons.util = #eee |
|
351 | logview.pylons.util = #eee | |
351 |
|
352 | |||
352 | ######################################################### |
|
353 | ######################################################### | |
353 | ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ### |
|
354 | ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ### | |
354 | ######################################################### |
|
355 | ######################################################### | |
355 |
|
356 | |||
356 | # SQLITE [default] |
|
357 | # SQLITE [default] | |
357 | sqlalchemy.url = sqlite:///%(here)s/kallithea.db?timeout=60 |
|
358 | sqlalchemy.url = sqlite:///%(here)s/kallithea.db?timeout=60 | |
358 |
|
359 | |||
359 | # see sqlalchemy docs for others |
|
360 | # see sqlalchemy docs for others | |
360 |
|
361 | |||
361 | sqlalchemy.pool_recycle = 3600 |
|
362 | sqlalchemy.pool_recycle = 3600 | |
362 |
|
363 | |||
363 | ################################ |
|
364 | ################################ | |
364 | ### ALEMBIC CONFIGURATION #### |
|
365 | ### ALEMBIC CONFIGURATION #### | |
365 | ################################ |
|
366 | ################################ | |
366 |
|
367 | |||
367 | [alembic] |
|
368 | [alembic] | |
368 | script_location = kallithea:alembic |
|
369 | script_location = kallithea:alembic | |
369 |
|
370 | |||
370 | ################################ |
|
371 | ################################ | |
371 | ### LOGGING CONFIGURATION #### |
|
372 | ### LOGGING CONFIGURATION #### | |
372 | ################################ |
|
373 | ################################ | |
373 |
|
374 | |||
374 | [loggers] |
|
375 | [loggers] | |
375 | keys = root, routes, kallithea, sqlalchemy, tg, gearbox, beaker, templates, whoosh_indexer, werkzeug, backlash |
|
376 | keys = root, routes, kallithea, sqlalchemy, tg, gearbox, beaker, templates, whoosh_indexer, werkzeug, backlash | |
376 |
|
377 | |||
377 | [handlers] |
|
378 | [handlers] | |
378 | keys = console, console_color, console_color_sql, null |
|
379 | keys = console, console_color, console_color_sql, null | |
379 |
|
380 | |||
380 | [formatters] |
|
381 | [formatters] | |
381 | keys = generic, color_formatter, color_formatter_sql |
|
382 | keys = generic, color_formatter, color_formatter_sql | |
382 |
|
383 | |||
383 | ############# |
|
384 | ############# | |
384 | ## LOGGERS ## |
|
385 | ## LOGGERS ## | |
385 | ############# |
|
386 | ############# | |
386 |
|
387 | |||
387 | [logger_root] |
|
388 | [logger_root] | |
388 | level = NOTSET |
|
389 | level = NOTSET | |
389 | #handlers = console |
|
390 | #handlers = console | |
390 | handlers = console_color |
|
391 | handlers = console_color | |
391 | # For coloring based on log level: |
|
392 | # For coloring based on log level: | |
392 | # handlers = console_color |
|
393 | # handlers = console_color | |
393 |
|
394 | |||
394 | [logger_routes] |
|
395 | [logger_routes] | |
395 | #level = WARN |
|
396 | #level = WARN | |
396 | level = DEBUG |
|
397 | level = DEBUG | |
397 | handlers = |
|
398 | handlers = | |
398 | qualname = routes.middleware |
|
399 | qualname = routes.middleware | |
399 | ## "level = DEBUG" logs the route matched and routing variables. |
|
400 | ## "level = DEBUG" logs the route matched and routing variables. | |
400 |
|
401 | |||
401 | [logger_beaker] |
|
402 | [logger_beaker] | |
402 | #level = WARN |
|
403 | #level = WARN | |
403 | level = DEBUG |
|
404 | level = DEBUG | |
404 | handlers = |
|
405 | handlers = | |
405 | qualname = beaker.container |
|
406 | qualname = beaker.container | |
406 |
|
407 | |||
407 | [logger_templates] |
|
408 | [logger_templates] | |
408 | #level = WARN |
|
409 | #level = WARN | |
409 | level = INFO |
|
410 | level = INFO | |
410 | handlers = |
|
411 | handlers = | |
411 | qualname = pylons.templating |
|
412 | qualname = pylons.templating | |
412 |
|
413 | |||
413 | [logger_kallithea] |
|
414 | [logger_kallithea] | |
414 | #level = WARN |
|
415 | #level = WARN | |
415 | level = DEBUG |
|
416 | level = DEBUG | |
416 | handlers = |
|
417 | handlers = | |
417 | qualname = kallithea |
|
418 | qualname = kallithea | |
418 |
|
419 | |||
419 | [logger_tg] |
|
420 | [logger_tg] | |
420 | #level = WARN |
|
421 | #level = WARN | |
421 | level = DEBUG |
|
422 | level = DEBUG | |
422 | handlers = |
|
423 | handlers = | |
423 | qualname = tg |
|
424 | qualname = tg | |
424 |
|
425 | |||
425 | [logger_gearbox] |
|
426 | [logger_gearbox] | |
426 | #level = WARN |
|
427 | #level = WARN | |
427 | level = DEBUG |
|
428 | level = DEBUG | |
428 | handlers = |
|
429 | handlers = | |
429 | qualname = gearbox |
|
430 | qualname = gearbox | |
430 |
|
431 | |||
431 | [logger_sqlalchemy] |
|
432 | [logger_sqlalchemy] | |
432 | level = WARN |
|
433 | level = WARN | |
433 | handlers = |
|
434 | handlers = | |
434 | qualname = sqlalchemy.engine |
|
435 | qualname = sqlalchemy.engine | |
435 | # For coloring based on log level and pretty printing of SQL: |
|
436 | # For coloring based on log level and pretty printing of SQL: | |
436 | # level = INFO |
|
437 | # level = INFO | |
437 | # handlers = console_color_sql |
|
438 | # handlers = console_color_sql | |
438 | # propagate = 0 |
|
439 | # propagate = 0 | |
439 |
|
440 | |||
440 | [logger_whoosh_indexer] |
|
441 | [logger_whoosh_indexer] | |
441 | #level = WARN |
|
442 | #level = WARN | |
442 | level = DEBUG |
|
443 | level = DEBUG | |
443 | handlers = |
|
444 | handlers = | |
444 | qualname = whoosh_indexer |
|
445 | qualname = whoosh_indexer | |
445 |
|
446 | |||
446 | [logger_werkzeug] |
|
447 | [logger_werkzeug] | |
447 | level = WARN |
|
448 | level = WARN | |
448 | handlers = |
|
449 | handlers = | |
449 | qualname = werkzeug |
|
450 | qualname = werkzeug | |
450 |
|
451 | |||
451 | [logger_backlash] |
|
452 | [logger_backlash] | |
452 | level = WARN |
|
453 | level = WARN | |
453 | handlers = |
|
454 | handlers = | |
454 | qualname = backlash |
|
455 | qualname = backlash | |
455 |
|
456 | |||
456 | ############## |
|
457 | ############## | |
457 | ## HANDLERS ## |
|
458 | ## HANDLERS ## | |
458 | ############## |
|
459 | ############## | |
459 |
|
460 | |||
460 | [handler_console] |
|
461 | [handler_console] | |
461 | class = StreamHandler |
|
462 | class = StreamHandler | |
462 | args = (sys.stderr,) |
|
463 | args = (sys.stderr,) | |
463 | formatter = generic |
|
464 | formatter = generic | |
464 |
|
465 | |||
465 | [handler_console_color] |
|
466 | [handler_console_color] | |
466 | # ANSI color coding based on log level |
|
467 | # ANSI color coding based on log level | |
467 | class = StreamHandler |
|
468 | class = StreamHandler | |
468 | args = (sys.stderr,) |
|
469 | args = (sys.stderr,) | |
469 | formatter = color_formatter |
|
470 | formatter = color_formatter | |
470 |
|
471 | |||
471 | [handler_console_color_sql] |
|
472 | [handler_console_color_sql] | |
472 | # ANSI color coding and pretty printing of SQL statements |
|
473 | # ANSI color coding and pretty printing of SQL statements | |
473 | class = StreamHandler |
|
474 | class = StreamHandler | |
474 | args = (sys.stderr,) |
|
475 | args = (sys.stderr,) | |
475 | formatter = color_formatter_sql |
|
476 | formatter = color_formatter_sql | |
476 |
|
477 | |||
477 | [handler_null] |
|
478 | [handler_null] | |
478 | class = NullHandler |
|
479 | class = NullHandler | |
479 | args = () |
|
480 | args = () | |
480 |
|
481 | |||
481 | ################ |
|
482 | ################ | |
482 | ## FORMATTERS ## |
|
483 | ## FORMATTERS ## | |
483 | ################ |
|
484 | ################ | |
484 |
|
485 | |||
485 | [formatter_generic] |
|
486 | [formatter_generic] | |
486 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s |
|
487 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s | |
487 | datefmt = %Y-%m-%d %H:%M:%S |
|
488 | datefmt = %Y-%m-%d %H:%M:%S | |
488 |
|
489 | |||
489 | [formatter_color_formatter] |
|
490 | [formatter_color_formatter] | |
490 | class = kallithea.lib.colored_formatter.ColorFormatter |
|
491 | class = kallithea.lib.colored_formatter.ColorFormatter | |
491 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s |
|
492 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s | |
492 | datefmt = %Y-%m-%d %H:%M:%S |
|
493 | datefmt = %Y-%m-%d %H:%M:%S | |
493 |
|
494 | |||
494 | [formatter_color_formatter_sql] |
|
495 | [formatter_color_formatter_sql] | |
495 | class = kallithea.lib.colored_formatter.ColorFormatterSql |
|
496 | class = kallithea.lib.colored_formatter.ColorFormatterSql | |
496 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s |
|
497 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s | |
497 | datefmt = %Y-%m-%d %H:%M:%S |
|
498 | datefmt = %Y-%m-%d %H:%M:%S | |
498 |
|
499 | |||
499 | ################# |
|
500 | ################# | |
500 | ## SSH LOGGING ## |
|
501 | ## SSH LOGGING ## | |
501 | ################# |
|
502 | ################# | |
502 |
|
503 | |||
503 | # The default loggers use 'handler_console' that uses StreamHandler with |
|
504 | # The default loggers use 'handler_console' that uses StreamHandler with | |
504 | # destination 'sys.stderr'. In the context of the SSH server process, these log |
|
505 | # destination 'sys.stderr'. In the context of the SSH server process, these log | |
505 | # messages would be sent to the client, which is normally not what you want. |
|
506 | # messages would be sent to the client, which is normally not what you want. | |
506 | # By default, when running ssh-serve, just use NullHandler and disable logging |
|
507 | # By default, when running ssh-serve, just use NullHandler and disable logging | |
507 | # completely. For other logging options, see: |
|
508 | # completely. For other logging options, see: | |
508 | # https://docs.python.org/2/library/logging.handlers.html |
|
509 | # https://docs.python.org/2/library/logging.handlers.html | |
509 |
|
510 | |||
510 | [ssh_serve:logger_root] |
|
511 | [ssh_serve:logger_root] | |
511 | level = CRITICAL |
|
512 | level = CRITICAL | |
512 | handlers = null |
|
513 | handlers = null | |
513 |
|
514 | |||
514 | # Note: If logging is configured with other handlers, they might need similar |
|
515 | # Note: If logging is configured with other handlers, they might need similar | |
515 | # muting for ssh-serve too. |
|
516 | # muting for ssh-serve too. |
@@ -1,636 +1,636 b'' | |||||
1 | .. _setup: |
|
1 | .. _setup: | |
2 |
|
2 | |||
3 | ===== |
|
3 | ===== | |
4 | Setup |
|
4 | Setup | |
5 | ===== |
|
5 | ===== | |
6 |
|
6 | |||
7 |
|
7 | |||
8 | Setting up Kallithea |
|
8 | Setting up Kallithea | |
9 | -------------------- |
|
9 | -------------------- | |
10 |
|
10 | |||
11 | First, you will need to create a Kallithea configuration file. Run the |
|
11 | First, you will need to create a Kallithea configuration file. Run the | |
12 | following command to do so:: |
|
12 | following command to do so:: | |
13 |
|
13 | |||
14 | kallithea-cli config-create my.ini |
|
14 | kallithea-cli config-create my.ini | |
15 |
|
15 | |||
16 | This will create the file ``my.ini`` in the current directory. This |
|
16 | This will create the file ``my.ini`` in the current directory. This | |
17 | configuration file contains the various settings for Kallithea, e.g. |
|
17 | configuration file contains the various settings for Kallithea, e.g. | |
18 | proxy port, email settings, usage of static files, cache, Celery |
|
18 | proxy port, email settings, usage of static files, cache, Celery | |
19 | settings, and logging. Extra settings can be specified like:: |
|
19 | settings, and logging. Extra settings can be specified like:: | |
20 |
|
20 | |||
21 | kallithea-cli config-create my.ini host=8.8.8.8 "[handler_console]" formatter=color_formatter |
|
21 | kallithea-cli config-create my.ini host=8.8.8.8 "[handler_console]" formatter=color_formatter | |
22 |
|
22 | |||
23 | Next, you need to create the databases used by Kallithea. It is recommended to |
|
23 | Next, you need to create the databases used by Kallithea. It is recommended to | |
24 | use PostgreSQL or SQLite (default). If you choose a database other than the |
|
24 | use PostgreSQL or SQLite (default). If you choose a database other than the | |
25 | default, ensure you properly adjust the database URL in your ``my.ini`` |
|
25 | default, ensure you properly adjust the database URL in your ``my.ini`` | |
26 | configuration file to use this other database. Kallithea currently supports |
|
26 | configuration file to use this other database. Kallithea currently supports | |
27 | PostgreSQL, SQLite and MySQL databases. Create the database by running |
|
27 | PostgreSQL, SQLite and MySQL databases. Create the database by running | |
28 | the following command:: |
|
28 | the following command:: | |
29 |
|
29 | |||
30 | kallithea-cli db-create -c my.ini |
|
30 | kallithea-cli db-create -c my.ini | |
31 |
|
31 | |||
32 | This will prompt you for a "root" path. This "root" path is the location where |
|
32 | This will prompt you for a "root" path. This "root" path is the location where | |
33 | Kallithea will store all of its repositories on the current machine. After |
|
33 | Kallithea will store all of its repositories on the current machine. After | |
34 | entering this "root" path ``db-create`` will also prompt you for a username |
|
34 | entering this "root" path ``db-create`` will also prompt you for a username | |
35 | and password for the initial admin account which ``db-create`` sets |
|
35 | and password for the initial admin account which ``db-create`` sets | |
36 | up for you. |
|
36 | up for you. | |
37 |
|
37 | |||
38 | The ``db-create`` values can also be given on the command line. |
|
38 | The ``db-create`` values can also be given on the command line. | |
39 | Example:: |
|
39 | Example:: | |
40 |
|
40 | |||
41 | kallithea-cli db-create -c my.ini --user=nn --password=secret --email=nn@example.com --repos=/srv/repos |
|
41 | kallithea-cli db-create -c my.ini --user=nn --password=secret --email=nn@example.com --repos=/srv/repos | |
42 |
|
42 | |||
43 | The ``db-create`` command will create all needed tables and an |
|
43 | The ``db-create`` command will create all needed tables and an | |
44 | admin account. When choosing a root path you can either use a new |
|
44 | admin account. When choosing a root path you can either use a new | |
45 | empty location, or a location which already contains existing |
|
45 | empty location, or a location which already contains existing | |
46 | repositories. If you choose a location which contains existing |
|
46 | repositories. If you choose a location which contains existing | |
47 | repositories Kallithea will add all of the repositories at the chosen |
|
47 | repositories Kallithea will add all of the repositories at the chosen | |
48 | location to its database. (Note: make sure you specify the correct |
|
48 | location to its database. (Note: make sure you specify the correct | |
49 | path to the root). |
|
49 | path to the root). | |
50 |
|
50 | |||
51 | .. note:: the given path for Mercurial_ repositories **must** be write |
|
51 | .. note:: the given path for Mercurial_ repositories **must** be write | |
52 | accessible for the application. It's very important since |
|
52 | accessible for the application. It's very important since | |
53 | the Kallithea web interface will work without write access, |
|
53 | the Kallithea web interface will work without write access, | |
54 | but when trying to do a push it will fail with permission |
|
54 | but when trying to do a push it will fail with permission | |
55 | denied errors unless it has write access. |
|
55 | denied errors unless it has write access. | |
56 |
|
56 | |||
57 | Finally, prepare the front-end by running:: |
|
57 | Finally, prepare the front-end by running:: | |
58 |
|
58 | |||
59 | kallithea-cli front-end-build |
|
59 | kallithea-cli front-end-build | |
60 |
|
60 | |||
61 | You are now ready to use Kallithea. To run it simply execute:: |
|
61 | You are now ready to use Kallithea. To run it simply execute:: | |
62 |
|
62 | |||
63 | gearbox serve -c my.ini |
|
63 | gearbox serve -c my.ini | |
64 |
|
64 | |||
65 | - This command runs the Kallithea server. The web app should be available at |
|
65 | - This command runs the Kallithea server. The web app should be available at | |
66 | http://127.0.0.1:5000. The IP address and port is configurable via the |
|
66 | http://127.0.0.1:5000. The IP address and port is configurable via the | |
67 | configuration file created in the previous step. |
|
67 | configuration file created in the previous step. | |
68 | - Log in to Kallithea using the admin account created when running ``db-create``. |
|
68 | - Log in to Kallithea using the admin account created when running ``db-create``. | |
69 | - The default permissions on each repository is read, and the owner is admin. |
|
69 | - The default permissions on each repository is read, and the owner is admin. | |
70 | Remember to update these if needed. |
|
70 | Remember to update these if needed. | |
71 | - In the admin panel you can toggle LDAP, anonymous, and permissions |
|
71 | - In the admin panel you can toggle LDAP, anonymous, and permissions | |
72 | settings, as well as edit more advanced options on users and |
|
72 | settings, as well as edit more advanced options on users and | |
73 | repositories. |
|
73 | repositories. | |
74 |
|
74 | |||
75 |
|
75 | |||
76 | Internationalization (i18n support) |
|
76 | Internationalization (i18n support) | |
77 | ----------------------------------- |
|
77 | ----------------------------------- | |
78 |
|
78 | |||
79 | The Kallithea web interface is automatically displayed in the user's preferred |
|
79 | The Kallithea web interface is automatically displayed in the user's preferred | |
80 | language, as indicated by the browser. Thus, different users may see the |
|
80 | language, as indicated by the browser. Thus, different users may see the | |
81 | application in different languages. If the requested language is not available |
|
81 | application in different languages. If the requested language is not available | |
82 | (because the translation file for that language does not yet exist or is |
|
82 | (because the translation file for that language does not yet exist or is | |
83 | incomplete), English is used. |
|
83 | incomplete), English is used. | |
84 |
|
84 | |||
85 | If you want to disable automatic language detection and instead configure a |
|
85 | If you want to disable automatic language detection and instead configure a | |
86 | fixed language regardless of user preference, set ``i18n.enabled = false`` and |
|
86 | fixed language regardless of user preference, set ``i18n.enabled = false`` and | |
87 | specify another language by setting ``i18n.lang`` in the Kallithea |
|
87 | specify another language by setting ``i18n.lang`` in the Kallithea | |
88 | configuration file. |
|
88 | configuration file. | |
89 |
|
89 | |||
90 |
|
90 | |||
91 | Using Kallithea with SSH |
|
91 | Using Kallithea with SSH | |
92 | ------------------------ |
|
92 | ------------------------ | |
93 |
|
93 | |||
94 | Kallithea supports repository access via SSH key based authentication. |
|
94 | Kallithea supports repository access via SSH key based authentication. | |
95 | This means: |
|
95 | This means: | |
96 |
|
96 | |||
97 | - repository URLs like ``ssh://kallithea@example.com/name/of/repository`` |
|
97 | - repository URLs like ``ssh://kallithea@example.com/name/of/repository`` | |
98 |
|
98 | |||
99 | - all network traffic for both read and write happens over the SSH protocol on |
|
99 | - all network traffic for both read and write happens over the SSH protocol on | |
100 | port 22, without using HTTP/HTTPS nor the Kallithea WSGI application |
|
100 | port 22, without using HTTP/HTTPS nor the Kallithea WSGI application | |
101 |
|
101 | |||
102 | - encryption and authentication protocols are managed by the system's ``sshd`` |
|
102 | - encryption and authentication protocols are managed by the system's ``sshd`` | |
103 | process, with all users using the same Kallithea system user (e.g. |
|
103 | process, with all users using the same Kallithea system user (e.g. | |
104 | ``kallithea``) when connecting to the SSH server, but with users' public keys |
|
104 | ``kallithea``) when connecting to the SSH server, but with users' public keys | |
105 | in the Kallithea system user's `.ssh/authorized_keys` file granting each user |
|
105 | in the Kallithea system user's `.ssh/authorized_keys` file granting each user | |
106 | sandboxed access to the repositories. |
|
106 | sandboxed access to the repositories. | |
107 |
|
107 | |||
108 | - users and admins can manage SSH public keys in the web UI |
|
108 | - users and admins can manage SSH public keys in the web UI | |
109 |
|
109 | |||
110 | - in their SSH client configuration, users can configure how the client should |
|
110 | - in their SSH client configuration, users can configure how the client should | |
111 | control access to their SSH key - without passphrase, with passphrase, and |
|
111 | control access to their SSH key - without passphrase, with passphrase, and | |
112 | optionally with passphrase caching in the local shell session (``ssh-agent``). |
|
112 | optionally with passphrase caching in the local shell session (``ssh-agent``). | |
113 | This is standard SSH functionality, not something Kallithea provides or |
|
113 | This is standard SSH functionality, not something Kallithea provides or | |
114 | interferes with. |
|
114 | interferes with. | |
115 |
|
115 | |||
116 | - network communication between client and server happens in a bidirectional |
|
116 | - network communication between client and server happens in a bidirectional | |
117 | stateful stream, and will in some cases be faster than HTTP/HTTPS with several |
|
117 | stateful stream, and will in some cases be faster than HTTP/HTTPS with several | |
118 | stateless round-trips. |
|
118 | stateless round-trips. | |
119 |
|
119 | |||
120 | .. note:: At this moment, repository access via SSH has been tested on Unix |
|
120 | .. note:: At this moment, repository access via SSH has been tested on Unix | |
121 | only. Windows users that care about SSH are invited to test it and report |
|
121 | only. Windows users that care about SSH are invited to test it and report | |
122 | problems, ideally contributing patches that solve these problems. |
|
122 | problems, ideally contributing patches that solve these problems. | |
123 |
|
123 | |||
124 | Users and admins can upload SSH public keys (e.g. ``.ssh/id_rsa.pub``) through |
|
124 | Users and admins can upload SSH public keys (e.g. ``.ssh/id_rsa.pub``) through | |
125 | the web interface. The server's ``.ssh/authorized_keys`` file is automatically |
|
125 | the web interface. The server's ``.ssh/authorized_keys`` file is automatically | |
126 | maintained with an entry for each SSH key. Each entry will tell ``sshd`` to run |
|
126 | maintained with an entry for each SSH key. Each entry will tell ``sshd`` to run | |
127 | ``kallithea-cli`` with the ``ssh-serve`` sub-command and the right Kallithea user ID |
|
127 | ``kallithea-cli`` with the ``ssh-serve`` sub-command and the right Kallithea user ID | |
128 | when encountering the corresponding SSH key. |
|
128 | when encountering the corresponding SSH key. | |
129 |
|
129 | |||
130 | To enable SSH repository access, Kallithea must be configured with the path to |
|
130 | To enable SSH repository access, Kallithea must be configured with the path to | |
131 | the ``.ssh/authorized_keys`` file for the Kallithea user, and the path to the |
|
131 | the ``.ssh/authorized_keys`` file for the Kallithea user, and the path to the | |
132 | ``kallithea-cli`` command. Put something like this in the ``.ini`` file:: |
|
132 | ``kallithea-cli`` command. Put something like this in the ``.ini`` file:: | |
133 |
|
133 | |||
134 | ssh_enabled = true |
|
134 | ssh_enabled = true | |
135 | ssh_authorized_keys = /home/kallithea/.ssh/authorized_keys |
|
135 | ssh_authorized_keys = /home/kallithea/.ssh/authorized_keys | |
136 | kallithea_cli_path = /srv/kallithea/venv/bin/kallithea-cli |
|
136 | kallithea_cli_path = /srv/kallithea/venv/bin/kallithea-cli | |
137 |
|
137 | |||
138 | The SSH service must be running, and the Kallithea user account must be active |
|
138 | The SSH service must be running, and the Kallithea user account must be active | |
139 | (not necessarily with password access, but public key access must be enabled), |
|
139 | (not necessarily with password access, but public key access must be enabled), | |
140 | all file permissions must be set as sshd wants it, and ``authorized_keys`` must |
|
140 | all file permissions must be set as sshd wants it, and ``authorized_keys`` must | |
141 | be writeable by the Kallithea user. |
|
141 | be writeable by the Kallithea user. | |
142 |
|
142 | |||
143 | .. note:: The ``authorized_keys`` file will be rewritten from scratch on |
|
143 | .. note:: The ``authorized_keys`` file will be rewritten from scratch on | |
144 | each update. If it already exists with other data, Kallithea will not |
|
144 | each update. If it already exists with other data, Kallithea will not | |
145 | overwrite the existing ``authorized_keys``, and the server process will |
|
145 | overwrite the existing ``authorized_keys``, and the server process will | |
146 | instead throw an exception. The system administrator thus cannot ssh |
|
146 | instead throw an exception. The system administrator thus cannot ssh | |
147 | directly to the Kallithea user but must use su/sudo from another account. |
|
147 | directly to the Kallithea user but must use su/sudo from another account. | |
148 |
|
148 | |||
149 | If ``/home/kallithea/.ssh/`` (the directory of the path specified in the |
|
149 | If ``/home/kallithea/.ssh/`` (the directory of the path specified in the | |
150 | ``ssh_authorized_keys`` setting of the ``.ini`` file) does not exist as a |
|
150 | ``ssh_authorized_keys`` setting of the ``.ini`` file) does not exist as a | |
151 | directory, Kallithea will attempt to create it. If that path exists but is |
|
151 | directory, Kallithea will attempt to create it. If that path exists but is | |
152 | *not* a directory, or is not readable-writable-executable by the server |
|
152 | *not* a directory, or is not readable-writable-executable by the server | |
153 | process, the server process will raise an exception each time it attempts to |
|
153 | process, the server process will raise an exception each time it attempts to | |
154 | write the ``authorized_keys`` file. |
|
154 | write the ``authorized_keys`` file. | |
155 |
|
155 | |||
156 | .. warning:: The handling of SSH access is steered directly by the command |
|
156 | .. warning:: The handling of SSH access is steered directly by the command | |
157 | specified in the ``authorized_keys`` file. There is no interaction with the |
|
157 | specified in the ``authorized_keys`` file. There is no interaction with the | |
158 | web UI. Once SSH access is correctly configured and enabled, it will work |
|
158 | web UI. Once SSH access is correctly configured and enabled, it will work | |
159 | regardless of whether the Kallithea web process is actually running. Hence, |
|
159 | regardless of whether the Kallithea web process is actually running. Hence, | |
160 | if you want to perform repository or server maintenance and want to fully |
|
160 | if you want to perform repository or server maintenance and want to fully | |
161 | disable all access to the repositories, disable SSH access by setting |
|
161 | disable all access to the repositories, disable SSH access by setting | |
162 | ``ssh_enabled = false`` in the correct ``.ini`` file (i.e. the ``.ini`` file |
|
162 | ``ssh_enabled = false`` in the correct ``.ini`` file (i.e. the ``.ini`` file | |
163 | specified in the ``authorized_keys`` file.) |
|
163 | specified in the ``authorized_keys`` file.) | |
164 |
|
164 | |||
165 | The ``authorized_keys`` file can be updated manually with ``kallithea-cli |
|
165 | The ``authorized_keys`` file can be updated manually with ``kallithea-cli | |
166 | ssh-update-authorized-keys -c my.ini``. This command is not needed in normal |
|
166 | ssh-update-authorized-keys -c my.ini``. This command is not needed in normal | |
167 | operation but is for example useful after changing SSH-related settings in the |
|
167 | operation but is for example useful after changing SSH-related settings in the | |
168 | ``.ini`` file or renaming that file. (The path to the ``.ini`` file is used in |
|
168 | ``.ini`` file or renaming that file. (The path to the ``.ini`` file is used in | |
169 | the generated ``authorized_keys`` file). |
|
169 | the generated ``authorized_keys`` file). | |
170 |
|
170 | |||
171 |
|
171 | |||
172 | Setting up Whoosh full text search |
|
172 | Setting up Whoosh full text search | |
173 | ---------------------------------- |
|
173 | ---------------------------------- | |
174 |
|
174 | |||
175 | Kallithea provides full text search of repositories using `Whoosh`__. |
|
175 | Kallithea provides full text search of repositories using `Whoosh`__. | |
176 |
|
176 | |||
177 | .. __: https://whoosh.readthedocs.io/en/latest/ |
|
177 | .. __: https://whoosh.readthedocs.io/en/latest/ | |
178 |
|
178 | |||
179 | For an incremental index build, run:: |
|
179 | For an incremental index build, run:: | |
180 |
|
180 | |||
181 | kallithea-cli index-create -c my.ini |
|
181 | kallithea-cli index-create -c my.ini | |
182 |
|
182 | |||
183 | For a full index rebuild, run:: |
|
183 | For a full index rebuild, run:: | |
184 |
|
184 | |||
185 | kallithea-cli index-create -c my.ini --full |
|
185 | kallithea-cli index-create -c my.ini --full | |
186 |
|
186 | |||
187 | The ``--repo-location`` option allows the location of the repositories to be overridden; |
|
187 | The ``--repo-location`` option allows the location of the repositories to be overridden; | |
188 | usually, the location is retrieved from the Kallithea database. |
|
188 | usually, the location is retrieved from the Kallithea database. | |
189 |
|
189 | |||
190 | The ``--index-only`` option can be used to limit the indexed repositories to a comma-separated list:: |
|
190 | The ``--index-only`` option can be used to limit the indexed repositories to a comma-separated list:: | |
191 |
|
191 | |||
192 | kallithea-cli index-create -c my.ini --index-only=vcs,kallithea |
|
192 | kallithea-cli index-create -c my.ini --index-only=vcs,kallithea | |
193 |
|
193 | |||
194 | To keep your index up-to-date it is necessary to do periodic index builds; |
|
194 | To keep your index up-to-date it is necessary to do periodic index builds; | |
195 | for this, it is recommended to use a crontab entry. Example:: |
|
195 | for this, it is recommended to use a crontab entry. Example:: | |
196 |
|
196 | |||
197 | 0 3 * * * /path/to/virtualenv/bin/kallithea-cli index-create -c /path/to/kallithea/my.ini |
|
197 | 0 3 * * * /path/to/virtualenv/bin/kallithea-cli index-create -c /path/to/kallithea/my.ini | |
198 |
|
198 | |||
199 | When using incremental mode (the default), Whoosh will check the last |
|
199 | When using incremental mode (the default), Whoosh will check the last | |
200 | modification date of each file and add it to be reindexed if a newer file is |
|
200 | modification date of each file and add it to be reindexed if a newer file is | |
201 | available. The indexing daemon checks for any removed files and removes them |
|
201 | available. The indexing daemon checks for any removed files and removes them | |
202 | from index. |
|
202 | from index. | |
203 |
|
203 | |||
204 | If you want to rebuild the index from scratch, you can use the ``-f`` flag as above, |
|
204 | If you want to rebuild the index from scratch, you can use the ``-f`` flag as above, | |
205 | or in the admin panel you can check the "build from scratch" checkbox. |
|
205 | or in the admin panel you can check the "build from scratch" checkbox. | |
206 |
|
206 | |||
207 |
|
207 | |||
208 | Integration with issue trackers |
|
208 | Integration with issue trackers | |
209 | ------------------------------- |
|
209 | ------------------------------- | |
210 |
|
210 | |||
211 | Kallithea provides a simple integration with issue trackers. It's possible |
|
211 | Kallithea provides a simple integration with issue trackers. It's possible | |
212 | to define a regular expression that will match an issue ID in commit messages, |
|
212 | to define a regular expression that will match an issue ID in commit messages, | |
213 | and have that replaced with a URL to the issue. |
|
213 | and have that replaced with a URL to the issue. | |
214 |
|
214 | |||
215 | This is achieved with following three variables in the ini file:: |
|
215 | This is achieved with following three variables in the ini file:: | |
216 |
|
216 | |||
217 | issue_pat = #(\d+) |
|
217 | issue_pat = #(\d+) | |
218 | issue_server_link = https://issues.example.com/{repo}/issue/\1 |
|
218 | issue_server_link = https://issues.example.com/{repo}/issue/\1 | |
219 | issue_sub = |
|
219 | issue_sub = | |
220 |
|
220 | |||
221 | ``issue_pat`` is the regular expression describing which strings in |
|
221 | ``issue_pat`` is the regular expression describing which strings in | |
222 | commit messages will be treated as issue references. The expression can/should |
|
222 | commit messages will be treated as issue references. The expression can/should | |
223 | have one or more parenthesized groups that can later be referred to in |
|
223 | have one or more parenthesized groups that can later be referred to in | |
224 | ``issue_server_link`` and ``issue_sub`` (see below). If you prefer, named groups |
|
224 | ``issue_server_link`` and ``issue_sub`` (see below). If you prefer, named groups | |
225 | can be used instead of simple parenthesized groups. |
|
225 | can be used instead of simple parenthesized groups. | |
226 |
|
226 | |||
227 | If the pattern should only match if it is preceded by whitespace, add the |
|
227 | If the pattern should only match if it is preceded by whitespace, add the | |
228 | following string before the actual pattern: ``(?:^|(?<=\s))``. |
|
228 | following string before the actual pattern: ``(?:^|(?<=\s))``. | |
229 | If the pattern should only match if it is followed by whitespace, add the |
|
229 | If the pattern should only match if it is followed by whitespace, add the | |
230 | following string after the actual pattern: ``(?:$|(?=\s))``. |
|
230 | following string after the actual pattern: ``(?:$|(?=\s))``. | |
231 | These expressions use lookbehind and lookahead assertions of the Python regular |
|
231 | These expressions use lookbehind and lookahead assertions of the Python regular | |
232 | expression module to avoid the whitespace to be part of the actual pattern, |
|
232 | expression module to avoid the whitespace to be part of the actual pattern, | |
233 | otherwise the link text will also contain that whitespace. |
|
233 | otherwise the link text will also contain that whitespace. | |
234 |
|
234 | |||
235 | Matched issue references are replaced with the link specified in |
|
235 | Matched issue references are replaced with the link specified in | |
236 | ``issue_server_link``, in which any backreferences are resolved. Backreferences |
|
236 | ``issue_server_link``, in which any backreferences are resolved. Backreferences | |
237 | can be ``\1``, ``\2``, ... or for named groups ``\g<groupname>``. |
|
237 | can be ``\1``, ``\2``, ... or for named groups ``\g<groupname>``. | |
238 | The special token ``{repo}`` is replaced with the full repository path |
|
238 | The special token ``{repo}`` is replaced with the full repository path | |
239 | (including repository groups), while token ``{repo_name}`` is replaced with the |
|
239 | (including repository groups), while token ``{repo_name}`` is replaced with the | |
240 | repository name (without repository groups). |
|
240 | repository name (without repository groups). | |
241 |
|
241 | |||
242 | The link text is determined by ``issue_sub``, which can be a string containing |
|
242 | The link text is determined by ``issue_sub``, which can be a string containing | |
243 | backreferences to the groups specified in ``issue_pat``. If ``issue_sub`` is |
|
243 | backreferences to the groups specified in ``issue_pat``. If ``issue_sub`` is | |
244 | empty, then the text matched by ``issue_pat`` is used verbatim. |
|
244 | empty, then the text matched by ``issue_pat`` is used verbatim. | |
245 |
|
245 | |||
246 | The example settings shown above match issues in the format ``#<number>``. |
|
246 | The example settings shown above match issues in the format ``#<number>``. | |
247 | This will cause the text ``#300`` to be transformed into a link: |
|
247 | This will cause the text ``#300`` to be transformed into a link: | |
248 |
|
248 | |||
249 | .. code-block:: html |
|
249 | .. code-block:: html | |
250 |
|
250 | |||
251 | <a href="https://issues.example.com/example_repo/issue/300">#300</a> |
|
251 | <a href="https://issues.example.com/example_repo/issue/300">#300</a> | |
252 |
|
252 | |||
253 | The following example transforms a text starting with either of 'pullrequest', |
|
253 | The following example transforms a text starting with either of 'pullrequest', | |
254 | 'pull request' or 'PR', followed by an optional space, then a pound character |
|
254 | 'pull request' or 'PR', followed by an optional space, then a pound character | |
255 | (#) and one or more digits, into a link with the text 'PR #' followed by the |
|
255 | (#) and one or more digits, into a link with the text 'PR #' followed by the | |
256 | digits:: |
|
256 | digits:: | |
257 |
|
257 | |||
258 | issue_pat = (pullrequest|pull request|PR) ?#(\d+) |
|
258 | issue_pat = (pullrequest|pull request|PR) ?#(\d+) | |
259 | issue_server_link = https://issues.example.com/\2 |
|
259 | issue_server_link = https://issues.example.com/\2 | |
260 | issue_sub = PR #\2 |
|
260 | issue_sub = PR #\2 | |
261 |
|
261 | |||
262 | The following example demonstrates how to require whitespace before the issue |
|
262 | The following example demonstrates how to require whitespace before the issue | |
263 | reference in order for it to be recognized, such that the text ``issue#123`` will |
|
263 | reference in order for it to be recognized, such that the text ``issue#123`` will | |
264 | not cause a match, but ``issue #123`` will:: |
|
264 | not cause a match, but ``issue #123`` will:: | |
265 |
|
265 | |||
266 | issue_pat = (?:^|(?<=\s))#(\d+) |
|
266 | issue_pat = (?:^|(?<=\s))#(\d+) | |
267 | issue_server_link = https://issues.example.com/\1 |
|
267 | issue_server_link = https://issues.example.com/\1 | |
268 | issue_sub = |
|
268 | issue_sub = | |
269 |
|
269 | |||
270 | If needed, more than one pattern can be specified by appending a unique suffix to |
|
270 | If needed, more than one pattern can be specified by appending a unique suffix to | |
271 | the variables. For example, also demonstrating the use of named groups:: |
|
271 | the variables. For example, also demonstrating the use of named groups:: | |
272 |
|
272 | |||
273 | issue_pat_wiki = wiki-(?P<pagename>\S+) |
|
273 | issue_pat_wiki = wiki-(?P<pagename>\S+) | |
274 | issue_server_link_wiki = https://wiki.example.com/\g<pagename> |
|
274 | issue_server_link_wiki = https://wiki.example.com/\g<pagename> | |
275 | issue_sub_wiki = WIKI-\g<pagename> |
|
275 | issue_sub_wiki = WIKI-\g<pagename> | |
276 |
|
276 | |||
277 | With these settings, wiki pages can be referenced as wiki-some-id, and every |
|
277 | With these settings, wiki pages can be referenced as wiki-some-id, and every | |
278 | such reference will be transformed into: |
|
278 | such reference will be transformed into: | |
279 |
|
279 | |||
280 | .. code-block:: html |
|
280 | .. code-block:: html | |
281 |
|
281 | |||
282 | <a href="https://wiki.example.com/some-id">WIKI-some-id</a> |
|
282 | <a href="https://wiki.example.com/some-id">WIKI-some-id</a> | |
283 |
|
283 | |||
284 | Refer to the `Python regular expression documentation`_ for more details about |
|
284 | Refer to the `Python regular expression documentation`_ for more details about | |
285 | the supported syntax in ``issue_pat``, ``issue_server_link`` and ``issue_sub``. |
|
285 | the supported syntax in ``issue_pat``, ``issue_server_link`` and ``issue_sub``. | |
286 |
|
286 | |||
287 |
|
287 | |||
288 | Hook management |
|
288 | Hook management | |
289 | --------------- |
|
289 | --------------- | |
290 |
|
290 | |||
291 | Hooks can be managed in similar way to that used in ``.hgrc`` files. |
|
291 | Hooks can be managed in similar way to that used in ``.hgrc`` files. | |
292 | To manage hooks, choose *Admin > Settings > Hooks*. |
|
292 | To manage hooks, choose *Admin > Settings > Hooks*. | |
293 |
|
293 | |||
294 | The built-in hooks cannot be modified, though they can be enabled or disabled in the *VCS* section. |
|
294 | The built-in hooks cannot be modified, though they can be enabled or disabled in the *VCS* section. | |
295 |
|
295 | |||
296 | To add another custom hook simply fill in the first textbox with |
|
296 | To add another custom hook simply fill in the first textbox with | |
297 | ``<name>.<hook_type>`` and the second with the hook path. Example hooks |
|
297 | ``<name>.<hook_type>`` and the second with the hook path. Example hooks | |
298 | can be found in ``kallithea.lib.hooks``. |
|
298 | can be found in ``kallithea.lib.hooks``. | |
299 |
|
299 | |||
300 |
|
300 | |||
301 | Changing default encoding |
|
301 | Changing default encoding | |
302 | ------------------------- |
|
302 | ------------------------- | |
303 |
|
303 | |||
304 | By default, Kallithea uses UTF-8 encoding. |
|
304 | By default, Kallithea uses UTF-8 encoding. | |
305 | This is configurable as ``default_encoding`` in the .ini file. |
|
305 | This is configurable as ``default_encoding`` in the .ini file. | |
306 | This affects many parts in Kallithea including user names, filenames, and |
|
306 | This affects many parts in Kallithea including user names, filenames, and | |
307 | encoding of commit messages. In addition Kallithea can detect if the ``chardet`` |
|
307 | encoding of commit messages. In addition Kallithea can detect if the ``chardet`` | |
308 | library is installed. If ``chardet`` is detected Kallithea will fallback to it |
|
308 | library is installed. If ``chardet`` is detected Kallithea will fallback to it | |
309 | when there are encode/decode errors. |
|
309 | when there are encode/decode errors. | |
310 |
|
310 | |||
311 | The Mercurial encoding is configurable as ``hgencoding``. It is similar to |
|
311 | The Mercurial encoding is configurable as ``hgencoding``. It is similar to | |
312 | setting the ``HGENCODING`` environment variable, but will override it. |
|
312 | setting the ``HGENCODING`` environment variable, but will override it. | |
313 |
|
313 | |||
314 |
|
314 | |||
315 | Celery configuration |
|
315 | Celery configuration | |
316 | -------------------- |
|
316 | -------------------- | |
317 |
|
317 | |||
318 | Kallithea can use the distributed task queue system Celery_ to run tasks like |
|
318 | Kallithea can use the distributed task queue system Celery_ to run tasks like | |
319 | cloning repositories or sending emails. |
|
319 | cloning repositories or sending emails. | |
320 |
|
320 | |||
321 | Kallithea will in most setups work perfectly fine out of the box (without |
|
321 | Kallithea will in most setups work perfectly fine out of the box (without | |
322 | Celery), executing all tasks in the web server process. Some tasks can however |
|
322 | Celery), executing all tasks in the web server process. Some tasks can however | |
323 | take some time to run and it can be better to run such tasks asynchronously in |
|
323 | take some time to run and it can be better to run such tasks asynchronously in | |
324 | a separate process so the web server can focus on serving web requests. |
|
324 | a separate process so the web server can focus on serving web requests. | |
325 |
|
325 | |||
326 | For installation and configuration of Celery, see the `Celery documentation`_. |
|
326 | For installation and configuration of Celery, see the `Celery documentation`_. | |
327 | Note that Celery requires a message broker service like RabbitMQ_ (recommended) |
|
327 | Note that Celery requires a message broker service like RabbitMQ_ (recommended) | |
328 | or Redis_. |
|
328 | or Redis_. | |
329 |
|
329 | |||
330 | The use of Celery is configured in the Kallithea ini configuration file. |
|
330 | The use of Celery is configured in the Kallithea ini configuration file. | |
331 | To enable it, simply set:: |
|
331 | To enable it, simply set:: | |
332 |
|
332 | |||
333 | use_celery = true |
|
333 | use_celery = true | |
334 |
|
334 | |||
335 |
and add or change the ``celery.*`` |
|
335 | and add or change the ``celery.*`` configuration variables. | |
336 |
|
336 | |||
337 | Remember that the ini files use the format with '.' and not with '_' like |
|
337 | Configuration settings are prefixed with 'celery.', so for example setting | |
338 | Celery. So for example setting `BROKER_HOST` in Celery means setting |
|
338 | `broker_url` in Celery means setting `celery.broker_url` in the configuration | |
339 | `broker.host` in the configuration file. |
|
339 | file. | |
340 |
|
340 | |||
341 | To start the Celery process, run:: |
|
341 | To start the Celery process, run:: | |
342 |
|
342 | |||
343 | kallithea-cli celery-run -c my.ini |
|
343 | kallithea-cli celery-run -c my.ini | |
344 |
|
344 | |||
345 | Extra options to the Celery worker can be passed after ``--`` - see ``-- -h`` |
|
345 | Extra options to the Celery worker can be passed after ``--`` - see ``-- -h`` | |
346 | for more info. |
|
346 | for more info. | |
347 |
|
347 | |||
348 | .. note:: |
|
348 | .. note:: | |
349 | Make sure you run this command from the same virtualenv, and with the same |
|
349 | Make sure you run this command from the same virtualenv, and with the same | |
350 | user that Kallithea runs. |
|
350 | user that Kallithea runs. | |
351 |
|
351 | |||
352 |
|
352 | |||
353 | HTTPS support |
|
353 | HTTPS support | |
354 | ------------- |
|
354 | ------------- | |
355 |
|
355 | |||
356 | Kallithea will by default generate URLs based on the WSGI environment. |
|
356 | Kallithea will by default generate URLs based on the WSGI environment. | |
357 |
|
357 | |||
358 | Alternatively, you can use some special configuration settings to control |
|
358 | Alternatively, you can use some special configuration settings to control | |
359 | directly which scheme/protocol Kallithea will use when generating URLs: |
|
359 | directly which scheme/protocol Kallithea will use when generating URLs: | |
360 |
|
360 | |||
361 | - With ``https_fixup = true``, the scheme will be taken from the |
|
361 | - With ``https_fixup = true``, the scheme will be taken from the | |
362 | ``X-Url-Scheme``, ``X-Forwarded-Scheme`` or ``X-Forwarded-Proto`` HTTP header |
|
362 | ``X-Url-Scheme``, ``X-Forwarded-Scheme`` or ``X-Forwarded-Proto`` HTTP header | |
363 | (default ``http``). |
|
363 | (default ``http``). | |
364 | - With ``force_https = true`` the default will be ``https``. |
|
364 | - With ``force_https = true`` the default will be ``https``. | |
365 | - With ``use_htsts = true``, Kallithea will set ``Strict-Transport-Security`` when using https. |
|
365 | - With ``use_htsts = true``, Kallithea will set ``Strict-Transport-Security`` when using https. | |
366 |
|
366 | |||
367 | .. _nginx_virtual_host: |
|
367 | .. _nginx_virtual_host: | |
368 |
|
368 | |||
369 |
|
369 | |||
370 | Nginx virtual host example |
|
370 | Nginx virtual host example | |
371 | -------------------------- |
|
371 | -------------------------- | |
372 |
|
372 | |||
373 | Sample config for Nginx using proxy: |
|
373 | Sample config for Nginx using proxy: | |
374 |
|
374 | |||
375 | .. code-block:: nginx |
|
375 | .. code-block:: nginx | |
376 |
|
376 | |||
377 | upstream kallithea { |
|
377 | upstream kallithea { | |
378 | server 127.0.0.1:5000; |
|
378 | server 127.0.0.1:5000; | |
379 | # add more instances for load balancing |
|
379 | # add more instances for load balancing | |
380 | #server 127.0.0.1:5001; |
|
380 | #server 127.0.0.1:5001; | |
381 | #server 127.0.0.1:5002; |
|
381 | #server 127.0.0.1:5002; | |
382 | } |
|
382 | } | |
383 |
|
383 | |||
384 | ## gist alias |
|
384 | ## gist alias | |
385 | server { |
|
385 | server { | |
386 | listen 443; |
|
386 | listen 443; | |
387 | server_name gist.example.com; |
|
387 | server_name gist.example.com; | |
388 | access_log /var/log/nginx/gist.access.log; |
|
388 | access_log /var/log/nginx/gist.access.log; | |
389 | error_log /var/log/nginx/gist.error.log; |
|
389 | error_log /var/log/nginx/gist.error.log; | |
390 |
|
390 | |||
391 | ssl on; |
|
391 | ssl on; | |
392 | ssl_certificate gist.your.kallithea.server.crt; |
|
392 | ssl_certificate gist.your.kallithea.server.crt; | |
393 | ssl_certificate_key gist.your.kallithea.server.key; |
|
393 | ssl_certificate_key gist.your.kallithea.server.key; | |
394 |
|
394 | |||
395 | ssl_session_timeout 5m; |
|
395 | ssl_session_timeout 5m; | |
396 |
|
396 | |||
397 | ssl_protocols SSLv3 TLSv1; |
|
397 | ssl_protocols SSLv3 TLSv1; | |
398 | ssl_ciphers DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:EDH-RSA-DES-CBC3-SHA:AES256-SHA:DES-CBC3-SHA:AES128-SHA:RC4-SHA:RC4-MD5; |
|
398 | ssl_ciphers DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:EDH-RSA-DES-CBC3-SHA:AES256-SHA:DES-CBC3-SHA:AES128-SHA:RC4-SHA:RC4-MD5; | |
399 | ssl_prefer_server_ciphers on; |
|
399 | ssl_prefer_server_ciphers on; | |
400 |
|
400 | |||
401 | rewrite ^/(.+)$ https://kallithea.example.com/_admin/gists/$1; |
|
401 | rewrite ^/(.+)$ https://kallithea.example.com/_admin/gists/$1; | |
402 | rewrite (.*) https://kallithea.example.com/_admin/gists; |
|
402 | rewrite (.*) https://kallithea.example.com/_admin/gists; | |
403 | } |
|
403 | } | |
404 |
|
404 | |||
405 | server { |
|
405 | server { | |
406 | listen 443; |
|
406 | listen 443; | |
407 | server_name kallithea.example.com |
|
407 | server_name kallithea.example.com | |
408 | access_log /var/log/nginx/kallithea.access.log; |
|
408 | access_log /var/log/nginx/kallithea.access.log; | |
409 | error_log /var/log/nginx/kallithea.error.log; |
|
409 | error_log /var/log/nginx/kallithea.error.log; | |
410 |
|
410 | |||
411 | ssl on; |
|
411 | ssl on; | |
412 | ssl_certificate your.kallithea.server.crt; |
|
412 | ssl_certificate your.kallithea.server.crt; | |
413 | ssl_certificate_key your.kallithea.server.key; |
|
413 | ssl_certificate_key your.kallithea.server.key; | |
414 |
|
414 | |||
415 | ssl_session_timeout 5m; |
|
415 | ssl_session_timeout 5m; | |
416 |
|
416 | |||
417 | ssl_protocols SSLv3 TLSv1; |
|
417 | ssl_protocols SSLv3 TLSv1; | |
418 | ssl_ciphers DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:EDH-RSA-DES-CBC3-SHA:AES256-SHA:DES-CBC3-SHA:AES128-SHA:RC4-SHA:RC4-MD5; |
|
418 | ssl_ciphers DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:EDH-RSA-DES-CBC3-SHA:AES256-SHA:DES-CBC3-SHA:AES128-SHA:RC4-SHA:RC4-MD5; | |
419 | ssl_prefer_server_ciphers on; |
|
419 | ssl_prefer_server_ciphers on; | |
420 |
|
420 | |||
421 | ## uncomment root directive if you want to serve static files by nginx |
|
421 | ## uncomment root directive if you want to serve static files by nginx | |
422 | ## requires static_files = false in .ini file |
|
422 | ## requires static_files = false in .ini file | |
423 | #root /srv/kallithea/kallithea/kallithea/public; |
|
423 | #root /srv/kallithea/kallithea/kallithea/public; | |
424 | include /etc/nginx/proxy.conf; |
|
424 | include /etc/nginx/proxy.conf; | |
425 | location / { |
|
425 | location / { | |
426 | try_files $uri @kallithea; |
|
426 | try_files $uri @kallithea; | |
427 | } |
|
427 | } | |
428 |
|
428 | |||
429 | location @kallithea { |
|
429 | location @kallithea { | |
430 | proxy_pass http://127.0.0.1:5000; |
|
430 | proxy_pass http://127.0.0.1:5000; | |
431 | } |
|
431 | } | |
432 |
|
432 | |||
433 | } |
|
433 | } | |
434 |
|
434 | |||
435 | Here's the proxy.conf. It's tuned so it will not timeout on long |
|
435 | Here's the proxy.conf. It's tuned so it will not timeout on long | |
436 | pushes or large pushes:: |
|
436 | pushes or large pushes:: | |
437 |
|
437 | |||
438 | proxy_redirect off; |
|
438 | proxy_redirect off; | |
439 | proxy_set_header Host $host; |
|
439 | proxy_set_header Host $host; | |
440 | ## needed for container auth |
|
440 | ## needed for container auth | |
441 | #proxy_set_header REMOTE_USER $remote_user; |
|
441 | #proxy_set_header REMOTE_USER $remote_user; | |
442 | #proxy_set_header X-Forwarded-User $remote_user; |
|
442 | #proxy_set_header X-Forwarded-User $remote_user; | |
443 | proxy_set_header X-Url-Scheme $scheme; |
|
443 | proxy_set_header X-Url-Scheme $scheme; | |
444 | proxy_set_header X-Host $http_host; |
|
444 | proxy_set_header X-Host $http_host; | |
445 | proxy_set_header X-Real-IP $remote_addr; |
|
445 | proxy_set_header X-Real-IP $remote_addr; | |
446 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
|
446 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
447 | proxy_set_header Proxy-host $proxy_host; |
|
447 | proxy_set_header Proxy-host $proxy_host; | |
448 | proxy_buffering off; |
|
448 | proxy_buffering off; | |
449 | proxy_connect_timeout 7200; |
|
449 | proxy_connect_timeout 7200; | |
450 | proxy_send_timeout 7200; |
|
450 | proxy_send_timeout 7200; | |
451 | proxy_read_timeout 7200; |
|
451 | proxy_read_timeout 7200; | |
452 | proxy_buffers 8 32k; |
|
452 | proxy_buffers 8 32k; | |
453 | client_max_body_size 1024m; |
|
453 | client_max_body_size 1024m; | |
454 | client_body_buffer_size 128k; |
|
454 | client_body_buffer_size 128k; | |
455 | large_client_header_buffers 8 64k; |
|
455 | large_client_header_buffers 8 64k; | |
456 |
|
456 | |||
457 | .. _apache_virtual_host_reverse_proxy: |
|
457 | .. _apache_virtual_host_reverse_proxy: | |
458 |
|
458 | |||
459 |
|
459 | |||
460 | Apache virtual host reverse proxy example |
|
460 | Apache virtual host reverse proxy example | |
461 | ----------------------------------------- |
|
461 | ----------------------------------------- | |
462 |
|
462 | |||
463 | Here is a sample configuration file for Apache using proxy: |
|
463 | Here is a sample configuration file for Apache using proxy: | |
464 |
|
464 | |||
465 | .. code-block:: apache |
|
465 | .. code-block:: apache | |
466 |
|
466 | |||
467 | <VirtualHost *:80> |
|
467 | <VirtualHost *:80> | |
468 | ServerName kallithea.example.com |
|
468 | ServerName kallithea.example.com | |
469 |
|
469 | |||
470 | <Proxy *> |
|
470 | <Proxy *> | |
471 | # For Apache 2.4 and later: |
|
471 | # For Apache 2.4 and later: | |
472 | Require all granted |
|
472 | Require all granted | |
473 |
|
473 | |||
474 | # For Apache 2.2 and earlier, instead use: |
|
474 | # For Apache 2.2 and earlier, instead use: | |
475 | # Order allow,deny |
|
475 | # Order allow,deny | |
476 | # Allow from all |
|
476 | # Allow from all | |
477 | </Proxy> |
|
477 | </Proxy> | |
478 |
|
478 | |||
479 | #important ! |
|
479 | #important ! | |
480 | #Directive to properly generate url (clone url) for Kallithea |
|
480 | #Directive to properly generate url (clone url) for Kallithea | |
481 | ProxyPreserveHost On |
|
481 | ProxyPreserveHost On | |
482 |
|
482 | |||
483 | #kallithea instance |
|
483 | #kallithea instance | |
484 | ProxyPass / http://127.0.0.1:5000/ |
|
484 | ProxyPass / http://127.0.0.1:5000/ | |
485 | ProxyPassReverse / http://127.0.0.1:5000/ |
|
485 | ProxyPassReverse / http://127.0.0.1:5000/ | |
486 |
|
486 | |||
487 | #to enable https use line below |
|
487 | #to enable https use line below | |
488 | #SetEnvIf X-Url-Scheme https HTTPS=1 |
|
488 | #SetEnvIf X-Url-Scheme https HTTPS=1 | |
489 | </VirtualHost> |
|
489 | </VirtualHost> | |
490 |
|
490 | |||
491 | Additional tutorial |
|
491 | Additional tutorial | |
492 | http://pylonsbook.com/en/1.1/deployment.html#using-apache-to-proxy-requests-to-pylons |
|
492 | http://pylonsbook.com/en/1.1/deployment.html#using-apache-to-proxy-requests-to-pylons | |
493 |
|
493 | |||
494 | .. _apache_subdirectory: |
|
494 | .. _apache_subdirectory: | |
495 |
|
495 | |||
496 |
|
496 | |||
497 | Apache as subdirectory |
|
497 | Apache as subdirectory | |
498 | ---------------------- |
|
498 | ---------------------- | |
499 |
|
499 | |||
500 | Apache subdirectory part: |
|
500 | Apache subdirectory part: | |
501 |
|
501 | |||
502 | .. code-block:: apache |
|
502 | .. code-block:: apache | |
503 |
|
503 | |||
504 | <Location /PREFIX > |
|
504 | <Location /PREFIX > | |
505 | ProxyPass http://127.0.0.1:5000/PREFIX |
|
505 | ProxyPass http://127.0.0.1:5000/PREFIX | |
506 | ProxyPassReverse http://127.0.0.1:5000/PREFIX |
|
506 | ProxyPassReverse http://127.0.0.1:5000/PREFIX | |
507 | SetEnvIf X-Url-Scheme https HTTPS=1 |
|
507 | SetEnvIf X-Url-Scheme https HTTPS=1 | |
508 | </Location> |
|
508 | </Location> | |
509 |
|
509 | |||
510 | Besides the regular apache setup you will need to add the following line |
|
510 | Besides the regular apache setup you will need to add the following line | |
511 | into ``[app:main]`` section of your .ini file:: |
|
511 | into ``[app:main]`` section of your .ini file:: | |
512 |
|
512 | |||
513 | filter-with = proxy-prefix |
|
513 | filter-with = proxy-prefix | |
514 |
|
514 | |||
515 | Add the following at the end of the .ini file:: |
|
515 | Add the following at the end of the .ini file:: | |
516 |
|
516 | |||
517 | [filter:proxy-prefix] |
|
517 | [filter:proxy-prefix] | |
518 | use = egg:PasteDeploy#prefix |
|
518 | use = egg:PasteDeploy#prefix | |
519 | prefix = /PREFIX |
|
519 | prefix = /PREFIX | |
520 |
|
520 | |||
521 | then change ``PREFIX`` into your chosen prefix |
|
521 | then change ``PREFIX`` into your chosen prefix | |
522 |
|
522 | |||
523 | .. _apache_mod_wsgi: |
|
523 | .. _apache_mod_wsgi: | |
524 |
|
524 | |||
525 |
|
525 | |||
526 | Apache with mod_wsgi |
|
526 | Apache with mod_wsgi | |
527 | -------------------- |
|
527 | -------------------- | |
528 |
|
528 | |||
529 | Alternatively, Kallithea can be set up with Apache under mod_wsgi. For |
|
529 | Alternatively, Kallithea can be set up with Apache under mod_wsgi. For | |
530 | that, you'll need to: |
|
530 | that, you'll need to: | |
531 |
|
531 | |||
532 | - Install mod_wsgi. If using a Debian-based distro, you can install |
|
532 | - Install mod_wsgi. If using a Debian-based distro, you can install | |
533 | the package libapache2-mod-wsgi:: |
|
533 | the package libapache2-mod-wsgi:: | |
534 |
|
534 | |||
535 | aptitude install libapache2-mod-wsgi |
|
535 | aptitude install libapache2-mod-wsgi | |
536 |
|
536 | |||
537 | - Enable mod_wsgi:: |
|
537 | - Enable mod_wsgi:: | |
538 |
|
538 | |||
539 | a2enmod wsgi |
|
539 | a2enmod wsgi | |
540 |
|
540 | |||
541 | - Add global Apache configuration to tell mod_wsgi that Python only will be |
|
541 | - Add global Apache configuration to tell mod_wsgi that Python only will be | |
542 | used in the WSGI processes and shouldn't be initialized in the Apache |
|
542 | used in the WSGI processes and shouldn't be initialized in the Apache | |
543 | processes:: |
|
543 | processes:: | |
544 |
|
544 | |||
545 | WSGIRestrictEmbedded On |
|
545 | WSGIRestrictEmbedded On | |
546 |
|
546 | |||
547 | - Create a WSGI dispatch script, like the one below. Make sure you |
|
547 | - Create a WSGI dispatch script, like the one below. Make sure you | |
548 | check that the paths correctly point to where you installed Kallithea |
|
548 | check that the paths correctly point to where you installed Kallithea | |
549 | and its Python Virtual Environment. |
|
549 | and its Python Virtual Environment. | |
550 |
|
550 | |||
551 | .. code-block:: python |
|
551 | .. code-block:: python | |
552 |
|
552 | |||
553 | import os |
|
553 | import os | |
554 | os.environ['PYTHON_EGG_CACHE'] = '/srv/kallithea/.egg-cache' |
|
554 | os.environ['PYTHON_EGG_CACHE'] = '/srv/kallithea/.egg-cache' | |
555 |
|
555 | |||
556 | # sometimes it's needed to set the current dir |
|
556 | # sometimes it's needed to set the current dir | |
557 | os.chdir('/srv/kallithea/') |
|
557 | os.chdir('/srv/kallithea/') | |
558 |
|
558 | |||
559 | import site |
|
559 | import site | |
560 | site.addsitedir("/srv/kallithea/venv/lib/python3.7/site-packages") |
|
560 | site.addsitedir("/srv/kallithea/venv/lib/python3.7/site-packages") | |
561 |
|
561 | |||
562 | ini = '/srv/kallithea/my.ini' |
|
562 | ini = '/srv/kallithea/my.ini' | |
563 | from logging.config import fileConfig |
|
563 | from logging.config import fileConfig | |
564 | fileConfig(ini, {'__file__': ini, 'here': '/srv/kallithea'}) |
|
564 | fileConfig(ini, {'__file__': ini, 'here': '/srv/kallithea'}) | |
565 | from paste.deploy import loadapp |
|
565 | from paste.deploy import loadapp | |
566 | application = loadapp('config:' + ini) |
|
566 | application = loadapp('config:' + ini) | |
567 |
|
567 | |||
568 | Or using proper virtualenv activation: |
|
568 | Or using proper virtualenv activation: | |
569 |
|
569 | |||
570 | .. code-block:: python |
|
570 | .. code-block:: python | |
571 |
|
571 | |||
572 | activate_this = '/srv/kallithea/venv/bin/activate_this.py' |
|
572 | activate_this = '/srv/kallithea/venv/bin/activate_this.py' | |
573 | execfile(activate_this, dict(__file__=activate_this)) |
|
573 | execfile(activate_this, dict(__file__=activate_this)) | |
574 |
|
574 | |||
575 | import os |
|
575 | import os | |
576 | os.environ['HOME'] = '/srv/kallithea' |
|
576 | os.environ['HOME'] = '/srv/kallithea' | |
577 |
|
577 | |||
578 | ini = '/srv/kallithea/kallithea.ini' |
|
578 | ini = '/srv/kallithea/kallithea.ini' | |
579 | from logging.config import fileConfig |
|
579 | from logging.config import fileConfig | |
580 | fileConfig(ini, {'__file__': ini, 'here': '/srv/kallithea'}) |
|
580 | fileConfig(ini, {'__file__': ini, 'here': '/srv/kallithea'}) | |
581 | from paste.deploy import loadapp |
|
581 | from paste.deploy import loadapp | |
582 | application = loadapp('config:' + ini) |
|
582 | application = loadapp('config:' + ini) | |
583 |
|
583 | |||
584 | - Add the necessary ``WSGI*`` directives to the Apache Virtual Host configuration |
|
584 | - Add the necessary ``WSGI*`` directives to the Apache Virtual Host configuration | |
585 | file, like in the example below. Notice that the WSGI dispatch script created |
|
585 | file, like in the example below. Notice that the WSGI dispatch script created | |
586 | above is referred to with the ``WSGIScriptAlias`` directive. |
|
586 | above is referred to with the ``WSGIScriptAlias`` directive. | |
587 | The default locale settings Apache provides for web services are often not |
|
587 | The default locale settings Apache provides for web services are often not | |
588 | adequate, with `C` as the default language and `ASCII` as the encoding. |
|
588 | adequate, with `C` as the default language and `ASCII` as the encoding. | |
589 | Instead, use the ``lang`` parameter of ``WSGIDaemonProcess`` to specify a |
|
589 | Instead, use the ``lang`` parameter of ``WSGIDaemonProcess`` to specify a | |
590 | suitable locale. See also the :ref:`overview` section and the |
|
590 | suitable locale. See also the :ref:`overview` section and the | |
591 | `WSGIDaemonProcess documentation`_. |
|
591 | `WSGIDaemonProcess documentation`_. | |
592 |
|
592 | |||
593 | Apache will by default run as a special Apache user, on Linux systems |
|
593 | Apache will by default run as a special Apache user, on Linux systems | |
594 | usually ``www-data`` or ``apache``. If you need to have the repositories |
|
594 | usually ``www-data`` or ``apache``. If you need to have the repositories | |
595 | directory owned by a different user, use the user and group options to |
|
595 | directory owned by a different user, use the user and group options to | |
596 | WSGIDaemonProcess to set the name of the user and group. |
|
596 | WSGIDaemonProcess to set the name of the user and group. | |
597 |
|
597 | |||
598 | Once again, check that all paths are correctly specified. |
|
598 | Once again, check that all paths are correctly specified. | |
599 |
|
599 | |||
600 | .. code-block:: apache |
|
600 | .. code-block:: apache | |
601 |
|
601 | |||
602 | WSGIDaemonProcess kallithea processes=5 threads=1 maximum-requests=100 \ |
|
602 | WSGIDaemonProcess kallithea processes=5 threads=1 maximum-requests=100 \ | |
603 | python-home=/srv/kallithea/venv lang=C.UTF-8 |
|
603 | python-home=/srv/kallithea/venv lang=C.UTF-8 | |
604 | WSGIProcessGroup kallithea |
|
604 | WSGIProcessGroup kallithea | |
605 | WSGIScriptAlias / /srv/kallithea/dispatch.wsgi |
|
605 | WSGIScriptAlias / /srv/kallithea/dispatch.wsgi | |
606 | WSGIPassAuthorization On |
|
606 | WSGIPassAuthorization On | |
607 |
|
607 | |||
608 | Or if using a dispatcher WSGI script with proper virtualenv activation: |
|
608 | Or if using a dispatcher WSGI script with proper virtualenv activation: | |
609 |
|
609 | |||
610 | .. code-block:: apache |
|
610 | .. code-block:: apache | |
611 |
|
611 | |||
612 | WSGIDaemonProcess kallithea processes=5 threads=1 maximum-requests=100 lang=en_US.utf8 |
|
612 | WSGIDaemonProcess kallithea processes=5 threads=1 maximum-requests=100 lang=en_US.utf8 | |
613 | WSGIProcessGroup kallithea |
|
613 | WSGIProcessGroup kallithea | |
614 | WSGIScriptAlias / /srv/kallithea/dispatch.wsgi |
|
614 | WSGIScriptAlias / /srv/kallithea/dispatch.wsgi | |
615 | WSGIPassAuthorization On |
|
615 | WSGIPassAuthorization On | |
616 |
|
616 | |||
617 |
|
617 | |||
618 | Other configuration files |
|
618 | Other configuration files | |
619 | ------------------------- |
|
619 | ------------------------- | |
620 |
|
620 | |||
621 | A number of `example init.d scripts`__ can be found in |
|
621 | A number of `example init.d scripts`__ can be found in | |
622 | the ``init.d`` directory of the Kallithea source. |
|
622 | the ``init.d`` directory of the Kallithea source. | |
623 |
|
623 | |||
624 | .. __: https://kallithea-scm.org/repos/kallithea/files/tip/init.d/ . |
|
624 | .. __: https://kallithea-scm.org/repos/kallithea/files/tip/init.d/ . | |
625 |
|
625 | |||
626 |
|
626 | |||
627 | .. _python: http://www.python.org/ |
|
627 | .. _python: http://www.python.org/ | |
628 | .. _Python regular expression documentation: https://docs.python.org/2/library/re.html |
|
628 | .. _Python regular expression documentation: https://docs.python.org/2/library/re.html | |
629 | .. _Mercurial: https://www.mercurial-scm.org/ |
|
629 | .. _Mercurial: https://www.mercurial-scm.org/ | |
630 | .. _Celery: http://celeryproject.org/ |
|
630 | .. _Celery: http://celeryproject.org/ | |
631 | .. _Celery documentation: http://docs.celeryproject.org/en/latest/getting-started/index.html |
|
631 | .. _Celery documentation: http://docs.celeryproject.org/en/latest/getting-started/index.html | |
632 | .. _RabbitMQ: http://www.rabbitmq.com/ |
|
632 | .. _RabbitMQ: http://www.rabbitmq.com/ | |
633 | .. _Redis: http://redis.io/ |
|
633 | .. _Redis: http://redis.io/ | |
634 | .. _mercurial-server: http://www.lshift.net/mercurial-server.html |
|
634 | .. _mercurial-server: http://www.lshift.net/mercurial-server.html | |
635 | .. _PublishingRepositories: https://www.mercurial-scm.org/wiki/PublishingRepositories |
|
635 | .. _PublishingRepositories: https://www.mercurial-scm.org/wiki/PublishingRepositories | |
636 | .. _WSGIDaemonProcess documentation: https://modwsgi.readthedocs.io/en/develop/configuration-directives/WSGIDaemonProcess.html |
|
636 | .. _WSGIDaemonProcess documentation: https://modwsgi.readthedocs.io/en/develop/configuration-directives/WSGIDaemonProcess.html |
@@ -1,77 +1,92 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | """ |
|
3 | """ | |
4 | Kallithea wrapper of Celery |
|
4 | Kallithea wrapper of Celery | |
5 |
|
5 | |||
6 | The Celery configuration is in the Kallithea ini file but must be converted to an |
|
6 | The Celery configuration is in the Kallithea ini file but must be converted to an | |
7 | entirely different format before Celery can use it. |
|
7 | entirely different format before Celery can use it. | |
8 |
|
8 | |||
9 | We read the configuration from tg.config at module import time. This module can |
|
9 | We read the configuration from tg.config at module import time. This module can | |
10 | thus not be imported in global scope but must be imported on demand in function |
|
10 | thus not be imported in global scope but must be imported on demand in function | |
11 | scope after tg.config has been initialized. |
|
11 | scope after tg.config has been initialized. | |
12 |
|
12 | |||
13 | To make sure that the config really has been initialized, we check one of the |
|
13 | To make sure that the config really has been initialized, we check one of the | |
14 | mandatory settings. |
|
14 | mandatory settings. | |
15 | """ |
|
15 | """ | |
16 |
|
16 | |||
17 | import logging |
|
17 | import logging | |
18 |
|
18 | |||
19 | import celery |
|
19 | import celery | |
20 | import tg |
|
20 | import tg | |
21 |
|
21 | |||
22 | import kallithea |
|
22 | import kallithea | |
23 |
|
23 | |||
24 |
|
24 | |||
25 | class CeleryConfig(object): |
|
25 | class CeleryConfig(object): | |
26 |
|
|
26 | imports = ['kallithea.lib.celerylib.tasks'] | |
27 | CELERY_ACCEPT_CONTENT = ['json'] |
|
27 | task_always_eager = False | |
28 | CELERY_RESULT_SERIALIZER = 'json' |
|
28 | ||
29 | CELERY_TASK_SERIALIZER = 'json' |
|
29 | # map from Kallithea .ini Celery 3 config names to Celery 4 config names | |
30 | CELERY_ALWAYS_EAGER = False |
|
30 | celery3_compat = { | |
|
31 | 'broker.url': 'broker_url', | |||
|
32 | 'celery.accept.content': 'accept_content', | |||
|
33 | 'celery.always.eager': 'task_always_eager', | |||
|
34 | 'celery.amqp.task.result.expires': 'result_expires', | |||
|
35 | 'celeryd.concurrency': 'worker_concurrency', | |||
|
36 | 'celeryd.max.tasks.per.child': 'worker_max_tasks_per_child', | |||
|
37 | #'celery.imports' ends up unchanged | |||
|
38 | 'celery.result.backend': 'result_backend', | |||
|
39 | 'celery.result.serializer': 'result_serializer', | |||
|
40 | 'celery.task.serializer': 'task_serializer', | |||
|
41 | } | |||
|
42 | ||||
|
43 | list_config_names = """imports accept_content""".split() | |||
31 |
|
44 | |||
32 |
|
45 | |||
33 | desupported = set([ |
|
46 | desupported = set([ | |
34 | 'celery.result.dburi', |
|
47 | 'celery.result.dburi', | |
35 | 'celery.result.serialier', |
|
48 | 'celery.result.serialier', | |
36 | 'celery.send.task.error.emails', |
|
49 | 'celery.send.task.error.emails', | |
37 | ]) |
|
50 | ]) | |
38 |
|
51 | |||
39 |
|
52 | |||
40 | log = logging.getLogger(__name__) |
|
53 | log = logging.getLogger(__name__) | |
41 |
|
54 | |||
42 |
|
55 | |||
43 | def make_celery_config(config): |
|
56 | def make_celery_config(config): | |
44 | """Return Celery config object populated from relevant settings in a config dict, such as tg.config""" |
|
57 | """Return Celery config object populated from relevant settings in a config dict, such as tg.config""" | |
45 |
|
58 | |||
46 | celery_config = CeleryConfig() |
|
59 | celery_config = CeleryConfig() | |
47 |
|
60 | |||
48 | PREFIXES = """ADMINS BROKER CASSANDRA CELERYBEAT CELERYD CELERYMON CELERY EMAIL SERVER""".split() |
|
|||
49 | LIST_PARAMS = """CELERY_IMPORTS CELERY_ACCEPT_CONTENT""".split() |
|
|||
50 |
|
||||
51 | for config_key, config_value in sorted(config.items()): |
|
61 | for config_key, config_value in sorted(config.items()): | |
52 | if config_key in desupported and config_value: |
|
62 | if config_key in desupported and config_value: | |
53 | log.error('Celery configuration setting %r is no longer supported', config_key) |
|
63 | log.error('Celery configuration setting %r is no longer supported', config_key) | |
54 | celery_key = config_key.replace('.', '_').upper() |
|
64 | celery_key = celery3_compat.get(config_key) | |
55 | if celery_key.split('_', 1)[0] not in PREFIXES: |
|
65 | parts = config_key.split('.', 1) | |
|
66 | if celery_key: # explicit Celery 3 backwards compatibility | |||
|
67 | pass | |||
|
68 | elif parts[0] == 'celery' and len(parts) == 2: # Celery 4 config key | |||
|
69 | celery_key = parts[1] | |||
|
70 | else: | |||
56 | continue |
|
71 | continue | |
57 | if not isinstance(config_value, str): |
|
72 | if not isinstance(config_value, str): | |
58 | continue |
|
73 | continue | |
59 |
if celery_key in |
|
74 | if celery_key in list_config_names: | |
60 | celery_value = config_value.split() |
|
75 | celery_value = config_value.split() | |
61 | elif config_value.isdigit(): |
|
76 | elif config_value.isdigit(): | |
62 | celery_value = int(config_value) |
|
77 | celery_value = int(config_value) | |
63 | elif config_value.lower() in ['true', 'false']: |
|
78 | elif config_value.lower() in ['true', 'false']: | |
64 | celery_value = config_value.lower() == 'true' |
|
79 | celery_value = config_value.lower() == 'true' | |
65 | else: |
|
80 | else: | |
66 | celery_value = config_value |
|
81 | celery_value = config_value | |
67 | setattr(celery_config, celery_key, celery_value) |
|
82 | setattr(celery_config, celery_key, celery_value) | |
68 | return celery_config |
|
83 | return celery_config | |
69 |
|
84 | |||
70 |
|
85 | |||
71 | def make_app(): |
|
86 | def make_app(): | |
72 | """Create celery app from the TurboGears configuration file""" |
|
87 | """Create celery app from the TurboGears configuration file""" | |
73 | app = celery.Celery() |
|
88 | app = celery.Celery() | |
74 | celery_config = make_celery_config(tg.config) |
|
89 | celery_config = make_celery_config(tg.config) | |
75 |
kallithea.CELERY_EAGER = celery_config. |
|
90 | kallithea.CELERY_EAGER = celery_config.task_always_eager | |
76 | app.config_from_object(celery_config) |
|
91 | app.config_from_object(celery_config) | |
77 | return app |
|
92 | return app |
@@ -1,697 +1,698 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 languages requested by the browser are used if available, with English as default.</%text> |
|
188 | <%text>## By default, the languages requested by the browser are used if available, with English as default.</%text> | |
189 | <%text>## Set i18n.enabled=false to disable automatic language choice.</%text> |
|
189 | <%text>## Set i18n.enabled=false to disable automatic language choice.</%text> | |
190 | #i18n.enabled = true |
|
190 | #i18n.enabled = true | |
191 | <%text>## To Force a language, set i18n.enabled=false and specify the language in i18n.lang.</%text> |
|
191 | <%text>## To Force a language, set i18n.enabled=false and specify the language in i18n.lang.</%text> | |
192 | <%text>## Valid values are the names of subdirectories in kallithea/i18n with a LC_MESSAGES/kallithea.mo</%text> |
|
192 | <%text>## Valid values are the names of subdirectories in kallithea/i18n with a LC_MESSAGES/kallithea.mo</%text> | |
193 | #i18n.lang = en |
|
193 | #i18n.lang = en | |
194 |
|
194 | |||
195 | cache_dir = %(here)s/data |
|
195 | cache_dir = %(here)s/data | |
196 | index_dir = %(here)s/data/index |
|
196 | index_dir = %(here)s/data/index | |
197 |
|
197 | |||
198 | <%text>## uncomment and set this path to use archive download cache</%text> |
|
198 | <%text>## uncomment and set this path to use archive download cache</%text> | |
199 | archive_cache_dir = %(here)s/tarballcache |
|
199 | archive_cache_dir = %(here)s/tarballcache | |
200 |
|
200 | |||
201 | <%text>## change this to unique ID for security</%text> |
|
201 | <%text>## change this to unique ID for security</%text> | |
202 | app_instance_uuid = ${uuid()} |
|
202 | app_instance_uuid = ${uuid()} | |
203 |
|
203 | |||
204 | <%text>## cut off limit for large diffs (size in bytes)</%text> |
|
204 | <%text>## cut off limit for large diffs (size in bytes)</%text> | |
205 | cut_off_limit = 256000 |
|
205 | cut_off_limit = 256000 | |
206 |
|
206 | |||
207 | <%text>## force https in Kallithea, fixes https redirects, assumes it's always https</%text> |
|
207 | <%text>## force https in Kallithea, fixes https redirects, assumes it's always https</%text> | |
208 | force_https = false |
|
208 | force_https = false | |
209 |
|
209 | |||
210 | <%text>## use Strict-Transport-Security headers</%text> |
|
210 | <%text>## use Strict-Transport-Security headers</%text> | |
211 | use_htsts = false |
|
211 | use_htsts = false | |
212 |
|
212 | |||
213 | <%text>## number of commits stats will parse on each iteration</%text> |
|
213 | <%text>## number of commits stats will parse on each iteration</%text> | |
214 | commit_parse_limit = 25 |
|
214 | commit_parse_limit = 25 | |
215 |
|
215 | |||
216 | <%text>## Path to Python executable to be used for git hooks.</%text> |
|
216 | <%text>## Path to Python executable to be used for git hooks.</%text> | |
217 | <%text>## This value will be written inside the git hook scripts as the text</%text> |
|
217 | <%text>## This value will be written inside the git hook scripts as the text</%text> | |
218 | <%text>## after '#!' (shebang). When empty or not defined, the value of</%text> |
|
218 | <%text>## after '#!' (shebang). When empty or not defined, the value of</%text> | |
219 | <%text>## 'sys.executable' at the time of installation of the git hooks is</%text> |
|
219 | <%text>## 'sys.executable' at the time of installation of the git hooks is</%text> | |
220 | <%text>## used, which is correct in many cases but for example not when using uwsgi.</%text> |
|
220 | <%text>## used, which is correct in many cases but for example not when using uwsgi.</%text> | |
221 | <%text>## If you change this setting, you should reinstall the Git hooks via</%text> |
|
221 | <%text>## If you change this setting, you should reinstall the Git hooks via</%text> | |
222 | <%text>## Admin > Settings > Remap and Rescan.</%text> |
|
222 | <%text>## Admin > Settings > Remap and Rescan.</%text> | |
223 | # git_hook_interpreter = /srv/kallithea/venv/bin/python3 |
|
223 | # git_hook_interpreter = /srv/kallithea/venv/bin/python3 | |
224 | %if git_hook_interpreter: |
|
224 | %if git_hook_interpreter: | |
225 | git_hook_interpreter = ${git_hook_interpreter} |
|
225 | git_hook_interpreter = ${git_hook_interpreter} | |
226 | %endif |
|
226 | %endif | |
227 |
|
227 | |||
228 | <%text>## path to git executable</%text> |
|
228 | <%text>## path to git executable</%text> | |
229 | git_path = git |
|
229 | git_path = git | |
230 |
|
230 | |||
231 | <%text>## git rev filter option, --all is the default filter, if you need to</%text> |
|
231 | <%text>## git rev filter option, --all is the default filter, if you need to</%text> | |
232 | <%text>## hide all refs in changelog switch this to --branches --tags</%text> |
|
232 | <%text>## hide all refs in changelog switch this to --branches --tags</%text> | |
233 | #git_rev_filter = --branches --tags |
|
233 | #git_rev_filter = --branches --tags | |
234 |
|
234 | |||
235 | <%text>## RSS feed options</%text> |
|
235 | <%text>## RSS feed options</%text> | |
236 | rss_cut_off_limit = 256000 |
|
236 | rss_cut_off_limit = 256000 | |
237 | rss_items_per_page = 10 |
|
237 | rss_items_per_page = 10 | |
238 | rss_include_diff = false |
|
238 | rss_include_diff = false | |
239 |
|
239 | |||
240 | <%text>## options for showing and identifying changesets</%text> |
|
240 | <%text>## options for showing and identifying changesets</%text> | |
241 | show_sha_length = 12 |
|
241 | show_sha_length = 12 | |
242 | show_revision_number = false |
|
242 | show_revision_number = false | |
243 |
|
243 | |||
244 | <%text>## Canonical URL to use when creating full URLs in UI and texts.</%text> |
|
244 | <%text>## Canonical URL to use when creating full URLs in UI and texts.</%text> | |
245 | <%text>## Useful when the site is available under different names or protocols.</%text> |
|
245 | <%text>## Useful when the site is available under different names or protocols.</%text> | |
246 | <%text>## Defaults to what is provided in the WSGI environment.</%text> |
|
246 | <%text>## Defaults to what is provided in the WSGI environment.</%text> | |
247 | #canonical_url = https://kallithea.example.com/repos |
|
247 | #canonical_url = https://kallithea.example.com/repos | |
248 |
|
248 | |||
249 | <%text>## gist URL alias, used to create nicer urls for gist. This should be an</%text> |
|
249 | <%text>## gist URL alias, used to create nicer urls for gist. This should be an</%text> | |
250 | <%text>## url that does rewrites to _admin/gists/<gistid>.</%text> |
|
250 | <%text>## url that does rewrites to _admin/gists/<gistid>.</%text> | |
251 | <%text>## example: http://gist.example.com/{gistid}. Empty means use the internal</%text> |
|
251 | <%text>## example: http://gist.example.com/{gistid}. Empty means use the internal</%text> | |
252 | <%text>## Kallithea url, ie. http[s]://kallithea.example.com/_admin/gists/<gistid></%text> |
|
252 | <%text>## Kallithea url, ie. http[s]://kallithea.example.com/_admin/gists/<gistid></%text> | |
253 | gist_alias_url = |
|
253 | gist_alias_url = | |
254 |
|
254 | |||
255 | <%text>## default encoding used to convert from and to unicode</%text> |
|
255 | <%text>## default encoding used to convert from and to unicode</%text> | |
256 | <%text>## can be also a comma separated list of encoding in case of mixed encodings</%text> |
|
256 | <%text>## can be also a comma separated list of encoding in case of mixed encodings</%text> | |
257 | default_encoding = utf-8 |
|
257 | default_encoding = utf-8 | |
258 |
|
258 | |||
259 | <%text>## Set Mercurial encoding, similar to setting HGENCODING before launching Kallithea</%text> |
|
259 | <%text>## Set Mercurial encoding, similar to setting HGENCODING before launching Kallithea</%text> | |
260 | hgencoding = utf-8 |
|
260 | hgencoding = utf-8 | |
261 |
|
261 | |||
262 | <%text>## issue tracker for Kallithea (leave blank to disable, absent for default)</%text> |
|
262 | <%text>## issue tracker for Kallithea (leave blank to disable, absent for default)</%text> | |
263 | #bugtracker = https://bitbucket.org/conservancy/kallithea/issues |
|
263 | #bugtracker = https://bitbucket.org/conservancy/kallithea/issues | |
264 |
|
264 | |||
265 | <%text>## issue tracking mapping for commit messages, comments, PR descriptions, ...</%text> |
|
265 | <%text>## issue tracking mapping for commit messages, comments, PR descriptions, ...</%text> | |
266 | <%text>## Refer to the documentation ("Integration with issue trackers") for more details.</%text> |
|
266 | <%text>## Refer to the documentation ("Integration with issue trackers") for more details.</%text> | |
267 |
|
267 | |||
268 | <%text>## regular expression to match issue references</%text> |
|
268 | <%text>## regular expression to match issue references</%text> | |
269 | <%text>## This pattern may/should contain parenthesized groups, that can</%text> |
|
269 | <%text>## This pattern may/should contain parenthesized groups, that can</%text> | |
270 | <%text>## be referred to in issue_server_link or issue_sub using Python backreferences</%text> |
|
270 | <%text>## be referred to in issue_server_link or issue_sub using Python backreferences</%text> | |
271 | <%text>## (e.g. \1, \2, ...). You can also create named groups with '(?P<groupname>)'.</%text> |
|
271 | <%text>## (e.g. \1, \2, ...). You can also create named groups with '(?P<groupname>)'.</%text> | |
272 | <%text>## To require mandatory whitespace before the issue pattern, use:</%text> |
|
272 | <%text>## To require mandatory whitespace before the issue pattern, use:</%text> | |
273 | <%text>## (?:^|(?<=\s)) before the actual pattern, and for mandatory whitespace</%text> |
|
273 | <%text>## (?:^|(?<=\s)) before the actual pattern, and for mandatory whitespace</%text> | |
274 | <%text>## behind the issue pattern, use (?:$|(?=\s)) after the actual pattern.</%text> |
|
274 | <%text>## behind the issue pattern, use (?:$|(?=\s)) after the actual pattern.</%text> | |
275 |
|
275 | |||
276 | issue_pat = #(\d+) |
|
276 | issue_pat = #(\d+) | |
277 |
|
277 | |||
278 | <%text>## server url to the issue</%text> |
|
278 | <%text>## server url to the issue</%text> | |
279 | <%text>## This pattern may/should contain backreferences to parenthesized groups in issue_pat.</%text> |
|
279 | <%text>## This pattern may/should contain backreferences to parenthesized groups in issue_pat.</%text> | |
280 | <%text>## A backreference can be \1, \2, ... or \g<groupname> if you specified a named group</%text> |
|
280 | <%text>## A backreference can be \1, \2, ... or \g<groupname> if you specified a named group</%text> | |
281 | <%text>## called 'groupname' in issue_pat.</%text> |
|
281 | <%text>## called 'groupname' in issue_pat.</%text> | |
282 | <%text>## The special token {repo} is replaced with the full repository name</%text> |
|
282 | <%text>## The special token {repo} is replaced with the full repository name</%text> | |
283 | <%text>## including repository groups, while {repo_name} is replaced with just</%text> |
|
283 | <%text>## including repository groups, while {repo_name} is replaced with just</%text> | |
284 | <%text>## the name of the repository.</%text> |
|
284 | <%text>## the name of the repository.</%text> | |
285 |
|
285 | |||
286 | issue_server_link = https://issues.example.com/{repo}/issue/\1 |
|
286 | issue_server_link = https://issues.example.com/{repo}/issue/\1 | |
287 |
|
287 | |||
288 | <%text>## substitution pattern to use as the link text</%text> |
|
288 | <%text>## substitution pattern to use as the link text</%text> | |
289 | <%text>## If issue_sub is empty, the text matched by issue_pat is retained verbatim</%text> |
|
289 | <%text>## If issue_sub is empty, the text matched by issue_pat is retained verbatim</%text> | |
290 | <%text>## for the link text. Otherwise, the link text is that of issue_sub, with any</%text> |
|
290 | <%text>## for the link text. Otherwise, the link text is that of issue_sub, with any</%text> | |
291 | <%text>## backreferences to groups in issue_pat replaced.</%text> |
|
291 | <%text>## backreferences to groups in issue_pat replaced.</%text> | |
292 |
|
292 | |||
293 | issue_sub = |
|
293 | issue_sub = | |
294 |
|
294 | |||
295 | <%text>## issue_pat, issue_server_link and issue_sub can have suffixes to specify</%text> |
|
295 | <%text>## issue_pat, issue_server_link and issue_sub can have suffixes to specify</%text> | |
296 | <%text>## multiple patterns, to other issues server, wiki or others</%text> |
|
296 | <%text>## multiple patterns, to other issues server, wiki or others</%text> | |
297 | <%text>## below an example how to create a wiki pattern</%text> |
|
297 | <%text>## below an example how to create a wiki pattern</%text> | |
298 | # wiki-some-id -> https://wiki.example.com/some-id |
|
298 | # wiki-some-id -> https://wiki.example.com/some-id | |
299 |
|
299 | |||
300 | #issue_pat_wiki = wiki-(\S+) |
|
300 | #issue_pat_wiki = wiki-(\S+) | |
301 | #issue_server_link_wiki = https://wiki.example.com/\1 |
|
301 | #issue_server_link_wiki = https://wiki.example.com/\1 | |
302 | #issue_sub_wiki = WIKI-\1 |
|
302 | #issue_sub_wiki = WIKI-\1 | |
303 |
|
303 | |||
304 | <%text>## alternative return HTTP header for failed authentication. Default HTTP</%text> |
|
304 | <%text>## alternative return HTTP header for failed authentication. Default HTTP</%text> | |
305 | <%text>## response is 401 HTTPUnauthorized. Currently Mercurial clients have trouble with</%text> |
|
305 | <%text>## response is 401 HTTPUnauthorized. Currently Mercurial clients have trouble with</%text> | |
306 | <%text>## handling that. Set this variable to 403 to return HTTPForbidden</%text> |
|
306 | <%text>## handling that. Set this variable to 403 to return HTTPForbidden</%text> | |
307 | auth_ret_code = |
|
307 | auth_ret_code = | |
308 |
|
308 | |||
309 | <%text>## allows to change the repository location in settings page</%text> |
|
309 | <%text>## allows to change the repository location in settings page</%text> | |
310 | allow_repo_location_change = True |
|
310 | allow_repo_location_change = True | |
311 |
|
311 | |||
312 | <%text>## allows to setup custom hooks in settings page</%text> |
|
312 | <%text>## allows to setup custom hooks in settings page</%text> | |
313 | allow_custom_hooks_settings = True |
|
313 | allow_custom_hooks_settings = True | |
314 |
|
314 | |||
315 | <%text>## extra extensions for indexing, space separated and without the leading '.'.</%text> |
|
315 | <%text>## extra extensions for indexing, space separated and without the leading '.'.</%text> | |
316 | # index.extensions = |
|
316 | # index.extensions = | |
317 | # gemfile |
|
317 | # gemfile | |
318 | # lock |
|
318 | # lock | |
319 |
|
319 | |||
320 | <%text>## extra filenames for indexing, space separated</%text> |
|
320 | <%text>## extra filenames for indexing, space separated</%text> | |
321 | # index.filenames = |
|
321 | # index.filenames = | |
322 | # .dockerignore |
|
322 | # .dockerignore | |
323 | # .editorconfig |
|
323 | # .editorconfig | |
324 | # INSTALL |
|
324 | # INSTALL | |
325 | # CHANGELOG |
|
325 | # CHANGELOG | |
326 |
|
326 | |||
327 | <%text>####################################</%text> |
|
327 | <%text>####################################</%text> | |
328 | <%text>### SSH CONFIG ####</%text> |
|
328 | <%text>### SSH CONFIG ####</%text> | |
329 | <%text>####################################</%text> |
|
329 | <%text>####################################</%text> | |
330 |
|
330 | |||
331 | <%text>## SSH is disabled by default, until an Administrator decides to enable it.</%text> |
|
331 | <%text>## SSH is disabled by default, until an Administrator decides to enable it.</%text> | |
332 | ssh_enabled = false |
|
332 | ssh_enabled = false | |
333 |
|
333 | |||
334 | <%text>## File where users' SSH keys will be stored *if* ssh_enabled is true.</%text> |
|
334 | <%text>## File where users' SSH keys will be stored *if* ssh_enabled is true.</%text> | |
335 | #ssh_authorized_keys = /home/kallithea/.ssh/authorized_keys |
|
335 | #ssh_authorized_keys = /home/kallithea/.ssh/authorized_keys | |
336 | %if user_home_path: |
|
336 | %if user_home_path: | |
337 | ssh_authorized_keys = ${user_home_path}/.ssh/authorized_keys |
|
337 | ssh_authorized_keys = ${user_home_path}/.ssh/authorized_keys | |
338 | %endif |
|
338 | %endif | |
339 |
|
339 | |||
340 | <%text>## Path to be used in ssh_authorized_keys file to invoke kallithea-cli with ssh-serve.</%text> |
|
340 | <%text>## Path to be used in ssh_authorized_keys file to invoke kallithea-cli with ssh-serve.</%text> | |
341 | #kallithea_cli_path = /srv/kallithea/venv/bin/kallithea-cli |
|
341 | #kallithea_cli_path = /srv/kallithea/venv/bin/kallithea-cli | |
342 | %if kallithea_cli_path: |
|
342 | %if kallithea_cli_path: | |
343 | kallithea_cli_path = ${kallithea_cli_path} |
|
343 | kallithea_cli_path = ${kallithea_cli_path} | |
344 | %endif |
|
344 | %endif | |
345 |
|
345 | |||
346 | <%text>## Locale to be used in the ssh-serve command.</%text> |
|
346 | <%text>## Locale to be used in the ssh-serve command.</%text> | |
347 | <%text>## This is needed because an SSH client may try to use its own locale</%text> |
|
347 | <%text>## This is needed because an SSH client may try to use its own locale</%text> | |
348 | <%text>## settings, which may not be available on the server.</%text> |
|
348 | <%text>## settings, which may not be available on the server.</%text> | |
349 | <%text>## See `locale -a` for valid values on this system.</%text> |
|
349 | <%text>## See `locale -a` for valid values on this system.</%text> | |
350 | #ssh_locale = C.UTF-8 |
|
350 | #ssh_locale = C.UTF-8 | |
351 | %if ssh_locale: |
|
351 | %if ssh_locale: | |
352 | ssh_locale = ${ssh_locale} |
|
352 | ssh_locale = ${ssh_locale} | |
353 | %endif |
|
353 | %endif | |
354 |
|
354 | |||
355 | <%text>####################################</%text> |
|
355 | <%text>####################################</%text> | |
356 | <%text>### CELERY CONFIG ####</%text> |
|
356 | <%text>### CELERY CONFIG ####</%text> | |
357 | <%text>####################################</%text> |
|
357 | <%text>####################################</%text> | |
358 |
|
358 | |||
|
359 | <%text>## Note: Celery doesn't support Windows.</%text> | |||
359 | use_celery = false |
|
360 | use_celery = false | |
360 |
|
361 | |||
361 | <%text>## Example: use the message queue on the local virtual host 'kallitheavhost' as the RabbitMQ user 'kallithea':</%text> |
|
362 | <%text>## Example: use the message queue on the local virtual host 'kallitheavhost' as the RabbitMQ user 'kallithea':</%text> | |
362 | broker.url = amqp://kallithea:thepassword@localhost:5672/kallitheavhost |
|
363 | broker.url = amqp://kallithea:thepassword@localhost:5672/kallitheavhost | |
363 |
|
364 | |||
364 | celery.result.backend = db+sqlite:///celery-results.db |
|
365 | celery.result.backend = db+sqlite:///celery-results.db | |
365 |
|
366 | |||
366 | #celery.amqp.task.result.expires = 18000 |
|
367 | #celery.amqp.task.result.expires = 18000 | |
367 |
|
368 | |||
368 | celeryd.concurrency = 2 |
|
369 | celeryd.concurrency = 2 | |
369 | celeryd.max.tasks.per.child = 1 |
|
370 | celeryd.max.tasks.per.child = 1 | |
370 |
|
371 | |||
371 | <%text>## If true, tasks will never be sent to the queue, but executed locally instead.</%text> |
|
372 | <%text>## If true, tasks will never be sent to the queue, but executed locally instead.</%text> | |
372 | celery.always.eager = false |
|
373 | celery.always.eager = false | |
373 |
|
374 | |||
374 | <%text>####################################</%text> |
|
375 | <%text>####################################</%text> | |
375 | <%text>### BEAKER CACHE ####</%text> |
|
376 | <%text>### BEAKER CACHE ####</%text> | |
376 | <%text>####################################</%text> |
|
377 | <%text>####################################</%text> | |
377 |
|
378 | |||
378 | beaker.cache.data_dir = %(here)s/data/cache/data |
|
379 | beaker.cache.data_dir = %(here)s/data/cache/data | |
379 | beaker.cache.lock_dir = %(here)s/data/cache/lock |
|
380 | beaker.cache.lock_dir = %(here)s/data/cache/lock | |
380 |
|
381 | |||
381 | beaker.cache.regions = short_term,long_term,sql_cache_short |
|
382 | beaker.cache.regions = short_term,long_term,sql_cache_short | |
382 |
|
383 | |||
383 | beaker.cache.short_term.type = memory |
|
384 | beaker.cache.short_term.type = memory | |
384 | beaker.cache.short_term.expire = 60 |
|
385 | beaker.cache.short_term.expire = 60 | |
385 | beaker.cache.short_term.key_length = 256 |
|
386 | beaker.cache.short_term.key_length = 256 | |
386 |
|
387 | |||
387 | beaker.cache.long_term.type = memory |
|
388 | beaker.cache.long_term.type = memory | |
388 | beaker.cache.long_term.expire = 36000 |
|
389 | beaker.cache.long_term.expire = 36000 | |
389 | beaker.cache.long_term.key_length = 256 |
|
390 | beaker.cache.long_term.key_length = 256 | |
390 |
|
391 | |||
391 | beaker.cache.sql_cache_short.type = memory |
|
392 | beaker.cache.sql_cache_short.type = memory | |
392 | beaker.cache.sql_cache_short.expire = 10 |
|
393 | beaker.cache.sql_cache_short.expire = 10 | |
393 | beaker.cache.sql_cache_short.key_length = 256 |
|
394 | beaker.cache.sql_cache_short.key_length = 256 | |
394 |
|
395 | |||
395 | <%text>####################################</%text> |
|
396 | <%text>####################################</%text> | |
396 | <%text>### BEAKER SESSION ####</%text> |
|
397 | <%text>### BEAKER SESSION ####</%text> | |
397 | <%text>####################################</%text> |
|
398 | <%text>####################################</%text> | |
398 |
|
399 | |||
399 | <%text>## Name of session cookie. Should be unique for a given host and path, even when running</%text> |
|
400 | <%text>## Name of session cookie. Should be unique for a given host and path, even when running</%text> | |
400 | <%text>## on different ports. Otherwise, cookie sessions will be shared and messed up.</%text> |
|
401 | <%text>## on different ports. Otherwise, cookie sessions will be shared and messed up.</%text> | |
401 | session.key = kallithea |
|
402 | session.key = kallithea | |
402 | <%text>## Sessions should always only be accessible by the browser, not directly by JavaScript.</%text> |
|
403 | <%text>## Sessions should always only be accessible by the browser, not directly by JavaScript.</%text> | |
403 | session.httponly = true |
|
404 | session.httponly = true | |
404 | <%text>## Session lifetime. 2592000 seconds is 30 days.</%text> |
|
405 | <%text>## Session lifetime. 2592000 seconds is 30 days.</%text> | |
405 | session.timeout = 2592000 |
|
406 | session.timeout = 2592000 | |
406 |
|
407 | |||
407 | <%text>## Server secret used with HMAC to ensure integrity of cookies.</%text> |
|
408 | <%text>## Server secret used with HMAC to ensure integrity of cookies.</%text> | |
408 | session.secret = ${uuid()} |
|
409 | session.secret = ${uuid()} | |
409 | <%text>## Further, encrypt the data with AES.</%text> |
|
410 | <%text>## Further, encrypt the data with AES.</%text> | |
410 | #session.encrypt_key = <key_for_encryption> |
|
411 | #session.encrypt_key = <key_for_encryption> | |
411 | #session.validate_key = <validation_key> |
|
412 | #session.validate_key = <validation_key> | |
412 |
|
413 | |||
413 | <%text>## Type of storage used for the session, current types are</%text> |
|
414 | <%text>## Type of storage used for the session, current types are</%text> | |
414 | <%text>## dbm, file, memcached, database, and memory.</%text> |
|
415 | <%text>## dbm, file, memcached, database, and memory.</%text> | |
415 |
|
416 | |||
416 | <%text>## File system storage of session data. (default)</%text> |
|
417 | <%text>## File system storage of session data. (default)</%text> | |
417 | #session.type = file |
|
418 | #session.type = file | |
418 |
|
419 | |||
419 | <%text>## Cookie only, store all session data inside the cookie. Requires secure secrets.</%text> |
|
420 | <%text>## Cookie only, store all session data inside the cookie. Requires secure secrets.</%text> | |
420 | #session.type = cookie |
|
421 | #session.type = cookie | |
421 |
|
422 | |||
422 | <%text>## Database storage of session data.</%text> |
|
423 | <%text>## Database storage of session data.</%text> | |
423 | #session.type = ext:database |
|
424 | #session.type = ext:database | |
424 | #session.sa.url = postgresql://postgres:qwe@localhost/kallithea |
|
425 | #session.sa.url = postgresql://postgres:qwe@localhost/kallithea | |
425 | #session.table_name = db_session |
|
426 | #session.table_name = db_session | |
426 |
|
427 | |||
427 | <%text>############################</%text> |
|
428 | <%text>############################</%text> | |
428 | <%text>## ERROR HANDLING SYSTEMS ##</%text> |
|
429 | <%text>## ERROR HANDLING SYSTEMS ##</%text> | |
429 | <%text>############################</%text> |
|
430 | <%text>############################</%text> | |
430 |
|
431 | |||
431 | # Propagate email settings to ErrorReporter of TurboGears2 |
|
432 | # Propagate email settings to ErrorReporter of TurboGears2 | |
432 | # You do not normally need to change these lines |
|
433 | # You do not normally need to change these lines | |
433 | get trace_errors.smtp_server = smtp_server |
|
434 | get trace_errors.smtp_server = smtp_server | |
434 | get trace_errors.smtp_port = smtp_port |
|
435 | get trace_errors.smtp_port = smtp_port | |
435 | get trace_errors.from_address = error_email_from |
|
436 | get trace_errors.from_address = error_email_from | |
436 | get trace_errors.error_email = email_to |
|
437 | get trace_errors.error_email = email_to | |
437 | get trace_errors.smtp_username = smtp_username |
|
438 | get trace_errors.smtp_username = smtp_username | |
438 | get trace_errors.smtp_password = smtp_password |
|
439 | get trace_errors.smtp_password = smtp_password | |
439 | get trace_errors.smtp_use_tls = smtp_use_tls |
|
440 | get trace_errors.smtp_use_tls = smtp_use_tls | |
440 |
|
441 | |||
441 | %if error_aggregation_service == 'appenlight': |
|
442 | %if error_aggregation_service == 'appenlight': | |
442 | <%text>####################</%text> |
|
443 | <%text>####################</%text> | |
443 | <%text>### [appenlight] ###</%text> |
|
444 | <%text>### [appenlight] ###</%text> | |
444 | <%text>####################</%text> |
|
445 | <%text>####################</%text> | |
445 |
|
446 | |||
446 | <%text>## AppEnlight is tailored to work with Kallithea, see</%text> |
|
447 | <%text>## AppEnlight is tailored to work with Kallithea, see</%text> | |
447 | <%text>## http://appenlight.com for details how to obtain an account</%text> |
|
448 | <%text>## http://appenlight.com for details how to obtain an account</%text> | |
448 | <%text>## you must install python package `appenlight_client` to make it work</%text> |
|
449 | <%text>## you must install python package `appenlight_client` to make it work</%text> | |
449 |
|
450 | |||
450 | <%text>## appenlight enabled</%text> |
|
451 | <%text>## appenlight enabled</%text> | |
451 | appenlight = false |
|
452 | appenlight = false | |
452 |
|
453 | |||
453 | appenlight.server_url = https://api.appenlight.com |
|
454 | appenlight.server_url = https://api.appenlight.com | |
454 | appenlight.api_key = YOUR_API_KEY |
|
455 | appenlight.api_key = YOUR_API_KEY | |
455 |
|
456 | |||
456 | <%text>## TWEAK AMOUNT OF INFO SENT HERE</%text> |
|
457 | <%text>## TWEAK AMOUNT OF INFO SENT HERE</%text> | |
457 |
|
458 | |||
458 | <%text>## enables 404 error logging (default False)</%text> |
|
459 | <%text>## enables 404 error logging (default False)</%text> | |
459 | appenlight.report_404 = false |
|
460 | appenlight.report_404 = false | |
460 |
|
461 | |||
461 | <%text>## time in seconds after request is considered being slow (default 1)</%text> |
|
462 | <%text>## time in seconds after request is considered being slow (default 1)</%text> | |
462 | appenlight.slow_request_time = 1 |
|
463 | appenlight.slow_request_time = 1 | |
463 |
|
464 | |||
464 | <%text>## record slow requests in application</%text> |
|
465 | <%text>## record slow requests in application</%text> | |
465 | <%text>## (needs to be enabled for slow datastore recording and time tracking)</%text> |
|
466 | <%text>## (needs to be enabled for slow datastore recording and time tracking)</%text> | |
466 | appenlight.slow_requests = true |
|
467 | appenlight.slow_requests = true | |
467 |
|
468 | |||
468 | <%text>## enable hooking to application loggers</%text> |
|
469 | <%text>## enable hooking to application loggers</%text> | |
469 | #appenlight.logging = true |
|
470 | #appenlight.logging = true | |
470 |
|
471 | |||
471 | <%text>## minimum log level for log capture</%text> |
|
472 | <%text>## minimum log level for log capture</%text> | |
472 | #appenlight.logging.level = WARNING |
|
473 | #appenlight.logging.level = WARNING | |
473 |
|
474 | |||
474 | <%text>## send logs only from erroneous/slow requests</%text> |
|
475 | <%text>## send logs only from erroneous/slow requests</%text> | |
475 | <%text>## (saves API quota for intensive logging)</%text> |
|
476 | <%text>## (saves API quota for intensive logging)</%text> | |
476 | appenlight.logging_on_error = false |
|
477 | appenlight.logging_on_error = false | |
477 |
|
478 | |||
478 | <%text>## list of additional keywords that should be grabbed from environ object</%text> |
|
479 | <%text>## list of additional keywords that should be grabbed from environ object</%text> | |
479 | <%text>## can be string with comma separated list of words in lowercase</%text> |
|
480 | <%text>## can be string with comma separated list of words in lowercase</%text> | |
480 | <%text>## (by default client will always send following info:</%text> |
|
481 | <%text>## (by default client will always send following info:</%text> | |
481 | <%text>## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that</%text> |
|
482 | <%text>## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that</%text> | |
482 | <%text>## start with HTTP* this list be extended with additional keywords here</%text> |
|
483 | <%text>## start with HTTP* this list be extended with additional keywords here</%text> | |
483 | appenlight.environ_keys_whitelist = |
|
484 | appenlight.environ_keys_whitelist = | |
484 |
|
485 | |||
485 | <%text>## list of keywords that should be blanked from request object</%text> |
|
486 | <%text>## list of keywords that should be blanked from request object</%text> | |
486 | <%text>## can be string with comma separated list of words in lowercase</%text> |
|
487 | <%text>## can be string with comma separated list of words in lowercase</%text> | |
487 | <%text>## (by default client will always blank keys that contain following words</%text> |
|
488 | <%text>## (by default client will always blank keys that contain following words</%text> | |
488 | <%text>## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'</%text> |
|
489 | <%text>## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'</%text> | |
489 | <%text>## this list be extended with additional keywords set here</%text> |
|
490 | <%text>## this list be extended with additional keywords set here</%text> | |
490 | appenlight.request_keys_blacklist = |
|
491 | appenlight.request_keys_blacklist = | |
491 |
|
492 | |||
492 | <%text>## list of namespaces that should be ignores when gathering log entries</%text> |
|
493 | <%text>## list of namespaces that should be ignores when gathering log entries</%text> | |
493 | <%text>## can be string with comma separated list of namespaces</%text> |
|
494 | <%text>## can be string with comma separated list of namespaces</%text> | |
494 | <%text>## (by default the client ignores own entries: appenlight_client.client)</%text> |
|
495 | <%text>## (by default the client ignores own entries: appenlight_client.client)</%text> | |
495 | appenlight.log_namespace_blacklist = |
|
496 | appenlight.log_namespace_blacklist = | |
496 |
|
497 | |||
497 | %elif error_aggregation_service == 'sentry': |
|
498 | %elif error_aggregation_service == 'sentry': | |
498 | <%text>################</%text> |
|
499 | <%text>################</%text> | |
499 | <%text>### [sentry] ###</%text> |
|
500 | <%text>### [sentry] ###</%text> | |
500 | <%text>################</%text> |
|
501 | <%text>################</%text> | |
501 |
|
502 | |||
502 | <%text>## sentry is a alternative open source error aggregator</%text> |
|
503 | <%text>## sentry is a alternative open source error aggregator</%text> | |
503 | <%text>## you must install python packages `sentry` and `raven` to enable</%text> |
|
504 | <%text>## you must install python packages `sentry` and `raven` to enable</%text> | |
504 |
|
505 | |||
505 | sentry.dsn = YOUR_DNS |
|
506 | sentry.dsn = YOUR_DNS | |
506 | sentry.servers = |
|
507 | sentry.servers = | |
507 | sentry.name = |
|
508 | sentry.name = | |
508 | sentry.key = |
|
509 | sentry.key = | |
509 | sentry.public_key = |
|
510 | sentry.public_key = | |
510 | sentry.secret_key = |
|
511 | sentry.secret_key = | |
511 | sentry.project = |
|
512 | sentry.project = | |
512 | sentry.site = |
|
513 | sentry.site = | |
513 | sentry.include_paths = |
|
514 | sentry.include_paths = | |
514 | sentry.exclude_paths = |
|
515 | sentry.exclude_paths = | |
515 |
|
516 | |||
516 | %endif |
|
517 | %endif | |
517 | <%text>################################################################################</%text> |
|
518 | <%text>################################################################################</%text> | |
518 | <%text>## WARNING: *DEBUG MODE MUST BE OFF IN A PRODUCTION ENVIRONMENT* ##</%text> |
|
519 | <%text>## WARNING: *DEBUG MODE MUST BE OFF IN A PRODUCTION ENVIRONMENT* ##</%text> | |
519 | <%text>## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##</%text> |
|
520 | <%text>## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##</%text> | |
520 | <%text>## execute malicious code after an exception is raised. ##</%text> |
|
521 | <%text>## execute malicious code after an exception is raised. ##</%text> | |
521 | <%text>################################################################################</%text> |
|
522 | <%text>################################################################################</%text> | |
522 | debug = false |
|
523 | debug = false | |
523 |
|
524 | |||
524 | <%text>##################################</%text> |
|
525 | <%text>##################################</%text> | |
525 | <%text>### LOGVIEW CONFIG ###</%text> |
|
526 | <%text>### LOGVIEW CONFIG ###</%text> | |
526 | <%text>##################################</%text> |
|
527 | <%text>##################################</%text> | |
527 |
|
528 | |||
528 | logview.sqlalchemy = #faa |
|
529 | logview.sqlalchemy = #faa | |
529 | logview.pylons.templating = #bfb |
|
530 | logview.pylons.templating = #bfb | |
530 | logview.pylons.util = #eee |
|
531 | logview.pylons.util = #eee | |
531 |
|
532 | |||
532 | <%text>#########################################################</%text> |
|
533 | <%text>#########################################################</%text> | |
533 | <%text>### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###</%text> |
|
534 | <%text>### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###</%text> | |
534 | <%text>#########################################################</%text> |
|
535 | <%text>#########################################################</%text> | |
535 |
|
536 | |||
536 | %if database_engine == 'sqlite': |
|
537 | %if database_engine == 'sqlite': | |
537 | # SQLITE [default] |
|
538 | # SQLITE [default] | |
538 | sqlalchemy.url = sqlite:///%(here)s/kallithea.db?timeout=60 |
|
539 | sqlalchemy.url = sqlite:///%(here)s/kallithea.db?timeout=60 | |
539 |
|
540 | |||
540 | %elif database_engine == 'postgres': |
|
541 | %elif database_engine == 'postgres': | |
541 | # POSTGRESQL |
|
542 | # POSTGRESQL | |
542 | sqlalchemy.url = postgresql://user:pass@localhost/kallithea |
|
543 | sqlalchemy.url = postgresql://user:pass@localhost/kallithea | |
543 |
|
544 | |||
544 | %elif database_engine == 'mysql': |
|
545 | %elif database_engine == 'mysql': | |
545 | # MySQL |
|
546 | # MySQL | |
546 | sqlalchemy.url = mysql://user:pass@localhost/kallithea?charset=utf8 |
|
547 | sqlalchemy.url = mysql://user:pass@localhost/kallithea?charset=utf8 | |
547 |
|
548 | |||
548 | %endif |
|
549 | %endif | |
549 | # see sqlalchemy docs for others |
|
550 | # see sqlalchemy docs for others | |
550 |
|
551 | |||
551 | sqlalchemy.pool_recycle = 3600 |
|
552 | sqlalchemy.pool_recycle = 3600 | |
552 |
|
553 | |||
553 | <%text>################################</%text> |
|
554 | <%text>################################</%text> | |
554 | <%text>### ALEMBIC CONFIGURATION ####</%text> |
|
555 | <%text>### ALEMBIC CONFIGURATION ####</%text> | |
555 | <%text>################################</%text> |
|
556 | <%text>################################</%text> | |
556 |
|
557 | |||
557 | [alembic] |
|
558 | [alembic] | |
558 | script_location = kallithea:alembic |
|
559 | script_location = kallithea:alembic | |
559 |
|
560 | |||
560 | <%text>################################</%text> |
|
561 | <%text>################################</%text> | |
561 | <%text>### LOGGING CONFIGURATION ####</%text> |
|
562 | <%text>### LOGGING CONFIGURATION ####</%text> | |
562 | <%text>################################</%text> |
|
563 | <%text>################################</%text> | |
563 |
|
564 | |||
564 | [loggers] |
|
565 | [loggers] | |
565 | keys = root, routes, kallithea, sqlalchemy, tg, gearbox, beaker, templates, whoosh_indexer, werkzeug, backlash |
|
566 | keys = root, routes, kallithea, sqlalchemy, tg, gearbox, beaker, templates, whoosh_indexer, werkzeug, backlash | |
566 |
|
567 | |||
567 | [handlers] |
|
568 | [handlers] | |
568 | keys = console, console_color, console_color_sql, null |
|
569 | keys = console, console_color, console_color_sql, null | |
569 |
|
570 | |||
570 | [formatters] |
|
571 | [formatters] | |
571 | keys = generic, color_formatter, color_formatter_sql |
|
572 | keys = generic, color_formatter, color_formatter_sql | |
572 |
|
573 | |||
573 | <%text>#############</%text> |
|
574 | <%text>#############</%text> | |
574 | <%text>## LOGGERS ##</%text> |
|
575 | <%text>## LOGGERS ##</%text> | |
575 | <%text>#############</%text> |
|
576 | <%text>#############</%text> | |
576 |
|
577 | |||
577 | [logger_root] |
|
578 | [logger_root] | |
578 | level = NOTSET |
|
579 | level = NOTSET | |
579 | handlers = console |
|
580 | handlers = console | |
580 | # For coloring based on log level: |
|
581 | # For coloring based on log level: | |
581 | # handlers = console_color |
|
582 | # handlers = console_color | |
582 |
|
583 | |||
583 | [logger_routes] |
|
584 | [logger_routes] | |
584 | level = WARN |
|
585 | level = WARN | |
585 | handlers = |
|
586 | handlers = | |
586 | qualname = routes.middleware |
|
587 | qualname = routes.middleware | |
587 | <%text>## "level = DEBUG" logs the route matched and routing variables.</%text> |
|
588 | <%text>## "level = DEBUG" logs the route matched and routing variables.</%text> | |
588 |
|
589 | |||
589 | [logger_beaker] |
|
590 | [logger_beaker] | |
590 | level = WARN |
|
591 | level = WARN | |
591 | handlers = |
|
592 | handlers = | |
592 | qualname = beaker.container |
|
593 | qualname = beaker.container | |
593 |
|
594 | |||
594 | [logger_templates] |
|
595 | [logger_templates] | |
595 | level = WARN |
|
596 | level = WARN | |
596 | handlers = |
|
597 | handlers = | |
597 | qualname = pylons.templating |
|
598 | qualname = pylons.templating | |
598 |
|
599 | |||
599 | [logger_kallithea] |
|
600 | [logger_kallithea] | |
600 | level = WARN |
|
601 | level = WARN | |
601 | handlers = |
|
602 | handlers = | |
602 | qualname = kallithea |
|
603 | qualname = kallithea | |
603 |
|
604 | |||
604 | [logger_tg] |
|
605 | [logger_tg] | |
605 | level = WARN |
|
606 | level = WARN | |
606 | handlers = |
|
607 | handlers = | |
607 | qualname = tg |
|
608 | qualname = tg | |
608 |
|
609 | |||
609 | [logger_gearbox] |
|
610 | [logger_gearbox] | |
610 | level = WARN |
|
611 | level = WARN | |
611 | handlers = |
|
612 | handlers = | |
612 | qualname = gearbox |
|
613 | qualname = gearbox | |
613 |
|
614 | |||
614 | [logger_sqlalchemy] |
|
615 | [logger_sqlalchemy] | |
615 | level = WARN |
|
616 | level = WARN | |
616 | handlers = |
|
617 | handlers = | |
617 | qualname = sqlalchemy.engine |
|
618 | qualname = sqlalchemy.engine | |
618 | # For coloring based on log level and pretty printing of SQL: |
|
619 | # For coloring based on log level and pretty printing of SQL: | |
619 | # level = INFO |
|
620 | # level = INFO | |
620 | # handlers = console_color_sql |
|
621 | # handlers = console_color_sql | |
621 | # propagate = 0 |
|
622 | # propagate = 0 | |
622 |
|
623 | |||
623 | [logger_whoosh_indexer] |
|
624 | [logger_whoosh_indexer] | |
624 | level = WARN |
|
625 | level = WARN | |
625 | handlers = |
|
626 | handlers = | |
626 | qualname = whoosh_indexer |
|
627 | qualname = whoosh_indexer | |
627 |
|
628 | |||
628 | [logger_werkzeug] |
|
629 | [logger_werkzeug] | |
629 | level = WARN |
|
630 | level = WARN | |
630 | handlers = |
|
631 | handlers = | |
631 | qualname = werkzeug |
|
632 | qualname = werkzeug | |
632 |
|
633 | |||
633 | [logger_backlash] |
|
634 | [logger_backlash] | |
634 | level = WARN |
|
635 | level = WARN | |
635 | handlers = |
|
636 | handlers = | |
636 | qualname = backlash |
|
637 | qualname = backlash | |
637 |
|
638 | |||
638 | <%text>##############</%text> |
|
639 | <%text>##############</%text> | |
639 | <%text>## HANDLERS ##</%text> |
|
640 | <%text>## HANDLERS ##</%text> | |
640 | <%text>##############</%text> |
|
641 | <%text>##############</%text> | |
641 |
|
642 | |||
642 | [handler_console] |
|
643 | [handler_console] | |
643 | class = StreamHandler |
|
644 | class = StreamHandler | |
644 | args = (sys.stderr,) |
|
645 | args = (sys.stderr,) | |
645 | formatter = generic |
|
646 | formatter = generic | |
646 |
|
647 | |||
647 | [handler_console_color] |
|
648 | [handler_console_color] | |
648 | # ANSI color coding based on log level |
|
649 | # ANSI color coding based on log level | |
649 | class = StreamHandler |
|
650 | class = StreamHandler | |
650 | args = (sys.stderr,) |
|
651 | args = (sys.stderr,) | |
651 | formatter = color_formatter |
|
652 | formatter = color_formatter | |
652 |
|
653 | |||
653 | [handler_console_color_sql] |
|
654 | [handler_console_color_sql] | |
654 | # ANSI color coding and pretty printing of SQL statements |
|
655 | # ANSI color coding and pretty printing of SQL statements | |
655 | class = StreamHandler |
|
656 | class = StreamHandler | |
656 | args = (sys.stderr,) |
|
657 | args = (sys.stderr,) | |
657 | formatter = color_formatter_sql |
|
658 | formatter = color_formatter_sql | |
658 |
|
659 | |||
659 | [handler_null] |
|
660 | [handler_null] | |
660 | class = NullHandler |
|
661 | class = NullHandler | |
661 | args = () |
|
662 | args = () | |
662 |
|
663 | |||
663 | <%text>################</%text> |
|
664 | <%text>################</%text> | |
664 | <%text>## FORMATTERS ##</%text> |
|
665 | <%text>## FORMATTERS ##</%text> | |
665 | <%text>################</%text> |
|
666 | <%text>################</%text> | |
666 |
|
667 | |||
667 | [formatter_generic] |
|
668 | [formatter_generic] | |
668 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s |
|
669 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s | |
669 | datefmt = %Y-%m-%d %H:%M:%S |
|
670 | datefmt = %Y-%m-%d %H:%M:%S | |
670 |
|
671 | |||
671 | [formatter_color_formatter] |
|
672 | [formatter_color_formatter] | |
672 | class = kallithea.lib.colored_formatter.ColorFormatter |
|
673 | class = kallithea.lib.colored_formatter.ColorFormatter | |
673 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s |
|
674 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s | |
674 | datefmt = %Y-%m-%d %H:%M:%S |
|
675 | datefmt = %Y-%m-%d %H:%M:%S | |
675 |
|
676 | |||
676 | [formatter_color_formatter_sql] |
|
677 | [formatter_color_formatter_sql] | |
677 | class = kallithea.lib.colored_formatter.ColorFormatterSql |
|
678 | class = kallithea.lib.colored_formatter.ColorFormatterSql | |
678 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s |
|
679 | format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s | |
679 | datefmt = %Y-%m-%d %H:%M:%S |
|
680 | datefmt = %Y-%m-%d %H:%M:%S | |
680 |
|
681 | |||
681 | <%text>#################</%text> |
|
682 | <%text>#################</%text> | |
682 | <%text>## SSH LOGGING ##</%text> |
|
683 | <%text>## SSH LOGGING ##</%text> | |
683 | <%text>#################</%text> |
|
684 | <%text>#################</%text> | |
684 |
|
685 | |||
685 | # The default loggers use 'handler_console' that uses StreamHandler with |
|
686 | # The default loggers use 'handler_console' that uses StreamHandler with | |
686 | # destination 'sys.stderr'. In the context of the SSH server process, these log |
|
687 | # destination 'sys.stderr'. In the context of the SSH server process, these log | |
687 | # messages would be sent to the client, which is normally not what you want. |
|
688 | # messages would be sent to the client, which is normally not what you want. | |
688 | # By default, when running ssh-serve, just use NullHandler and disable logging |
|
689 | # By default, when running ssh-serve, just use NullHandler and disable logging | |
689 | # completely. For other logging options, see: |
|
690 | # completely. For other logging options, see: | |
690 | # https://docs.python.org/2/library/logging.handlers.html |
|
691 | # https://docs.python.org/2/library/logging.handlers.html | |
691 |
|
692 | |||
692 | [ssh_serve:logger_root] |
|
693 | [ssh_serve:logger_root] | |
693 | level = CRITICAL |
|
694 | level = CRITICAL | |
694 | handlers = null |
|
695 | handlers = null | |
695 |
|
696 | |||
696 | # Note: If logging is configured with other handlers, they might need similar |
|
697 | # Note: If logging is configured with other handlers, they might need similar | |
697 | # muting for ssh-serve too. |
|
698 | # muting for ssh-serve too. |
@@ -1,162 +1,162 b'' | |||||
1 | #!/usr/bin/env python3 |
|
1 | #!/usr/bin/env python3 | |
2 | # -*- coding: utf-8 -*- |
|
2 | # -*- coding: utf-8 -*- | |
3 | import os |
|
3 | import os | |
4 | import platform |
|
4 | import platform | |
5 | import sys |
|
5 | import sys | |
6 |
|
6 | |||
7 | import setuptools |
|
7 | import setuptools | |
8 | # monkey patch setuptools to use distutils owner/group functionality |
|
8 | # monkey patch setuptools to use distutils owner/group functionality | |
9 | from setuptools.command import sdist |
|
9 | from setuptools.command import sdist | |
10 |
|
10 | |||
11 |
|
11 | |||
12 | if sys.version_info < (3, 6): |
|
12 | if sys.version_info < (3, 6): | |
13 | raise Exception('Kallithea requires Python 3.6 or later') |
|
13 | raise Exception('Kallithea requires Python 3.6 or later') | |
14 |
|
14 | |||
15 |
|
15 | |||
16 | here = os.path.abspath(os.path.dirname(__file__)) |
|
16 | here = os.path.abspath(os.path.dirname(__file__)) | |
17 |
|
17 | |||
18 |
|
18 | |||
19 | def _get_meta_var(name, data, callback_handler=None): |
|
19 | def _get_meta_var(name, data, callback_handler=None): | |
20 | import re |
|
20 | import re | |
21 | matches = re.compile(r'(?:%s)\s*=\s*(.*)' % name).search(data) |
|
21 | matches = re.compile(r'(?:%s)\s*=\s*(.*)' % name).search(data) | |
22 | if matches: |
|
22 | if matches: | |
23 | if not callable(callback_handler): |
|
23 | if not callable(callback_handler): | |
24 | callback_handler = lambda v: v |
|
24 | callback_handler = lambda v: v | |
25 |
|
25 | |||
26 | return callback_handler(eval(matches.groups()[0])) |
|
26 | return callback_handler(eval(matches.groups()[0])) | |
27 |
|
27 | |||
28 | _meta = open(os.path.join(here, 'kallithea', '__init__.py'), 'r') |
|
28 | _meta = open(os.path.join(here, 'kallithea', '__init__.py'), 'r') | |
29 | _metadata = _meta.read() |
|
29 | _metadata = _meta.read() | |
30 | _meta.close() |
|
30 | _meta.close() | |
31 |
|
31 | |||
32 | callback = lambda V: ('.'.join(map(str, V[:3])) + '.'.join(V[3:])) |
|
32 | callback = lambda V: ('.'.join(map(str, V[:3])) + '.'.join(V[3:])) | |
33 | __version__ = _get_meta_var('VERSION', _metadata, callback) |
|
33 | __version__ = _get_meta_var('VERSION', _metadata, callback) | |
34 | __license__ = _get_meta_var('__license__', _metadata) |
|
34 | __license__ = _get_meta_var('__license__', _metadata) | |
35 | __author__ = _get_meta_var('__author__', _metadata) |
|
35 | __author__ = _get_meta_var('__author__', _metadata) | |
36 | __url__ = _get_meta_var('__url__', _metadata) |
|
36 | __url__ = _get_meta_var('__url__', _metadata) | |
37 | # defines current platform |
|
37 | # defines current platform | |
38 | __platform__ = platform.system() |
|
38 | __platform__ = platform.system() | |
39 |
|
39 | |||
40 | is_windows = __platform__ in ['Windows'] |
|
40 | is_windows = __platform__ in ['Windows'] | |
41 |
|
41 | |||
42 | requirements = [ |
|
42 | requirements = [ | |
43 | "alembic >= 1.0.10, < 1.5", |
|
43 | "alembic >= 1.0.10, < 1.5", | |
44 | "gearbox >= 0.1.0, < 1", |
|
44 | "gearbox >= 0.1.0, < 1", | |
45 | "waitress >= 0.8.8, < 1.5", |
|
45 | "waitress >= 0.8.8, < 1.5", | |
46 | "WebOb >= 1.8, < 1.9", |
|
46 | "WebOb >= 1.8, < 1.9", | |
47 | "backlash >= 0.1.2, < 1", |
|
47 | "backlash >= 0.1.2, < 1", | |
48 | "TurboGears2 >= 2.4, < 2.5", |
|
48 | "TurboGears2 >= 2.4, < 2.5", | |
49 | "tgext.routes >= 0.2.0, < 1", |
|
49 | "tgext.routes >= 0.2.0, < 1", | |
50 | "Beaker >= 1.10.1, < 2", |
|
50 | "Beaker >= 1.10.1, < 2", | |
51 | "WebHelpers2 >= 2.0, < 2.1", |
|
51 | "WebHelpers2 >= 2.0, < 2.1", | |
52 | "FormEncode >= 1.3.1, < 1.4", |
|
52 | "FormEncode >= 1.3.1, < 1.4", | |
53 | "SQLAlchemy >= 1.2.9, < 1.4", |
|
53 | "SQLAlchemy >= 1.2.9, < 1.4", | |
54 | "Mako >= 0.9.1, < 1.2", |
|
54 | "Mako >= 0.9.1, < 1.2", | |
55 | "Pygments >= 2.2.0, < 2.6", |
|
55 | "Pygments >= 2.2.0, < 2.6", | |
56 | "Whoosh >= 2.7.1, < 2.8", |
|
56 | "Whoosh >= 2.7.1, < 2.8", | |
57 | "celery >= 3.1, < 4.0", # TODO: celery 4 doesn't work |
|
57 | "celery >= 4.3, < 4.5", | |
58 | "Babel >= 1.3, < 2.9", |
|
58 | "Babel >= 1.3, < 2.9", | |
59 | "python-dateutil >= 2.1.0, < 2.9", |
|
59 | "python-dateutil >= 2.1.0, < 2.9", | |
60 | "Markdown >= 2.2.1, < 3.2", |
|
60 | "Markdown >= 2.2.1, < 3.2", | |
61 | "docutils >= 0.11, < 0.17", |
|
61 | "docutils >= 0.11, < 0.17", | |
62 | "URLObject >= 2.3.4, < 2.5", |
|
62 | "URLObject >= 2.3.4, < 2.5", | |
63 | "Routes >= 2.0, < 2.5", |
|
63 | "Routes >= 2.0, < 2.5", | |
64 | "dulwich >= 0.19.0, < 0.20", |
|
64 | "dulwich >= 0.19.0, < 0.20", | |
65 | "mercurial >= 5.2, < 5.4", |
|
65 | "mercurial >= 5.2, < 5.4", | |
66 | "decorator >= 4.2.1, < 4.5", |
|
66 | "decorator >= 4.2.1, < 4.5", | |
67 | "Paste >= 2.0.3, < 3.4", |
|
67 | "Paste >= 2.0.3, < 3.4", | |
68 | "bleach >= 3.0, < 3.2", |
|
68 | "bleach >= 3.0, < 3.2", | |
69 | "Click >= 7.0, < 8", |
|
69 | "Click >= 7.0, < 8", | |
70 | "ipaddr >= 2.2.0, < 2.3", |
|
70 | "ipaddr >= 2.2.0, < 2.3", | |
71 | "paginate >= 0.5, < 0.6", |
|
71 | "paginate >= 0.5, < 0.6", | |
72 | "paginate_sqlalchemy >= 0.3.0, < 0.4", |
|
72 | "paginate_sqlalchemy >= 0.3.0, < 0.4", | |
73 | ] |
|
73 | ] | |
74 |
|
74 | |||
75 | if not is_windows: |
|
75 | if not is_windows: | |
76 | requirements.append("bcrypt >= 3.1.0, < 3.2") |
|
76 | requirements.append("bcrypt >= 3.1.0, < 3.2") | |
77 |
|
77 | |||
78 | dependency_links = [ |
|
78 | dependency_links = [ | |
79 | ] |
|
79 | ] | |
80 |
|
80 | |||
81 | classifiers = [ |
|
81 | classifiers = [ | |
82 | 'Development Status :: 4 - Beta', |
|
82 | 'Development Status :: 4 - Beta', | |
83 | 'Environment :: Web Environment', |
|
83 | 'Environment :: Web Environment', | |
84 | 'Framework :: Pylons', |
|
84 | 'Framework :: Pylons', | |
85 | 'Intended Audience :: Developers', |
|
85 | 'Intended Audience :: Developers', | |
86 | 'License :: OSI Approved :: GNU General Public License (GPL)', |
|
86 | 'License :: OSI Approved :: GNU General Public License (GPL)', | |
87 | 'Operating System :: OS Independent', |
|
87 | 'Operating System :: OS Independent', | |
88 | 'Programming Language :: Python :: 3.6', |
|
88 | 'Programming Language :: Python :: 3.6', | |
89 | 'Programming Language :: Python :: 3.7', |
|
89 | 'Programming Language :: Python :: 3.7', | |
90 | 'Programming Language :: Python :: 3.8', |
|
90 | 'Programming Language :: Python :: 3.8', | |
91 | 'Topic :: Software Development :: Version Control', |
|
91 | 'Topic :: Software Development :: Version Control', | |
92 | ] |
|
92 | ] | |
93 |
|
93 | |||
94 |
|
94 | |||
95 | # additional files from project that goes somewhere in the filesystem |
|
95 | # additional files from project that goes somewhere in the filesystem | |
96 | # relative to sys.prefix |
|
96 | # relative to sys.prefix | |
97 | data_files = [] |
|
97 | data_files = [] | |
98 |
|
98 | |||
99 | description = ('Kallithea is a fast and powerful management tool ' |
|
99 | description = ('Kallithea is a fast and powerful management tool ' | |
100 | 'for Mercurial and Git with a built in push/pull server, ' |
|
100 | 'for Mercurial and Git with a built in push/pull server, ' | |
101 | 'full text search and code-review.') |
|
101 | 'full text search and code-review.') | |
102 |
|
102 | |||
103 | keywords = ' '.join([ |
|
103 | keywords = ' '.join([ | |
104 | 'kallithea', 'mercurial', 'git', 'code review', |
|
104 | 'kallithea', 'mercurial', 'git', 'code review', | |
105 | 'repo groups', 'ldap', 'repository management', 'hgweb replacement', |
|
105 | 'repo groups', 'ldap', 'repository management', 'hgweb replacement', | |
106 | 'hgwebdir', 'gitweb replacement', 'serving hgweb', |
|
106 | 'hgwebdir', 'gitweb replacement', 'serving hgweb', | |
107 | ]) |
|
107 | ]) | |
108 |
|
108 | |||
109 | # long description |
|
109 | # long description | |
110 | README_FILE = 'README.rst' |
|
110 | README_FILE = 'README.rst' | |
111 | try: |
|
111 | try: | |
112 | long_description = open(README_FILE).read() |
|
112 | long_description = open(README_FILE).read() | |
113 | except IOError as err: |
|
113 | except IOError as err: | |
114 | sys.stderr.write( |
|
114 | sys.stderr.write( | |
115 | "[WARNING] Cannot find file specified as long_description (%s): %s\n" |
|
115 | "[WARNING] Cannot find file specified as long_description (%s): %s\n" | |
116 | % (README_FILE, err) |
|
116 | % (README_FILE, err) | |
117 | ) |
|
117 | ) | |
118 | long_description = description |
|
118 | long_description = description | |
119 |
|
119 | |||
120 |
|
120 | |||
121 | sdist_org = sdist.sdist |
|
121 | sdist_org = sdist.sdist | |
122 | class sdist_new(sdist_org): |
|
122 | class sdist_new(sdist_org): | |
123 | def initialize_options(self): |
|
123 | def initialize_options(self): | |
124 | sdist_org.initialize_options(self) |
|
124 | sdist_org.initialize_options(self) | |
125 | self.owner = self.group = 'root' |
|
125 | self.owner = self.group = 'root' | |
126 | sdist.sdist = sdist_new |
|
126 | sdist.sdist = sdist_new | |
127 |
|
127 | |||
128 | packages = setuptools.find_packages(exclude=['ez_setup']) |
|
128 | packages = setuptools.find_packages(exclude=['ez_setup']) | |
129 |
|
129 | |||
130 | setuptools.setup( |
|
130 | setuptools.setup( | |
131 | name='Kallithea', |
|
131 | name='Kallithea', | |
132 | version=__version__, |
|
132 | version=__version__, | |
133 | description=description, |
|
133 | description=description, | |
134 | long_description=long_description, |
|
134 | long_description=long_description, | |
135 | keywords=keywords, |
|
135 | keywords=keywords, | |
136 | license=__license__, |
|
136 | license=__license__, | |
137 | author=__author__, |
|
137 | author=__author__, | |
138 | author_email='kallithea@sfconservancy.org', |
|
138 | author_email='kallithea@sfconservancy.org', | |
139 | dependency_links=dependency_links, |
|
139 | dependency_links=dependency_links, | |
140 | url=__url__, |
|
140 | url=__url__, | |
141 | install_requires=requirements, |
|
141 | install_requires=requirements, | |
142 | classifiers=classifiers, |
|
142 | classifiers=classifiers, | |
143 | data_files=data_files, |
|
143 | data_files=data_files, | |
144 | packages=packages, |
|
144 | packages=packages, | |
145 | include_package_data=True, |
|
145 | include_package_data=True, | |
146 | message_extractors={'kallithea': [ |
|
146 | message_extractors={'kallithea': [ | |
147 | ('**.py', 'python', None), |
|
147 | ('**.py', 'python', None), | |
148 | ('templates/**.mako', 'mako', {'input_encoding': 'utf-8'}), |
|
148 | ('templates/**.mako', 'mako', {'input_encoding': 'utf-8'}), | |
149 | ('templates/**.html', 'mako', {'input_encoding': 'utf-8'}), |
|
149 | ('templates/**.html', 'mako', {'input_encoding': 'utf-8'}), | |
150 | ('public/**', 'ignore', None)]}, |
|
150 | ('public/**', 'ignore', None)]}, | |
151 | zip_safe=False, |
|
151 | zip_safe=False, | |
152 | entry_points=""" |
|
152 | entry_points=""" | |
153 | [console_scripts] |
|
153 | [console_scripts] | |
154 | kallithea-api = kallithea.bin.kallithea_api:main |
|
154 | kallithea-api = kallithea.bin.kallithea_api:main | |
155 | kallithea-gist = kallithea.bin.kallithea_gist:main |
|
155 | kallithea-gist = kallithea.bin.kallithea_gist:main | |
156 | kallithea-config = kallithea.bin.kallithea_config:main |
|
156 | kallithea-config = kallithea.bin.kallithea_config:main | |
157 | kallithea-cli = kallithea.bin.kallithea_cli:cli |
|
157 | kallithea-cli = kallithea.bin.kallithea_cli:cli | |
158 |
|
158 | |||
159 | [paste.app_factory] |
|
159 | [paste.app_factory] | |
160 | main = kallithea.config.middleware:make_app |
|
160 | main = kallithea.config.middleware:make_app | |
161 | """, |
|
161 | """, | |
162 | ) |
|
162 | ) |
General Comments 0
You need to be logged in to leave comments.
Login now