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