Changeset - fbbe80e3322b
[Not reviewed]
default
0 18 0
Mads Kiilerich - 10 years ago 2015-08-26 17:28:58
madski@unity3d.com
docs: consistent spacing around headings

Start out with 2 empty lines before/after for top level, decrease for deeper
levels.
18 files changed with 38 insertions and 51 deletions:
0 comments (0 inline, 0 general)
README.rst
Show inline comments
 
================
 
Kallithea README
 
================
 

	
 

	
 
About
 
-----
 

	
 
**Kallithea** is a fast and powerful management tool for Mercurial_ and Git_
 
with a built-in push/pull server, full text search and code-review. It works on
 
http/https and has a built in permission/authentication system with the ability
 
to authenticate via LDAP or ActiveDirectory. Kallithea also provides simple API
 
so it's easy to integrate with existing external systems.
 

	
 
Kallithea is similar in some respects to GitHub_ or Bitbucket_, however
 
Kallithea can be run as standalone hosted application on your own server. It is
 
open-source donationware and focuses more on providing a customised,
 
self-administered interface for Mercurial_ and Git_ repositories. Kallithea
 
works on Unix-like systems and Windows, and is powered by the vcs_ library
 
created by Łukasz Balcerzak and Marcin Kuźmiński to uniformly handle multiple
 
version control systems.
 

	
 
Kallithea was forked from RhodeCode in July 2014 and has been heavily modified.
 

	
 

	
 
Installation
 
------------
 

	
 
Kallithea requires Python_ 2.x and it is recommended to install it in a
 
virtualenv_. Official releases of Kallithea can be installed with::
 

	
 
    pip install kallithea
 

	
 
The development repository is kept very stable and used in production by the
 
developers -- you can do the same.
 

	
 
Please visit https://docs.kallithea-scm.org/en/latest/installation.html for
 
more details.
 

	
 

	
docs/api/api.rst
Show inline comments
 
.. _api:
 

	
 
===
 
API
 
===
 

	
 

	
 
Kallithea has a simple JSON RPC API with a single schema for calling all API
 
methods. Everything is available by sending JSON encoded http(s) requests to
 
``<your_server>/_admin/api``.
 

	
 

	
 
API access for web views
 
++++++++++++++++++++++++
 

	
 
API access can also be turned on for each web view in Kallithea that is
 
decorated with the ``@LoginRequired`` decorator. Some views use
 
``@LoginRequired(api_access=True)`` and are always available. By default only
 
RSS/Atom feed views are enabled. Other views are
 
@@ -128,72 +127,69 @@ INPUT::
 
    api_key : "<api_key>"
 
    method :  "pull"
 
    args :    {
 
                "repoid" : "<reponame or repo_id>"
 
              }
 

	
 
OUTPUT::
 

	
 
    id : <id_given_in_input>
 
    result : "Pulled from `<reponame>`"
 
    error :  null
 

	
 

	
 
rescan_repos
 
------------
 

	
 
Rescan repositories. If ``remove_obsolete`` is set,
 
Kallithea will delete repos that are in the database but not in the filesystem.
 
This command can only be executed using the api_key of a user with admin rights.
 

	
 
INPUT::
 

	
 
    id : <id_for_response>
 
    api_key : "<api_key>"
 
    method :  "rescan_repos"
 
    args :    {
 
                "remove_obsolete" : "<boolean = Optional(False)>"
 
              }
 

	
 
OUTPUT::
 

	
 
    id : <id_given_in_input>
 
    result : "{'added': [<list of names of added repos>],
 
               'removed': [<list of names of removed repos>]}"
 
    error :  null
 

	
 

	
 
invalidate_cache
 
----------------
 

	
 
Invalidate the cache for a repository.
 
This command can only be executed using the api_key of a user with admin rights,
 
or that of a regular user with admin or write access to the repository.
 

	
 
INPUT::
 

	
 
    id : <id_for_response>
 
    api_key : "<api_key>"
 
    method :  "invalidate_cache"
 
    args :    {
 
                "repoid" : "<reponame or repo_id>"
 
              }
 

	
 
OUTPUT::
 

	
 
    id : <id_given_in_input>
 
    result : "Caches of repository `<reponame>`"
 
    error :  null
 

	
 

	
 
lock
 
----
 

	
 
Set the locking state on the given repository by the given user.
 
If the param ``userid`` is skipped, it is set to the ID of the user who is calling this method.
 
If param ``locked`` is skipped, the current lock state of the repository is returned.
 
This command can only be executed using the api_key of a user with admin rights, or that of a regular user with admin or write access to the repository.
 

	
 
INPUT::
 

	
 
    id : <id_for_response>
 
    api_key : "<api_key>"
 
@@ -207,25 +203,24 @@ INPUT::
 
OUTPUT::
 

	
 
    id : <id_given_in_input>
 
    result : {
 
                 "repo": "<reponame>",
 
                 "locked": "<bool true|false>",
 
                 "locked_since": "<float lock_time>",
 
                 "locked_by": "<username>",
 
                 "msg": "User `<username>` set lock state for repo `<reponame>` to `<false|true>`"
 
             }
 
    error :  null
 

	
 

	
 
get_ip
 
------
 

	
 
Return IP address as seen from Kallithea server, together with all
 
defined IP addresses for given user.
 
This command can only be executed using the api_key of a user with admin rights.
 

	
 
INPUT::
 

	
 
    id : <id_for_response>
 
    api_key : "<api_key>"
 
    method :  "get_ip"
 
@@ -240,25 +235,24 @@ OUTPUT::
 
                 "ip_addr_server": <ip_from_clien>",
 
                 "user_ips": [
 
                                {
 
                                   "ip_addr": "<ip_with_mask>",
 
                                   "ip_range": ["<start_ip>", "<end_ip>"],
 
                                },
 
                                ...
 
                             ]
 
             }
 

	
 
    error :  null
 

	
 

	
 
get_user
 
--------
 

	
 
Get a user by username or userid. The result is empty if user can't be found.
 
If userid param is skipped, it is set to id of user who is calling this method.
 
Any userid can be specified when the command is executed using the api_key of a user with admin rights.
 
Regular users can only speicy their own userid.
 

	
 

	
 
INPUT::
 

	
 
    id : <id_for_response>
 
@@ -286,25 +280,24 @@ OUTPUT::
 
                "ldap_dn" :     "<ldap_dn>",
 
                "last_login":   "<last_login>",
 
                "permissions": {
 
                    "global": ["hg.create.repository",
 
                               "repository.read",
 
                               "hg.register.manual_activate"],
 
                    "repositories": {"repo1": "repository.none"},
 
                    "repositories_groups": {"Group1": "group.read"}
 
                 },
 
            }
 
    error:  null
 

	
 

	
 
get_users
 
---------
 

	
 
List all existing users.
 
This command can only be executed using the api_key of a user with admin rights.
 

	
 

	
 
INPUT::
 

	
 
    id : <id_for_response>
 
    api_key : "<api_key>"
 
    method :  "get_users"
 
@@ -373,25 +366,24 @@ OUTPUT::
 
                "active" :   "<bool>",
 
                "admin" :    "<bool>",
 
                "ldap_dn" :  "<ldap_dn>",
 
                "last_login": "<last_login>",
 
              },
 
            }
 
    error:  null
 

	
 
Example::
 

	
 
    kallithea-api create_user username:bent email:bent@example.com firstname:Bent lastname:Bentsen extern_type:ldap extern_name:uid=bent,dc=example,dc=com
 

	
 

	
 
update_user
 
-----------
 

	
 
Update the given user if such user exists.
 
This command can only be executed using the api_key of a user with admin rights.
 

	
 

	
 
INPUT::
 

	
 
    id : <id_for_response>
 
    api_key : "<api_key>"
 
    method :  "update_user"
 
@@ -419,25 +411,24 @@ OUTPUT::
 
                "firstname": "<firstname>",
 
                "lastname" : "<lastname>",
 
                "email" :    "<email>",
 
                "emails":    "<list_of_all_additional_emails>",
 
                "active" :   "<bool>",
 
                "admin" :    "<bool>",
 
                "ldap_dn" :  "<ldap_dn>",
 
                "last_login": "<last_login>",
 
              },
 
            }
 
    error:  null
 

	
 

	
 
delete_user
 
-----------
 

	
 
Delete the given user if such a user exists.
 
This command can only be executed using the api_key of a user with admin rights.
 

	
 

	
 
INPUT::
 

	
 
    id : <id_for_response>
 
    api_key : "<api_key>"
 
    method :  "delete_user"
 
@@ -445,25 +436,24 @@ INPUT::
 
                "userid" : "<user_id or username>",
 
              }
 

	
 
OUTPUT::
 

	
 
    id : <id_given_in_input>
 
    result: {
 
              "msg" : "deleted user ID:<userid> <username>",
 
              "user": null
 
            }
 
    error:  null
 

	
 

	
 
get_user_group
 
--------------
 

	
 
Get an existing user group.
 
This command can only be executed using the api_key of a user with admin rights.
 

	
 

	
 
INPUT::
 

	
 
    id : <id_for_response>
 
    api_key : "<api_key>"
 
    method :  "get_user_group"
 
@@ -489,25 +479,24 @@ OUTPUT::
 
                                "email" :    "<email>",
 
                                "emails":    "<list_of_all_additional_emails>",
 
                                "active" :   "<bool>",
 
                                "admin" :    "<bool>",
 
                                "ldap_dn" :  "<ldap_dn>",
 
                                "last_login": "<last_login>",
 
                              },
 
 
                            ]
 
             }
 
    error : null
 

	
 

	
 
get_user_groups
 
---------------
 

	
 
List all existing user groups.
 
This command can only be executed using the api_key of a user with admin rights.
 

	
 

	
 
INPUT::
 

	
 
    id : <id_for_response>
 
    api_key : "<api_key>"
 
    method :  "get_user_groups"
 
@@ -517,25 +506,24 @@ OUTPUT::
 

	
 
    id : <id_given_in_input>
 
    result : [
 
               {
 
               "users_group_id" : "<id>",
 
               "group_name" :     "<groupname>",
 
               "active":          "<bool>",
 
               },
 
 
              ]
 
    error : null
 

	
 

	
 
create_user_group
 
-----------------
 

	
 
Create a new user group.
 
This command can only be executed using the api_key of a user with admin rights.
 

	
 

	
 
INPUT::
 

	
 
    id : <id_for_response>
 
    api_key : "<api_key>"
 
    method :  "create_user_group"
 
@@ -549,25 +537,24 @@ OUTPUT::
 

	
 
    id : <id_given_in_input>
 
    result: {
 
              "msg": "created new user group `<groupname>`",
 
              "users_group": {
 
                     "users_group_id" : "<id>",
 
                     "group_name" :     "<groupname>",
 
                     "active":          "<bool>",
 
               },
 
            }
 
    error:  null
 

	
 

	
 
add_user_to_user_group
 
----------------------
 

	
 
Adds a user to a user group. If the user already is in that group, success will be
 
``false``.
 
This command can only be executed using the api_key of a user with admin rights.
 

	
 

	
 
INPUT::
 

	
 
    id : <id_for_response>
 
    api_key : "<api_key>"
 
@@ -578,25 +565,24 @@ INPUT::
 
              }
 

	
 
OUTPUT::
 

	
 
    id : <id_given_in_input>
 
    result: {
 
              "success": True|False # depends on if member is in group
 
              "msg": "added member `<username>` to a user group `<groupname>` |
 
                      User is already in that group"
 
            }
 
    error:  null
 

	
 

	
 
remove_user_from_user_group
 
---------------------------
 

	
 
Remove a user from a user group. If the user isn't in the given group, success will
 
be ``false``.
 
This command can only be executed using the api_key of a user with admin rights.
 

	
 

	
 
INPUT::
 

	
 
    id : <id_for_response>
 
    api_key : "<api_key>"
 
@@ -607,25 +593,24 @@ INPUT::
 
              }
 

	
 
OUTPUT::
 

	
 
    id : <id_given_in_input>
 
    result: {
 
              "success":  True|False,  # depends on if member is in group
 
              "msg": "removed member <username> from user group <groupname> |
 
                      User wasn't in group"
 
            }
 
    error:  null
 

	
 

	
 
get_repo
 
--------
 

	
 
Get an existing repository by its name or repository_id. Members will contain
 
either users_group or users associated to that repository.
 
This command can only be executed using the api_key of a user with admin rights,
 
or that of a regular user with at least read access to the repository.
 

	
 
INPUT::
 

	
 
    id : <id_for_response>
 
    api_key : "<api_key>"
 
@@ -697,25 +682,24 @@ OUTPUT::
 
                                    "emails":       "<list_of_all_additional_emails>",
 
                                    "ip_addresses": "<list_of_ip_addresses_for_user>",
 
                                    "active" :      "<bool>",
 
                                    "admin" :       "<bool>",
 
                                    "ldap_dn" :     "<ldap_dn>",
 
                                    "last_login":   "<last_login>",
 
                                  },
 
 
                 ]
 
            }
 
    error:  null
 

	
 

	
 
get_repos
 
---------
 

	
 
List all existing repositories.
 
This command can only be executed using the api_key of a user with admin rights,
 
or that of a regular user with at least read access to the repository.
 

	
 

	
 
INPUT::
 

	
 
    id : <id_for_response>
 
    api_key : "<api_key>"
 
@@ -736,25 +720,24 @@ OUTPUT::
 
                "description" :      "<description>",
 
                "landing_rev":       "<landing_rev>",
 
                "owner":             "<repo_owner>",
 
                "fork_of":           "<name_of_fork_parent>",
 
                "enable_downloads":  "<bool>",
 
                "enable_locking":    "<bool>",
 
                "enable_statistics": "<bool>",
 
              },
 
 
            ]
 
    error:  null
 

	
 

	
 
get_repo_nodes
 
--------------
 

	
 
Return a list of files and directories for a given path at the given revision.
 
It is possible to specify ret_type to show only ``files`` or ``dirs``.
 
This command can only be executed using the api_key of a user with admin rights.
 

	
 

	
 
INPUT::
 

	
 
    id : <id_for_response>
 
    api_key : "<api_key>"
 
@@ -769,25 +752,24 @@ INPUT::
 
OUTPUT::
 

	
 
    id : <id_given_in_input>
 
    result: [
 
              {
 
                "name" :        "<name>"
 
                "type" :        "<type>",
 
              },
 
 
            ]
 
    error:  null
 

	
 

	
 
create_repo
 
-----------
 

	
 
Create a repository. If the repository name contains "/", all needed repository
 
groups will be created. For example "foo/bar/baz" will create repository groups
 
"foo", "bar" (with "foo" as parent), and create "baz" repository with
 
"bar" as group.
 
This command can only be executed using the api_key of a user with admin rights,
 
or that of a regular user with create repository permission.
 
Regular users cannot specify owner parameter.
 

	
 

	
 
@@ -823,25 +805,24 @@ OUTPUT::
 
                "created_on" :       "<datetimecreated>",
 
                "description" :      "<description>",
 
                "landing_rev":       "<landing_rev>",
 
                "owner":             "<username or user_id>",
 
                "fork_of":           "<name_of_fork_parent>",
 
                "enable_downloads":  "<bool>",
 
                "enable_locking":    "<bool>",
 
                "enable_statistics": "<bool>",
 
              },
 
            }
 
    error:  null
 

	
 

	
 
update_repo
 
-----------
 

	
 
Update a repository.
 
This command can only be executed using the api_key of a user with admin rights,
 
or that of a regular user with create repository permission.
 
Regular users cannot specify owner parameter.
 

	
 

	
 
INPUT::
 

	
 
    id : <id_for_response>
 
@@ -885,25 +866,24 @@ OUTPUT::
 
                                       "date":     "<date_time_of_commit>",
 
                                       "message":  "<commit_message>",
 
                                       "raw_id":   "<raw_id>",
 
                                       "revision": "<numeric_revision>",
 
                                       "short_id": "<short_id>"
 
                                     }
 
                "locked_by": "<username>",
 
                "locked_date": "<float lock_time>",
 
              },
 
            }
 
    error:  null
 

	
 

	
 
fork_repo
 
---------
 

	
 
Create a fork of the given repo. If using Celery, this will
 
return success message immediately and a fork will be created
 
asynchronously.
 
This command can only be executed using the api_key of a user with admin
 
rights, or with the global fork permission, by a regular user with create
 
repository permission and at least read access to the repository.
 
Regular users cannot specify owner parameter.
 

	
 

	
 
@@ -923,25 +903,24 @@ INPUT::
 

	
 
              }
 

	
 
OUTPUT::
 

	
 
    id : <id_given_in_input>
 
    result: {
 
              "msg": "Created fork of `<reponame>` as `<forkname>`",
 
              "success": true
 
            }
 
    error:  null
 

	
 

	
 
delete_repo
 
-----------
 

	
 
Delete a repository.
 
This command can only be executed using the api_key of a user with admin rights,
 
or that of a regular user with admin access to the repository.
 
When ``forks`` param is set it is possible to detach or delete forks of the deleted repository.
 

	
 

	
 
INPUT::
 

	
 
    id : <id_for_response>
 
@@ -952,25 +931,24 @@ INPUT::
 
                "forks"  : "`delete` or `detach` = Optional(None)"
 
              }
 

	
 
OUTPUT::
 

	
 
    id : <id_given_in_input>
 
    result: {
 
              "msg": "Deleted repository `<reponame>`",
 
              "success": true
 
            }
 
    error:  null
 

	
 

	
 
grant_user_permission
 
---------------------
 

	
 
Grant permission for a user on the given repository, or update the existing one if found.
 
This command can only be executed using the api_key of a user with admin rights.
 

	
 

	
 
INPUT::
 

	
 
    id : <id_for_response>
 
    api_key : "<api_key>"
 
    method :  "grant_user_permission"
 
@@ -980,25 +958,24 @@ INPUT::
 
                "perm" :       "(repository.(none|read|write|admin))",
 
              }
 

	
 
OUTPUT::
 

	
 
    id : <id_given_in_input>
 
    result: {
 
              "msg" : "Granted perm: `<perm>` for user: `<username>` in repo: `<reponame>`",
 
              "success": true
 
            }
 
    error:  null
 

	
 

	
 
revoke_user_permission
 
----------------------
 

	
 
Revoke permission for a user on the given repository.
 
This command can only be executed using the api_key of a user with admin rights.
 

	
 

	
 
INPUT::
 

	
 
    id : <id_for_response>
 
    api_key : "<api_key>"
 
    method  : "revoke_user_permission"
 
@@ -1007,25 +984,24 @@ INPUT::
 
                "userid" : "<username or user_id>"
 
              }
 

	
 
OUTPUT::
 

	
 
    id : <id_given_in_input>
 
    result: {
 
              "msg" : "Revoked perm for user: `<username>` in repo: `<reponame>`",
 
              "success": true
 
            }
 
    error:  null
 

	
 

	
 
grant_user_group_permission
 
---------------------------
 

	
 
Grant permission for a user group on the given repository, or update the
 
existing one if found.
 
This command can only be executed using the api_key of a user with admin rights.
 

	
 

	
 
INPUT::
 

	
 
    id : <id_for_response>
 
    api_key : "<api_key>"
 
@@ -1036,25 +1012,24 @@ INPUT::
 
                "perm" : "(repository.(none|read|write|admin))",
 
              }
 

	
 
OUTPUT::
 

	
 
    id : <id_given_in_input>
 
    result: {
 
              "msg" : "Granted perm: `<perm>` for group: `<usersgroupname>` in repo: `<reponame>`",
 
              "success": true
 
            }
 
    error:  null
 

	
 

	
 
revoke_user_group_permission
 
----------------------------
 

	
 
Revoke permission for a user group on the given repository.
 
This command can only be executed using the api_key of a user with admin rights.
 

	
 
INPUT::
 

	
 
    id : <id_for_response>
 
    api_key : "<api_key>"
 
    method  : "revoke_user_group_permission"
 
    args:     {
docs/changelog.rst
Show inline comments
 
.. _changelog:
 

	
 
=========
 
Changelog
 
=========
 

	
 
Kallithea project doesn't keep its changelog here.  We refer you to our `Mercurial logs`__.
 

	
 

	
 
.. __: https://kallithea-scm.org/repos/kallithea/changelog
docs/contributing.rst
Show inline comments
 
@@ -15,24 +15,25 @@ The main repository is hosted on Our Own
 
https://kallithea-scm.org/repos/kallithea/, our self-hosted instance
 
of Kallithea.
 

	
 
For now, we use Bitbucket_ for `pull requests`_ and `issue tracking`_. The
 
issue tracker is for tracking bugs, not for support, discussion, or ideas --
 
please use the `mailing list`_ or :ref:`IRC <readme>` to reach the community.
 

	
 
We use Weblate_ to translate the user interface messages into languages other
 
than English. Join our project on `Hosted Weblate`_ to help us.
 
To register, you can use your Bitbucket or GitHub account. See :ref:`translations`
 
for more details.
 

	
 

	
 
Getting started
 
---------------
 

	
 
To get started with development::
 

	
 
        hg clone https://kallithea-scm.org/repos/kallithea
 
        cd kallithea
 
        virtualenv ../kallithea-venv
 
        source ../kallithea-venv/bin/activate
 
        python setup.py develop
 
        paster make-config Kallithea my.ini
 
        paster setup-db my.ini --user=user --email=user@example.com --password=password --repos=/tmp
 
@@ -60,24 +61,25 @@ the tests, thus eliminating the initial 
 
    KALLITHEA_WHOOSH_TEST_DISABLE=1 KALLITHEA_NO_TMP_PATH=1 nosetests
 
    kill -9 $(cat test.pid)
 

	
 
You can run individual tests by specifying their path as argument to nosetests.
 
nosetests also has many more options, see `nosetests -h`. Some useful options
 
are::
 

	
 
    -x, --stop            Stop running tests after the first error or failure
 
    -s, --nocapture       Don't capture stdout (any stdout output will be
 
                          printed immediately) [NOSE_NOCAPTURE]
 
    --failed              Run the tests that failed in the last test run.
 

	
 

	
 
Coding/contribution guidelines
 
------------------------------
 

	
 
Kallithea is GPLv3 and we assume all contributions are made by the
 
committer/contributor and under GPLv3 unless explicitly stated. We do care a
 
lot about preservation of copyright and license information for existing code
 
that is brought into the project.
 

	
 
We don't have a formal coding/formatting standard. We are currently using a mix
 
of Mercurial (http://mercurial.selenic.com/wiki/CodingStyle), pep8, and
 
consistency with existing code. Run whitespacecleanup.sh to avoid stupid
 
whitespace noise in your patches.
 
@@ -125,24 +127,25 @@ We try to make sure we have consensus on
 
Everything non-sensitive should be discussed in public -- preferably on the
 
mailing list.  We aim at having all non-trivial changes reviewed by at least
 
one other core developer before pushing. Obvious non-controversial changes will
 
be handled more casually.
 

	
 
For now we just have one official branch ("default") and will keep it so stable
 
that it can be (and is) used in production. Experimental changes should live
 
elsewhere (for example in a pull request) until they are ready.
 

	
 
.. _translations:
 
.. include:: ./../kallithea/i18n/how_to
 

	
 

	
 
"Roadmap"
 
---------
 

	
 
We do not have a road map but are waiting for your contributions. Refer to the
 
wiki_ for some ideas of places we might want to go -- contributions in these
 
areas are very welcome.
 

	
 

	
 
Thank you for your contribution!
 
--------------------------------
 

	
 

	
docs/index.rst
Show inline comments
 
.. _index:
 

	
 
#######################
 
Kallithea Documentation
 
#######################
 

	
 

	
 
**Readme**
 

	
 
.. toctree::
 
   :maxdepth: 1
 

	
 
   readme
 

	
 
**Installation**
 

	
 
.. toctree::
 
   :maxdepth: 1
 

	
 
@@ -59,22 +58,23 @@ Kallithea Documentation
 
   :maxdepth: 1
 

	
 
   api/api
 
   api/models
 

	
 

	
 
Other topics
 
------------
 

	
 
* :ref:`genindex`
 
* :ref:`search`
 

	
 

	
 
.. _virtualenv: http://pypi.python.org/pypi/virtualenv
 
.. _python: http://www.python.org/
 
.. _django: http://www.djangoproject.com/
 
.. _mercurial: http://mercurial.selenic.com/
 
.. _bitbucket: http://bitbucket.org/
 
.. _subversion: http://subversion.tigris.org/
 
.. _git: http://git-scm.com/
 
.. _celery: http://celeryproject.org/
 
.. _Sphinx: http://sphinx.pocoo.org/
 
.. _vcs: http://pypi.python.org/pypi/vcs
docs/installation.rst
Show inline comments
 
@@ -19,44 +19,46 @@ The following describes three different 
 
  installations side by side or remove it entirely by just removing the
 
  virtualenv directory) and does not require root privileges.
 

	
 
- :ref:`installation-without-virtualenv`: The alternative method of installing
 
  a Kallithea release is using standard pip. The package will be installed in
 
  the same location as all other Python packages you have ever installed. As a
 
  result, removing it is not as straightforward as with a virtualenv, as you'd
 
  have to remove its dependencies manually and make sure that they are not
 
  needed by other packages.
 

	
 
.. _installation-source:
 

	
 

	
 
Installation from repository source
 
-----------------------------------
 

	
 
To install Kallithea in a virtualenv_ using the stable branch of the development
 
repository, follow the instructions below::
 

	
 
        hg clone https://kallithea-scm.org/repos/kallithea -u stable
 
        cd kallithea
 
        virtualenv ../kallithea-venv
 
        source ../kallithea-venv/bin/activate
 
        python setup.py develop
 
        python setup.py compile_catalog   # for translation of the UI
 

	
 
You can now proceed to :ref:`setup`.
 

	
 
To upgrade, simply update the repository with ``hg pull -u`` and restart the
 
server.
 

	
 
.. _installation-virtualenv:
 

	
 

	
 
Installing a released version in a virtualenv
 
---------------------------------------------
 

	
 
It is highly recommended to use a separate virtualenv_ for installing Kallithea.
 
This way, all libraries required by Kallithea will be installed separately from your
 
main Python installation and other applications and things will be less
 
problematic when upgrading the system or Kallithea.
 
An additional benefit of virtualenv_ is that it doesn't require root privileges.
 

	
 
- Assuming you have installed virtualenv_, create a new virtual environment
 
  for example, in `/srv/kallithea/venv`, using the virtualenv command::
 

	
 
@@ -82,40 +84,42 @@ An additional benefit of virtualenv_ is 
 
  Alternatively, download a .tar.gz from http://pypi.python.org/pypi/Kallithea,
 
  extract it and run::
 

	
 
    python setup.py install
 

	
 
- This will install Kallithea together with pylons_ and all other required
 
  python libraries into the activated virtualenv.
 

	
 
You can now proceed to :ref:`setup`.
 

	
 
.. _installation-without-virtualenv:
 

	
 

	
 
Installing a released version without virtualenv
 
------------------------------------------------
 

	
 
For installation without virtualenv, 'just' use::
 

	
 
    pip install kallithea
 

	
 
Note that this method requires root privileges and will install packages
 
globally without using the system's package manager.
 

	
 
To install as a regular user in ``~/.local``, you can use::
 

	
 
    pip install --user kallithea
 

	
 
You can now proceed to :ref:`setup`.
 

	
 

	
 
Upgrading Kallithea from Python Package Index (PyPI)
 
----------------------------------------------------
 

	
 
.. note::
 
   It is strongly recommended that you **always** perform a database and
 
   configuration backup before doing an upgrade.
 

	
 
   These directions will use '{version}' to note that this is the version of
 
   Kallithea that these files were used with.  If backing up your Kallithea
 
   instance from version 0.1 to 0.2, the ``my.ini`` file could be
 
   backed up to ``my.ini.0-1``.
 

	
docs/installation_iis.rst
Show inline comments
 
@@ -3,54 +3,55 @@
 
=====================================================================
 
Installing Kallithea on Microsoft Internet Information Services (IIS)
 
=====================================================================
 

	
 
The following is documented using IIS 7/8 terminology. There should be nothing
 
preventing you from applying this on IIS 6 well.
 

	
 
.. note::
 

	
 
    For the best security, it is strongly recommended to only host the site over
 
    a secure connection, e.g. using TLS.
 

	
 

	
 
Prerequisites
 
-------------
 

	
 
Apart from the normal requirements for Kallithea, it is also necessary to get an
 
ISAPI-WSGI bridge module, e.g. isapi-wsgi.
 

	
 

	
 
Installation
 
------------
 

	
 
The following assumes that your Kallithea is at ``c:\inetpub\kallithea``, and
 
will be served from the root of its own website. The changes to serve it in its
 
own virtual folder will be noted where appropriate.
 

	
 
Application pool
 
................
 

	
 
Make sure that there is a unique application pool for the Kallithea application
 
with an identity that has read access to the Kallithea distribution.
 

	
 
The application pool does not need to be able to run any managed code. If you
 
are using a 32-bit Python installation, then you must enable 32-bit program in
 
the advanced settings for the application pool; otherwise Python will not be able
 
to run on the website and neither will Kallithea.
 

	
 
.. note::
 

	
 
    The application pool can be the same as an existing application pool,
 
    as long as the Kallithea requirements are met by the existing pool.
 

	
 

	
 
ISAPI handler
 
.............
 

	
 
The ISAPI handler can be generated using::
 

	
 
    paster install-iis my.ini --root=/
 

	
 
This will generate a ``dispatch.py`` file in the current directory that contains
 
the necessary components to finalize an installation into IIS. Once this file
 
has been generated, it is necessary to run the following command due to the way
 
that ISAPI-WSGI is made::
 

	
 
@@ -80,24 +81,25 @@ added, enable it with the ``REMOTE_USER`
 
Finally, save the changes on this page.
 

	
 
Switch to the administration's permissions page and disable anonymous access,
 
otherwise Kallithea will not attempt to use the authenticated user name. By
 
default, Kallithea will populate the list of users lazily as they log in. Either
 
disable external auth account activation and ensure that you pre-populate the
 
user database with an external tool, or set it to *Automatic activation of
 
external account*. Finally, save the changes.
 

	
 
The last necessary step is to enable the relevant authentication in IIS, e.g.
 
Windows authentication.
 

	
 

	
 
Troubleshooting
 
---------------
 

	
 
Typically, any issues in this setup will either be entirely in IIS or entirely
 
in Kallithea (or Kallithea's WSGI/paster middleware). Consequently, two
 
different options for finding issues exist: IIS' failed request tracking which
 
is great at finding issues until they exist inside Kallithea, at which point the
 
ISAPI-WSGI wrapper above uses ``win32traceutil``, which is part of ``pywin32``.
 

	
 
In order to dump output from WSGI using ``win32traceutil`` it is sufficient to
 
type the following in a console window::
 

	
docs/installation_win.rst
Show inline comments
 
.. _installation_win:
 

	
 
================================================================
 
Installation and upgrade on Windows (7/Server 2008 R2 and newer)
 
================================================================
 

	
 

	
 
First time install
 
::::::::::::::::::
 

	
 
Target OS: Windows 7 and newer or Windows Server 2008 R2 and newer
 

	
 
Tested on Windows 8.1, Windows Server 2008 R2 and Windows Server 2012
 

	
 
To install on an older version of Windows, see `<installation_win_old.html>`_
 

	
 

	
 
Step 1 - Install Python
 
-----------------------
 

	
 
Install Python 2.x.y (x = 6 or 7). Latest version is recommended. If you need another version, they can run side by side.
 

	
 
.. warning:: Python 3.x is not supported.
 

	
 
- Download Python 2.x.y from http://www.python.org/download/
 
- Choose and click on the version
 
- Click on "Windows X86-64 Installer" for x64 or "Windows x86 MSI installer" for Win32.
 
- Disable UAC or run the installer with admin privileges. If you chose to disable UAC, do not forget to reboot afterwards.
 

	
 
While writing this guide, the latest version was v2.7.9.
 
Remember the specific major and minor versions installed, because they will
 
be needed in the next step. In this case, it is "2.7".
 

	
 

	
 
Step 2 - Python BIN
 
-------------------
 

	
 
Add Python BIN folder to the path. This can be done manually (editing
 
"PATH" environment variable) or by using Windows Support Tools that
 
come pre-installed in Windows Vista/7 and later.
 

	
 
Open a CMD and type::
 

	
 
  SETX PATH "%PATH%;[your-python-path]" /M
 

	
 
Please substitute [your-python-path] with your Python installation
 
path. Typically this is ``C:\\Python27``.
 

	
 

	
 
Step 3 - Install pywin32 extensions
 
-----------------------------------
 

	
 
Download pywin32 from:
 
http://sourceforge.net/projects/pywin32/files/
 

	
 
- Click on "pywin32" folder
 
- Click on the first folder (in this case, Build 219, maybe newer when you try)
 
- Choose the file ending with ".amd64-py2.x.exe" (".win32-py2.x.exe"
 
  for Win32) where x is the minor version of Python you installed.
 
  When writing this guide, the file was:
 
  http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/pywin32-219.win-amd64-py2.7.exe/download
 
  (x64)
 
  http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/pywin32-219.win32-py2.7.exe/download
 
  (Win32)
 

	
 

	
 
Step 4 - Install pip
 
--------------------
 

	
 
pip is a package management system for Python. You will need it to install Kallithea and its dependencies.
 

	
 
If you installed Python 2.7.9+, you already have it (as long as you ran the installer with admin privileges or disabled UAC).
 

	
 
If it was not installed or if you are using Python>=2.6,<2.7.9:
 

	
 
- Go to https://bootstrap.pypa.io
 
- Right-click on get-pip.py and choose Saves as...
 
- Run "python get-pip.py" in the folder where you downloaded get-pip.py (may require admin access).
 

	
 
.. note::
 

	
 
   See http://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows
 
   for details and alternative methods.
 

	
 
Note that pip.exe will be placed inside your Python installation's
 
Scripts folder, which is likely not on your path. To correct this,
 
open a CMD and type::
 

	
 
  SETX PATH "%PATH%;[your-python-path]\Scripts" /M
 

	
 

	
 
Step 5 - Kallithea folder structure
 
-----------------------------------
 

	
 
Create a Kallithea folder structure.
 

	
 
This is only an example to install Kallithea. Of course, you can
 
change it. However, this guide will follow the proposed structure, so
 
please later adapt the paths if you change them. Folders without
 
spaces are recommended.
 

	
 
Create the following folder structure::
 

	
 
  C:\Kallithea
 
  C:\Kallithea\Bin
 
  C:\Kallithea\Env
 
  C:\Kallithea\Repos
 

	
 

	
 
Step 6 - Install virtualenv
 
---------------------------
 

	
 
.. note::
 
   A python virtual environment will allow for isolation between the Python packages of your system and those used for Kallithea.
 
   It is strongly recommended to use it to ensure that Kallithea does not change a dependency that other software uses or vice versa.
 

	
 
In a command prompt type::
 

	
 
  pip install virtualenv
 

	
 
Virtualenv will now be inside your Python Scripts path (C:\\Python27\\Scripts or similar).
 

	
 
To create a virtual environment, run::
 

	
 
  virtualenv C:\Kallithea\Env
 

	
 

	
 
Step 7 - Install Kallithea
 
--------------------------
 

	
 
In order to install Kallithea, you need to be able to run "pip install kallithea". It will use pip to install the Kallithea Python package and its dependencies.
 
Some Python packages use managed code and need to be compiled.
 
This can be done on Linux without any special steps. On Windows, you will need to install Microsoft Visual C++ compiler for Python 2.7.
 

	
 
Download and install "Microsoft Visual C++ Compiler for Python 2.7" from http://aka.ms/vcpython27
 

	
 
.. note::
 
  You can also install the dependencies using already compiled Windows binaries packages. A good source of compiled Python packages is http://www.lfd.uci.edu/~gohlke/pythonlibs/. However, not all of the necessary packages for Kallithea are on this site and some are hard to find, so we will stick with using the compiler.
 

	
 
@@ -141,35 +135,33 @@ In a command prompt type (adapting paths
 
  cd C:\Kallithea\Env\Scripts
 
  activate
 

	
 
The prompt will change into "(Env) C:\\Kallithea\\Env\\Scripts" or similar
 
(depending of your folder structure). Then type::
 

	
 
  pip install kallithea
 

	
 
.. note:: This will take some time. Please wait patiently until it is fully
 
          complete. Some warnings will appear. Don't worry, they are
 
          normal.
 

	
 

	
 
Step 8 - Install git (optional)
 
-------------------------------
 

	
 
Mercurial being a python package, it was installed automatically when doing "pip install kallithea".
 

	
 
You need to install git manually if you want Kallithea to be able to host git repositories.
 

	
 
See http://git-scm.com/book/en/v2/Getting-Started-Installing-Git#Installing-on-Windows for instructions.
 

	
 

	
 
Step 9 - Configuring Kallithea
 
------------------------------
 

	
 
Steps taken from `<setup.html>`_
 

	
 
You have to use the same command prompt as in Step 7, so if you closed
 
it, reopen it following the same commands (including the "activate"
 
one). When ready, type::
 

	
 
  cd C:\Kallithea\Bin
 
  paster make-config Kallithea production.ini
 

	
 
@@ -191,25 +183,24 @@ For the sake of simplicity, run it with 
 
The script will ask you for confirmation about creating a new database, answer yes (y)
 

	
 
The script will ask you for the repository path, answer C:\\Kallithea\\Repos (or similar).
 

	
 
The script will ask you for the admin username and password, answer "admin" + "123456" (or whatever you want)
 

	
 
The script will ask you for admin mail, answer "admin@xxxx.com" (or whatever you want).
 

	
 
If you make a mistake and the script doesn't end, don't worry: start it again.
 

	
 
If you decided not to install git, you will get errors about it that you can ignore.
 

	
 

	
 
Step 10 - Running Kallithea
 
---------------------------
 

	
 
In the previous command prompt, being in the C:\\Kallithea\\Bin folder, type::
 

	
 
  paster serve production.ini
 

	
 
Open your web server, and go to http://127.0.0.1:5000
 

	
 
It works!! :-)
 

	
 
Remark:
docs/installation_win_old.rst
Show inline comments
 
.. _installation_win_old:
 

	
 
======================================================================
 
Installation and upgrade on Windows (XP/Vista/Server 2003/Server 2008)
 
======================================================================
 

	
 

	
 
First-time install
 
::::::::::::::::::
 

	
 
Target OS: Windows XP SP3 32-bit English (Clean installation)
 
+ All Windows Updates until 24-may-2012
 

	
 
.. note::
 

	
 
   This installation is for 32-bit systems, for 64-bit Windows you might need
 
   to download proper 64-bit versions of the different packages (Windows Installer, Win32py extensions)
 
   plus some extra tweaks.
 
   These extra steps haven been marked as "64-bit".
 
   Tested on Windows Server 2008 R2 SP1, 9-feb-2013.
 
   If you run into any 64-bit related problems, please check these pages:
 
   - http://blog.victorjabur.com/2011/06/05/compiling-python-2-7-modules-on-windows-32-and-64-using-msvc-2008-express/
 
   - http://bugs.python.org/issue7511
 

	
 
Step 1 - Install Visual Studio 2008 Express
 
-------------------------------------------
 

	
 

	
 
Optional: You can also install MinGW, but VS2008 installation is easier.
 

	
 
Download "Visual C++ 2008 Express Edition with SP1" from:
 
http://download.microsoft.com/download/E/8/E/E8EEB394-7F42-4963-A2D8-29559B738298/VS2008ExpressWithSP1ENUX1504728.iso
 
(if not found or relocated, google for "visual studio 2008 express" for updated link. This link was taken from http://stackoverflow.com/questions/15318560/visual-c-2008-express-download-link-dead)
 

	
 
You can also download full ISO file for offline installation, just
 
choose "All - Offline Install ISO image file" in the previous page and
 
choose "Visual C++ 2008 Express" when installing.
 

	
 
.. note::
 

	
 
@@ -47,62 +47,59 @@ choose "Visual C++ 2008 Express" when in
 

	
 
.. note::
 

	
 
   64-bit: You also need to install the Microsoft Windows SDK for .NET 3.5 SP1 (.NET 4.0 won't work).
 
   Download from: http://www.microsoft.com/en-us/download/details.aspx?id=3138
 

	
 
.. note::
 

	
 
   64-bit: You also need to copy and rename a .bat file to make the Visual C++ compiler work.
 
   I am not sure why this is not necessary for 32-bit.
 
   Copy C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat to C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\vcvarsamd64.bat
 

	
 

	
 
Step 2 -- Install Python
 
------------------------
 

	
 
Install Python 2.x.y (x = 6 or 7) x86 version (32-bit). DO NOT USE A 3.x version.
 
Download Python 2.x.y from:
 
http://www.python.org/download/
 

	
 
Choose "Windows Installer" (32-bit version) not "Windows X86-64
 
Installer". While writing this guide, the latest version was v2.7.3.
 
Remember the specific major and minor version installed, because it will
 
be needed in the next step. In this case, it is "2.7".
 

	
 
.. note::
 

	
 
   64-bit: Just download and install the 64-bit version of python.
 

	
 

	
 
Step 3 -- Install Win32py extensions
 
------------------------------------
 

	
 
Download pywin32 from:
 
http://sourceforge.net/projects/pywin32/files/
 

	
 
- Click on "pywin32" folder
 
- Click on the first folder (in this case, Build 217, maybe newer when you try)
 
- Choose the file ending with ".win32-py2.x.exe" -> x being the minor
 
  version of Python you installed (in this case, 7)
 
  When writing this guide, the file was:
 
  http://sourceforge.net/projects/pywin32/files/pywin32/Build%20217/pywin32-217.win32-py2.7.exe/download
 

	
 
  .. note::
 

	
 
     64-bit: Download and install the 64-bit version.
 
     At the time of writing you can find this at:
 
     http://sourceforge.net/projects/pywin32/files/pywin32/Build%20218/pywin32-218.win-amd64-py2.7.exe/download
 

	
 

	
 
Step 4 -- Python BIN
 
--------------------
 

	
 
Add Python BIN folder to the path
 

	
 
You have to add the Python folder to the path, you can do it manually
 
(editing "PATH" environment variable) or using Windows Support Tools
 
that came preinstalled in Vista/7 and can be installed in Windows XP.
 

	
 
- Using support tools on WINDOWS XP:
 
  If you use Windows XP you can install them using Windows XP CD and
 
  navigating to \SUPPORT\TOOLS. There, execute Setup.EXE (not MSI).
 
@@ -112,64 +109,61 @@ that came preinstalled in Vista/7 and ca
 

	
 
  Close CMD (the path variable will be updated then)
 

	
 
- Using support tools on WINDOWS Vista/7:
 

	
 
  Open a CMD and type::
 

	
 
    SETX PATH "%PATH%;[your-python-path]" /M
 

	
 
  Please substitute [your-python-path] with your Python installation path.
 
  Typically: C:\\Python27
 

	
 

	
 
Step 5 -- Kallithea folder structure
 
------------------------------------
 

	
 
Create a Kallithea folder structure
 

	
 
This is only a example to install Kallithea, you can of course change
 
it. However, this guide will follow the proposed structure, so please
 
later adapt the paths if you change them. My recommendation is to use
 
folders with NO SPACES. But you can try if you are brave...
 

	
 
Create the following folder structure::
 

	
 
  C:\Kallithea
 
  C:\Kallithea\Bin
 
  C:\Kallithea\Env
 
  C:\Kallithea\Repos
 

	
 

	
 
Step 6 -- Install virtualenv
 
----------------------------
 

	
 
Install Virtual Env for Python
 

	
 
Navigate to: http://www.virtualenv.org/en/latest/index.html#installation
 
Right click on "virtualenv.py" file and choose "Save link as...".
 
Download to C:\\Kallithea (or whatever you want)
 
(the file is located at
 
https://raw.github.com/pypa/virtualenv/master/virtualenv.py)
 

	
 
Create a virtual Python environment in C:\\Kallithea\\Env (or similar). To
 
do so, open a CMD (Python Path should be included in Step3), navigate
 
where you downloaded "virtualenv.py", and write::
 

	
 
 python virtualenv.py C:\Kallithea\Env
 

	
 
(--no-site-packages is now the default behaviour of virtualenv, no need
 
to include it)
 

	
 

	
 
Step 7 -- Install Kallithea
 
---------------------------
 

	
 
Finally, install Kallithea
 

	
 
Close previously opened command prompt/s, and open a Visual Studio 2008
 
Command Prompt (**IMPORTANT!!**). To do so, go to Start Menu, and then open
 
"Microsoft Visual C++ 2008 Express Edition" -> "Visual Studio Tools" ->
 
"Visual Studio 2008 Command Prompt"
 

	
 
.. note::
 

	
 
@@ -190,25 +184,24 @@ In that CMD (loaded with VS2008 PATHs) t
 
  cd C:\Kallithea\Env\Scripts (or similar)
 
  activate
 

	
 
The prompt will change into "(Env) C:\\Kallithea\\Env\\Scripts" or similar
 
(depending of your folder structure). Then type::
 

	
 
 pip install kallithea
 

	
 
(long step, please wait until fully complete)
 

	
 
Some warnings will appear, don't worry as they are normal.
 

	
 

	
 
Step 8 -- Configuring Kallithea
 
-------------------------------
 

	
 
steps taken from http://packages.python.org/Kallithea/setup.html
 

	
 
You have to use the same Visual Studio 2008 command prompt as Step7, so
 
if you closed it reopen it following the same commands (including the
 
"activate" one). When ready, just type::
 

	
 
  cd C:\Kallithea\Bin
 
  paster make-config Kallithea production.ini
 

	
 
@@ -229,44 +222,41 @@ step to later UPGRADE to a newer Kallith
 
The script will ask you for confirmation about creating a NEW database,
 
answer yes (y)
 
The script will ask you for repository path, answer C:\\Kallithea\\Repos
 
(or similar)
 
The script will ask you for admin username and password, answer "admin"
 
+ "123456" (or whatever you want)
 
The script will ask you for admin mail, answer "admin@xxxx.com" (or
 
whatever you want)
 

	
 
If you make some mistake and the script does not end, don't worry, start
 
it again.
 

	
 

	
 
Step 9 -- Running Kallithea
 
---------------------------
 

	
 

	
 
In the previous command prompt, being in the C:\\Kallithea\\Bin folder,
 
just type::
 

	
 
 paster serve production.ini
 

	
 
Open yout web server, and go to http://127.0.0.1:5000
 

	
 
It works!! :-)
 

	
 
Remark:
 
If it does not work first time, just Ctrl-C the CMD process and start it
 
again. Don't forget the "http://" in Internet Explorer
 

	
 

	
 

	
 
What this Guide does not cover:
 

	
 
- Installing Celery
 
- Running Kallithea as Windows Service. You can investigate here:
 

	
 
  - http://pypi.python.org/pypi/wsgisvc
 
  - http://ryrobes.com/python/running-python-scripts-as-a-windows-service/
 
  - http://wiki.pylonshq.com/display/pylonscookbook/How+to+run+Pylons+as+a+Windows+service
 

	
 
- Using Apache. You can investigate here:
 

	
 
  - https://groups.google.com/group/rhodecode/msg/c433074e813ffdc4
docs/overview.rst
Show inline comments
 
.. _overview:
 

	
 
=====================
 
Installation overview
 
=====================
 

	
 

	
 
Some overview and some details that can help understanding the options when
 
installing Kallithea.
 

	
 

	
 
Python environment
 
------------------
 

	
 
**Kallithea** is written entirely in Python_ and requires Python version
 
2.6 or higher. Python 3.x is currently not supported.
 

	
 
Given a Python installation, there are different ways of providing the
 
environment for running Python applications. Each of them pretty much
docs/setup.rst
Show inline comments
 
@@ -112,24 +112,25 @@ named ``kallithea``, then to clone via s
 

	
 
    hg clone ssh://user@server.com//srv/repos/kallithea
 

	
 
Using other external tools such as mercurial-server_ or using ssh key-based
 
authentication is fully supported.
 

	
 
.. note:: In an advanced setup, in order for your ssh access to use
 
          the same permissions as set up via the Kallithea web
 
          interface, you can create an authentication hook to connect
 
          to the Kallithea db and run check functions for permissions
 
          against that.
 

	
 

	
 
Setting up Whoosh full text search
 
----------------------------------
 

	
 
Kallithea provides full text search of repositories using `Whoosh`__.
 

	
 
.. __: https://pythonhosted.org/Whoosh/
 

	
 
For an incremental index build, run::
 

	
 
    paster make-index my.ini
 

	
 
For a full index rebuild, run::
 
@@ -375,36 +376,34 @@ clients access the application.
 
When these authentication methods are enabled in Kallithea, it uses the
 
username that the container/proxy (Apache or Nginx, etc.) provides and doesn't
 
perform the authentication itself. The authorization, however, is still done by
 
Kallithea according to its settings.
 

	
 
When a user logs in for the first time using these authentication methods,
 
a matching user account is created in Kallithea with default permissions. An
 
administrator can then modify it using Kallithea's admin interface.
 

	
 
It's also possible for an administrator to create accounts and configure their
 
permissions before the user logs in for the first time, using the :ref:`create-user` API.
 

	
 

	
 
Container-based authentication
 
''''''''''''''''''''''''''''''
 

	
 
In a container-based authentication setup, Kallithea reads the user name from
 
the ``REMOTE_USER`` server variable provided by the WSGI container.
 

	
 
After setting up your container (see `Apache with mod_wsgi`_), you'll need
 
to configure it to require authentication on the location configured for
 
Kallithea.
 

	
 

	
 
Proxy pass-through authentication
 
'''''''''''''''''''''''''''''''''
 

	
 
In a proxy pass-through authentication setup, Kallithea reads the user name
 
from the ``X-Forwarded-User`` request header, which should be configured to be
 
sent by the reverse-proxy server.
 

	
 
After setting up your proxy solution (see `Apache virtual host reverse proxy example`_,
 
`Apache as subdirectory`_ or `Nginx virtual host example`_), you'll need to
 
configure the authentication and add the username in a request header named
 
``X-Forwarded-User``.
 

	
 
@@ -701,24 +700,25 @@ into ``[app:main]`` section of your .ini
 

	
 
    filter-with = proxy-prefix
 

	
 
Add the following at the end of the .ini file::
 

	
 
    [filter:proxy-prefix]
 
    use = egg:PasteDeploy#prefix
 
    prefix = /<someprefix>
 

	
 

	
 
then change ``<someprefix>`` into your chosen prefix
 

	
 

	
 
Apache with mod_wsgi
 
--------------------
 

	
 
Alternatively, Kallithea can be set up with Apache under mod_wsgi. For
 
that, you'll need to:
 

	
 
- Install mod_wsgi. If using a Debian-based distro, you can install
 
  the package libapache2-mod-wsgi::
 

	
 
    aptitude install libapache2-mod-wsgi
 

	
 
- Enable mod_wsgi::
 
@@ -798,22 +798,23 @@ Or using proper virtualenv activation:
 
    from paste.deploy import loadapp
 
    application = loadapp('config:' + ini)
 

	
 

	
 
Other configuration files
 
-------------------------
 

	
 
A number of `example init.d scripts`__ can be found in
 
the ``init.d`` directory of the Kallithea source.
 

	
 
.. __: https://kallithea-scm.org/repos/kallithea/files/tip/init.d/ .
 

	
 

	
 
.. _virtualenv: http://pypi.python.org/pypi/virtualenv
 
.. _python: http://www.python.org/
 
.. _Mercurial: http://mercurial.selenic.com/
 
.. _Celery: http://celeryproject.org/
 
.. _Celery documentation: http://docs.celeryproject.org/en/latest/getting-started/index.html
 
.. _RabbitMQ: http://www.rabbitmq.com/
 
.. _Redis: http://redis.io/
 
.. _python-ldap: http://www.python-ldap.org/
 
.. _mercurial-server: http://www.lshift.net/mercurial-server.html
 
.. _PublishingRepositories: http://mercurial.selenic.com/wiki/PublishingRepositories
docs/usage/backup.rst
Show inline comments
 
.. _backup:
 

	
 
====================
 
Backing up Kallithea
 
====================
 

	
 

	
 
Settings
 
--------
 

	
 
Just copy your .ini file, it contains all Kallithea settings.
 

	
 

	
 
Whoosh index
 
------------
 

	
 
The Whoosh index is located in the ``data/index`` directory where you installed
 
Kallithea, i.e., the same place where the ini file is located
 

	
 

	
 
Database
 
--------
 

	
 
When using sqlite just copy kallithea.db.
 
Any other database engine requires a manual backup operation.
docs/usage/debugging.rst
Show inline comments
 
.. _debugging:
 

	
 
===================
 
Debugging Kallithea
 
===================
 

	
 
If you encounter problems with Kallithea, here are some instructions
 
on how to debug them.
 

	
 
.. note:: First make sure you're using the latest version available.
 

	
 

	
 
Enable detailed debug
 
---------------------
 

	
 
Kallithea uses the standard Python ``logging`` module to log its output.
 
By default only loggers with ``INFO`` level are displayed. To enable full output
 
change ``level = DEBUG`` for all logging handlers in the currently used .ini file.
 
This change will allow you to see much more detailed output in the log file or
 
console. This generally helps a lot to track issues.
 

	
 

	
 
Enable interactive debug mode
 
-----------------------------
docs/usage/email.rst
Show inline comments
 
@@ -6,24 +6,25 @@ Email settings
 

	
 
The Kallithea configuration file has several email related settings. When
 
these contain correct values, Kallithea will send email in the situations
 
described below. If the email configuration is not correct so that emails
 
cannot be sent, all mails will show up in the log output.
 

	
 
Before any email can be sent, an SMTP server has to be configured using the
 
configuration file setting ``smtp_server``. If required for that server, specify
 
a username (``smtp_username``) and password (``smtp_password``), a non-standard
 
port (``smtp_port``), encryption settings (``smtp_use_tls`` or ``smtp_use_ssl``)
 
and/or specific authentication parameters (``smtp_auth``).
 

	
 

	
 
Application emails
 
------------------
 

	
 
Kallithea sends an email to `users` on several occasions:
 

	
 
- when comments are given on one of their changesets
 
- when comments are given on changesets they are reviewer on or on which they
 
  commented regardless
 
- when they are invited as reviewer in pull requests
 
- when they request a password reset
 

	
 
Kallithea sends an email to all `administrators` upon new account registration.
 
@@ -33,38 +34,41 @@ page.
 
When Kallithea wants to send an email but due to an error cannot correctly
 
determine the intended recipients, the administrators and the addresses
 
specified in ``email_to`` in the configuration file are used as fallback.
 

	
 
Recipients will see these emails originating from the sender specified in the
 
``app_email_from`` setting in the configuration file. This setting can either
 
contain only an email address, like `kallithea-noreply@example.com`, or both
 
a name and an address in the following format: `Kallithea
 
<kallithea-noreply@example.com>`. The subject of these emails can
 
optionally be prefixed with the value of ``email_prefix`` in the configuration
 
file.
 

	
 

	
 
Error emails
 
------------
 

	
 
When an exception occurs in Kallithea -- and unless interactive debugging is
 
enabled using ``set debug = true`` in the ``[app:main]`` section of the
 
configuration file -- an email with exception details is sent by WebError_'s
 
``ErrorMiddleware`` to the addresses specified in ``email_to`` in the
 
configuration file.
 

	
 
Recipients will see these emails originating from the sender specified in the
 
``error_email_from`` setting in the configuration file. This setting can either
 
contain only an email address, like `kallithea-noreply@example.com`, or both
 
a name and an address in the following format: `Kallithea Errors
 
<kallithea-noreply@example.com>`.
 

	
 
*Note:* The WebError_ package does not respect ``smtp_port`` and assumes the
 
standard SMTP port (25). If you have a remote SMTP server with a different port,
 
you could set up a local forwarding SMTP server on port 25.
 

	
 

	
 
References
 
----------
 

	
 
- `Error Middleware (Pylons documentation) <http://pylons-webframework.readthedocs.org/en/latest/debugging.html#error-middleware>`_
 
- `ErrorHandler (Pylons modules documentation) <http://pylons-webframework.readthedocs.org/en/latest/modules/middleware.html#pylons.middleware.ErrorHandler>`_
 

	
 

	
 
.. _WebError: https://pypi.python.org/pypi/WebError
docs/usage/general.rst
Show inline comments
 
@@ -18,24 +18,25 @@ There is a special command for cleaning 
 
    paster cleanup-repos --older-than=30d my.ini
 

	
 
This command scans for archived repositories that are older than
 
30 days, displays them, and asks if you want to delete them (unless given
 
the ``--dont-ask`` flag). If you host a large amount of repositories with
 
forks that are constantly being deleted, it is recommended that you run this
 
command via crontab.
 

	
 
It is worth noting that even if someone is given administrative access to
 
Kallithea and deletes a repository, you can easily restore such an action by
 
renaming the repository directory, removing the ``rm__<date>`` prefix.
 

	
 

	
 
File view: follow current branch
 
--------------------------------
 

	
 
In the file view, left and right arrows allow to jump to the previous and next
 
revision. Depending on the way revisions were created in the repository, this
 
could jump to a different branch.  When the checkbox ``Follow current branch``
 
is checked, these arrows will only jump to revisions on the same branch as the
 
currently visible revision.  So for example, if someone is viewing files in the
 
``beta`` branch and marks the `Follow current branch` checkbox, the < and >
 
arrows will only show revisions on the ``beta`` branch.
 

	
 

	
docs/usage/performance.rst
Show inline comments
 
@@ -45,13 +45,14 @@ Follow these few steps to improve perfor
 
      shared disk storage, preferably together with repositories. This ``data``
 
      dir contains template caches, sessions, whoosh index and is used for
 
      task locking (so it is safe across multiple instances). Set the
 
      ``cache_dir``, ``index_dir``, ``beaker.cache.data_dir``, ``beaker.cache.lock_dir``
 
      variables in each .ini file to a shared location across Kallithea instances
 
    - If celery is used each instance should run a separate Celery instance, but
 
      the message broker should be common to all of them (e.g.,  one
 
      shared RabbitMQ server)
 
    - Load balance using round robin or IP hash, recommended is writing LB rules
 
      that will separate regular user traffic from automated processes like CI
 
      servers or build bots.
 

	
 

	
 
.. _SQLAlchemyGrate: https://github.com/shazow/sqlalchemygrate
docs/usage/vcs_support.rst
Show inline comments
 
@@ -8,29 +8,32 @@ Kallithea supports Git and Mercurial rep
 
For Git, you do need the ``git`` command line client installed on the server.
 

	
 
You can always disable Git or Mercurial support by editing the
 
file ``kallithea/__init__.py`` and commenting out the backend.
 

	
 
.. code-block:: python
 

	
 
   BACKENDS = {
 
       'hg': 'Mercurial repository',
 
       #'git': 'Git repository',
 
   }
 

	
 

	
 
Git support
 
-----------
 

	
 

	
 
Web server with chunked encoding
 
````````````````````````````````
 

	
 
Large Git pushes require an HTTP server with support for
 
chunked encoding for POST. The Python web servers waitress_ and
 
gunicorn_ (Linux only) can be used. By default, Kallithea uses
 
waitress_ for `paster serve` instead of the built-in `paste` WSGI
 
server.
 

	
 
The paster server is controlled in the .ini file::
 

	
 
    use = egg:waitress#main
 

	
 
or::
 

	
 
@@ -38,26 +41,28 @@ or::
 

	
 

	
 
Also make sure to comment out the following options::
 

	
 
    threadpool_workers =
 
    threadpool_max_requests =
 
    use_threadpool =
 

	
 

	
 
Mercurial support
 
-----------------
 

	
 

	
 
Working with Mercurial subrepositories
 
``````````````````````````````````````
 

	
 
This section explains how to use Mercurial subrepositories_ in Kallithea.
 

	
 
Example usage::
 

	
 
    ## init a simple repo
 
    hg init mainrepo
 
    cd mainrepo
 
    echo "file" > file
 
    hg add file
 
    hg ci --message "initial file"
 

	
 
    # clone subrepo we want to add from Kallithea
 
@@ -68,15 +73,16 @@ Example usage::
 
    hg add .hgsub
 
    hg ci --message "added remote subrepo"
 

	
 
In the file list of a clone of ``mainrepo`` you will see a connected
 
subrepository at the revision it was cloned with. Clicking on the
 
subrepository link sends you to the proper repository in Kallithea.
 

	
 
Cloning ``mainrepo`` will also clone the attached subrepository.
 

	
 
Next we can edit the subrepository data, and push back to Kallithea. This will
 
update both repositories.
 

	
 

	
 
.. _waitress: http://pypi.python.org/pypi/waitress
 
.. _gunicorn: http://pypi.python.org/pypi/gunicorn
 
.. _subrepositories: http://mercurial.aragost.com/kick-start/en/subrepositories/
kallithea/i18n/how_to
Show inline comments
 
============
 
Translations
 
============
 

	
 
Translations are available on Hosted Weblate at the following URL:
 

	
 
    https://hosted.weblate.org/projects/kallithea/kallithea/
 

	
 
Registered users may contribute to the existing languages, or request a new
 
language translations.
 

	
 

	
 
Translating using Weblate
 
-------------------------
 

	
 
Weblate_ offers a simple and easy to use interface featuring glossary, machine
 
translation, suggestions based on similar translations in other projects,
 
automatic checks etc. Weblate imports the source code tree directly from
 
the version control system, and commits edits back from time to time.
 

	
 
When registering at Weblate, make sure you name and email address you prefer to
 
be used when your changes are committed. We can and probably will amend changesets
 
coming from Weblate, but having things right from the beginning makes things easier.
 

	
 
Weblate performs sanity checks all the time and tries to prevent you from ignoring
 
them. Most common mistakes are inconsistent punctuation, whitespaces, missing or extra
 
format parameters, untranslated strings copied into the translation. Please perform
 
necessary corrections when they're needed, or override the false positives.
 

	
 

	
 
Merging translations from Weblate
 
---------------------------------
 

	
 
Weblate rebases its changes every time it pulls from our repository. Pulls are triggered
 
by a web hook from Our Own Kallithea every time it receives new commits. Usually merging
 
the new translations is a straightforward process consisting of a pull from Weblate-hosted
 
repository which is available under Data Exports tab in Weblate interface.
 

	
 
Weblate tries to minimise the number of commits, but that's not always work, especially
 
when two translators work with different languages at more or less the same time.
 
It makes sense sometimes to re-order or fold commits by the same author when they touch
 
just the same language translation. That, however, may confuse Weblate sometimes, in
 
which case it should be manually convinced it has to discard the commits it created by
 
using its administrative interface.
 

	
 

	
 
Manual creation of a new language translation
 
---------------------------------------------
 

	
 
In the prepared development environment, run the following to ensure
 
all translation strings are extracted and up-to-date::
 

	
 
    python setup.py extract_messages
 

	
 
Create new language by executing following command::
 

	
 
    python setup.py init_catalog -l <new_language_code>
 

	
 
@@ -57,36 +60,38 @@ This creates a new translation under dir
 
based on the translation template file, `kallithea/i18n/kallithea.pot`.
 

	
 
Edit the new PO file located in `LC_MESSAGES` directory with poedit or your
 
favorite PO files editor. After you finished with the translations, check the
 
translation file for errors by executing::
 

	
 
    msgfmt -f -c kallithea/i18n/<new_language_code>/LC_MESSAGES/<updated_file.po>
 

	
 
Finally, compile the translations::
 

	
 
    python setup.py compile_catalog -l <new_language_code>
 

	
 

	
 
Updating translations
 
---------------------
 

	
 
Extract the latest versions of strings for translation by running::
 

	
 
    python setup.py extract_messages
 

	
 
Update the PO file by doing::
 

	
 
    python setup.py update_catalog -l <new_language_code>
 

	
 
Edit the new updated translation file. Repeat all steps after `init_catalog` step from
 
new translation instructions
 

	
 

	
 
Testing translations
 
--------------------
 

	
 
Edit kallithea/tests/test.ini file and set lang attribute to::
 

	
 
    lang=<new_language_code>
 

	
 
Run Kallithea tests by executing::
 

	
 
    nosetests
0 comments (0 inline, 0 general)