# HG changeset patch # User Søren Løvborg # Date 2015-09-11 11:00:47 # Node ID 12b47803189f4b8e61be1fcd040c360ccdd71d07 # Parent 2b2216e8af368005b7619c12ab587e34461c1924 cleanup: use example.com for tests and examples example.com is explicitly reserved for this purpose. Using that means we won't accidentally hammer a real server or real email address if an example value escapes into the wild, e.g. in an automated test. The domain "kallithea.example.com" has been used throughout to refer to the example Kallithea server. diff --git a/development.ini b/development.ini --- a/development.ini +++ b/development.ini @@ -57,7 +57,7 @@ pdebug = false ## SMTP server settings ## Only smtp_server is mandatory. All other settings take the specified default ## values. -#smtp_server = mail.server.com +#smtp_server = smtp.example.com #smtp_username = #smtp_password = #smtp_port = 25 @@ -228,8 +228,8 @@ show_revision_number = false ## gist URL alias, used to create nicer urls for gist. This should be an ## url that does rewrites to _admin/gists/. -## example: http://gist.kallithea.server/{gistid}. Empty means use the internal -## Kallithea url, ie. http[s]://your.kallithea.server/_admin/gists/ +## example: http://gist.example.com/{gistid}. Empty means use the internal +## Kallithea url, ie. http[s]://kallithea.example.com/_admin/gists/ gist_alias_url = ## white list of API enabled controllers. This allows to add list of @@ -264,7 +264,7 @@ issue_pat = (?:\s*#)(\d+) ## fetched from the regex and {repo} is replaced with full repository name ## including groups {repo_name} is replaced with just name of repo -issue_server_link = https://myissueserver.com/{repo}/issue/{id} +issue_server_link = https://issues.example.com/{repo}/issue/{id} ## prefix to add to link to indicate it's an url ## #314 will be replaced by @@ -274,10 +274,10 @@ issue_prefix = # ## issue_pat, issue_server_link, issue_prefix can have suffixes to specify ## multiple patterns, to other issues server, wiki or others ## below an example how to create a wiki pattern -# wiki-some-id -> https://mywiki.com/some-id +# wiki-some-id -> https://wiki.example.com/some-id #issue_pat_wiki = (?:wiki-)(.+) -#issue_server_link_wiki = https://mywiki.com/{id} +#issue_server_link_wiki = https://wiki.example.com/{id} #issue_prefix_wiki = WIKI- ## instance-id prefix diff --git a/docs/api/api.rst b/docs/api/api.rst --- a/docs/api/api.rst +++ b/docs/api/api.rst @@ -49,7 +49,7 @@ Clients must send JSON encoded JSON-RPC For example, to pull to a local "CPython" mirror using curl:: - curl https://example.com/_admin/api -X POST -H 'content-type:text/plain' \ + curl https://kallithea.example.com/_admin/api -X POST -H 'content-type:text/plain' \ --data-binary '{"id":1,"api_key":"xe7cdb2v278e4evbdf5vs04v832v0efvcbcve4a3","method":"pull","args":{"repo":"CPython"}}' In general, provide diff --git a/docs/setup.rst b/docs/setup.rst --- a/docs/setup.rst +++ b/docs/setup.rst @@ -36,7 +36,7 @@ up for you. The ``setup-db`` values can also be given on the command line. Example:: - paster setup-db my.ini --user=nn --password=secret --email=nn@example.org --repos=/srv/repos + paster setup-db my.ini --user=nn --password=secret --email=nn@example.com --repos=/srv/repos The ``setup-db`` command will create all needed tables and an admin account. When choosing a root path you can either use a new @@ -108,7 +108,7 @@ If your main directory (the same as set example set to ``/srv/repos`` and the repository you are using is named ``kallithea``, then to clone via ssh you should run:: - hg clone ssh://user@server.com//srv/repos/kallithea + hg clone ssh://user@kallithea.example.com/srv/repos/kallithea Using other external tools such as mercurial-server_ or using ssh key-based authentication is fully supported. @@ -176,7 +176,7 @@ Here's a typical LDAP setup:: Connection settings Enable LDAP = checked - Host = host.example.org + Host = host.example.com Port = 389 Account = Password = @@ -443,7 +443,7 @@ and have that replaced with a URL to the uncomment the following variables in the ini file:: issue_pat = (?:^#|\s#)(\w+) - issue_server_link = https://myissueserver.com/{repo}/issue/{id} + issue_server_link = https://issues.example.com/{repo}/issue/{id} issue_prefix = # ``issue_pat`` is the regular expression describing which strings in @@ -461,13 +461,13 @@ generate a URL in the format: .. code-block:: html - ISSUE-300 + ISSUE-300 If needed, more than one pattern can be specified by appending a unique suffix to the variables. For example:: issue_pat_wiki = (?:wiki-)(.+) - issue_server_link_wiki = https://mywiki.com/{id} + issue_server_link_wiki = https://wiki.example.com/{id} issue_prefix_wiki = WIKI- With these settings, wiki pages can be referenced as wiki-some-id, and every @@ -475,7 +475,7 @@ such reference will be transformed into: .. code-block:: html - WIKI-some-id + WIKI-some-id Hook management @@ -569,7 +569,7 @@ Sample config for Nginx using proxy: ## gist alias server { listen 443; - server_name gist.myserver.com; + server_name gist.example.com; access_log /var/log/nginx/gist.access.log; error_log /var/log/nginx/gist.error.log; @@ -583,13 +583,13 @@ Sample config for Nginx using proxy: 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; ssl_prefer_server_ciphers on; - rewrite ^/(.+)$ https://your.kallithea.server/_admin/gists/$1; - rewrite (.*) https://your.kallithea.server/_admin/gists; + rewrite ^/(.+)$ https://kallithea.example.com/_admin/gists/$1; + rewrite (.*) https://kallithea.example.com/_admin/gists; } server { listen 443; - server_name your.kallithea.server; + server_name kallithea.example.com access_log /var/log/nginx/kallithea.access.log; error_log /var/log/nginx/kallithea.error.log; @@ -648,7 +648,7 @@ Here is a sample configuration file for .. code-block:: apache - ServerName hg.myserver.com + ServerName kallithea.example.com # For Apache 2.4 and later: diff --git a/docs/usage/general.rst b/docs/usage/general.rst --- a/docs/usage/general.rst +++ b/docs/usage/general.rst @@ -78,11 +78,11 @@ Permanent repository URLs Due to the complicated nature of repository grouping, URLs of repositories can often change. For example, a repository originally accessible from:: - http://example.com/repo_name + http://kallithea.example.com/repo_name would get a new URL after moving it to test_group:: - http://example.com/test_group/repo_name + http://kallithea.example.com/test_group/repo_name Such moving of a repository to a group can be an issue for build systems and other scripts where the repository paths are hardcoded. To mitigate this, @@ -94,7 +94,7 @@ such URLs. In the example, the repository could also be accessible as:: - http://example.com/_ + http://kallithea.example.com/_ The ID of a given repository can be shown from the repository ``Summary`` page, by selecting the ``Show by ID`` button next to ``Clone URL``. @@ -137,7 +137,7 @@ Currently it supports the following opti If you need to clone repositories that are protected via basic authentication, you can pass the credentials in the URL, e.g. -``http://user:passw@remote.server/repo``. Kallithea will then try to login and +``http://user:passw@remote.example.com/repo``. Kallithea will then try to login and clone using the given credentials. Please note that the given credentials will be stored as plaintext inside the database. However, the authentication information will not be shown in the clone URL on the summary page. diff --git a/kallithea/bin/kallithea_api.py b/kallithea/bin/kallithea_api.py --- a/kallithea/bin/kallithea_api.py +++ b/kallithea/bin/kallithea_api.py @@ -36,7 +36,7 @@ def argparser(argv): "kallithea-api [-h] [--format=FORMAT] [--apikey=APIKEY] [--apihost=APIHOST] " "[--config=CONFIG] [--save-config] " "METHOD ...\n" - "Create config file: kallithea-api --apikey= --apihost=http://your.kallithea.server --save-config" + "Create config file: kallithea-api --apikey= --apihost=http://kallithea.example.com --save-config" ) parser = argparse.ArgumentParser(description='Kallithea API cli', diff --git a/kallithea/bin/kallithea_gist.py b/kallithea/bin/kallithea_gist.py --- a/kallithea/bin/kallithea_gist.py +++ b/kallithea/bin/kallithea_gist.py @@ -39,7 +39,7 @@ def argparser(argv): "kallithea-gist [-h] [--format=FORMAT] [--apikey=APIKEY] [--apihost=APIHOST] " "[--config=CONFIG] [--save-config] [GIST OPTIONS] " "[filename or stdin use - for terminal stdin ]\n" - "Create config file: kallithea-gist --apikey= --apihost=http://your.kallithea.server --save-config" + "Create config file: kallithea-gist --apikey= --apihost=http://kallithea.example.com --save-config" ) parser = argparse.ArgumentParser(description='Kallithea Gist cli', diff --git a/kallithea/bin/ldap_sync.conf b/kallithea/bin/ldap_sync.conf --- a/kallithea/bin/ldap_sync.conf +++ b/kallithea/bin/ldap_sync.conf @@ -1,11 +1,11 @@ [default] -api_url = http://your.kallithea.server:5000/_admin/api +api_url = http://kallithea.example.com/_admin/api api_user = admin api_key = XXXXXXXXXXXX -ldap_uri = ldap://your.ldap.server:389 -ldap_user = cn=kallithea,ou=binders,dc=linaro,dc=org +ldap_uri = ldap://ldap.example.com:389 +ldap_user = cn=kallithea,dc=example,dc=com ldap_key = XXXXXXXXX -base_dn = dc=linaro,dc=org +base_dn = dc=example,dc=com sync_users = True \ No newline at end of file diff --git a/kallithea/bin/template.ini.mako b/kallithea/bin/template.ini.mako --- a/kallithea/bin/template.ini.mako +++ b/kallithea/bin/template.ini.mako @@ -51,7 +51,7 @@ pdebug = false <%text>## SMTP server settings <%text>## Only smtp_server is mandatory. All other settings take the specified default <%text>## values. -#smtp_server = mail.server.com +#smtp_server = smtp.example.com #smtp_username = #smtp_password = #smtp_port = 25 @@ -226,8 +226,8 @@ show_revision_number = false <%text>## gist URL alias, used to create nicer urls for gist. This should be an <%text>## url that does rewrites to _admin/gists/. -<%text>## example: http://gist.kallithea.server/{gistid}. Empty means use the internal -<%text>## Kallithea url, ie. http[s]://your.kallithea.server/_admin/gists/ +<%text>## example: http://gist.example.com/{gistid}. Empty means use the internal +<%text>## Kallithea url, ie. http[s]://kallithea.example.com/_admin/gists/ gist_alias_url = <%text>## white list of API enabled controllers. This allows to add list of @@ -262,7 +262,7 @@ issue_pat = (?:\s*#)(\d+) <%text>## fetched from the regex and {repo} is replaced with full repository name <%text>## including groups {repo_name} is replaced with just name of repo -issue_server_link = https://myissueserver.com/{repo}/issue/{id} +issue_server_link = https://issues.example.com/{repo}/issue/{id} <%text>## prefix to add to link to indicate it's an url <%text>## #314 will be replaced by @@ -272,10 +272,10 @@ issue_prefix = # <%text>## issue_pat, issue_server_link, issue_prefix can have suffixes to specify <%text>## multiple patterns, to other issues server, wiki or others <%text>## below an example how to create a wiki pattern -# wiki-some-id -> https://mywiki.com/some-id +# wiki-some-id -> https://wiki.example.com/some-id #issue_pat_wiki = (?:wiki-)(.+) -#issue_server_link_wiki = https://mywiki.com/{id} +#issue_server_link_wiki = https://wiki.example.com/{id} #issue_prefix_wiki = WIKI- <%text>## instance-id prefix diff --git a/kallithea/config/deployment.ini_tmpl b/kallithea/config/deployment.ini_tmpl --- a/kallithea/config/deployment.ini_tmpl +++ b/kallithea/config/deployment.ini_tmpl @@ -52,7 +52,7 @@ pdebug = false ## SMTP server settings ## Only smtp_server is mandatory. All other settings take the specified default ## values. -#smtp_server = mail.server.com +#smtp_server = smtp.example.com #smtp_username = #smtp_password = #smtp_port = 25 @@ -222,8 +222,8 @@ show_revision_number = false ## gist URL alias, used to create nicer urls for gist. This should be an ## url that does rewrites to _admin/gists/. -## example: http://gist.kallithea.server/{gistid}. Empty means use the internal -## Kallithea url, ie. http[s]://your.kallithea.server/_admin/gists/ +## example: http://gist.example.com/{gistid}. Empty means use the internal +## Kallithea url, ie. http[s]://kallithea.example.com/_admin/gists/ gist_alias_url = ## white list of API enabled controllers. This allows to add list of @@ -258,7 +258,7 @@ issue_pat = (?:\s*#)(\d+) ## fetched from the regex and {repo} is replaced with full repository name ## including groups {repo_name} is replaced with just name of repo -issue_server_link = https://myissueserver.com/{repo}/issue/{id} +issue_server_link = https://issues.example.com/{repo}/issue/{id} ## prefix to add to link to indicate it's an url ## #314 will be replaced by @@ -268,10 +268,10 @@ issue_prefix = # ## issue_pat, issue_server_link, issue_prefix can have suffixes to specify ## multiple patterns, to other issues server, wiki or others ## below an example how to create a wiki pattern -# wiki-some-id -> https://mywiki.com/some-id +# wiki-some-id -> https://wiki.example.com/some-id #issue_pat_wiki = (?:wiki-)(.+) -#issue_server_link_wiki = https://mywiki.com/{id} +#issue_server_link_wiki = https://wiki.example.com/{id} #issue_prefix_wiki = WIKI- ## instance-id prefix diff --git a/kallithea/lib/rcmail/response.py b/kallithea/lib/rcmail/response.py --- a/kallithea/lib/rcmail/response.py +++ b/kallithea/lib/rcmail/response.py @@ -138,7 +138,7 @@ class MailResponse(object): as __init__ parameters, or by setting those attributes. You can initially set the From, To, and Subject, but they are headers so - use the dict notation to change them: msg['From'] = 'joe@test.com'. + use the dict notation to change them: msg['From'] = 'joe@example.com'. The message is not fully crafted until right when you convert it with MailResponse.to_message. This lets you change it and work with it, then diff --git a/kallithea/tests/__init__.py b/kallithea/tests/__init__.py --- a/kallithea/tests/__init__.py +++ b/kallithea/tests/__init__.py @@ -90,15 +90,15 @@ environ = {} TESTS_TMP_PATH = jn('/', 'tmp', 'rc_test_%s' % _RandomNameSequence().next()) TEST_USER_ADMIN_LOGIN = 'test_admin' TEST_USER_ADMIN_PASS = 'test12' -TEST_USER_ADMIN_EMAIL = 'test_admin@mail.com' +TEST_USER_ADMIN_EMAIL = 'test_admin@example.com' TEST_USER_REGULAR_LOGIN = 'test_regular' TEST_USER_REGULAR_PASS = 'test12' -TEST_USER_REGULAR_EMAIL = 'test_regular@mail.com' +TEST_USER_REGULAR_EMAIL = 'test_regular@example.com' TEST_USER_REGULAR2_LOGIN = 'test_regular2' TEST_USER_REGULAR2_PASS = 'test12' -TEST_USER_REGULAR2_EMAIL = 'test_regular2@mail.com' +TEST_USER_REGULAR2_EMAIL = 'test_regular2@example.com' HG_REPO = 'vcs_test_hg' GIT_REPO = 'vcs_test_git' diff --git a/kallithea/tests/api/api_base.py b/kallithea/tests/api/api_base.py --- a/kallithea/tests/api/api_base.py +++ b/kallithea/tests/api/api_base.py @@ -552,7 +552,7 @@ class _BaseTestApi(object): def test_api_create_existing_user(self): id_, params = _build_data(self.apikey, 'create_user', username=TEST_USER_ADMIN_LOGIN, - email='test@foo.com', + email='test@example.com', password='trololo') response = api_call(self, params) @@ -571,7 +571,7 @@ class _BaseTestApi(object): def test_api_create_user(self): username = 'test_new_api_user' - email = username + "@foo.com" + email = username + "@example.com" id_, params = _build_data(self.apikey, 'create_user', username=username, @@ -593,7 +593,7 @@ class _BaseTestApi(object): def test_api_create_user_without_password(self): username = 'test_new_api_user_passwordless' - email = username + "@foo.com" + email = username + "@example.com" id_, params = _build_data(self.apikey, 'create_user', username=username, @@ -613,7 +613,7 @@ class _BaseTestApi(object): def test_api_create_user_with_extern_name(self): username = 'test_new_api_user_passwordless' - email = username + "@foo.com" + email = username + "@example.com" id_, params = _build_data(self.apikey, 'create_user', username=username, @@ -635,7 +635,7 @@ class _BaseTestApi(object): def test_api_create_user_when_exception_happened(self): username = 'test_new_api_user' - email = username + "@foo.com" + email = username + "@example.com" id_, params = _build_data(self.apikey, 'create_user', username=username, @@ -1138,7 +1138,7 @@ class _BaseTestApi(object): ('description', {'description': 'new description'}), ('active', {'active': True}), ('active', {'active': False}), - ('clone_uri', {'clone_uri': 'http://foo.com/repo'}), + ('clone_uri', {'clone_uri': 'http://example.com/repo'}), ('clone_uri', {'clone_uri': None}), ('landing_rev', {'landing_rev': 'branch:master'}), ('enable_statistics', {'enable_statistics': True}), diff --git a/kallithea/tests/functional/test_admin_users.py b/kallithea/tests/functional/test_admin_users.py --- a/kallithea/tests/functional/test_admin_users.py +++ b/kallithea/tests/functional/test_admin_users.py @@ -47,7 +47,7 @@ class TestAdminUsersController(TestContr password_confirmation = password name = 'name' lastname = 'lastname' - email = 'mail@mail.com' + email = 'mail@example.com' response = self.app.post(url('users'), {'username': username, @@ -83,7 +83,7 @@ class TestAdminUsersController(TestContr password = '' name = 'name' lastname = 'lastname' - email = 'errmail.com' + email = 'errmail.example.com' response = self.app.post(url('users'), {'username': username, 'password': password, @@ -119,7 +119,7 @@ class TestAdminUsersController(TestContr ('extern_name', {'extern_name': None}), ('active', {'active': False}), ('active', {'active': True}), - ('email', {'email': 'some@email.com'}), + ('email', {'email': 'someemail@example.com'}), # ('new_password', {'new_password': 'foobar123', # 'password_confirmation': 'foobar123'}) ]) diff --git a/kallithea/tests/functional/test_files.py b/kallithea/tests/functional/test_files.py --- a/kallithea/tests/functional/test_files.py +++ b/kallithea/tests/functional/test_files.py @@ -97,7 +97,7 @@ class TestFilesController(TestController revision='8911406ad776fdd3d0b9932a2e89677e57405a48', f_path='vcs/nodes.py')) - response.mustcontain("""
Partially implemented #16. filecontent/commit message/author/node name are safe_unicode now. + response.mustcontain("""
Partially implemented #16. filecontent/commit message/author/node name are safe_unicode now. In addition some other __str__ are unicode as well Added test for unicode Improved test to clone into uniq repository. diff --git a/kallithea/tests/functional/test_login.py b/kallithea/tests/functional/test_login.py --- a/kallithea/tests/functional/test_login.py +++ b/kallithea/tests/functional/test_login.py @@ -103,8 +103,8 @@ class TestLoginController(TestController ('data:text/html,',), ('mailto:test@example.com',), ('file:///etc/passwd',), - ('ftp://some.ftp.server',), - ('http://other.domain/bl%C3%A5b%C3%A6rgr%C3%B8d',), + ('ftp://ftp.example.com',), + ('http://other.example.com/bl%C3%A5b%C3%A6rgr%C3%B8d',), ]) def test_login_bad_came_froms(self, url_came_from): response = self.app.post(url(controller='login', action='index', @@ -205,7 +205,7 @@ class TestLoginController(TestController {'username': uname, 'password': 'test12', 'password_confirmation': 'test12', - 'email': 'goodmail@domain.com', + 'email': 'goodmail@example.com', 'firstname': 'test', 'lastname': 'test'}) @@ -304,7 +304,7 @@ class TestLoginController(TestController def test_register_ok(self): username = 'test_regular4' password = 'qweqwe' - email = 'username@test.com' + email = 'user4@example.com' name = 'testname' lastname = 'testlastname' @@ -348,7 +348,7 @@ class TestLoginController(TestController username = 'test_password_reset_1' password = 'qweqwe' - email = 'username@python-works.com' + email = 'username@example.com' name = 'passwd' lastname = 'reset' timestamp = int(time.time()) diff --git a/kallithea/tests/functional/test_my_account.py b/kallithea/tests/functional/test_my_account.py --- a/kallithea/tests/functional/test_my_account.py +++ b/kallithea/tests/functional/test_my_account.py @@ -67,16 +67,16 @@ class TestMyAccountController(TestContro response.mustcontain('No additional emails specified') response = self.app.post(url('my_account_emails'), - {'new_email': 'foo@barz.com', '_authentication_token': self.authentication_token()}) + {'new_email': 'barz@example.com', '_authentication_token': self.authentication_token()}) response = self.app.get(url('my_account_emails')) from kallithea.model.db import UserEmailMap email_id = UserEmailMap.query()\ .filter(UserEmailMap.user == User.get_by_username(TEST_USER_ADMIN_LOGIN))\ - .filter(UserEmailMap.email == 'foo@barz.com').one().email_id + .filter(UserEmailMap.email == 'barz@example.com').one().email_id - response.mustcontain('foo@barz.com') + response.mustcontain('barz@example.com') response.mustcontain('' % email_id) response = self.app.post(url('my_account_emails'), @@ -97,7 +97,7 @@ class TestMyAccountController(TestContro #('extern_name', {'extern_name': None}), ('active', {'active': False}), ('active', {'active': True}), - ('email', {'email': 'some@email.com'}), + ('email', {'email': 'someemail@example.com'}), # ('new_password', {'new_password': 'foobar123', # 'password_confirmation': 'foobar123'}) ]) diff --git a/kallithea/tests/other/manual_test_vcs_operations.py b/kallithea/tests/other/manual_test_vcs_operations.py --- a/kallithea/tests/other/manual_test_vcs_operations.py +++ b/kallithea/tests/other/manual_test_vcs_operations.py @@ -112,13 +112,13 @@ def _add_files_and_push(vcs, DEST, **kwa for i in xrange(kwargs.get('files_no', 3)): cmd = """echo 'added_line%s' >> %s""" % (i, added_file) Command(cwd).execute(cmd) - author_str = 'User ǝɯɐᴎ ' + author_str = 'User ǝɯɐᴎ ' if vcs == 'hg': cmd = """hg commit -m 'commited new %s' -u '%s' %s """ % ( i, author_str, added_file ) elif vcs == 'git': - cmd = """EMAIL="me@email.com" git commit -m 'commited new %s' --author '%s' %s """ % ( + cmd = """EMAIL="me@example.com" git commit -m 'commited new %s' --author '%s' %s """ % ( i, author_str, added_file ) Command(cwd).execute(cmd) diff --git a/kallithea/tests/other/test_libs.py b/kallithea/tests/other/test_libs.py --- a/kallithea/tests/other/test_libs.py +++ b/kallithea/tests/other/test_libs.py @@ -42,11 +42,11 @@ TEST_URLS = [ '%s://127.0.0.1' % proto), ('%s://127.0.0.1:8080' % proto, ['%s://' % proto, '127.0.0.1', '8080'], '%s://127.0.0.1:8080' % proto), - ('%s://domain.org' % proto, ['%s://' % proto, 'domain.org'], - '%s://domain.org' % proto), - ('%s://user:pass@domain.org:8080' % proto, ['%s://' % proto, 'domain.org', + ('%s://example.com' % proto, ['%s://' % proto, 'example.com'], + '%s://example.com' % proto), + ('%s://user:pass@example.com:8080' % proto, ['%s://' % proto, 'example.com', '8080'], - '%s://domain.org:8080' % proto), + '%s://example.com:8080' % proto), ] proto = 'https' @@ -59,11 +59,11 @@ TEST_URLS += [ '%s://127.0.0.1' % proto), ('%s://127.0.0.1:8080' % proto, ['%s://' % proto, '127.0.0.1', '8080'], '%s://127.0.0.1:8080' % proto), - ('%s://domain.org' % proto, ['%s://' % proto, 'domain.org'], - '%s://domain.org' % proto), - ('%s://user:pass@domain.org:8080' % proto, ['%s://' % proto, 'domain.org', + ('%s://example.com' % proto, ['%s://' % proto, 'example.com'], + '%s://example.com' % proto), + ('%s://user:pass@example.com:8080' % proto, ['%s://' % proto, 'example.com', '8080'], - '%s://domain.org:8080' % proto), + '%s://example.com:8080' % proto), ] @@ -104,11 +104,11 @@ class TestLibs(BaseTestCase): def test_mention_extractor(self): from kallithea.lib.utils2 import extract_mentioned_users sample = ( - "@first hi there @world here's my email username@email.com " + "@first hi there @world here's my email username@example.com " "@lukaszb check @one_more22 it pls @ ttwelve @D[] @one@two@three " "@UPPER @cAmEL @2one_more22 @john please see this http://org.pl " "@marian.user just do it @marco-polo and next extract @marco_polo " - "user.dot hej ! not-needed maril@domain.org" + "user.dot hej ! not-needed maril@example.com" ) s = sorted([ @@ -184,7 +184,7 @@ class TestLibs(BaseTestCase): def test_tag_exctrator(self): sample = ( "hello pta[tag] gog [[]] [[] sda ero[or]d [me =>>< sa]" - "[requires] [stale] [see<>=>] [see => http://url.com]" + "[requires] [stale] [see<>=>] [see => http://example.com]" "[requires => url] [lang => python] [just a tag]" "[,d] [ => ULR ] [obsolete] [desc]]" ) @@ -205,7 +205,7 @@ class TestLibs(BaseTestCase): class fake_url(object): @classmethod def current(cls, *args, **kwargs): - return 'https://server.com' + return 'https://example.com' #mock pylons.tmpl_context def fake_tmpl_context(_url): @@ -218,35 +218,35 @@ class TestLibs(BaseTestCase): with mock.patch('pylons.url', fake_url): - fake = fake_tmpl_context(_url='http://test.com/{email}') + fake = fake_tmpl_context(_url='http://example.com/{email}') with mock.patch('pylons.tmpl_context', fake): from pylons import url - assert url.current() == 'https://server.com' - grav = gravatar_url(email_address='test@foo.com', size=24) - assert grav == 'http://test.com/test@foo.com' + assert url.current() == 'https://example.com' + grav = gravatar_url(email_address='test@example.com', size=24) + assert grav == 'http://example.com/test@example.com' - fake = fake_tmpl_context(_url='http://test.com/{email}') + fake = fake_tmpl_context(_url='http://example.com/{email}') with mock.patch('pylons.tmpl_context', fake): - grav = gravatar_url(email_address='test@foo.com', size=24) - assert grav == 'http://test.com/test@foo.com' + grav = gravatar_url(email_address='test@example.com', size=24) + assert grav == 'http://example.com/test@example.com' - fake = fake_tmpl_context(_url='http://test.com/{md5email}') + fake = fake_tmpl_context(_url='http://example.com/{md5email}') with mock.patch('pylons.tmpl_context', fake): - em = 'test@foo.com' + em = 'test@example.com' grav = gravatar_url(email_address=em, size=24) - assert grav == 'http://test.com/%s' % (_md5(em)) + assert grav == 'http://example.com/%s' % (_md5(em)) - fake = fake_tmpl_context(_url='http://test.com/{md5email}/{size}') + fake = fake_tmpl_context(_url='http://example.com/{md5email}/{size}') with mock.patch('pylons.tmpl_context', fake): - em = 'test@foo.com' + em = 'test@example.com' grav = gravatar_url(email_address=em, size=24) - assert grav == 'http://test.com/%s/%s' % (_md5(em), 24) + assert grav == 'http://example.com/%s/%s' % (_md5(em), 24) fake = fake_tmpl_context(_url='{scheme}://{netloc}/{md5email}/{size}') with mock.patch('pylons.tmpl_context', fake): - em = 'test@foo.com' + em = 'test@example.com' grav = gravatar_url(email_address=em, size=24) - assert grav == 'https://server.com/%s/%s' % (_md5(em), 24) + assert grav == 'https://example.com/%s/%s' % (_md5(em), 24) @parameterized.expand([ (Repository.DEFAULT_CLONE_URI, 'group/repo1', {}, '', 'http://vps1:8000/group/repo1'), @@ -260,9 +260,9 @@ class TestLibs(BaseTestCase): ('{scheme}://{user}@{netloc}/_{repoid}', 'group/repo1', {'user': 'username'}, '', 'http://username@vps1:8000/_23'), ('http://{user}@{netloc}/_{repoid}', 'group/repo1', {'user': 'username'}, '', 'http://username@vps1:8000/_23'), ('http://{netloc}/_{repoid}', 'group/repo1', {'user': 'username'}, '', 'http://vps1:8000/_23'), - ('https://{user}@proxy1.server.com/{repo}', 'group/repo1', {'user': 'username'}, '', 'https://username@proxy1.server.com/group/repo1'), - ('https://{user}@proxy1.server.com/{repo}', 'group/repo1', {}, '', 'https://proxy1.server.com/group/repo1'), - ('https://proxy1.server.com/{user}/{repo}', 'group/repo1', {'user': 'username'}, '', 'https://proxy1.server.com/username/group/repo1'), + ('https://{user}@proxy1.example.com/{repo}', 'group/repo1', {'user': 'username'}, '', 'https://username@proxy1.example.com/group/repo1'), + ('https://{user}@proxy1.example.com/{repo}', 'group/repo1', {}, '', 'https://proxy1.example.com/group/repo1'), + ('https://proxy1.example.com/{user}/{repo}', 'group/repo1', {'user': 'username'}, '', 'https://proxy1.example.com/username/group/repo1'), ]) def test_clone_url_generator(self, tmpl, repo_name, overrides, prefix, expected): from kallithea.lib.utils2 import get_clone_url @@ -337,12 +337,12 @@ class TestLibs(BaseTestCase): "from rev a also rev url[http://google.com]", "http://google.com"), ("""Multi line - https://foo.bar.com + https://foo.bar.example.com some text lalala""", """Multi line - url[https://foo.bar.com] + url[https://foo.bar.example.com] some text lalala""", - "https://foo.bar.com") + "https://foo.bar.example.com") ]) def test_urlify_test(self, sample, expected, url_): from kallithea.lib.helpers import urlify_text diff --git a/kallithea/tests/scripts/manual_test_concurrency.py b/kallithea/tests/scripts/manual_test_concurrency.py --- a/kallithea/tests/scripts/manual_test_concurrency.py +++ b/kallithea/tests/scripts/manual_test_concurrency.py @@ -107,7 +107,7 @@ def create_test_user(force=True): new_usr = User() new_usr.username = USER new_usr.password = get_crypt_password(PASS) - new_usr.email = 'mail@mail.com' + new_usr.email = 'mail@example.com' new_usr.name = 'test' new_usr.lastname = 'lasttestname' new_usr.active = True diff --git a/kallithea/tests/test.ini b/kallithea/tests/test.ini --- a/kallithea/tests/test.ini +++ b/kallithea/tests/test.ini @@ -56,7 +56,7 @@ pdebug = false ## SMTP server settings ## Only smtp_server is mandatory. All other settings take the specified default ## values. -#smtp_server = mail.server.com +#smtp_server = smtp.example.com #smtp_username = #smtp_password = #smtp_port = 25 @@ -228,8 +228,8 @@ show_revision_number = true ## gist URL alias, used to create nicer urls for gist. This should be an ## url that does rewrites to _admin/gists/. -## example: http://gist.kallithea.server/{gistid}. Empty means use the internal -## Kallithea url, ie. http[s]://your.kallithea.server/_admin/gists/ +## example: http://gist.example.com/{gistid}. Empty means use the internal +## Kallithea url, ie. http[s]://kallithea.example.com/_admin/gists/ gist_alias_url = ## white list of API enabled controllers. This allows to add list of @@ -264,7 +264,7 @@ issue_pat = (?:\s*#)(\d+) ## fetched from the regex and {repo} is replaced with full repository name ## including groups {repo_name} is replaced with just name of repo -issue_server_link = https://myissueserver.com/{repo}/issue/{id} +issue_server_link = https://issues.example.com/{repo}/issue/{id} ## prefix to add to link to indicate it's an url ## #314 will be replaced by @@ -274,10 +274,10 @@ issue_prefix = # ## issue_pat, issue_server_link, issue_prefix can have suffixes to specify ## multiple patterns, to other issues server, wiki or others ## below an example how to create a wiki pattern -# wiki-some-id -> https://mywiki.com/some-id +# wiki-some-id -> https://wiki.example.com/some-id #issue_pat_wiki = (?:wiki-)(.+) -#issue_server_link_wiki = https://mywiki.com/{id} +#issue_server_link_wiki = https://wiki.example.com/{id} #issue_prefix_wiki = WIKI- ## instance-id prefix diff --git a/kallithea/tests/vcs/test_utils.py b/kallithea/tests/vcs/test_utils.py --- a/kallithea/tests/vcs/test_utils.py +++ b/kallithea/tests/vcs/test_utils.py @@ -184,26 +184,26 @@ class TestParseDatetime(unittest.TestCas class TestAuthorExtractors(unittest.TestCase): - TEST_AUTHORS = [("Username Last'o'Name ", - ("Username Last'o'Name", "username@python-works.com")), - ("Username Last'o'Name Spaces < username@python-works.com >", - ("Username Last'o'Name Spaces", "username@python-works.com")), - ("Username Last'o'Name ", - ("Username Last'o'Name", "username.lastname@python-works.com")), - ('mrf RFC_SPEC ', - ('mrf RFC_SPEC', 'username+lastname@python-works.com')), - ('username ', - ('username', 'user@email.com')), - ('username ', - ('', 'justemail@mail.com')), + TEST_AUTHORS = [("Username Last'o'Name ", + ("Username Last'o'Name", "username@example.com")), + ("Username Last'o'Name Spaces < username@example.com >", + ("Username Last'o'Name Spaces", "username@example.com")), + ("Username Last'o'Name ", + ("Username Last'o'Name", "username.lastname@example.com")), + ('mrf RFC_SPEC ', + ('mrf RFC_SPEC', 'username+lastname@example.com')), + ('username ', + ('username', 'user@example.com')), + ('username ', + ('', 'justemail@example.com')), ('justname', ('justname', '')), - ('Mr Double Name withemail@email.com ', - ('Mr Double Name', 'withemail@email.com')), + ('Mr Double Name withemail@example.com ', + ('Mr Double Name', 'withemail@example.com')), ] def test_author_email(self):