diff --git a/README.rst b/README.rst --- a/README.rst +++ b/README.rst @@ -21,6 +21,7 @@ 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 @@ -29,7 +30,7 @@ virtualenv_. Official releases of Kallit pip install kallithea The development repository is kept very stable and used in production by the -developers - you can do the same. +developers -- you can do the same. Please visit https://docs.kallithea-scm.org/en/latest/installation.html for more details. @@ -115,11 +116,11 @@ Community --------- **Kallithea** is maintained by its users who contribute the fixes they would - like to see. +like to see. Get in touch with the rest of the community: -- Join the mailing list users and developers - see +- Join the mailing list users and developers -- see http://lists.sfconservancy.org/mailman/listinfo/kallithea-general. - Use IRC and join #kallithea on FreeNode (irc.freenode.net) or use @@ -198,6 +199,7 @@ database, using the database string you If you started out using the branding interoperability approach mentioned above, watch out for stray brand.pyc after removing brand.py. + .. _virtualenv: http://pypi.python.org/pypi/virtualenv .. _Python: http://www.python.org/ .. _Sphinx: http://sphinx.pocoo.org/ diff --git a/docs/api/api.rst b/docs/api/api.rst --- a/docs/api/api.rst +++ b/docs/api/api.rst @@ -7,7 +7,7 @@ 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 -/_admin/api . +``/_admin/api``. API access for web views @@ -16,12 +16,12 @@ 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 -only available if they have been white listed. Edit the +RSS/Atom feed views are enabled. Other views are +only available if they have been whitelisted. Edit the ``api_access_controllers_whitelist`` option in your .ini file and define views that should have API access enabled. -For example, to enable API access to patch/diff raw file and archive:: +For example, to enable API access to patch/diff, raw file and archive:: api_access_controllers_whitelist = ChangesetController:changeset_patch, @@ -33,7 +33,7 @@ After this change, a Kallithea view can GET parameter ``?api_key=`` to the URL. Exposing raw diffs is a good way to integrate with -3rd party services like code review, or build farms that could download archives. +third-party services like code review, or build farms that can download archives. API access @@ -50,27 +50,28 @@ Clients must send JSON encoded JSON-RPC For example, to pull to a local "CPython" mirror using curl:: - curl https://server.com/_admin/api -X POST -H 'content-type:text/plain' --data-binary '{"id":1,"api_key":"xe7cdb2v278e4evbdf5vs04v832v0efvcbcve4a3","method":"pull","args":{"repo":"CPython"}}' + curl https://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 - *id*, a value of any type, can be used to match the response with the request that it is replying to. - *api_key*, for authentication and permission validation. - - *method*, the name of the method to call - a list of available methods can be found below. + - *method*, the name of the method to call -- a list of available methods can be found below. - *args*, the arguments to pass to the method. .. note:: - api_key can be found or set on the user account page + api_key can be found or set on the user account page. The response to the JSON-RPC API call will always be a JSON structure:: { - "id":, # the id that was used in the request - "result": ""|null, # JSON formatted result, null if any errors - "error": "null"| # JSON formatted error (if any) + "id": , # the id that was used in the request + "result": |null, # JSON formatted result (null on error) + "error": null| # JSON formatted error (null on success) } -All responses from API will be ``HTTP/1.0 200 OK``. If there is an error, +All responses from the API will be ``HTTP/1.0 200 OK``. If an error occurs, the reponse will have a failure description in *error* and *result* will be null. @@ -78,7 +79,7 @@ the reponse will have a failure descript API client ++++++++++ -Kallithea comes with a ``kallithea-api`` command line tool providing a convenient +Kallithea comes with a ``kallithea-api`` command line tool, providing a convenient way to call the JSON-RPC API. For example, to call ``get_repo``:: @@ -106,7 +107,7 @@ To avoid specifying ``apihost`` and ``ap kallithea-api --save-config --apihost= --apikey= -This will create a ``~/.config/kallithea`` with the specified hostname and apikey +This will create a ``~/.config/kallithea`` with the specified hostname and API key so you don't have to specify them every time. @@ -332,6 +333,8 @@ OUTPUT:: error: null +.. _create-user: + create_user ----------- @@ -375,6 +378,10 @@ OUTPUT:: } 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 ----------- diff --git a/docs/changelog.rst b/docs/changelog.rst --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -4,6 +4,6 @@ Changelog ========= -Kallithea project doesn't keep its changelog here. We refer you to our Mercurial logs_ . +Kallithea project doesn't keep its changelog here. We refer you to our `Mercurial logs`__. -.. _logs: https://kallithea-scm.org/repos/kallithea/changelog +.. __: https://kallithea-scm.org/repos/kallithea/changelog diff --git a/docs/conf.py b/docs/conf.py --- a/docs/conf.py +++ b/docs/conf.py @@ -88,6 +88,7 @@ exclude_patterns = ['_build'] # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' +highlight_language = 'none' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] diff --git a/docs/contributing.rst b/docs/contributing.rst --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -11,13 +11,13 @@ your own itch. Infrastructure -------------- -The main repository is hosted at Our Own Kallithea (aka OOK) on -https://kallithea-scm.org/repos/kallithea/ (which is our self-hosted instance -of Kallithea). +The main repository is hosted on Our Own Kallithea (aka OOK) at +https://kallithea-scm.org/repos/kallithea/, our self-hosted instance +of Kallithea. -For now, we use Bitbucket_ for `Pull Requests`_ and `Issue Tracker`_ services. The -issue tracker is for tracking bugs, not for support, discussion, or ideas - -please use the `mailing list`_ to reach the community. +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 ` 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. @@ -48,7 +48,7 @@ Running tests After finishing your changes make sure all tests pass cleanly. You can run the testsuite running ``nosetests`` from the project root, or if you use tox -run ``tox`` for python2.6-2.7 with multiple database test. +run ``tox`` for Python 2.6--2.7 with multiple database test. When running tests, Kallithea uses `kallithea/tests/test.ini` and populates the SQLite database specified there. @@ -90,22 +90,23 @@ to the extent it is feasible, IE8 is not We primarily support Linux and OS X on the server side but Windows should also work. -Html templates should use 2 spaces for indentation ... but be pragmatic. We +HTML templates should use 2 spaces for indentation ... but be pragmatic. We should use templates cleverly and avoid duplication. We should use reasonable -semantic markup with classes and ids that can be used for styling and testing. +semantic markup with element classes and IDs that can be used for styling and testing. We should only use inline styles in places where it really is semantic (such as -display:none). +``display: none``). -JavaScript must use ';' between/after statements. Indentation 4 spaces. Inline -multiline functions should be indented two levels - one for the () and one for -{}. jQuery value arrays should have a leading $. +JavaScript must use ``;`` between/after statements. Indentation 4 spaces. Inline +multiline functions should be indented two levels -- one for the ``()`` and one for +``{}``. +Variables holding jQuery objects should be named with a leading ``$``. Commit messages should have a leading short line summarizing the changes. For -bug fixes, put "(Issue #123)" at the end of this line. +bug fixes, put ``(Issue #123)`` at the end of this line. -Contributions will be accepted in most formats - such as pull requests on +Contributions will be accepted in most formats -- such as pull requests on bitbucket, something hosted on your own Kallithea instance, or patches sent by -email to the kallithea-general mailing list. +email to the `kallithea-general`_ mailing list. Make sure to test your changes both manually and with the automatic tests before posting. @@ -116,7 +117,7 @@ might give feedback that requests polish changes when we apply them. We try to make sure we have consensus on the direction the project is taking. -Everything non-sensitive should be discussed in public - preferably on the +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. @@ -132,7 +133,7 @@ elsewhere (for example in a pull request --------- 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 +wiki_ for some ideas of places we might want to go -- contributions in these areas are very welcome. @@ -141,9 +142,10 @@ Thank you for your contribution! .. _Weblate: http://weblate.org/ -.. _Issue Tracker: https://bitbucket.org/conservancy/kallithea/issues?status=new&status=open -.. _Pull Requests: https://bitbucket.org/conservancy/kallithea/pull-requests +.. _issue tracking: https://bitbucket.org/conservancy/kallithea/issues?status=new&status=open +.. _pull requests: https://bitbucket.org/conservancy/kallithea/pull-requests .. _bitbucket: http://bitbucket.org/ .. _mailing list: http://lists.sfconservancy.org/mailman/listinfo/kallithea-general +.. _kallithea-general: http://lists.sfconservancy.org/mailman/listinfo/kallithea-general .. _Hosted Weblate: https://hosted.weblate.org/projects/kallithea/kallithea/ .. _wiki: https://bitbucket.org/conservancy/kallithea/wiki/Home diff --git a/docs/installation.rst b/docs/installation.rst --- a/docs/installation.rst +++ b/docs/installation.rst @@ -4,11 +4,12 @@ Installation on Unix/Linux ========================== -Here are more details about 3 ways to install Kallithea: +The following describes three different ways of installing Kallithea: - :ref:`installation-source`: The simplest way to keep the installation - uptodate and keep track of local customizations is to run directly from - source in a Kallithea repository clone and use virtualenv. + up-to-date and track any local customizations is to run directly from + source in a Kallithea repository clone, preferably inside a virtualenv + virtual Python environment. - :ref:`installation-virtualenv`: If you prefer to only use released versions of Kallithea, the recommended method is to install Kallithea in a virtual @@ -30,7 +31,7 @@ Here are more details about 3 ways to in Installation from repository source ----------------------------------- -To install Kallithea in a virtualenv using the stable branch of the development +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 diff --git a/docs/installation_iis.rst b/docs/installation_iis.rst --- a/docs/installation_iis.rst +++ b/docs/installation_iis.rst @@ -21,7 +21,7 @@ ISAPI-WSGI bridge module, e.g. isapi-wsg Installation ------------ -The following will assume that your Kallithea is at ``c:\inetpub\kallithea`` and +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. @@ -32,15 +32,15 @@ Make sure that there is a unique applica 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 consequently, Kallithea will not be able to run. +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 requirements to Kallithea are enabled by the existing application - pool. + 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 ............. diff --git a/docs/installation_win_old.rst b/docs/installation_win_old.rst --- a/docs/installation_win_old.rst +++ b/docs/installation_win_old.rst @@ -7,17 +7,17 @@ Installation and upgrade on Windows (XP/ First-time install :::::::::::::::::: -Target OS: Windows XP SP3 32bit English (Clean installation) +Target OS: Windows XP SP3 32-bit English (Clean installation) + All Windows Updates until 24-may-2012 .. note:: - This installation is for 32bit systems, for 64bit windows you might need - to download proper 64bit versions of the different packages(Windows Installer, Win32py extensions) + 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 "64bit". + These extra steps haven been marked as "64-bit". Tested on Windows Server 2008 R2 SP1, 9-feb-2013. - If you run into any 64bit related problems, please check these pages: + 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 @@ -47,34 +47,35 @@ choose "Visual C++ 2008 Express" when in .. note:: - 64bit: You also need to install the Microsoft Windows SDK for .NET 3.5 SP1 (.NET 4.0 won't work). + 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:: - 64bit: 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 32bit. + 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 ------------------------ +Step 2 -- Install Python +------------------------ -Install Python 2.x.y (x = 6 or 7) x86 version (32bit). DO NOT USE A 3.x version. +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" (32bit version) not "Windows X86-64 +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:: - 64bit: Just download and install the 64bit version of python. + 64-bit: Just download and install the 64-bit version of python. + -Step 3 - Install Win32py extensions ------------------------------------ +Step 3 -- Install Win32py extensions +------------------------------------ Download pywin32 from: http://sourceforge.net/projects/pywin32/files/ @@ -88,12 +89,13 @@ http://sourceforge.net/projects/pywin32/ .. note:: - 64bit: Download and install the 64bit version. + 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 -------------------- + +Step 4 -- Python BIN +-------------------- Add Python BIN folder to the path @@ -120,8 +122,8 @@ that came preinstalled in Vista/7 and ca Typically: C:\\Python27 -Step 5 - Kallithea folder structure ------------------------------------ +Step 5 -- Kallithea folder structure +------------------------------------ Create a Kallithea folder structure @@ -138,8 +140,8 @@ Create the following folder structure:: C:\Kallithea\Repos -Step 6 - Install virtualenv ---------------------------- +Step 6 -- Install virtualenv +---------------------------- Install Virtual Env for Python @@ -159,8 +161,8 @@ where you downloaded "virtualenv.py", an to include it) -Step 7 - Install Kallithea --------------------------- +Step 7 -- Install Kallithea +--------------------------- Finally, install Kallithea @@ -171,7 +173,7 @@ Command Prompt (**IMPORTANT!!**). To do .. note:: - 64bit: For 64bit you need to modify the shortcut that is used to start the + 64-bit: For 64-bit you need to modify the shortcut that is used to start the Visual Studio 2008 Command Prompt. Use right-mouse click to open properties. Change commandline from:: @@ -198,9 +200,8 @@ The prompt will change into "(Env) C:\\K Some warnings will appear, don't worry as they are normal. -Step 8 - Configuring Kallithea ------------------------------- - +Step 8 -- Configuring Kallithea +------------------------------- steps taken from http://packages.python.org/Kallithea/setup.html @@ -238,8 +239,8 @@ If you make some mistake and the script it again. -Step 9 - Running Kallithea --------------------------- +Step 9 -- Running Kallithea +--------------------------- In the previous command prompt, being in the C:\\Kallithea\\Bin folder, diff --git a/docs/setup.rst b/docs/setup.rst --- a/docs/setup.rst +++ b/docs/setup.rst @@ -14,7 +14,7 @@ following command to do so:: paster make-config Kallithea my.ini This will create the file ``my.ini`` in the current directory. This -configuration file contains the various settings for Kallithea, e.g., +configuration file contains the various settings for Kallithea, e.g. proxy port, email settings, usage of static files, cache, Celery settings, and logging. @@ -34,12 +34,13 @@ entering this "root" path ``setup-db`` w and password for the initial admin account which ``setup-db`` sets up for you. -The setup process can be fully automated, example for lazy:: +The ``setup-db`` values can also be given on the command line. +Example:: - paster setup-db my.ini --user=nn --password=secret --email=nn@your.kallithea.server --repos=/srv/repos + paster setup-db my.ini --user=nn --password=secret --email=nn@example.org --repos=/srv/repos -The ``setup-db`` command will create all of the needed tables and an +The ``setup-db`` command will create all needed tables and an admin account. When choosing a root path you can either use a new empty location, or a location which already contains existing repositories. If you choose a location which contains existing @@ -58,22 +59,22 @@ You are now ready to use Kallithea. To r paster serve my.ini - This command runs the Kallithea server. The web app should be available at - http://127.0.0.1:5000. This ip and port is configurable via the my.ini - file created in previous step -- Use the admin account you created above when running ``setup-db`` - to login to the web app. + http://127.0.0.1:5000. The IP address and port is configurable via the + configuration file created in the previous step. +- Log in to Kallithea using the admin account created when running ``setup-db``. - The default permissions on each repository is read, and the owner is admin. Remember to update these if needed. - In the admin panel you can toggle LDAP, anonymous, and permissions settings, as well as edit more advanced options on users and - repositories + repositories. Extensions ---------- -Optionally users can create an ``rcextensions`` package that extends Kallithea -functionality. To do this simply execute:: +Optionally one can create an ``rcextensions`` package that extends Kallithea +functionality. +To generate a skeleton extensions package, run:: paster make-rcext my.ini @@ -123,45 +124,38 @@ authentication is fully supported. Setting up Whoosh full text search ---------------------------------- -The whoosh index can be built by using the paster -command ``make-index``. To use ``make-index`` you must specify the configuration -file that stores the location of the index. You may specify the location of the -repositories (``--repo-location``). If not specified, this value is retrieved -from the Kallithea database. -It is also possible to specify a comma separated list of -repositories (``--index-only``) to build index only on chooses repositories -skipping any other found in repos location +Kallithea provides full text search of repositories using `Whoosh`__. -You may optionally pass the option ``-f`` to enable a full index rebuild. Without -the ``-f`` option, indexing will run always in "incremental" mode. +.. __: https://pythonhosted.org/Whoosh/ -For an incremental index build use:: +For an incremental index build, run:: paster make-index my.ini -For a full index rebuild use:: +For a full index rebuild, run:: paster make-index my.ini -f +The ``--repo-location`` option allows the location of the repositories to be overriden; +usually, the location is retrieved from the Kallithea database. -Building an index for just selected repositories is possible with such command:: +The ``--index-only`` option can be used to limit the indexed repositories to a comma-separated list:: paster make-index my.ini --index-only=vcs,kallithea -In order to do periodic index builds and keep your index always up to -date, it is recommended to use a crontab entry. An example entry -might look like this:: +To keep your index up-to-date it is necessary to do periodic index builds; +for this, it is recommended to use a crontab entry. Example:: - /path/to/python/bin/paster make-index /path/to/kallithea/my.ini + 0 3 * * * /path/to/virtualenv/bin/paster make-index /path/to/kallithea/my.ini -When using incremental mode (the default) whoosh will check the last +When using incremental mode (the default), Whoosh will check the last modification date of each file and add it to be reindexed if a newer file is available. The indexing daemon checks for any removed files and removes them from index. If you want to rebuild the index from scratch, you can use the ``-f`` flag as above, -or in the admin panel you can check the "build from scratch" flag. +or in the admin panel you can check the "build from scratch" checkbox. Setting up LDAP support @@ -169,7 +163,7 @@ Setting up LDAP support Kallithea supports LDAP authentication. In order to use LDAP, you have to install the python-ldap_ package. This package is -available via pypi, so you can install it by running:: +available via PyPI, so you can install it by running:: pip install python-ldap @@ -378,15 +372,16 @@ of users to its WSGI container, or to a clients access the application. When these authentication methods are enabled in Kallithea, it uses the -username that the container/proxy (Apache/Nginx/etc) authenticated and doesn't +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. +permissions before the user logs in for the first time, using the :ref:`create-user` API. Container-based authentication @@ -395,7 +390,7 @@ 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's WSGI config`_), you'd need +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. @@ -408,22 +403,24 @@ from the ``X-Forwarded-User`` request he 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'd need to +`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``. For example, the following config section for Apache sets a subdirectory in a -reverse-proxy setup with basic auth:: +reverse-proxy setup with basic auth: + +.. code-block:: apache - > - ProxyPass http://127.0.0.1:5000/ - ProxyPassReverse http://127.0.0.1:5000/ + + ProxyPass http://127.0.0.1:5000/someprefix + ProxyPassReverse http://127.0.0.1:5000/someprefix SetEnvIf X-Url-Scheme https HTTPS=1 AuthType Basic AuthName "Kallithea authentication" AuthUserFile /srv/kallithea/.htpasswd - require valid-user + Require valid-user RequestHeader unset X-Forwarded-User @@ -445,8 +442,8 @@ Integration with issue trackers ------------------------------- Kallithea provides a simple integration with issue trackers. It's possible -to define a regular expression that will fetch an issue id stored in a commit -messages and replace that with a URL to the issue. To enable this simply +to define a regular expression that will match an issue ID in commit messages, +and have that replaced with a URL to the issue. To enable this simply uncomment the following variables in the ini file:: issue_pat = (?:^#|\s#)(\w+) @@ -459,12 +456,14 @@ parentheses should be used to specify th The default expression matches issues in the format ``#``, e.g., ``#300``. -Matched issues are replaced with the link specified as -``issue_server_link`` ``{id}`` is replaced with issue id, and +Matched issue references are replaced with the link specified in +``issue_server_link``. ``{id}`` is replaced with the issue ID, and ``{repo}`` with the repository name. Since the # is stripped away, ``issue_prefix`` is prepended to the link text. ``issue_prefix`` doesn't necessarily need to be ``#``: if you set issue prefix to ``ISSUE-`` this will -generate a URL in the format:: +generate a URL in the format: + +.. code-block:: html ISSUE-300 @@ -476,7 +475,9 @@ the variables. For example:: issue_prefix_wiki = WIKI- With these settings, wiki pages can be referenced as wiki-some-id, and every -such reference will be transformed into:: +such reference will be transformed into: + +.. code-block:: html WIKI-some-id @@ -488,10 +489,10 @@ Hooks can be managed in similar way to t To access hooks setting click `advanced setup` in the `Hooks` section of Mercurial Settings in Admin. -There are four built in hooks that cannot be changed (only enabled/disabled by -checkboxes in the previous section). -To add another custom hook simply fill in the first section with -``.`` and the second one with hook path. Example hooks +The built-in hooks cannot be modified, though they can be enabled or disabled in the *VCS* section. + +To add another custom hook simply fill in the first textbox with +``.`` and the second with the hook path. Example hooks can be found in ``kallithea.lib.hooks``. @@ -541,6 +542,7 @@ To start the Celery process, run:: Make sure you run this command from the same virtualenv, and with the same user that Kallithea runs. + HTTPS support ------------- @@ -549,15 +551,19 @@ Kallithea will by default generate URLs Alternatively, you can use some special configuration settings to control directly which scheme/protocol Kallithea will use when generating URLs: -- With ``https_fixup = true``, the scheme will be taken from the ``HTTP_X_URL_SCHEME``, - ``HTTP_X_FORWARDED_SCHEME`` or ``HTTP_X_FORWARDED_PROTO HTTP`` header (default ``http``). +- With ``https_fixup = true``, the scheme will be taken from the + ``X-Url-Scheme``, ``X-Forwarded-Scheme`` or ``X-Forwarded-Proto`` HTTP header + (default ``http``). - With ``force_https = true`` the default will be ``https``. -- With ``use_htsts = true``, it will set ``Strict-Transport-Security`` when using https. +- With ``use_htsts = true``, Kallithea will set ``Strict-Transport-Security`` when using https. + Nginx virtual host example -------------------------- -Sample config for nginx using proxy:: +Sample config for Nginx using proxy: + +.. code-block:: nginx upstream kallithea { server 127.0.0.1:5000; @@ -643,15 +649,21 @@ pushes or large pushes:: Apache virtual host reverse proxy example ----------------------------------------- -Here is a sample configuration file for apache using proxy:: +Here is a sample configuration file for Apache using proxy: + +.. code-block:: apache ServerName hg.myserver.com ServerAlias hg.myserver.com - Order allow,deny - Allow from all + # For Apache 2.4 and later: + Require all granted + + # For Apache 2.2 and earlier, instead use: + # Order allow,deny + # Allow from all #important ! @@ -664,7 +676,6 @@ Here is a sample configuration file for #to enable https use line below #SetEnvIf X-Url-Scheme https HTTPS=1 - @@ -675,7 +686,9 @@ http://pylonsbook.com/en/1.1/deployment. Apache as subdirectory ---------------------- -Apache subdirectory part:: +Apache subdirectory part: + +.. code-block:: apache > ProxyPass http://127.0.0.1:5000/ @@ -697,7 +710,7 @@ Add the following at the end of the .ini then change ```` into your chosen prefix -Apache's WSGI config +Apache with mod_wsgi -------------------- Alternatively, Kallithea can be set up with Apache under mod_wsgi. For @@ -719,7 +732,10 @@ that, you'll need to: as in the following example. Once again, check the paths are correctly specified. -Here is a sample excerpt from an Apache Virtual Host configuration file:: +Here is a sample excerpt from an Apache Virtual Host configuration file: + + +.. code-block:: apache WSGIDaemonProcess kallithea \ processes=1 threads=4 \ @@ -727,7 +743,9 @@ Here is a sample excerpt from an Apache WSGIScriptAlias / /srv/kallithea/dispatch.wsgi WSGIPassAuthorization On -Or if using a dispatcher WSGI script with proper virtualenv activation:: +Or if using a dispatcher WSGI script with proper virtualenv activation: + +.. code-block:: apache WSGIDaemonProcess kallithea processes=1 threads=4 WSGIScriptAlias / /srv/kallithea/dispatch.wsgi @@ -744,7 +762,9 @@ Or if using a dispatcher WSGI script wit gets it's own cache invalidation key. -Example WSGI dispatch script:: +Example WSGI dispatch script: + +.. code-block:: python import os os.environ["HGENCODING"] = "UTF-8" @@ -762,10 +782,12 @@ Example WSGI dispatch script:: fileConfig('/srv/kallithea/my.ini') application = loadapp('config:/srv/kallithea/my.ini') -Or using proper virtualenv activation:: +Or using proper virtualenv activation: + +.. code-block:: python activate_this = '/srv/kallithea/venv/bin/activate_this.py' - execfile(activate_this,dict(__file__=activate_this)) + execfile(activate_this, dict(__file__=activate_this)) import os os.environ['HOME'] = '/srv/kallithea' @@ -780,8 +802,10 @@ Or using proper virtualenv activation:: Other configuration files ------------------------- -Some example init.d scripts can be found in the ``init.d`` directory: -https://kallithea-scm.org/repos/kallithea/files/tip/init.d/ . +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/ diff --git a/docs/usage/general.rst b/docs/usage/general.rst --- a/docs/usage/general.rst +++ b/docs/usage/general.rst @@ -5,7 +5,7 @@ General Kallithea usage ======================= -Repository deleting +Repository deletion ------------------- Currently when an admin or owner deletes a repository, Kallithea does @@ -13,7 +13,7 @@ not physically delete said repository fr renames it in a special way so that it is not possible to push, clone or access the repository. -There is a special command for cleaning up such archived repos:: +There is a special command for cleaning up such archived repositories:: paster cleanup-repos --older-than=30d my.ini @@ -70,17 +70,18 @@ Creating a pull request (and its ancestors) by selecting it and clicking the ``Open new pull request for selected changesets`` button. + 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://server.com/repo_name + http://example.com/repo_name would get a new URL after moving it to test_group:: - http://server.com/test_group/repo_name + http://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, @@ -92,15 +93,16 @@ such URLs. In the example, the repository could also be accessible as:: - http://server.com/_ + http://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``. + Email notifications ------------------- -When the administrator correctly specified the email settings in the Kallithea +With email settings properly configured in the Kallithea configuration file, Kallithea will send emails on user registration and when errors occur. @@ -151,10 +153,11 @@ features that merit further explanation. Repository extra fields ~~~~~~~~~~~~~~~~~~~~~~~ -In the `Visual` tab, there is an option `Use repository extra -fields`, which allows to set custom fields for each repository in the system. -Each new field consists of 3 attributes: ``field key``, ``field label``, -``field description``. +In the *Visual* tab, there is an option "Use repository extra +fields", which allows to set custom fields for each repository in the system. + +Once enabled site-wide, the custom fields can be edited per-repository under +*Options* | *Settings* | *Extra Fields*. Example usage of such fields would be to define company-specific information into repositories, e.g., defining a ``repo_manager`` key that would give info @@ -164,9 +167,9 @@ Newly created fields are accessible via Meta tagging ~~~~~~~~~~~~ -In the `Visual` tab, option `Stylify recognised meta tags` will cause Kallithea -to turn certain meta-tags, detected in repository and repository group -descriptions, into colored tags. Currently recognised tags are:: +In the *Visual* tab, option "Stylify recognised meta tags" will cause Kallithea +to turn certain text fragments in repository and repository group +descriptions into colored tags. Currently recognised tags are:: [featured] [stale] diff --git a/docs/usage/locking.rst b/docs/usage/locking.rst --- a/docs/usage/locking.rst +++ b/docs/usage/locking.rst @@ -4,24 +4,24 @@ Repository locking ================== -Kallithea has a ``repository locking`` feature, disabled by default. When +Kallithea has a *repository locking* feature, disabled by default. When enabled, every initial clone and every pull gives users (with write permission) the exclusive right to do a push. -When repository locking is enabled, repositories get a ``locked`` state that -can be true or false. The hg/git commands ``hg/git clone``, ``hg/git pull``, +When repository locking is enabled, repositories get a ``locked`` flag. +The hg/git commands ``hg/git clone``, ``hg/git pull``, and ``hg/git push`` influence this state: -- A ``clone`` or ``pull`` action on the repository locks it (``locked=true``) +- A ``clone`` or ``pull`` action locks the target repository if the user has write/admin permissions on this repository. - Kallithea will remember the user who locked the repository so only this - specific user can unlock the repo (``locked=false``) by performing a ``push`` + specific user can unlock the repo by performing a ``push`` command. - Every other command on a locked repository from this user and every command from any other user will result in an HTTP return code 423 (Locked). - Additionally, the HTTP error includes the that locked the repository + Additionally, the HTTP error will mention the user that locked the repository (e.g., “repository locked by user ”). Each repository can be manually unlocked by an administrator from the diff --git a/docs/usage/performance.rst b/docs/usage/performance.rst --- a/docs/usage/performance.rst +++ b/docs/usage/performance.rst @@ -9,12 +9,12 @@ performing slower than expected. Because amounts of data from version control systems, here are some tips on how to get the best performance. -* Kallithea will perform better on machines with faster disks (SSD/SAN). It's - more important to have a faster disk than a faster CPU. +* Kallithea is often I/O bound, and hence a fast disk (SSD/SAN) is + usually more important than a fast CPU. -* Slowness on initial page can be easily fixed by grouping repositories, and/or +* Sluggish loading of the front page can easily be fixed by grouping repositories or by increasing cache size (see below). This includes using the lightweight dashboard - option and ``vcs_full_cache`` setting in .ini file + option and ``vcs_full_cache`` setting in .ini file. Follow these few steps to improve performance of Kallithea system. @@ -25,18 +25,18 @@ 1. Increase cache Tweak beaker cache settings in the ini file. The actual effect of that is questionable. -2. Switch from sqlite to postgres or mysql +2. Switch from SQLite to PostgreSQL or MySQL - sqlite is a good option when having a small load on the system. But due to - locking issues with sqlite, it is not recommended to use it for larger - deployments. Switching to mysql or postgres will result in an immediate + SQLite is a good option when having a small load on the system. But due to + locking issues with SQLite, it is not recommended to use it for larger + deployments. Switching to MySQL or PostgreSQL will result in an immediate performance increase. A tool like SQLAlchemyGrate_ can be used for migrating to another database platform. 3. Scale Kallithea horizontally - Scaling horizontally can give huge performance increases when dealing with - large traffic (large amount of users, CI servers etc). Kallithea can be + Scaling horizontally can give huge performance benefits when dealing with + large amounts of traffic (many users, CI servers, etc.). Kallithea can be scaled horizontally on one (recommended) or multiple machines. In order to scale horizontally you need to do the following: diff --git a/docs/usage/statistics.rst b/docs/usage/statistics.rst --- a/docs/usage/statistics.rst +++ b/docs/usage/statistics.rst @@ -4,7 +4,7 @@ Repository statistics ===================== -Kallithea has a ``repository statistics`` feature, disabled by default. When +Kallithea has a *repository statistics* feature, disabled by default. When enabled, the amount of commits per committer is visualized in a timeline. This feature can be enabled using the ``Enable statistics`` checkbox on the repository ``Settings`` page. diff --git a/docs/usage/troubleshooting.rst b/docs/usage/troubleshooting.rst --- a/docs/usage/troubleshooting.rst +++ b/docs/usage/troubleshooting.rst @@ -1,5 +1,6 @@ .. _troubleshooting: + =============== Troubleshooting ===============