Show More
@@ -57,7 +57,7 b' pdebug = false' | |||||
57 | ## SMTP server settings |
|
57 | ## SMTP server settings | |
58 | ## Only smtp_server is mandatory. All other settings take the specified default |
|
58 | ## Only smtp_server is mandatory. All other settings take the specified default | |
59 | ## values. |
|
59 | ## values. | |
60 |
#smtp_server = |
|
60 | #smtp_server = smtp.example.com | |
61 | #smtp_username = |
|
61 | #smtp_username = | |
62 | #smtp_password = |
|
62 | #smtp_password = | |
63 | #smtp_port = 25 |
|
63 | #smtp_port = 25 | |
@@ -228,8 +228,8 b' show_revision_number = false' | |||||
228 |
|
228 | |||
229 | ## gist URL alias, used to create nicer urls for gist. This should be an |
|
229 | ## gist URL alias, used to create nicer urls for gist. This should be an | |
230 | ## url that does rewrites to _admin/gists/<gistid>. |
|
230 | ## url that does rewrites to _admin/gists/<gistid>. | |
231 |
## example: http://gist. |
|
231 | ## example: http://gist.example.com/{gistid}. Empty means use the internal | |
232 |
## Kallithea url, ie. http[s]:// |
|
232 | ## Kallithea url, ie. http[s]://kallithea.example.com/_admin/gists/<gistid> | |
233 | gist_alias_url = |
|
233 | gist_alias_url = | |
234 |
|
234 | |||
235 | ## white list of API enabled controllers. This allows to add list of |
|
235 | ## white list of API enabled controllers. This allows to add list of | |
@@ -264,7 +264,7 b' issue_pat = (?:\\s*#)(\\d+)' | |||||
264 | ## fetched from the regex and {repo} is replaced with full repository name |
|
264 | ## fetched from the regex and {repo} is replaced with full repository name | |
265 | ## including groups {repo_name} is replaced with just name of repo |
|
265 | ## including groups {repo_name} is replaced with just name of repo | |
266 |
|
266 | |||
267 |
issue_server_link = https:// |
|
267 | issue_server_link = https://issues.example.com/{repo}/issue/{id} | |
268 |
|
268 | |||
269 | ## prefix to add to link to indicate it's an url |
|
269 | ## prefix to add to link to indicate it's an url | |
270 | ## #314 will be replaced by <issue_prefix><id> |
|
270 | ## #314 will be replaced by <issue_prefix><id> | |
@@ -274,10 +274,10 b' issue_prefix = #' | |||||
274 | ## issue_pat, issue_server_link, issue_prefix can have suffixes to specify |
|
274 | ## issue_pat, issue_server_link, issue_prefix can have suffixes to specify | |
275 | ## multiple patterns, to other issues server, wiki or others |
|
275 | ## multiple patterns, to other issues server, wiki or others | |
276 | ## below an example how to create a wiki pattern |
|
276 | ## below an example how to create a wiki pattern | |
277 |
# wiki-some-id -> https:// |
|
277 | # wiki-some-id -> https://wiki.example.com/some-id | |
278 |
|
278 | |||
279 | #issue_pat_wiki = (?:wiki-)(.+) |
|
279 | #issue_pat_wiki = (?:wiki-)(.+) | |
280 |
#issue_server_link_wiki = https:// |
|
280 | #issue_server_link_wiki = https://wiki.example.com/{id} | |
281 | #issue_prefix_wiki = WIKI- |
|
281 | #issue_prefix_wiki = WIKI- | |
282 |
|
282 | |||
283 | ## instance-id prefix |
|
283 | ## instance-id prefix |
@@ -49,7 +49,7 b' Clients must send JSON encoded JSON-RPC ' | |||||
49 |
|
49 | |||
50 | For example, to pull to a local "CPython" mirror using curl:: |
|
50 | For example, to pull to a local "CPython" mirror using curl:: | |
51 |
|
51 | |||
52 | curl https://example.com/_admin/api -X POST -H 'content-type:text/plain' \ |
|
52 | curl https://kallithea.example.com/_admin/api -X POST -H 'content-type:text/plain' \ | |
53 | --data-binary '{"id":1,"api_key":"xe7cdb2v278e4evbdf5vs04v832v0efvcbcve4a3","method":"pull","args":{"repo":"CPython"}}' |
|
53 | --data-binary '{"id":1,"api_key":"xe7cdb2v278e4evbdf5vs04v832v0efvcbcve4a3","method":"pull","args":{"repo":"CPython"}}' | |
54 |
|
54 | |||
55 | In general, provide |
|
55 | In general, provide |
@@ -36,7 +36,7 b' up for you.' | |||||
36 | The ``setup-db`` values can also be given on the command line. |
|
36 | The ``setup-db`` values can also be given on the command line. | |
37 | Example:: |
|
37 | Example:: | |
38 |
|
38 | |||
39 |
paster setup-db my.ini --user=nn --password=secret --email=nn@example. |
|
39 | paster setup-db my.ini --user=nn --password=secret --email=nn@example.com --repos=/srv/repos | |
40 |
|
40 | |||
41 | The ``setup-db`` command will create all needed tables and an |
|
41 | The ``setup-db`` command will create all needed tables and an | |
42 | admin account. When choosing a root path you can either use a new |
|
42 | admin account. When choosing a root path you can either use a new | |
@@ -108,7 +108,7 b' If your main directory (the same as set ' | |||||
108 | example set to ``/srv/repos`` and the repository you are using is |
|
108 | example set to ``/srv/repos`` and the repository you are using is | |
109 | named ``kallithea``, then to clone via ssh you should run:: |
|
109 | named ``kallithea``, then to clone via ssh you should run:: | |
110 |
|
110 | |||
111 |
hg clone ssh://user@ |
|
111 | hg clone ssh://user@kallithea.example.com/srv/repos/kallithea | |
112 |
|
112 | |||
113 | Using other external tools such as mercurial-server_ or using ssh key-based |
|
113 | Using other external tools such as mercurial-server_ or using ssh key-based | |
114 | authentication is fully supported. |
|
114 | authentication is fully supported. | |
@@ -176,7 +176,7 b" Here's a typical LDAP setup::" | |||||
176 |
|
176 | |||
177 | Connection settings |
|
177 | Connection settings | |
178 | Enable LDAP = checked |
|
178 | Enable LDAP = checked | |
179 |
Host = host.example. |
|
179 | Host = host.example.com | |
180 | Port = 389 |
|
180 | Port = 389 | |
181 | Account = <account> |
|
181 | Account = <account> | |
182 | Password = <password> |
|
182 | Password = <password> | |
@@ -443,7 +443,7 b' and have that replaced with a URL to the' | |||||
443 | uncomment the following variables in the ini file:: |
|
443 | uncomment the following variables in the ini file:: | |
444 |
|
444 | |||
445 | issue_pat = (?:^#|\s#)(\w+) |
|
445 | issue_pat = (?:^#|\s#)(\w+) | |
446 |
issue_server_link = https:// |
|
446 | issue_server_link = https://issues.example.com/{repo}/issue/{id} | |
447 | issue_prefix = # |
|
447 | issue_prefix = # | |
448 |
|
448 | |||
449 | ``issue_pat`` is the regular expression describing which strings in |
|
449 | ``issue_pat`` is the regular expression describing which strings in | |
@@ -461,13 +461,13 b' generate a URL in the format:' | |||||
461 |
|
461 | |||
462 | .. code-block:: html |
|
462 | .. code-block:: html | |
463 |
|
463 | |||
464 |
<a href="https:// |
|
464 | <a href="https://issues.example.com/example_repo/issue/300">ISSUE-300</a> | |
465 |
|
465 | |||
466 | If needed, more than one pattern can be specified by appending a unique suffix to |
|
466 | If needed, more than one pattern can be specified by appending a unique suffix to | |
467 | the variables. For example:: |
|
467 | the variables. For example:: | |
468 |
|
468 | |||
469 | issue_pat_wiki = (?:wiki-)(.+) |
|
469 | issue_pat_wiki = (?:wiki-)(.+) | |
470 |
issue_server_link_wiki = https:// |
|
470 | issue_server_link_wiki = https://wiki.example.com/{id} | |
471 | issue_prefix_wiki = WIKI- |
|
471 | issue_prefix_wiki = WIKI- | |
472 |
|
472 | |||
473 | With these settings, wiki pages can be referenced as wiki-some-id, and every |
|
473 | With these settings, wiki pages can be referenced as wiki-some-id, and every | |
@@ -475,7 +475,7 b' such reference will be transformed into:' | |||||
475 |
|
475 | |||
476 | .. code-block:: html |
|
476 | .. code-block:: html | |
477 |
|
477 | |||
478 |
<a href="https:// |
|
478 | <a href="https://wiki.example.com/some-id">WIKI-some-id</a> | |
479 |
|
479 | |||
480 |
|
480 | |||
481 | Hook management |
|
481 | Hook management | |
@@ -569,7 +569,7 b' Sample config for Nginx using proxy:' | |||||
569 | ## gist alias |
|
569 | ## gist alias | |
570 | server { |
|
570 | server { | |
571 | listen 443; |
|
571 | listen 443; | |
572 |
server_name gist. |
|
572 | server_name gist.example.com; | |
573 | access_log /var/log/nginx/gist.access.log; |
|
573 | access_log /var/log/nginx/gist.access.log; | |
574 | error_log /var/log/nginx/gist.error.log; |
|
574 | error_log /var/log/nginx/gist.error.log; | |
575 |
|
575 | |||
@@ -583,13 +583,13 b' Sample config for Nginx using proxy:' | |||||
583 | 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; |
|
583 | 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; | |
584 | ssl_prefer_server_ciphers on; |
|
584 | ssl_prefer_server_ciphers on; | |
585 |
|
585 | |||
586 |
rewrite ^/(.+)$ https:// |
|
586 | rewrite ^/(.+)$ https://kallithea.example.com/_admin/gists/$1; | |
587 |
rewrite (.*) https:// |
|
587 | rewrite (.*) https://kallithea.example.com/_admin/gists; | |
588 | } |
|
588 | } | |
589 |
|
589 | |||
590 | server { |
|
590 | server { | |
591 | listen 443; |
|
591 | listen 443; | |
592 |
server_name |
|
592 | server_name kallithea.example.com | |
593 | access_log /var/log/nginx/kallithea.access.log; |
|
593 | access_log /var/log/nginx/kallithea.access.log; | |
594 | error_log /var/log/nginx/kallithea.error.log; |
|
594 | error_log /var/log/nginx/kallithea.error.log; | |
595 |
|
595 | |||
@@ -648,7 +648,7 b' Here is a sample configuration file for ' | |||||
648 | .. code-block:: apache |
|
648 | .. code-block:: apache | |
649 |
|
649 | |||
650 | <VirtualHost *:80> |
|
650 | <VirtualHost *:80> | |
651 |
ServerName |
|
651 | ServerName kallithea.example.com | |
652 |
|
652 | |||
653 | <Proxy *> |
|
653 | <Proxy *> | |
654 | # For Apache 2.4 and later: |
|
654 | # For Apache 2.4 and later: |
@@ -78,11 +78,11 b' Permanent repository URLs' | |||||
78 | Due to the complicated nature of repository grouping, URLs of repositories |
|
78 | Due to the complicated nature of repository grouping, URLs of repositories | |
79 | can often change. For example, a repository originally accessible from:: |
|
79 | can often change. For example, a repository originally accessible from:: | |
80 |
|
80 | |||
81 | http://example.com/repo_name |
|
81 | http://kallithea.example.com/repo_name | |
82 |
|
82 | |||
83 | would get a new URL after moving it to test_group:: |
|
83 | would get a new URL after moving it to test_group:: | |
84 |
|
84 | |||
85 | http://example.com/test_group/repo_name |
|
85 | http://kallithea.example.com/test_group/repo_name | |
86 |
|
86 | |||
87 | Such moving of a repository to a group can be an issue for build systems and |
|
87 | Such moving of a repository to a group can be an issue for build systems and | |
88 | other scripts where the repository paths are hardcoded. To mitigate this, |
|
88 | other scripts where the repository paths are hardcoded. To mitigate this, | |
@@ -94,7 +94,7 b' such URLs.' | |||||
94 |
|
94 | |||
95 | In the example, the repository could also be accessible as:: |
|
95 | In the example, the repository could also be accessible as:: | |
96 |
|
96 | |||
97 | http://example.com/_<ID> |
|
97 | http://kallithea.example.com/_<ID> | |
98 |
|
98 | |||
99 | The ID of a given repository can be shown from the repository ``Summary`` page, |
|
99 | The ID of a given repository can be shown from the repository ``Summary`` page, | |
100 | by selecting the ``Show by ID`` button next to ``Clone URL``. |
|
100 | by selecting the ``Show by ID`` button next to ``Clone URL``. | |
@@ -137,7 +137,7 b' Currently it supports the following opti' | |||||
137 |
|
137 | |||
138 | If you need to clone repositories that are protected via basic authentication, |
|
138 | If you need to clone repositories that are protected via basic authentication, | |
139 | you can pass the credentials in the URL, e.g. |
|
139 | you can pass the credentials in the URL, e.g. | |
140 |
``http://user:passw@remote. |
|
140 | ``http://user:passw@remote.example.com/repo``. Kallithea will then try to login and | |
141 | clone using the given credentials. Please note that the given credentials will |
|
141 | clone using the given credentials. Please note that the given credentials will | |
142 | be stored as plaintext inside the database. However, the authentication |
|
142 | be stored as plaintext inside the database. However, the authentication | |
143 | information will not be shown in the clone URL on the summary page. |
|
143 | information will not be shown in the clone URL on the summary page. |
@@ -36,7 +36,7 b' def argparser(argv):' | |||||
36 | "kallithea-api [-h] [--format=FORMAT] [--apikey=APIKEY] [--apihost=APIHOST] " |
|
36 | "kallithea-api [-h] [--format=FORMAT] [--apikey=APIKEY] [--apihost=APIHOST] " | |
37 | "[--config=CONFIG] [--save-config] " |
|
37 | "[--config=CONFIG] [--save-config] " | |
38 | "METHOD <key:val> <key2:val> ...\n" |
|
38 | "METHOD <key:val> <key2:val> ...\n" | |
39 |
"Create config file: kallithea-api --apikey=<key> --apihost=http:// |
|
39 | "Create config file: kallithea-api --apikey=<key> --apihost=http://kallithea.example.com --save-config" | |
40 | ) |
|
40 | ) | |
41 |
|
41 | |||
42 | parser = argparse.ArgumentParser(description='Kallithea API cli', |
|
42 | parser = argparse.ArgumentParser(description='Kallithea API cli', |
@@ -39,7 +39,7 b' def argparser(argv):' | |||||
39 | "kallithea-gist [-h] [--format=FORMAT] [--apikey=APIKEY] [--apihost=APIHOST] " |
|
39 | "kallithea-gist [-h] [--format=FORMAT] [--apikey=APIKEY] [--apihost=APIHOST] " | |
40 | "[--config=CONFIG] [--save-config] [GIST OPTIONS] " |
|
40 | "[--config=CONFIG] [--save-config] [GIST OPTIONS] " | |
41 | "[filename or stdin use - for terminal stdin ]\n" |
|
41 | "[filename or stdin use - for terminal stdin ]\n" | |
42 |
"Create config file: kallithea-gist --apikey=<key> --apihost=http:// |
|
42 | "Create config file: kallithea-gist --apikey=<key> --apihost=http://kallithea.example.com --save-config" | |
43 | ) |
|
43 | ) | |
44 |
|
44 | |||
45 | parser = argparse.ArgumentParser(description='Kallithea Gist cli', |
|
45 | parser = argparse.ArgumentParser(description='Kallithea Gist cli', |
@@ -1,11 +1,11 b'' | |||||
1 | [default] |
|
1 | [default] | |
2 |
api_url = http:// |
|
2 | api_url = http://kallithea.example.com/_admin/api | |
3 | api_user = admin |
|
3 | api_user = admin | |
4 | api_key = XXXXXXXXXXXX |
|
4 | api_key = XXXXXXXXXXXX | |
5 |
|
5 | |||
6 |
ldap_uri = ldap:// |
|
6 | ldap_uri = ldap://ldap.example.com:389 | |
7 |
ldap_user = cn=kallithea, |
|
7 | ldap_user = cn=kallithea,dc=example,dc=com | |
8 | ldap_key = XXXXXXXXX |
|
8 | ldap_key = XXXXXXXXX | |
9 |
base_dn = dc= |
|
9 | base_dn = dc=example,dc=com | |
10 |
|
10 | |||
11 | sync_users = True No newline at end of file |
|
11 | sync_users = True |
@@ -51,7 +51,7 b' pdebug = false' | |||||
51 | <%text>## SMTP server settings</%text> |
|
51 | <%text>## SMTP server settings</%text> | |
52 | <%text>## Only smtp_server is mandatory. All other settings take the specified default</%text> |
|
52 | <%text>## Only smtp_server is mandatory. All other settings take the specified default</%text> | |
53 | <%text>## values.</%text> |
|
53 | <%text>## values.</%text> | |
54 |
#smtp_server = |
|
54 | #smtp_server = smtp.example.com | |
55 | #smtp_username = |
|
55 | #smtp_username = | |
56 | #smtp_password = |
|
56 | #smtp_password = | |
57 | #smtp_port = 25 |
|
57 | #smtp_port = 25 | |
@@ -226,8 +226,8 b' show_revision_number = false' | |||||
226 |
|
226 | |||
227 | <%text>## gist URL alias, used to create nicer urls for gist. This should be an</%text> |
|
227 | <%text>## gist URL alias, used to create nicer urls for gist. This should be an</%text> | |
228 | <%text>## url that does rewrites to _admin/gists/<gistid>.</%text> |
|
228 | <%text>## url that does rewrites to _admin/gists/<gistid>.</%text> | |
229 |
<%text>## example: http://gist. |
|
229 | <%text>## example: http://gist.example.com/{gistid}. Empty means use the internal</%text> | |
230 |
<%text>## Kallithea url, ie. http[s]:// |
|
230 | <%text>## Kallithea url, ie. http[s]://kallithea.example.com/_admin/gists/<gistid></%text> | |
231 | gist_alias_url = |
|
231 | gist_alias_url = | |
232 |
|
232 | |||
233 | <%text>## white list of API enabled controllers. This allows to add list of</%text> |
|
233 | <%text>## white list of API enabled controllers. This allows to add list of</%text> | |
@@ -262,7 +262,7 b' issue_pat = (?:\\s*#)(\\d+)' | |||||
262 | <%text>## fetched from the regex and {repo} is replaced with full repository name</%text> |
|
262 | <%text>## fetched from the regex and {repo} is replaced with full repository name</%text> | |
263 | <%text>## including groups {repo_name} is replaced with just name of repo</%text> |
|
263 | <%text>## including groups {repo_name} is replaced with just name of repo</%text> | |
264 |
|
264 | |||
265 |
issue_server_link = https:// |
|
265 | issue_server_link = https://issues.example.com/{repo}/issue/{id} | |
266 |
|
266 | |||
267 | <%text>## prefix to add to link to indicate it's an url</%text> |
|
267 | <%text>## prefix to add to link to indicate it's an url</%text> | |
268 | <%text>## #314 will be replaced by <issue_prefix><id></%text> |
|
268 | <%text>## #314 will be replaced by <issue_prefix><id></%text> | |
@@ -272,10 +272,10 b' issue_prefix = #' | |||||
272 | <%text>## issue_pat, issue_server_link, issue_prefix can have suffixes to specify</%text> |
|
272 | <%text>## issue_pat, issue_server_link, issue_prefix can have suffixes to specify</%text> | |
273 | <%text>## multiple patterns, to other issues server, wiki or others</%text> |
|
273 | <%text>## multiple patterns, to other issues server, wiki or others</%text> | |
274 | <%text>## below an example how to create a wiki pattern</%text> |
|
274 | <%text>## below an example how to create a wiki pattern</%text> | |
275 |
# wiki-some-id -> https:// |
|
275 | # wiki-some-id -> https://wiki.example.com/some-id | |
276 |
|
276 | |||
277 | #issue_pat_wiki = (?:wiki-)(.+) |
|
277 | #issue_pat_wiki = (?:wiki-)(.+) | |
278 |
#issue_server_link_wiki = https:// |
|
278 | #issue_server_link_wiki = https://wiki.example.com/{id} | |
279 | #issue_prefix_wiki = WIKI- |
|
279 | #issue_prefix_wiki = WIKI- | |
280 |
|
280 | |||
281 | <%text>## instance-id prefix</%text> |
|
281 | <%text>## instance-id prefix</%text> |
@@ -52,7 +52,7 b' pdebug = false' | |||||
52 | ## SMTP server settings |
|
52 | ## SMTP server settings | |
53 | ## Only smtp_server is mandatory. All other settings take the specified default |
|
53 | ## Only smtp_server is mandatory. All other settings take the specified default | |
54 | ## values. |
|
54 | ## values. | |
55 |
#smtp_server = |
|
55 | #smtp_server = smtp.example.com | |
56 | #smtp_username = |
|
56 | #smtp_username = | |
57 | #smtp_password = |
|
57 | #smtp_password = | |
58 | #smtp_port = 25 |
|
58 | #smtp_port = 25 | |
@@ -222,8 +222,8 b' show_revision_number = false' | |||||
222 |
|
222 | |||
223 | ## gist URL alias, used to create nicer urls for gist. This should be an |
|
223 | ## gist URL alias, used to create nicer urls for gist. This should be an | |
224 | ## url that does rewrites to _admin/gists/<gistid>. |
|
224 | ## url that does rewrites to _admin/gists/<gistid>. | |
225 |
## example: http://gist. |
|
225 | ## example: http://gist.example.com/{gistid}. Empty means use the internal | |
226 |
## Kallithea url, ie. http[s]:// |
|
226 | ## Kallithea url, ie. http[s]://kallithea.example.com/_admin/gists/<gistid> | |
227 | gist_alias_url = |
|
227 | gist_alias_url = | |
228 |
|
228 | |||
229 | ## white list of API enabled controllers. This allows to add list of |
|
229 | ## white list of API enabled controllers. This allows to add list of | |
@@ -258,7 +258,7 b' issue_pat = (?:\\s*#)(\\d+)' | |||||
258 | ## fetched from the regex and {repo} is replaced with full repository name |
|
258 | ## fetched from the regex and {repo} is replaced with full repository name | |
259 | ## including groups {repo_name} is replaced with just name of repo |
|
259 | ## including groups {repo_name} is replaced with just name of repo | |
260 |
|
260 | |||
261 |
issue_server_link = https:// |
|
261 | issue_server_link = https://issues.example.com/{repo}/issue/{id} | |
262 |
|
262 | |||
263 | ## prefix to add to link to indicate it's an url |
|
263 | ## prefix to add to link to indicate it's an url | |
264 | ## #314 will be replaced by <issue_prefix><id> |
|
264 | ## #314 will be replaced by <issue_prefix><id> | |
@@ -268,10 +268,10 b' issue_prefix = #' | |||||
268 | ## issue_pat, issue_server_link, issue_prefix can have suffixes to specify |
|
268 | ## issue_pat, issue_server_link, issue_prefix can have suffixes to specify | |
269 | ## multiple patterns, to other issues server, wiki or others |
|
269 | ## multiple patterns, to other issues server, wiki or others | |
270 | ## below an example how to create a wiki pattern |
|
270 | ## below an example how to create a wiki pattern | |
271 |
# wiki-some-id -> https:// |
|
271 | # wiki-some-id -> https://wiki.example.com/some-id | |
272 |
|
272 | |||
273 | #issue_pat_wiki = (?:wiki-)(.+) |
|
273 | #issue_pat_wiki = (?:wiki-)(.+) | |
274 |
#issue_server_link_wiki = https:// |
|
274 | #issue_server_link_wiki = https://wiki.example.com/{id} | |
275 | #issue_prefix_wiki = WIKI- |
|
275 | #issue_prefix_wiki = WIKI- | |
276 |
|
276 | |||
277 | ## instance-id prefix |
|
277 | ## instance-id prefix |
@@ -138,7 +138,7 b' class MailResponse(object):' | |||||
138 | as __init__ parameters, or by setting those attributes. |
|
138 | as __init__ parameters, or by setting those attributes. | |
139 |
|
139 | |||
140 | You can initially set the From, To, and Subject, but they are headers so |
|
140 | You can initially set the From, To, and Subject, but they are headers so | |
141 |
use the dict notation to change them: msg['From'] = 'joe@ |
|
141 | use the dict notation to change them: msg['From'] = 'joe@example.com'. | |
142 |
|
142 | |||
143 | The message is not fully crafted until right when you convert it with |
|
143 | The message is not fully crafted until right when you convert it with | |
144 | MailResponse.to_message. This lets you change it and work with it, then |
|
144 | MailResponse.to_message. This lets you change it and work with it, then |
@@ -90,15 +90,15 b' environ = {}' | |||||
90 | TESTS_TMP_PATH = jn('/', 'tmp', 'rc_test_%s' % _RandomNameSequence().next()) |
|
90 | TESTS_TMP_PATH = jn('/', 'tmp', 'rc_test_%s' % _RandomNameSequence().next()) | |
91 | TEST_USER_ADMIN_LOGIN = 'test_admin' |
|
91 | TEST_USER_ADMIN_LOGIN = 'test_admin' | |
92 | TEST_USER_ADMIN_PASS = 'test12' |
|
92 | TEST_USER_ADMIN_PASS = 'test12' | |
93 |
TEST_USER_ADMIN_EMAIL = 'test_admin@ |
|
93 | TEST_USER_ADMIN_EMAIL = 'test_admin@example.com' | |
94 |
|
94 | |||
95 | TEST_USER_REGULAR_LOGIN = 'test_regular' |
|
95 | TEST_USER_REGULAR_LOGIN = 'test_regular' | |
96 | TEST_USER_REGULAR_PASS = 'test12' |
|
96 | TEST_USER_REGULAR_PASS = 'test12' | |
97 |
TEST_USER_REGULAR_EMAIL = 'test_regular@ |
|
97 | TEST_USER_REGULAR_EMAIL = 'test_regular@example.com' | |
98 |
|
98 | |||
99 | TEST_USER_REGULAR2_LOGIN = 'test_regular2' |
|
99 | TEST_USER_REGULAR2_LOGIN = 'test_regular2' | |
100 | TEST_USER_REGULAR2_PASS = 'test12' |
|
100 | TEST_USER_REGULAR2_PASS = 'test12' | |
101 |
TEST_USER_REGULAR2_EMAIL = 'test_regular2@ |
|
101 | TEST_USER_REGULAR2_EMAIL = 'test_regular2@example.com' | |
102 |
|
102 | |||
103 | HG_REPO = 'vcs_test_hg' |
|
103 | HG_REPO = 'vcs_test_hg' | |
104 | GIT_REPO = 'vcs_test_git' |
|
104 | GIT_REPO = 'vcs_test_git' |
@@ -552,7 +552,7 b' class _BaseTestApi(object):' | |||||
552 | def test_api_create_existing_user(self): |
|
552 | def test_api_create_existing_user(self): | |
553 | id_, params = _build_data(self.apikey, 'create_user', |
|
553 | id_, params = _build_data(self.apikey, 'create_user', | |
554 | username=TEST_USER_ADMIN_LOGIN, |
|
554 | username=TEST_USER_ADMIN_LOGIN, | |
555 |
email='test@ |
|
555 | email='test@example.com', | |
556 | password='trololo') |
|
556 | password='trololo') | |
557 | response = api_call(self, params) |
|
557 | response = api_call(self, params) | |
558 |
|
558 | |||
@@ -571,7 +571,7 b' class _BaseTestApi(object):' | |||||
571 |
|
571 | |||
572 | def test_api_create_user(self): |
|
572 | def test_api_create_user(self): | |
573 | username = 'test_new_api_user' |
|
573 | username = 'test_new_api_user' | |
574 |
email = username + "@ |
|
574 | email = username + "@example.com" | |
575 |
|
575 | |||
576 | id_, params = _build_data(self.apikey, 'create_user', |
|
576 | id_, params = _build_data(self.apikey, 'create_user', | |
577 | username=username, |
|
577 | username=username, | |
@@ -593,7 +593,7 b' class _BaseTestApi(object):' | |||||
593 |
|
593 | |||
594 | def test_api_create_user_without_password(self): |
|
594 | def test_api_create_user_without_password(self): | |
595 | username = 'test_new_api_user_passwordless' |
|
595 | username = 'test_new_api_user_passwordless' | |
596 |
email = username + "@ |
|
596 | email = username + "@example.com" | |
597 |
|
597 | |||
598 | id_, params = _build_data(self.apikey, 'create_user', |
|
598 | id_, params = _build_data(self.apikey, 'create_user', | |
599 | username=username, |
|
599 | username=username, | |
@@ -613,7 +613,7 b' class _BaseTestApi(object):' | |||||
613 |
|
613 | |||
614 | def test_api_create_user_with_extern_name(self): |
|
614 | def test_api_create_user_with_extern_name(self): | |
615 | username = 'test_new_api_user_passwordless' |
|
615 | username = 'test_new_api_user_passwordless' | |
616 |
email = username + "@ |
|
616 | email = username + "@example.com" | |
617 |
|
617 | |||
618 | id_, params = _build_data(self.apikey, 'create_user', |
|
618 | id_, params = _build_data(self.apikey, 'create_user', | |
619 | username=username, |
|
619 | username=username, | |
@@ -635,7 +635,7 b' class _BaseTestApi(object):' | |||||
635 | def test_api_create_user_when_exception_happened(self): |
|
635 | def test_api_create_user_when_exception_happened(self): | |
636 |
|
636 | |||
637 | username = 'test_new_api_user' |
|
637 | username = 'test_new_api_user' | |
638 |
email = username + "@ |
|
638 | email = username + "@example.com" | |
639 |
|
639 | |||
640 | id_, params = _build_data(self.apikey, 'create_user', |
|
640 | id_, params = _build_data(self.apikey, 'create_user', | |
641 | username=username, |
|
641 | username=username, | |
@@ -1138,7 +1138,7 b' class _BaseTestApi(object):' | |||||
1138 | ('description', {'description': 'new description'}), |
|
1138 | ('description', {'description': 'new description'}), | |
1139 | ('active', {'active': True}), |
|
1139 | ('active', {'active': True}), | |
1140 | ('active', {'active': False}), |
|
1140 | ('active', {'active': False}), | |
1141 |
('clone_uri', {'clone_uri': 'http:// |
|
1141 | ('clone_uri', {'clone_uri': 'http://example.com/repo'}), | |
1142 | ('clone_uri', {'clone_uri': None}), |
|
1142 | ('clone_uri', {'clone_uri': None}), | |
1143 | ('landing_rev', {'landing_rev': 'branch:master'}), |
|
1143 | ('landing_rev', {'landing_rev': 'branch:master'}), | |
1144 | ('enable_statistics', {'enable_statistics': True}), |
|
1144 | ('enable_statistics', {'enable_statistics': True}), |
@@ -47,7 +47,7 b' class TestAdminUsersController(TestContr' | |||||
47 | password_confirmation = password |
|
47 | password_confirmation = password | |
48 | name = 'name' |
|
48 | name = 'name' | |
49 | lastname = 'lastname' |
|
49 | lastname = 'lastname' | |
50 |
email = 'mail@ |
|
50 | email = 'mail@example.com' | |
51 |
|
51 | |||
52 | response = self.app.post(url('users'), |
|
52 | response = self.app.post(url('users'), | |
53 | {'username': username, |
|
53 | {'username': username, | |
@@ -83,7 +83,7 b' class TestAdminUsersController(TestContr' | |||||
83 | password = '' |
|
83 | password = '' | |
84 | name = 'name' |
|
84 | name = 'name' | |
85 | lastname = 'lastname' |
|
85 | lastname = 'lastname' | |
86 | email = 'errmail.com' |
|
86 | email = 'errmail.example.com' | |
87 |
|
87 | |||
88 | response = self.app.post(url('users'), {'username': username, |
|
88 | response = self.app.post(url('users'), {'username': username, | |
89 | 'password': password, |
|
89 | 'password': password, | |
@@ -119,7 +119,7 b' class TestAdminUsersController(TestContr' | |||||
119 | ('extern_name', {'extern_name': None}), |
|
119 | ('extern_name', {'extern_name': None}), | |
120 | ('active', {'active': False}), |
|
120 | ('active', {'active': False}), | |
121 | ('active', {'active': True}), |
|
121 | ('active', {'active': True}), | |
122 |
('email', {'email': 'some |
|
122 | ('email', {'email': 'someemail@example.com'}), | |
123 | # ('new_password', {'new_password': 'foobar123', |
|
123 | # ('new_password', {'new_password': 'foobar123', | |
124 | # 'password_confirmation': 'foobar123'}) |
|
124 | # 'password_confirmation': 'foobar123'}) | |
125 | ]) |
|
125 | ]) |
@@ -97,7 +97,7 b' class TestFilesController(TestController' | |||||
97 | revision='8911406ad776fdd3d0b9932a2e89677e57405a48', |
|
97 | revision='8911406ad776fdd3d0b9932a2e89677e57405a48', | |
98 | f_path='vcs/nodes.py')) |
|
98 | f_path='vcs/nodes.py')) | |
99 |
|
99 | |||
100 |
response.mustcontain("""<div class="commit">Partially implemented <a class="issue-tracker-link" href="https:// |
|
100 | response.mustcontain("""<div class="commit">Partially implemented <a class="issue-tracker-link" href="https://issues.example.com/vcs_test_hg/issue/16">#16</a>. filecontent/commit message/author/node name are safe_unicode now. | |
101 | In addition some other __str__ are unicode as well |
|
101 | In addition some other __str__ are unicode as well | |
102 | Added test for unicode |
|
102 | Added test for unicode | |
103 | Improved test to clone into uniq repository. |
|
103 | Improved test to clone into uniq repository. |
@@ -103,8 +103,8 b' class TestLoginController(TestController' | |||||
103 | ('data:text/html,<script>window.alert("xss")</script>',), |
|
103 | ('data:text/html,<script>window.alert("xss")</script>',), | |
104 | ('mailto:test@example.com',), |
|
104 | ('mailto:test@example.com',), | |
105 | ('file:///etc/passwd',), |
|
105 | ('file:///etc/passwd',), | |
106 |
('ftp:// |
|
106 | ('ftp://ftp.example.com',), | |
107 |
('http://other. |
|
107 | ('http://other.example.com/bl%C3%A5b%C3%A6rgr%C3%B8d',), | |
108 | ]) |
|
108 | ]) | |
109 | def test_login_bad_came_froms(self, url_came_from): |
|
109 | def test_login_bad_came_froms(self, url_came_from): | |
110 | response = self.app.post(url(controller='login', action='index', |
|
110 | response = self.app.post(url(controller='login', action='index', | |
@@ -205,7 +205,7 b' class TestLoginController(TestController' | |||||
205 | {'username': uname, |
|
205 | {'username': uname, | |
206 | 'password': 'test12', |
|
206 | 'password': 'test12', | |
207 | 'password_confirmation': 'test12', |
|
207 | 'password_confirmation': 'test12', | |
208 |
'email': 'goodmail@ |
|
208 | 'email': 'goodmail@example.com', | |
209 | 'firstname': 'test', |
|
209 | 'firstname': 'test', | |
210 | 'lastname': 'test'}) |
|
210 | 'lastname': 'test'}) | |
211 |
|
211 | |||
@@ -304,7 +304,7 b' class TestLoginController(TestController' | |||||
304 | def test_register_ok(self): |
|
304 | def test_register_ok(self): | |
305 | username = 'test_regular4' |
|
305 | username = 'test_regular4' | |
306 | password = 'qweqwe' |
|
306 | password = 'qweqwe' | |
307 |
email = 'user |
|
307 | email = 'user4@example.com' | |
308 | name = 'testname' |
|
308 | name = 'testname' | |
309 | lastname = 'testlastname' |
|
309 | lastname = 'testlastname' | |
310 |
|
310 | |||
@@ -348,7 +348,7 b' class TestLoginController(TestController' | |||||
348 |
|
348 | |||
349 | username = 'test_password_reset_1' |
|
349 | username = 'test_password_reset_1' | |
350 | password = 'qweqwe' |
|
350 | password = 'qweqwe' | |
351 |
email = 'username@ |
|
351 | email = 'username@example.com' | |
352 | name = 'passwd' |
|
352 | name = 'passwd' | |
353 | lastname = 'reset' |
|
353 | lastname = 'reset' | |
354 | timestamp = int(time.time()) |
|
354 | timestamp = int(time.time()) |
@@ -67,16 +67,16 b' class TestMyAccountController(TestContro' | |||||
67 | response.mustcontain('No additional emails specified') |
|
67 | response.mustcontain('No additional emails specified') | |
68 |
|
68 | |||
69 | response = self.app.post(url('my_account_emails'), |
|
69 | response = self.app.post(url('my_account_emails'), | |
70 |
{'new_email': ' |
|
70 | {'new_email': 'barz@example.com', '_authentication_token': self.authentication_token()}) | |
71 |
|
71 | |||
72 | response = self.app.get(url('my_account_emails')) |
|
72 | response = self.app.get(url('my_account_emails')) | |
73 |
|
73 | |||
74 | from kallithea.model.db import UserEmailMap |
|
74 | from kallithea.model.db import UserEmailMap | |
75 | email_id = UserEmailMap.query()\ |
|
75 | email_id = UserEmailMap.query()\ | |
76 | .filter(UserEmailMap.user == User.get_by_username(TEST_USER_ADMIN_LOGIN))\ |
|
76 | .filter(UserEmailMap.user == User.get_by_username(TEST_USER_ADMIN_LOGIN))\ | |
77 |
.filter(UserEmailMap.email == ' |
|
77 | .filter(UserEmailMap.email == 'barz@example.com').one().email_id | |
78 |
|
78 | |||
79 |
response.mustcontain(' |
|
79 | response.mustcontain('barz@example.com') | |
80 | response.mustcontain('<input id="del_email_id" name="del_email_id" type="hidden" value="%s" />' % email_id) |
|
80 | response.mustcontain('<input id="del_email_id" name="del_email_id" type="hidden" value="%s" />' % email_id) | |
81 |
|
81 | |||
82 | response = self.app.post(url('my_account_emails'), |
|
82 | response = self.app.post(url('my_account_emails'), | |
@@ -97,7 +97,7 b' class TestMyAccountController(TestContro' | |||||
97 | #('extern_name', {'extern_name': None}), |
|
97 | #('extern_name', {'extern_name': None}), | |
98 | ('active', {'active': False}), |
|
98 | ('active', {'active': False}), | |
99 | ('active', {'active': True}), |
|
99 | ('active', {'active': True}), | |
100 |
('email', {'email': 'some |
|
100 | ('email', {'email': 'someemail@example.com'}), | |
101 | # ('new_password', {'new_password': 'foobar123', |
|
101 | # ('new_password', {'new_password': 'foobar123', | |
102 | # 'password_confirmation': 'foobar123'}) |
|
102 | # 'password_confirmation': 'foobar123'}) | |
103 | ]) |
|
103 | ]) |
@@ -112,13 +112,13 b' def _add_files_and_push(vcs, DEST, **kwa' | |||||
112 | for i in xrange(kwargs.get('files_no', 3)): |
|
112 | for i in xrange(kwargs.get('files_no', 3)): | |
113 | cmd = """echo 'added_line%s' >> %s""" % (i, added_file) |
|
113 | cmd = """echo 'added_line%s' >> %s""" % (i, added_file) | |
114 | Command(cwd).execute(cmd) |
|
114 | Command(cwd).execute(cmd) | |
115 |
author_str = 'User ǝɯɐᴎ <me@e |
|
115 | author_str = 'User ǝɯɐᴎ <me@example.com>' | |
116 | if vcs == 'hg': |
|
116 | if vcs == 'hg': | |
117 | cmd = """hg commit -m 'commited new %s' -u '%s' %s """ % ( |
|
117 | cmd = """hg commit -m 'commited new %s' -u '%s' %s """ % ( | |
118 | i, author_str, added_file |
|
118 | i, author_str, added_file | |
119 | ) |
|
119 | ) | |
120 | elif vcs == 'git': |
|
120 | elif vcs == 'git': | |
121 |
cmd = """EMAIL="me@e |
|
121 | cmd = """EMAIL="me@example.com" git commit -m 'commited new %s' --author '%s' %s """ % ( | |
122 | i, author_str, added_file |
|
122 | i, author_str, added_file | |
123 | ) |
|
123 | ) | |
124 | Command(cwd).execute(cmd) |
|
124 | Command(cwd).execute(cmd) |
@@ -42,11 +42,11 b' TEST_URLS = [' | |||||
42 | '%s://127.0.0.1' % proto), |
|
42 | '%s://127.0.0.1' % proto), | |
43 | ('%s://127.0.0.1:8080' % proto, ['%s://' % proto, '127.0.0.1', '8080'], |
|
43 | ('%s://127.0.0.1:8080' % proto, ['%s://' % proto, '127.0.0.1', '8080'], | |
44 | '%s://127.0.0.1:8080' % proto), |
|
44 | '%s://127.0.0.1:8080' % proto), | |
45 |
('%s:// |
|
45 | ('%s://example.com' % proto, ['%s://' % proto, 'example.com'], | |
46 |
'%s:// |
|
46 | '%s://example.com' % proto), | |
47 |
('%s://user:pass@ |
|
47 | ('%s://user:pass@example.com:8080' % proto, ['%s://' % proto, 'example.com', | |
48 | '8080'], |
|
48 | '8080'], | |
49 |
'%s:// |
|
49 | '%s://example.com:8080' % proto), | |
50 | ] |
|
50 | ] | |
51 |
|
51 | |||
52 | proto = 'https' |
|
52 | proto = 'https' | |
@@ -59,11 +59,11 b' TEST_URLS += [' | |||||
59 | '%s://127.0.0.1' % proto), |
|
59 | '%s://127.0.0.1' % proto), | |
60 | ('%s://127.0.0.1:8080' % proto, ['%s://' % proto, '127.0.0.1', '8080'], |
|
60 | ('%s://127.0.0.1:8080' % proto, ['%s://' % proto, '127.0.0.1', '8080'], | |
61 | '%s://127.0.0.1:8080' % proto), |
|
61 | '%s://127.0.0.1:8080' % proto), | |
62 |
('%s:// |
|
62 | ('%s://example.com' % proto, ['%s://' % proto, 'example.com'], | |
63 |
'%s:// |
|
63 | '%s://example.com' % proto), | |
64 |
('%s://user:pass@ |
|
64 | ('%s://user:pass@example.com:8080' % proto, ['%s://' % proto, 'example.com', | |
65 | '8080'], |
|
65 | '8080'], | |
66 |
'%s:// |
|
66 | '%s://example.com:8080' % proto), | |
67 | ] |
|
67 | ] | |
68 |
|
68 | |||
69 |
|
69 | |||
@@ -104,11 +104,11 b' class TestLibs(BaseTestCase):' | |||||
104 | def test_mention_extractor(self): |
|
104 | def test_mention_extractor(self): | |
105 | from kallithea.lib.utils2 import extract_mentioned_users |
|
105 | from kallithea.lib.utils2 import extract_mentioned_users | |
106 | sample = ( |
|
106 | sample = ( | |
107 |
"@first hi there @world here's my email username@e |
|
107 | "@first hi there @world here's my email username@example.com " | |
108 | "@lukaszb check @one_more22 it pls @ ttwelve @D[] @one@two@three " |
|
108 | "@lukaszb check @one_more22 it pls @ ttwelve @D[] @one@two@three " | |
109 | "@UPPER @cAmEL @2one_more22 @john please see this http://org.pl " |
|
109 | "@UPPER @cAmEL @2one_more22 @john please see this http://org.pl " | |
110 | "@marian.user just do it @marco-polo and next extract @marco_polo " |
|
110 | "@marian.user just do it @marco-polo and next extract @marco_polo " | |
111 |
"user.dot hej ! not-needed maril@ |
|
111 | "user.dot hej ! not-needed maril@example.com" | |
112 | ) |
|
112 | ) | |
113 |
|
113 | |||
114 | s = sorted([ |
|
114 | s = sorted([ | |
@@ -184,7 +184,7 b' class TestLibs(BaseTestCase):' | |||||
184 | def test_tag_exctrator(self): |
|
184 | def test_tag_exctrator(self): | |
185 | sample = ( |
|
185 | sample = ( | |
186 | "hello pta[tag] gog [[]] [[] sda ero[or]d [me =>>< sa]" |
|
186 | "hello pta[tag] gog [[]] [[] sda ero[or]d [me =>>< sa]" | |
187 |
"[requires] [stale] [see<>=>] [see => http:// |
|
187 | "[requires] [stale] [see<>=>] [see => http://example.com]" | |
188 | "[requires => url] [lang => python] [just a tag]" |
|
188 | "[requires => url] [lang => python] [just a tag]" | |
189 | "[,d] [ => ULR ] [obsolete] [desc]]" |
|
189 | "[,d] [ => ULR ] [obsolete] [desc]]" | |
190 | ) |
|
190 | ) | |
@@ -205,7 +205,7 b' class TestLibs(BaseTestCase):' | |||||
205 | class fake_url(object): |
|
205 | class fake_url(object): | |
206 | @classmethod |
|
206 | @classmethod | |
207 | def current(cls, *args, **kwargs): |
|
207 | def current(cls, *args, **kwargs): | |
208 |
return 'https:// |
|
208 | return 'https://example.com' | |
209 |
|
209 | |||
210 | #mock pylons.tmpl_context |
|
210 | #mock pylons.tmpl_context | |
211 | def fake_tmpl_context(_url): |
|
211 | def fake_tmpl_context(_url): | |
@@ -218,35 +218,35 b' class TestLibs(BaseTestCase):' | |||||
218 |
|
218 | |||
219 |
|
219 | |||
220 | with mock.patch('pylons.url', fake_url): |
|
220 | with mock.patch('pylons.url', fake_url): | |
221 |
fake = fake_tmpl_context(_url='http:// |
|
221 | fake = fake_tmpl_context(_url='http://example.com/{email}') | |
222 | with mock.patch('pylons.tmpl_context', fake): |
|
222 | with mock.patch('pylons.tmpl_context', fake): | |
223 | from pylons import url |
|
223 | from pylons import url | |
224 |
assert url.current() == 'https:// |
|
224 | assert url.current() == 'https://example.com' | |
225 |
grav = gravatar_url(email_address='test@ |
|
225 | grav = gravatar_url(email_address='test@example.com', size=24) | |
226 |
assert grav == 'http:// |
|
226 | assert grav == 'http://example.com/test@example.com' | |
227 |
|
227 | |||
228 |
fake = fake_tmpl_context(_url='http:// |
|
228 | fake = fake_tmpl_context(_url='http://example.com/{email}') | |
229 | with mock.patch('pylons.tmpl_context', fake): |
|
229 | with mock.patch('pylons.tmpl_context', fake): | |
230 |
grav = gravatar_url(email_address='test@ |
|
230 | grav = gravatar_url(email_address='test@example.com', size=24) | |
231 |
assert grav == 'http:// |
|
231 | assert grav == 'http://example.com/test@example.com' | |
232 |
|
232 | |||
233 |
fake = fake_tmpl_context(_url='http:// |
|
233 | fake = fake_tmpl_context(_url='http://example.com/{md5email}') | |
234 | with mock.patch('pylons.tmpl_context', fake): |
|
234 | with mock.patch('pylons.tmpl_context', fake): | |
235 |
em = 'test@ |
|
235 | em = 'test@example.com' | |
236 | grav = gravatar_url(email_address=em, size=24) |
|
236 | grav = gravatar_url(email_address=em, size=24) | |
237 |
assert grav == 'http:// |
|
237 | assert grav == 'http://example.com/%s' % (_md5(em)) | |
238 |
|
238 | |||
239 |
fake = fake_tmpl_context(_url='http:// |
|
239 | fake = fake_tmpl_context(_url='http://example.com/{md5email}/{size}') | |
240 | with mock.patch('pylons.tmpl_context', fake): |
|
240 | with mock.patch('pylons.tmpl_context', fake): | |
241 |
em = 'test@ |
|
241 | em = 'test@example.com' | |
242 | grav = gravatar_url(email_address=em, size=24) |
|
242 | grav = gravatar_url(email_address=em, size=24) | |
243 |
assert grav == 'http:// |
|
243 | assert grav == 'http://example.com/%s/%s' % (_md5(em), 24) | |
244 |
|
244 | |||
245 | fake = fake_tmpl_context(_url='{scheme}://{netloc}/{md5email}/{size}') |
|
245 | fake = fake_tmpl_context(_url='{scheme}://{netloc}/{md5email}/{size}') | |
246 | with mock.patch('pylons.tmpl_context', fake): |
|
246 | with mock.patch('pylons.tmpl_context', fake): | |
247 |
em = 'test@ |
|
247 | em = 'test@example.com' | |
248 | grav = gravatar_url(email_address=em, size=24) |
|
248 | grav = gravatar_url(email_address=em, size=24) | |
249 |
assert grav == 'https:// |
|
249 | assert grav == 'https://example.com/%s/%s' % (_md5(em), 24) | |
250 |
|
250 | |||
251 | @parameterized.expand([ |
|
251 | @parameterized.expand([ | |
252 | (Repository.DEFAULT_CLONE_URI, 'group/repo1', {}, '', 'http://vps1:8000/group/repo1'), |
|
252 | (Repository.DEFAULT_CLONE_URI, 'group/repo1', {}, '', 'http://vps1:8000/group/repo1'), | |
@@ -260,9 +260,9 b' class TestLibs(BaseTestCase):' | |||||
260 | ('{scheme}://{user}@{netloc}/_{repoid}', 'group/repo1', {'user': 'username'}, '', 'http://username@vps1:8000/_23'), |
|
260 | ('{scheme}://{user}@{netloc}/_{repoid}', 'group/repo1', {'user': 'username'}, '', 'http://username@vps1:8000/_23'), | |
261 | ('http://{user}@{netloc}/_{repoid}', 'group/repo1', {'user': 'username'}, '', 'http://username@vps1:8000/_23'), |
|
261 | ('http://{user}@{netloc}/_{repoid}', 'group/repo1', {'user': 'username'}, '', 'http://username@vps1:8000/_23'), | |
262 | ('http://{netloc}/_{repoid}', 'group/repo1', {'user': 'username'}, '', 'http://vps1:8000/_23'), |
|
262 | ('http://{netloc}/_{repoid}', 'group/repo1', {'user': 'username'}, '', 'http://vps1:8000/_23'), | |
263 |
('https://{user}@proxy1. |
|
263 | ('https://{user}@proxy1.example.com/{repo}', 'group/repo1', {'user': 'username'}, '', 'https://username@proxy1.example.com/group/repo1'), | |
264 |
('https://{user}@proxy1. |
|
264 | ('https://{user}@proxy1.example.com/{repo}', 'group/repo1', {}, '', 'https://proxy1.example.com/group/repo1'), | |
265 |
('https://proxy1. |
|
265 | ('https://proxy1.example.com/{user}/{repo}', 'group/repo1', {'user': 'username'}, '', 'https://proxy1.example.com/username/group/repo1'), | |
266 | ]) |
|
266 | ]) | |
267 | def test_clone_url_generator(self, tmpl, repo_name, overrides, prefix, expected): |
|
267 | def test_clone_url_generator(self, tmpl, repo_name, overrides, prefix, expected): | |
268 | from kallithea.lib.utils2 import get_clone_url |
|
268 | from kallithea.lib.utils2 import get_clone_url | |
@@ -337,12 +337,12 b' class TestLibs(BaseTestCase):' | |||||
337 | "from rev a also rev url[http://google.com]", |
|
337 | "from rev a also rev url[http://google.com]", | |
338 | "http://google.com"), |
|
338 | "http://google.com"), | |
339 | ("""Multi line |
|
339 | ("""Multi line | |
340 | https://foo.bar.com |
|
340 | https://foo.bar.example.com | |
341 | some text lalala""", |
|
341 | some text lalala""", | |
342 | """Multi line |
|
342 | """Multi line | |
343 | url[https://foo.bar.com] |
|
343 | url[https://foo.bar.example.com] | |
344 | some text lalala""", |
|
344 | some text lalala""", | |
345 | "https://foo.bar.com") |
|
345 | "https://foo.bar.example.com") | |
346 | ]) |
|
346 | ]) | |
347 | def test_urlify_test(self, sample, expected, url_): |
|
347 | def test_urlify_test(self, sample, expected, url_): | |
348 | from kallithea.lib.helpers import urlify_text |
|
348 | from kallithea.lib.helpers import urlify_text |
@@ -107,7 +107,7 b' def create_test_user(force=True):' | |||||
107 | new_usr = User() |
|
107 | new_usr = User() | |
108 | new_usr.username = USER |
|
108 | new_usr.username = USER | |
109 | new_usr.password = get_crypt_password(PASS) |
|
109 | new_usr.password = get_crypt_password(PASS) | |
110 |
new_usr.email = 'mail@ |
|
110 | new_usr.email = 'mail@example.com' | |
111 | new_usr.name = 'test' |
|
111 | new_usr.name = 'test' | |
112 | new_usr.lastname = 'lasttestname' |
|
112 | new_usr.lastname = 'lasttestname' | |
113 | new_usr.active = True |
|
113 | new_usr.active = True |
@@ -56,7 +56,7 b' pdebug = false' | |||||
56 | ## SMTP server settings |
|
56 | ## SMTP server settings | |
57 | ## Only smtp_server is mandatory. All other settings take the specified default |
|
57 | ## Only smtp_server is mandatory. All other settings take the specified default | |
58 | ## values. |
|
58 | ## values. | |
59 |
#smtp_server = |
|
59 | #smtp_server = smtp.example.com | |
60 | #smtp_username = |
|
60 | #smtp_username = | |
61 | #smtp_password = |
|
61 | #smtp_password = | |
62 | #smtp_port = 25 |
|
62 | #smtp_port = 25 | |
@@ -228,8 +228,8 b' show_revision_number = true' | |||||
228 |
|
228 | |||
229 | ## gist URL alias, used to create nicer urls for gist. This should be an |
|
229 | ## gist URL alias, used to create nicer urls for gist. This should be an | |
230 | ## url that does rewrites to _admin/gists/<gistid>. |
|
230 | ## url that does rewrites to _admin/gists/<gistid>. | |
231 |
## example: http://gist. |
|
231 | ## example: http://gist.example.com/{gistid}. Empty means use the internal | |
232 |
## Kallithea url, ie. http[s]:// |
|
232 | ## Kallithea url, ie. http[s]://kallithea.example.com/_admin/gists/<gistid> | |
233 | gist_alias_url = |
|
233 | gist_alias_url = | |
234 |
|
234 | |||
235 | ## white list of API enabled controllers. This allows to add list of |
|
235 | ## white list of API enabled controllers. This allows to add list of | |
@@ -264,7 +264,7 b' issue_pat = (?:\\s*#)(\\d+)' | |||||
264 | ## fetched from the regex and {repo} is replaced with full repository name |
|
264 | ## fetched from the regex and {repo} is replaced with full repository name | |
265 | ## including groups {repo_name} is replaced with just name of repo |
|
265 | ## including groups {repo_name} is replaced with just name of repo | |
266 |
|
266 | |||
267 |
issue_server_link = https:// |
|
267 | issue_server_link = https://issues.example.com/{repo}/issue/{id} | |
268 |
|
268 | |||
269 | ## prefix to add to link to indicate it's an url |
|
269 | ## prefix to add to link to indicate it's an url | |
270 | ## #314 will be replaced by <issue_prefix><id> |
|
270 | ## #314 will be replaced by <issue_prefix><id> | |
@@ -274,10 +274,10 b' issue_prefix = #' | |||||
274 | ## issue_pat, issue_server_link, issue_prefix can have suffixes to specify |
|
274 | ## issue_pat, issue_server_link, issue_prefix can have suffixes to specify | |
275 | ## multiple patterns, to other issues server, wiki or others |
|
275 | ## multiple patterns, to other issues server, wiki or others | |
276 | ## below an example how to create a wiki pattern |
|
276 | ## below an example how to create a wiki pattern | |
277 |
# wiki-some-id -> https:// |
|
277 | # wiki-some-id -> https://wiki.example.com/some-id | |
278 |
|
278 | |||
279 | #issue_pat_wiki = (?:wiki-)(.+) |
|
279 | #issue_pat_wiki = (?:wiki-)(.+) | |
280 |
#issue_server_link_wiki = https:// |
|
280 | #issue_server_link_wiki = https://wiki.example.com/{id} | |
281 | #issue_prefix_wiki = WIKI- |
|
281 | #issue_prefix_wiki = WIKI- | |
282 |
|
282 | |||
283 | ## instance-id prefix |
|
283 | ## instance-id prefix |
@@ -184,26 +184,26 b' class TestParseDatetime(unittest.TestCas' | |||||
184 |
|
184 | |||
185 |
|
185 | |||
186 | class TestAuthorExtractors(unittest.TestCase): |
|
186 | class TestAuthorExtractors(unittest.TestCase): | |
187 |
TEST_AUTHORS = [("Username Last'o'Name <username@ |
|
187 | TEST_AUTHORS = [("Username Last'o'Name <username@example.com>", | |
188 |
("Username Last'o'Name", "username@ |
|
188 | ("Username Last'o'Name", "username@example.com")), | |
189 |
("Username Last'o'Name Spaces < username@ |
|
189 | ("Username Last'o'Name Spaces < username@example.com >", | |
190 |
("Username Last'o'Name Spaces", "username@ |
|
190 | ("Username Last'o'Name Spaces", "username@example.com")), | |
191 |
("Username Last'o'Name <username.lastname@ |
|
191 | ("Username Last'o'Name <username.lastname@example.com>", | |
192 |
("Username Last'o'Name", "username.lastname@ |
|
192 | ("Username Last'o'Name", "username.lastname@example.com")), | |
193 |
('mrf RFC_SPEC <username+lastname@ |
|
193 | ('mrf RFC_SPEC <username+lastname@example.com>', | |
194 |
('mrf RFC_SPEC', 'username+lastname@ |
|
194 | ('mrf RFC_SPEC', 'username+lastname@example.com')), | |
195 |
('username <user@e |
|
195 | ('username <user@example.com>', | |
196 |
('username', 'user@e |
|
196 | ('username', 'user@example.com')), | |
197 |
('username <user@e |
|
197 | ('username <user@example.com', | |
198 |
('username', 'user@e |
|
198 | ('username', 'user@example.com')), | |
199 |
('broken missing@e |
|
199 | ('broken missing@example.com', | |
200 |
('broken', 'missing@e |
|
200 | ('broken', 'missing@example.com')), | |
201 |
('<justemail@ |
|
201 | ('<justemail@example.com>', | |
202 |
('', 'justemail@ |
|
202 | ('', 'justemail@example.com')), | |
203 | ('justname', |
|
203 | ('justname', | |
204 | ('justname', '')), |
|
204 | ('justname', '')), | |
205 |
('Mr Double Name withemail@e |
|
205 | ('Mr Double Name withemail@example.com ', | |
206 |
('Mr Double Name', 'withemail@e |
|
206 | ('Mr Double Name', 'withemail@example.com')), | |
207 | ] |
|
207 | ] | |
208 |
|
208 | |||
209 | def test_author_email(self): |
|
209 | def test_author_email(self): |
General Comments 0
You need to be logged in to leave comments.
Login now