##// END OF EJS Templates
docs: rework stuff...
Mads Kiilerich -
r4902:03bbd33b default
parent child Browse files
Show More
@@ -0,0 +1,3 b''
1 .. _readme:
2
3 .. include:: ./../README.rst
@@ -0,0 +1,37 b''
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <svg xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" enable-background="new 0 0 163 30" xml:space="preserve" height="30" viewBox="0 0 140 30" width="140" version="1.1" y="0px" x="0px">
3 <metadata>
4 <rdf:RDF>
5 <cc:Work rdf:about="">
6 <dc:format>image/svg+xml</dc:format>
7 <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
8 <dc:title/>
9 </cc:Work>
10 </rdf:RDF>
11 </metadata>
12 <g display="none">
13 <rect display="inline" height="163" width="256" y="-66.5" x="-24" fill="#404c2c"/>
14 </g>
15 <g transform="matrix(.83 0 0 1 5.6391 0)">
16 <g fill="#b1d579">
17 <path d="m26.04 25.875v-20.64l5.451-0.473v21.113h-5.451zm17.215 0h-6.141l-5.451-8.066 5.589-6.704h5.555l-5.555 6.481 6.003 8.289z"/>
18 <path d="m58.951 21.592c0 1.141 0.379 1.557 1.242 1.809l-1.138 2.865c-2.174-0.141-3.588-0.668-4.416-2.143-1.311 1.641-3.347 2.225-5.52 2.225-3.657 0-5.969-1.918-5.969-4.617 0-3.227 3.036-4.979 8.59-4.979h1.863v-0.641c0-1.751-0.862-2.28-3.105-2.28-1.173 0-2.967 0.278-4.795 0.779l-1.242-2.893c2.312-0.695 4.83-1.085 6.9-1.085 5.313 0 7.59 1.808 7.59 5.229v5.731zm-5.347 0.194v-2.614h-1.346c-2.484 0-3.691 0.695-3.691 2.169 0 1.169 0.793 1.864 2.139 1.864 1.276 0 2.242-0.529 2.898-1.419z"/>
19 <path d="m68.057 21.73c0 0.834 0.345 1.141 0.932 1.141 0.276 0 0.655-0.057 0.897-0.139l1.069 3.115c-0.931 0.305-2.242 0.5-3.519 0.5-3.036 0-4.83-1.447-4.83-4.173v-16.939l5.451-0.473v16.968z"/>
20 <path d="m77.785 21.73c0 0.834 0.345 1.141 0.932 1.141 0.276 0 0.655-0.057 0.897-0.139l1.069 3.115c-0.931 0.305-2.242 0.5-3.519 0.5-3.036 0-4.83-1.447-4.83-4.173v-16.939l5.451-0.473v16.968z"/>
21 <path d="m88.169 5.819c0 1.418-1.346 2.503-3.243 2.503-1.896 0-3.208-1.085-3.208-2.503 0-1.419 1.312-2.504 3.208-2.504 1.897 0 3.243 1.085 3.243 2.504zm-5.935 20.056v-14.771h5.451v14.771h-5.451z"/>
22 <path d="m102.93 25.18c-1.379 0.779-3.312 1.168-4.968 1.168-4.036-0.027-6.003-1.863-6.003-5.341v-6.843h-2.588v-3.06h2.588v-3.199l5.451-0.5v3.7h4.209l-0.587 3.06h-3.622v6.787c0 1.419 0.586 1.92 1.725 1.92 0.621 0 1.242-0.14 1.967-0.501l1.828 2.809z"/>
23 <path d="m120.04 15.082v10.793h-5.45v-10.042c0-1.558-0.691-1.975-1.726-1.975-1.208 0-2.208 0.695-3.175 1.892v10.125h-5.45v-20.64l5.45-0.445v7.9c1.483-1.363 3.141-2.059 5.279-2.059 3.174 0 5.072 1.641 5.072 4.451z"/>
24 <path d="m139.5 19.783h-11.35c0.379 2.643 1.932 3.365 4.174 3.365 1.484 0 2.795-0.416 4.382-1.308l2.243 2.447c-1.829 1.168-4.176 2.06-7.143 2.06-6.105 0-9.211-3.172-9.211-7.789 0-4.422 3.002-7.928 8.557-7.928 5.242 0 8.451 2.782 8.451 7.566 0.001 0.474-0.033 1.142-0.102 1.587zm-5.244-2.838c-0.034-2.002-0.794-3.394-2.968-3.394-1.793 0-2.896 0.946-3.139 3.589h6.105l0.002-0.195z"/>
25 <path d="m156.78 21.592c0 1.141 0.379 1.557 1.242 1.809l-1.139 2.865c-2.175-0.141-3.589-0.668-4.416-2.143-1.312 1.641-3.348 2.225-5.521 2.225-3.658 0-5.97-1.918-5.97-4.617 0-3.227 3.035-4.979 8.59-4.979h1.863v-0.641c0-1.751-0.861-2.28-3.104-2.28-1.172 0-2.968 0.278-4.795 0.779l-1.242-2.893c2.312-0.695 4.83-1.085 6.899-1.085 5.312 0 7.591 1.808 7.591 5.229l0.002 5.731zm-5.347 0.194v-2.614h-1.346c-2.484 0-3.691 0.695-3.691 2.169 0 1.169 0.793 1.864 2.14 1.864 1.275 0 2.24-0.529 2.897-1.419z"/>
26 </g>
27 </g>
28 <g fill="#b1d579">
29 <path d="m8.155 18.736c-0.086-0.21-0.048-0.579-0.048-0.579l-0.097-8.098h-1.149l0.098 8.398s-0.034 0.455 0.091 0.709c0.125 0.255 0.413 0.599 0.413 0.599l3.491 3.384s0.107 0.122 0.292 0.486l0.001-1.876-2.884-2.702c0 0.002-0.122-0.11-0.208-0.321z"/>
30 <path d="m19.362 23.255c0.088-0.331 0.089-0.608 0.089-0.608l-0.01-2.976h-1.237v3.082s-0.007 0.113-0.069 0.254c-0.063 0.142-0.091 0.173-0.091 0.173l-2.319 2.395h1.569l1.768-1.832c0.001-0.001 0.217-0.17 0.3-0.488z"/>
31 <path d="m12.905 15.81c0.18-0.288 0.437-0.463 0.437-0.463l2.998-3.073s0.511-0.461 0.622-0.782c0.108-0.321 0.045-1.436 0.045-1.436l-0.111-6.44h-1.491l0.077 6.441s0.062 0.514 0 0.726-0.294 0.481-0.294 0.481l-3.137 3.212s-0.638 0.705-0.743 0.934c-0.104 0.228-0.057 1.347-0.057 1.347l-0.003 5.005-0.001 1.876-0.002 1.938h1.479l0.051-8.819c-0.002-0.001-0.048-0.66 0.13-0.947z"/>
32 </g>
33 <g stroke="#b1d579" fill="none" stroke-miterlimit="10">
34 <circle cx="18.723" cy="17.973" r="1.698" stroke-width="1.4318"/>
35 <circle cx="7.454" cy="7.291" r="2.769" stroke-width="1.7898"/>
36 </g>
37 </svg>
@@ -1,26 +1,26 b''
1 syntax: glob
1 syntax: glob
2 *.pyc
2 *.pyc
3 *.swp
3 *.swp
4 *.sqlite
4 *.sqlite
5 *.tox
5 *.tox
6 *.egg-info
6 *.egg-info
7 *.egg
7 *.egg
8
8
9 syntax: regexp
9 syntax: regexp
10 ^rcextensions
10 ^rcextensions
11 ^build
11 ^build
12 ^dist/
12 ^dist/
13 ^docs/build/
13 ^docs/build/
14 ^docs/_build/
14 ^docs/_build/
15 ^data$
15 ^data$
16 ^sql_dumps/
16 ^sql_dumps/
17 ^\.settings$
17 ^\.settings$
18 ^\.project$
18 ^\.project$
19 ^\.pydevproject$
19 ^\.pydevproject$
20 ^\.coverage$
20 ^\.coverage$
21 ^kallithea\.db$
21 ^kallithea\.db$
22 ^test\.db$
22 ^test\.db$
23 ^Kallithea\.egg-info$
23 ^Kallithea\.egg-info$
24 ^rc.*\.ini$
24 ^my\.ini$
25 ^fabfile.py
25 ^fabfile.py
26 ^\.idea$
26 ^\.idea$
@@ -1,205 +1,198 b''
1 =========
1 ================
2 Kallithea
2 Kallithea README
3 =========
3 ================
4
4
5 About
5 About
6 -----
6 -----
7
7
8 ``Kallithea`` is a fast and powerful management tool for Mercurial_ and Git_
8 ``Kallithea`` is a fast and powerful management tool for Mercurial_ and Git_
9 with a built-in push/pull server, full text search and code-review.
9 with a built-in push/pull server, full text search and code-review.
10 It works on http/https and has a built in permission/authentication system with
10 It works on http/https and has a built in permission/authentication system with
11 the ability to authenticate via LDAP or ActiveDirectory. Kallithea also provides
11 the ability to authenticate via LDAP or ActiveDirectory. Kallithea also provides
12 simple API so it's easy to integrate with existing external systems.
12 simple API so it's easy to integrate with existing external systems.
13
13
14 Kallithea is similar in some respects to GitHub_ or Bitbucket_,
14 Kallithea is similar in some respects to GitHub_ or Bitbucket_,
15 however Kallithea can be run as standalone hosted application on your own server.
15 however Kallithea can be run as standalone hosted application on your own server.
16 It is open-source donationware and focuses more on providing a customised,
16 It is open-source donationware and focuses more on providing a customised,
17 self-administered interface for Mercurial_ and Git_ repositories.
17 self-administered interface for Mercurial_ and Git_ repositories.
18 Kallithea works on Unix-like systems and Windows, and is powered by the vcs_ library
18 Kallithea works on Unix-like systems and Windows, and is powered by the vcs_ library
19 created by Łukasz Balcerzak and Marcin Kuźmiński to uniformly handle multiple
19 created by Łukasz Balcerzak and Marcin Kuźmiński to uniformly handle multiple
20 version control systems.
20 version control systems.
21
21
22 Kallithea was forked from RhodeCode in July 2014 and has been heavily modified.
22 Kallithea was forked from RhodeCode in July 2014 and has been heavily modified.
23
23
24 Installation
24 Installation
25 ------------
25 ------------
26 Stable releases of Kallithea are best installed via::
26 Official releases of Kallithea can be installed via::
27
28 easy_install kallithea
29
30 Or::
31
27
32 pip install kallithea
28 pip install kallithea
33
29
34 Detailed instructions and links may be found on the Installation page.
30 The development repository is kept very stable and used in production by the
31 developers - you can do the same.
35
32
36 Please visit http://packages.python.org/Kallithea/installation.html for
33 Please visit http://packages.python.org/Kallithea/installation.html for
37 more details.
34 more details.
38
35
39
36
40 Source code
37 Source code
41 -----------
38 -----------
42
39
43 The latest sources can be obtained from https://kallithea-scm.org/repos/kallithea
40 The latest sources can be obtained from https://kallithea-scm.org/repos/kallithea.
44
45
41
46 MIRRORS:
42 The issue tracker and a repository mirror can be found at Bitbucket_ on
47
43 https://bitbucket.org/conservancy/kallithea.
48 Issue tracker and sources at Bitbucket_
49
50 https://bitbucket.org/conservancy/kallithea
51
44
52
45
53
46
54 Kallithea Features
47 Kallithea Features
55 ------------------
48 ------------------
56
49
57 - Has its own middleware to handle Mercurial_ and Git_ protocol requests.
50 - Has its own middleware to handle Mercurial_ and Git_ protocol requests.
58 Each request is authenticated and logged together with IP address.
51 Each request is authenticated and logged together with IP address.
59 - Built for speed and performance. You can make multiple pulls/pushes simultaneously.
52 - Built for speed and performance. You can make multiple pulls/pushes simultaneously.
60 Proven to work with thousands of repositories and users.
53 Proven to work with thousands of repositories and users.
61 - Supports http/https, LDAP, AD, proxy-pass authentication.
54 - Supports http/https, LDAP, AD, proxy-pass authentication.
62 - Full permissions (private/read/write/admin) together with IP restrictions for each repository,
55 - Full permissions (private/read/write/admin) together with IP restrictions for each repository,
63 additional explicit forking, repositories group and repository creation permissions.
56 additional explicit forking, repositories group and repository creation permissions.
64 - User groups for easier permission management.
57 - User groups for easier permission management.
65 - Repository groups let you group repos and manage them easier. They come with
58 - Repository groups let you group repos and manage them easier. They come with
66 permission delegation features, so you can delegate groups management.
59 permission delegation features, so you can delegate groups management.
67 - Users can fork other users repos, and compare them at any time.
60 - Users can fork other users repos, and compare them at any time.
68 - Built-in versioned paste functionality (Gist) for sharing code snippets.
61 - Built-in versioned paste functionality (Gist) for sharing code snippets.
69 - Integrates easily with other systems, with custom created mappers you can connect it to almost
62 - Integrates easily with other systems, with custom created mappers you can connect it to almost
70 any issue tracker, and with an JSON-RPC API you can make much more
63 any issue tracker, and with a JSON-RPC API you can make much more.
71 - Built-in commit API lets you add, edit and commit files right from Kallithea
64 - Built-in commit API lets you add, edit and commit files right from Kallithea
72 web interface using simple editor or upload binary files using simple form.
65 web interface using simple editor or upload binary files using simple form.
73 - Powerful pull request driven review system with inline commenting,
66 - Powerful pull request driven review system with inline commenting,
74 changeset statuses, and notification system.
67 changeset statuses, and notification system.
75 - Importing and syncing repositories from remote locations for Git_, Mercurial_ and Subversion.
68 - Importing and syncing repositories from remote locations for Git_, Mercurial_ and Subversion.
76 - Mako templates let you customize the look and feel of the application.
69 - Mako templates let you customize the look and feel of the application.
77 - Beautiful diffs, annotations and source code browsing all colored by pygments.
70 - Beautiful diffs, annotations and source code browsing all colored by pygments.
78 Raw diffs are made in Git-diff format for both VCS systems, including Git_ binary-patches
71 Raw diffs are made in Git-diff format for both VCS systems, including Git_ binary-patches.
79 - Mercurial_ and Git_ DAG graphs and Flot-powered graphs with zooming and statistics
72 - Mercurial_ and Git_ DAG graphs and Flot-powered graphs with zooming and statistics
80 to track activity for repositories
73 to track activity for repositories.
81 - Admin interface with user/permission management. Admin activity journal, logs
74 - Admin interface with user/permission management. Admin activity journal, logs
82 pulls, pushes, forks, registrations and other actions made by all users.
75 pulls, pushes, forks, registrations and other actions made by all users.
83 - Server side forks. It is possible to fork a project and modify it freely
76 - Server side forks. It is possible to fork a project and modify it freely
84 without breaking the main repository.
77 without breaking the main repository.
85 - reST and Markdown README support for repositories.
78 - reST and Markdown README support for repositories.
86 - Full text search powered by Whoosh on the source files, commit messages, and file names.
79 - Full text search powered by Whoosh on the source files, commit messages, and file names.
87 Built-in indexing daemons, with optional incremental index build
80 Built-in indexing daemons, with optional incremental index build
88 (no external search servers required all in one application)
81 (no external search servers required all in one application).
89 - Setup project descriptions/tags and info inside built in DB for easy,
82 - Setup project descriptions/tags and info inside built in DB for easy,
90 non-filesystem operations.
83 non-filesystem operations.
91 - Intelligent cache with invalidation after push or project change, provides
84 - Intelligent cache with invalidation after push or project change, provides
92 high performance and always up to date data.
85 high performance and always up to date data.
93 - RSS/Atom feeds, Gravatar support, downloadable sources as zip/tar/gz
86 - RSS/Atom feeds, Gravatar support, downloadable sources as zip/tar/gz.
94 - Optional async tasks for speed and performance using Celery_
87 - Optional async tasks for speed and performance using Celery_.
95 - Backup scripts can do backup of whole app and send it over scp to desired
88 - Backup scripts can do backup of whole app and send it over scp to desired
96 location
89 location.
97 - Based on Pylons, SQLAlchemy, SQLite, Whoosh, vcs
90 - Based on Pylons, SQLAlchemy, SQLite, Whoosh, vcs.
98
99
100 Incoming / Plans
101 ----------------
102
91
103 - Finer granular permissions per branch, or subrepo
104 - Web-based merges for pull requests
105 - Tracking history for each lines in files
106 - Simple issue tracker
107 - SSH-based authentication with server side key management
108 - Commit based built in wiki system
109 - More statistics and graph (global annotation + some more statistics)
110 - Other advancements as development continues (or you can of course make
111 additions and or requests)
112
92
113 License
93 License
114 -------
94 -------
115
95
116 ``Kallithea`` is released under the GPLv3 license.
96 ``Kallithea`` is released under the GPLv3 license. ``Kallithea`` is a
97 `Software Freedom Conservancy`_ project and thus controlled by a non-profit organization.
98 No commercial entity can take ownership of the project and change the direction.
99
100 Kallithea started out as an effort to make sure the existing GPLv3 codebase would stay
101 available under a legal license. Kallithea thus has to stay GPLv3 compatible ...
102 but we are also happy it is GPLv3 and happy to keep it that way.
103 A different license (such as AGPL) could perhaps help attract a different community
104 with a different mix of Free Software people and companies but we are happy with the current focus.
117
105
118
106
119 Getting help
107 Community
120 ------------
108 ---------
109
110 ``Kallithea`` is maintained by its users who contribute the fixes they would like to see.
121
111
122 Listed bellow are various support resources that should help.
112 Get in touch with the rest of the community:
123
113
124 .. note::
114 - Join the mailing list users and developers - see
115 http://lists.sfconservancy.org/mailman/listinfo/kallithea-general.
125
116
126 Please try to read the documentation before posting any issues, especially
117 - Use IRC and join #kallithea on FreeNode (irc.freenode.net)
127 the **troubleshooting section**
118 or use http://webchat.freenode.net/?channels=kallithea.
128
119
129 - Open an issue at `issue tracker <https://bitbucket.org/conservancy/kallithea/issues>`_
120 - Follow ``Kallithea`` on Twitter, **@KallitheaSCM**.
130
121
131 - Join #kallithea on FreeNode (irc.freenode.net)
122 - Issues can be reported at `issue tracker <https://bitbucket.org/conservancy/kallithea/issues>`_.
132 or use http://webchat.freenode.net/?channels=kallithea for web access to irc.
133
123
134 You can follow this project on Twitter, **@KallitheaSCM**.
124 .. note::
125
126 Please try to read the documentation before posting any issues, especially
127 the **troubleshooting section**
135
128
136
129
137 Online documentation
130 Online documentation
138 --------------------
131 --------------------
139
132
140 Online documentation for the current version of Kallithea is available at
133 Online documentation for the current version of Kallithea is available at https://pythonhosted.org/Kallithea/.
141 - http://packages.python.org/Kallithea/
134 Documentation for the current development version can be found on http://kallithea.readthedocs.org/.
142 - http://kallithea.readthedocs.org/
143
135
144 You may also build the documentation for yourself: go into ``docs/`` and run::
136 You can also build the documentation locally: go to ``docs/`` and run::
145
137
146 make html
138 make html
147
139
148 (You need to have Sphinx_ installed to build the documentation. If you don't
140 (You need to have Sphinx_ installed to build the documentation. If you don't
149 have Sphinx_ installed you can install it via the command:
141 have Sphinx_ installed you can install it via the command:
150 ``easy_install sphinx``)
142 ``pip install sphinx``)
151
143
152
144
153 Converting from RhodeCode
145 Converting from RhodeCode
154 -------------------------
146 -------------------------
155
147
156 Currently, you have two options for working with an existing RhodeCode database:
148 Currently, you have two options for working with an existing RhodeCode database:
157 - keep the database unconverted (intended for testing and evaluation)
149 - keep the database unconverted (intended for testing and evaluation)
158 - convert the database in a one-time step
150 - convert the database in a one-time step
159
151
160 Maintaining Interoperability
152 Maintaining Interoperability
161 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
153 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
162
154
163 Interoperability with RhodeCode 2.2.5 installations is provided so you don't
155 Interoperability with RhodeCode 2.2.X installations is provided so you don't
164 have to immediately commit to switching to Kallithea. This option will most
156 have to immediately commit to switching to Kallithea. This option will most
165 likely go away once the two projects have diverged significantly.
157 likely go away once the two projects have diverged significantly.
166
158
167 To run Kallithea on a RhodeCode database, run::
159 To run Kallithea on a RhodeCode database, run::
168
160
169 echo "BRAND = 'rhodecode'" > kallithea/brand.py
161 echo "BRAND = 'rhodecode'" > kallithea/brand.py
170
162
171 This location will depend on where you installed Kallithea. If you installed via::
163 This location will depend on where you installed Kallithea. If you installed via::
172
164
173 python setup.py install
165 python setup.py install
174
166
175 then you will find this location at
167 then you will find this location at
176 ``$VIRTUAL_ENV/lib/python2.7/site-packages/Kallithea-2.2.5-py2.7.egg/kallithea``
168 ``$VIRTUAL_ENV/lib/python2.7/site-packages/Kallithea-0.1-py2.7.egg/kallithea``.
177
169
178 One-time Conversion
170 One-time Conversion
179 ~~~~~~~~~~~~~~~~~~~
171 ~~~~~~~~~~~~~~~~~~~
180
172
181 Alternatively, if you would like to convert the database for good, you can use
173 Alternatively, if you would like to convert the database for good, you can use
182 a helper script provided by Kallithea. This script will operate directly on the
174 a helper script provided by Kallithea. This script will operate directly on the
183 database, using the database string you can find in your ``production.ini`` (or
175 database, using the database string you can find in your ``production.ini`` (or
184 ``development.ini``) file. For example, if using SQLite::
176 ``development.ini``) file. For example, if using SQLite::
185
177
186 cd /path/to/kallithea
178 cd /path/to/kallithea
187 cp /path/to/rhodecode/rhodecode.db kallithea.db
179 cp /path/to/rhodecode/rhodecode.db kallithea.db
188 pip install sqlalchemy-migrate
180 pip install sqlalchemy-migrate
189 python kallithea/bin/rebranddb.py sqlite:///kallithea.db
181 python kallithea/bin/rebranddb.py sqlite:///kallithea.db
190
182
191 .. WARNING::
183 .. Note::
192
184
193 If you used the other method for interoperability, overwrite brand.py with
185 If you started out using the branding interoperability approach mentioned
194 an empty file (or watch out for stray brand.pyc after removing brand.py).
186 above, watch out for stray brand.pyc after removing brand.py.
195
187
196 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
188 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
197 .. _Python: http://www.python.org/
189 .. _Python: http://www.python.org/
198 .. _Sphinx: http://sphinx.pocoo.org/
190 .. _Sphinx: http://sphinx.pocoo.org/
199 .. _Mercurial: http://mercurial.selenic.com/
191 .. _Mercurial: http://mercurial.selenic.com/
200 .. _Bitbucket: http://bitbucket.org/
192 .. _Bitbucket: http://bitbucket.org/
201 .. _GitHub: http://github.com/
193 .. _GitHub: http://github.com/
202 .. _Subversion: http://subversion.tigris.org/
194 .. _Subversion: http://subversion.tigris.org/
203 .. _Git: http://git-scm.com/
195 .. _Git: http://git-scm.com/
204 .. _Celery: http://celeryproject.org/
196 .. _Celery: http://celeryproject.org/
205 .. _vcs: http://pypi.python.org/pypi/vcs
197 .. _vcs: http://pypi.python.org/pypi/vcs
198 .. _Software Freedom Conservancy: http://sfconservancy.org/
@@ -1,1002 +1,1002 b''
1 .. _api:
1 .. _api:
2
2
3 ===
3 ===
4 API
4 API
5 ===
5 ===
6
6
7
7
8 Kallithea has a simple JSON RPC API with a single schema for calling all api
8 Kallithea has a simple JSON RPC API with a single schema for calling all api
9 methods. Everything is available by sending JSON encoded http(s) requests to
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 API ACCESS FOR WEB VIEWS
13 API access for web views
14 ++++++++++++++++++++++++
14 ++++++++++++++++++++++++
15
15
16 API access can also be turned on for each web view in Kallithea that is
16 API access can also be turned on for each web view in Kallithea that is
17 decorated with the `@LoginRequired` decorator. Some views use
17 decorated with the `@LoginRequired` decorator. Some views use
18 `@LoginRequired(api_access=True)` and are always available. By default only
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 only available if they have been white listed. Edit the
20 only available if they have been white listed. Edit the
21 `api_access_controllers_whitelist` option in your .ini file and define views
21 `api_access_controllers_whitelist` option in your .ini file and define views
22 that should have API access enabled.
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 api_access_controllers_whitelist =
26 api_access_controllers_whitelist =
27 ChangesetController:changeset_patch,
27 ChangesetController:changeset_patch,
28 ChangesetController:changeset_raw,
28 ChangesetController:changeset_raw,
29 FilesController:raw,
29 FilesController:raw,
30 FilesController:archivefile
30 FilesController:archivefile
31
31
32 After this change, a Kallithea view can be accessed without login by adding a
32 After this change, a Kallithea view can be accessed without login by adding a
33 GET parameter `?api_key=<api_key>` to url.
33 GET parameter `?api_key=<api_key>` to url.
34
34
35 Exposing raw diffs is a good way to integrate with
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 3rd party services like code review, or build farms that could download archives.
37
37
38
38
39 API ACCESS
39 API access
40 ++++++++++
40 ++++++++++
41
41
42 Clients must send JSON encoded JSON-RPC requests::
42 Clients must send JSON encoded JSON-RPC requests::
43
43
44 {
44 {
45 "id: "<id>",
45 "id: "<id>",
46 "api_key": "<api_key>",
46 "api_key": "<api_key>",
47 "method": "<method_name>",
47 "method": "<method_name>",
48 "args": {"<arg_key>": "<arg_val>"}
48 "args": {"<arg_key>": "<arg_val>"}
49 }
49 }
50
50
51 For example, to pull to a local "CPython" mirror using curl::
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://server.com/_admin/api -X POST -H 'content-type:text/plain' --data-binary '{"id":1,"api_key":"xe7cdb2v278e4evbdf5vs04v832v0efvcbcve4a3","method":"pull","args":{"repo":"CPython"}}'
54
54
55 In general, provide
55 In general, provide
56 - *id*, a value of any type, can be used to match the response with the request that it is replying to.
56 - *id*, a value of any type, can be used to match the response with the request that it is replying to.
57 - *api_key*, for authentication and permission validation.
57 - *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.
58 - *method*, the name of the method to call - a list of available methods can be found below.
59 - *args*, the arguments to pass to the method.
59 - *args*, the arguments to pass to the method.
60
60
61 .. note::
61 .. note::
62
62
63 api_key can be found or set on the user account page
63 api_key can be found or set on the user account page
64
64
65 The response to the JSON-RPC API call will always be a JSON structure::
65 The response to the JSON-RPC API call will always be a JSON structure::
66
66
67 {
67 {
68 "id":<id>, # the id that was used in the request
68 "id":<id>, # the id that was used in the request
69 "result": "<result>"|null, # JSON formatted result, null if any errors
69 "result": "<result>"|null, # JSON formatted result, null if any errors
70 "error": "null"|<error_message> # JSON formatted error (if any)
70 "error": "null"|<error_message> # JSON formatted error (if any)
71 }
71 }
72
72
73 All responses from API will be `HTTP/1.0 200 OK`. If there is an error,
73 All responses from API will be `HTTP/1.0 200 OK`. If there is an error,
74 the reponse will have a failure description in *error* and
74 the reponse will have a failure description in *error* and
75 *result* will be null.
75 *result* will be null.
76
76
77
77
78 API CLIENT
78 API client
79 ++++++++++
79 ++++++++++
80
80
81 Kallithea comes with a `kallithea-api` command line tool providing a convenient
81 Kallithea comes with a `kallithea-api` command line tool providing a convenient
82 way to call the JSON-RPC API.
82 way to call the JSON-RPC API.
83
83
84 For example, to call `get_repo`::
84 For example, to call `get_repo`::
85
85
86 kallithea-api --apihost=<your.kallithea.server.url> --apikey=<yourapikey> get_repo
86 kallithea-api --apihost=<your.kallithea.server.url> --apikey=<yourapikey> get_repo
87
87
88 calling {"api_key": "<apikey>", "id": 75, "args": {}, "method": "get_repo"} to http://127.0.0.1:5000
88 calling {"api_key": "<apikey>", "id": 75, "args": {}, "method": "get_repo"} to http://127.0.0.1:5000
89 Kallithea said:
89 Kallithea said:
90 {'error': 'Missing non optional `repoid` arg in JSON DATA',
90 {'error': 'Missing non optional `repoid` arg in JSON DATA',
91 'id': 75,
91 'id': 75,
92 'result': None}
92 'result': None}
93
93
94 Oops, looks like we forgot to add an argument. Let's try again, now providing the repoid as parameter::
94 Oops, looks like we forgot to add an argument. Let's try again, now providing the repoid as parameter::
95
95
96 kallithea-api get_repo repoid:myrepo
96 kallithea-api get_repo repoid:myrepo
97
97
98 calling {"api_key": "<apikey>", "id": 39, "args": {"repoid": "myrepo"}, "method": "get_repo"} to http://127.0.0.1:5000
98 calling {"api_key": "<apikey>", "id": 39, "args": {"repoid": "myrepo"}, "method": "get_repo"} to http://127.0.0.1:5000
99 Kallithea said:
99 Kallithea said:
100 {'error': None,
100 {'error': None,
101 'id': 39,
101 'id': 39,
102 'result': <json data...>}
102 'result': <json data...>}
103
103
104 To avoid specifying apihost and apikey every time, run::
104 To avoid specifying apihost and apikey every time, run::
105
105
106 kallithea-api --save-config --apihost=<your.kallithea.server.url> --apikey=<yourapikey>
106 kallithea-api --save-config --apihost=<your.kallithea.server.url> --apikey=<yourapikey>
107
107
108 This will create a `~/.config/kallithea` with the specified hostname and apikey
108 This will create a `~/.config/kallithea` with the specified hostname and apikey
109 so you don't have to specify them every time.
109 so you don't have to specify them every time.
110
110
111
111
112 API METHODS
112 API methods
113 +++++++++++
113 +++++++++++
114
114
115
115
116 pull
116 pull
117 ----
117 ----
118
118
119 Pull the given repo from remote location. Can be used to automatically keep
119 Pull the given repo from remote location. Can be used to automatically keep
120 remote repos up to date.
120 remote repos up to date.
121 This command can only be executed using the api_key of a user with admin rights.
121 This command can only be executed using the api_key of a user with admin rights.
122
122
123 INPUT::
123 INPUT::
124
124
125 id : <id_for_response>
125 id : <id_for_response>
126 api_key : "<api_key>"
126 api_key : "<api_key>"
127 method : "pull"
127 method : "pull"
128 args : {
128 args : {
129 "repoid" : "<reponame or repo_id>"
129 "repoid" : "<reponame or repo_id>"
130 }
130 }
131
131
132 OUTPUT::
132 OUTPUT::
133
133
134 id : <id_given_in_input>
134 id : <id_given_in_input>
135 result : "Pulled from `<reponame>`"
135 result : "Pulled from `<reponame>`"
136 error : null
136 error : null
137
137
138
138
139 rescan_repos
139 rescan_repos
140 ------------
140 ------------
141
141
142 Rescan repositories. If remove_obsolete is set,
142 Rescan repositories. If remove_obsolete is set,
143 Kallithea will delete repos that are in database but not in the filesystem.
143 Kallithea will delete repos that are in database but not in the filesystem.
144 This command can only be executed using the api_key of a user with admin rights.
144 This command can only be executed using the api_key of a user with admin rights.
145
145
146 INPUT::
146 INPUT::
147
147
148 id : <id_for_response>
148 id : <id_for_response>
149 api_key : "<api_key>"
149 api_key : "<api_key>"
150 method : "rescan_repos"
150 method : "rescan_repos"
151 args : {
151 args : {
152 "remove_obsolete" : "<boolean = Optional(False)>"
152 "remove_obsolete" : "<boolean = Optional(False)>"
153 }
153 }
154
154
155 OUTPUT::
155 OUTPUT::
156
156
157 id : <id_given_in_input>
157 id : <id_given_in_input>
158 result : "{'added': [<list of names of added repos>],
158 result : "{'added': [<list of names of added repos>],
159 'removed': [<list of names of removed repos>]}"
159 'removed': [<list of names of removed repos>]}"
160 error : null
160 error : null
161
161
162
162
163 invalidate_cache
163 invalidate_cache
164 ----------------
164 ----------------
165
165
166 Invalidate cache for repository.
166 Invalidate cache for repository.
167 This command can only be executed using the api_key of a user with admin rights,
167 This command can only be executed using the api_key of a user with admin rights,
168 or that of a regular user with admin or write access to the repository.
168 or that of a regular user with admin or write access to the repository.
169
169
170 INPUT::
170 INPUT::
171
171
172 id : <id_for_response>
172 id : <id_for_response>
173 api_key : "<api_key>"
173 api_key : "<api_key>"
174 method : "invalidate_cache"
174 method : "invalidate_cache"
175 args : {
175 args : {
176 "repoid" : "<reponame or repo_id>"
176 "repoid" : "<reponame or repo_id>"
177 }
177 }
178
178
179 OUTPUT::
179 OUTPUT::
180
180
181 id : <id_given_in_input>
181 id : <id_given_in_input>
182 result : "Caches of repository `<reponame>`"
182 result : "Caches of repository `<reponame>`"
183 error : null
183 error : null
184
184
185
185
186 lock
186 lock
187 ----
187 ----
188
188
189 Set the locking state on the given repository by the given user.
189 Set the locking state on the given repository by the given user.
190 If param 'userid' is skipped, it is set to the id of the user who is calling this method.
190 If param 'userid' is skipped, it is set to the id of the user who is calling this method.
191 If param 'locked' is skipped, the current lock state of the repository is returned.
191 If param 'locked' is skipped, the current lock state of the repository is returned.
192 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.
192 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.
193
193
194 INPUT::
194 INPUT::
195
195
196 id : <id_for_response>
196 id : <id_for_response>
197 api_key : "<api_key>"
197 api_key : "<api_key>"
198 method : "lock"
198 method : "lock"
199 args : {
199 args : {
200 "repoid" : "<reponame or repo_id>"
200 "repoid" : "<reponame or repo_id>"
201 "userid" : "<user_id or username = Optional(=apiuser)>",
201 "userid" : "<user_id or username = Optional(=apiuser)>",
202 "locked" : "<bool true|false = Optional(=None)>"
202 "locked" : "<bool true|false = Optional(=None)>"
203 }
203 }
204
204
205 OUTPUT::
205 OUTPUT::
206
206
207 id : <id_given_in_input>
207 id : <id_given_in_input>
208 result : {
208 result : {
209 "repo": "<reponame>",
209 "repo": "<reponame>",
210 "locked": "<bool true|false>",
210 "locked": "<bool true|false>",
211 "locked_since": "<float lock_time>",
211 "locked_since": "<float lock_time>",
212 "locked_by": "<username>",
212 "locked_by": "<username>",
213 "msg": "User `<username>` set lock state for repo `<reponame>` to `<false|true>`"
213 "msg": "User `<username>` set lock state for repo `<reponame>` to `<false|true>`"
214 }
214 }
215 error : null
215 error : null
216
216
217
217
218 get_ip
218 get_ip
219 ------
219 ------
220
220
221 Return IP address as seen from Kallithea server, together with all
221 Return IP address as seen from Kallithea server, together with all
222 defined IP addresses for given user.
222 defined IP addresses for given user.
223 This command can only be executed using the api_key of a user with admin rights.
223 This command can only be executed using the api_key of a user with admin rights.
224
224
225 INPUT::
225 INPUT::
226
226
227 id : <id_for_response>
227 id : <id_for_response>
228 api_key : "<api_key>"
228 api_key : "<api_key>"
229 method : "get_ip"
229 method : "get_ip"
230 args : {
230 args : {
231 "userid" : "<user_id or username>",
231 "userid" : "<user_id or username>",
232 }
232 }
233
233
234 OUTPUT::
234 OUTPUT::
235
235
236 id : <id_given_in_input>
236 id : <id_given_in_input>
237 result : {
237 result : {
238 "ip_addr_server": <ip_from_clien>",
238 "ip_addr_server": <ip_from_clien>",
239 "user_ips": [
239 "user_ips": [
240 {
240 {
241 "ip_addr": "<ip_with_mask>",
241 "ip_addr": "<ip_with_mask>",
242 "ip_range": ["<start_ip>", "<end_ip>"],
242 "ip_range": ["<start_ip>", "<end_ip>"],
243 },
243 },
244 ...
244 ...
245 ]
245 ]
246 }
246 }
247
247
248 error : null
248 error : null
249
249
250
250
251 get_user
251 get_user
252 --------
252 --------
253
253
254 Get a user by username or userid. The result is empty if user can't be found.
254 Get a user by username or userid. The result is empty if user can't be found.
255 If userid param is skipped, it is set to id of user who is calling this method.
255 If userid param is skipped, it is set to id of user who is calling this method.
256 Any userid can be specified when the command is executed using the api_key of a user with admin rights.
256 Any userid can be specified when the command is executed using the api_key of a user with admin rights.
257 Regular users can only speicy their own userid.
257 Regular users can only speicy their own userid.
258
258
259
259
260 INPUT::
260 INPUT::
261
261
262 id : <id_for_response>
262 id : <id_for_response>
263 api_key : "<api_key>"
263 api_key : "<api_key>"
264 method : "get_user"
264 method : "get_user"
265 args : {
265 args : {
266 "userid" : "<username or user_id Optional(=apiuser)>"
266 "userid" : "<username or user_id Optional(=apiuser)>"
267 }
267 }
268
268
269 OUTPUT::
269 OUTPUT::
270
270
271 id : <id_given_in_input>
271 id : <id_given_in_input>
272 result: None if user does not exist or
272 result: None if user does not exist or
273 {
273 {
274 "user_id" : "<user_id>",
274 "user_id" : "<user_id>",
275 "api_key" : "<api_key>",
275 "api_key" : "<api_key>",
276 "username" : "<username>",
276 "username" : "<username>",
277 "firstname": "<firstname>",
277 "firstname": "<firstname>",
278 "lastname" : "<lastname>",
278 "lastname" : "<lastname>",
279 "email" : "<email>",
279 "email" : "<email>",
280 "emails": "<list_of_all_additional_emails>",
280 "emails": "<list_of_all_additional_emails>",
281 "ip_addresses": "<list_of_ip_addresses_for_user>",
281 "ip_addresses": "<list_of_ip_addresses_for_user>",
282 "active" : "<bool>",
282 "active" : "<bool>",
283 "admin" :  "<bool>",
283 "admin" :  "<bool>",
284 "ldap_dn" : "<ldap_dn>",
284 "ldap_dn" : "<ldap_dn>",
285 "last_login": "<last_login>",
285 "last_login": "<last_login>",
286 "permissions": {
286 "permissions": {
287 "global": ["hg.create.repository",
287 "global": ["hg.create.repository",
288 "repository.read",
288 "repository.read",
289 "hg.register.manual_activate"],
289 "hg.register.manual_activate"],
290 "repositories": {"repo1": "repository.none"},
290 "repositories": {"repo1": "repository.none"},
291 "repositories_groups": {"Group1": "group.read"}
291 "repositories_groups": {"Group1": "group.read"}
292 },
292 },
293 }
293 }
294
294
295 error: null
295 error: null
296
296
297
297
298 get_users
298 get_users
299 ---------
299 ---------
300
300
301 List all existing users.
301 List all existing users.
302 This command can only be executed using the api_key of a user with admin rights.
302 This command can only be executed using the api_key of a user with admin rights.
303
303
304
304
305 INPUT::
305 INPUT::
306
306
307 id : <id_for_response>
307 id : <id_for_response>
308 api_key : "<api_key>"
308 api_key : "<api_key>"
309 method : "get_users"
309 method : "get_users"
310 args : { }
310 args : { }
311
311
312 OUTPUT::
312 OUTPUT::
313
313
314 id : <id_given_in_input>
314 id : <id_given_in_input>
315 result: [
315 result: [
316 {
316 {
317 "user_id" : "<user_id>",
317 "user_id" : "<user_id>",
318 "api_key" : "<api_key>",
318 "api_key" : "<api_key>",
319 "username" : "<username>",
319 "username" : "<username>",
320 "firstname": "<firstname>",
320 "firstname": "<firstname>",
321 "lastname" : "<lastname>",
321 "lastname" : "<lastname>",
322 "email" : "<email>",
322 "email" : "<email>",
323 "emails": "<list_of_all_additional_emails>",
323 "emails": "<list_of_all_additional_emails>",
324 "ip_addresses": "<list_of_ip_addresses_for_user>",
324 "ip_addresses": "<list_of_ip_addresses_for_user>",
325 "active" : "<bool>",
325 "active" : "<bool>",
326 "admin" :  "<bool>",
326 "admin" :  "<bool>",
327 "ldap_dn" : "<ldap_dn>",
327 "ldap_dn" : "<ldap_dn>",
328 "last_login": "<last_login>",
328 "last_login": "<last_login>",
329 },
329 },
330
330
331 ]
331 ]
332 error: null
332 error: null
333
333
334
334
335 create_user
335 create_user
336 -----------
336 -----------
337
337
338 Create new user.
338 Create new user.
339 This command can only be executed using the api_key of a user with admin rights.
339 This command can only be executed using the api_key of a user with admin rights.
340
340
341
341
342 INPUT::
342 INPUT::
343
343
344 id : <id_for_response>
344 id : <id_for_response>
345 api_key : "<api_key>"
345 api_key : "<api_key>"
346 method : "create_user"
346 method : "create_user"
347 args : {
347 args : {
348 "username" : "<username>",
348 "username" : "<username>",
349 "email" : "<useremail>",
349 "email" : "<useremail>",
350 "password" : "<password = Optional(None)>",
350 "password" : "<password = Optional(None)>",
351 "firstname" : "<firstname> = Optional(None)",
351 "firstname" : "<firstname> = Optional(None)",
352 "lastname" : "<lastname> = Optional(None)",
352 "lastname" : "<lastname> = Optional(None)",
353 "active" : "<bool> = Optional(True)",
353 "active" : "<bool> = Optional(True)",
354 "admin" : "<bool> = Optional(False)",
354 "admin" : "<bool> = Optional(False)",
355 "ldap_dn" : "<ldap_dn> = Optional(None)"
355 "ldap_dn" : "<ldap_dn> = Optional(None)"
356 }
356 }
357
357
358 OUTPUT::
358 OUTPUT::
359
359
360 id : <id_given_in_input>
360 id : <id_given_in_input>
361 result: {
361 result: {
362 "msg" : "created new user `<username>`",
362 "msg" : "created new user `<username>`",
363 "user": {
363 "user": {
364 "user_id" : "<user_id>",
364 "user_id" : "<user_id>",
365 "username" : "<username>",
365 "username" : "<username>",
366 "firstname": "<firstname>",
366 "firstname": "<firstname>",
367 "lastname" : "<lastname>",
367 "lastname" : "<lastname>",
368 "email" : "<email>",
368 "email" : "<email>",
369 "emails": "<list_of_all_additional_emails>",
369 "emails": "<list_of_all_additional_emails>",
370 "active" : "<bool>",
370 "active" : "<bool>",
371 "admin" :  "<bool>",
371 "admin" :  "<bool>",
372 "ldap_dn" : "<ldap_dn>",
372 "ldap_dn" : "<ldap_dn>",
373 "last_login": "<last_login>",
373 "last_login": "<last_login>",
374 },
374 },
375 }
375 }
376 error: null
376 error: null
377
377
378
378
379 update_user
379 update_user
380 -----------
380 -----------
381
381
382 Update the given user if such user exists.
382 Update the given user if such user exists.
383 This command can only be executed using the api_key of a user with admin rights.
383 This command can only be executed using the api_key of a user with admin rights.
384
384
385
385
386 INPUT::
386 INPUT::
387
387
388 id : <id_for_response>
388 id : <id_for_response>
389 api_key : "<api_key>"
389 api_key : "<api_key>"
390 method : "update_user"
390 method : "update_user"
391 args : {
391 args : {
392 "userid" : "<user_id or username>",
392 "userid" : "<user_id or username>",
393 "username" : "<username> = Optional(None)",
393 "username" : "<username> = Optional(None)",
394 "email" : "<useremail> = Optional(None)",
394 "email" : "<useremail> = Optional(None)",
395 "password" : "<password> = Optional(None)",
395 "password" : "<password> = Optional(None)",
396 "firstname" : "<firstname> = Optional(None)",
396 "firstname" : "<firstname> = Optional(None)",
397 "lastname" : "<lastname> = Optional(None)",
397 "lastname" : "<lastname> = Optional(None)",
398 "active" : "<bool> = Optional(None)",
398 "active" : "<bool> = Optional(None)",
399 "admin" : "<bool> = Optional(None)",
399 "admin" : "<bool> = Optional(None)",
400 "ldap_dn" : "<ldap_dn> = Optional(None)"
400 "ldap_dn" : "<ldap_dn> = Optional(None)"
401 }
401 }
402
402
403 OUTPUT::
403 OUTPUT::
404
404
405 id : <id_given_in_input>
405 id : <id_given_in_input>
406 result: {
406 result: {
407 "msg" : "updated user ID:<userid> <username>",
407 "msg" : "updated user ID:<userid> <username>",
408 "user": {
408 "user": {
409 "user_id" : "<user_id>",
409 "user_id" : "<user_id>",
410 "api_key" : "<api_key>",
410 "api_key" : "<api_key>",
411 "username" : "<username>",
411 "username" : "<username>",
412 "firstname": "<firstname>",
412 "firstname": "<firstname>",
413 "lastname" : "<lastname>",
413 "lastname" : "<lastname>",
414 "email" : "<email>",
414 "email" : "<email>",
415 "emails": "<list_of_all_additional_emails>",
415 "emails": "<list_of_all_additional_emails>",
416 "active" : "<bool>",
416 "active" : "<bool>",
417 "admin" :  "<bool>",
417 "admin" :  "<bool>",
418 "ldap_dn" : "<ldap_dn>",
418 "ldap_dn" : "<ldap_dn>",
419 "last_login": "<last_login>",
419 "last_login": "<last_login>",
420 },
420 },
421 }
421 }
422 error: null
422 error: null
423
423
424
424
425 delete_user
425 delete_user
426 -----------
426 -----------
427
427
428 Delete given user if such user exists.
428 Delete given user if such user exists.
429 This command can only be executed using the api_key of a user with admin rights.
429 This command can only be executed using the api_key of a user with admin rights.
430
430
431
431
432 INPUT::
432 INPUT::
433
433
434 id : <id_for_response>
434 id : <id_for_response>
435 api_key : "<api_key>"
435 api_key : "<api_key>"
436 method : "delete_user"
436 method : "delete_user"
437 args : {
437 args : {
438 "userid" : "<user_id or username>",
438 "userid" : "<user_id or username>",
439 }
439 }
440
440
441 OUTPUT::
441 OUTPUT::
442
442
443 id : <id_given_in_input>
443 id : <id_given_in_input>
444 result: {
444 result: {
445 "msg" : "deleted user ID:<userid> <username>",
445 "msg" : "deleted user ID:<userid> <username>",
446 "user": null
446 "user": null
447 }
447 }
448 error: null
448 error: null
449
449
450
450
451 get_user_group
451 get_user_group
452 --------------
452 --------------
453
453
454 Get an existing user group.
454 Get an existing user group.
455 This command can only be executed using the api_key of a user with admin rights.
455 This command can only be executed using the api_key of a user with admin rights.
456
456
457
457
458 INPUT::
458 INPUT::
459
459
460 id : <id_for_response>
460 id : <id_for_response>
461 api_key : "<api_key>"
461 api_key : "<api_key>"
462 method : "get_user_group"
462 method : "get_user_group"
463 args : {
463 args : {
464 "usergroupid" : "<user group id or name>"
464 "usergroupid" : "<user group id or name>"
465 }
465 }
466
466
467 OUTPUT::
467 OUTPUT::
468
468
469 id : <id_given_in_input>
469 id : <id_given_in_input>
470 result : None if group not exist
470 result : None if group not exist
471 {
471 {
472 "users_group_id" : "<id>",
472 "users_group_id" : "<id>",
473 "group_name" : "<groupname>",
473 "group_name" : "<groupname>",
474 "active": "<bool>",
474 "active": "<bool>",
475 "members" : [
475 "members" : [
476 {
476 {
477 "user_id" : "<user_id>",
477 "user_id" : "<user_id>",
478 "api_key" : "<api_key>",
478 "api_key" : "<api_key>",
479 "username" : "<username>",
479 "username" : "<username>",
480 "firstname": "<firstname>",
480 "firstname": "<firstname>",
481 "lastname" : "<lastname>",
481 "lastname" : "<lastname>",
482 "email" : "<email>",
482 "email" : "<email>",
483 "emails": "<list_of_all_additional_emails>",
483 "emails": "<list_of_all_additional_emails>",
484 "active" : "<bool>",
484 "active" : "<bool>",
485 "admin" :  "<bool>",
485 "admin" :  "<bool>",
486 "ldap_dn" : "<ldap_dn>",
486 "ldap_dn" : "<ldap_dn>",
487 "last_login": "<last_login>",
487 "last_login": "<last_login>",
488 },
488 },
489
489
490 ]
490 ]
491 }
491 }
492 error : null
492 error : null
493
493
494
494
495 get_user_groups
495 get_user_groups
496 ---------------
496 ---------------
497
497
498 List all existing user groups.
498 List all existing user groups.
499 This command can only be executed using the api_key of a user with admin rights.
499 This command can only be executed using the api_key of a user with admin rights.
500
500
501
501
502 INPUT::
502 INPUT::
503
503
504 id : <id_for_response>
504 id : <id_for_response>
505 api_key : "<api_key>"
505 api_key : "<api_key>"
506 method : "get_user_groups"
506 method : "get_user_groups"
507 args : { }
507 args : { }
508
508
509 OUTPUT::
509 OUTPUT::
510
510
511 id : <id_given_in_input>
511 id : <id_given_in_input>
512 result : [
512 result : [
513 {
513 {
514 "users_group_id" : "<id>",
514 "users_group_id" : "<id>",
515 "group_name" : "<groupname>",
515 "group_name" : "<groupname>",
516 "active": "<bool>",
516 "active": "<bool>",
517 },
517 },
518
518
519 ]
519 ]
520 error : null
520 error : null
521
521
522
522
523 create_user_group
523 create_user_group
524 -----------------
524 -----------------
525
525
526 Create a new user group.
526 Create a new user group.
527 This command can only be executed using the api_key of a user with admin rights.
527 This command can only be executed using the api_key of a user with admin rights.
528
528
529
529
530 INPUT::
530 INPUT::
531
531
532 id : <id_for_response>
532 id : <id_for_response>
533 api_key : "<api_key>"
533 api_key : "<api_key>"
534 method : "create_user_group"
534 method : "create_user_group"
535 args: {
535 args: {
536 "group_name": "<groupname>",
536 "group_name": "<groupname>",
537 "owner" : "<onwer_name_or_id = Optional(=apiuser)>",
537 "owner" : "<onwer_name_or_id = Optional(=apiuser)>",
538 "active": "<bool> = Optional(True)"
538 "active": "<bool> = Optional(True)"
539 }
539 }
540
540
541 OUTPUT::
541 OUTPUT::
542
542
543 id : <id_given_in_input>
543 id : <id_given_in_input>
544 result: {
544 result: {
545 "msg": "created new user group `<groupname>`",
545 "msg": "created new user group `<groupname>`",
546 "users_group": {
546 "users_group": {
547 "users_group_id" : "<id>",
547 "users_group_id" : "<id>",
548 "group_name" : "<groupname>",
548 "group_name" : "<groupname>",
549 "active": "<bool>",
549 "active": "<bool>",
550 },
550 },
551 }
551 }
552 error: null
552 error: null
553
553
554
554
555 add_user_to_user_group
555 add_user_to_user_group
556 ----------------------
556 ----------------------
557
557
558 Addsa user to a user group. If the user already is in that group, success will be
558 Addsa user to a user group. If the user already is in that group, success will be
559 `false`.
559 `false`.
560 This command can only be executed using the api_key of a user with admin rights.
560 This command can only be executed using the api_key of a user with admin rights.
561
561
562
562
563 INPUT::
563 INPUT::
564
564
565 id : <id_for_response>
565 id : <id_for_response>
566 api_key : "<api_key>"
566 api_key : "<api_key>"
567 method : "add_user_user_group"
567 method : "add_user_user_group"
568 args: {
568 args: {
569 "usersgroupid" : "<user group id or name>",
569 "usersgroupid" : "<user group id or name>",
570 "userid" : "<user_id or username>",
570 "userid" : "<user_id or username>",
571 }
571 }
572
572
573 OUTPUT::
573 OUTPUT::
574
574
575 id : <id_given_in_input>
575 id : <id_given_in_input>
576 result: {
576 result: {
577 "success": True|False # depends on if member is in group
577 "success": True|False # depends on if member is in group
578 "msg": "added member `<username>` to a user group `<groupname>` |
578 "msg": "added member `<username>` to a user group `<groupname>` |
579 User is already in that group"
579 User is already in that group"
580 }
580 }
581 error: null
581 error: null
582
582
583
583
584 remove_user_from_user_group
584 remove_user_from_user_group
585 ---------------------------
585 ---------------------------
586
586
587 Remove a user from a user group. If the user isn't in the given group, success will
587 Remove a user from a user group. If the user isn't in the given group, success will
588 be `false`.
588 be `false`.
589 This command can only be executed using the api_key of a user with admin rights.
589 This command can only be executed using the api_key of a user with admin rights.
590
590
591
591
592 INPUT::
592 INPUT::
593
593
594 id : <id_for_response>
594 id : <id_for_response>
595 api_key : "<api_key>"
595 api_key : "<api_key>"
596 method : "remove_user_from_user_group"
596 method : "remove_user_from_user_group"
597 args: {
597 args: {
598 "usersgroupid" : "<user group id or name>",
598 "usersgroupid" : "<user group id or name>",
599 "userid" : "<user_id or username>",
599 "userid" : "<user_id or username>",
600 }
600 }
601
601
602 OUTPUT::
602 OUTPUT::
603
603
604 id : <id_given_in_input>
604 id : <id_given_in_input>
605 result: {
605 result: {
606 "success": True|False, # depends on if member is in group
606 "success": True|False, # depends on if member is in group
607 "msg": "removed member <username> from user group <groupname> |
607 "msg": "removed member <username> from user group <groupname> |
608 User wasn't in group"
608 User wasn't in group"
609 }
609 }
610 error: null
610 error: null
611
611
612
612
613 get_repo
613 get_repo
614 --------
614 --------
615
615
616 Get an existing repository by its name or repository_id. Members will contain
616 Get an existing repository by its name or repository_id. Members will contain
617 either users_group or user associated to that repository.
617 either users_group or user associated to that repository.
618 This command can only be executed using the api_key of a user with admin rights,
618 This command can only be executed using the api_key of a user with admin rights,
619 or that of a regular user with at least read access to the repository.
619 or that of a regular user with at least read access to the repository.
620
620
621 INPUT::
621 INPUT::
622
622
623 id : <id_for_response>
623 id : <id_for_response>
624 api_key : "<api_key>"
624 api_key : "<api_key>"
625 method : "get_repo"
625 method : "get_repo"
626 args: {
626 args: {
627 "repoid" : "<reponame or repo_id>"
627 "repoid" : "<reponame or repo_id>"
628 }
628 }
629
629
630 OUTPUT::
630 OUTPUT::
631
631
632 id : <id_given_in_input>
632 id : <id_given_in_input>
633 result: None if repository does not exist or
633 result: None if repository does not exist or
634 {
634 {
635 "repo_id" : "<repo_id>",
635 "repo_id" : "<repo_id>",
636 "repo_name" : "<reponame>"
636 "repo_name" : "<reponame>"
637 "repo_type" : "<repo_type>",
637 "repo_type" : "<repo_type>",
638 "clone_uri" : "<clone_uri>",
638 "clone_uri" : "<clone_uri>",
639 "enable_downloads": "<bool>",
639 "enable_downloads": "<bool>",
640 "enable_locking": "<bool>",
640 "enable_locking": "<bool>",
641 "enable_statistics": "<bool>",
641 "enable_statistics": "<bool>",
642 "private": "<bool>",
642 "private": "<bool>",
643 "created_on" : "<date_time_created>",
643 "created_on" : "<date_time_created>",
644 "description" : "<description>",
644 "description" : "<description>",
645 "landing_rev": "<landing_rev>",
645 "landing_rev": "<landing_rev>",
646 "last_changeset": {
646 "last_changeset": {
647 "author": "<full_author>",
647 "author": "<full_author>",
648 "date": "<date_time_of_commit>",
648 "date": "<date_time_of_commit>",
649 "message": "<commit_message>",
649 "message": "<commit_message>",
650 "raw_id": "<raw_id>",
650 "raw_id": "<raw_id>",
651 "revision": "<numeric_revision>",
651 "revision": "<numeric_revision>",
652 "short_id": "<short_id>"
652 "short_id": "<short_id>"
653 }
653 }
654 "owner": "<repo_owner>",
654 "owner": "<repo_owner>",
655 "fork_of": "<name_of_fork_parent>",
655 "fork_of": "<name_of_fork_parent>",
656 "members" : [
656 "members" : [
657 {
657 {
658 "type": "user",
658 "type": "user",
659 "user_id" : "<user_id>",
659 "user_id" : "<user_id>",
660 "api_key" : "<api_key>",
660 "api_key" : "<api_key>",
661 "username" : "<username>",
661 "username" : "<username>",
662 "firstname": "<firstname>",
662 "firstname": "<firstname>",
663 "lastname" : "<lastname>",
663 "lastname" : "<lastname>",
664 "email" : "<email>",
664 "email" : "<email>",
665 "emails": "<list_of_all_additional_emails>",
665 "emails": "<list_of_all_additional_emails>",
666 "active" : "<bool>",
666 "active" : "<bool>",
667 "admin" :  "<bool>",
667 "admin" :  "<bool>",
668 "ldap_dn" : "<ldap_dn>",
668 "ldap_dn" : "<ldap_dn>",
669 "last_login": "<last_login>",
669 "last_login": "<last_login>",
670 "permission" : "repository.(read|write|admin)"
670 "permission" : "repository.(read|write|admin)"
671 },
671 },
672
672
673 {
673 {
674 "type": "users_group",
674 "type": "users_group",
675 "id" : "<usersgroupid>",
675 "id" : "<usersgroupid>",
676 "name" : "<usersgroupname>",
676 "name" : "<usersgroupname>",
677 "active": "<bool>",
677 "active": "<bool>",
678 "permission" : "repository.(read|write|admin)"
678 "permission" : "repository.(read|write|admin)"
679 },
679 },
680
680
681 ]
681 ]
682 "followers": [
682 "followers": [
683 {
683 {
684 "user_id" : "<user_id>",
684 "user_id" : "<user_id>",
685 "username" : "<username>",
685 "username" : "<username>",
686 "api_key" : "<api_key>",
686 "api_key" : "<api_key>",
687 "firstname": "<firstname>",
687 "firstname": "<firstname>",
688 "lastname" : "<lastname>",
688 "lastname" : "<lastname>",
689 "email" : "<email>",
689 "email" : "<email>",
690 "emails": "<list_of_all_additional_emails>",
690 "emails": "<list_of_all_additional_emails>",
691 "ip_addresses": "<list_of_ip_addresses_for_user>",
691 "ip_addresses": "<list_of_ip_addresses_for_user>",
692 "active" : "<bool>",
692 "active" : "<bool>",
693 "admin" :  "<bool>",
693 "admin" :  "<bool>",
694 "ldap_dn" : "<ldap_dn>",
694 "ldap_dn" : "<ldap_dn>",
695 "last_login": "<last_login>",
695 "last_login": "<last_login>",
696 },
696 },
697
697
698 ]
698 ]
699 }
699 }
700 error: null
700 error: null
701
701
702
702
703 get_repos
703 get_repos
704 ---------
704 ---------
705
705
706 List all existing repositories.
706 List all existing repositories.
707 This command can only be executed using the api_key of a user with admin rights,
707 This command can only be executed using the api_key of a user with admin rights,
708 or that of a regular user with at least read access to the repository.
708 or that of a regular user with at least read access to the repository.
709
709
710
710
711 INPUT::
711 INPUT::
712
712
713 id : <id_for_response>
713 id : <id_for_response>
714 api_key : "<api_key>"
714 api_key : "<api_key>"
715 method : "get_repos"
715 method : "get_repos"
716 args: { }
716 args: { }
717
717
718 OUTPUT::
718 OUTPUT::
719
719
720 id : <id_given_in_input>
720 id : <id_given_in_input>
721 result: [
721 result: [
722 {
722 {
723 "repo_id" : "<repo_id>",
723 "repo_id" : "<repo_id>",
724 "repo_name" : "<reponame>"
724 "repo_name" : "<reponame>"
725 "repo_type" : "<repo_type>",
725 "repo_type" : "<repo_type>",
726 "clone_uri" : "<clone_uri>",
726 "clone_uri" : "<clone_uri>",
727 "private": : "<bool>",
727 "private": : "<bool>",
728 "created_on" : "<datetimecreated>",
728 "created_on" : "<datetimecreated>",
729 "description" : "<description>",
729 "description" : "<description>",
730 "landing_rev": "<landing_rev>",
730 "landing_rev": "<landing_rev>",
731 "owner": "<repo_owner>",
731 "owner": "<repo_owner>",
732 "fork_of": "<name_of_fork_parent>",
732 "fork_of": "<name_of_fork_parent>",
733 "enable_downloads": "<bool>",
733 "enable_downloads": "<bool>",
734 "enable_locking": "<bool>",
734 "enable_locking": "<bool>",
735 "enable_statistics": "<bool>",
735 "enable_statistics": "<bool>",
736 },
736 },
737
737
738 ]
738 ]
739 error: null
739 error: null
740
740
741
741
742 get_repo_nodes
742 get_repo_nodes
743 --------------
743 --------------
744
744
745 Return a list of files and directories for a given path at the given revision.
745 Return a list of files and directories for a given path at the given revision.
746 It's possible to specify ret_type to show only `files` or `dirs`.
746 It's possible to specify ret_type to show only `files` or `dirs`.
747 This command can only be executed using the api_key of a user with admin rights.
747 This command can only be executed using the api_key of a user with admin rights.
748
748
749
749
750 INPUT::
750 INPUT::
751
751
752 id : <id_for_response>
752 id : <id_for_response>
753 api_key : "<api_key>"
753 api_key : "<api_key>"
754 method : "get_repo_nodes"
754 method : "get_repo_nodes"
755 args: {
755 args: {
756 "repoid" : "<reponame or repo_id>"
756 "repoid" : "<reponame or repo_id>"
757 "revision" : "<revision>",
757 "revision" : "<revision>",
758 "root_path" : "<root_path>",
758 "root_path" : "<root_path>",
759 "ret_type" : "<ret_type> = Optional('all')"
759 "ret_type" : "<ret_type> = Optional('all')"
760 }
760 }
761
761
762 OUTPUT::
762 OUTPUT::
763
763
764 id : <id_given_in_input>
764 id : <id_given_in_input>
765 result: [
765 result: [
766 {
766 {
767 "name" : "<name>"
767 "name" : "<name>"
768 "type" : "<type>",
768 "type" : "<type>",
769 },
769 },
770
770
771 ]
771 ]
772 error: null
772 error: null
773
773
774
774
775 create_repo
775 create_repo
776 -----------
776 -----------
777
777
778 Create a repository. If repository name contains "/", all needed repository
778 Create a repository. If repository name contains "/", all needed repository
779 groups will be created. For example "foo/bar/baz" will create repository groups
779 groups will be created. For example "foo/bar/baz" will create repository groups
780 "foo", "bar" (with "foo" as parent), and create "baz" repository with
780 "foo", "bar" (with "foo" as parent), and create "baz" repository with
781 "bar" as group.
781 "bar" as group.
782 This command can only be executed using the api_key of a user with admin rights,
782 This command can only be executed using the api_key of a user with admin rights,
783 or that of a regular user with create repository permission.
783 or that of a regular user with create repository permission.
784 Regular users cannot specify owner parameter.
784 Regular users cannot specify owner parameter.
785
785
786
786
787 INPUT::
787 INPUT::
788
788
789 id : <id_for_response>
789 id : <id_for_response>
790 api_key : "<api_key>"
790 api_key : "<api_key>"
791 method : "create_repo"
791 method : "create_repo"
792 args: {
792 args: {
793 "repo_name" : "<reponame>",
793 "repo_name" : "<reponame>",
794 "owner" : "<onwer_name_or_id = Optional(=apiuser)>",
794 "owner" : "<onwer_name_or_id = Optional(=apiuser)>",
795 "repo_type" : "<repo_type> = Optional('hg')",
795 "repo_type" : "<repo_type> = Optional('hg')",
796 "description" : "<description> = Optional('')",
796 "description" : "<description> = Optional('')",
797 "private" : "<bool> = Optional(False)",
797 "private" : "<bool> = Optional(False)",
798 "clone_uri" : "<clone_uri> = Optional(None)",
798 "clone_uri" : "<clone_uri> = Optional(None)",
799 "landing_rev" : "<landing_rev> = Optional('tip')",
799 "landing_rev" : "<landing_rev> = Optional('tip')",
800 "enable_downloads": "<bool> = Optional(False)",
800 "enable_downloads": "<bool> = Optional(False)",
801 "enable_locking": "<bool> = Optional(False)",
801 "enable_locking": "<bool> = Optional(False)",
802 "enable_statistics": "<bool> = Optional(False)",
802 "enable_statistics": "<bool> = Optional(False)",
803 }
803 }
804
804
805 OUTPUT::
805 OUTPUT::
806
806
807 id : <id_given_in_input>
807 id : <id_given_in_input>
808 result: {
808 result: {
809 "msg": "Created new repository `<reponame>`",
809 "msg": "Created new repository `<reponame>`",
810 "repo": {
810 "repo": {
811 "repo_id" : "<repo_id>",
811 "repo_id" : "<repo_id>",
812 "repo_name" : "<reponame>"
812 "repo_name" : "<reponame>"
813 "repo_type" : "<repo_type>",
813 "repo_type" : "<repo_type>",
814 "clone_uri" : "<clone_uri>",
814 "clone_uri" : "<clone_uri>",
815 "private": : "<bool>",
815 "private": : "<bool>",
816 "created_on" : "<datetimecreated>",
816 "created_on" : "<datetimecreated>",
817 "description" : "<description>",
817 "description" : "<description>",
818 "landing_rev": "<landing_rev>",
818 "landing_rev": "<landing_rev>",
819 "owner": "<username or user_id>",
819 "owner": "<username or user_id>",
820 "fork_of": "<name_of_fork_parent>",
820 "fork_of": "<name_of_fork_parent>",
821 "enable_downloads": "<bool>",
821 "enable_downloads": "<bool>",
822 "enable_locking": "<bool>",
822 "enable_locking": "<bool>",
823 "enable_statistics": "<bool>",
823 "enable_statistics": "<bool>",
824 },
824 },
825 }
825 }
826 error: null
826 error: null
827
827
828
828
829 fork_repo
829 fork_repo
830 ---------
830 ---------
831
831
832 Create a fork of given repo. If using celery, this will
832 Create a fork of given repo. If using celery, this will
833 return success message immidiatelly and fork will be created
833 return success message immidiatelly and fork will be created
834 asynchronously.
834 asynchronously.
835 This command can only be executed using the api_key of a user with admin rights,
835 This command can only be executed using the api_key of a user with admin rights,
836 or that of a regular user with fork permission and at least read access to the repository.
836 or that of a regular user with fork permission and at least read access to the repository.
837 Regular users cannot specify owner parameter.
837 Regular users cannot specify owner parameter.
838
838
839
839
840 INPUT::
840 INPUT::
841
841
842 id : <id_for_response>
842 id : <id_for_response>
843 api_key : "<api_key>"
843 api_key : "<api_key>"
844 method : "fork_repo"
844 method : "fork_repo"
845 args: {
845 args: {
846 "repoid" : "<reponame or repo_id>",
846 "repoid" : "<reponame or repo_id>",
847 "fork_name": "<forkname>",
847 "fork_name": "<forkname>",
848 "owner": "<username or user_id = Optional(=apiuser)>",
848 "owner": "<username or user_id = Optional(=apiuser)>",
849 "description": "<description>",
849 "description": "<description>",
850 "copy_permissions": "<bool>",
850 "copy_permissions": "<bool>",
851 "private": "<bool>",
851 "private": "<bool>",
852 "landing_rev": "<landing_rev>"
852 "landing_rev": "<landing_rev>"
853
853
854 }
854 }
855
855
856 OUTPUT::
856 OUTPUT::
857
857
858 id : <id_given_in_input>
858 id : <id_given_in_input>
859 result: {
859 result: {
860 "msg": "Created fork of `<reponame>` as `<forkname>`",
860 "msg": "Created fork of `<reponame>` as `<forkname>`",
861 "success": true
861 "success": true
862 }
862 }
863 error: null
863 error: null
864
864
865
865
866 delete_repo
866 delete_repo
867 -----------
867 -----------
868
868
869 Delete a repository.
869 Delete a repository.
870 This command can only be executed using the api_key of a user with admin rights,
870 This command can only be executed using the api_key of a user with admin rights,
871 or that of a regular user with admin access to the repository.
871 or that of a regular user with admin access to the repository.
872 When `forks` param is set it's possible to detach or delete forks of the deleted repository.
872 When `forks` param is set it's possible to detach or delete forks of the deleted repository.
873
873
874
874
875 INPUT::
875 INPUT::
876
876
877 id : <id_for_response>
877 id : <id_for_response>
878 api_key : "<api_key>"
878 api_key : "<api_key>"
879 method : "delete_repo"
879 method : "delete_repo"
880 args: {
880 args: {
881 "repoid" : "<reponame or repo_id>",
881 "repoid" : "<reponame or repo_id>",
882 "forks" : "`delete` or `detach` = Optional(None)"
882 "forks" : "`delete` or `detach` = Optional(None)"
883 }
883 }
884
884
885 OUTPUT::
885 OUTPUT::
886
886
887 id : <id_given_in_input>
887 id : <id_given_in_input>
888 result: {
888 result: {
889 "msg": "Deleted repository `<reponame>`",
889 "msg": "Deleted repository `<reponame>`",
890 "success": true
890 "success": true
891 }
891 }
892 error: null
892 error: null
893
893
894
894
895 grant_user_permission
895 grant_user_permission
896 ---------------------
896 ---------------------
897
897
898 Grant permission for user on given repository, or update existing one if found.
898 Grant permission for user on given repository, or update existing one if found.
899 This command can only be executed using the api_key of a user with admin rights.
899 This command can only be executed using the api_key of a user with admin rights.
900
900
901
901
902 INPUT::
902 INPUT::
903
903
904 id : <id_for_response>
904 id : <id_for_response>
905 api_key : "<api_key>"
905 api_key : "<api_key>"
906 method : "grant_user_permission"
906 method : "grant_user_permission"
907 args: {
907 args: {
908 "repoid" : "<reponame or repo_id>"
908 "repoid" : "<reponame or repo_id>"
909 "userid" : "<username or user_id>"
909 "userid" : "<username or user_id>"
910 "perm" : "(repository.(none|read|write|admin))",
910 "perm" : "(repository.(none|read|write|admin))",
911 }
911 }
912
912
913 OUTPUT::
913 OUTPUT::
914
914
915 id : <id_given_in_input>
915 id : <id_given_in_input>
916 result: {
916 result: {
917 "msg" : "Granted perm: `<perm>` for user: `<username>` in repo: `<reponame>`",
917 "msg" : "Granted perm: `<perm>` for user: `<username>` in repo: `<reponame>`",
918 "success": true
918 "success": true
919 }
919 }
920 error: null
920 error: null
921
921
922
922
923 revoke_user_permission
923 revoke_user_permission
924 ----------------------
924 ----------------------
925
925
926 Revoke permission for user on given repository.
926 Revoke permission for user on given repository.
927 This command can only be executed using the api_key of a user with admin rights.
927 This command can only be executed using the api_key of a user with admin rights.
928
928
929
929
930 INPUT::
930 INPUT::
931
931
932 id : <id_for_response>
932 id : <id_for_response>
933 api_key : "<api_key>"
933 api_key : "<api_key>"
934 method : "revoke_user_permission"
934 method : "revoke_user_permission"
935 args: {
935 args: {
936 "repoid" : "<reponame or repo_id>"
936 "repoid" : "<reponame or repo_id>"
937 "userid" : "<username or user_id>"
937 "userid" : "<username or user_id>"
938 }
938 }
939
939
940 OUTPUT::
940 OUTPUT::
941
941
942 id : <id_given_in_input>
942 id : <id_given_in_input>
943 result: {
943 result: {
944 "msg" : "Revoked perm for user: `<username>` in repo: `<reponame>`",
944 "msg" : "Revoked perm for user: `<username>` in repo: `<reponame>`",
945 "success": true
945 "success": true
946 }
946 }
947 error: null
947 error: null
948
948
949
949
950 grant_user_group_permission
950 grant_user_group_permission
951 ---------------------------
951 ---------------------------
952
952
953 Grant permission for user group on given repository, or update
953 Grant permission for user group on given repository, or update
954 existing one if found.
954 existing one if found.
955 This command can only be executed using the api_key of a user with admin rights.
955 This command can only be executed using the api_key of a user with admin rights.
956
956
957
957
958 INPUT::
958 INPUT::
959
959
960 id : <id_for_response>
960 id : <id_for_response>
961 api_key : "<api_key>"
961 api_key : "<api_key>"
962 method : "grant_user_group_permission"
962 method : "grant_user_group_permission"
963 args: {
963 args: {
964 "repoid" : "<reponame or repo_id>"
964 "repoid" : "<reponame or repo_id>"
965 "usersgroupid" : "<user group id or name>"
965 "usersgroupid" : "<user group id or name>"
966 "perm" : "(repository.(none|read|write|admin))",
966 "perm" : "(repository.(none|read|write|admin))",
967 }
967 }
968
968
969 OUTPUT::
969 OUTPUT::
970
970
971 id : <id_given_in_input>
971 id : <id_given_in_input>
972 result: {
972 result: {
973 "msg" : "Granted perm: `<perm>` for group: `<usersgroupname>` in repo: `<reponame>`",
973 "msg" : "Granted perm: `<perm>` for group: `<usersgroupname>` in repo: `<reponame>`",
974 "success": true
974 "success": true
975 }
975 }
976 error: null
976 error: null
977
977
978
978
979 revoke_user_group_permission
979 revoke_user_group_permission
980 ----------------------------
980 ----------------------------
981
981
982 Revoke permission for user group on given repository.
982 Revoke permission for user group on given repository.
983 This command can only be executed using the api_key of a user with admin rights.
983 This command can only be executed using the api_key of a user with admin rights.
984
984
985 INPUT::
985 INPUT::
986
986
987 id : <id_for_response>
987 id : <id_for_response>
988 api_key : "<api_key>"
988 api_key : "<api_key>"
989 method : "revoke_user_group_permission"
989 method : "revoke_user_group_permission"
990 args: {
990 args: {
991 "repoid" : "<reponame or repo_id>"
991 "repoid" : "<reponame or repo_id>"
992 "usersgroupid" : "<user group id or name>"
992 "usersgroupid" : "<user group id or name>"
993 }
993 }
994
994
995 OUTPUT::
995 OUTPUT::
996
996
997 id : <id_given_in_input>
997 id : <id_given_in_input>
998 result: {
998 result: {
999 "msg" : "Revoked perm for group: `<usersgroupname>` in repo: `<reponame>`",
999 "msg" : "Revoked perm for group: `<usersgroupname>` in repo: `<reponame>`",
1000 "success": true
1000 "success": true
1001 }
1001 }
1002 error: null
1002 error: null
@@ -1,51 +1,160 b''
1 .. _contributing:
1 .. _contributing:
2
2
3 =========================
3 =========================
4 Contributing to Kallithea
4 Contributing to Kallithea
5 =========================
5 =========================
6
6
7 If you would like to contribute to Kallithea, please contact us, any help is
7 Kallithea is developed and maintained by its users. Please join us and scratch
8 greatly appreciated!
8 your own itch.
9
10
11 Infrastructure
12 --------------
9
13
10 Could I request that you make your source contributions by first forking the
14 The main repository is hosted at Our Own Kallithea (aka OOK) on
11 Kallithea repository on bitbucket_
15 https://kallithea-scm.org/repos/kallithea/ (which is our self-hosted instance
12 https://bitbucket.org/conservancy/kallithea and then make your changes to
16 of Kallithea).
13 your forked repository. Please post all fixes into **dev** bookmark since your
14 change might be already fixed there and i try to merge all fixes from dev into
15 stable, and not the other way. Finally, when you are finished with your changes,
16 please send us a pull request.
17
17
18 To run Kallithea in a development version you always need to install the latest
18 For now, we use Bitbucket_ for `Pull Requests`_ and `Issue Tracker`_ services. The
19 required libs. Simply clone Kallithea and switch to beta branch::
19 issue tracker is for tracking bugs, not for "support", discussion or ideas -
20 please use the `mailing list`_ to reach the community.
21
22 We use Weblate_ to translate the user interface messages into languages other
23 than English. Join our project on `Hosted Weblate`_ to help us.
24 To register, you can use your Bitbucket or GitHub account.
25
20
26
21 hg clone https://kallithea-scm.org/repos/kallithea
27 Getting started
28 ---------------
22
29
23 after downloading/pulling Kallithea make sure you run::
30 To get started with development::
24
25 python setup.py develop
26
31
27 command to install/verify all required packages, and prepare development
32 hg clone https://kallithea-scm.org/repos/kallithea
28 enviroment.
33 cd kallithea
34 virtualenv ../kallithea-venv
35 source ../kallithea-venv/bin/activate
36 python setup.py develop
37 paster make-config Kallithea my.ini
38 paster setup-db my.ini --user=user --email=user@example.com --password=password --repos=/tmp
39 paster serve my.ini --reload &
40 firefox http://127.0.0.1:5000/
29
41
30 There are two files in the directory production.ini and developement.ini copy
42 You can also start out by forking https://bitbucket.org/conservancy/kallithea
31 the `development.ini` file as rc.ini (which is excluded from version controll)
43 on Bitbucket_ and create a local clone of your own fork.
32 and put all your changes like db connection or server port in there.
44
33
45
34 After finishing your changes make sure all tests passes ok. You can run
46 Running tests
47 -------------
48
49 After finishing your changes make sure all tests pass cleanly. You can run
35 the testsuite running ``nosetest`` from the project root, or if you use tox
50 the testsuite running ``nosetest`` from the project root, or if you use tox
36 run tox for python2.6-2.7 with multiple database test. When using `nosetests`
51 run tox for python2.6-2.7 with multiple database test. When using `nosetests`
37 test.ini file is used and by default it uses sqlite for tests, edit this file
52 test.ini file is used and by default it uses sqlite for tests, edit this file
38 to change your testing enviroment.
53 to change your testing enviroment.
39
54
40
41 There's a special set of tests for push/pull operations, you can runn them using::
55 There's a special set of tests for push/pull operations, you can runn them using::
42
56
43 paster serve test.ini --pid-file=test.pid --daemon
57 paster serve test.ini --pid-file=test.pid --daemon
44 KALLITHEA_WHOOSH_TEST_DISABLE=1 KALLITHEA_NO_TMP_PATH=1 nosetests -x kallithea/tests/other/test_vcs_operations.py
58 KALLITHEA_WHOOSH_TEST_DISABLE=1 KALLITHEA_NO_TMP_PATH=1 nosetests -x kallithea/tests/other/test_vcs_operations.py
45 kill -9 $(cat test.pid)
59 kill -9 $(cat test.pid)
46
60
47
61
48 | Thank you for any contributions!
62 Coding/contribution guidelines
63 ------------------------------
64
65 Kallithea is GPLv3 and we assume all contributions are made by the
66 committer/contributor and under GPLv3 unless explicitly stated. We do care a
67 lot about preservation of copyright and license information for existing code
68 that is brought into the project.
69
70 We don't have a formal coding/formatting standard. We are currently using a mix
71 of Mercurial (http://mercurial.selenic.com/wiki/CodingStyle), pep8, and
72 consistency with existing code. Run whitespacecleanup.sh to avoid stupid
73 whitespace noise in your patches.
74
75 We support both Python 2.6.x and 2.7.x and nothing else. For now we don't care
76 about Python 3 compatibility.
77
78 We try to support the most common modern web browsers. IE8 is still supported
79 to the extent it is feasible but we may stop supporting it very soon.
80
81 We primarily support Linux and OS X on the server side but Windows should also work.
82
83 Html templates should use 2 spaces for indentation ... but be pragmatic. We
84 should use templates cleverly and avoid duplication. We should use reasonable
85 semantic markup with classes and ids that can be used for styling and testing.
86 We should only use inline styles in places where it really is semantic (such as
87 display:none).
88
89 JavaScript must use ';' between/after statements. Indentation 4 spaces. Inline
90 multiline functions should be indented two levels - one for the () and one for
91 {}. jQuery value arrays should have a leading $.
92
93 Commit messages should have a leading short line summarizing the changes. For
94 bug fixes, put "(Issue #123)" at the end of this line.
95
96 Contributions will be accepted in most formats - such as pull requests on
97 bitbucket, something hosted on your own Kallithea instance, or patches sent by
98 mail to the kallithea-general mailing list.
99
100 Make sure to test your changes both manually and with the automatic tests
101 before posting.
102
103 We care about quality and review and keeping a clean repository history. We
104 might give feedback that requests polishing contributions until they are
105 "perfect". We might also rebase and collapse and make minor adjustments to your
106 changes when we apply them.
107
108 We try to make sure we have consensus on the direction the project is taking.
109 Everything non-sensitive should be discussed in public - preferably on the
110 mailing list. We aim at having all non-trivial changes reviewed by at least
111 one other core developer before pushing. Obvious non-controversial changes will
112 be handled more casually.
113
114 For now we just have one official branch ("default") and will keep it so stable
115 that it can be (and is) used in production. Experimental changes should live
116 elsewhere (for example in a pull request) until they are ready.
49
117
50
118
119 "Roadmap"
120 ---------
121
122 We do not have a road map but are waiting for your contributions. Here are some
123 ideas of places we might want to go - contributions in these areas are very
124 welcome:
125
126 * Front end:
127 * kill YUI - more jQuery
128 * remove other dependencies - especially the embedded cut'n'pasted ones
129 * remove hardcoded styling in templates, make markup more semantic while moving all styling to css
130 * switch to bootstrap or some other modern UI library and cleanup of style.css and contextbar.css
131 * new fancy style that looks good
132 * testing
133 * better test coverage with the existing high level test framework
134 * test even more high level and javascript - selenium/robot and splinter seems like the top candidates
135 * more unit testing
136 * code cleanup
137 * move code from templates to controllers and from controllers to libs or models
138 * more best practice for web apps and the frameworks
139 * features
140 * relax dependency version requirements after thorough testing
141 * support for evolve
142 * updates of PRs ... while preserving history and comment context
143 * auto pr merge/rebase
144 * ssh
145 * bitbucket compatible wiki
146 * realtime preview / wysiwyg when editing comments and files
147 * make journal more useful - filtering on branches and files
148 * community mode with self registration and personal space
149 * improve documentation
150
151 Thank you for your contribution!
152 --------------------------------
153
154
155 .. _Weblate: http://weblate.org/
156 .. _Issue Tracker: https://bitbucket.org/conservancy/kallithea/issues?status=new&status=open
157 .. _Pull Requests: https://bitbucket.org/conservancy/kallithea/pull-requests
51 .. _bitbucket: http://bitbucket.org/
158 .. _bitbucket: http://bitbucket.org/
159 .. _mailing list: http://lists.sfconservancy.org/mailman/listinfo/kallithea-general
160 .. _Hosted Weblate: https://hosted.weblate.org/projects/kallithea/kallithea/
@@ -1,67 +1,71 b''
1 .. _index:
1 .. _index:
2
2
3 .. include:: ./../README.rst
3 Administrators Guide
4 --------------------
5
6 **Readme**
4
7
5 Users Guide
8 .. toctree::
6 -----------
9 :maxdepth: 1
7
10
8 **Installation:**
11 readme
12
13 **Installation**
9
14
10 .. toctree::
15 .. toctree::
11 :maxdepth: 1
16 :maxdepth: 1
12
17
13 installation
18 installation
14 upgrade
15 installation_win
19 installation_win
16 installation_win_old
20 installation_win_old
17 installation_iis
21 installation_iis
18 setup
22 setup
19
23
20 **Usage**
24 **Usage**
21
25
22 .. toctree::
26 .. toctree::
23 :maxdepth: 1
27 :maxdepth: 1
24
28
25 usage/general
29 usage/general
26 usage/git_support
30 usage/git_support
27 usage/performance
31 usage/performance
28 usage/locking
32 usage/locking
29 usage/statistics
33 usage/statistics
30 usage/backup
34 usage/backup
31 usage/subrepos
35 usage/subrepos
32 usage/debugging
36 usage/debugging
33 usage/troubleshooting
37 usage/troubleshooting
34
38
35 **Develop**
39 **Develop**
36
40
37 .. toctree::
41 .. toctree::
38 :maxdepth: 1
42 :maxdepth: 1
39
43
40 contributing
44 contributing
41 changelog
45 changelog
42
46
43 **API**
47 **API**
44
48
45 .. toctree::
49 .. toctree::
46 :maxdepth: 1
50 :maxdepth: 1
47
51
48 api/api
52 api/api
49 api/models
53 api/models
50
54
51
55
52 Other topics
56 Other topics
53 ------------
57 ------------
54
58
55 * :ref:`genindex`
59 * :ref:`genindex`
56 * :ref:`search`
60 * :ref:`search`
57
61
58 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
62 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
59 .. _python: http://www.python.org/
63 .. _python: http://www.python.org/
60 .. _django: http://www.djangoproject.com/
64 .. _django: http://www.djangoproject.com/
61 .. _mercurial: http://mercurial.selenic.com/
65 .. _mercurial: http://mercurial.selenic.com/
62 .. _bitbucket: http://bitbucket.org/
66 .. _bitbucket: http://bitbucket.org/
63 .. _subversion: http://subversion.tigris.org/
67 .. _subversion: http://subversion.tigris.org/
64 .. _git: http://git-scm.com/
68 .. _git: http://git-scm.com/
65 .. _celery: http://celeryproject.org/
69 .. _celery: http://celeryproject.org/
66 .. _Sphinx: http://sphinx.pocoo.org/
70 .. _Sphinx: http://sphinx.pocoo.org/
67 .. _vcs: http://pypi.python.org/pypi/vcs
71 .. _vcs: http://pypi.python.org/pypi/vcs
@@ -1,133 +1,201 b''
1 .. _installation:
1 .. _installation:
2
2
3 ==========================
3 ==========================
4 Installation on Unix/Linux
4 Installation on Unix/Linux
5 ==========================
5 ==========================
6
6
7 ``Kallithea`` is written entirely in Python. Before posting any issues make
7 ``Kallithea`` is written entirely in Python. Kallithea requires Python version
8 sure, your not missing any system libraries and using right version of
8 2.6 or higher.
9 libraries required by Kallithea. There's also restriction in terms of mercurial
9
10 clients. Minimal version of hg client known working fine with Kallithea is
10 .. Note:: Alternative very detailed installation instructions for Ubuntu Server
11 **1.6**. If you're using older client, please upgrade.
11 with celery, indexer and daemon scripts: https://gist.github.com/4546398
12
12
13
13
14 Installing Kallithea from PyPI (aka "Cheeseshop")
14 Installing Kallithea from Python Package Index (PyPI)
15 -------------------------------------------------
15 -----------------------------------------------------
16
17 Kallithea requires python version 2.6 or higher.
18
16
19 The easiest way to install ``kallithea`` is to run::
17 ``Kallithea`` can be installed from PyPI with::
20
21 easy_install kallithea
22
23 Or::
24
18
25 pip install kallithea
19 pip install kallithea
26
20
27 If you prefer to install Kallithea manually simply grab latest release from
28 http://pypi.python.org/pypi/Kallithea, decompress the archive and run::
29
21
30 python setup.py install
22 Installation in virtualenv
31
23 --------------------------
32 Step by step installation example for Windows
33 ---------------------------------------------
34
35 :ref:`installation_win`
36
37
24
38 Step by step installation example for Linux
25 It is highly recommended to use a separate virtualenv_ for installing Kallithea.
39 -------------------------------------------
26 This way, all libraries required by Kallithea will be installed separately from your
40
27 main Python installation and things will be less problematic when upgrading the
28 system or Kallithea.
29 An additional benefit of virtualenv_ is that it doesn't require root privileges.
41
30
42 For installing Kallithea i highly recommend using separate virtualenv_. This
31 - Assuming you have installed virtualenv_, create a new virtual environment
43 way many required by Kallithea libraries will remain sandboxed from your main
44 python and making things less problematic when doing system python updates.
45
46 Alternative very detailed installation instructions for Ubuntu Server with
47 celery, indexer and daemon scripts: https://gist.github.com/4546398
48
49
50 - Assuming you have installed virtualenv_ create a new virtual environment
51 using virtualenv command::
32 using virtualenv command::
52
33
53 virtualenv --no-site-packages /opt/kallithea-venv
34 virtualenv /srv/kallithea/venv
54
35
36 .. note:: Older versions of virtualenv required ``--no-site-packages`` to work
37 correctly. It should no longer be necessary.
55
38
56 .. note:: Using ``--no-site-packages`` when generating your
39 - this will install new virtualenv_ into `/srv/kallithea/venv`.
57 virtualenv is **very important**. This flag provides the necessary
40 - Activate the virtualenv_ in your current shell session by running::
58 isolation for running the set of packages required by
59 Kallithea. If you do not specify ``--no-site-packages``,
60 it's possible that Kallithea will not install properly into
61 the virtualenv, or, even if it does, may not run properly,
62 depending on the packages you've already got installed into your
63 Python's "main" site-packages dir.
64
41
65
42 source /srv/kallithea/venv/bin/activate
66 - this will install new virtualenv_ into `/opt/kallithea-venv`.
67 - Activate the virtualenv_ by running::
68
69 source /opt/kallithea-venv/bin/activate
70
43
71 .. note:: If you're using UNIX, *do not* use ``sudo`` to run the
44 .. note:: If you're using UNIX, *do not* use ``sudo`` to run the
72 ``virtualenv`` script. It's perfectly acceptable (and desirable)
45 ``virtualenv`` script. It's perfectly acceptable (and desirable)
73 to create a virtualenv as a normal user.
46 to create a virtualenv as a normal user.
74
47
75 - Make a folder for Kallithea data files, and configuration somewhere on the
48 - Make a folder for Kallithea data files, and configuration somewhere on the
76 filesystem. For example::
49 filesystem. For example::
77
50
78 mkdir /opt/kallithea
51 mkdir /srv/kallithea
79
80
52
81 - Go into the created directory run this command to install kallithea::
53 - Go into the created directory run this command to install kallithea::
82
54
83 easy_install kallithea
84
85 or::
86
87 pip install kallithea
55 pip install kallithea
88
56
57 Alternatively, download a .tar.gz from http://pypi.python.org/pypi/Kallithea,
58 extract it and run::
59
60 python setup.py install
61
89 - This will install Kallithea together with pylons and all other required
62 - This will install Kallithea together with pylons and all other required
90 python libraries into activated virtualenv
63 python libraries into the activated virtualenv.
64
91
65
92 Requirements for Celery (optional)
66 Requirements for Celery (optional)
93 ----------------------------------
67 ----------------------------------
94
68
95 In order to gain maximum performance
69 In order to gain maximum performance
96 there are some third-party you must install. When Kallithea is used
70 there are some third-party you must install. When Kallithea is used
97 together with celery you have to install some kind of message broker,
71 together with celery you have to install some kind of message broker,
98 recommended one is rabbitmq_ to make the async tasks work.
72 recommended one is rabbitmq_ to make the async tasks work.
99
73
100 Of course Kallithea works in sync mode also and then you do not have to install
74 Of course Kallithea works in sync mode also and then you do not have to install
101 any third party applications. However, using Celery_ will give you a large
75 any third party applications. However, using Celery_ will give you a large
102 speed improvement when using many big repositories. If you plan to use
76 speed improvement when using many big repositories. If you plan to use
103 Kallithea for say 7 to 10 repositories, Kallithea will perform perfectly well
77 Kallithea for say 7 to 10 repositories, Kallithea will perform perfectly well
104 without celery running.
78 without celery running.
105
79
106 If you make the decision to run Kallithea with celery make sure you run
80 If you make the decision to run Kallithea with celery make sure you run
107 celeryd using paster and message broker together with the application.
81 celeryd using paster and message broker together with the application.
108
82
109 .. note::
83 .. note::
110 Installing message broker and using celery is optional, Kallithea will
84 Installing message broker and using celery is optional, Kallithea will
111 work perfectly fine without them.
85 work perfectly fine without them.
112
86
113
87
114 **Message Broker**
88 **Message Broker**
115
89
116 - preferred is `RabbitMq <http://www.rabbitmq.com/>`_
90 - preferred is `RabbitMq <http://www.rabbitmq.com/>`_
117 - A possible alternative is `Redis <http://code.google.com/p/redis/>`_
91 - A possible alternative is `Redis <http://code.google.com/p/redis/>`_
118
92
119 For installation instructions you can visit:
93 For installation instructions you can visit:
120 http://ask.github.com/celery/getting-started/index.html.
94 http://ask.github.com/celery/getting-started/index.html.
121 This is a very nice tutorial on how to start using celery_ with rabbitmq_
95 This is a very nice tutorial on how to start using celery_ with rabbitmq_
122
96
123
97
124 You can now proceed to :ref:`setup`
98 Next
125 -----------------------------------
99 ----
100
101 You can now proceed to :ref:`setup`.
102
103
104 Upgrading Kallithea from Python Package Index (PyPI)
105 -----------------------------------------------------
106
107 .. note::
108 Firstly, it is recommended that you **always** perform a database and
109 configuration backup before doing an upgrade.
110
111 (These directions will use '{version}' to note that this is the version of
112 Kallithea that these files were used with. If backing up your Kallithea
113 instance from version 0.1 to 0.2, the ``my.ini`` file could be
114 backed up to ``my.ini.0-1``.)
115
116
117 If using a sqlite database, stop the Kallithea process/daemon/service, and
118 then make a copy of the database file::
119
120 service kallithea stop
121 cp kallithea.db kallithea.db.{version}
122
123
124 Back up your configuration file::
125
126 cp my.ini my.ini.{version}
127
128
129 Ensure that you are using the Python Virtual Environment that you'd originally
130 installed Kallithea in::
131
132 pip freeze
133
134 will list all packages installed in the current environment. If Kallithea
135 isn't listed, change virtual environments to your venv location::
136
137 source /srv/kallithea/venv/bin/activate
138
139
140 Once you have verified the environment you can upgrade ``Kallithea`` with::
141
142 pip install --upgrade kallithea
143
144
145 Then run the following command from the installation directory::
126
146
147 paster make-config Kallithea my.ini
148
149 This will display any changes made by the new version of Kallithea to your
150 current configuration. It will try to perform an automerge. It's recommended
151 that you re-check the content after the automerge.
152
153 .. note::
154 Please always make sure your .ini files are up to date. Often errors are
155 caused by missing params added in new versions.
156
157
158 It is also recommended that you rebuild the whoosh index after upgrading since
159 the new whoosh version could introduce some incompatible index changes. Please
160 read the changelog to see if there were any changes to whoosh.
161
162
163 The final step is to upgrade the database. To do this simply run::
164
165 paster upgrade-db my.ini
166
167 This will upgrade the schema and update some of the defaults in the database,
168 and will always recheck the settings of the application, if there are no new
169 options that need to be set.
170
171
172 .. note::
173 DB schema upgrade library has some limitations and can sometimes fail if you try to
174 upgrade from older major releases. In such case simply run upgrades sequentially, eg.
175 upgrading from 0.1.X to 0.3.X should be done like that: 0.1.X. > 0.2.X > 0.3.X
176 You can always specify what version of Kallithea you want to install for example in pip
177 `pip install Kallithea==0.2`
178
179 You may find it helpful to clear out your log file so that new errors are
180 readily apparent::
181
182 echo > kallithea.log
183
184 Once that is complete, you may now start your upgraded Kallithea Instance::
185
186 service kallithea start
187
188 Or::
189
190 paster serve /srv/kallithea/my.ini
191
192 .. note::
193 If you're using Celery, make sure you restart all instances of it after
194 upgrade.
127
195
128
196
129 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
197 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
130 .. _python: http://www.python.org/
198 .. _python: http://www.python.org/
131 .. _mercurial: http://mercurial.selenic.com/
199 .. _mercurial: http://mercurial.selenic.com/
132 .. _celery: http://celeryproject.org/
200 .. _celery: http://celeryproject.org/
133 .. _rabbitmq: http://www.rabbitmq.com/
201 .. _rabbitmq: http://www.rabbitmq.com/
@@ -1,238 +1,239 b''
1 .. _installation_win:
1 .. _installation_win:
2
2
3
3
4 Installation and upgrade on Windows (7/Server 2008 R2 and newer)
4 Installation and upgrade on Windows (7/Server 2008 R2 and newer)
5 ================================================================
5 ================================================================
6
6
7 First time install
7 First time install
8 ::::::::::::::::::
8 ::::::::::::::::::
9
9
10 Target OS: Windows 7 and newer or Windows Server 2008 R2 and newer
10 Target OS: Windows 7 and newer or Windows Server 2008 R2 and newer
11
11
12 Tested on Windows 8.1, Windows Server 2008 R2 and Windows Server 2012
12 Tested on Windows 8.1, Windows Server 2008 R2 and Windows Server 2012
13
13
14 To install on an older version of Windows, see `<installation_win_old.html>`_
14 To install on an older version of Windows, see `<installation_win_old.html>`_
15
15
16
16
17 Step 1 - Install Python
17 Step 1 - Install Python
18 -----------------------
18 -----------------------
19
19
20 Install Python 2.x.y (x = 6 or 7). Latest version is recommended. If you need another version, they can run side by side.
20 Install Python 2.x.y (x = 6 or 7). Latest version is recommended. If you need another version, they can run side by side.
21
21
22 DO NOT USE A 3.x version.
22 DO NOT USE A 3.x version.
23
23
24 - Download Python 2.x.y from http://www.python.org/download/
24 - Download Python 2.x.y from http://www.python.org/download/
25 - Choose and click on the version
25 - Choose and click on the version
26 - Click on "Windows X86-64 Installer" for x64 or "Windows x86 MSI installer" for Win32.
26 - Click on "Windows X86-64 Installer" for x64 or "Windows x86 MSI installer" for Win32.
27 - Disable UAC or run the installer with admin privileges. If you chose to disable UAC, do not forget to reboot afterwards.
27 - Disable UAC or run the installer with admin privileges. If you chose to disable UAC, do not forget to reboot afterwards.
28
28
29 While writing this Guide, the latest version was v2.7.9.
29 While writing this Guide, the latest version was v2.7.9.
30 Remember the specific major and minor versions installed, because they will
30 Remember the specific major and minor versions installed, because they will
31 be needed in the next step. In this case, it is "2.7".
31 be needed in the next step. In this case, it is "2.7".
32
32
33
33
34 Step 2 - Python BIN
34 Step 2 - Python BIN
35 -------------------
35 -------------------
36
36
37 Add Python BIN folder to the path
37 Add Python BIN folder to the path
38
38
39 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 later.
39 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 later.
40
40
41 Open a CMD and type::
41 Open a CMD and type::
42
42
43 SETX PATH "%PATH%;[your-python-path]" /M
43 SETX PATH "%PATH%;[your-python-path]" /M
44
44
45 Please substitute [your-python-path] with your Python installation path. Typically: C:\\Python27
45 Please substitute [your-python-path] with your Python installation path. Typically: C:\\Python27
46
46
47
47
48 Step 3 - Install Win32py extensions
48 Step 3 - Install Win32py extensions
49 -----------------------------------
49 -----------------------------------
50
50
51 Download pywin32 from:
51 Download pywin32 from:
52 http://sourceforge.net/projects/pywin32/files/
52 http://sourceforge.net/projects/pywin32/files/
53
53
54 - Click on "pywin32" folder
54 - Click on "pywin32" folder
55 - Click on the first folder (in this case, Build 219, maybe newer when you try)
55 - Click on the first folder (in this case, Build 219, maybe newer when you try)
56 - Choose the file ending with ".amd64-py2.x.exe" (".win32-py2.x.exe" for Win32) -> x being the minor version of Python you installed (in this case, 7).
56 - Choose the file ending with ".amd64-py2.x.exe" (".win32-py2.x.exe" for Win32) -> x being the minor version of Python you installed (in this case, 7).
57 When writing this Guide, the file was:
57 When writing this Guide, the file was:
58 http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/pywin32-219.win-amd64-py2.7.exe/download (x64)
58 http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/pywin32-219.win-amd64-py2.7.exe/download (x64)
59 http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/pywin32-219.win32-py2.7.exe/download (Win32)
59 http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/pywin32-219.win32-py2.7.exe/download (Win32)
60
60
61
61
62 Step 4 - Install pip
62 Step 4 - Install pip
63 --------------------
63 --------------------
64
64
65 pip is a package management system for Python. You will need it to install Kallithea and its dependencies.
65 pip is a package management system for Python. You will need it to install Kallithea and its dependencies.
66
66
67 If you installed Python 2.7.9+, you already have it (as long as you ran the installer with admin privileges or disabled UAC).
67 If you installed Python 2.7.9+, you already have it (as long as you ran the installer with admin privileges or disabled UAC).
68
68
69 If it was not installed or if you are using Python>=2.6,<2.7.9:
69 If it was not installed or if you are using Python>=2.6,<2.7.9:
70
70
71 - Go to https://bootstrap.pypa.io
71 - Go to https://bootstrap.pypa.io
72 - Right-click on get-pip.py and choose Saves as...
72 - Right-click on get-pip.py and choose Saves as...
73 - Run "python get-pip.py" in the folder where you downloaded get-pip.py (may require admin access).
73 - Run "python get-pip.py" in the folder where you downloaded get-pip.py (may require admin access).
74
74 (See http://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows for explanations or alternatives)
75 (See http://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows for explanations or alternatives)
75
76
76 Note that pip.exe will be placed inside your Python installation's Scripts folder, which is likely not on your path.
77 Note that pip.exe will be placed inside your Python installation's Scripts folder, which is likely not on your path.
77
78
78 Open a CMD and type::
79 Open a CMD and type::
79
80
80 SETX PATH "%PATH%;[your-python-path]\Scripts" /M
81 SETX PATH "%PATH%;[your-python-path]\Scripts" /M
81
82
82
83
83 Step 5 - Kallithea Folder Structure
84 Step 5 - Kallithea Folder Structure
84 -----------------------------------
85 -----------------------------------
85
86
86 Create a Kallithea folder structure.
87 Create a Kallithea folder structure.
87
88
88 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 with NO SPACES are recommended. But you can try it if you are brave...
89 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 with NO SPACES are recommended. But you can try it if you are brave...
89
90
90 Create the following folder structure::
91 Create the following folder structure::
91
92
92 C:\Kallithea
93 C:\Kallithea
93 C:\Kallithea\Bin
94 C:\Kallithea\Bin
94 C:\Kallithea\Env
95 C:\Kallithea\Env
95 C:\Kallithea\Repos
96 C:\Kallithea\Repos
96
97
97
98
98 Step 6 - Install virtualenv
99 Step 6 - Install virtualenv
99 ---------------------------
100 ---------------------------
100
101
101 .. note::
102 .. note::
102 A python virtual environment will allow for isolation between the Python packages of your system and those used for Kallithea.
103 A python virtual environment will allow for isolation between the Python packages of your system and those used for Kallithea.
103 It is strongly recommended to use it to ensure that Kallithea does not change a dependency that another software uses or vice versa.
104 It is strongly recommended to use it to ensure that Kallithea does not change a dependency that another software uses or vice versa.
104 If you are using your server (or VM) only for Kallithea, you can skip this step, at your own risk.
105 If you are using your server (or VM) only for Kallithea, you can skip this step, at your own risk.
105
106
106 Install Virtual Env for Python
107 Install Virtual Env for Python
107
108
108 In a command prompt type::
109 In a command prompt type::
109
110
110 pip install virtualenv
111 pip install virtualenv
111
112
112 Virtualenv will now be inside your Python Scripts path (C:\\Python27\\Scripts or similar).
113 Virtualenv will now be inside your Python Scripts path (C:\\Python27\\Scripts or similar).
113
114
114 To create a virtual environment, run::
115 To create a virtual environment, run::
115
116
116 virtualenv C:\Kallithea\Env
117 virtualenv C:\Kallithea\Env
117
118
118
119
119 Step 7 - Install Kallithea
120 Step 7 - Install Kallithea
120 --------------------------
121 --------------------------
121
122
122 In order to install Kallithea, you need to be able to run "pip install kallithea". It will use Python pip to install the Kallithea Python package and its dependencies.
123 In order to install Kallithea, you need to be able to run "pip install kallithea". It will use Python pip to install the Kallithea Python package and its dependencies.
123 Some Python packages use managed code and need to be compiled.
124 Some Python packages use managed code and need to be compiled.
124 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.
125 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.
125
126
126 Download and install "Microsoft Visual C++ Compiler for Python 2.7" from http://aka.ms/vcpython27
127 Download and install "Microsoft Visual C++ Compiler for Python 2.7" from http://aka.ms/vcpython27
127
128
128 .. note::
129 .. note::
129 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.
130 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.
130
131
131 In a command prompt type (adapting paths if necessary)::
132 In a command prompt type (adapting paths if necessary)::
132
133
133 cd C:\Kallithea\Env\Scripts
134 cd C:\Kallithea\Env\Scripts
134 activate
135 activate
135
136
136 The prompt will change into "(Env) C:\\Kallithea\\Env\\Scripts" or similar
137 The prompt will change into "(Env) C:\\Kallithea\\Env\\Scripts" or similar
137 (depending of your folder structure). Then type::
138 (depending of your folder structure). Then type::
138
139
139 pip install kallithea
140 pip install kallithea
140
141
141 (Long step, please wait until fully complete)
142 (Long step, please wait until fully complete)
142
143
143 Some warnings will appear. Don't worry, they are normal.
144 Some warnings will appear. Don't worry, they are normal.
144
145
145
146
146 Step 8 - (Optional) Install git
147 Step 8 - (Optional) Install git
147 -------------------------------
148 -------------------------------
148 Mercurial being a python package, it was installed automatically when doing "pip install kallithea".
149 Mercurial being a python package, it was installed automatically when doing "pip install kallithea".
149
150
150 You need to install git manually if you want Kallithea to be able to host git repositories.
151 You need to install git manually if you want Kallithea to be able to host git repositories.
151
152
152 See http://git-scm.com/book/en/v2/Getting-Started-Installing-Git#Installing-on-Windows for instructions.
153 See http://git-scm.com/book/en/v2/Getting-Started-Installing-Git#Installing-on-Windows for instructions.
153
154
154
155
155 Step 9 - Configuring Kallithea
156 Step 9 - Configuring Kallithea
156 ------------------------------
157 ------------------------------
157
158
158 Steps taken from `<setup.html>`_
159 Steps taken from `<setup.html>`_
159
160
160 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).
161 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).
161
162
162 When ready, type::
163 When ready, type::
163
164
164 cd C:\Kallithea\Bin
165 cd C:\Kallithea\Bin
165 paster make-config Kallithea production.ini
166 paster make-config Kallithea production.ini
166
167
167 Then, you must edit production.ini to fit your needs (IP address, IP port, mail settings, database, etc.) NotePad++ (free) or similar text editors are recommended, as they handle well the EndOfLine character differences between Unix and Windows (http://notepad-plus-plus.org/).
168 Then, you must edit production.ini to fit your needs (IP address, IP port, mail settings, database, etc.) NotePad++ (free) or similar text editors are recommended, as they handle well the EndOfLine character differences between Unix and Windows (http://notepad-plus-plus.org/).
168
169
169 For the sake of simplicity, run it with the default settings. After your edits (if any), in the previous Command Prompt, type::
170 For the sake of simplicity, run it with the default settings. After your edits (if any), in the previous Command Prompt, type::
170
171
171 paster setup-db production.ini
172 paster setup-db production.ini
172
173
173 (This time a NEW database will be installed. You must follow a different step to later UPGRADE to a newer Kallithea version)
174 (This time a NEW database will be installed. You must follow a different step to later UPGRADE to a newer Kallithea version)
174
175
175 The script will ask you for confirmation about creating a NEW database, answer yes (y)
176 The script will ask you for confirmation about creating a NEW database, answer yes (y)
176
177
177 The script will ask you for repository path, answer C:\\Kallithea\\Repos (or similar).
178 The script will ask you for repository path, answer C:\\Kallithea\\Repos (or similar).
178
179
179 The script will ask you for admin username and password, answer "admin" + "123456" (or whatever you want)
180 The script will ask you for admin username and password, answer "admin" + "123456" (or whatever you want)
180
181
181 The script will ask you for admin mail, answer "admin@xxxx.com" (or whatever you want)
182 The script will ask you for admin mail, answer "admin@xxxx.com" (or whatever you want)
182
183
183 If you make a mistake and the script doesn't end, don't worry: start it again.
184 If you make a mistake and the script doesn't end, don't worry: start it again.
184
185
185 If you decided not to install git, you will get errors about it that you can ignore.
186 If you decided not to install git, you will get errors about it that you can ignore.
186
187
187
188
188 Step 10 - Running Kallithea
189 Step 10 - Running Kallithea
189 ---------------------------
190 ---------------------------
190
191
191 In the previous command prompt, being in the C:\\Kallithea\\Bin folder, type::
192 In the previous command prompt, being in the C:\\Kallithea\\Bin folder, type::
192
193
193 paster serve production.ini
194 paster serve production.ini
194
195
195 Open your web server, and go to http://127.0.0.1:5000
196 Open your web server, and go to http://127.0.0.1:5000
196
197
197 It works!! :-)
198 It works!! :-)
198
199
199 Remark:
200 Remark:
200 If it does not work the first time, Ctrl-C the CMD process and start it again. Don't forget the "http://" in Internet Explorer.
201 If it does not work the first time, Ctrl-C the CMD process and start it again. Don't forget the "http://" in Internet Explorer.
201
202
202
203
203 What this Guide does not cover:
204 What this Guide does not cover:
204
205
205 - Installing Celery
206 - Installing Celery
206 - Running Kallithea as a Windows Service. You can investigate here:
207 - Running Kallithea as a Windows Service. You can investigate here:
207
208
208 - http://pypi.python.org/pypi/wsgisvc
209 - http://pypi.python.org/pypi/wsgisvc
209 - http://ryrobes.com/python/running-python-scripts-as-a-windows-service/
210 - http://ryrobes.com/python/running-python-scripts-as-a-windows-service/
210 - http://wiki.pylonshq.com/display/pylonscookbook/How+to+run+Pylons+as+a+Windows+service
211 - http://wiki.pylonshq.com/display/pylonscookbook/How+to+run+Pylons+as+a+Windows+service
211
212
212 - Using Apache. You can investigate here:
213 - Using Apache. You can investigate here:
213
214
214 - https://groups.google.com/group/rhodecode/msg/c433074e813ffdc4
215 - https://groups.google.com/group/rhodecode/msg/c433074e813ffdc4
215
216
216
217
217 Upgrading
218 Upgrading
218 :::::::::
219 :::::::::
219
220
220 Stop running Kallithea
221 Stop running Kallithea
221 Open a CommandPrompt like in Step 7 (cd to C:\Kallithea\Env\Scripts and activate) and type::
222 Open a CommandPrompt like in Step 7 (cd to C:\Kallithea\Env\Scripts and activate) and type::
222
223
223 pip install kallithea --upgrade
224 pip install kallithea --upgrade
224 cd \Kallithea\Bin
225 cd \Kallithea\Bin
225
226
226 Backup your production.ini file now.
227 Backup your production.ini file now.
227
228
228 Then, run::
229 Then, run::
229
230
230 paster make-config Kallithea production.ini
231 paster make-config Kallithea production.ini
231
232
232 Look for changes and update your production.ini accordingly.
233 Look for changes and update your production.ini accordingly.
233
234
234 Then, update the database::
235 Then, update the database::
235
236
236 paster upgrade-db production.ini
237 paster upgrade-db production.ini
237
238
238 Full steps in `<upgrade.html>`_
239 Full steps in `<upgrade.html>`_
@@ -1,755 +1,764 b''
1 .. _setup:
1 .. _setup:
2
2
3 =====
3 =====
4 Setup
4 Setup
5 =====
5 =====
6
6
7
7
8 Setting up Kallithea
8 Setting up Kallithea
9 --------------------
9 --------------------
10
10
11 First, you will need to create a Kallithea configuration file. Run the
11 First, you will need to create a Kallithea configuration file. Run the
12 following command to do this::
12 following command to do this::
13
13
14 paster make-config Kallithea production.ini
14 paster make-config Kallithea my.ini
15
15
16 - This will create the file `production.ini` in the current directory. This
16 - This will create the file `my.ini` in the current directory. This
17 configuration file contains the various settings for Kallithea, e.g proxy
17 configuration file contains the various settings for Kallithea, e.g proxy
18 port, email settings, usage of static files, cache, celery settings and
18 port, email settings, usage of static files, cache, celery settings and
19 logging.
19 logging.
20
20
21
21
22 Next, you need to create the databases used by Kallithea. I recommend that you
22 Next, you need to create the databases used by Kallithea. It is recommended to
23 use postgresql or sqlite (default). If you choose a database other than the
23 use postgresql or sqlite (default). If you choose a database other than the
24 default ensure you properly adjust the db url in your production.ini
24 default ensure you properly adjust the db url in your my.ini
25 configuration file to use this other database. Kallithea currently supports
25 configuration file to use this other database. Kallithea currently supports
26 postgresql, sqlite and mysql databases. Create the database by running
26 postgresql, sqlite and mysql databases. Create the database by running
27 the following command::
27 the following command::
28
28
29 paster setup-db production.ini
29 paster setup-db my.ini
30
30
31 This will prompt you for a "root" path. This "root" path is the location where
31 This will prompt you for a "root" path. This "root" path is the location where
32 Kallithea will store all of its repositories on the current machine. After
32 Kallithea will store all of its repositories on the current machine. After
33 entering this "root" path ``setup-db`` will also prompt you for a username
33 entering this "root" path ``setup-db`` will also prompt you for a username
34 and password for the initial admin account which ``setup-db`` sets
34 and password for the initial admin account which ``setup-db`` sets
35 up for you.
35 up for you.
36
36
37 setup process can be fully automated, example for lazy::
37 setup process can be fully automated, example for lazy::
38
38
39 paster setup-db production.ini --user=nn --password=secret --email=nn@your.kallithea.server --repos=/home/nn/my_repos
39 paster setup-db my.ini --user=nn --password=secret --email=nn@your.kallithea.server --repos=/srv/repos
40
40
41
41
42 - The ``setup-db`` command will create all of the needed tables and an
42 - The ``setup-db`` command will create all of the needed tables and an
43 admin account. When choosing a root path you can either use a new empty
43 admin account. When choosing a root path you can either use a new empty
44 location, or a location which already contains existing repositories. If you
44 location, or a location which already contains existing repositories. If you
45 choose a location which contains existing repositories Kallithea will simply
45 choose a location which contains existing repositories Kallithea will simply
46 add all of the repositories at the chosen location to it's database.
46 add all of the repositories at the chosen location to it's database.
47 (Note: make sure you specify the correct path to the root).
47 (Note: make sure you specify the correct path to the root).
48 - Note: the given path for mercurial_ repositories **must** be write accessible
48 - Note: the given path for mercurial_ repositories **must** be write accessible
49 for the application. It's very important since the Kallithea web interface
49 for the application. It's very important since the Kallithea web interface
50 will work without write access, but when trying to do a push it will
50 will work without write access, but when trying to do a push it will
51 eventually fail with permission denied errors unless it has write access.
51 eventually fail with permission denied errors unless it has write access.
52
52
53 You are now ready to use Kallithea, to run it simply execute::
53 You are now ready to use Kallithea, to run it simply execute::
54
54
55 paster serve production.ini
55 paster serve my.ini
56
56
57 - This command runs the Kallithea server. The web app should be available at the
57 - This command runs the Kallithea server. The web app should be available at the
58 127.0.0.1:5000. This ip and port is configurable via the production.ini
58 127.0.0.1:5000. This ip and port is configurable via the my.ini
59 file created in previous step
59 file created in previous step
60 - Use the admin account you created above when running ``setup-db``
60 - Use the admin account you created above when running ``setup-db``
61 to login to the web app.
61 to login to the web app.
62 - The default permissions on each repository is read, and the owner is admin.
62 - The default permissions on each repository is read, and the owner is admin.
63 Remember to update these if needed.
63 Remember to update these if needed.
64 - In the admin panel you can toggle ldap, anonymous, permissions settings. As
64 - In the admin panel you can toggle LDAP, anonymous, permissions settings. As
65 well as edit more advanced options on users and repositories
65 well as edit more advanced options on users and repositories
66
66
67 Optionally users can create `rcextensions` package that extends Kallithea
67 Optionally users can create `rcextensions` package that extends Kallithea
68 functionality. To do this simply execute::
68 functionality. To do this simply execute::
69
69
70 paster make-rcext production.ini
70 paster make-rcext my.ini
71
71
72 This will create `rcextensions` package in the same place that your `ini` file
72 This will create `rcextensions` package in the same place that your `ini` file
73 lives. With `rcextensions` it's possible to add additional mapping for whoosh,
73 lives. With `rcextensions` it's possible to add additional mapping for whoosh,
74 stats and add additional code into the push/pull/create/delete repo hooks.
74 stats and add additional code into the push/pull/create/delete repo hooks.
75 For example for sending signals to build-bots such as jenkins.
75 For example for sending signals to build-bots such as jenkins.
76 Please see the `__init__.py` file inside `rcextensions` package
76 Please see the `__init__.py` file inside `rcextensions` package
77 for more details.
77 for more details.
78
78
79
79
80 Using Kallithea with SSH
80 Using Kallithea with SSH
81 ------------------------
81 ------------------------
82
82
83 Kallithea currently only hosts repositories using http and https. (The addition
83 Kallithea currently only hosts repositories using http and https. (The addition
84 of ssh hosting is a planned future feature.) However you can easily use ssh in
84 of ssh hosting is a planned future feature.) However you can easily use ssh in
85 parallel with Kallithea. (Repository access via ssh is a standard "out of
85 parallel with Kallithea. (Repository access via ssh is a standard "out of
86 the box" feature of mercurial_ and you can use this to access any of the
86 the box" feature of mercurial_ and you can use this to access any of the
87 repositories that Kallithea is hosting. See PublishingRepositories_)
87 repositories that Kallithea is hosting. See PublishingRepositories_)
88
88
89 Kallithea repository structures are kept in directories with the same name
89 Kallithea repository structures are kept in directories with the same name
90 as the project. When using repository groups, each group is a subdirectory.
90 as the project. When using repository groups, each group is a subdirectory.
91 This allows you to easily use ssh for accessing repositories.
91 This allows you to easily use ssh for accessing repositories.
92
92
93 In order to use ssh you need to make sure that your web-server and the users
93 In order to use ssh you need to make sure that your web-server and the users
94 login accounts have the correct permissions set on the appropriate directories.
94 login accounts have the correct permissions set on the appropriate directories.
95 (Note that these permissions are independent of any permissions you have set up
95 (Note that these permissions are independent of any permissions you have set up
96 using the Kallithea web interface.)
96 using the Kallithea web interface.)
97
97
98 If your main directory (the same as set in Kallithea settings) is for example
98 If your main directory (the same as set in Kallithea settings) is for example
99 set to **/home/hg** and the repository you are using is named `kallithea`, then
99 set to **/srv/repos** and the repository you are using is named `kallithea`, then
100 to clone via ssh you should run::
100 to clone via ssh you should run::
101
101
102 hg clone ssh://user@server.com/home/hg/kallithea
102 hg clone ssh://user@server.com//srv/repos/kallithea
103
103
104 Using other external tools such as mercurial-server_ or using ssh key based
104 Using other external tools such as mercurial-server_ or using ssh key based
105 authentication is fully supported.
105 authentication is fully supported.
106
106
107 Note: In an advanced setup, in order for your ssh access to use the same
107 Note: In an advanced setup, in order for your ssh access to use the same
108 permissions as set up via the Kallithea web interface, you can create an
108 permissions as set up via the Kallithea web interface, you can create an
109 authentication hook to connect to the Kallithea db and runs check functions for
109 authentication hook to connect to the Kallithea db and runs check functions for
110 permissions against that.
110 permissions against that.
111
111
112 Setting up Whoosh full text search
112 Setting up Whoosh full text search
113 ----------------------------------
113 ----------------------------------
114
114
115 Starting from version 1.1 the whoosh index can be build by using the paster
115 The whoosh index can be build by using the paster
116 command ``make-index``. To use ``make-index`` you must specify the configuration
116 command ``make-index``. To use ``make-index`` you must specify the configuration
117 file that stores the location of the index. You may specify the location of the
117 file that stores the location of the index. You may specify the location of the
118 repositories (`--repo-location`). If not specified, this value is retrieved
118 repositories (`--repo-location`). If not specified, this value is retrieved
119 from the Kallithea database. This was required prior to 1.2. Starting from
119 from the Kallithea database.
120 version 1.2 it is also possible to specify a comma separated list of
120 It is also possible to specify a comma separated list of
121 repositories (`--index-only`) to build index only on chooses repositories
121 repositories (`--index-only`) to build index only on chooses repositories
122 skipping any other found in repos location
122 skipping any other found in repos location
123
123
124 You may optionally pass the option `-f` to enable a full index rebuild. Without
124 You may optionally pass the option `-f` to enable a full index rebuild. Without
125 the `-f` option, indexing will run always in "incremental" mode.
125 the `-f` option, indexing will run always in "incremental" mode.
126
126
127 For an incremental index build use::
127 For an incremental index build use::
128
128
129 paster make-index production.ini
129 paster make-index my.ini
130
130
131 For a full index rebuild use::
131 For a full index rebuild use::
132
132
133 paster make-index production.ini -f
133 paster make-index my.ini -f
134
134
135
135
136 building index just for chosen repositories is possible with such command::
136 building index just for chosen repositories is possible with such command::
137
137
138 paster make-index production.ini --index-only=vcs,kallithea
138 paster make-index my.ini --index-only=vcs,kallithea
139
139
140
140
141 In order to do periodical index builds and keep your index always up to date.
141 In order to do periodical index builds and keep your index always up to date.
142 It's recommended to do a crontab entry for incremental indexing.
142 It's recommended to do a crontab entry for incremental indexing.
143 An example entry might look like this::
143 An example entry might look like this::
144
144
145 /path/to/python/bin/paster make-index /path/to/kallithea/production.ini
145 /path/to/python/bin/paster make-index /path/to/kallithea/my.ini
146
146
147 When using incremental mode (the default) whoosh will check the last
147 When using incremental mode (the default) whoosh will check the last
148 modification date of each file and add it to be reindexed if a newer file is
148 modification date of each file and add it to be reindexed if a newer file is
149 available. The indexing daemon checks for any removed files and removes them
149 available. The indexing daemon checks for any removed files and removes them
150 from index.
150 from index.
151
151
152 If you want to rebuild index from scratch, you can use the `-f` flag as above,
152 If you want to rebuild index from scratch, you can use the `-f` flag as above,
153 or in the admin panel you can check `build from scratch` flag.
153 or in the admin panel you can check `build from scratch` flag.
154
154
155
155
156 Setting up LDAP support
156 Setting up LDAP support
157 -----------------------
157 -----------------------
158
158
159 Kallithea starting from version 1.1 supports ldap authentication. In order
159 Kallithea supports LDAP authentication. In order
160 to use LDAP, you have to install the python-ldap_ package. This package is
160 to use LDAP, you have to install the python-ldap_ package. This package is
161 available via pypi, so you can install it by running
161 available via pypi, so you can install it by running
162
162
163 using easy_install::
164
165 easy_install python-ldap
166
167 using pip::
168
169 pip install python-ldap
163 pip install python-ldap
170
164
171 .. note::
165 .. note::
172 python-ldap requires some certain libs on your system, so before installing
166 python-ldap requires some certain libs on your system, so before installing
173 it check that you have at least `openldap`, and `sasl` libraries.
167 it check that you have at least `openldap`, and `sasl` libraries.
174
168
175 LDAP settings are located in admin->ldap section,
169 LDAP settings are located in Admin->LDAP section.
176
170
177 Here's a typical ldap setup::
171 Here's a typical LDAP setup::
178
172
179 Connection settings
173 Connection settings
180 Enable LDAP = checked
174 Enable LDAP = checked
181 Host = host.example.org
175 Host = host.example.org
182 Port = 389
176 Port = 389
183 Account = <account>
177 Account = <account>
184 Password = <password>
178 Password = <password>
185 Connection Security = LDAPS connection
179 Connection Security = LDAPS connection
186 Certificate Checks = DEMAND
180 Certificate Checks = DEMAND
187
181
188 Search settings
182 Search settings
189 Base DN = CN=users,DC=host,DC=example,DC=org
183 Base DN = CN=users,DC=host,DC=example,DC=org
190 LDAP Filter = (&(objectClass=user)(!(objectClass=computer)))
184 LDAP Filter = (&(objectClass=user)(!(objectClass=computer)))
191 LDAP Search Scope = SUBTREE
185 LDAP Search Scope = SUBTREE
192
186
193 Attribute mappings
187 Attribute mappings
194 Login Attribute = uid
188 Login Attribute = uid
195 First Name Attribute = firstName
189 First Name Attribute = firstName
196 Last Name Attribute = lastName
190 Last Name Attribute = lastName
197 E-mail Attribute = mail
191 E-mail Attribute = mail
198
192
199 If your user groups are placed in a Organisation Unit (OU) structure the Search Settings configuration differs::
193 If your user groups are placed in a Organisation Unit (OU) structure the Search Settings configuration differs::
200
194
201 Search settings
195 Search settings
202 Base DN = DC=host,DC=example,DC=org
196 Base DN = DC=host,DC=example,DC=org
203 LDAP Filter = (&(memberOf=CN=your user group,OU=subunit,OU=unit,DC=host,DC=example,DC=org)(objectClass=user))
197 LDAP Filter = (&(memberOf=CN=your user group,OU=subunit,OU=unit,DC=host,DC=example,DC=org)(objectClass=user))
204 LDAP Search Scope = SUBTREE
198 LDAP Search Scope = SUBTREE
205
199
206 .. _enable_ldap:
200 .. _enable_ldap:
207
201
208 Enable LDAP : required
202 Enable LDAP : required
209 Whether to use LDAP for authenticating users.
203 Whether to use LDAP for authenticating users.
210
204
211 .. _ldap_host:
205 .. _ldap_host:
212
206
213 Host : required
207 Host : required
214 LDAP server hostname or IP address. Can be also a comma separated
208 LDAP server hostname or IP address. Can be also a comma separated
215 list of servers to support LDAP fail-over.
209 list of servers to support LDAP fail-over.
216
210
217 .. _Port:
211 .. _Port:
218
212
219 Port : required
213 Port : required
220 389 for un-encrypted LDAP, 636 for SSL-encrypted LDAP.
214 389 for un-encrypted LDAP, 636 for SSL-encrypted LDAP.
221
215
222 .. _ldap_account:
216 .. _ldap_account:
223
217
224 Account : optional
218 Account : optional
225 Only required if the LDAP server does not allow anonymous browsing of
219 Only required if the LDAP server does not allow anonymous browsing of
226 records. This should be a special account for record browsing. This
220 records. This should be a special account for record browsing. This
227 will require `LDAP Password`_ below.
221 will require `LDAP Password`_ below.
228
222
229 .. _LDAP Password:
223 .. _LDAP Password:
230
224
231 Password : optional
225 Password : optional
232 Only required if the LDAP server does not allow anonymous browsing of
226 Only required if the LDAP server does not allow anonymous browsing of
233 records.
227 records.
234
228
235 .. _Enable LDAPS:
229 .. _Enable LDAPS:
236
230
237 Connection Security : required
231 Connection Security : required
238 Defines the connection to LDAP server
232 Defines the connection to LDAP server
239
233
240 No encryption
234 No encryption
241 Plain non encrypted connection
235 Plain non encrypted connection
242
236
243 LDAPS connection
237 LDAPS connection
244 Enable ldaps connection. It will likely require `Port`_ to be set to
238 Enable LDAPS connections. It will likely require `Port`_ to be set to
245 a different value (standard LDAPS port is 636). When LDAPS is enabled
239 a different value (standard LDAPS port is 636). When LDAPS is enabled
246 then `Certificate Checks`_ is required.
240 then `Certificate Checks`_ is required.
247
241
248 START_TLS on LDAP connection
242 START_TLS on LDAP connection
249 START TLS connection
243 START TLS connection
250
244
251 .. _Certificate Checks:
245 .. _Certificate Checks:
252
246
253 Certificate Checks : optional
247 Certificate Checks : optional
254 How SSL certificates verification is handled - this is only useful when
248 How SSL certificates verification is handled - this is only useful when
255 `Enable LDAPS`_ is enabled. Only DEMAND or HARD offer full SSL security
249 `Enable LDAPS`_ is enabled. Only DEMAND or HARD offer full SSL security
256 while the other options are susceptible to man-in-the-middle attacks. SSL
250 while the other options are susceptible to man-in-the-middle attacks. SSL
257 certificates can be installed to /etc/openldap/cacerts so that the
251 certificates can be installed to /etc/openldap/cacerts so that the
258 DEMAND or HARD options can be used with self-signed certificates or
252 DEMAND or HARD options can be used with self-signed certificates or
259 certificates that do not have traceable certificates of authority.
253 certificates that do not have traceable certificates of authority.
260
254
261 NEVER
255 NEVER
262 A serve certificate will never be requested or checked.
256 A serve certificate will never be requested or checked.
263
257
264 ALLOW
258 ALLOW
265 A server certificate is requested. Failure to provide a
259 A server certificate is requested. Failure to provide a
266 certificate or providing a bad certificate will not terminate the
260 certificate or providing a bad certificate will not terminate the
267 session.
261 session.
268
262
269 TRY
263 TRY
270 A server certificate is requested. Failure to provide a
264 A server certificate is requested. Failure to provide a
271 certificate does not halt the session; providing a bad certificate
265 certificate does not halt the session; providing a bad certificate
272 halts the session.
266 halts the session.
273
267
274 DEMAND
268 DEMAND
275 A server certificate is requested and must be provided and
269 A server certificate is requested and must be provided and
276 authenticated for the session to proceed.
270 authenticated for the session to proceed.
277
271
278 HARD
272 HARD
279 The same as DEMAND.
273 The same as DEMAND.
280
274
281 .. _Base DN:
275 .. _Base DN:
282
276
283 Base DN : required
277 Base DN : required
284 The Distinguished Name (DN) where searches for users will be performed.
278 The Distinguished Name (DN) where searches for users will be performed.
285 Searches can be controlled by `LDAP Filter`_ and `LDAP Search Scope`_.
279 Searches can be controlled by `LDAP Filter`_ and `LDAP Search Scope`_.
286
280
287 .. _LDAP Filter:
281 .. _LDAP Filter:
288
282
289 LDAP Filter : optional
283 LDAP Filter : optional
290 A LDAP filter defined by RFC 2254. This is more useful when `LDAP
284 A LDAP filter defined by RFC 2254. This is more useful when `LDAP
291 Search Scope`_ is set to SUBTREE. The filter is useful for limiting
285 Search Scope`_ is set to SUBTREE. The filter is useful for limiting
292 which LDAP objects are identified as representing Users for
286 which LDAP objects are identified as representing Users for
293 authentication. The filter is augmented by `Login Attribute`_ below.
287 authentication. The filter is augmented by `Login Attribute`_ below.
294 This can commonly be left blank.
288 This can commonly be left blank.
295
289
296 .. _LDAP Search Scope:
290 .. _LDAP Search Scope:
297
291
298 LDAP Search Scope : required
292 LDAP Search Scope : required
299 This limits how far LDAP will search for a matching object.
293 This limits how far LDAP will search for a matching object.
300
294
301 BASE
295 BASE
302 Only allows searching of `Base DN`_ and is usually not what you
296 Only allows searching of `Base DN`_ and is usually not what you
303 want.
297 want.
304
298
305 ONELEVEL
299 ONELEVEL
306 Searches all entries under `Base DN`_, but not Base DN itself.
300 Searches all entries under `Base DN`_, but not Base DN itself.
307
301
308 SUBTREE
302 SUBTREE
309 Searches all entries below `Base DN`_, but not Base DN itself.
303 Searches all entries below `Base DN`_, but not Base DN itself.
310 When using SUBTREE `LDAP Filter`_ is useful to limit object
304 When using SUBTREE `LDAP Filter`_ is useful to limit object
311 location.
305 location.
312
306
313 .. _Login Attribute:
307 .. _Login Attribute:
314
308
315 Login Attribute : required
309 Login Attribute : required
316 The LDAP record attribute that will be matched as the USERNAME or
310 The LDAP record attribute that will be matched as the USERNAME or
317 ACCOUNT used to connect to Kallithea. This will be added to `LDAP
311 ACCOUNT used to connect to Kallithea. This will be added to `LDAP
318 Filter`_ for locating the User object. If `LDAP Filter`_ is specified as
312 Filter`_ for locating the User object. If `LDAP Filter`_ is specified as
319 "LDAPFILTER", `Login Attribute`_ is specified as "uid" and the user has
313 "LDAPFILTER", `Login Attribute`_ is specified as "uid" and the user has
320 connected as "jsmith" then the `LDAP Filter`_ will be augmented as below
314 connected as "jsmith" then the `LDAP Filter`_ will be augmented as below
321 ::
315 ::
322
316
323 (&(LDAPFILTER)(uid=jsmith))
317 (&(LDAPFILTER)(uid=jsmith))
324
318
325 .. _ldap_attr_firstname:
319 .. _ldap_attr_firstname:
326
320
327 First Name Attribute : required
321 First Name Attribute : required
328 The LDAP record attribute which represents the user's first name.
322 The LDAP record attribute which represents the user's first name.
329
323
330 .. _ldap_attr_lastname:
324 .. _ldap_attr_lastname:
331
325
332 Last Name Attribute : required
326 Last Name Attribute : required
333 The LDAP record attribute which represents the user's last name.
327 The LDAP record attribute which represents the user's last name.
334
328
335 .. _ldap_attr_email:
329 .. _ldap_attr_email:
336
330
337 Email Attribute : required
331 Email Attribute : required
338 The LDAP record attribute which represents the user's email address.
332 The LDAP record attribute which represents the user's email address.
339
333
340 If all data are entered correctly, and python-ldap_ is properly installed
334 If all data are entered correctly, and python-ldap_ is properly installed
341 users should be granted access to Kallithea with ldap accounts. At this
335 users should be granted access to Kallithea with LDAP accounts. At this
342 time user information is copied from LDAP into the Kallithea user database.
336 time user information is copied from LDAP into the Kallithea user database.
343 This means that updates of an LDAP user object may not be reflected as a
337 This means that updates of an LDAP user object may not be reflected as a
344 user update in Kallithea.
338 user update in Kallithea.
345
339
346 If You have problems with LDAP access and believe You entered correct
340 If You have problems with LDAP access and believe You entered correct
347 information check out the Kallithea logs, any error messages sent from LDAP
341 information check out the Kallithea logs, any error messages sent from LDAP
348 will be saved there.
342 will be saved there.
349
343
350 Active Directory
344 Active Directory
351 ''''''''''''''''
345 ''''''''''''''''
352
346
353 Kallithea can use Microsoft Active Directory for user authentication. This
347 Kallithea can use Microsoft Active Directory for user authentication. This
354 is done through an LDAP or LDAPS connection to Active Directory. The
348 is done through an LDAP or LDAPS connection to Active Directory. The
355 following LDAP configuration settings are typical for using Active
349 following LDAP configuration settings are typical for using Active
356 Directory ::
350 Directory ::
357
351
358 Base DN = OU=SBSUsers,OU=Users,OU=MyBusiness,DC=v3sys,DC=local
352 Base DN = OU=SBSUsers,OU=Users,OU=MyBusiness,DC=v3sys,DC=local
359 Login Attribute = sAMAccountName
353 Login Attribute = sAMAccountName
360 First Name Attribute = givenName
354 First Name Attribute = givenName
361 Last Name Attribute = sn
355 Last Name Attribute = sn
362 E-mail Attribute = mail
356 E-mail Attribute = mail
363
357
364 All other LDAP settings will likely be site-specific and should be
358 All other LDAP settings will likely be site-specific and should be
365 appropriately configured.
359 appropriately configured.
366
360
367
361
368 Authentication by container or reverse-proxy
362 Authentication by container or reverse-proxy
369 --------------------------------------------
363 --------------------------------------------
370
364
371 Kallithea supports delegating the authentication
365 Kallithea supports delegating the authentication
372 of users to its WSGI container, or to a reverse-proxy server through which all
366 of users to its WSGI container, or to a reverse-proxy server through which all
373 clients access the application.
367 clients access the application.
374
368
375 When these authentication methods are enabled in Kallithea, it uses the
369 When these authentication methods are enabled in Kallithea, it uses the
376 username that the container/proxy (Apache/Nginx/etc) authenticated and doesn't
370 username that the container/proxy (Apache/Nginx/etc) authenticated and doesn't
377 perform the authentication itself. The authorization, however, is still done by
371 perform the authentication itself. The authorization, however, is still done by
378 Kallithea according to its settings.
372 Kallithea according to its settings.
379
373
380 When a user logs in for the first time using these authentication methods,
374 When a user logs in for the first time using these authentication methods,
381 a matching user account is created in Kallithea with default permissions. An
375 a matching user account is created in Kallithea with default permissions. An
382 administrator can then modify it using Kallithea's admin interface.
376 administrator can then modify it using Kallithea's admin interface.
383 It's also possible for an administrator to create accounts and configure their
377 It's also possible for an administrator to create accounts and configure their
384 permissions before the user logs in for the first time.
378 permissions before the user logs in for the first time.
385
379
386
380
387 Container-based authentication
381 Container-based authentication
388 ''''''''''''''''''''''''''''''
382 ''''''''''''''''''''''''''''''
389
383
390 In a container-based authentication setup, Kallithea reads the user name from
384 In a container-based authentication setup, Kallithea reads the user name from
391 the ``REMOTE_USER`` server variable provided by the WSGI container.
385 the ``REMOTE_USER`` server variable provided by the WSGI container.
392
386
393 After setting up your container (see `Apache's WSGI config`_), you'd need
387 After setting up your container (see `Apache's WSGI config`_), you'd need
394 to configure it to require authentication on the location configured for
388 to configure it to require authentication on the location configured for
395 Kallithea.
389 Kallithea.
396
390
397
391
398 Proxy pass-through authentication
392 Proxy pass-through authentication
399 '''''''''''''''''''''''''''''''''
393 '''''''''''''''''''''''''''''''''
400
394
401 In a proxy pass-through authentication setup, Kallithea reads the user name
395 In a proxy pass-through authentication setup, Kallithea reads the user name
402 from the ``X-Forwarded-User`` request header, which should be configured to be
396 from the ``X-Forwarded-User`` request header, which should be configured to be
403 sent by the reverse-proxy server.
397 sent by the reverse-proxy server.
404
398
405 After setting up your proxy solution (see `Apache virtual host reverse proxy example`_,
399 After setting up your proxy solution (see `Apache virtual host reverse proxy example`_,
406 `Apache as subdirectory`_ or `Nginx virtual host example`_), you'd need to
400 `Apache as subdirectory`_ or `Nginx virtual host example`_), you'd need to
407 configure the authentication and add the username in a request header named
401 configure the authentication and add the username in a request header named
408 ``X-Forwarded-User``.
402 ``X-Forwarded-User``.
409
403
410 For example, the following config section for Apache sets a subdirectory in a
404 For example, the following config section for Apache sets a subdirectory in a
411 reverse-proxy setup with basic auth::
405 reverse-proxy setup with basic auth::
412
406
413 <Location /<someprefix> >
407 <Location /<someprefix> >
414 ProxyPass http://127.0.0.1:5000/<someprefix>
408 ProxyPass http://127.0.0.1:5000/<someprefix>
415 ProxyPassReverse http://127.0.0.1:5000/<someprefix>
409 ProxyPassReverse http://127.0.0.1:5000/<someprefix>
416 SetEnvIf X-Url-Scheme https HTTPS=1
410 SetEnvIf X-Url-Scheme https HTTPS=1
417
411
418 AuthType Basic
412 AuthType Basic
419 AuthName "Kallithea authentication"
413 AuthName "Kallithea authentication"
420 AuthUserFile /home/web/kallithea/.htpasswd
414 AuthUserFile /srv/kallithea/.htpasswd
421 require valid-user
415 require valid-user
422
416
423 RequestHeader unset X-Forwarded-User
417 RequestHeader unset X-Forwarded-User
424
418
425 RewriteEngine On
419 RewriteEngine On
426 RewriteCond %{LA-U:REMOTE_USER} (.+)
420 RewriteCond %{LA-U:REMOTE_USER} (.+)
427 RewriteRule .* - [E=RU:%1]
421 RewriteRule .* - [E=RU:%1]
428 RequestHeader set X-Forwarded-User %{RU}e
422 RequestHeader set X-Forwarded-User %{RU}e
429 </Location>
423 </Location>
430
424
431
425
432 .. note::
426 .. note::
433 If you enable proxy pass-through authentication, make sure your server is
427 If you enable proxy pass-through authentication, make sure your server is
434 only accessible through the proxy. Otherwise, any client would be able to
428 only accessible through the proxy. Otherwise, any client would be able to
435 forge the authentication header and could effectively become authenticated
429 forge the authentication header and could effectively become authenticated
436 using any account of their liking.
430 using any account of their liking.
437
431
438 Integration with Issue trackers
432 Integration with Issue trackers
439 -------------------------------
433 -------------------------------
440
434
441 Kallithea provides a simple integration with issue trackers. It's possible
435 Kallithea provides a simple integration with issue trackers. It's possible
442 to define a regular expression that will fetch issue id stored in commit
436 to define a regular expression that will fetch issue id stored in commit
443 messages and replace that with an url to this issue. To enable this simply
437 messages and replace that with an url to this issue. To enable this simply
444 uncomment following variables in the ini file::
438 uncomment following variables in the ini file::
445
439
446 issue_pat = (?:^#|\s#)(\w+)
440 issue_pat = (?:^#|\s#)(\w+)
447 issue_server_link = https://myissueserver.com/{repo}/issue/{id}
441 issue_server_link = https://myissueserver.com/{repo}/issue/{id}
448 issue_prefix = #
442 issue_prefix = #
449
443
450 `issue_pat` is the regular expression describing which strings in
444 `issue_pat` is the regular expression describing which strings in
451 commit messages will be treated as issue references. A match group in
445 commit messages will be treated as issue references. A match group in
452 parentheses should be used to specify the actual issue id.
446 parentheses should be used to specify the actual issue id.
453
447
454 The default expression matches issues in the format '#<number>', e.g. '#300'.
448 The default expression matches issues in the format '#<number>', e.g. '#300'.
455
449
456 Matched issues are replaced with the link specified as `issue_server_link`
450 Matched issues are replaced with the link specified as `issue_server_link`
457 {id} is replaced with issue id, and {repo} with repository name.
451 {id} is replaced with issue id, and {repo} with repository name.
458 Since the # is stripped away, `issue_prefix` is prepended to the link text.
452 Since the # is stripped away, `issue_prefix` is prepended to the link text.
459 `issue_prefix` doesn't necessarily need to be #: if you set issue
453 `issue_prefix` doesn't necessarily need to be #: if you set issue
460 prefix to ISSUE- this will generate a URL in format::
454 prefix to ISSUE- this will generate a URL in format::
461
455
462 <a href="https://myissueserver.com/example_repo/issue/300">ISSUE-300</a>
456 <a href="https://myissueserver.com/example_repo/issue/300">ISSUE-300</a>
463
457
464 If needed, more than one pattern can be specified by appending a unique suffix to
458 If needed, more than one pattern can be specified by appending a unique suffix to
465 the variables. For example::
459 the variables. For example::
466
460
467 issue_pat_wiki = (?:wiki-)(.+)
461 issue_pat_wiki = (?:wiki-)(.+)
468 issue_server_link_wiki = https://mywiki.com/{id}
462 issue_server_link_wiki = https://mywiki.com/{id}
469 issue_prefix_wiki = WIKI-
463 issue_prefix_wiki = WIKI-
470
464
471 With these settings, wiki pages can be referenced as wiki-some-id, and every
465 With these settings, wiki pages can be referenced as wiki-some-id, and every
472 such reference will be transformed into::
466 such reference will be transformed into::
473
467
474 <a href="https://mywiki.com/some-id">WIKI-some-id</a>
468 <a href="https://mywiki.com/some-id">WIKI-some-id</a>
475
469
476
470
477 Hook management
471 Hook management
478 ---------------
472 ---------------
479
473
480 Hooks can be managed in similar way to this used in .hgrc files.
474 Hooks can be managed in similar way to this used in .hgrc files.
481 To access hooks setting click `advanced setup` on Hooks section of Mercurial
475 To access hooks setting click `advanced setup` on Hooks section of Mercurial
482 Settings in Admin.
476 Settings in Admin.
483
477
484 There are 4 built in hooks that cannot be changed (only enable/disable by
478 There are 4 built in hooks that cannot be changed (only enable/disable by
485 checkboxes on previos section).
479 checkboxes on previos section).
486 To add another custom hook simply fill in first section with
480 To add another custom hook simply fill in first section with
487 <name>.<hook_type> and the second one with hook path. Example hooks
481 <name>.<hook_type> and the second one with hook path. Example hooks
488 can be found at *kallithea.lib.hooks*.
482 can be found at *kallithea.lib.hooks*.
489
483
490
484
491 Changing default encoding
485 Changing default encoding
492 -------------------------
486 -------------------------
493
487
494 By default Kallithea uses utf8 encoding, starting from 1.3 series this
488 By default, Kallithea uses utf8 encoding.
495 can be changed, simply edit default_encoding in .ini file to desired one.
489 It is configurable as `default_encoding` in the .ini file.
496 This affects many parts in Kallithea including committers names, filenames,
490 This affects many parts in Kallithea including user names, filenames, and
497 encoding of commit messages. In addition Kallithea can detect if `chardet`
491 encoding of commit messages. In addition Kallithea can detect if `chardet`
498 library is installed. If `chardet` is detected Kallithea will fallback to it
492 library is installed. If `chardet` is detected Kallithea will fallback to it
499 when there are encode/decode errors.
493 when there are encode/decode errors.
500
494
501
495
502 Setting Up Celery
496 Celery configuration
503 -----------------
497 --------------------
504
498
505 Since version 1.1 celery is configured by the Kallithea ini configuration files.
499 Celery is configured in the Kallithea ini configuration files.
506 Simply set use_celery=true in the ini file then add / change the configuration
500 Simply set use_celery=true in the ini file then add / change the configuration
507 variables inside the ini file.
501 variables inside the ini file.
508
502
509 Remember that the ini files use the format with '.' not with '_' like celery.
503 Remember that the ini files use the format with '.' not with '_' like celery.
510 So for example setting `BROKER_HOST` in celery means setting `broker.host` in
504 So for example setting `BROKER_HOST` in celery means setting `broker.host` in
511 the config file.
505 the config file.
512
506
513 In order to start using celery run::
507 In order to start using celery run::
514
508
515 paster celeryd <configfile.ini>
509 paster celeryd <configfile.ini>
516
510
517
511
518 .. note::
512 .. note::
519 Make sure you run this command from the same virtualenv, and with the same
513 Make sure you run this command from the same virtualenv, and with the same
520 user that Kallithea runs.
514 user that Kallithea runs.
521
515
522 HTTPS support
516 HTTPS support
523 -------------
517 -------------
524
518
525 Kallithea will by default generate URLs based on the WSGI environment.
519 Kallithea will by default generate URLs based on the WSGI environment.
526
520
527 Alternatively, you can use some special configuration settings to control
521 Alternatively, you can use some special configuration settings to control
528 directly which scheme/protocol Kallithea will use when generating URLs:
522 directly which scheme/protocol Kallithea will use when generating URLs:
529
523
530 - With `https_fixup = true`, the scheme will be taken from the HTTP_X_URL_SCHEME,
524 - With `https_fixup = true`, the scheme will be taken from the HTTP_X_URL_SCHEME,
531 HTTP_X_FORWARDED_SCHEME or HTTP_X_FORWARDED_PROTO HTTP header (default 'http').
525 HTTP_X_FORWARDED_SCHEME or HTTP_X_FORWARDED_PROTO HTTP header (default 'http').
532 - With `force_https = true` the default will be 'https'.
526 - With `force_https = true` the default will be 'https'.
533 - With `use_htsts = true`, it will set Strict-Transport-Security when using https.
527 - With `use_htsts = true`, it will set Strict-Transport-Security when using https.
534
528
535 Nginx virtual host example
529 Nginx virtual host example
536 --------------------------
530 --------------------------
537
531
538 Sample config for nginx using proxy::
532 Sample config for nginx using proxy::
539
533
540 upstream rc {
534 upstream kallithea {
541 server 127.0.0.1:5000;
535 server 127.0.0.1:5000;
542 # add more instances for load balancing
536 # add more instances for load balancing
543 #server 127.0.0.1:5001;
537 #server 127.0.0.1:5001;
544 #server 127.0.0.1:5002;
538 #server 127.0.0.1:5002;
545 }
539 }
546
540
547 ## gist alias
541 ## gist alias
548 server {
542 server {
549 listen 443;
543 listen 443;
550 server_name gist.myserver.com;
544 server_name gist.myserver.com;
551 access_log /var/log/nginx/gist.access.log;
545 access_log /var/log/nginx/gist.access.log;
552 error_log /var/log/nginx/gist.error.log;
546 error_log /var/log/nginx/gist.error.log;
553
547
554 ssl on;
548 ssl on;
555 ssl_certificate gist.your.kallithea.server.crt;
549 ssl_certificate gist.your.kallithea.server.crt;
556 ssl_certificate_key gist.your.kallithea.server.key;
550 ssl_certificate_key gist.your.kallithea.server.key;
557
551
558 ssl_session_timeout 5m;
552 ssl_session_timeout 5m;
559
553
560 ssl_protocols SSLv3 TLSv1;
554 ssl_protocols SSLv3 TLSv1;
561 ssl_ciphers DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:EDH-RSA-DES-CBC3-SHA:AES256-SHA:DES-CBC3-SHA:AES128-SHA:RC4-SHA:RC4-MD5;
555 ssl_ciphers DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:EDH-RSA-DES-CBC3-SHA:AES256-SHA:DES-CBC3-SHA:AES128-SHA:RC4-SHA:RC4-MD5;
562 ssl_prefer_server_ciphers on;
556 ssl_prefer_server_ciphers on;
563
557
564 rewrite ^/(.+)$ https://your.kallithea.server/_admin/gists/$1;
558 rewrite ^/(.+)$ https://your.kallithea.server/_admin/gists/$1;
565 rewrite (.*) https://your.kallithea.server/_admin/gists;
559 rewrite (.*) https://your.kallithea.server/_admin/gists;
566 }
560 }
567
561
568 server {
562 server {
569 listen 443;
563 listen 443;
570 server_name your.kallithea.server;
564 server_name your.kallithea.server;
571 access_log /var/log/nginx/kallithea.access.log;
565 access_log /var/log/nginx/kallithea.access.log;
572 error_log /var/log/nginx/kallithea.error.log;
566 error_log /var/log/nginx/kallithea.error.log;
573
567
574 ssl on;
568 ssl on;
575 ssl_certificate your.kallithea.server.crt;
569 ssl_certificate your.kallithea.server.crt;
576 ssl_certificate_key your.kallithea.server.key;
570 ssl_certificate_key your.kallithea.server.key;
577
571
578 ssl_session_timeout 5m;
572 ssl_session_timeout 5m;
579
573
580 ssl_protocols SSLv3 TLSv1;
574 ssl_protocols SSLv3 TLSv1;
581 ssl_ciphers DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:EDH-RSA-DES-CBC3-SHA:AES256-SHA:DES-CBC3-SHA:AES128-SHA:RC4-SHA:RC4-MD5;
575 ssl_ciphers DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:EDH-RSA-DES-CBC3-SHA:AES256-SHA:DES-CBC3-SHA:AES128-SHA:RC4-SHA:RC4-MD5;
582 ssl_prefer_server_ciphers on;
576 ssl_prefer_server_ciphers on;
583
577
584 ## uncomment root directive if you want to serve static files by nginx
578 ## uncomment root directive if you want to serve static files by nginx
585 ## requires static_files = false in .ini file
579 ## requires static_files = false in .ini file
586 #root /path/to/installation/kallithea/public;
580 #root /path/to/installation/kallithea/public;
587 include /etc/nginx/proxy.conf;
581 include /etc/nginx/proxy.conf;
588 location / {
582 location / {
589 try_files $uri @rhode;
583 try_files $uri @kallithea;
590 }
584 }
591
585
592 location @rhode {
586 location @kallithea {
593 proxy_pass http://rc;
587 proxy_pass http://kallithea;
594 }
588 }
595
589
596 }
590 }
597
591
598 Here's the proxy.conf. It's tuned so it will not timeout on long
592 Here's the proxy.conf. It's tuned so it will not timeout on long
599 pushes or large pushes::
593 pushes or large pushes::
600
594
601 proxy_redirect off;
595 proxy_redirect off;
602 proxy_set_header Host $host;
596 proxy_set_header Host $host;
603 ## needed for container auth
597 ## needed for container auth
604 #proxy_set_header REMOTE_USER $remote_user;
598 #proxy_set_header REMOTE_USER $remote_user;
605 #proxy_set_header X-Forwarded-User $remote_user;
599 #proxy_set_header X-Forwarded-User $remote_user;
606 proxy_set_header X-Url-Scheme $scheme;
600 proxy_set_header X-Url-Scheme $scheme;
607 proxy_set_header X-Host $http_host;
601 proxy_set_header X-Host $http_host;
608 proxy_set_header X-Real-IP $remote_addr;
602 proxy_set_header X-Real-IP $remote_addr;
609 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
603 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
610 proxy_set_header Proxy-host $proxy_host;
604 proxy_set_header Proxy-host $proxy_host;
611 proxy_buffering off;
605 proxy_buffering off;
612 proxy_connect_timeout 7200;
606 proxy_connect_timeout 7200;
613 proxy_send_timeout 7200;
607 proxy_send_timeout 7200;
614 proxy_read_timeout 7200;
608 proxy_read_timeout 7200;
615 proxy_buffers 8 32k;
609 proxy_buffers 8 32k;
616 client_max_body_size 1024m;
610 client_max_body_size 1024m;
617 client_body_buffer_size 128k;
611 client_body_buffer_size 128k;
618 large_client_header_buffers 8 64k;
612 large_client_header_buffers 8 64k;
619
613
620
614
621 Apache virtual host reverse proxy example
615 Apache virtual host reverse proxy example
622 -----------------------------------------
616 -----------------------------------------
623
617
624 Here is a sample configuration file for apache using proxy::
618 Here is a sample configuration file for apache using proxy::
625
619
626 <VirtualHost *:80>
620 <VirtualHost *:80>
627 ServerName hg.myserver.com
621 ServerName hg.myserver.com
628 ServerAlias hg.myserver.com
622 ServerAlias hg.myserver.com
629
623
630 <Proxy *>
624 <Proxy *>
631 Order allow,deny
625 Order allow,deny
632 Allow from all
626 Allow from all
633 </Proxy>
627 </Proxy>
634
628
635 #important !
629 #important !
636 #Directive to properly generate url (clone url) for pylons
630 #Directive to properly generate url (clone url) for pylons
637 ProxyPreserveHost On
631 ProxyPreserveHost On
638
632
639 #kallithea instance
633 #kallithea instance
640 ProxyPass / http://127.0.0.1:5000/
634 ProxyPass / http://127.0.0.1:5000/
641 ProxyPassReverse / http://127.0.0.1:5000/
635 ProxyPassReverse / http://127.0.0.1:5000/
642
636
643 #to enable https use line below
637 #to enable https use line below
644 #SetEnvIf X-Url-Scheme https HTTPS=1
638 #SetEnvIf X-Url-Scheme https HTTPS=1
645
639
646 </VirtualHost>
640 </VirtualHost>
647
641
648
642
649 Additional tutorial
643 Additional tutorial
650 http://wiki.pylonshq.com/display/pylonscookbook/Apache+as+a+reverse+proxy+for+Pylons
644 http://wiki.pylonshq.com/display/pylonscookbook/Apache+as+a+reverse+proxy+for+Pylons
651
645
652
646
653 Apache as subdirectory
647 Apache as subdirectory
654 ----------------------
648 ----------------------
655
649
656 Apache subdirectory part::
650 Apache subdirectory part::
657
651
658 <Location /<someprefix> >
652 <Location /<someprefix> >
659 ProxyPass http://127.0.0.1:5000/<someprefix>
653 ProxyPass http://127.0.0.1:5000/<someprefix>
660 ProxyPassReverse http://127.0.0.1:5000/<someprefix>
654 ProxyPassReverse http://127.0.0.1:5000/<someprefix>
661 SetEnvIf X-Url-Scheme https HTTPS=1
655 SetEnvIf X-Url-Scheme https HTTPS=1
662 </Location>
656 </Location>
663
657
664 Besides the regular apache setup you will need to add the following line
658 Besides the regular apache setup you will need to add the following line
665 into [app:main] section of your .ini file::
659 into [app:main] section of your .ini file::
666
660
667 filter-with = proxy-prefix
661 filter-with = proxy-prefix
668
662
669 Add the following at the end of the .ini file::
663 Add the following at the end of the .ini file::
670
664
671 [filter:proxy-prefix]
665 [filter:proxy-prefix]
672 use = egg:PasteDeploy#prefix
666 use = egg:PasteDeploy#prefix
673 prefix = /<someprefix>
667 prefix = /<someprefix>
674
668
675
669
676 then change <someprefix> into your chosen prefix
670 then change <someprefix> into your chosen prefix
677
671
678 Apache's WSGI config
672 Apache's WSGI config
679 --------------------
673 --------------------
680
674
681 Alternatively, Kallithea can be set up with Apache under mod_wsgi. For
675 Alternatively, Kallithea can be set up with Apache under mod_wsgi. For
682 that, you'll need to:
676 that, you'll need to:
683
677
684 - Install mod_wsgi. If using a Debian-based distro, you can install
678 - Install mod_wsgi. If using a Debian-based distro, you can install
685 the package libapache2-mod-wsgi::
679 the package libapache2-mod-wsgi::
686
680
687 aptitude install libapache2-mod-wsgi
681 aptitude install libapache2-mod-wsgi
688
682
689 - Enable mod_wsgi::
683 - Enable mod_wsgi::
690
684
691 a2enmod wsgi
685 a2enmod wsgi
692
686
693 - Create a wsgi dispatch script, like the one below. Make sure you
687 - Create a wsgi dispatch script, like the one below. Make sure you
694 check the paths correctly point to where you installed Kallithea
688 check the paths correctly point to where you installed Kallithea
695 and its Python Virtual Environment.
689 and its Python Virtual Environment.
696 - Enable the WSGIScriptAlias directive for the wsgi dispatch script,
690 - Enable the WSGIScriptAlias directive for the wsgi dispatch script,
697 as in the following example. Once again, check the paths are
691 as in the following example. Once again, check the paths are
698 correctly specified.
692 correctly specified.
699
693
700 Here is a sample excerpt from an Apache Virtual Host configuration file::
694 Here is a sample excerpt from an Apache Virtual Host configuration file::
701
695
702 WSGIDaemonProcess pylons \
696 WSGIDaemonProcess kallithea \
703 threads=4 \
697 processes=1 threads=4 \
704 python-path=/home/web/kallithea/pyenv/lib/python2.7/site-packages
698 python-path=/srv/kallithea/pyenv/lib/python2.7/site-packages
705 WSGIScriptAlias / /home/web/kallithea/dispatch.wsgi
699 WSGIScriptAlias / /srv/kallithea/dispatch.wsgi
706 WSGIPassAuthorization On
700 WSGIPassAuthorization On
707
701
702 Or if using a dispatcher wsgi script with proper virtualenv activation::
703
704 WSGIDaemonProcess kallithea processes=1 threads=4
705 WSGIScriptAlias / /srv/kallithea/dispatch.wsgi
706 WSGIPassAuthorization On
707
708
708 .. note::
709 .. note::
709 when running apache as root please add: `user=www-data group=www-data`
710 When running apache as root, please make sure it doesn't run Kallithea as
710 into above configuration
711 root, for examply by adding: `user=www-data group=www-data` to the configuration.
711
712
712 .. note::
713 .. note::
713 Running Kallithea in multiprocess mode in apache is not supported,
714 If running Kallithea in multiprocess mode,
714 make sure you don't specify `processes=num` directive in the config
715 make sure you set `instance_id = \*` in the configuration so each process
716 gets it's own cache invalidationkey.
715
717
716
718
717 Example wsgi dispatch script::
719 Example wsgi dispatch script::
718
720
719 import os
721 import os
720 os.environ["HGENCODING"] = "UTF-8"
722 os.environ["HGENCODING"] = "UTF-8"
721 os.environ['PYTHON_EGG_CACHE'] = '/home/web/kallithea/.egg-cache'
723 os.environ['PYTHON_EGG_CACHE'] = '/srv/kallithea/.egg-cache'
722
724
723 # sometimes it's needed to set the curent dir
725 # sometimes it's needed to set the curent dir
724 os.chdir('/home/web/kallithea/')
726 os.chdir('/srv/kallithea/')
725
727
726 import site
728 import site
727 site.addsitedir("/home/web/kallithea/pyenv/lib/python2.7/site-packages")
729 site.addsitedir("/srv/kallithea/pyenv/lib/python2.7/site-packages")
728
730
729 from paste.deploy import loadapp
731 from paste.deploy import loadapp
730 from paste.script.util.logging_config import fileConfig
732 from paste.script.util.logging_config import fileConfig
731
733
732 fileConfig('/home/web/kallithea/production.ini')
734 fileConfig('/srv/kallithea/my.ini')
733 application = loadapp('config:/home/web/kallithea/production.ini')
735 application = loadapp('config:/srv/kallithea/my.ini')
736
737 Or using proper virtualenv activation::
738
739 activate_this = '/srv/kallithea/venv/bin/activate_this.py'
740 execfile(activate_this,dict(__file__=activate_this))
734
741
735 Note: when using mod_wsgi you'll need to install the same version of
742 import os
736 Mercurial that's inside Kallithea's virtualenv also on the system's Python
743 os.environ['HOME'] = '/srv/kallithea'
737 environment.
744
745 ini = '/srv/kallithea/kallithea.ini'
746 from paste.script.util.logging_config import fileConfig
747 fileConfig(ini)
748 from paste.deploy import loadapp
749 application = loadapp('config:' + ini)
738
750
739
751
740 Other configuration files
752 Other configuration files
741 -------------------------
753 -------------------------
742
754
743 Some example init.d scripts can be found in init.d directory::
755 Some example init.d scripts can be found in init.d directory: https://kallithea-scm.org/repos/kallithea/files/tip/init.d/
744
745 https://kallithea-scm.org/repos/kallithea/files/tip/init.d/
746
756
747 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
757 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
748 .. _python: http://www.python.org/
758 .. _python: http://www.python.org/
749 .. _mercurial: http://mercurial.selenic.com/
759 .. _mercurial: http://mercurial.selenic.com/
750 .. _celery: http://celeryproject.org/
760 .. _celery: http://celeryproject.org/
751 .. _rabbitmq: http://www.rabbitmq.com/
761 .. _rabbitmq: http://www.rabbitmq.com/
752 .. _python-ldap: http://www.python-ldap.org/
762 .. _python-ldap: http://www.python-ldap.org/
753 .. _mercurial-server: http://www.lshift.net/mercurial-server.html
763 .. _mercurial-server: http://www.lshift.net/mercurial-server.html
754 .. _PublishingRepositories: http://mercurial.selenic.com/wiki/PublishingRepositories
764 .. _PublishingRepositories: http://mercurial.selenic.com/wiki/PublishingRepositories
755 .. _Issues tracker: https://bitbucket.org/conservancy/kallithea/issues
@@ -1,17 +1,20 b''
1 {% extends "basic/layout.html" %}
1 {% extends "basic/layout.html" %}
2
2
3 {% block sidebarlogo %}
3 {% block sidebarlogo %}
4 <div style="text-align:center;margin:10px;padding:20px;background:white">
5 <img src="{{pathto('_static/kallithea-logo.svg',1)}}"/>
6 </div>
4 <h3>Support Kallithea development</h3>
7 <h3>Support Kallithea development</h3>
5 <div style="text-align:center">
8 <div style="text-align:center">
6 <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
9 <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
7 <input type="hidden" name="cmd" value="_s-xclick">
10 <input type="hidden" name="cmd" value="_s-xclick">
8 <input type="hidden" name="hosted_button_id" value="EYXFS3SQPHYUL">
11 <input type="hidden" name="hosted_button_id" value="EYXFS3SQPHYUL">
9 <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
12 <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
10 <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
13 <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
11 </form>
14 </form>
12 <div style="padding:5px">
15 <div style="padding:5px">
13 <a href="https://flattr.com/thing/922714/Donate-to-Software-Freedom-Conservancy" target="_blank">
16 <a href="https://flattr.com/thing/922714/Donate-to-Software-Freedom-Conservancy" target="_blank">
14 <img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" border="0" /></a>
17 <img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" border="0" /></a>
15 </div>
18 </div>
16 </div>
19 </div>
17 {% endblock %}}
20 {% endblock %}}
@@ -1,30 +1,30 b''
1 .. _debugging:
1 .. _debugging:
2
2
3 ===================
3 ===================
4 Debugging Kallithea
4 Debugging Kallithea
5 ===================
5 ===================
6
6
7 If you encountered problems with Kallithea here are some instructions how to
7 If you encountered problems with Kallithea here are some instructions how to
8 possibly debug them.
8 possibly debug them.
9
9
10 ** First make sure you're using the latest version available.**
10 ** First make sure you're using the latest version available.**
11
11
12 enable detailed debug
12 Enable detailed debug
13 ---------------------
13 ---------------------
14
14
15 Kallithea uses standard python logging modules to log it's output.
15 Kallithea uses standard python logging modules to log it's output.
16 By default only loggers with INFO level are displayed. To enable full output
16 By default only loggers with INFO level are displayed. To enable full output
17 change `level = DEBUG` for all logging handlers in currently used .ini file.
17 change `level = DEBUG` for all logging handlers in currently used .ini file.
18 This change will allow to see much more detailed output in the logfile or
18 This change will allow to see much more detailed output in the logfile or
19 console. This generally helps a lot to track issues.
19 console. This generally helps a lot to track issues.
20
20
21
21
22 enable interactive debug mode
22 Enable interactive debug mode
23 -----------------------------
23 -----------------------------
24
24
25 To enable interactive debug mode simply comment out `set debug = false` in
25 To enable interactive debug mode simply comment out `set debug = false` in
26 .ini file, this will trigger and interactive debugger each time there an
26 .ini file, this will trigger and interactive debugger each time there an
27 error in browser, or send a http link if error occured in the backend. This
27 error in browser, or send a http link if error occured in the backend. This
28 is a great tool for fast debugging as you get a handy python console right
28 is a great tool for fast debugging as you get a handy python console right
29 in the web view. ** NEVER ENABLE THIS ON PRODUCTION ** the interactive console
29 in the web view. ** NEVER ENABLE THIS ON PRODUCTION ** the interactive console
30 can be a serious security threat to you system.
30 can be a serious security threat to you system.
@@ -1,166 +1,166 b''
1 .. _general:
1 .. _general:
2
2
3 =======================
3 =======================
4 General Kallithea usage
4 General Kallithea usage
5 =======================
5 =======================
6
6
7
7
8 Repository deleting
8 Repository deleting
9 -------------------
9 -------------------
10
10
11 Currently when admin/owner deletes a repository, Kallithea does not physically
11 Currently when admin/owner deletes a repository, Kallithea does not physically
12 delete a repository from filesystem, it renames it in a special way so it's
12 delete a repository from filesystem, it renames it in a special way so it's
13 not possible to push,clone or access repository. It's worth a notice that,
13 not possible to push,clone or access repository. It's worth a notice that,
14 even if someone will be given administrative access to Kallithea and will
14 even if someone will be given administrative access to Kallithea and will
15 delete a repository You can easy restore such action by restoring `rm__<date>`
15 delete a repository You can easy restore such action by restoring `rm__<date>`
16 from the repository name, and internal repository storage (.hg/.git). There
16 from the repository name, and internal repository storage (.hg/.git). There
17 is also a special command for cleaning such archived repos::
17 is also a special command for cleaning such archived repos::
18
18
19 paster cleanup-repos --older-than=30d production.ini
19 paster cleanup-repos --older-than=30d my.ini
20
20
21 This command will scan for archived repositories that are older than 30d,
21 This command will scan for archived repositories that are older than 30d,
22 display them and ask if you want to delete them (there's a --dont-ask flag also)
22 display them and ask if you want to delete them (there's a --dont-ask flag also)
23 If you host big amount of repositories with forks that are constantly deleted
23 If you host big amount of repositories with forks that are constantly deleted
24 it's recommended that you run such command via crontab.
24 it's recommended that you run such command via crontab.
25
25
26 Follow current branch in file view
26 Follow current branch in file view
27 ----------------------------------
27 ----------------------------------
28
28
29 In file view when this checkbox is checked the << and >> arrows will jump
29 In file view when this checkbox is checked the << and >> arrows will jump
30 to changesets within the same branch currently viewing. So for example
30 to changesets within the same branch currently viewing. So for example
31 if someone is viewing files at 'beta' branch and marks `follow current branch`
31 if someone is viewing files at 'beta' branch and marks `follow current branch`
32 checkbox the << and >> buttons will only show him revisions for 'beta' branch
32 checkbox the << and >> buttons will only show him revisions for 'beta' branch
33
33
34
34
35 Compare view from changelog
35 Compare view from changelog
36 ---------------------------
36 ---------------------------
37
37
38 Checkboxes in compare view allow users to view combined compare view. You can
38 Checkboxes in compare view allow users to view combined compare view. You can
39 only show the range between the first and last checkbox (no cherry pick).
39 only show the range between the first and last checkbox (no cherry pick).
40 Clicking more than one checkbox will activate a link in top saying
40 Clicking more than one checkbox will activate a link in top saying
41 `Show selected changesets <from-rev> -> <to-rev>` clicking this will bring
41 `Show selected changesets <from-rev> -> <to-rev>` clicking this will bring
42 compare view. In this view also it's possible to switch to combined compare.
42 compare view. In this view also it's possible to switch to combined compare.
43
43
44 Compare view is also available from the journal on pushes having more than
44 Compare view is also available from the journal on pushes having more than
45 one changeset
45 one changeset
46
46
47
47
48 Non changeable repository urls
48 Non changeable repository urls
49 ------------------------------
49 ------------------------------
50
50
51 Due to complicated nature of repository grouping, often urls of repositories
51 Due to complicated nature of repository grouping, often urls of repositories
52 can change.
52 can change.
53
53
54 example::
54 example::
55
55
56 #before
56 #before
57 http://server.com/repo_name
57 http://server.com/repo_name
58 # after insertion to test_group group the url will be
58 # after insertion to test_group group the url will be
59 http://server.com/test_group/repo_name
59 http://server.com/test_group/repo_name
60
60
61 This can be an issue for build systems and any other hardcoded scripts, moving
61 This can be an issue for build systems and any other hardcoded scripts, moving
62 repository to a group leads to a need for changing external systems. To
62 repository to a group leads to a need for changing external systems. To
63 overcome this Kallithea introduces a non changable replacement url. It's
63 overcome this Kallithea introduces a non changable replacement url. It's
64 simply an repository ID prefixed with `_` above urls are also accessible as::
64 simply an repository ID prefixed with `_` above urls are also accessible as::
65
65
66 http://server.com/_<ID>
66 http://server.com/_<ID>
67
67
68 Since ID are always the same moving the repository will not affect such url.
68 Since ID are always the same moving the repository will not affect such url.
69 the _<ID> syntax can be used anywhere in the system so urls with repo_name
69 the _<ID> syntax can be used anywhere in the system so urls with repo_name
70 for changelogs, files and other can be exchanged with _<ID> syntax.
70 for changelogs, files and other can be exchanged with _<ID> syntax.
71
71
72
72
73 Mailing
73 Mailing
74 -------
74 -------
75
75
76 When administrator will fill up the mailing settings in .ini files
76 When administrator will fill up the mailing settings in .ini files
77 Kallithea will send mails on user registration, or when Kallithea errors occur
77 Kallithea will send mails on user registration, or when Kallithea errors occur
78 on errors the mails will have a detailed traceback of error.
78 on errors the mails will have a detailed traceback of error.
79
79
80
80
81 Mails are also sent for code comments. If someone comments on a changeset
81 Mails are also sent for code comments. If someone comments on a changeset
82 mail is sent to all participants, the person who commited the changeset
82 mail is sent to all participants, the person who commited the changeset
83 (if present in Kallithea), and to all people mentioned with @mention system.
83 (if present in Kallithea), and to all people mentioned with @mention system.
84
84
85
85
86 Trending source files
86 Trending source files
87 ---------------------
87 ---------------------
88
88
89 Trending source files are calculated based on pre defined dict of known
89 Trending source files are calculated based on pre defined dict of known
90 types and extensions. If You miss some extension or Would like to scan some
90 types and extensions. If You miss some extension or Would like to scan some
91 custom files it's possible to add new types in `LANGUAGES_EXTENSIONS_MAP` dict
91 custom files it's possible to add new types in `LANGUAGES_EXTENSIONS_MAP` dict
92 located in `/kallithea/lib/celerylib/tasks.py`
92 located in `/kallithea/lib/celerylib/tasks.py`
93
93
94
94
95 Cloning remote repositories
95 Cloning remote repositories
96 ---------------------------
96 ---------------------------
97
97
98 Kallithea has an ability to clone remote repos from given remote locations.
98 Kallithea has an ability to clone remote repos from given remote locations.
99 Currently it support following options:
99 Currently it support following options:
100
100
101 - hg -> hg clone
101 - hg -> hg clone
102 - svn -> hg clone
102 - svn -> hg clone
103 - git -> git clone
103 - git -> git clone
104
104
105
105
106 .. note::
106 .. note::
107
107
108 - *`svn -> hg` cloning requires `hgsubversion` library to be installed.*
108 - *`svn -> hg` cloning requires `hgsubversion` library to be installed.*
109
109
110 If you need to clone repositories that are protected via basic auth, you
110 If you need to clone repositories that are protected via basic auth, you
111 might pass the url with stored credentials inside eg.
111 might pass the url with stored credentials inside eg.
112 `http://user:passw@remote.server/repo`, Kallithea will try to login and clone
112 `http://user:passw@remote.server/repo`, Kallithea will try to login and clone
113 using given credentials. Please take a note that they will be stored as
113 using given credentials. Please take a note that they will be stored as
114 plaintext inside the database. Kallithea will remove auth info when showing the
114 plaintext inside the database. Kallithea will remove auth info when showing the
115 clone url in summary page.
115 clone url in summary page.
116
116
117
117
118
118
119 Visual settings in admin pannel
119 Visual settings in admin pannel
120 -------------------------------
120 -------------------------------
121
121
122
122
123 Visualisation settings in Kallithea settings view are extra customizations
123 Visualisation settings in Kallithea settings view are extra customizations
124 of server behavior. There are 3 main section in the settings.
124 of server behavior. There are 3 main section in the settings.
125
125
126 General
126 General
127 ~~~~~~~
127 ~~~~~~~
128
128
129 `Use repository extra fields` option allows to set a custom fields for each
129 `Use repository extra fields` option allows to set a custom fields for each
130 repository in the system. Each new field consists of 3 attributes `field key`,
130 repository in the system. Each new field consists of 3 attributes `field key`,
131 `field label`, `field description`. Example usage of such fields would be to
131 `field label`, `field description`. Example usage of such fields would be to
132 define company specific information into repositories eg. defining repo_manager
132 define company specific information into repositories eg. defining repo_manager
133 key that would add give info about a manager of each repository. There's no
133 key that would add give info about a manager of each repository. There's no
134 limit for adding custom fields. Newly created fields are accessible via API.
134 limit for adding custom fields. Newly created fields are accessible via API.
135
135
136 `Show Kallithea version` option toggles displaying exact Kallithea version in
136 `Show Kallithea version` option toggles displaying exact Kallithea version in
137 the footer
137 the footer
138
138
139
139
140 Dashboard items
140 Dashboard items
141 ~~~~~~~~~~~~~~~
141 ~~~~~~~~~~~~~~~
142
142
143 Number if items in main page dashboard before pagination is displayed
143 Number if items in main page dashboard before pagination is displayed
144
144
145
145
146 Icons
146 Icons
147 ~~~~~
147 ~~~~~
148
148
149 Show public repo icon / Show private repo icon on repositories - defines if
149 Show public repo icon / Show private repo icon on repositories - defines if
150 public/private icons should be shown in the UI.
150 public/private icons should be shown in the UI.
151
151
152
152
153 Meta-Tagging
153 Meta-Tagging
154 ~~~~~~~~~~~~
154 ~~~~~~~~~~~~
155
155
156 With this option enabled, special metatags that are recognisible by Kallithea
156 With this option enabled, special metatags that are recognisible by Kallithea
157 will be turned into colored tags. Currently available tags are::
157 will be turned into colored tags. Currently available tags are::
158
158
159 [featured]
159 [featured]
160 [stale]
160 [stale]
161 [dead]
161 [dead]
162 [lang => lang]
162 [lang => lang]
163 [license => License]
163 [license => License]
164 [requires => Repo]
164 [requires => Repo]
165 [recommends => Repo]
165 [recommends => Repo]
166 [see => URI]
166 [see => URI]
@@ -1,55 +1,49 b''
1 .. _git_support:
1 .. _git_support:
2
2
3 ===========
3 ===========
4 GIT support
4 GIT support
5 ===========
5 ===========
6
6
7
7
8 Git support in Kallithea 1.3 was enabled by default. You need to have a git
8 Kallithea Git support is enabled by default. You just need a git
9 client installed on the machine to make git fully work.
9 command line client installed on the server to make Git work fully.
10
10
11 Although There is one limitation on git usage.
11 Web server with chunked encoding
12
12 --------------------------------
13 - large pushes requires a http server with chunked encoding support.
14
13
15 if you plan to use git you need to run Kallithea with some
14 Large Git pushes do however require a http server with support for chunked encoding for POST.
16 http server that supports chunked encoding which git http protocol uses,
17 i recommend using waitress_ or gunicorn_ (linux only) for `paste` wsgi app
18 replacement. Starting from version 1.4 waitress_ is the default wsgi server
19 used in Kallithea.
20
15
21 To use, simply change change the following in the .ini file::
16 The Python web servers waitress_ and gunicorn_ (linux only) can be used.
17 By default, Kallithea uses waitress_ for `paster serve` instead of the built-in `paste` WSGI server.
22
18
23 use = egg:Paste#http
19 The default paste server is controlled in the .ini file::
24
25 to::
26
20
27 use = egg:waitress#main
21 use = egg:waitress#main
28
22
29 or::
23 or::
30
24
31 use = egg:gunicorn#main
25 use = egg:gunicorn#main
32
26
33
27
34 And comment out bellow options::
28 Also make sure to comment out the following options::
35
29
36 threadpool_workers =
30 threadpool_workers =
37 threadpool_max_requests =
31 threadpool_max_requests =
38 use_threadpool =
32 use_threadpool =
39
33
40
34
41 You can simply run `paster serve` as usual.
35 Disabling Git
42
36 -------------
43
37
44 You can always disable git/hg support by editing a
38 You can always disable git/hg support by editing a
45 file **kallithea/__init__.py** and commenting out backends
39 file **kallithea/__init__.py** and commenting out the backend.
46
40
47 .. code-block:: python
41 .. code-block:: python
48
42
49 BACKENDS = {
43 BACKENDS = {
50 'hg': 'Mercurial repository',
44 'hg': 'Mercurial repository',
51 #'git': 'Git repository',
45 #'git': 'Git repository',
52 }
46 }
53
47
54 .. _waitress: http://pypi.python.org/pypi/waitress
48 .. _waitress: http://pypi.python.org/pypi/waitress
55 .. _gunicorn: http://pypi.python.org/pypi/gunicorn
49 .. _gunicorn: http://pypi.python.org/pypi/gunicorn
@@ -1,41 +1,38 b''
1 .. _locking:
1 .. _locking:
2
2
3 ===================================
3 ===================================
4 Kallithea repository locking system
4 Kallithea repository locking system
5 ===================================
5 ===================================
6
6
7
7
8 The scenario for repos with `locking function` enabled is that
9 every initial clone and every pull gives users (with write permission)
10 the exclusive right to do a push.
11
12 Each repo can be manually unlocked by admin from the repo settings menu.
13
8 | Repos with **locking function=disabled** is the default, that's how repos work
14 | Repos with **locking function=disabled** is the default, that's how repos work
9 today.
15 today.
10 | Repos with **locking function=enabled** behaves like follows:
16 | Repos with **locking function=enabled** behaves like follows:
11
17
12 Repos have a state called `locked` that can be true or false.
18 Repos have a state called `locked` that can be true or false.
13 The hg/git commands `hg/git clone`, `hg/git pull`, and `hg/git push`
19 The hg/git commands `hg/git clone`, `hg/git pull`, and `hg/git push`
14 influence this state:
20 influence this state:
15
21
16 - The command `hg/git pull <repo>` will lock that repo (locked=true)
22 - The command `hg/git pull <repo>` will lock that repo (locked=true)
17 if the user has write/admin permissions on this repo
23 if the user has write/admin permissions on this repo
18
24
19 - The command `hg/git clone <repo>` will lock that repo (locked=true) if the
25 - The command `hg/git clone <repo>` will lock that repo (locked=true) if the
20 user has write/admin permissions on this repo
26 user has write/admin permissions on this repo
21
27
22
28
23 Kallithea will remember the user id who locked the repo
29 Kallithea will remember the user id who locked the repo so
24 only this specific user can unlock the repo (locked=false) by calling
30 only this specific user can unlock the repo (locked=false) by calling
25
31
26 - `hg/git push <repo>`
32 - `hg/git push <repo>`
27
33
28 every other command on that repo from this user and
34 Every other command on that repo from this user and
29 every command from any other user will result in http return code 423 (locked)
35 every command from any other user will result in http return code 423 (locked).
30
31
32 additionally the http error includes the <user> that locked the repo
33 (e.g. “repository <repo> locked by user <user>”)
34
36
35
37 Additionally, the http error includes the <user> that locked the repo
36 So the scenario of use for repos with `locking function` enabled is that
38 (e.g. “repository <repo> locked by user <user>”).
37 every initial clone and every pull gives users (with write permission)
38 the exclusive right to do a push.
39
40
41 Each repo can be manually unlocked by admin from the repo settings menu.
@@ -1,33 +1,33 b''
1 .. _statistics:
1 .. _statistics:
2
2
3 ==========
3 ==========
4 Statistics
4 Statistics
5 ==========
5 ==========
6
6
7 The Kallithea statistics system makes heavy demands of the server resources, so
7 The Kallithea statistics system makes heavy demands of the server resources, so
8 in order to keep a balance between usability and performance, the statistics are
8 in order to keep a balance between usability and performance, the statistics are
9 cached inside db and are gathered incrementally, this is how Kallithea does
9 cached inside db and are gathered incrementally. This is how Kallithea does
10 this:
10 this:
11
11
12 With Celery disabled
12 With Celery disabled
13 --------------------
13 --------------------
14
14
15 - On each first visit to the summary page a set of 250 commits are parsed and
15 - On each first visit to the summary page a set of 250 commits are parsed and
16 updates statistics cache.
16 updates statistics cache.
17 - This happens on each single visit to the statistics page until all commits are
17 - This happens on each single visit to the statistics page until all commits are
18 fetched. Statistics are kept cached until additional commits are added to the
18 fetched. Statistics are kept cached until additional commits are added to the
19 repository. In such a case Kallithea will only fetch the new commits when
19 repository. In such a case Kallithea will only fetch the new commits when
20 updating it's cache.
20 updating it's cache.
21
21
22
22
23 With Celery enabled
23 With Celery enabled
24 -------------------
24 -------------------
25
25
26 - On the first visit to the summary page Kallithea will create tasks that will
26 - On the first visit to the summary page Kallithea will create tasks that will
27 execute on celery workers. This task will gather all of the stats until all
27 execute on celery workers. This task will gather all of the stats until all
28 commits are parsed, each task will parse 250 commits, and run the next task to
28 commits are parsed, each task will parse 250 commits, and run the next task to
29 parse next 250 commits, until all of the commits are parsed.
29 parse next 250 commits, until all of the commits are parsed.
30
30
31 .. note::
31 .. note::
32 At any time you can disable statistics on each repository via the repository
32 At any time you can disable statistics on each repository via the repository
33 edit form in the admin panel. To do this just uncheck the statistics checkbox.
33 edit form in the admin panel. To do this just uncheck the statistics checkbox.
@@ -1,37 +1,36 b''
1 .. _subrepos:
1 .. _subrepos:
2
2
3 =============================================
3 =============================================
4 working with Kallithea and mercurial subrepos
4 Working with Kallithea and Mercurial subrepos
5 =============================================
5 =============================================
6
6
7 example usage of Subrepos with Kallithea::
7 Example usage of Subrepos with Kallithea::
8
8
9 ## init a simple repo
9 ## init a simple repo
10 hg init repo1
10 hg init repo1
11 cd repo1
11 cd repo1
12 echo "file1" > file1
12 echo "file1" > file1
13 hg add file1
13 hg add file1
14 hg ci --message "initial file 1"
14 hg ci --message "initial file 1"
15
15
16 #clone subrepo we want to add
16 #clone subrepo we want to add
17 hg clone http://rc.local/subrepo
17 hg clone http://kallithea.local/subrepo
18
18
19 ## use path like url to existing repo in Kallithea
19 ## use path like url to existing repo in Kallithea
20 echo "subrepo = http://rc.local/subrepo" > .hgsub
20 echo "subrepo = http://kallithea.local/subrepo" > .hgsub
21
21
22 hg add .hgsub
22 hg add .hgsub
23 hg ci --message "added remote subrepo"
23 hg ci --message "added remote subrepo"
24
24
25
25
26 In the file list of a clone of repo1 you will see a connected subrepo at
27 revision it was during cloning.
28 Clicking in subrepos link should send you to proper repository in Kallithea.
26
29
27 In file list of repo1 you will see a connected subrepo at revision it was
30 Cloning repo1 will also clone attached subrepository.
28 during cloning.
29 Clicking in subrepos link should send you to proper repository in Kallithea
30
31 cloning repo1 will also clone attached subrepository.
32
31
33 Next we can edit the subrepo data, and push back to Kallithea. This will update
32 Next we can edit the subrepo data, and push back to Kallithea. This will update
34 both of repositories.
33 both of repositories.
35
34
36 see http://mercurial.aragost.com/kick-start/en/subrepositories/ for more
35 See http://mercurial.aragost.com/kick-start/en/subrepositories/ for more
37 information about subrepositories
36 information about subrepositories.
@@ -1,78 +1,75 b''
1 .. _troubleshooting:
1 .. _troubleshooting:
2
2
3
3
4 ===============
4 ===============
5 Troubleshooting
5 Troubleshooting
6 ===============
6 ===============
7
7
8 :Q: **Missing static files?**
8 :Q: **Missing static files?**
9 :A: Make sure either to set the `static_files = true` in the .ini file or
9 :A: Make sure either to set the `static_files = true` in the .ini file or
10 double check the root path for your http setup. It should point to
10 double check the root path for your http setup. It should point to
11 for example:
11 for example:
12 /home/my-virtual-python/lib/python2.7/site-packages/kallithea/public
12 /home/my-virtual-python/lib/python2.7/site-packages/kallithea/public
13
13
14 |
14 |
15
15
16 :Q: **Can't install celery/rabbitmq?**
16 :Q: **Can't install celery/rabbitmq?**
17 :A: Don't worry Kallithea works without them too. No extra setup is required.
17 :A: Don't worry Kallithea works without them too. No extra setup is required.
18 Try out great celery docs for further help.
18 Try out great celery docs for further help.
19
19
20 |
20 |
21
21
22 :Q: **Long lasting push timeouts?**
22 :Q: **Long lasting push timeouts?**
23 :A: Make sure you set a longer timeouts in your proxy/fcgi settings, timeouts
23 :A: Make sure you set a longer timeouts in your proxy/fcgi settings, timeouts
24 are caused by https server and not Kallithea.
24 are caused by https server and not Kallithea.
25
25
26 |
26 |
27
27
28 :Q: **Large pushes timeouts?**
28 :Q: **Large pushes timeouts?**
29 :A: Make sure you set a proper max_body_size for the http server. Very often
29 :A: Make sure you set a proper max_body_size for the http server. Very often
30 Apache, Nginx or other http servers kill the connection due to to large
30 Apache, Nginx or other http servers kill the connection due to to large
31 body.
31 body.
32
32
33 |
33 |
34
34
35 :Q: **Apache doesn't pass basicAuth on pull/push?**
35 :Q: **Apache doesn't pass basicAuth on pull/push?**
36 :A: Make sure you added `WSGIPassAuthorization true`.
36 :A: Make sure you added `WSGIPassAuthorization true`.
37
37
38 |
38 |
39
39
40 :Q: **Git fails on push/pull?**
40 :Q: **Git fails on push/pull?**
41 :A: Make sure you're using an wsgi http server that can handle chunked encoding
41 :A: Make sure you're using an wsgi http server that can handle chunked encoding
42 such as `waitress` or `gunicorn`
42 such as `waitress` or `gunicorn`.
43
43
44 |
44 |
45
45
46 :Q: **How i use hooks in Kallithea?**
46 :Q: **How can I use hooks in Kallithea?**
47 :A: It's easy if they are python hooks just use advanced link in hooks section
47 :A: It's easy if they are python hooks just use advanced link in hooks section
48 in Admin panel, that works only for Mercurial. If you want to use githooks,
48 in Admin panel, that works only for Mercurial. If you want to use githooks,
49 just install proper one in repository eg. create file in
49 just install proper one in repository eg. create file in
50 `/gitrepo/hooks/pre-receive`. You can also use Kallithea-extensions to
50 `/gitrepo/hooks/pre-receive`. You can also use Kallithea-extensions to
51 connect to callback hooks, for both Git and Mercurial.
51 connect to callback hooks, for both Git and Mercurial.
52
52
53 |
53 |
54
54
55 :Q: **Kallithea is slow for me, how can i make it faster?**
55 :Q: **Kallithea is slow for me, how can I make it faster?**
56 :A: See the :ref:`performance` section
56 :A: See the :ref:`performance` section.
57
57
58 |
58 |
59
59
60 :Q: **UnicodeDecodeError on Apache mod_wsgi**
60 :Q: **UnicodeDecodeError on Apache mod_wsgi**
61 :A: Please read: https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/modwsgi/#if-you-get-a-unicodeencodeerror
61 :A: Please read: https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/modwsgi/#if-you-get-a-unicodeencodeerror.
62
62
63 |
63 |
64
64
65 :Q: **Requests hanging on Windows**
65 :Q: **Requests hanging on Windows**
66 :A: Please try out with disabled Antivirus software, there are some known problems with Eset Anitivirus. Make sure
66 :A: Please try out with disabled Antivirus software, there are some known problems with Eset Anitivirus. Make sure
67 you have installed latest windows patches (especially KB2789397)
67 you have installed latest windows patches (especially KB2789397).
68
68
69
69
70 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
70 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
71 .. _python: http://www.python.org/
71 .. _python: http://www.python.org/
72 .. _mercurial: http://mercurial.selenic.com/
72 .. _mercurial: http://mercurial.selenic.com/
73 .. _celery: http://celeryproject.org/
73 .. _celery: http://celeryproject.org/
74 .. _rabbitmq: http://www.rabbitmq.com/
74 .. _rabbitmq: http://www.rabbitmq.com/
75 .. _python-ldap: http://www.python-ldap.org/
75 .. _python-ldap: http://www.python-ldap.org/
76 .. _mercurial-server: http://www.lshift.net/mercurial-server.html
77 .. _PublishingRepositories: http://mercurial.selenic.com/wiki/PublishingRepositories
78 .. _Issues tracker: https://bitbucket.org/conservancy/kallithea/issues
@@ -1,51 +1,51 b''
1 ; Kallithea Supervisord
1 ; Kallithea Supervisord
2 ; ##########################
2 ; ##########################
3 ; for help see http://supervisord.org/configuration.html
3 ; for help see http://supervisord.org/configuration.html
4 ; ##########################
4 ; ##########################
5
5
6 [inet_http_server] ; inet (TCP) server disabled by default
6 [inet_http_server] ; inet (TCP) server disabled by default
7 port=127.0.0.1:9001 ; (ip_address:port specifier, *:port for all iface)
7 port=127.0.0.1:9001 ; (ip_address:port specifier, *:port for all iface)
8 ;username=user ; (default is no username (open server))
8 ;username=user ; (default is no username (open server))
9 ;password=123 ; (default is no password (open server))
9 ;password=123 ; (default is no password (open server))
10
10
11 [supervisord]
11 [supervisord]
12 logfile=/%(here)s/supervisord_kallithea.log ; (main log file;default $CWD/supervisord.log)
12 logfile=/%(here)s/supervisord_kallithea.log ; (main log file;default $CWD/supervisord.log)
13 logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
13 logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
14 logfile_backups=10 ; (num of main logfile rotation backups;default 10)
14 logfile_backups=10 ; (num of main logfile rotation backups;default 10)
15 loglevel=info ; (log level;default info; others: debug,warn,trace)
15 loglevel=info ; (log level;default info; others: debug,warn,trace)
16 pidfile=/%(here)s/supervisord_kallithea.pid ; (supervisord pidfile;default supervisord.pid)
16 pidfile=/%(here)s/supervisord_kallithea.pid ; (supervisord pidfile;default supervisord.pid)
17 nodaemon=true ; (start in foreground if true;default false)
17 nodaemon=true ; (start in foreground if true;default false)
18 minfds=1024 ; (min. avail startup file descriptors;default 1024)
18 minfds=1024 ; (min. avail startup file descriptors;default 1024)
19 minprocs=200 ; (min. avail process descriptors;default 200)
19 minprocs=200 ; (min. avail process descriptors;default 200)
20 umask=022 ; (process file creation umask;default 022)
20 umask=022 ; (process file creation umask;default 022)
21 user=username ; (default is current user, required if root)
21 user=username ; (default is current user, required if root)
22 ;identifier=supervisor ; (supervisord identifier, default is 'supervisor')
22 ;identifier=supervisor ; (supervisord identifier, default is 'supervisor')
23 ;directory=/tmp ; (default is not to cd during start)
23 ;directory=/tmp ; (default is not to cd during start)
24 ;nocleanup=true ; (don't clean up tempfiles at start;default false)
24 ;nocleanup=true ; (don't clean up tempfiles at start;default false)
25 ;childlogdir=/tmp ; ('AUTO' child log dir, default $TEMP)
25 ;childlogdir=/tmp ; ('AUTO' child log dir, default $TEMP)
26 environment=HOME=/home/username ; (key value pairs to add to environment)
26 environment=HOME=/srv/kallithea ; (key value pairs to add to environment)
27 ;strip_ansi=false ; (strip ansi escape codes in logs; def. false)
27 ;strip_ansi=false ; (strip ansi escape codes in logs; def. false)
28
28
29 ; the below section must remain in the config file for RPC
29 ; the below section must remain in the config file for RPC
30 ; (supervisorctl/web interface) to work, additional interfaces may be
30 ; (supervisorctl/web interface) to work, additional interfaces may be
31 ; added by defining them in separate rpcinterface: sections
31 ; added by defining them in separate rpcinterface: sections
32 [rpcinterface:supervisor]
32 [rpcinterface:supervisor]
33 supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
33 supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
34
34
35 [supervisorctl]
35 [supervisorctl]
36 serverurl=http://127.0.0.1:9001 ; use an http:// url to specify an inet socket
36 serverurl=http://127.0.0.1:9001 ; use an http:// url to specify an inet socket
37 ;username=user ; should be same as http_username if set
37 ;username=user ; should be same as http_username if set
38 ;password=123 ; should be same as http_password if set
38 ;password=123 ; should be same as http_password if set
39 ;prompt=mysupervisor ; cmd line prompt (default "supervisor")
39 ;prompt=mysupervisor ; cmd line prompt (default "supervisor")
40 ;history_file=~/.sc_history ; use readline history if available
40 ;history_file=~/.sc_history ; use readline history if available
41
41
42
42
43 ; restart with supervisorctl restart kallithea:*
43 ; restart with supervisorctl restart kallithea:*
44 [program:kallithea]
44 [program:kallithea]
45 numprocs = 1
45 numprocs = 1
46 numprocs_start = 5000 # possible should match ports
46 numprocs_start = 5000 # possible should match ports
47 directory=/home/username/kallithea-dir
47 directory=/srv/kallithea
48 command = /home/username/v-env/bin/paster serve rc.ini
48 command = /srv/kallithea/venv/bin/paster serve my.ini
49 process_name = %(program_name)s_%(process_num)04d
49 process_name = %(program_name)s_%(process_num)04d
50 redirect_stderr=true
50 redirect_stderr=true
51 stdout_logfile=/%(here)s/kallithea.log No newline at end of file
51 stdout_logfile=/%(here)s/kallithea.log
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now