##// END OF EJS Templates
docs: spelling, grammar, content and typography
Søren Løvborg -
r5425:5ae8e644 default
parent child Browse files
Show More
@@ -21,6 +21,7 b' version control systems.'
21 21
22 22 Kallithea was forked from RhodeCode in July 2014 and has been heavily modified.
23 23
24
24 25 Installation
25 26 ------------
26 27 Kallithea requires Python_ 2.x and it is recommended to install it in a
@@ -29,7 +30,7 b' virtualenv_. Official releases of Kallit'
29 30 pip install kallithea
30 31
31 32 The development repository is kept very stable and used in production by the
32 developers - you can do the same.
33 developers -- you can do the same.
33 34
34 35 Please visit https://docs.kallithea-scm.org/en/latest/installation.html for
35 36 more details.
@@ -119,7 +120,7 b' Community'
119 120
120 121 Get in touch with the rest of the community:
121 122
122 - Join the mailing list users and developers - see
123 - Join the mailing list users and developers -- see
123 124 http://lists.sfconservancy.org/mailman/listinfo/kallithea-general.
124 125
125 126 - Use IRC and join #kallithea on FreeNode (irc.freenode.net) or use
@@ -198,6 +199,7 b' database, using the database string you '
198 199 If you started out using the branding interoperability approach mentioned
199 200 above, watch out for stray brand.pyc after removing brand.py.
200 201
202
201 203 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
202 204 .. _Python: http://www.python.org/
203 205 .. _Sphinx: http://sphinx.pocoo.org/
@@ -7,7 +7,7 b' API'
7 7
8 8 Kallithea has a simple JSON RPC API with a single schema for calling all API
9 9 methods. Everything is available by sending JSON encoded http(s) requests to
10 <your_server>/_admin/api .
10 ``<your_server>/_admin/api``.
11 11
12 12
13 13 API access for web views
@@ -16,12 +16,12 b' API access for web views'
16 16 API access can also be turned on for each web view in Kallithea that is
17 17 decorated with the ``@LoginRequired`` decorator. Some views use
18 18 ``@LoginRequired(api_access=True)`` and are always available. By default only
19 RSS/ATOM feed views are enabled. Other views are
19 RSS/Atom feed views are enabled. Other views are
20 20 only available if they have been white listed. Edit the
21 21 ``api_access_controllers_whitelist`` option in your .ini file and define views
22 22 that should have API access enabled.
23 23
24 For example, to enable API access to patch/diff raw file and archive::
24 For example, to enable API access to patch/diff, raw file and archive::
25 25
26 26 api_access_controllers_whitelist =
27 27 ChangesetController:changeset_patch,
@@ -33,7 +33,7 b' After this change, a Kallithea view can '
33 33 GET parameter ``?api_key=<api_key>`` to the URL.
34 34
35 35 Exposing raw diffs is a good way to integrate with
36 3rd party services like code review, or build farms that could download archives.
36 third-party services like code review, or build farms that can download archives.
37 37
38 38
39 39 API access
@@ -50,27 +50,28 b' Clients must send JSON encoded JSON-RPC '
50 50
51 51 For example, to pull to a local "CPython" mirror using curl::
52 52
53 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"}}'
53 curl https://example.com/_admin/api -X POST -H 'content-type:text/plain' \
54 --data-binary '{"id":1,"api_key":"xe7cdb2v278e4evbdf5vs04v832v0efvcbcve4a3","method":"pull","args":{"repo":"CPython"}}'
54 55
55 56 In general, provide
56 57 - *id*, a value of any type, can be used to match the response with the request that it is replying to.
57 58 - *api_key*, for authentication and permission validation.
58 - *method*, the name of the method to call - a list of available methods can be found below.
59 - *method*, the name of the method to call -- a list of available methods can be found below.
59 60 - *args*, the arguments to pass to the method.
60 61
61 62 .. note::
62 63
63 api_key can be found or set on the user account page
64 api_key can be found or set on the user account page.
64 65
65 66 The response to the JSON-RPC API call will always be a JSON structure::
66 67
67 68 {
68 69 "id":<id>, # the id that was used in the request
69 "result": "<result>"|null, # JSON formatted result, null if any errors
70 "error": "null"|<error_message> # JSON formatted error (if any)
70 "result": <result>|null, # JSON formatted result (null on error)
71 "error": null|<error_message> # JSON formatted error (null on success)
71 72 }
72 73
73 All responses from API will be ``HTTP/1.0 200 OK``. If there is an error,
74 All responses from the API will be ``HTTP/1.0 200 OK``. If an error occurs,
74 75 the reponse will have a failure description in *error* and
75 76 *result* will be null.
76 77
@@ -78,7 +79,7 b' the reponse will have a failure descript'
78 79 API client
79 80 ++++++++++
80 81
81 Kallithea comes with a ``kallithea-api`` command line tool providing a convenient
82 Kallithea comes with a ``kallithea-api`` command line tool, providing a convenient
82 83 way to call the JSON-RPC API.
83 84
84 85 For example, to call ``get_repo``::
@@ -106,7 +107,7 b' To avoid specifying ``apihost`` and ``ap'
106 107
107 108 kallithea-api --save-config --apihost=<your.kallithea.server.url> --apikey=<yourapikey>
108 109
109 This will create a ``~/.config/kallithea`` with the specified hostname and apikey
110 This will create a ``~/.config/kallithea`` with the specified hostname and API key
110 111 so you don't have to specify them every time.
111 112
112 113
@@ -332,6 +333,8 b' OUTPUT::'
332 333 error: null
333 334
334 335
336 .. _create-user:
337
335 338 create_user
336 339 -----------
337 340
@@ -375,6 +378,10 b' OUTPUT::'
375 378 }
376 379 error: null
377 380
381 Example::
382
383 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
384
378 385
379 386 update_user
380 387 -----------
@@ -4,6 +4,6 b''
4 4 Changelog
5 5 =========
6 6
7 Kallithea project doesn't keep its changelog here. We refer you to our Mercurial logs_ .
7 Kallithea project doesn't keep its changelog here. We refer you to our `Mercurial logs`__.
8 8
9 .. _logs: https://kallithea-scm.org/repos/kallithea/changelog
9 .. __: https://kallithea-scm.org/repos/kallithea/changelog
@@ -88,6 +88,7 b" exclude_patterns = ['_build']"
88 88
89 89 # The name of the Pygments (syntax highlighting) style to use.
90 90 pygments_style = 'sphinx'
91 highlight_language = 'none'
91 92
92 93 # A list of ignored prefixes for module index sorting.
93 94 #modindex_common_prefix = []
@@ -11,13 +11,13 b' your own itch.'
11 11 Infrastructure
12 12 --------------
13 13
14 The main repository is hosted at Our Own Kallithea (aka OOK) on
15 https://kallithea-scm.org/repos/kallithea/ (which is our self-hosted instance
16 of Kallithea).
14 The main repository is hosted on Our Own Kallithea (aka OOK) at
15 https://kallithea-scm.org/repos/kallithea/, our self-hosted instance
16 of Kallithea.
17 17
18 For now, we use Bitbucket_ for `Pull Requests`_ and `Issue Tracker`_ services. The
19 issue tracker is for tracking bugs, not for support, discussion, or ideas -
20 please use the `mailing list`_ to reach the community.
18 For now, we use Bitbucket_ for `pull requests`_ and `issue tracking`_. The
19 issue tracker is for tracking bugs, not for support, discussion, or ideas --
20 please use the `mailing list`_ or :ref:`IRC <readme>` to reach the community.
21 21
22 22 We use Weblate_ to translate the user interface messages into languages other
23 23 than English. Join our project on `Hosted Weblate`_ to help us.
@@ -48,7 +48,7 b' Running tests'
48 48
49 49 After finishing your changes make sure all tests pass cleanly. You can run
50 50 the testsuite running ``nosetests`` from the project root, or if you use tox
51 run ``tox`` for python2.6-2.7 with multiple database test.
51 run ``tox`` for Python 2.6--2.7 with multiple database test.
52 52
53 53 When running tests, Kallithea uses `kallithea/tests/test.ini` and populates the
54 54 SQLite database specified there.
@@ -90,22 +90,23 b' to the extent it is feasible, IE8 is not'
90 90
91 91 We primarily support Linux and OS X on the server side but Windows should also work.
92 92
93 Html templates should use 2 spaces for indentation ... but be pragmatic. We
93 HTML templates should use 2 spaces for indentation ... but be pragmatic. We
94 94 should use templates cleverly and avoid duplication. We should use reasonable
95 semantic markup with classes and ids that can be used for styling and testing.
95 semantic markup with element classes and IDs that can be used for styling and testing.
96 96 We should only use inline styles in places where it really is semantic (such as
97 display:none).
97 ``display: none``).
98 98
99 JavaScript must use ';' between/after statements. Indentation 4 spaces. Inline
100 multiline functions should be indented two levels - one for the () and one for
101 {}. jQuery value arrays should have a leading $.
99 JavaScript must use ``;`` between/after statements. Indentation 4 spaces. Inline
100 multiline functions should be indented two levels -- one for the ``()`` and one for
101 ``{}``.
102 Variables holding jQuery objects should be named with a leading ``$``.
102 103
103 104 Commit messages should have a leading short line summarizing the changes. For
104 bug fixes, put "(Issue #123)" at the end of this line.
105 bug fixes, put ``(Issue #123)`` at the end of this line.
105 106
106 Contributions will be accepted in most formats - such as pull requests on
107 Contributions will be accepted in most formats -- such as pull requests on
107 108 bitbucket, something hosted on your own Kallithea instance, or patches sent by
108 email to the kallithea-general mailing list.
109 email to the `kallithea-general`_ mailing list.
109 110
110 111 Make sure to test your changes both manually and with the automatic tests
111 112 before posting.
@@ -116,7 +117,7 b' might give feedback that requests polish'
116 117 changes when we apply them.
117 118
118 119 We try to make sure we have consensus on the direction the project is taking.
119 Everything non-sensitive should be discussed in public - preferably on the
120 Everything non-sensitive should be discussed in public -- preferably on the
120 121 mailing list. We aim at having all non-trivial changes reviewed by at least
121 122 one other core developer before pushing. Obvious non-controversial changes will
122 123 be handled more casually.
@@ -132,7 +133,7 b' elsewhere (for example in a pull request'
132 133 ---------
133 134
134 135 We do not have a road map but are waiting for your contributions. Refer to the
135 wiki_ for some ideas of places we might want to go - contributions in these
136 wiki_ for some ideas of places we might want to go -- contributions in these
136 137 areas are very welcome.
137 138
138 139
@@ -141,9 +142,10 b' Thank you for your contribution!'
141 142
142 143
143 144 .. _Weblate: http://weblate.org/
144 .. _Issue Tracker: https://bitbucket.org/conservancy/kallithea/issues?status=new&status=open
145 .. _Pull Requests: https://bitbucket.org/conservancy/kallithea/pull-requests
145 .. _issue tracking: https://bitbucket.org/conservancy/kallithea/issues?status=new&status=open
146 .. _pull requests: https://bitbucket.org/conservancy/kallithea/pull-requests
146 147 .. _bitbucket: http://bitbucket.org/
147 148 .. _mailing list: http://lists.sfconservancy.org/mailman/listinfo/kallithea-general
149 .. _kallithea-general: http://lists.sfconservancy.org/mailman/listinfo/kallithea-general
148 150 .. _Hosted Weblate: https://hosted.weblate.org/projects/kallithea/kallithea/
149 151 .. _wiki: https://bitbucket.org/conservancy/kallithea/wiki/Home
@@ -4,11 +4,12 b''
4 4 Installation on Unix/Linux
5 5 ==========================
6 6
7 Here are more details about 3 ways to install Kallithea:
7 The following describes three different ways of installing Kallithea:
8 8
9 9 - :ref:`installation-source`: The simplest way to keep the installation
10 uptodate and keep track of local customizations is to run directly from
11 source in a Kallithea repository clone and use virtualenv.
10 up-to-date and track any local customizations is to run directly from
11 source in a Kallithea repository clone, preferably inside a virtualenv
12 virtual Python environment.
12 13
13 14 - :ref:`installation-virtualenv`: If you prefer to only use released versions
14 15 of Kallithea, the recommended method is to install Kallithea in a virtual
@@ -30,7 +31,7 b' Here are more details about 3 ways to in'
30 31 Installation from repository source
31 32 -----------------------------------
32 33
33 To install Kallithea in a virtualenv using the stable branch of the development
34 To install Kallithea in a virtualenv_ using the stable branch of the development
34 35 repository, follow the instructions below::
35 36
36 37 hg clone https://kallithea-scm.org/repos/kallithea -u stable
@@ -21,7 +21,7 b' ISAPI-WSGI bridge module, e.g. isapi-wsg'
21 21 Installation
22 22 ------------
23 23
24 The following will assume that your Kallithea is at ``c:\inetpub\kallithea`` and
24 The following assumes that your Kallithea is at ``c:\inetpub\kallithea``, and
25 25 will be served from the root of its own website. The changes to serve it in its
26 26 own virtual folder will be noted where appropriate.
27 27
@@ -32,15 +32,15 b' Make sure that there is a unique applica'
32 32 with an identity that has read access to the Kallithea distribution.
33 33
34 34 The application pool does not need to be able to run any managed code. If you
35 are using a 32-bit Python installation, then you must enable 32 bit program in
36 the advanced settings for the application pool otherwise Python will not be able
37 to run on the website and consequently, Kallithea will not be able to run.
35 are using a 32-bit Python installation, then you must enable 32-bit program in
36 the advanced settings for the application pool; otherwise Python will not be able
37 to run on the website and neither will Kallithea.
38 38
39 39 .. note::
40 40
41 The application pool can be the same as an existing application pool as long
42 as the requirements to Kallithea are enabled by the existing application
43 pool.
41 The application pool can be the same as an existing application pool,
42 as long as the Kallithea requirements are met by the existing pool.
43
44 44
45 45 ISAPI handler
46 46 .............
@@ -7,17 +7,17 b' Installation and upgrade on Windows (XP/'
7 7 First-time install
8 8 ::::::::::::::::::
9 9
10 Target OS: Windows XP SP3 32bit English (Clean installation)
10 Target OS: Windows XP SP3 32-bit English (Clean installation)
11 11 + All Windows Updates until 24-may-2012
12 12
13 13 .. note::
14 14
15 This installation is for 32bit systems, for 64bit windows you might need
16 to download proper 64bit versions of the different packages(Windows Installer, Win32py extensions)
15 This installation is for 32-bit systems, for 64-bit Windows you might need
16 to download proper 64-bit versions of the different packages (Windows Installer, Win32py extensions)
17 17 plus some extra tweaks.
18 These extra steps haven been marked as "64bit".
18 These extra steps haven been marked as "64-bit".
19 19 Tested on Windows Server 2008 R2 SP1, 9-feb-2013.
20 If you run into any 64bit related problems, please check these pages:
20 If you run into any 64-bit related problems, please check these pages:
21 21 - http://blog.victorjabur.com/2011/06/05/compiling-python-2-7-modules-on-windows-32-and-64-using-msvc-2008-express/
22 22 - http://bugs.python.org/issue7511
23 23
@@ -47,34 +47,35 b' choose "Visual C++ 2008 Express" when in'
47 47
48 48 .. note::
49 49
50 64bit: You also need to install the Microsoft Windows SDK for .NET 3.5 SP1 (.NET 4.0 won't work).
50 64-bit: You also need to install the Microsoft Windows SDK for .NET 3.5 SP1 (.NET 4.0 won't work).
51 51 Download from: http://www.microsoft.com/en-us/download/details.aspx?id=3138
52 52
53 53 .. note::
54 54
55 64bit: You also need to copy and rename a .bat file to make the Visual C++ compiler work.
56 I am not sure why this is not necessary for 32bit.
55 64-bit: You also need to copy and rename a .bat file to make the Visual C++ compiler work.
56 I am not sure why this is not necessary for 32-bit.
57 57 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
58 58
59 59
60 Step 2 - Install Python
61 -----------------------
60 Step 2 -- Install Python
61 ------------------------
62 62
63 Install Python 2.x.y (x = 6 or 7) x86 version (32bit). DO NOT USE A 3.x version.
63 Install Python 2.x.y (x = 6 or 7) x86 version (32-bit). DO NOT USE A 3.x version.
64 64 Download Python 2.x.y from:
65 65 http://www.python.org/download/
66 66
67 Choose "Windows Installer" (32bit version) not "Windows X86-64
67 Choose "Windows Installer" (32-bit version) not "Windows X86-64
68 68 Installer". While writing this guide, the latest version was v2.7.3.
69 69 Remember the specific major and minor version installed, because it will
70 70 be needed in the next step. In this case, it is "2.7".
71 71
72 72 .. note::
73 73
74 64bit: Just download and install the 64bit version of python.
74 64-bit: Just download and install the 64-bit version of python.
75
75 76
76 Step 3 - Install Win32py extensions
77 -----------------------------------
77 Step 3 -- Install Win32py extensions
78 ------------------------------------
78 79
79 80 Download pywin32 from:
80 81 http://sourceforge.net/projects/pywin32/files/
@@ -88,12 +89,13 b' http://sourceforge.net/projects/pywin32/'
88 89
89 90 .. note::
90 91
91 64bit: Download and install the 64bit version.
92 64-bit: Download and install the 64-bit version.
92 93 At the time of writing you can find this at:
93 94 http://sourceforge.net/projects/pywin32/files/pywin32/Build%20218/pywin32-218.win-amd64-py2.7.exe/download
94 95
95 Step 4 - Python BIN
96 -------------------
96
97 Step 4 -- Python BIN
98 --------------------
97 99
98 100 Add Python BIN folder to the path
99 101
@@ -120,8 +122,8 b' that came preinstalled in Vista/7 and ca'
120 122 Typically: C:\\Python27
121 123
122 124
123 Step 5 - Kallithea folder structure
124 -----------------------------------
125 Step 5 -- Kallithea folder structure
126 ------------------------------------
125 127
126 128 Create a Kallithea folder structure
127 129
@@ -138,8 +140,8 b' Create the following folder structure::'
138 140 C:\Kallithea\Repos
139 141
140 142
141 Step 6 - Install virtualenv
142 ---------------------------
143 Step 6 -- Install virtualenv
144 ----------------------------
143 145
144 146 Install Virtual Env for Python
145 147
@@ -159,8 +161,8 b' where you downloaded "virtualenv.py", an'
159 161 to include it)
160 162
161 163
162 Step 7 - Install Kallithea
163 --------------------------
164 Step 7 -- Install Kallithea
165 ---------------------------
164 166
165 167 Finally, install Kallithea
166 168
@@ -171,7 +173,7 b' Command Prompt (**IMPORTANT!!**). To do '
171 173
172 174 .. note::
173 175
174 64bit: For 64bit you need to modify the shortcut that is used to start the
176 64-bit: For 64-bit you need to modify the shortcut that is used to start the
175 177 Visual Studio 2008 Command Prompt. Use right-mouse click to open properties.
176 178
177 179 Change commandline from::
@@ -198,9 +200,8 b' The prompt will change into "(Env) C:\\\\K'
198 200 Some warnings will appear, don't worry as they are normal.
199 201
200 202
201 Step 8 - Configuring Kallithea
202 ------------------------------
203
203 Step 8 -- Configuring Kallithea
204 -------------------------------
204 205
205 206 steps taken from http://packages.python.org/Kallithea/setup.html
206 207
@@ -238,8 +239,8 b' If you make some mistake and the script '
238 239 it again.
239 240
240 241
241 Step 9 - Running Kallithea
242 --------------------------
242 Step 9 -- Running Kallithea
243 ---------------------------
243 244
244 245
245 246 In the previous command prompt, being in the C:\\Kallithea\\Bin folder,
@@ -14,7 +14,7 b' following command to do so::'
14 14 paster make-config Kallithea my.ini
15 15
16 16 This will create the file ``my.ini`` in the current directory. This
17 configuration file contains the various settings for Kallithea, e.g.,
17 configuration file contains the various settings for Kallithea, e.g.
18 18 proxy port, email settings, usage of static files, cache, Celery
19 19 settings, and logging.
20 20
@@ -34,12 +34,13 b' entering this "root" path ``setup-db`` w'
34 34 and password for the initial admin account which ``setup-db`` sets
35 35 up for you.
36 36
37 The setup process can be fully automated, example for lazy::
37 The ``setup-db`` values can also be given on the command line.
38 Example::
38 39
39 paster setup-db my.ini --user=nn --password=secret --email=nn@your.kallithea.server --repos=/srv/repos
40 paster setup-db my.ini --user=nn --password=secret --email=nn@example.org --repos=/srv/repos
40 41
41 42
42 The ``setup-db`` command will create all of the needed tables and an
43 The ``setup-db`` command will create all needed tables and an
43 44 admin account. When choosing a root path you can either use a new
44 45 empty location, or a location which already contains existing
45 46 repositories. If you choose a location which contains existing
@@ -58,22 +59,22 b' You are now ready to use Kallithea. To r'
58 59 paster serve my.ini
59 60
60 61 - This command runs the Kallithea server. The web app should be available at
61 http://127.0.0.1:5000. This ip and port is configurable via the my.ini
62 file created in previous step
63 - Use the admin account you created above when running ``setup-db``
64 to login to the web app.
62 http://127.0.0.1:5000. The IP address and port is configurable via the
63 configuration file created in the previous step.
64 - Log in to Kallithea using the admin account created when running ``setup-db``.
65 65 - The default permissions on each repository is read, and the owner is admin.
66 66 Remember to update these if needed.
67 67 - In the admin panel you can toggle LDAP, anonymous, and permissions
68 68 settings, as well as edit more advanced options on users and
69 repositories
69 repositories.
70 70
71 71
72 72 Extensions
73 73 ----------
74 74
75 Optionally users can create an ``rcextensions`` package that extends Kallithea
76 functionality. To do this simply execute::
75 Optionally one can create an ``rcextensions`` package that extends Kallithea
76 functionality.
77 To generate a skeleton extensions package, run::
77 78
78 79 paster make-rcext my.ini
79 80
@@ -123,45 +124,38 b' authentication is fully supported.'
123 124 Setting up Whoosh full text search
124 125 ----------------------------------
125 126
126 The whoosh index can be built by using the paster
127 command ``make-index``. To use ``make-index`` you must specify the configuration
128 file that stores the location of the index. You may specify the location of the
129 repositories (``--repo-location``). If not specified, this value is retrieved
130 from the Kallithea database.
131 It is also possible to specify a comma separated list of
132 repositories (``--index-only``) to build index only on chooses repositories
133 skipping any other found in repos location
127 Kallithea provides full text search of repositories using `Whoosh`__.
134 128
135 You may optionally pass the option ``-f`` to enable a full index rebuild. Without
136 the ``-f`` option, indexing will run always in "incremental" mode.
129 .. __: https://pythonhosted.org/Whoosh/
137 130
138 For an incremental index build use::
131 For an incremental index build, run::
139 132
140 133 paster make-index my.ini
141 134
142 For a full index rebuild use::
135 For a full index rebuild, run::
143 136
144 137 paster make-index my.ini -f
145 138
139 The ``--repo-location`` option allows the location of the repositories to be overriden;
140 usually, the location is retrieved from the Kallithea database.
146 141
147 Building an index for just selected repositories is possible with such command::
142 The ``--index-only`` option can be used to limit the indexed repositories to a comma-separated list::
148 143
149 144 paster make-index my.ini --index-only=vcs,kallithea
150 145
151 146
152 In order to do periodic index builds and keep your index always up to
153 date, it is recommended to use a crontab entry. An example entry
154 might look like this::
147 To keep your index up-to-date it is necessary to do periodic index builds;
148 for this, it is recommended to use a crontab entry. Example::
155 149
156 /path/to/python/bin/paster make-index /path/to/kallithea/my.ini
150 0 3 * * * /path/to/virtualenv/bin/paster make-index /path/to/kallithea/my.ini
157 151
158 When using incremental mode (the default) whoosh will check the last
152 When using incremental mode (the default), Whoosh will check the last
159 153 modification date of each file and add it to be reindexed if a newer file is
160 154 available. The indexing daemon checks for any removed files and removes them
161 155 from index.
162 156
163 157 If you want to rebuild the index from scratch, you can use the ``-f`` flag as above,
164 or in the admin panel you can check the "build from scratch" flag.
158 or in the admin panel you can check the "build from scratch" checkbox.
165 159
166 160
167 161 Setting up LDAP support
@@ -169,7 +163,7 b' Setting up LDAP support'
169 163
170 164 Kallithea supports LDAP authentication. In order
171 165 to use LDAP, you have to install the python-ldap_ package. This package is
172 available via pypi, so you can install it by running::
166 available via PyPI, so you can install it by running::
173 167
174 168 pip install python-ldap
175 169
@@ -378,15 +372,16 b' of users to its WSGI container, or to a '
378 372 clients access the application.
379 373
380 374 When these authentication methods are enabled in Kallithea, it uses the
381 username that the container/proxy (Apache/Nginx/etc) authenticated and doesn't
375 username that the container/proxy (Apache or Nginx, etc.) provides and doesn't
382 376 perform the authentication itself. The authorization, however, is still done by
383 377 Kallithea according to its settings.
384 378
385 379 When a user logs in for the first time using these authentication methods,
386 380 a matching user account is created in Kallithea with default permissions. An
387 381 administrator can then modify it using Kallithea's admin interface.
382
388 383 It's also possible for an administrator to create accounts and configure their
389 permissions before the user logs in for the first time.
384 permissions before the user logs in for the first time, using the :ref:`create-user` API.
390 385
391 386
392 387 Container-based authentication
@@ -395,7 +390,7 b' Container-based authentication'
395 390 In a container-based authentication setup, Kallithea reads the user name from
396 391 the ``REMOTE_USER`` server variable provided by the WSGI container.
397 392
398 After setting up your container (see `Apache's WSGI config`_), you'd need
393 After setting up your container (see `Apache with mod_wsgi`_), you'll need
399 394 to configure it to require authentication on the location configured for
400 395 Kallithea.
401 396
@@ -408,22 +403,24 b' from the ``X-Forwarded-User`` request he'
408 403 sent by the reverse-proxy server.
409 404
410 405 After setting up your proxy solution (see `Apache virtual host reverse proxy example`_,
411 `Apache as subdirectory`_ or `Nginx virtual host example`_), you'd need to
406 `Apache as subdirectory`_ or `Nginx virtual host example`_), you'll need to
412 407 configure the authentication and add the username in a request header named
413 408 ``X-Forwarded-User``.
414 409
415 410 For example, the following config section for Apache sets a subdirectory in a
416 reverse-proxy setup with basic auth::
411 reverse-proxy setup with basic auth:
412
413 .. code-block:: apache
417 414
418 <Location /<someprefix> >
419 ProxyPass http://127.0.0.1:5000/<someprefix>
420 ProxyPassReverse http://127.0.0.1:5000/<someprefix>
415 <Location /someprefix>
416 ProxyPass http://127.0.0.1:5000/someprefix
417 ProxyPassReverse http://127.0.0.1:5000/someprefix
421 418 SetEnvIf X-Url-Scheme https HTTPS=1
422 419
423 420 AuthType Basic
424 421 AuthName "Kallithea authentication"
425 422 AuthUserFile /srv/kallithea/.htpasswd
426 require valid-user
423 Require valid-user
427 424
428 425 RequestHeader unset X-Forwarded-User
429 426
@@ -445,8 +442,8 b' Integration with issue trackers'
445 442 -------------------------------
446 443
447 444 Kallithea provides a simple integration with issue trackers. It's possible
448 to define a regular expression that will fetch an issue id stored in a commit
449 messages and replace that with a URL to the issue. To enable this simply
445 to define a regular expression that will match an issue ID in commit messages,
446 and have that replaced with a URL to the issue. To enable this simply
450 447 uncomment the following variables in the ini file::
451 448
452 449 issue_pat = (?:^#|\s#)(\w+)
@@ -459,12 +456,14 b' parentheses should be used to specify th'
459 456
460 457 The default expression matches issues in the format ``#<number>``, e.g., ``#300``.
461 458
462 Matched issues are replaced with the link specified as
463 ``issue_server_link`` ``{id}`` is replaced with issue id, and
459 Matched issue references are replaced with the link specified in
460 ``issue_server_link``. ``{id}`` is replaced with the issue ID, and
464 461 ``{repo}`` with the repository name. Since the # is stripped away,
465 462 ``issue_prefix`` is prepended to the link text. ``issue_prefix`` doesn't
466 463 necessarily need to be ``#``: if you set issue prefix to ``ISSUE-`` this will
467 generate a URL in the format::
464 generate a URL in the format:
465
466 .. code-block:: html
468 467
469 468 <a href="https://myissueserver.com/example_repo/issue/300">ISSUE-300</a>
470 469
@@ -476,7 +475,9 b' the variables. For example::'
476 475 issue_prefix_wiki = WIKI-
477 476
478 477 With these settings, wiki pages can be referenced as wiki-some-id, and every
479 such reference will be transformed into::
478 such reference will be transformed into:
479
480 .. code-block:: html
480 481
481 482 <a href="https://mywiki.com/some-id">WIKI-some-id</a>
482 483
@@ -488,10 +489,10 b' Hooks can be managed in similar way to t'
488 489 To access hooks setting click `advanced setup` in the `Hooks` section
489 490 of Mercurial Settings in Admin.
490 491
491 There are four built in hooks that cannot be changed (only enabled/disabled by
492 checkboxes in the previous section).
493 To add another custom hook simply fill in the first section with
494 ``<name>.<hook_type>`` and the second one with hook path. Example hooks
492 The built-in hooks cannot be modified, though they can be enabled or disabled in the *VCS* section.
493
494 To add another custom hook simply fill in the first textbox with
495 ``<name>.<hook_type>`` and the second with the hook path. Example hooks
495 496 can be found in ``kallithea.lib.hooks``.
496 497
497 498
@@ -541,6 +542,7 b' To start the Celery process, run::'
541 542 Make sure you run this command from the same virtualenv, and with the same
542 543 user that Kallithea runs.
543 544
545
544 546 HTTPS support
545 547 -------------
546 548
@@ -549,15 +551,19 b' Kallithea will by default generate URLs '
549 551 Alternatively, you can use some special configuration settings to control
550 552 directly which scheme/protocol Kallithea will use when generating URLs:
551 553
552 - With ``https_fixup = true``, the scheme will be taken from the ``HTTP_X_URL_SCHEME``,
553 ``HTTP_X_FORWARDED_SCHEME`` or ``HTTP_X_FORWARDED_PROTO HTTP`` header (default ``http``).
554 - With ``https_fixup = true``, the scheme will be taken from the
555 ``X-Url-Scheme``, ``X-Forwarded-Scheme`` or ``X-Forwarded-Proto`` HTTP header
556 (default ``http``).
554 557 - With ``force_https = true`` the default will be ``https``.
555 - With ``use_htsts = true``, it will set ``Strict-Transport-Security`` when using https.
558 - With ``use_htsts = true``, Kallithea will set ``Strict-Transport-Security`` when using https.
559
556 560
557 561 Nginx virtual host example
558 562 --------------------------
559 563
560 Sample config for nginx using proxy::
564 Sample config for Nginx using proxy:
565
566 .. code-block:: nginx
561 567
562 568 upstream kallithea {
563 569 server 127.0.0.1:5000;
@@ -643,15 +649,21 b' pushes or large pushes::'
643 649 Apache virtual host reverse proxy example
644 650 -----------------------------------------
645 651
646 Here is a sample configuration file for apache using proxy::
652 Here is a sample configuration file for Apache using proxy:
653
654 .. code-block:: apache
647 655
648 656 <VirtualHost *:80>
649 657 ServerName hg.myserver.com
650 658 ServerAlias hg.myserver.com
651 659
652 660 <Proxy *>
653 Order allow,deny
654 Allow from all
661 # For Apache 2.4 and later:
662 Require all granted
663
664 # For Apache 2.2 and earlier, instead use:
665 # Order allow,deny
666 # Allow from all
655 667 </Proxy>
656 668
657 669 #important !
@@ -664,7 +676,6 b' Here is a sample configuration file for '
664 676
665 677 #to enable https use line below
666 678 #SetEnvIf X-Url-Scheme https HTTPS=1
667
668 679 </VirtualHost>
669 680
670 681
@@ -675,7 +686,9 b' http://pylonsbook.com/en/1.1/deployment.'
675 686 Apache as subdirectory
676 687 ----------------------
677 688
678 Apache subdirectory part::
689 Apache subdirectory part:
690
691 .. code-block:: apache
679 692
680 693 <Location /<someprefix> >
681 694 ProxyPass http://127.0.0.1:5000/<someprefix>
@@ -697,7 +710,7 b' Add the following at the end of the .ini'
697 710
698 711 then change ``<someprefix>`` into your chosen prefix
699 712
700 Apache's WSGI config
713 Apache with mod_wsgi
701 714 --------------------
702 715
703 716 Alternatively, Kallithea can be set up with Apache under mod_wsgi. For
@@ -719,7 +732,10 b" that, you'll need to:"
719 732 as in the following example. Once again, check the paths are
720 733 correctly specified.
721 734
722 Here is a sample excerpt from an Apache Virtual Host configuration file::
735 Here is a sample excerpt from an Apache Virtual Host configuration file:
736
737
738 .. code-block:: apache
723 739
724 740 WSGIDaemonProcess kallithea \
725 741 processes=1 threads=4 \
@@ -727,7 +743,9 b' Here is a sample excerpt from an Apache '
727 743 WSGIScriptAlias / /srv/kallithea/dispatch.wsgi
728 744 WSGIPassAuthorization On
729 745
730 Or if using a dispatcher WSGI script with proper virtualenv activation::
746 Or if using a dispatcher WSGI script with proper virtualenv activation:
747
748 .. code-block:: apache
731 749
732 750 WSGIDaemonProcess kallithea processes=1 threads=4
733 751 WSGIScriptAlias / /srv/kallithea/dispatch.wsgi
@@ -744,7 +762,9 b' Or if using a dispatcher WSGI script wit'
744 762 gets it's own cache invalidation key.
745 763
746 764
747 Example WSGI dispatch script::
765 Example WSGI dispatch script:
766
767 .. code-block:: python
748 768
749 769 import os
750 770 os.environ["HGENCODING"] = "UTF-8"
@@ -762,7 +782,9 b' Example WSGI dispatch script::'
762 782 fileConfig('/srv/kallithea/my.ini')
763 783 application = loadapp('config:/srv/kallithea/my.ini')
764 784
765 Or using proper virtualenv activation::
785 Or using proper virtualenv activation:
786
787 .. code-block:: python
766 788
767 789 activate_this = '/srv/kallithea/venv/bin/activate_this.py'
768 790 execfile(activate_this,dict(__file__=activate_this))
@@ -780,8 +802,10 b' Or using proper virtualenv activation::'
780 802 Other configuration files
781 803 -------------------------
782 804
783 Some example init.d scripts can be found in the ``init.d`` directory:
784 https://kallithea-scm.org/repos/kallithea/files/tip/init.d/ .
805 A number of `example init.d scripts`__ can be found in
806 the ``init.d`` directory of the Kallithea source.
807
808 .. __: https://kallithea-scm.org/repos/kallithea/files/tip/init.d/ .
785 809
786 810 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
787 811 .. _python: http://www.python.org/
@@ -5,7 +5,7 b' General Kallithea usage'
5 5 =======================
6 6
7 7
8 Repository deleting
8 Repository deletion
9 9 -------------------
10 10
11 11 Currently when an admin or owner deletes a repository, Kallithea does
@@ -13,7 +13,7 b' not physically delete said repository fr'
13 13 renames it in a special way so that it is not possible to push, clone
14 14 or access the repository.
15 15
16 There is a special command for cleaning up such archived repos::
16 There is a special command for cleaning up such archived repositories::
17 17
18 18 paster cleanup-repos --older-than=30d my.ini
19 19
@@ -70,17 +70,18 b' Creating a pull request'
70 70 (and its ancestors) by selecting it and clicking the ``Open new pull request
71 71 for selected changesets`` button.
72 72
73
73 74 Permanent repository URLs
74 75 -------------------------
75 76
76 77 Due to the complicated nature of repository grouping, URLs of repositories
77 78 can often change. For example, a repository originally accessible from::
78 79
79 http://server.com/repo_name
80 http://example.com/repo_name
80 81
81 82 would get a new URL after moving it to test_group::
82 83
83 http://server.com/test_group/repo_name
84 http://example.com/test_group/repo_name
84 85
85 86 Such moving of a repository to a group can be an issue for build systems and
86 87 other scripts where the repository paths are hardcoded. To mitigate this,
@@ -92,15 +93,16 b' such URLs.'
92 93
93 94 In the example, the repository could also be accessible as::
94 95
95 http://server.com/_<ID>
96 http://example.com/_<ID>
96 97
97 98 The ID of a given repository can be shown from the repository ``Summary`` page,
98 99 by selecting the ``Show by ID`` button next to ``Clone URL``.
99 100
101
100 102 Email notifications
101 103 -------------------
102 104
103 When the administrator correctly specified the email settings in the Kallithea
105 With email settings properly configured in the Kallithea
104 106 configuration file, Kallithea will send emails on user registration and when
105 107 errors occur.
106 108
@@ -151,10 +153,11 b' features that merit further explanation.'
151 153 Repository extra fields
152 154 ~~~~~~~~~~~~~~~~~~~~~~~
153 155
154 In the `Visual` tab, there is an option `Use repository extra
155 fields`, which allows to set custom fields for each repository in the system.
156 Each new field consists of 3 attributes: ``field key``, ``field label``,
157 ``field description``.
156 In the *Visual* tab, there is an option "Use repository extra
157 fields", which allows to set custom fields for each repository in the system.
158
159 Once enabled site-wide, the custom fields can be edited per-repository under
160 *Options* | *Settings* | *Extra Fields*.
158 161
159 162 Example usage of such fields would be to define company-specific information
160 163 into repositories, e.g., defining a ``repo_manager`` key that would give info
@@ -164,9 +167,9 b' Newly created fields are accessible via '
164 167 Meta tagging
165 168 ~~~~~~~~~~~~
166 169
167 In the `Visual` tab, option `Stylify recognised meta tags` will cause Kallithea
168 to turn certain meta-tags, detected in repository and repository group
169 descriptions, into colored tags. Currently recognised tags are::
170 In the *Visual* tab, option "Stylify recognised meta tags" will cause Kallithea
171 to turn certain text fragments in repository and repository group
172 descriptions into colored tags. Currently recognised tags are::
170 173
171 174 [featured]
172 175 [stale]
@@ -4,24 +4,24 b''
4 4 Repository locking
5 5 ==================
6 6
7 Kallithea has a ``repository locking`` feature, disabled by default. When
7 Kallithea has a *repository locking* feature, disabled by default. When
8 8 enabled, every initial clone and every pull gives users (with write permission)
9 9 the exclusive right to do a push.
10 10
11 When repository locking is enabled, repositories get a ``locked`` state that
12 can be true or false. The hg/git commands ``hg/git clone``, ``hg/git pull``,
11 When repository locking is enabled, repositories get a ``locked`` flag.
12 The hg/git commands ``hg/git clone``, ``hg/git pull``,
13 13 and ``hg/git push`` influence this state:
14 14
15 - A ``clone`` or ``pull`` action on the repository locks it (``locked=true``)
15 - A ``clone`` or ``pull`` action locks the target repository
16 16 if the user has write/admin permissions on this repository.
17 17
18 18 - Kallithea will remember the user who locked the repository so only this
19 specific user can unlock the repo (``locked=false``) by performing a ``push``
19 specific user can unlock the repo by performing a ``push``
20 20 command.
21 21
22 22 - Every other command on a locked repository from this user and every command
23 23 from any other user will result in an HTTP return code 423 (Locked).
24 Additionally, the HTTP error includes the <user> that locked the repository
24 Additionally, the HTTP error will mention the user that locked the repository
25 25 (e.g., “repository <repo> locked by user <user>”).
26 26
27 27 Each repository can be manually unlocked by an administrator from the
@@ -9,12 +9,12 b' performing slower than expected. Because'
9 9 amounts of data from version control systems, here are some tips on how to get
10 10 the best performance.
11 11
12 * Kallithea will perform better on machines with faster disks (SSD/SAN). It's
13 more important to have a faster disk than a faster CPU.
12 * Kallithea is often I/O bound, and hence a fast disk (SSD/SAN) is
13 usually more important than a fast CPU.
14 14
15 * Slowness on initial page can be easily fixed by grouping repositories, and/or
15 * Sluggish loading of the front page can easily be fixed by grouping repositories or by
16 16 increasing cache size (see below). This includes using the lightweight dashboard
17 option and ``vcs_full_cache`` setting in .ini file
17 option and ``vcs_full_cache`` setting in .ini file.
18 18
19 19
20 20 Follow these few steps to improve performance of Kallithea system.
@@ -25,18 +25,18 b' 1. Increase cache'
25 25 Tweak beaker cache settings in the ini file. The actual effect of that
26 26 is questionable.
27 27
28 2. Switch from sqlite to postgres or mysql
28 2. Switch from SQLite to PostgreSQL or MySQL
29 29
30 sqlite is a good option when having a small load on the system. But due to
31 locking issues with sqlite, it is not recommended to use it for larger
32 deployments. Switching to mysql or postgres will result in an immediate
30 SQLite is a good option when having a small load on the system. But due to
31 locking issues with SQLite, it is not recommended to use it for larger
32 deployments. Switching to MySQL or PostgreSQL will result in an immediate
33 33 performance increase. A tool like SQLAlchemyGrate_ can be used for
34 34 migrating to another database platform.
35 35
36 36 3. Scale Kallithea horizontally
37 37
38 Scaling horizontally can give huge performance increases when dealing with
39 large traffic (large amount of users, CI servers etc). Kallithea can be
38 Scaling horizontally can give huge performance benefits when dealing with
39 large amounts of traffic (many users, CI servers, etc.). Kallithea can be
40 40 scaled horizontally on one (recommended) or multiple machines. In order
41 41 to scale horizontally you need to do the following:
42 42
@@ -4,7 +4,7 b''
4 4 Repository statistics
5 5 =====================
6 6
7 Kallithea has a ``repository statistics`` feature, disabled by default. When
7 Kallithea has a *repository statistics* feature, disabled by default. When
8 8 enabled, the amount of commits per committer is visualized in a timeline. This
9 9 feature can be enabled using the ``Enable statistics`` checkbox on the
10 10 repository ``Settings`` page.
@@ -1,5 +1,6 b''
1 1 .. _troubleshooting:
2 2
3
3 4 ===============
4 5 Troubleshooting
5 6 ===============
General Comments 0
You need to be logged in to leave comments. Login now