##// END OF EJS Templates
docs: spelling, grammar, content and typography
Søren Løvborg -
r5425:5ae8e644 default
parent child Browse files
Show More
@@ -1,211 +1,213 b''
1 ================
1 ================
2 Kallithea README
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. It works on
9 with a built-in push/pull server, full text search and code-review. It works on
10 http/https and has a built in permission/authentication system with the ability
10 http/https and has a built in permission/authentication system with the ability
11 to authenticate via LDAP or ActiveDirectory. Kallithea also provides simple API
11 to authenticate via LDAP or ActiveDirectory. Kallithea also provides simple API
12 so it's easy to integrate with existing external systems.
12 so it's easy to integrate with existing external systems.
13
13
14 Kallithea is similar in some respects to GitHub_ or Bitbucket_, however
14 Kallithea is similar in some respects to GitHub_ or Bitbucket_, however
15 Kallithea can be run as standalone hosted application on your own server. It is
15 Kallithea can be run as standalone hosted application on your own server. It is
16 open-source donationware and focuses more on providing a customised,
16 open-source donationware and focuses more on providing a customised,
17 self-administered interface for Mercurial_ and Git_ repositories. Kallithea
17 self-administered interface for Mercurial_ and Git_ repositories. Kallithea
18 works on Unix-like systems and Windows, and is powered by the vcs_ library
18 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
24 Installation
25 Installation
25 ------------
26 ------------
26 Kallithea requires Python_ 2.x and it is recommended to install it in a
27 Kallithea requires Python_ 2.x and it is recommended to install it in a
27 virtualenv_. Official releases of Kallithea can be installed with::
28 virtualenv_. Official releases of Kallithea can be installed with::
28
29
29 pip install kallithea
30 pip install kallithea
30
31
31 The development repository is kept very stable and used in production by the
32 The development repository is kept very stable and used in production by the
32 developers - you can do the same.
33 developers -- you can do the same.
33
34
34 Please visit https://docs.kallithea-scm.org/en/latest/installation.html for
35 Please visit https://docs.kallithea-scm.org/en/latest/installation.html for
35 more details.
36 more details.
36
37
37
38
38 Source code
39 Source code
39 -----------
40 -----------
40
41
41 The latest sources can be obtained from
42 The latest sources can be obtained from
42 https://kallithea-scm.org/repos/kallithea.
43 https://kallithea-scm.org/repos/kallithea.
43
44
44 The issue tracker and a repository mirror can be found at Bitbucket_ on
45 The issue tracker and a repository mirror can be found at Bitbucket_ on
45 https://bitbucket.org/conservancy/kallithea.
46 https://bitbucket.org/conservancy/kallithea.
46
47
47
48
48 Kallithea features
49 Kallithea features
49 ------------------
50 ------------------
50
51
51 - Has its own middleware to handle Mercurial_ and Git_ protocol requests. Each
52 - Has its own middleware to handle Mercurial_ and Git_ protocol requests. Each
52 request is authenticated and logged together with IP address.
53 request is authenticated and logged together with IP address.
53 - Built for speed and performance. You can make multiple pulls/pushes
54 - Built for speed and performance. You can make multiple pulls/pushes
54 simultaneously. Proven to work with thousands of repositories and users.
55 simultaneously. Proven to work with thousands of repositories and users.
55 - Supports http/https, LDAP, AD, proxy-pass authentication.
56 - Supports http/https, LDAP, AD, proxy-pass authentication.
56 - Full permissions (private/read/write/admin) together with IP restrictions for
57 - Full permissions (private/read/write/admin) together with IP restrictions for
57 each repository, additional explicit forking, repositories group and
58 each repository, additional explicit forking, repositories group and
58 repository creation permissions.
59 repository creation permissions.
59 - User groups for easier permission management.
60 - User groups for easier permission management.
60 - Repository groups let you group repos and manage them easier. They come with
61 - Repository groups let you group repos and manage them easier. They come with
61 permission delegation features, so you can delegate groups management.
62 permission delegation features, so you can delegate groups management.
62 - Users can fork other users repos, and compare them at any time.
63 - Users can fork other users repos, and compare them at any time.
63 - Built-in versioned paste functionality (Gist) for sharing code snippets.
64 - Built-in versioned paste functionality (Gist) for sharing code snippets.
64 - Integrates easily with other systems, with custom created mappers you can
65 - Integrates easily with other systems, with custom created mappers you can
65 connect it to almost any issue tracker, and with a JSON-RPC API you can make
66 connect it to almost any issue tracker, and with a JSON-RPC API you can make
66 much more.
67 much more.
67 - Built-in commit API lets you add, edit and commit files right from Kallithea
68 - Built-in commit API lets you add, edit and commit files right from Kallithea
68 web interface using simple editor or upload binary files using simple form.
69 web interface using simple editor or upload binary files using simple form.
69 - Powerful pull request driven review system with inline commenting, changeset
70 - Powerful pull request driven review system with inline commenting, changeset
70 statuses, and notification system.
71 statuses, and notification system.
71 - Importing and syncing repositories from remote locations for Git_, Mercurial_
72 - Importing and syncing repositories from remote locations for Git_, Mercurial_
72 and Subversion.
73 and Subversion.
73 - Mako templates let you customize the look and feel of the application.
74 - Mako templates let you customize the look and feel of the application.
74 - Beautiful diffs, annotations and source code browsing all colored by
75 - Beautiful diffs, annotations and source code browsing all colored by
75 pygments. Raw diffs are made in Git-diff format for both VCS systems,
76 pygments. Raw diffs are made in Git-diff format for both VCS systems,
76 including Git_ binary-patches.
77 including Git_ binary-patches.
77 - Mercurial_ and Git_ DAG graphs and Flot-powered graphs with zooming and
78 - Mercurial_ and Git_ DAG graphs and Flot-powered graphs with zooming and
78 statistics to track activity for repositories.
79 statistics to track activity for repositories.
79 - Admin interface with user/permission management. Admin activity journal, logs
80 - Admin interface with user/permission management. Admin activity journal, logs
80 pulls, pushes, forks, registrations and other actions made by all users.
81 pulls, pushes, forks, registrations and other actions made by all users.
81 - Server side forks. It is possible to fork a project and modify it freely
82 - Server side forks. It is possible to fork a project and modify it freely
82 without breaking the main repository.
83 without breaking the main repository.
83 - reST and Markdown README support for repositories.
84 - reST and Markdown README support for repositories.
84 - Full text search powered by Whoosh on the source files, commit messages, and
85 - Full text search powered by Whoosh on the source files, commit messages, and
85 file names. Built-in indexing daemons, with optional incremental index build
86 file names. Built-in indexing daemons, with optional incremental index build
86 (no external search servers required all in one application).
87 (no external search servers required all in one application).
87 - Setup project descriptions/tags and info inside built in DB for easy,
88 - Setup project descriptions/tags and info inside built in DB for easy,
88 non-filesystem operations.
89 non-filesystem operations.
89 - Intelligent cache with invalidation after push or project change, provides
90 - Intelligent cache with invalidation after push or project change, provides
90 high performance and always up to date data.
91 high performance and always up to date data.
91 - RSS/Atom feeds, Gravatar support, downloadable sources as zip/tar/gz.
92 - RSS/Atom feeds, Gravatar support, downloadable sources as zip/tar/gz.
92 - Optional async tasks for speed and performance using Celery_.
93 - Optional async tasks for speed and performance using Celery_.
93 - Backup scripts can do backup of whole app and send it over scp to desired
94 - Backup scripts can do backup of whole app and send it over scp to desired
94 location.
95 location.
95 - Based on Pylons, SQLAlchemy, SQLite, Whoosh, vcs.
96 - Based on Pylons, SQLAlchemy, SQLite, Whoosh, vcs.
96
97
97
98
98 License
99 License
99 -------
100 -------
100
101
101 **Kallithea** is released under the GPLv3 license. Kallithea is a `Software
102 **Kallithea** is released under the GPLv3 license. Kallithea is a `Software
102 Freedom Conservancy`_ project and thus controlled by a non-profit organization.
103 Freedom Conservancy`_ project and thus controlled by a non-profit organization.
103 No commercial entity can take ownership of the project and change the
104 No commercial entity can take ownership of the project and change the
104 direction.
105 direction.
105
106
106 Kallithea started out as an effort to make sure the existing GPLv3 codebase
107 Kallithea started out as an effort to make sure the existing GPLv3 codebase
107 would stay available under a legal license. Kallithea thus has to stay GPLv3
108 would stay available under a legal license. Kallithea thus has to stay GPLv3
108 compatible ... but we are also happy it is GPLv3 and happy to keep it that way.
109 compatible ... but we are also happy it is GPLv3 and happy to keep it that way.
109 A different license (such as AGPL) could perhaps help attract a different
110 A different license (such as AGPL) could perhaps help attract a different
110 community with a different mix of Free Software people and companies but we are
111 community with a different mix of Free Software people and companies but we are
111 happy with the current focus.
112 happy with the current focus.
112
113
113
114
114 Community
115 Community
115 ---------
116 ---------
116
117
117 **Kallithea** is maintained by its users who contribute the fixes they would
118 **Kallithea** is maintained by its users who contribute the fixes they would
118 like to see.
119 like to see.
119
120
120 Get in touch with the rest of the community:
121 Get in touch with the rest of the community:
121
122
122 - Join the mailing list users and developers - see
123 - Join the mailing list users and developers -- see
123 http://lists.sfconservancy.org/mailman/listinfo/kallithea-general.
124 http://lists.sfconservancy.org/mailman/listinfo/kallithea-general.
124
125
125 - Use IRC and join #kallithea on FreeNode (irc.freenode.net) or use
126 - Use IRC and join #kallithea on FreeNode (irc.freenode.net) or use
126 http://webchat.freenode.net/?channels=kallithea.
127 http://webchat.freenode.net/?channels=kallithea.
127
128
128 - Follow Kallithea on Twitter, **@KallitheaSCM**.
129 - Follow Kallithea on Twitter, **@KallitheaSCM**.
129
130
130 - Issues can be reported at `issue tracker
131 - Issues can be reported at `issue tracker
131 <https://bitbucket.org/conservancy/kallithea/issues>`_.
132 <https://bitbucket.org/conservancy/kallithea/issues>`_.
132
133
133 .. note::
134 .. note::
134
135
135 Please try to read the documentation before posting any issues,
136 Please try to read the documentation before posting any issues,
136 especially the **troubleshooting section**
137 especially the **troubleshooting section**
137
138
138
139
139 Online documentation
140 Online documentation
140 --------------------
141 --------------------
141
142
142 Online documentation for the current version of Kallithea is available at
143 Online documentation for the current version of Kallithea is available at
143 https://pythonhosted.org/Kallithea/. Documentation for the current development
144 https://pythonhosted.org/Kallithea/. Documentation for the current development
144 version can be found on https://docs.kallithea-scm.org/.
145 version can be found on https://docs.kallithea-scm.org/.
145
146
146 You can also build the documentation locally: go to ``docs/`` and run::
147 You can also build the documentation locally: go to ``docs/`` and run::
147
148
148 make html
149 make html
149
150
150 .. note:: You need to have Sphinx_ installed to build the
151 .. note:: You need to have Sphinx_ installed to build the
151 documentation. If you don't have Sphinx_ installed you can
152 documentation. If you don't have Sphinx_ installed you can
152 install it via the command: ``pip install sphinx`` .
153 install it via the command: ``pip install sphinx`` .
153
154
154
155
155 Converting from RhodeCode
156 Converting from RhodeCode
156 -------------------------
157 -------------------------
157
158
158 Currently, you have two options for working with an existing RhodeCode
159 Currently, you have two options for working with an existing RhodeCode
159 database:
160 database:
160
161
161 - keep the database unconverted (intended for testing and evaluation)
162 - keep the database unconverted (intended for testing and evaluation)
162 - convert the database in a one-time step
163 - convert the database in a one-time step
163
164
164 Maintaining interoperability
165 Maintaining interoperability
165 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
166 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
166
167
167 Interoperability with RhodeCode 2.2.X installations is provided so you don't
168 Interoperability with RhodeCode 2.2.X installations is provided so you don't
168 have to immediately commit to switching to Kallithea. This option will most
169 have to immediately commit to switching to Kallithea. This option will most
169 likely go away once the two projects have diverged significantly.
170 likely go away once the two projects have diverged significantly.
170
171
171 To run Kallithea on a RhodeCode database, run::
172 To run Kallithea on a RhodeCode database, run::
172
173
173 echo "BRAND = 'rhodecode'" > kallithea/brand.py
174 echo "BRAND = 'rhodecode'" > kallithea/brand.py
174
175
175 This location will depend on where you installed Kallithea. If you installed
176 This location will depend on where you installed Kallithea. If you installed
176 via::
177 via::
177
178
178 python setup.py install
179 python setup.py install
179
180
180 then you will find this location at
181 then you will find this location at
181 ``$VIRTUAL_ENV/lib/python2.7/site-packages/Kallithea-0.1-py2.7.egg/kallithea``.
182 ``$VIRTUAL_ENV/lib/python2.7/site-packages/Kallithea-0.1-py2.7.egg/kallithea``.
182
183
183 One-time conversion
184 One-time conversion
184 ~~~~~~~~~~~~~~~~~~~
185 ~~~~~~~~~~~~~~~~~~~
185
186
186 Alternatively, if you would like to convert the database for good, you can use
187 Alternatively, if you would like to convert the database for good, you can use
187 a helper script provided by Kallithea. This script will operate directly on the
188 a helper script provided by Kallithea. This script will operate directly on the
188 database, using the database string you can find in your ``production.ini`` (or
189 database, using the database string you can find in your ``production.ini`` (or
189 ``development.ini``) file. For example, if using SQLite::
190 ``development.ini``) file. For example, if using SQLite::
190
191
191 cd /path/to/kallithea
192 cd /path/to/kallithea
192 cp /path/to/rhodecode/rhodecode.db kallithea.db
193 cp /path/to/rhodecode/rhodecode.db kallithea.db
193 pip install sqlalchemy-migrate
194 pip install sqlalchemy-migrate
194 python kallithea/bin/rebranddb.py sqlite:///kallithea.db
195 python kallithea/bin/rebranddb.py sqlite:///kallithea.db
195
196
196 .. Note::
197 .. Note::
197
198
198 If you started out using the branding interoperability approach mentioned
199 If you started out using the branding interoperability approach mentioned
199 above, watch out for stray brand.pyc after removing brand.py.
200 above, watch out for stray brand.pyc after removing brand.py.
200
201
202
201 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
203 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
202 .. _Python: http://www.python.org/
204 .. _Python: http://www.python.org/
203 .. _Sphinx: http://sphinx.pocoo.org/
205 .. _Sphinx: http://sphinx.pocoo.org/
204 .. _Mercurial: http://mercurial.selenic.com/
206 .. _Mercurial: http://mercurial.selenic.com/
205 .. _Bitbucket: http://bitbucket.org/
207 .. _Bitbucket: http://bitbucket.org/
206 .. _GitHub: http://github.com/
208 .. _GitHub: http://github.com/
207 .. _Subversion: http://subversion.tigris.org/
209 .. _Subversion: http://subversion.tigris.org/
208 .. _Git: http://git-scm.com/
210 .. _Git: http://git-scm.com/
209 .. _Celery: http://celeryproject.org/
211 .. _Celery: http://celeryproject.org/
210 .. _vcs: http://pypi.python.org/pypi/vcs
212 .. _vcs: http://pypi.python.org/pypi/vcs
211 .. _Software Freedom Conservancy: http://sfconservancy.org/
213 .. _Software Freedom Conservancy: http://sfconservancy.org/
@@ -1,1065 +1,1072 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 whitelisted. 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 the URL.
33 GET parameter ``?api_key=<api_key>`` to the 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 third-party services like code review, or build farms that can 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://example.com/_admin/api -X POST -H 'content-type:text/plain' \
54 --data-binary '{"id":1,"api_key":"xe7cdb2v278e4evbdf5vs04v832v0efvcbcve4a3","method":"pull","args":{"repo":"CPython"}}'
54
55
55 In general, provide
56 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.
57 - *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.
58 - *api_key*, for authentication and permission validation.
58 - *method*, the name of the method to call - a list of available methods can be found below.
59 - *method*, the name of the method to call -- a list of available methods can be found below.
59 - *args*, the arguments to pass to the method.
60 - *args*, the arguments to pass to the method.
60
61
61 .. note::
62 .. note::
62
63
63 api_key can be found or set on the user account page
64 api_key can be found or set on the user account page.
64
65
65 The response to the JSON-RPC API call will always be a JSON structure::
66 The response to the JSON-RPC API call will always be a JSON structure::
66
67
67 {
68 {
68 "id":<id>, # the id that was used in the request
69 "id": <id>, # the id that was used in the request
69 "result": "<result>"|null, # JSON formatted result, null if any errors
70 "result": <result>|null, # JSON formatted result (null on error)
70 "error": "null"|<error_message> # JSON formatted error (if any)
71 "error": null|<error_message> # JSON formatted error (null on success)
71 }
72 }
72
73
73 All responses from API will be ``HTTP/1.0 200 OK``. If there is an error,
74 All responses from the API will be ``HTTP/1.0 200 OK``. If an error occurs,
74 the reponse will have a failure description in *error* and
75 the reponse will have a failure description in *error* and
75 *result* will be null.
76 *result* will be null.
76
77
77
78
78 API client
79 API client
79 ++++++++++
80 ++++++++++
80
81
81 Kallithea comes with a ``kallithea-api`` command line tool providing a convenient
82 Kallithea comes with a ``kallithea-api`` command line tool, providing a convenient
82 way to call the JSON-RPC API.
83 way to call the JSON-RPC API.
83
84
84 For example, to call ``get_repo``::
85 For example, to call ``get_repo``::
85
86
86 kallithea-api --apihost=<your.kallithea.server.url> --apikey=<yourapikey> get_repo
87 kallithea-api --apihost=<your.kallithea.server.url> --apikey=<yourapikey> get_repo
87
88
88 calling {"api_key": "<apikey>", "id": 75, "args": {}, "method": "get_repo"} to http://127.0.0.1:5000
89 calling {"api_key": "<apikey>", "id": 75, "args": {}, "method": "get_repo"} to http://127.0.0.1:5000
89 Kallithea said:
90 Kallithea said:
90 {'error': 'Missing non optional `repoid` arg in JSON DATA',
91 {'error': 'Missing non optional `repoid` arg in JSON DATA',
91 'id': 75,
92 'id': 75,
92 'result': None}
93 'result': None}
93
94
94 Oops, looks like we forgot to add an argument. Let's try again, now
95 Oops, looks like we forgot to add an argument. Let's try again, now
95 providing the ``repoid`` as a parameter::
96 providing the ``repoid`` as a parameter::
96
97
97 kallithea-api get_repo repoid:myrepo
98 kallithea-api get_repo repoid:myrepo
98
99
99 calling {"api_key": "<apikey>", "id": 39, "args": {"repoid": "myrepo"}, "method": "get_repo"} to http://127.0.0.1:5000
100 calling {"api_key": "<apikey>", "id": 39, "args": {"repoid": "myrepo"}, "method": "get_repo"} to http://127.0.0.1:5000
100 Kallithea said:
101 Kallithea said:
101 {'error': None,
102 {'error': None,
102 'id': 39,
103 'id': 39,
103 'result': <json data...>}
104 'result': <json data...>}
104
105
105 To avoid specifying ``apihost`` and ``apikey`` every time, run::
106 To avoid specifying ``apihost`` and ``apikey`` every time, run::
106
107
107 kallithea-api --save-config --apihost=<your.kallithea.server.url> --apikey=<yourapikey>
108 kallithea-api --save-config --apihost=<your.kallithea.server.url> --apikey=<yourapikey>
108
109
109 This will create a ``~/.config/kallithea`` with the specified hostname and apikey
110 This will create a ``~/.config/kallithea`` with the specified hostname and API key
110 so you don't have to specify them every time.
111 so you don't have to specify them every time.
111
112
112
113
113 API methods
114 API methods
114 +++++++++++
115 +++++++++++
115
116
116
117
117 pull
118 pull
118 ----
119 ----
119
120
120 Pull the given repo from remote location. Can be used to automatically keep
121 Pull the given repo from remote location. Can be used to automatically keep
121 remote repos up to date.
122 remote repos up to date.
122 This command can only be executed using the api_key of a user with admin rights.
123 This command can only be executed using the api_key of a user with admin rights.
123
124
124 INPUT::
125 INPUT::
125
126
126 id : <id_for_response>
127 id : <id_for_response>
127 api_key : "<api_key>"
128 api_key : "<api_key>"
128 method : "pull"
129 method : "pull"
129 args : {
130 args : {
130 "repoid" : "<reponame or repo_id>"
131 "repoid" : "<reponame or repo_id>"
131 }
132 }
132
133
133 OUTPUT::
134 OUTPUT::
134
135
135 id : <id_given_in_input>
136 id : <id_given_in_input>
136 result : "Pulled from `<reponame>`"
137 result : "Pulled from `<reponame>`"
137 error : null
138 error : null
138
139
139
140
140 rescan_repos
141 rescan_repos
141 ------------
142 ------------
142
143
143 Rescan repositories. If ``remove_obsolete`` is set,
144 Rescan repositories. If ``remove_obsolete`` is set,
144 Kallithea will delete repos that are in the database but not in the filesystem.
145 Kallithea will delete repos that are in the database but not in the filesystem.
145 This command can only be executed using the api_key of a user with admin rights.
146 This command can only be executed using the api_key of a user with admin rights.
146
147
147 INPUT::
148 INPUT::
148
149
149 id : <id_for_response>
150 id : <id_for_response>
150 api_key : "<api_key>"
151 api_key : "<api_key>"
151 method : "rescan_repos"
152 method : "rescan_repos"
152 args : {
153 args : {
153 "remove_obsolete" : "<boolean = Optional(False)>"
154 "remove_obsolete" : "<boolean = Optional(False)>"
154 }
155 }
155
156
156 OUTPUT::
157 OUTPUT::
157
158
158 id : <id_given_in_input>
159 id : <id_given_in_input>
159 result : "{'added': [<list of names of added repos>],
160 result : "{'added': [<list of names of added repos>],
160 'removed': [<list of names of removed repos>]}"
161 'removed': [<list of names of removed repos>]}"
161 error : null
162 error : null
162
163
163
164
164 invalidate_cache
165 invalidate_cache
165 ----------------
166 ----------------
166
167
167 Invalidate the cache for a repository.
168 Invalidate the cache for a repository.
168 This command can only be executed using the api_key of a user with admin rights,
169 This command can only be executed using the api_key of a user with admin rights,
169 or that of a regular user with admin or write access to the repository.
170 or that of a regular user with admin or write access to the repository.
170
171
171 INPUT::
172 INPUT::
172
173
173 id : <id_for_response>
174 id : <id_for_response>
174 api_key : "<api_key>"
175 api_key : "<api_key>"
175 method : "invalidate_cache"
176 method : "invalidate_cache"
176 args : {
177 args : {
177 "repoid" : "<reponame or repo_id>"
178 "repoid" : "<reponame or repo_id>"
178 }
179 }
179
180
180 OUTPUT::
181 OUTPUT::
181
182
182 id : <id_given_in_input>
183 id : <id_given_in_input>
183 result : "Caches of repository `<reponame>`"
184 result : "Caches of repository `<reponame>`"
184 error : null
185 error : null
185
186
186
187
187 lock
188 lock
188 ----
189 ----
189
190
190 Set the locking state on the given repository by the given user.
191 Set the locking state on the given repository by the given user.
191 If the param ``userid`` is skipped, it is set to the ID of the user who is calling this method.
192 If the param ``userid`` is skipped, it is set to the ID of the user who is calling this method.
192 If param ``locked`` is skipped, the current lock state of the repository is returned.
193 If param ``locked`` is skipped, the current lock state of the repository is returned.
193 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.
194 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.
194
195
195 INPUT::
196 INPUT::
196
197
197 id : <id_for_response>
198 id : <id_for_response>
198 api_key : "<api_key>"
199 api_key : "<api_key>"
199 method : "lock"
200 method : "lock"
200 args : {
201 args : {
201 "repoid" : "<reponame or repo_id>"
202 "repoid" : "<reponame or repo_id>"
202 "userid" : "<user_id or username = Optional(=apiuser)>",
203 "userid" : "<user_id or username = Optional(=apiuser)>",
203 "locked" : "<bool true|false = Optional(=None)>"
204 "locked" : "<bool true|false = Optional(=None)>"
204 }
205 }
205
206
206 OUTPUT::
207 OUTPUT::
207
208
208 id : <id_given_in_input>
209 id : <id_given_in_input>
209 result : {
210 result : {
210 "repo": "<reponame>",
211 "repo": "<reponame>",
211 "locked": "<bool true|false>",
212 "locked": "<bool true|false>",
212 "locked_since": "<float lock_time>",
213 "locked_since": "<float lock_time>",
213 "locked_by": "<username>",
214 "locked_by": "<username>",
214 "msg": "User `<username>` set lock state for repo `<reponame>` to `<false|true>`"
215 "msg": "User `<username>` set lock state for repo `<reponame>` to `<false|true>`"
215 }
216 }
216 error : null
217 error : null
217
218
218
219
219 get_ip
220 get_ip
220 ------
221 ------
221
222
222 Return IP address as seen from Kallithea server, together with all
223 Return IP address as seen from Kallithea server, together with all
223 defined IP addresses for given user.
224 defined IP addresses for given user.
224 This command can only be executed using the api_key of a user with admin rights.
225 This command can only be executed using the api_key of a user with admin rights.
225
226
226 INPUT::
227 INPUT::
227
228
228 id : <id_for_response>
229 id : <id_for_response>
229 api_key : "<api_key>"
230 api_key : "<api_key>"
230 method : "get_ip"
231 method : "get_ip"
231 args : {
232 args : {
232 "userid" : "<user_id or username>",
233 "userid" : "<user_id or username>",
233 }
234 }
234
235
235 OUTPUT::
236 OUTPUT::
236
237
237 id : <id_given_in_input>
238 id : <id_given_in_input>
238 result : {
239 result : {
239 "ip_addr_server": <ip_from_clien>",
240 "ip_addr_server": <ip_from_clien>",
240 "user_ips": [
241 "user_ips": [
241 {
242 {
242 "ip_addr": "<ip_with_mask>",
243 "ip_addr": "<ip_with_mask>",
243 "ip_range": ["<start_ip>", "<end_ip>"],
244 "ip_range": ["<start_ip>", "<end_ip>"],
244 },
245 },
245 ...
246 ...
246 ]
247 ]
247 }
248 }
248
249
249 error : null
250 error : null
250
251
251
252
252 get_user
253 get_user
253 --------
254 --------
254
255
255 Get a user by username or userid. The result is empty if user can't be found.
256 Get a user by username or userid. The result is empty if user can't be found.
256 If userid param is skipped, it is set to id of user who is calling this method.
257 If userid param is skipped, it is set to id of user who is calling this method.
257 Any userid can be specified when the command is executed using the api_key of a user with admin rights.
258 Any userid can be specified when the command is executed using the api_key of a user with admin rights.
258 Regular users can only speicy their own userid.
259 Regular users can only speicy their own userid.
259
260
260
261
261 INPUT::
262 INPUT::
262
263
263 id : <id_for_response>
264 id : <id_for_response>
264 api_key : "<api_key>"
265 api_key : "<api_key>"
265 method : "get_user"
266 method : "get_user"
266 args : {
267 args : {
267 "userid" : "<username or user_id Optional(=apiuser)>"
268 "userid" : "<username or user_id Optional(=apiuser)>"
268 }
269 }
269
270
270 OUTPUT::
271 OUTPUT::
271
272
272 id : <id_given_in_input>
273 id : <id_given_in_input>
273 result: None if user does not exist or
274 result: None if user does not exist or
274 {
275 {
275 "user_id" : "<user_id>",
276 "user_id" : "<user_id>",
276 "api_key" : "<api_key>",
277 "api_key" : "<api_key>",
277 "username" : "<username>",
278 "username" : "<username>",
278 "firstname": "<firstname>",
279 "firstname": "<firstname>",
279 "lastname" : "<lastname>",
280 "lastname" : "<lastname>",
280 "email" : "<email>",
281 "email" : "<email>",
281 "emails": "<list_of_all_additional_emails>",
282 "emails": "<list_of_all_additional_emails>",
282 "ip_addresses": "<list_of_ip_addresses_for_user>",
283 "ip_addresses": "<list_of_ip_addresses_for_user>",
283 "active" : "<bool>",
284 "active" : "<bool>",
284 "admin" :  "<bool>",
285 "admin" :  "<bool>",
285 "ldap_dn" : "<ldap_dn>",
286 "ldap_dn" : "<ldap_dn>",
286 "last_login": "<last_login>",
287 "last_login": "<last_login>",
287 "permissions": {
288 "permissions": {
288 "global": ["hg.create.repository",
289 "global": ["hg.create.repository",
289 "repository.read",
290 "repository.read",
290 "hg.register.manual_activate"],
291 "hg.register.manual_activate"],
291 "repositories": {"repo1": "repository.none"},
292 "repositories": {"repo1": "repository.none"},
292 "repositories_groups": {"Group1": "group.read"}
293 "repositories_groups": {"Group1": "group.read"}
293 },
294 },
294 }
295 }
295 error: null
296 error: null
296
297
297
298
298 get_users
299 get_users
299 ---------
300 ---------
300
301
301 List all existing users.
302 List all existing users.
302 This command can only be executed using the api_key of a user with admin rights.
303 This command can only be executed using the api_key of a user with admin rights.
303
304
304
305
305 INPUT::
306 INPUT::
306
307
307 id : <id_for_response>
308 id : <id_for_response>
308 api_key : "<api_key>"
309 api_key : "<api_key>"
309 method : "get_users"
310 method : "get_users"
310 args : { }
311 args : { }
311
312
312 OUTPUT::
313 OUTPUT::
313
314
314 id : <id_given_in_input>
315 id : <id_given_in_input>
315 result: [
316 result: [
316 {
317 {
317 "user_id" : "<user_id>",
318 "user_id" : "<user_id>",
318 "api_key" : "<api_key>",
319 "api_key" : "<api_key>",
319 "username" : "<username>",
320 "username" : "<username>",
320 "firstname": "<firstname>",
321 "firstname": "<firstname>",
321 "lastname" : "<lastname>",
322 "lastname" : "<lastname>",
322 "email" : "<email>",
323 "email" : "<email>",
323 "emails": "<list_of_all_additional_emails>",
324 "emails": "<list_of_all_additional_emails>",
324 "ip_addresses": "<list_of_ip_addresses_for_user>",
325 "ip_addresses": "<list_of_ip_addresses_for_user>",
325 "active" : "<bool>",
326 "active" : "<bool>",
326 "admin" :  "<bool>",
327 "admin" :  "<bool>",
327 "ldap_dn" : "<ldap_dn>",
328 "ldap_dn" : "<ldap_dn>",
328 "last_login": "<last_login>",
329 "last_login": "<last_login>",
329 },
330 },
330
331
331 ]
332 ]
332 error: null
333 error: null
333
334
334
335
336 .. _create-user:
337
335 create_user
338 create_user
336 -----------
339 -----------
337
340
338 Create new user.
341 Create new user.
339 This command can only be executed using the api_key of a user with admin rights.
342 This command can only be executed using the api_key of a user with admin rights.
340
343
341
344
342 INPUT::
345 INPUT::
343
346
344 id : <id_for_response>
347 id : <id_for_response>
345 api_key : "<api_key>"
348 api_key : "<api_key>"
346 method : "create_user"
349 method : "create_user"
347 args : {
350 args : {
348 "username" : "<username>",
351 "username" : "<username>",
349 "email" : "<useremail>",
352 "email" : "<useremail>",
350 "password" : "<password = Optional(None)>",
353 "password" : "<password = Optional(None)>",
351 "firstname" : "<firstname> = Optional(None)",
354 "firstname" : "<firstname> = Optional(None)",
352 "lastname" : "<lastname> = Optional(None)",
355 "lastname" : "<lastname> = Optional(None)",
353 "active" : "<bool> = Optional(True)",
356 "active" : "<bool> = Optional(True)",
354 "admin" : "<bool> = Optional(False)",
357 "admin" : "<bool> = Optional(False)",
355 "ldap_dn" : "<ldap_dn> = Optional(None)"
358 "ldap_dn" : "<ldap_dn> = Optional(None)"
356 }
359 }
357
360
358 OUTPUT::
361 OUTPUT::
359
362
360 id : <id_given_in_input>
363 id : <id_given_in_input>
361 result: {
364 result: {
362 "msg" : "created new user `<username>`",
365 "msg" : "created new user `<username>`",
363 "user": {
366 "user": {
364 "user_id" : "<user_id>",
367 "user_id" : "<user_id>",
365 "username" : "<username>",
368 "username" : "<username>",
366 "firstname": "<firstname>",
369 "firstname": "<firstname>",
367 "lastname" : "<lastname>",
370 "lastname" : "<lastname>",
368 "email" : "<email>",
371 "email" : "<email>",
369 "emails": "<list_of_all_additional_emails>",
372 "emails": "<list_of_all_additional_emails>",
370 "active" : "<bool>",
373 "active" : "<bool>",
371 "admin" :  "<bool>",
374 "admin" :  "<bool>",
372 "ldap_dn" : "<ldap_dn>",
375 "ldap_dn" : "<ldap_dn>",
373 "last_login": "<last_login>",
376 "last_login": "<last_login>",
374 },
377 },
375 }
378 }
376 error: null
379 error: null
377
380
381 Example::
382
383 kallithea-api create_user username:bent email:bent@example.com firstname:Bent lastname:Bentsen extern_type:ldap extern_name:uid=bent,dc=example,dc=com
384
378
385
379 update_user
386 update_user
380 -----------
387 -----------
381
388
382 Update the given user if such user exists.
389 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.
390 This command can only be executed using the api_key of a user with admin rights.
384
391
385
392
386 INPUT::
393 INPUT::
387
394
388 id : <id_for_response>
395 id : <id_for_response>
389 api_key : "<api_key>"
396 api_key : "<api_key>"
390 method : "update_user"
397 method : "update_user"
391 args : {
398 args : {
392 "userid" : "<user_id or username>",
399 "userid" : "<user_id or username>",
393 "username" : "<username> = Optional(None)",
400 "username" : "<username> = Optional(None)",
394 "email" : "<useremail> = Optional(None)",
401 "email" : "<useremail> = Optional(None)",
395 "password" : "<password> = Optional(None)",
402 "password" : "<password> = Optional(None)",
396 "firstname" : "<firstname> = Optional(None)",
403 "firstname" : "<firstname> = Optional(None)",
397 "lastname" : "<lastname> = Optional(None)",
404 "lastname" : "<lastname> = Optional(None)",
398 "active" : "<bool> = Optional(None)",
405 "active" : "<bool> = Optional(None)",
399 "admin" : "<bool> = Optional(None)",
406 "admin" : "<bool> = Optional(None)",
400 "ldap_dn" : "<ldap_dn> = Optional(None)"
407 "ldap_dn" : "<ldap_dn> = Optional(None)"
401 }
408 }
402
409
403 OUTPUT::
410 OUTPUT::
404
411
405 id : <id_given_in_input>
412 id : <id_given_in_input>
406 result: {
413 result: {
407 "msg" : "updated user ID:<userid> <username>",
414 "msg" : "updated user ID:<userid> <username>",
408 "user": {
415 "user": {
409 "user_id" : "<user_id>",
416 "user_id" : "<user_id>",
410 "api_key" : "<api_key>",
417 "api_key" : "<api_key>",
411 "username" : "<username>",
418 "username" : "<username>",
412 "firstname": "<firstname>",
419 "firstname": "<firstname>",
413 "lastname" : "<lastname>",
420 "lastname" : "<lastname>",
414 "email" : "<email>",
421 "email" : "<email>",
415 "emails": "<list_of_all_additional_emails>",
422 "emails": "<list_of_all_additional_emails>",
416 "active" : "<bool>",
423 "active" : "<bool>",
417 "admin" :  "<bool>",
424 "admin" :  "<bool>",
418 "ldap_dn" : "<ldap_dn>",
425 "ldap_dn" : "<ldap_dn>",
419 "last_login": "<last_login>",
426 "last_login": "<last_login>",
420 },
427 },
421 }
428 }
422 error: null
429 error: null
423
430
424
431
425 delete_user
432 delete_user
426 -----------
433 -----------
427
434
428 Delete the given user if such a user exists.
435 Delete the given user if such a user exists.
429 This command can only be executed using the api_key of a user with admin rights.
436 This command can only be executed using the api_key of a user with admin rights.
430
437
431
438
432 INPUT::
439 INPUT::
433
440
434 id : <id_for_response>
441 id : <id_for_response>
435 api_key : "<api_key>"
442 api_key : "<api_key>"
436 method : "delete_user"
443 method : "delete_user"
437 args : {
444 args : {
438 "userid" : "<user_id or username>",
445 "userid" : "<user_id or username>",
439 }
446 }
440
447
441 OUTPUT::
448 OUTPUT::
442
449
443 id : <id_given_in_input>
450 id : <id_given_in_input>
444 result: {
451 result: {
445 "msg" : "deleted user ID:<userid> <username>",
452 "msg" : "deleted user ID:<userid> <username>",
446 "user": null
453 "user": null
447 }
454 }
448 error: null
455 error: null
449
456
450
457
451 get_user_group
458 get_user_group
452 --------------
459 --------------
453
460
454 Get an existing user group.
461 Get an existing user group.
455 This command can only be executed using the api_key of a user with admin rights.
462 This command can only be executed using the api_key of a user with admin rights.
456
463
457
464
458 INPUT::
465 INPUT::
459
466
460 id : <id_for_response>
467 id : <id_for_response>
461 api_key : "<api_key>"
468 api_key : "<api_key>"
462 method : "get_user_group"
469 method : "get_user_group"
463 args : {
470 args : {
464 "usergroupid" : "<user group id or name>"
471 "usergroupid" : "<user group id or name>"
465 }
472 }
466
473
467 OUTPUT::
474 OUTPUT::
468
475
469 id : <id_given_in_input>
476 id : <id_given_in_input>
470 result : None if group not exist
477 result : None if group not exist
471 {
478 {
472 "users_group_id" : "<id>",
479 "users_group_id" : "<id>",
473 "group_name" : "<groupname>",
480 "group_name" : "<groupname>",
474 "active": "<bool>",
481 "active": "<bool>",
475 "members" : [
482 "members" : [
476 {
483 {
477 "user_id" : "<user_id>",
484 "user_id" : "<user_id>",
478 "api_key" : "<api_key>",
485 "api_key" : "<api_key>",
479 "username" : "<username>",
486 "username" : "<username>",
480 "firstname": "<firstname>",
487 "firstname": "<firstname>",
481 "lastname" : "<lastname>",
488 "lastname" : "<lastname>",
482 "email" : "<email>",
489 "email" : "<email>",
483 "emails": "<list_of_all_additional_emails>",
490 "emails": "<list_of_all_additional_emails>",
484 "active" : "<bool>",
491 "active" : "<bool>",
485 "admin" :  "<bool>",
492 "admin" :  "<bool>",
486 "ldap_dn" : "<ldap_dn>",
493 "ldap_dn" : "<ldap_dn>",
487 "last_login": "<last_login>",
494 "last_login": "<last_login>",
488 },
495 },
489
496
490 ]
497 ]
491 }
498 }
492 error : null
499 error : null
493
500
494
501
495 get_user_groups
502 get_user_groups
496 ---------------
503 ---------------
497
504
498 List all existing user groups.
505 List all existing user groups.
499 This command can only be executed using the api_key of a user with admin rights.
506 This command can only be executed using the api_key of a user with admin rights.
500
507
501
508
502 INPUT::
509 INPUT::
503
510
504 id : <id_for_response>
511 id : <id_for_response>
505 api_key : "<api_key>"
512 api_key : "<api_key>"
506 method : "get_user_groups"
513 method : "get_user_groups"
507 args : { }
514 args : { }
508
515
509 OUTPUT::
516 OUTPUT::
510
517
511 id : <id_given_in_input>
518 id : <id_given_in_input>
512 result : [
519 result : [
513 {
520 {
514 "users_group_id" : "<id>",
521 "users_group_id" : "<id>",
515 "group_name" : "<groupname>",
522 "group_name" : "<groupname>",
516 "active": "<bool>",
523 "active": "<bool>",
517 },
524 },
518
525
519 ]
526 ]
520 error : null
527 error : null
521
528
522
529
523 create_user_group
530 create_user_group
524 -----------------
531 -----------------
525
532
526 Create a new user group.
533 Create a new user group.
527 This command can only be executed using the api_key of a user with admin rights.
534 This command can only be executed using the api_key of a user with admin rights.
528
535
529
536
530 INPUT::
537 INPUT::
531
538
532 id : <id_for_response>
539 id : <id_for_response>
533 api_key : "<api_key>"
540 api_key : "<api_key>"
534 method : "create_user_group"
541 method : "create_user_group"
535 args: {
542 args: {
536 "group_name": "<groupname>",
543 "group_name": "<groupname>",
537 "owner" : "<owner_name_or_id = Optional(=apiuser)>",
544 "owner" : "<owner_name_or_id = Optional(=apiuser)>",
538 "active": "<bool> = Optional(True)"
545 "active": "<bool> = Optional(True)"
539 }
546 }
540
547
541 OUTPUT::
548 OUTPUT::
542
549
543 id : <id_given_in_input>
550 id : <id_given_in_input>
544 result: {
551 result: {
545 "msg": "created new user group `<groupname>`",
552 "msg": "created new user group `<groupname>`",
546 "users_group": {
553 "users_group": {
547 "users_group_id" : "<id>",
554 "users_group_id" : "<id>",
548 "group_name" : "<groupname>",
555 "group_name" : "<groupname>",
549 "active": "<bool>",
556 "active": "<bool>",
550 },
557 },
551 }
558 }
552 error: null
559 error: null
553
560
554
561
555 add_user_to_user_group
562 add_user_to_user_group
556 ----------------------
563 ----------------------
557
564
558 Adds a user to a user group. If the user already is in that group, success will be
565 Adds a user to a user group. If the user already is in that group, success will be
559 ``false``.
566 ``false``.
560 This command can only be executed using the api_key of a user with admin rights.
567 This command can only be executed using the api_key of a user with admin rights.
561
568
562
569
563 INPUT::
570 INPUT::
564
571
565 id : <id_for_response>
572 id : <id_for_response>
566 api_key : "<api_key>"
573 api_key : "<api_key>"
567 method : "add_user_user_group"
574 method : "add_user_user_group"
568 args: {
575 args: {
569 "usersgroupid" : "<user group id or name>",
576 "usersgroupid" : "<user group id or name>",
570 "userid" : "<user_id or username>",
577 "userid" : "<user_id or username>",
571 }
578 }
572
579
573 OUTPUT::
580 OUTPUT::
574
581
575 id : <id_given_in_input>
582 id : <id_given_in_input>
576 result: {
583 result: {
577 "success": True|False # depends on if member is in group
584 "success": True|False # depends on if member is in group
578 "msg": "added member `<username>` to a user group `<groupname>` |
585 "msg": "added member `<username>` to a user group `<groupname>` |
579 User is already in that group"
586 User is already in that group"
580 }
587 }
581 error: null
588 error: null
582
589
583
590
584 remove_user_from_user_group
591 remove_user_from_user_group
585 ---------------------------
592 ---------------------------
586
593
587 Remove a user from a user group. If the user isn't in the given group, success will
594 Remove a user from a user group. If the user isn't in the given group, success will
588 be ``false``.
595 be ``false``.
589 This command can only be executed using the api_key of a user with admin rights.
596 This command can only be executed using the api_key of a user with admin rights.
590
597
591
598
592 INPUT::
599 INPUT::
593
600
594 id : <id_for_response>
601 id : <id_for_response>
595 api_key : "<api_key>"
602 api_key : "<api_key>"
596 method : "remove_user_from_user_group"
603 method : "remove_user_from_user_group"
597 args: {
604 args: {
598 "usersgroupid" : "<user group id or name>",
605 "usersgroupid" : "<user group id or name>",
599 "userid" : "<user_id or username>",
606 "userid" : "<user_id or username>",
600 }
607 }
601
608
602 OUTPUT::
609 OUTPUT::
603
610
604 id : <id_given_in_input>
611 id : <id_given_in_input>
605 result: {
612 result: {
606 "success": True|False, # depends on if member is in group
613 "success": True|False, # depends on if member is in group
607 "msg": "removed member <username> from user group <groupname> |
614 "msg": "removed member <username> from user group <groupname> |
608 User wasn't in group"
615 User wasn't in group"
609 }
616 }
610 error: null
617 error: null
611
618
612
619
613 get_repo
620 get_repo
614 --------
621 --------
615
622
616 Get an existing repository by its name or repository_id. Members will contain
623 Get an existing repository by its name or repository_id. Members will contain
617 either users_group or users associated to that repository.
624 either users_group or users associated to that repository.
618 This command can only be executed using the api_key of a user with admin rights,
625 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.
626 or that of a regular user with at least read access to the repository.
620
627
621 INPUT::
628 INPUT::
622
629
623 id : <id_for_response>
630 id : <id_for_response>
624 api_key : "<api_key>"
631 api_key : "<api_key>"
625 method : "get_repo"
632 method : "get_repo"
626 args: {
633 args: {
627 "repoid" : "<reponame or repo_id>"
634 "repoid" : "<reponame or repo_id>"
628 }
635 }
629
636
630 OUTPUT::
637 OUTPUT::
631
638
632 id : <id_given_in_input>
639 id : <id_given_in_input>
633 result: None if repository does not exist or
640 result: None if repository does not exist or
634 {
641 {
635 "repo_id" : "<repo_id>",
642 "repo_id" : "<repo_id>",
636 "repo_name" : "<reponame>"
643 "repo_name" : "<reponame>"
637 "repo_type" : "<repo_type>",
644 "repo_type" : "<repo_type>",
638 "clone_uri" : "<clone_uri>",
645 "clone_uri" : "<clone_uri>",
639 "enable_downloads": "<bool>",
646 "enable_downloads": "<bool>",
640 "enable_locking": "<bool>",
647 "enable_locking": "<bool>",
641 "enable_statistics": "<bool>",
648 "enable_statistics": "<bool>",
642 "private": "<bool>",
649 "private": "<bool>",
643 "created_on" : "<date_time_created>",
650 "created_on" : "<date_time_created>",
644 "description" : "<description>",
651 "description" : "<description>",
645 "landing_rev": "<landing_rev>",
652 "landing_rev": "<landing_rev>",
646 "last_changeset": {
653 "last_changeset": {
647 "author": "<full_author>",
654 "author": "<full_author>",
648 "date": "<date_time_of_commit>",
655 "date": "<date_time_of_commit>",
649 "message": "<commit_message>",
656 "message": "<commit_message>",
650 "raw_id": "<raw_id>",
657 "raw_id": "<raw_id>",
651 "revision": "<numeric_revision>",
658 "revision": "<numeric_revision>",
652 "short_id": "<short_id>"
659 "short_id": "<short_id>"
653 }
660 }
654 "owner": "<repo_owner>",
661 "owner": "<repo_owner>",
655 "fork_of": "<name_of_fork_parent>",
662 "fork_of": "<name_of_fork_parent>",
656 "members" : [
663 "members" : [
657 {
664 {
658 "type": "user",
665 "type": "user",
659 "user_id" : "<user_id>",
666 "user_id" : "<user_id>",
660 "api_key" : "<api_key>",
667 "api_key" : "<api_key>",
661 "username" : "<username>",
668 "username" : "<username>",
662 "firstname": "<firstname>",
669 "firstname": "<firstname>",
663 "lastname" : "<lastname>",
670 "lastname" : "<lastname>",
664 "email" : "<email>",
671 "email" : "<email>",
665 "emails": "<list_of_all_additional_emails>",
672 "emails": "<list_of_all_additional_emails>",
666 "active" : "<bool>",
673 "active" : "<bool>",
667 "admin" :  "<bool>",
674 "admin" :  "<bool>",
668 "ldap_dn" : "<ldap_dn>",
675 "ldap_dn" : "<ldap_dn>",
669 "last_login": "<last_login>",
676 "last_login": "<last_login>",
670 "permission" : "repository.(read|write|admin)"
677 "permission" : "repository.(read|write|admin)"
671 },
678 },
672
679
673 {
680 {
674 "type": "users_group",
681 "type": "users_group",
675 "id" : "<usersgroupid>",
682 "id" : "<usersgroupid>",
676 "name" : "<usersgroupname>",
683 "name" : "<usersgroupname>",
677 "active": "<bool>",
684 "active": "<bool>",
678 "permission" : "repository.(read|write|admin)"
685 "permission" : "repository.(read|write|admin)"
679 },
686 },
680
687
681 ]
688 ]
682 "followers": [
689 "followers": [
683 {
690 {
684 "user_id" : "<user_id>",
691 "user_id" : "<user_id>",
685 "username" : "<username>",
692 "username" : "<username>",
686 "api_key" : "<api_key>",
693 "api_key" : "<api_key>",
687 "firstname": "<firstname>",
694 "firstname": "<firstname>",
688 "lastname" : "<lastname>",
695 "lastname" : "<lastname>",
689 "email" : "<email>",
696 "email" : "<email>",
690 "emails": "<list_of_all_additional_emails>",
697 "emails": "<list_of_all_additional_emails>",
691 "ip_addresses": "<list_of_ip_addresses_for_user>",
698 "ip_addresses": "<list_of_ip_addresses_for_user>",
692 "active" : "<bool>",
699 "active" : "<bool>",
693 "admin" :  "<bool>",
700 "admin" :  "<bool>",
694 "ldap_dn" : "<ldap_dn>",
701 "ldap_dn" : "<ldap_dn>",
695 "last_login": "<last_login>",
702 "last_login": "<last_login>",
696 },
703 },
697
704
698 ]
705 ]
699 }
706 }
700 error: null
707 error: null
701
708
702
709
703 get_repos
710 get_repos
704 ---------
711 ---------
705
712
706 List all existing repositories.
713 List all existing repositories.
707 This command can only be executed using the api_key of a user with admin rights,
714 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.
715 or that of a regular user with at least read access to the repository.
709
716
710
717
711 INPUT::
718 INPUT::
712
719
713 id : <id_for_response>
720 id : <id_for_response>
714 api_key : "<api_key>"
721 api_key : "<api_key>"
715 method : "get_repos"
722 method : "get_repos"
716 args: { }
723 args: { }
717
724
718 OUTPUT::
725 OUTPUT::
719
726
720 id : <id_given_in_input>
727 id : <id_given_in_input>
721 result: [
728 result: [
722 {
729 {
723 "repo_id" : "<repo_id>",
730 "repo_id" : "<repo_id>",
724 "repo_name" : "<reponame>"
731 "repo_name" : "<reponame>"
725 "repo_type" : "<repo_type>",
732 "repo_type" : "<repo_type>",
726 "clone_uri" : "<clone_uri>",
733 "clone_uri" : "<clone_uri>",
727 "private" : "<bool>",
734 "private" : "<bool>",
728 "created_on" : "<datetimecreated>",
735 "created_on" : "<datetimecreated>",
729 "description" : "<description>",
736 "description" : "<description>",
730 "landing_rev": "<landing_rev>",
737 "landing_rev": "<landing_rev>",
731 "owner": "<repo_owner>",
738 "owner": "<repo_owner>",
732 "fork_of": "<name_of_fork_parent>",
739 "fork_of": "<name_of_fork_parent>",
733 "enable_downloads": "<bool>",
740 "enable_downloads": "<bool>",
734 "enable_locking": "<bool>",
741 "enable_locking": "<bool>",
735 "enable_statistics": "<bool>",
742 "enable_statistics": "<bool>",
736 },
743 },
737
744
738 ]
745 ]
739 error: null
746 error: null
740
747
741
748
742 get_repo_nodes
749 get_repo_nodes
743 --------------
750 --------------
744
751
745 Return a list of files and directories for a given path at the given revision.
752 Return a list of files and directories for a given path at the given revision.
746 It is possible to specify ret_type to show only ``files`` or ``dirs``.
753 It is 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.
754 This command can only be executed using the api_key of a user with admin rights.
748
755
749
756
750 INPUT::
757 INPUT::
751
758
752 id : <id_for_response>
759 id : <id_for_response>
753 api_key : "<api_key>"
760 api_key : "<api_key>"
754 method : "get_repo_nodes"
761 method : "get_repo_nodes"
755 args: {
762 args: {
756 "repoid" : "<reponame or repo_id>"
763 "repoid" : "<reponame or repo_id>"
757 "revision" : "<revision>",
764 "revision" : "<revision>",
758 "root_path" : "<root_path>",
765 "root_path" : "<root_path>",
759 "ret_type" : "<ret_type> = Optional('all')"
766 "ret_type" : "<ret_type> = Optional('all')"
760 }
767 }
761
768
762 OUTPUT::
769 OUTPUT::
763
770
764 id : <id_given_in_input>
771 id : <id_given_in_input>
765 result: [
772 result: [
766 {
773 {
767 "name" : "<name>"
774 "name" : "<name>"
768 "type" : "<type>",
775 "type" : "<type>",
769 },
776 },
770
777
771 ]
778 ]
772 error: null
779 error: null
773
780
774
781
775 create_repo
782 create_repo
776 -----------
783 -----------
777
784
778 Create a repository. If the repository name contains "/", all needed repository
785 Create a repository. If the repository name contains "/", all needed repository
779 groups will be created. For example "foo/bar/baz" will create repository groups
786 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
787 "foo", "bar" (with "foo" as parent), and create "baz" repository with
781 "bar" as group.
788 "bar" as group.
782 This command can only be executed using the api_key of a user with admin rights,
789 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.
790 or that of a regular user with create repository permission.
784 Regular users cannot specify owner parameter.
791 Regular users cannot specify owner parameter.
785
792
786
793
787 INPUT::
794 INPUT::
788
795
789 id : <id_for_response>
796 id : <id_for_response>
790 api_key : "<api_key>"
797 api_key : "<api_key>"
791 method : "create_repo"
798 method : "create_repo"
792 args: {
799 args: {
793 "repo_name" : "<reponame>",
800 "repo_name" : "<reponame>",
794 "owner" : "<owner_name_or_id = Optional(=apiuser)>",
801 "owner" : "<owner_name_or_id = Optional(=apiuser)>",
795 "repo_type" : "<repo_type> = Optional('hg')",
802 "repo_type" : "<repo_type> = Optional('hg')",
796 "description" : "<description> = Optional('')",
803 "description" : "<description> = Optional('')",
797 "private" : "<bool> = Optional(False)",
804 "private" : "<bool> = Optional(False)",
798 "clone_uri" : "<clone_uri> = Optional(None)",
805 "clone_uri" : "<clone_uri> = Optional(None)",
799 "landing_rev" : "<landing_rev> = Optional('tip')",
806 "landing_rev" : "<landing_rev> = Optional('tip')",
800 "enable_downloads": "<bool> = Optional(False)",
807 "enable_downloads": "<bool> = Optional(False)",
801 "enable_locking": "<bool> = Optional(False)",
808 "enable_locking": "<bool> = Optional(False)",
802 "enable_statistics": "<bool> = Optional(False)",
809 "enable_statistics": "<bool> = Optional(False)",
803 }
810 }
804
811
805 OUTPUT::
812 OUTPUT::
806
813
807 id : <id_given_in_input>
814 id : <id_given_in_input>
808 result: {
815 result: {
809 "msg": "Created new repository `<reponame>`",
816 "msg": "Created new repository `<reponame>`",
810 "repo": {
817 "repo": {
811 "repo_id" : "<repo_id>",
818 "repo_id" : "<repo_id>",
812 "repo_name" : "<reponame>"
819 "repo_name" : "<reponame>"
813 "repo_type" : "<repo_type>",
820 "repo_type" : "<repo_type>",
814 "clone_uri" : "<clone_uri>",
821 "clone_uri" : "<clone_uri>",
815 "private" : "<bool>",
822 "private" : "<bool>",
816 "created_on" : "<datetimecreated>",
823 "created_on" : "<datetimecreated>",
817 "description" : "<description>",
824 "description" : "<description>",
818 "landing_rev": "<landing_rev>",
825 "landing_rev": "<landing_rev>",
819 "owner": "<username or user_id>",
826 "owner": "<username or user_id>",
820 "fork_of": "<name_of_fork_parent>",
827 "fork_of": "<name_of_fork_parent>",
821 "enable_downloads": "<bool>",
828 "enable_downloads": "<bool>",
822 "enable_locking": "<bool>",
829 "enable_locking": "<bool>",
823 "enable_statistics": "<bool>",
830 "enable_statistics": "<bool>",
824 },
831 },
825 }
832 }
826 error: null
833 error: null
827
834
828
835
829 update_repo
836 update_repo
830 -----------
837 -----------
831
838
832 Update a repository.
839 Update a repository.
833 This command can only be executed using the api_key of a user with admin rights,
840 This command can only be executed using the api_key of a user with admin rights,
834 or that of a regular user with create repository permission.
841 or that of a regular user with create repository permission.
835 Regular users cannot specify owner parameter.
842 Regular users cannot specify owner parameter.
836
843
837
844
838 INPUT::
845 INPUT::
839
846
840 id : <id_for_response>
847 id : <id_for_response>
841 api_key : "<api_key>"
848 api_key : "<api_key>"
842 method : "update_repo"
849 method : "update_repo"
843 args: {
850 args: {
844 "repoid" : "<reponame or repo_id>"
851 "repoid" : "<reponame or repo_id>"
845 "name" : "<reponame> = Optional('')",
852 "name" : "<reponame> = Optional('')",
846 "group" : "<group_id> = Optional(None)",
853 "group" : "<group_id> = Optional(None)",
847 "owner" : "<owner_name_or_id = Optional(=apiuser)>",
854 "owner" : "<owner_name_or_id = Optional(=apiuser)>",
848 "description" : "<description> = Optional('')",
855 "description" : "<description> = Optional('')",
849 "private" : "<bool> = Optional(False)",
856 "private" : "<bool> = Optional(False)",
850 "clone_uri" : "<clone_uri> = Optional(None)",
857 "clone_uri" : "<clone_uri> = Optional(None)",
851 "landing_rev" : "<landing_rev> = Optional('tip')",
858 "landing_rev" : "<landing_rev> = Optional('tip')",
852 "enable_downloads": "<bool> = Optional(False)",
859 "enable_downloads": "<bool> = Optional(False)",
853 "enable_locking": "<bool> = Optional(False)",
860 "enable_locking": "<bool> = Optional(False)",
854 "enable_statistics": "<bool> = Optional(False)",
861 "enable_statistics": "<bool> = Optional(False)",
855 }
862 }
856
863
857 OUTPUT::
864 OUTPUT::
858
865
859 id : <id_given_in_input>
866 id : <id_given_in_input>
860 result: {
867 result: {
861 "msg": "updated repo ID:repo_id `<reponame>`",
868 "msg": "updated repo ID:repo_id `<reponame>`",
862 "repository": {
869 "repository": {
863 "repo_id" : "<repo_id>",
870 "repo_id" : "<repo_id>",
864 "repo_name" : "<reponame>"
871 "repo_name" : "<reponame>"
865 "repo_type" : "<repo_type>",
872 "repo_type" : "<repo_type>",
866 "clone_uri" : "<clone_uri>",
873 "clone_uri" : "<clone_uri>",
867 "private": "<bool>",
874 "private": "<bool>",
868 "created_on" : "<datetimecreated>",
875 "created_on" : "<datetimecreated>",
869 "description" : "<description>",
876 "description" : "<description>",
870 "landing_rev": "<landing_rev>",
877 "landing_rev": "<landing_rev>",
871 "owner": "<username or user_id>",
878 "owner": "<username or user_id>",
872 "fork_of": "<name_of_fork_parent>",
879 "fork_of": "<name_of_fork_parent>",
873 "enable_downloads": "<bool>",
880 "enable_downloads": "<bool>",
874 "enable_locking": "<bool>",
881 "enable_locking": "<bool>",
875 "enable_statistics": "<bool>",
882 "enable_statistics": "<bool>",
876 "last_changeset": {
883 "last_changeset": {
877 "author": "<full_author>",
884 "author": "<full_author>",
878 "date": "<date_time_of_commit>",
885 "date": "<date_time_of_commit>",
879 "message": "<commit_message>",
886 "message": "<commit_message>",
880 "raw_id": "<raw_id>",
887 "raw_id": "<raw_id>",
881 "revision": "<numeric_revision>",
888 "revision": "<numeric_revision>",
882 "short_id": "<short_id>"
889 "short_id": "<short_id>"
883 }
890 }
884 "locked_by": "<username>",
891 "locked_by": "<username>",
885 "locked_date": "<float lock_time>",
892 "locked_date": "<float lock_time>",
886 },
893 },
887 }
894 }
888 error: null
895 error: null
889
896
890
897
891 fork_repo
898 fork_repo
892 ---------
899 ---------
893
900
894 Create a fork of the given repo. If using Celery, this will
901 Create a fork of the given repo. If using Celery, this will
895 return success message immediately and a fork will be created
902 return success message immediately and a fork will be created
896 asynchronously.
903 asynchronously.
897 This command can only be executed using the api_key of a user with admin
904 This command can only be executed using the api_key of a user with admin
898 rights, or with the global fork permission, by a regular user with create
905 rights, or with the global fork permission, by a regular user with create
899 repository permission and at least read access to the repository.
906 repository permission and at least read access to the repository.
900 Regular users cannot specify owner parameter.
907 Regular users cannot specify owner parameter.
901
908
902
909
903 INPUT::
910 INPUT::
904
911
905 id : <id_for_response>
912 id : <id_for_response>
906 api_key : "<api_key>"
913 api_key : "<api_key>"
907 method : "fork_repo"
914 method : "fork_repo"
908 args: {
915 args: {
909 "repoid" : "<reponame or repo_id>",
916 "repoid" : "<reponame or repo_id>",
910 "fork_name": "<forkname>",
917 "fork_name": "<forkname>",
911 "owner": "<username or user_id = Optional(=apiuser)>",
918 "owner": "<username or user_id = Optional(=apiuser)>",
912 "description": "<description>",
919 "description": "<description>",
913 "copy_permissions": "<bool>",
920 "copy_permissions": "<bool>",
914 "private": "<bool>",
921 "private": "<bool>",
915 "landing_rev": "<landing_rev>"
922 "landing_rev": "<landing_rev>"
916
923
917 }
924 }
918
925
919 OUTPUT::
926 OUTPUT::
920
927
921 id : <id_given_in_input>
928 id : <id_given_in_input>
922 result: {
929 result: {
923 "msg": "Created fork of `<reponame>` as `<forkname>`",
930 "msg": "Created fork of `<reponame>` as `<forkname>`",
924 "success": true
931 "success": true
925 }
932 }
926 error: null
933 error: null
927
934
928
935
929 delete_repo
936 delete_repo
930 -----------
937 -----------
931
938
932 Delete a repository.
939 Delete a repository.
933 This command can only be executed using the api_key of a user with admin rights,
940 This command can only be executed using the api_key of a user with admin rights,
934 or that of a regular user with admin access to the repository.
941 or that of a regular user with admin access to the repository.
935 When ``forks`` param is set it is possible to detach or delete forks of the deleted repository.
942 When ``forks`` param is set it is possible to detach or delete forks of the deleted repository.
936
943
937
944
938 INPUT::
945 INPUT::
939
946
940 id : <id_for_response>
947 id : <id_for_response>
941 api_key : "<api_key>"
948 api_key : "<api_key>"
942 method : "delete_repo"
949 method : "delete_repo"
943 args: {
950 args: {
944 "repoid" : "<reponame or repo_id>",
951 "repoid" : "<reponame or repo_id>",
945 "forks" : "`delete` or `detach` = Optional(None)"
952 "forks" : "`delete` or `detach` = Optional(None)"
946 }
953 }
947
954
948 OUTPUT::
955 OUTPUT::
949
956
950 id : <id_given_in_input>
957 id : <id_given_in_input>
951 result: {
958 result: {
952 "msg": "Deleted repository `<reponame>`",
959 "msg": "Deleted repository `<reponame>`",
953 "success": true
960 "success": true
954 }
961 }
955 error: null
962 error: null
956
963
957
964
958 grant_user_permission
965 grant_user_permission
959 ---------------------
966 ---------------------
960
967
961 Grant permission for a user on the given repository, or update the existing one if found.
968 Grant permission for a user on the given repository, or update the existing one if found.
962 This command can only be executed using the api_key of a user with admin rights.
969 This command can only be executed using the api_key of a user with admin rights.
963
970
964
971
965 INPUT::
972 INPUT::
966
973
967 id : <id_for_response>
974 id : <id_for_response>
968 api_key : "<api_key>"
975 api_key : "<api_key>"
969 method : "grant_user_permission"
976 method : "grant_user_permission"
970 args: {
977 args: {
971 "repoid" : "<reponame or repo_id>"
978 "repoid" : "<reponame or repo_id>"
972 "userid" : "<username or user_id>"
979 "userid" : "<username or user_id>"
973 "perm" : "(repository.(none|read|write|admin))",
980 "perm" : "(repository.(none|read|write|admin))",
974 }
981 }
975
982
976 OUTPUT::
983 OUTPUT::
977
984
978 id : <id_given_in_input>
985 id : <id_given_in_input>
979 result: {
986 result: {
980 "msg" : "Granted perm: `<perm>` for user: `<username>` in repo: `<reponame>`",
987 "msg" : "Granted perm: `<perm>` for user: `<username>` in repo: `<reponame>`",
981 "success": true
988 "success": true
982 }
989 }
983 error: null
990 error: null
984
991
985
992
986 revoke_user_permission
993 revoke_user_permission
987 ----------------------
994 ----------------------
988
995
989 Revoke permission for a user on the given repository.
996 Revoke permission for a user on the given repository.
990 This command can only be executed using the api_key of a user with admin rights.
997 This command can only be executed using the api_key of a user with admin rights.
991
998
992
999
993 INPUT::
1000 INPUT::
994
1001
995 id : <id_for_response>
1002 id : <id_for_response>
996 api_key : "<api_key>"
1003 api_key : "<api_key>"
997 method : "revoke_user_permission"
1004 method : "revoke_user_permission"
998 args: {
1005 args: {
999 "repoid" : "<reponame or repo_id>"
1006 "repoid" : "<reponame or repo_id>"
1000 "userid" : "<username or user_id>"
1007 "userid" : "<username or user_id>"
1001 }
1008 }
1002
1009
1003 OUTPUT::
1010 OUTPUT::
1004
1011
1005 id : <id_given_in_input>
1012 id : <id_given_in_input>
1006 result: {
1013 result: {
1007 "msg" : "Revoked perm for user: `<username>` in repo: `<reponame>`",
1014 "msg" : "Revoked perm for user: `<username>` in repo: `<reponame>`",
1008 "success": true
1015 "success": true
1009 }
1016 }
1010 error: null
1017 error: null
1011
1018
1012
1019
1013 grant_user_group_permission
1020 grant_user_group_permission
1014 ---------------------------
1021 ---------------------------
1015
1022
1016 Grant permission for a user group on the given repository, or update the
1023 Grant permission for a user group on the given repository, or update the
1017 existing one if found.
1024 existing one if found.
1018 This command can only be executed using the api_key of a user with admin rights.
1025 This command can only be executed using the api_key of a user with admin rights.
1019
1026
1020
1027
1021 INPUT::
1028 INPUT::
1022
1029
1023 id : <id_for_response>
1030 id : <id_for_response>
1024 api_key : "<api_key>"
1031 api_key : "<api_key>"
1025 method : "grant_user_group_permission"
1032 method : "grant_user_group_permission"
1026 args: {
1033 args: {
1027 "repoid" : "<reponame or repo_id>"
1034 "repoid" : "<reponame or repo_id>"
1028 "usersgroupid" : "<user group id or name>"
1035 "usersgroupid" : "<user group id or name>"
1029 "perm" : "(repository.(none|read|write|admin))",
1036 "perm" : "(repository.(none|read|write|admin))",
1030 }
1037 }
1031
1038
1032 OUTPUT::
1039 OUTPUT::
1033
1040
1034 id : <id_given_in_input>
1041 id : <id_given_in_input>
1035 result: {
1042 result: {
1036 "msg" : "Granted perm: `<perm>` for group: `<usersgroupname>` in repo: `<reponame>`",
1043 "msg" : "Granted perm: `<perm>` for group: `<usersgroupname>` in repo: `<reponame>`",
1037 "success": true
1044 "success": true
1038 }
1045 }
1039 error: null
1046 error: null
1040
1047
1041
1048
1042 revoke_user_group_permission
1049 revoke_user_group_permission
1043 ----------------------------
1050 ----------------------------
1044
1051
1045 Revoke permission for a user group on the given repository.
1052 Revoke permission for a user group on the given repository.
1046 This command can only be executed using the api_key of a user with admin rights.
1053 This command can only be executed using the api_key of a user with admin rights.
1047
1054
1048 INPUT::
1055 INPUT::
1049
1056
1050 id : <id_for_response>
1057 id : <id_for_response>
1051 api_key : "<api_key>"
1058 api_key : "<api_key>"
1052 method : "revoke_user_group_permission"
1059 method : "revoke_user_group_permission"
1053 args: {
1060 args: {
1054 "repoid" : "<reponame or repo_id>"
1061 "repoid" : "<reponame or repo_id>"
1055 "usersgroupid" : "<user group id or name>"
1062 "usersgroupid" : "<user group id or name>"
1056 }
1063 }
1057
1064
1058 OUTPUT::
1065 OUTPUT::
1059
1066
1060 id : <id_given_in_input>
1067 id : <id_given_in_input>
1061 result: {
1068 result: {
1062 "msg" : "Revoked perm for group: `<usersgroupname>` in repo: `<reponame>`",
1069 "msg" : "Revoked perm for group: `<usersgroupname>` in repo: `<reponame>`",
1063 "success": true
1070 "success": true
1064 }
1071 }
1065 error: null
1072 error: null
@@ -1,9 +1,9 b''
1 .. _changelog:
1 .. _changelog:
2
2
3 =========
3 =========
4 Changelog
4 Changelog
5 =========
5 =========
6
6
7 Kallithea project doesn't keep its changelog here. We refer you to our Mercurial logs_ .
7 Kallithea project doesn't keep its changelog here. We refer you to our `Mercurial logs`__.
8
8
9 .. _logs: https://kallithea-scm.org/repos/kallithea/changelog
9 .. __: https://kallithea-scm.org/repos/kallithea/changelog
@@ -1,226 +1,227 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 #
2 #
3 # Kallithea documentation build configuration file, created by
3 # Kallithea documentation build configuration file, created by
4 # sphinx-quickstart on Sun Oct 10 16:46:37 2010.
4 # sphinx-quickstart on Sun Oct 10 16:46:37 2010.
5 #
5 #
6 # This file is execfile()d with the current directory set to its containing dir.
6 # This file is execfile()d with the current directory set to its containing dir.
7 #
7 #
8 # Note that not all possible configuration values are present in this
8 # Note that not all possible configuration values are present in this
9 # autogenerated file.
9 # autogenerated file.
10 #
10 #
11 # All configuration values have a default; values that are commented out
11 # All configuration values have a default; values that are commented out
12 # serve to show the default.
12 # serve to show the default.
13
13
14 import sys
14 import sys
15 import os
15 import os
16
16
17 # If extensions (or modules to document with autodoc) are in another directory,
17 # If extensions (or modules to document with autodoc) are in another directory,
18 # add these directories to sys.path here. If the directory is relative to the
18 # add these directories to sys.path here. If the directory is relative to the
19 # documentation root, use os.path.abspath to make it absolute, like shown here.
19 # documentation root, use os.path.abspath to make it absolute, like shown here.
20 sys.path.insert(0, os.path.abspath('..'))
20 sys.path.insert(0, os.path.abspath('..'))
21
21
22 # -- General configuration -----------------------------------------------------
22 # -- General configuration -----------------------------------------------------
23
23
24 # If your documentation needs a minimal Sphinx version, state it here.
24 # If your documentation needs a minimal Sphinx version, state it here.
25 #needs_sphinx = '1.0'
25 #needs_sphinx = '1.0'
26
26
27 # Add any Sphinx extension module names here, as strings. They can be extensions
27 # Add any Sphinx extension module names here, as strings. They can be extensions
28 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
28 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
29 extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest',
29 extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest',
30 'sphinx.ext.intersphinx', 'sphinx.ext.todo',
30 'sphinx.ext.intersphinx', 'sphinx.ext.todo',
31 'sphinx.ext.viewcode']
31 'sphinx.ext.viewcode']
32
32
33 # Add any paths that contain templates here, relative to this directory.
33 # Add any paths that contain templates here, relative to this directory.
34 templates_path = ['_templates']
34 templates_path = ['_templates']
35
35
36 # The suffix of source filenames.
36 # The suffix of source filenames.
37 source_suffix = '.rst'
37 source_suffix = '.rst'
38
38
39 # The encoding of source files.
39 # The encoding of source files.
40 #source_encoding = 'utf-8-sig'
40 #source_encoding = 'utf-8-sig'
41
41
42 # The master toctree document.
42 # The master toctree document.
43 master_doc = 'index'
43 master_doc = 'index'
44
44
45 # General information about the project.
45 # General information about the project.
46 project = u'Kallithea'
46 project = u'Kallithea'
47 copyright = u'2010-2015 by various authors, licensed as GPLv3.'
47 copyright = u'2010-2015 by various authors, licensed as GPLv3.'
48
48
49 # The version info for the project you're documenting, acts as replacement for
49 # The version info for the project you're documenting, acts as replacement for
50 # |version| and |release|, also used in various other places throughout the
50 # |version| and |release|, also used in various other places throughout the
51 # built documents.
51 # built documents.
52 #
52 #
53 # The short X.Y version.
53 # The short X.Y version.
54 root = os.path.dirname(os.path.dirname(__file__))
54 root = os.path.dirname(os.path.dirname(__file__))
55 sys.path.append(root)
55 sys.path.append(root)
56 from kallithea import __version__
56 from kallithea import __version__
57 version = __version__
57 version = __version__
58 # The full version, including alpha/beta/rc tags.
58 # The full version, including alpha/beta/rc tags.
59 release = __version__
59 release = __version__
60
60
61 # The language for content autogenerated by Sphinx. Refer to documentation
61 # The language for content autogenerated by Sphinx. Refer to documentation
62 # for a list of supported languages.
62 # for a list of supported languages.
63 #language = None
63 #language = None
64
64
65 # There are two options for replacing |today|: either, you set today to some
65 # There are two options for replacing |today|: either, you set today to some
66 # non-false value, then it is used:
66 # non-false value, then it is used:
67 #today = ''
67 #today = ''
68 # Else, today_fmt is used as the format for a strftime call.
68 # Else, today_fmt is used as the format for a strftime call.
69 #today_fmt = '%B %d, %Y'
69 #today_fmt = '%B %d, %Y'
70
70
71 # List of patterns, relative to source directory, that match files and
71 # List of patterns, relative to source directory, that match files and
72 # directories to ignore when looking for source files.
72 # directories to ignore when looking for source files.
73 exclude_patterns = ['_build']
73 exclude_patterns = ['_build']
74
74
75 # The reST default role (used for this markup: `text`) to use for all documents.
75 # The reST default role (used for this markup: `text`) to use for all documents.
76 #default_role = None
76 #default_role = None
77
77
78 # If true, '()' will be appended to :func: etc. cross-reference text.
78 # If true, '()' will be appended to :func: etc. cross-reference text.
79 #add_function_parentheses = True
79 #add_function_parentheses = True
80
80
81 # If true, the current module name will be prepended to all description
81 # If true, the current module name will be prepended to all description
82 # unit titles (such as .. function::).
82 # unit titles (such as .. function::).
83 #add_module_names = True
83 #add_module_names = True
84
84
85 # If true, sectionauthor and moduleauthor directives will be shown in the
85 # If true, sectionauthor and moduleauthor directives will be shown in the
86 # output. They are ignored by default.
86 # output. They are ignored by default.
87 #show_authors = False
87 #show_authors = False
88
88
89 # The name of the Pygments (syntax highlighting) style to use.
89 # The name of the Pygments (syntax highlighting) style to use.
90 pygments_style = 'sphinx'
90 pygments_style = 'sphinx'
91 highlight_language = 'none'
91
92
92 # A list of ignored prefixes for module index sorting.
93 # A list of ignored prefixes for module index sorting.
93 #modindex_common_prefix = []
94 #modindex_common_prefix = []
94
95
95
96
96 # -- Options for HTML output ---------------------------------------------------
97 # -- Options for HTML output ---------------------------------------------------
97
98
98 # The theme to use for HTML and HTML Help pages. See the documentation for
99 # The theme to use for HTML and HTML Help pages. See the documentation for
99 # a list of builtin themes.
100 # a list of builtin themes.
100 html_theme = 'nature'
101 html_theme = 'nature'
101
102
102 # Theme options are theme-specific and customize the look and feel of a theme
103 # Theme options are theme-specific and customize the look and feel of a theme
103 # further. For a list of options available for each theme, see the
104 # further. For a list of options available for each theme, see the
104 # documentation.
105 # documentation.
105 #html_theme_options = {}
106 #html_theme_options = {}
106
107
107 # Add any paths that contain custom themes here, relative to this directory.
108 # Add any paths that contain custom themes here, relative to this directory.
108 html_theme_path = ['theme']
109 html_theme_path = ['theme']
109
110
110 # The name for this set of Sphinx documents. If None, it defaults to
111 # The name for this set of Sphinx documents. If None, it defaults to
111 # "<project> v<release> documentation".
112 # "<project> v<release> documentation".
112 #html_title = None
113 #html_title = None
113
114
114 # A shorter title for the navigation bar. Default is the same as html_title.
115 # A shorter title for the navigation bar. Default is the same as html_title.
115 #html_short_title = None
116 #html_short_title = None
116
117
117 # The name of an image file (relative to this directory) to place at the top
118 # The name of an image file (relative to this directory) to place at the top
118 # of the sidebar.
119 # of the sidebar.
119 #html_logo = None
120 #html_logo = None
120
121
121 # The name of an image file (within the static path) to use as favicon of the
122 # The name of an image file (within the static path) to use as favicon of the
122 # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
123 # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
123 # pixels large.
124 # pixels large.
124 #html_favicon = None
125 #html_favicon = None
125
126
126 # Add any paths that contain custom static files (such as style sheets) here,
127 # Add any paths that contain custom static files (such as style sheets) here,
127 # relative to this directory. They are copied after the builtin static files,
128 # relative to this directory. They are copied after the builtin static files,
128 # so a file named "default.css" will overwrite the builtin "default.css".
129 # so a file named "default.css" will overwrite the builtin "default.css".
129 #html_static_path = ['_static']
130 #html_static_path = ['_static']
130
131
131 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
132 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
132 # using the given strftime format.
133 # using the given strftime format.
133 #html_last_updated_fmt = '%b %d, %Y'
134 #html_last_updated_fmt = '%b %d, %Y'
134
135
135 # If true, SmartyPants will be used to convert quotes and dashes to
136 # If true, SmartyPants will be used to convert quotes and dashes to
136 # typographically correct entities.
137 # typographically correct entities.
137 #html_use_smartypants = True
138 #html_use_smartypants = True
138
139
139 # Custom sidebar templates, maps document names to template names.
140 # Custom sidebar templates, maps document names to template names.
140 #html_sidebars = {}
141 #html_sidebars = {}
141
142
142 # Additional templates that should be rendered to pages, maps page names to
143 # Additional templates that should be rendered to pages, maps page names to
143 # template names.
144 # template names.
144 #html_additional_pages = {}
145 #html_additional_pages = {}
145
146
146 # If false, no module index is generated.
147 # If false, no module index is generated.
147 #html_domain_indices = True
148 #html_domain_indices = True
148
149
149 # If false, no index is generated.
150 # If false, no index is generated.
150 #html_use_index = True
151 #html_use_index = True
151
152
152 # If true, the index is split into individual pages for each letter.
153 # If true, the index is split into individual pages for each letter.
153 #html_split_index = False
154 #html_split_index = False
154
155
155 # If true, links to the reST sources are added to the pages.
156 # If true, links to the reST sources are added to the pages.
156 #html_show_sourcelink = True
157 #html_show_sourcelink = True
157
158
158 # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
159 # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
159 #html_show_sphinx = True
160 #html_show_sphinx = True
160
161
161 # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
162 # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
162 #html_show_copyright = True
163 #html_show_copyright = True
163
164
164 # If true, an OpenSearch description file will be output, and all pages will
165 # If true, an OpenSearch description file will be output, and all pages will
165 # contain a <link> tag referring to it. The value of this option must be the
166 # contain a <link> tag referring to it. The value of this option must be the
166 # base URL from which the finished HTML is served.
167 # base URL from which the finished HTML is served.
167 #html_use_opensearch = ''
168 #html_use_opensearch = ''
168
169
169 # This is the file name suffix for HTML files (e.g. ".xhtml").
170 # This is the file name suffix for HTML files (e.g. ".xhtml").
170 #html_file_suffix = None
171 #html_file_suffix = None
171
172
172 # Output file base name for HTML help builder.
173 # Output file base name for HTML help builder.
173 htmlhelp_basename = 'Kallithea-docs'
174 htmlhelp_basename = 'Kallithea-docs'
174
175
175
176
176 # -- Options for LaTeX output --------------------------------------------------
177 # -- Options for LaTeX output --------------------------------------------------
177
178
178 # The paper size ('letter' or 'a4').
179 # The paper size ('letter' or 'a4').
179 #latex_paper_size = 'letter'
180 #latex_paper_size = 'letter'
180
181
181 # The font size ('10pt', '11pt' or '12pt').
182 # The font size ('10pt', '11pt' or '12pt').
182 #latex_font_size = '10pt'
183 #latex_font_size = '10pt'
183
184
184 # Grouping the document tree into LaTeX files. List of tuples
185 # Grouping the document tree into LaTeX files. List of tuples
185 # (source start file, target name, title, author, documentclass [howto/manual]).
186 # (source start file, target name, title, author, documentclass [howto/manual]).
186 latex_documents = [
187 latex_documents = [
187 ('index', 'Kallithea.tex', u'Kallithea Documentation',
188 ('index', 'Kallithea.tex', u'Kallithea Documentation',
188 u'Kallithea Developers', 'manual'),
189 u'Kallithea Developers', 'manual'),
189 ]
190 ]
190
191
191 # The name of an image file (relative to this directory) to place at the top of
192 # The name of an image file (relative to this directory) to place at the top of
192 # the title page.
193 # the title page.
193 #latex_logo = None
194 #latex_logo = None
194
195
195 # For "manual" documents, if this is true, then toplevel headings are parts,
196 # For "manual" documents, if this is true, then toplevel headings are parts,
196 # not chapters.
197 # not chapters.
197 #latex_use_parts = False
198 #latex_use_parts = False
198
199
199 # If true, show page references after internal links.
200 # If true, show page references after internal links.
200 #latex_show_pagerefs = False
201 #latex_show_pagerefs = False
201
202
202 # If true, show URL addresses after external links.
203 # If true, show URL addresses after external links.
203 #latex_show_urls = False
204 #latex_show_urls = False
204
205
205 # Additional stuff for the LaTeX preamble.
206 # Additional stuff for the LaTeX preamble.
206 #latex_preamble = ''
207 #latex_preamble = ''
207
208
208 # Documents to append as an appendix to all manuals.
209 # Documents to append as an appendix to all manuals.
209 #latex_appendices = []
210 #latex_appendices = []
210
211
211 # If false, no module index is generated.
212 # If false, no module index is generated.
212 #latex_domain_indices = True
213 #latex_domain_indices = True
213
214
214
215
215 # -- Options for manual page output --------------------------------------------
216 # -- Options for manual page output --------------------------------------------
216
217
217 # One entry per manual page. List of tuples
218 # One entry per manual page. List of tuples
218 # (source start file, name, description, authors, manual section).
219 # (source start file, name, description, authors, manual section).
219 man_pages = [
220 man_pages = [
220 ('index', 'kallithea', u'Kallithea Documentation',
221 ('index', 'kallithea', u'Kallithea Documentation',
221 [u'Kallithea Developers'], 1)
222 [u'Kallithea Developers'], 1)
222 ]
223 ]
223
224
224
225
225 # Example configuration for intersphinx: refer to the Python standard library.
226 # Example configuration for intersphinx: refer to the Python standard library.
226 intersphinx_mapping = {'http://docs.python.org/': None}
227 intersphinx_mapping = {'http://docs.python.org/': None}
@@ -1,149 +1,151 b''
1 .. _contributing:
1 .. _contributing:
2
2
3 =========================
3 =========================
4 Contributing to Kallithea
4 Contributing to Kallithea
5 =========================
5 =========================
6
6
7 Kallithea is developed and maintained by its users. Please join us and scratch
7 Kallithea is developed and maintained by its users. Please join us and scratch
8 your own itch.
8 your own itch.
9
9
10
10
11 Infrastructure
11 Infrastructure
12 --------------
12 --------------
13
13
14 The main repository is hosted at Our Own Kallithea (aka OOK) on
14 The main repository is hosted on Our Own Kallithea (aka OOK) at
15 https://kallithea-scm.org/repos/kallithea/ (which is our self-hosted instance
15 https://kallithea-scm.org/repos/kallithea/, our self-hosted instance
16 of Kallithea).
16 of Kallithea.
17
17
18 For now, we use Bitbucket_ for `Pull Requests`_ and `Issue Tracker`_ services. The
18 For now, we use Bitbucket_ for `pull requests`_ and `issue tracking`_. The
19 issue tracker is for tracking bugs, not for support, discussion, or ideas -
19 issue tracker is for tracking bugs, not for support, discussion, or ideas --
20 please use the `mailing list`_ to reach the community.
20 please use the `mailing list`_ or :ref:`IRC <readme>` to reach the community.
21
21
22 We use Weblate_ to translate the user interface messages into languages other
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.
23 than English. Join our project on `Hosted Weblate`_ to help us.
24 To register, you can use your Bitbucket or GitHub account. See :ref:`translations`
24 To register, you can use your Bitbucket or GitHub account. See :ref:`translations`
25 for more details.
25 for more details.
26
26
27 Getting started
27 Getting started
28 ---------------
28 ---------------
29
29
30 To get started with development::
30 To get started with development::
31
31
32 hg clone https://kallithea-scm.org/repos/kallithea
32 hg clone https://kallithea-scm.org/repos/kallithea
33 cd kallithea
33 cd kallithea
34 virtualenv ../kallithea-venv
34 virtualenv ../kallithea-venv
35 source ../kallithea-venv/bin/activate
35 source ../kallithea-venv/bin/activate
36 python setup.py develop
36 python setup.py develop
37 paster make-config Kallithea my.ini
37 paster make-config Kallithea my.ini
38 paster setup-db my.ini --user=user --email=user@example.com --password=password --repos=/tmp
38 paster setup-db my.ini --user=user --email=user@example.com --password=password --repos=/tmp
39 paster serve my.ini --reload &
39 paster serve my.ini --reload &
40 firefox http://127.0.0.1:5000/
40 firefox http://127.0.0.1:5000/
41
41
42 You can also start out by forking https://bitbucket.org/conservancy/kallithea
42 You can also start out by forking https://bitbucket.org/conservancy/kallithea
43 on Bitbucket_ and create a local clone of your own fork.
43 on Bitbucket_ and create a local clone of your own fork.
44
44
45
45
46 Running tests
46 Running tests
47 -------------
47 -------------
48
48
49 After finishing your changes make sure all tests pass cleanly. You can run
49 After finishing your changes make sure all tests pass cleanly. You can run
50 the testsuite running ``nosetests`` from the project root, or if you use tox
50 the testsuite running ``nosetests`` from the project root, or if you use tox
51 run ``tox`` for python2.6-2.7 with multiple database test.
51 run ``tox`` for Python 2.6--2.7 with multiple database test.
52
52
53 When running tests, Kallithea uses `kallithea/tests/test.ini` and populates the
53 When running tests, Kallithea uses `kallithea/tests/test.ini` and populates the
54 SQLite database specified there.
54 SQLite database specified there.
55
55
56 It is possible to avoid recreating the full test database on each invocation of
56 It is possible to avoid recreating the full test database on each invocation of
57 the tests, thus eliminating the initial delay. To achieve this, run the tests as::
57 the tests, thus eliminating the initial delay. To achieve this, run the tests as::
58
58
59 paster serve kallithea/tests/test.ini --pid-file=test.pid --daemon
59 paster serve kallithea/tests/test.ini --pid-file=test.pid --daemon
60 KALLITHEA_WHOOSH_TEST_DISABLE=1 KALLITHEA_NO_TMP_PATH=1 nosetests
60 KALLITHEA_WHOOSH_TEST_DISABLE=1 KALLITHEA_NO_TMP_PATH=1 nosetests
61 kill -9 $(cat test.pid)
61 kill -9 $(cat test.pid)
62
62
63 You can run individual tests by specifying their path as argument to nosetests.
63 You can run individual tests by specifying their path as argument to nosetests.
64 nosetests also has many more options, see `nosetests -h`. Some useful options
64 nosetests also has many more options, see `nosetests -h`. Some useful options
65 are::
65 are::
66
66
67 -x, --stop Stop running tests after the first error or failure
67 -x, --stop Stop running tests after the first error or failure
68 -s, --nocapture Don't capture stdout (any stdout output will be
68 -s, --nocapture Don't capture stdout (any stdout output will be
69 printed immediately) [NOSE_NOCAPTURE]
69 printed immediately) [NOSE_NOCAPTURE]
70 --failed Run the tests that failed in the last test run.
70 --failed Run the tests that failed in the last test run.
71
71
72 Coding/contribution guidelines
72 Coding/contribution guidelines
73 ------------------------------
73 ------------------------------
74
74
75 Kallithea is GPLv3 and we assume all contributions are made by the
75 Kallithea is GPLv3 and we assume all contributions are made by the
76 committer/contributor and under GPLv3 unless explicitly stated. We do care a
76 committer/contributor and under GPLv3 unless explicitly stated. We do care a
77 lot about preservation of copyright and license information for existing code
77 lot about preservation of copyright and license information for existing code
78 that is brought into the project.
78 that is brought into the project.
79
79
80 We don't have a formal coding/formatting standard. We are currently using a mix
80 We don't have a formal coding/formatting standard. We are currently using a mix
81 of Mercurial (http://mercurial.selenic.com/wiki/CodingStyle), pep8, and
81 of Mercurial (http://mercurial.selenic.com/wiki/CodingStyle), pep8, and
82 consistency with existing code. Run whitespacecleanup.sh to avoid stupid
82 consistency with existing code. Run whitespacecleanup.sh to avoid stupid
83 whitespace noise in your patches.
83 whitespace noise in your patches.
84
84
85 We support both Python 2.6.x and 2.7.x and nothing else. For now we don't care
85 We support both Python 2.6.x and 2.7.x and nothing else. For now we don't care
86 about Python 3 compatibility.
86 about Python 3 compatibility.
87
87
88 We try to support the most common modern web browsers. IE9 is still supported
88 We try to support the most common modern web browsers. IE9 is still supported
89 to the extent it is feasible, IE8 is not.
89 to the extent it is feasible, IE8 is not.
90
90
91 We primarily support Linux and OS X on the server side but Windows should also work.
91 We primarily support Linux and OS X on the server side but Windows should also work.
92
92
93 Html templates should use 2 spaces for indentation ... but be pragmatic. We
93 HTML templates should use 2 spaces for indentation ... but be pragmatic. We
94 should use templates cleverly and avoid duplication. We should use reasonable
94 should use templates cleverly and avoid duplication. We should use reasonable
95 semantic markup with classes and ids that can be used for styling and testing.
95 semantic markup with element classes and IDs that can be used for styling and testing.
96 We should only use inline styles in places where it really is semantic (such as
96 We should only use inline styles in places where it really is semantic (such as
97 display:none).
97 ``display: none``).
98
98
99 JavaScript must use ';' between/after statements. Indentation 4 spaces. Inline
99 JavaScript must use ``;`` between/after statements. Indentation 4 spaces. Inline
100 multiline functions should be indented two levels - one for the () and one for
100 multiline functions should be indented two levels -- one for the ``()`` and one for
101 {}. jQuery value arrays should have a leading $.
101 ``{}``.
102 Variables holding jQuery objects should be named with a leading ``$``.
102
103
103 Commit messages should have a leading short line summarizing the changes. For
104 Commit messages should have a leading short line summarizing the changes. For
104 bug fixes, put "(Issue #123)" at the end of this line.
105 bug fixes, put ``(Issue #123)`` at the end of this line.
105
106
106 Contributions will be accepted in most formats - such as pull requests on
107 Contributions will be accepted in most formats -- such as pull requests on
107 bitbucket, something hosted on your own Kallithea instance, or patches sent by
108 bitbucket, something hosted on your own Kallithea instance, or patches sent by
108 email to the kallithea-general mailing list.
109 email to the `kallithea-general`_ mailing list.
109
110
110 Make sure to test your changes both manually and with the automatic tests
111 Make sure to test your changes both manually and with the automatic tests
111 before posting.
112 before posting.
112
113
113 We care about quality and review and keeping a clean repository history. We
114 We care about quality and review and keeping a clean repository history. We
114 might give feedback that requests polishing contributions until they are
115 might give feedback that requests polishing contributions until they are
115 "perfect". We might also rebase and collapse and make minor adjustments to your
116 "perfect". We might also rebase and collapse and make minor adjustments to your
116 changes when we apply them.
117 changes when we apply them.
117
118
118 We try to make sure we have consensus on the direction the project is taking.
119 We try to make sure we have consensus on the direction the project is taking.
119 Everything non-sensitive should be discussed in public - preferably on the
120 Everything non-sensitive should be discussed in public -- preferably on the
120 mailing list. We aim at having all non-trivial changes reviewed by at least
121 mailing list. We aim at having all non-trivial changes reviewed by at least
121 one other core developer before pushing. Obvious non-controversial changes will
122 one other core developer before pushing. Obvious non-controversial changes will
122 be handled more casually.
123 be handled more casually.
123
124
124 For now we just have one official branch ("default") and will keep it so stable
125 For now we just have one official branch ("default") and will keep it so stable
125 that it can be (and is) used in production. Experimental changes should live
126 that it can be (and is) used in production. Experimental changes should live
126 elsewhere (for example in a pull request) until they are ready.
127 elsewhere (for example in a pull request) until they are ready.
127
128
128 .. _translations:
129 .. _translations:
129 .. include:: ./../kallithea/i18n/how_to
130 .. include:: ./../kallithea/i18n/how_to
130
131
131 "Roadmap"
132 "Roadmap"
132 ---------
133 ---------
133
134
134 We do not have a road map but are waiting for your contributions. Refer to the
135 We do not have a road map but are waiting for your contributions. Refer to the
135 wiki_ for some ideas of places we might want to go - contributions in these
136 wiki_ for some ideas of places we might want to go -- contributions in these
136 areas are very welcome.
137 areas are very welcome.
137
138
138
139
139 Thank you for your contribution!
140 Thank you for your contribution!
140 --------------------------------
141 --------------------------------
141
142
142
143
143 .. _Weblate: http://weblate.org/
144 .. _Weblate: http://weblate.org/
144 .. _Issue Tracker: https://bitbucket.org/conservancy/kallithea/issues?status=new&status=open
145 .. _issue tracking: https://bitbucket.org/conservancy/kallithea/issues?status=new&status=open
145 .. _Pull Requests: https://bitbucket.org/conservancy/kallithea/pull-requests
146 .. _pull requests: https://bitbucket.org/conservancy/kallithea/pull-requests
146 .. _bitbucket: http://bitbucket.org/
147 .. _bitbucket: http://bitbucket.org/
147 .. _mailing list: http://lists.sfconservancy.org/mailman/listinfo/kallithea-general
148 .. _mailing list: http://lists.sfconservancy.org/mailman/listinfo/kallithea-general
149 .. _kallithea-general: http://lists.sfconservancy.org/mailman/listinfo/kallithea-general
148 .. _Hosted Weblate: https://hosted.weblate.org/projects/kallithea/kallithea/
150 .. _Hosted Weblate: https://hosted.weblate.org/projects/kallithea/kallithea/
149 .. _wiki: https://bitbucket.org/conservancy/kallithea/wiki/Home
151 .. _wiki: https://bitbucket.org/conservancy/kallithea/wiki/Home
@@ -1,203 +1,204 b''
1 .. _installation:
1 .. _installation:
2
2
3 ==========================
3 ==========================
4 Installation on Unix/Linux
4 Installation on Unix/Linux
5 ==========================
5 ==========================
6
6
7 Here are more details about 3 ways to install Kallithea:
7 The following describes three different ways of installing Kallithea:
8
8
9 - :ref:`installation-source`: The simplest way to keep the installation
9 - :ref:`installation-source`: The simplest way to keep the installation
10 uptodate and keep track of local customizations is to run directly from
10 up-to-date and track any local customizations is to run directly from
11 source in a Kallithea repository clone and use virtualenv.
11 source in a Kallithea repository clone, preferably inside a virtualenv
12 virtual Python environment.
12
13
13 - :ref:`installation-virtualenv`: If you prefer to only use released versions
14 - :ref:`installation-virtualenv`: If you prefer to only use released versions
14 of Kallithea, the recommended method is to install Kallithea in a virtual
15 of Kallithea, the recommended method is to install Kallithea in a virtual
15 Python environment using `virtualenv`. The advantages of this method over
16 Python environment using `virtualenv`. The advantages of this method over
16 direct installation is that Kallithea and its dependencies are completely
17 direct installation is that Kallithea and its dependencies are completely
17 contained inside the virtualenv (which also means you can have multiple
18 contained inside the virtualenv (which also means you can have multiple
18 installations side by side or remove it entirely by just removing the
19 installations side by side or remove it entirely by just removing the
19 virtualenv directory) and does not require root privileges.
20 virtualenv directory) and does not require root privileges.
20
21
21 - :ref:`installation-without-virtualenv`: The alternative method of installing
22 - :ref:`installation-without-virtualenv`: The alternative method of installing
22 a Kallithea release is using standard pip. The package will be installed in
23 a Kallithea release is using standard pip. The package will be installed in
23 the same location as all other Python packages you have ever installed. As a
24 the same location as all other Python packages you have ever installed. As a
24 result, removing it is not as straightforward as with a virtualenv, as you'd
25 result, removing it is not as straightforward as with a virtualenv, as you'd
25 have to remove its dependencies manually and make sure that they are not
26 have to remove its dependencies manually and make sure that they are not
26 needed by other packages.
27 needed by other packages.
27
28
28 .. _installation-source:
29 .. _installation-source:
29
30
30 Installation from repository source
31 Installation from repository source
31 -----------------------------------
32 -----------------------------------
32
33
33 To install Kallithea in a virtualenv using the stable branch of the development
34 To install Kallithea in a virtualenv_ using the stable branch of the development
34 repository, follow the instructions below::
35 repository, follow the instructions below::
35
36
36 hg clone https://kallithea-scm.org/repos/kallithea -u stable
37 hg clone https://kallithea-scm.org/repos/kallithea -u stable
37 cd kallithea
38 cd kallithea
38 virtualenv ../kallithea-venv
39 virtualenv ../kallithea-venv
39 source ../kallithea-venv/bin/activate
40 source ../kallithea-venv/bin/activate
40 python setup.py develop
41 python setup.py develop
41 python setup.py compile_catalog # for translation of the UI
42 python setup.py compile_catalog # for translation of the UI
42
43
43 You can now proceed to :ref:`setup`.
44 You can now proceed to :ref:`setup`.
44
45
45 To upgrade, simply update the repository with ``hg pull -u`` and restart the
46 To upgrade, simply update the repository with ``hg pull -u`` and restart the
46 server.
47 server.
47
48
48 .. _installation-virtualenv:
49 .. _installation-virtualenv:
49
50
50 Installing a released version in a virtualenv
51 Installing a released version in a virtualenv
51 ---------------------------------------------
52 ---------------------------------------------
52
53
53 It is highly recommended to use a separate virtualenv_ for installing Kallithea.
54 It is highly recommended to use a separate virtualenv_ for installing Kallithea.
54 This way, all libraries required by Kallithea will be installed separately from your
55 This way, all libraries required by Kallithea will be installed separately from your
55 main Python installation and other applications and things will be less
56 main Python installation and other applications and things will be less
56 problematic when upgrading the system or Kallithea.
57 problematic when upgrading the system or Kallithea.
57 An additional benefit of virtualenv_ is that it doesn't require root privileges.
58 An additional benefit of virtualenv_ is that it doesn't require root privileges.
58
59
59 - Assuming you have installed virtualenv_, create a new virtual environment
60 - Assuming you have installed virtualenv_, create a new virtual environment
60 for example, in `/srv/kallithea/venv`, using the virtualenv command::
61 for example, in `/srv/kallithea/venv`, using the virtualenv command::
61
62
62 virtualenv /srv/kallithea/venv
63 virtualenv /srv/kallithea/venv
63
64
64 - Activate the virtualenv_ in your current shell session by running::
65 - Activate the virtualenv_ in your current shell session by running::
65
66
66 source /srv/kallithea/venv/bin/activate
67 source /srv/kallithea/venv/bin/activate
67
68
68 .. note:: You can't use UNIX ``sudo`` to source the ``virtualenv`` script; it
69 .. note:: You can't use UNIX ``sudo`` to source the ``virtualenv`` script; it
69 will "activate" a shell that terminates immediately. It is also perfectly
70 will "activate" a shell that terminates immediately. It is also perfectly
70 acceptable (and desirable) to create a virtualenv as a normal user.
71 acceptable (and desirable) to create a virtualenv as a normal user.
71
72
72 - Make a folder for Kallithea data files, and configuration somewhere on the
73 - Make a folder for Kallithea data files, and configuration somewhere on the
73 filesystem. For example::
74 filesystem. For example::
74
75
75 mkdir /srv/kallithea
76 mkdir /srv/kallithea
76
77
77 - Go into the created directory and run this command to install Kallithea::
78 - Go into the created directory and run this command to install Kallithea::
78
79
79 pip install kallithea
80 pip install kallithea
80
81
81 Alternatively, download a .tar.gz from http://pypi.python.org/pypi/Kallithea,
82 Alternatively, download a .tar.gz from http://pypi.python.org/pypi/Kallithea,
82 extract it and run::
83 extract it and run::
83
84
84 python setup.py install
85 python setup.py install
85
86
86 - This will install Kallithea together with pylons_ and all other required
87 - This will install Kallithea together with pylons_ and all other required
87 python libraries into the activated virtualenv.
88 python libraries into the activated virtualenv.
88
89
89 You can now proceed to :ref:`setup`.
90 You can now proceed to :ref:`setup`.
90
91
91 .. _installation-without-virtualenv:
92 .. _installation-without-virtualenv:
92
93
93 Installing a released version without virtualenv
94 Installing a released version without virtualenv
94 ------------------------------------------------
95 ------------------------------------------------
95
96
96 For installation without virtualenv, 'just' use::
97 For installation without virtualenv, 'just' use::
97
98
98 pip install kallithea
99 pip install kallithea
99
100
100 Note that this method requires root privileges and will install packages
101 Note that this method requires root privileges and will install packages
101 globally without using the system's package manager.
102 globally without using the system's package manager.
102
103
103 To install as a regular user in ``~/.local``, you can use::
104 To install as a regular user in ``~/.local``, you can use::
104
105
105 pip install --user kallithea
106 pip install --user kallithea
106
107
107 You can now proceed to :ref:`setup`.
108 You can now proceed to :ref:`setup`.
108
109
109 Upgrading Kallithea from Python Package Index (PyPI)
110 Upgrading Kallithea from Python Package Index (PyPI)
110 ----------------------------------------------------
111 ----------------------------------------------------
111
112
112 .. note::
113 .. note::
113 It is strongly recommended that you **always** perform a database and
114 It is strongly recommended that you **always** perform a database and
114 configuration backup before doing an upgrade.
115 configuration backup before doing an upgrade.
115
116
116 These directions will use '{version}' to note that this is the version of
117 These directions will use '{version}' to note that this is the version of
117 Kallithea that these files were used with. If backing up your Kallithea
118 Kallithea that these files were used with. If backing up your Kallithea
118 instance from version 0.1 to 0.2, the ``my.ini`` file could be
119 instance from version 0.1 to 0.2, the ``my.ini`` file could be
119 backed up to ``my.ini.0-1``.
120 backed up to ``my.ini.0-1``.
120
121
121
122
122 If using a SQLite database, stop the Kallithea process/daemon/service, and
123 If using a SQLite database, stop the Kallithea process/daemon/service, and
123 then make a copy of the database file::
124 then make a copy of the database file::
124
125
125 service kallithea stop
126 service kallithea stop
126 cp kallithea.db kallithea.db.{version}
127 cp kallithea.db kallithea.db.{version}
127
128
128
129
129 Back up your configuration file::
130 Back up your configuration file::
130
131
131 cp my.ini my.ini.{version}
132 cp my.ini my.ini.{version}
132
133
133
134
134 Ensure that you are using the Python virtual environment that you originally
135 Ensure that you are using the Python virtual environment that you originally
135 installed Kallithea in by running::
136 installed Kallithea in by running::
136
137
137 pip freeze
138 pip freeze
138
139
139 This will list all packages installed in the current environment. If
140 This will list all packages installed in the current environment. If
140 Kallithea isn't listed, activate the correct virtual environment::
141 Kallithea isn't listed, activate the correct virtual environment::
141
142
142 source /srv/kallithea/venv/bin/activate
143 source /srv/kallithea/venv/bin/activate
143
144
144
145
145 Once you have verified the environment you can upgrade Kallithea with::
146 Once you have verified the environment you can upgrade Kallithea with::
146
147
147 pip install --upgrade kallithea
148 pip install --upgrade kallithea
148
149
149
150
150 Then run the following command from the installation directory::
151 Then run the following command from the installation directory::
151
152
152 paster make-config Kallithea my.ini
153 paster make-config Kallithea my.ini
153
154
154 This will display any changes made by the new version of Kallithea to your
155 This will display any changes made by the new version of Kallithea to your
155 current configuration. It will try to perform an automerge. It is recommended
156 current configuration. It will try to perform an automerge. It is recommended
156 that you recheck the content after the automerge.
157 that you recheck the content after the automerge.
157
158
158 .. note::
159 .. note::
159 Please always make sure your .ini files are up to date. Errors can
160 Please always make sure your .ini files are up to date. Errors can
160 often be caused by missing parameters added in new versions.
161 often be caused by missing parameters added in new versions.
161
162
162
163
163 It is also recommended that you rebuild the whoosh index after upgrading since
164 It is also recommended that you rebuild the whoosh index after upgrading since
164 the new whoosh version could introduce some incompatible index changes. Please
165 the new whoosh version could introduce some incompatible index changes. Please
165 read the changelog to see if there were any changes to whoosh.
166 read the changelog to see if there were any changes to whoosh.
166
167
167
168
168 The final step is to upgrade the database. To do this simply run::
169 The final step is to upgrade the database. To do this simply run::
169
170
170 paster upgrade-db my.ini
171 paster upgrade-db my.ini
171
172
172 This will upgrade the schema and update some of the defaults in the database,
173 This will upgrade the schema and update some of the defaults in the database,
173 and will always recheck the settings of the application, if there are no new
174 and will always recheck the settings of the application, if there are no new
174 options that need to be set.
175 options that need to be set.
175
176
176
177
177 .. note::
178 .. note::
178 The DB schema upgrade library has some limitations and can sometimes fail if you try to
179 The DB schema upgrade library has some limitations and can sometimes fail if you try to
179 upgrade from older major releases. In such a case simply run upgrades sequentially, e.g.,
180 upgrade from older major releases. In such a case simply run upgrades sequentially, e.g.,
180 upgrading from 0.1.X to 0.3.X should be done like this: 0.1.X. > 0.2.X > 0.3.X
181 upgrading from 0.1.X to 0.3.X should be done like this: 0.1.X. > 0.2.X > 0.3.X
181 You can always specify what version of Kallithea you want to install for example in pip
182 You can always specify what version of Kallithea you want to install for example in pip
182 `pip install Kallithea==0.2`
183 `pip install Kallithea==0.2`
183
184
184 You may find it helpful to clear out your log file so that new errors are
185 You may find it helpful to clear out your log file so that new errors are
185 readily apparent::
186 readily apparent::
186
187
187 echo > kallithea.log
188 echo > kallithea.log
188
189
189 Once that is complete, you may now start your upgraded Kallithea Instance::
190 Once that is complete, you may now start your upgraded Kallithea Instance::
190
191
191 service kallithea start
192 service kallithea start
192
193
193 Or::
194 Or::
194
195
195 paster serve /srv/kallithea/my.ini
196 paster serve /srv/kallithea/my.ini
196
197
197 .. note::
198 .. note::
198 If you're using Celery, make sure you restart all instances of it after
199 If you're using Celery, make sure you restart all instances of it after
199 upgrade.
200 upgrade.
200
201
201
202
202 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
203 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
203 .. _pylons: http://www.pylonsproject.org/
204 .. _pylons: http://www.pylonsproject.org/
@@ -1,108 +1,108 b''
1 .. _installation_iis:
1 .. _installation_iis:
2
2
3 =====================================================================
3 =====================================================================
4 Installing Kallithea on Microsoft Internet Information Services (IIS)
4 Installing Kallithea on Microsoft Internet Information Services (IIS)
5 =====================================================================
5 =====================================================================
6
6
7 The following is documented using IIS 7/8 terminology. There should be nothing
7 The following is documented using IIS 7/8 terminology. There should be nothing
8 preventing you from applying this on IIS 6 well.
8 preventing you from applying this on IIS 6 well.
9
9
10 .. note::
10 .. note::
11
11
12 For the best security, it is strongly recommended to only host the site over
12 For the best security, it is strongly recommended to only host the site over
13 a secure connection, e.g. using TLS.
13 a secure connection, e.g. using TLS.
14
14
15 Prerequisites
15 Prerequisites
16 -------------
16 -------------
17
17
18 Apart from the normal requirements for Kallithea, it is also necessary to get an
18 Apart from the normal requirements for Kallithea, it is also necessary to get an
19 ISAPI-WSGI bridge module, e.g. isapi-wsgi.
19 ISAPI-WSGI bridge module, e.g. isapi-wsgi.
20
20
21 Installation
21 Installation
22 ------------
22 ------------
23
23
24 The following will assume that your Kallithea is at ``c:\inetpub\kallithea`` and
24 The following assumes that your Kallithea is at ``c:\inetpub\kallithea``, and
25 will be served from the root of its own website. The changes to serve it in its
25 will be served from the root of its own website. The changes to serve it in its
26 own virtual folder will be noted where appropriate.
26 own virtual folder will be noted where appropriate.
27
27
28 Application pool
28 Application pool
29 ................
29 ................
30
30
31 Make sure that there is a unique application pool for the Kallithea application
31 Make sure that there is a unique application pool for the Kallithea application
32 with an identity that has read access to the Kallithea distribution.
32 with an identity that has read access to the Kallithea distribution.
33
33
34 The application pool does not need to be able to run any managed code. If you
34 The application pool does not need to be able to run any managed code. If you
35 are using a 32-bit Python installation, then you must enable 32 bit program in
35 are using a 32-bit Python installation, then you must enable 32-bit program in
36 the advanced settings for the application pool otherwise Python will not be able
36 the advanced settings for the application pool; otherwise Python will not be able
37 to run on the website and consequently, Kallithea will not be able to run.
37 to run on the website and neither will Kallithea.
38
38
39 .. note::
39 .. note::
40
40
41 The application pool can be the same as an existing application pool as long
41 The application pool can be the same as an existing application pool,
42 as the requirements to Kallithea are enabled by the existing application
42 as long as the Kallithea requirements are met by the existing pool.
43 pool.
43
44
44
45 ISAPI handler
45 ISAPI handler
46 .............
46 .............
47
47
48 The ISAPI handler can be generated using::
48 The ISAPI handler can be generated using::
49
49
50 paster install-iis my.ini --root=/
50 paster install-iis my.ini --root=/
51
51
52 This will generate a ``dispatch.py`` file in the current directory that contains
52 This will generate a ``dispatch.py`` file in the current directory that contains
53 the necessary components to finalize an installation into IIS. Once this file
53 the necessary components to finalize an installation into IIS. Once this file
54 has been generated, it is necessary to run the following command due to the way
54 has been generated, it is necessary to run the following command due to the way
55 that ISAPI-WSGI is made::
55 that ISAPI-WSGI is made::
56
56
57 python dispatch.py install
57 python dispatch.py install
58
58
59 This accomplishes two things: generating an ISAPI compliant DLL file,
59 This accomplishes two things: generating an ISAPI compliant DLL file,
60 ``_dispatch.dll``, and installing a script map handler into IIS for the
60 ``_dispatch.dll``, and installing a script map handler into IIS for the
61 ``--root`` specified above pointing to ``_dispatch.dll``.
61 ``--root`` specified above pointing to ``_dispatch.dll``.
62
62
63 The ISAPI handler is registered to all file extensions, so it will automatically
63 The ISAPI handler is registered to all file extensions, so it will automatically
64 be the one handling all requests to the specified root. When the website starts
64 be the one handling all requests to the specified root. When the website starts
65 the ISAPI handler, it will start a thread pool managed wrapper around the paster
65 the ISAPI handler, it will start a thread pool managed wrapper around the paster
66 middleware WSGI handler that Kallithea runs within and each HTTP request to the
66 middleware WSGI handler that Kallithea runs within and each HTTP request to the
67 site will be processed through this logic henceforth.
67 site will be processed through this logic henceforth.
68
68
69 Authentication with Kallithea using IIS authentication modules
69 Authentication with Kallithea using IIS authentication modules
70 ..............................................................
70 ..............................................................
71
71
72 The recommended way to handle authentication with Kallithea using IIS is to let
72 The recommended way to handle authentication with Kallithea using IIS is to let
73 IIS handle all the authentication and just pass it to Kallithea.
73 IIS handle all the authentication and just pass it to Kallithea.
74
74
75 To move responsibility into IIS from Kallithea, we need to configure Kallithea
75 To move responsibility into IIS from Kallithea, we need to configure Kallithea
76 to let external systems handle authentication and then let Kallithea create the
76 to let external systems handle authentication and then let Kallithea create the
77 user automatically. To do this, access the administration's authentication page
77 user automatically. To do this, access the administration's authentication page
78 and enable the ``kallithea.lib.auth_modules.auth_container`` plugin. Once it is
78 and enable the ``kallithea.lib.auth_modules.auth_container`` plugin. Once it is
79 added, enable it with the ``REMOTE_USER`` header and check *Clean username*.
79 added, enable it with the ``REMOTE_USER`` header and check *Clean username*.
80 Finally, save the changes on this page.
80 Finally, save the changes on this page.
81
81
82 Switch to the administration's permissions page and disable anonymous access,
82 Switch to the administration's permissions page and disable anonymous access,
83 otherwise Kallithea will not attempt to use the authenticated user name. By
83 otherwise Kallithea will not attempt to use the authenticated user name. By
84 default, Kallithea will populate the list of users lazily as they log in. Either
84 default, Kallithea will populate the list of users lazily as they log in. Either
85 disable external auth account activation and ensure that you pre-populate the
85 disable external auth account activation and ensure that you pre-populate the
86 user database with an external tool, or set it to *Automatic activation of
86 user database with an external tool, or set it to *Automatic activation of
87 external account*. Finally, save the changes.
87 external account*. Finally, save the changes.
88
88
89 The last necessary step is to enable the relevant authentication in IIS, e.g.
89 The last necessary step is to enable the relevant authentication in IIS, e.g.
90 Windows authentication.
90 Windows authentication.
91
91
92 Troubleshooting
92 Troubleshooting
93 ---------------
93 ---------------
94
94
95 Typically, any issues in this setup will either be entirely in IIS or entirely
95 Typically, any issues in this setup will either be entirely in IIS or entirely
96 in Kallithea (or Kallithea's WSGI/paster middleware). Consequently, two
96 in Kallithea (or Kallithea's WSGI/paster middleware). Consequently, two
97 different options for finding issues exist: IIS' failed request tracking which
97 different options for finding issues exist: IIS' failed request tracking which
98 is great at finding issues until they exist inside Kallithea, at which point the
98 is great at finding issues until they exist inside Kallithea, at which point the
99 ISAPI-WSGI wrapper above uses ``win32traceutil``, which is part of ``pywin32``.
99 ISAPI-WSGI wrapper above uses ``win32traceutil``, which is part of ``pywin32``.
100
100
101 In order to dump output from WSGI using ``win32traceutil`` it is sufficient to
101 In order to dump output from WSGI using ``win32traceutil`` it is sufficient to
102 type the following in a console window::
102 type the following in a console window::
103
103
104 python -m win32traceutil
104 python -m win32traceutil
105
105
106 and any exceptions occurring in the WSGI layer and below (i.e. in the Kallithea
106 and any exceptions occurring in the WSGI layer and below (i.e. in the Kallithea
107 application itself) that are uncaught, will be printed here complete with stack
107 application itself) that are uncaught, will be printed here complete with stack
108 traces, making it a lot easier to identify issues.
108 traces, making it a lot easier to identify issues.
@@ -1,291 +1,292 b''
1 .. _installation_win_old:
1 .. _installation_win_old:
2
2
3 ======================================================================
3 ======================================================================
4 Installation and upgrade on Windows (XP/Vista/Server 2003/Server 2008)
4 Installation and upgrade on Windows (XP/Vista/Server 2003/Server 2008)
5 ======================================================================
5 ======================================================================
6
6
7 First-time install
7 First-time install
8 ::::::::::::::::::
8 ::::::::::::::::::
9
9
10 Target OS: Windows XP SP3 32bit English (Clean installation)
10 Target OS: Windows XP SP3 32-bit English (Clean installation)
11 + All Windows Updates until 24-may-2012
11 + All Windows Updates until 24-may-2012
12
12
13 .. note::
13 .. note::
14
14
15 This installation is for 32bit systems, for 64bit windows you might need
15 This installation is for 32-bit systems, for 64-bit Windows you might need
16 to download proper 64bit versions of the different packages(Windows Installer, Win32py extensions)
16 to download proper 64-bit versions of the different packages (Windows Installer, Win32py extensions)
17 plus some extra tweaks.
17 plus some extra tweaks.
18 These extra steps haven been marked as "64bit".
18 These extra steps haven been marked as "64-bit".
19 Tested on Windows Server 2008 R2 SP1, 9-feb-2013.
19 Tested on Windows Server 2008 R2 SP1, 9-feb-2013.
20 If you run into any 64bit related problems, please check these pages:
20 If you run into any 64-bit related problems, please check these pages:
21 - http://blog.victorjabur.com/2011/06/05/compiling-python-2-7-modules-on-windows-32-and-64-using-msvc-2008-express/
21 - http://blog.victorjabur.com/2011/06/05/compiling-python-2-7-modules-on-windows-32-and-64-using-msvc-2008-express/
22 - http://bugs.python.org/issue7511
22 - http://bugs.python.org/issue7511
23
23
24 Step 1 - Install Visual Studio 2008 Express
24 Step 1 - Install Visual Studio 2008 Express
25 -------------------------------------------
25 -------------------------------------------
26
26
27
27
28 Optional: You can also install MinGW, but VS2008 installation is easier.
28 Optional: You can also install MinGW, but VS2008 installation is easier.
29
29
30 Download "Visual C++ 2008 Express Edition with SP1" from:
30 Download "Visual C++ 2008 Express Edition with SP1" from:
31 http://download.microsoft.com/download/E/8/E/E8EEB394-7F42-4963-A2D8-29559B738298/VS2008ExpressWithSP1ENUX1504728.iso
31 http://download.microsoft.com/download/E/8/E/E8EEB394-7F42-4963-A2D8-29559B738298/VS2008ExpressWithSP1ENUX1504728.iso
32 (if not found or relocated, google for "visual studio 2008 express" for updated link. This link was taken from http://stackoverflow.com/questions/15318560/visual-c-2008-express-download-link-dead)
32 (if not found or relocated, google for "visual studio 2008 express" for updated link. This link was taken from http://stackoverflow.com/questions/15318560/visual-c-2008-express-download-link-dead)
33
33
34 You can also download full ISO file for offline installation, just
34 You can also download full ISO file for offline installation, just
35 choose "All - Offline Install ISO image file" in the previous page and
35 choose "All - Offline Install ISO image file" in the previous page and
36 choose "Visual C++ 2008 Express" when installing.
36 choose "Visual C++ 2008 Express" when installing.
37
37
38 .. note::
38 .. note::
39
39
40 Using other versions of Visual Studio will lead to random crashes.
40 Using other versions of Visual Studio will lead to random crashes.
41 You must use Visual Studio 2008!"
41 You must use Visual Studio 2008!"
42
42
43 .. note::
43 .. note::
44
44
45 Silverlight Runtime and SQL Server 2008 Express Edition are not
45 Silverlight Runtime and SQL Server 2008 Express Edition are not
46 required, you can uncheck them
46 required, you can uncheck them
47
47
48 .. note::
48 .. note::
49
49
50 64bit: You also need to install the Microsoft Windows SDK for .NET 3.5 SP1 (.NET 4.0 won't work).
50 64-bit: You also need to install the Microsoft Windows SDK for .NET 3.5 SP1 (.NET 4.0 won't work).
51 Download from: http://www.microsoft.com/en-us/download/details.aspx?id=3138
51 Download from: http://www.microsoft.com/en-us/download/details.aspx?id=3138
52
52
53 .. note::
53 .. note::
54
54
55 64bit: You also need to copy and rename a .bat file to make the Visual C++ compiler work.
55 64-bit: You also need to copy and rename a .bat file to make the Visual C++ compiler work.
56 I am not sure why this is not necessary for 32bit.
56 I am not sure why this is not necessary for 32-bit.
57 Copy C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat to C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\vcvarsamd64.bat
57 Copy C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat to C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\vcvarsamd64.bat
58
58
59
59
60 Step 2 - Install Python
60 Step 2 -- Install Python
61 -----------------------
61 ------------------------
62
62
63 Install Python 2.x.y (x = 6 or 7) x86 version (32bit). DO NOT USE A 3.x version.
63 Install Python 2.x.y (x = 6 or 7) x86 version (32-bit). DO NOT USE A 3.x version.
64 Download Python 2.x.y from:
64 Download Python 2.x.y from:
65 http://www.python.org/download/
65 http://www.python.org/download/
66
66
67 Choose "Windows Installer" (32bit version) not "Windows X86-64
67 Choose "Windows Installer" (32-bit version) not "Windows X86-64
68 Installer". While writing this guide, the latest version was v2.7.3.
68 Installer". While writing this guide, the latest version was v2.7.3.
69 Remember the specific major and minor version installed, because it will
69 Remember the specific major and minor version installed, because it will
70 be needed in the next step. In this case, it is "2.7".
70 be needed in the next step. In this case, it is "2.7".
71
71
72 .. note::
72 .. note::
73
73
74 64bit: Just download and install the 64bit version of python.
74 64-bit: Just download and install the 64-bit version of python.
75
75
76
76 Step 3 - Install Win32py extensions
77 Step 3 -- Install Win32py extensions
77 -----------------------------------
78 ------------------------------------
78
79
79 Download pywin32 from:
80 Download pywin32 from:
80 http://sourceforge.net/projects/pywin32/files/
81 http://sourceforge.net/projects/pywin32/files/
81
82
82 - Click on "pywin32" folder
83 - Click on "pywin32" folder
83 - Click on the first folder (in this case, Build 217, maybe newer when you try)
84 - Click on the first folder (in this case, Build 217, maybe newer when you try)
84 - Choose the file ending with ".win32-py2.x.exe" -> x being the minor
85 - Choose the file ending with ".win32-py2.x.exe" -> x being the minor
85 version of Python you installed (in this case, 7)
86 version of Python you installed (in this case, 7)
86 When writing this guide, the file was:
87 When writing this guide, the file was:
87 http://sourceforge.net/projects/pywin32/files/pywin32/Build%20217/pywin32-217.win32-py2.7.exe/download
88 http://sourceforge.net/projects/pywin32/files/pywin32/Build%20217/pywin32-217.win32-py2.7.exe/download
88
89
89 .. note::
90 .. note::
90
91
91 64bit: Download and install the 64bit version.
92 64-bit: Download and install the 64-bit version.
92 At the time of writing you can find this at:
93 At the time of writing you can find this at:
93 http://sourceforge.net/projects/pywin32/files/pywin32/Build%20218/pywin32-218.win-amd64-py2.7.exe/download
94 http://sourceforge.net/projects/pywin32/files/pywin32/Build%20218/pywin32-218.win-amd64-py2.7.exe/download
94
95
95 Step 4 - Python BIN
96
96 -------------------
97 Step 4 -- Python BIN
98 --------------------
97
99
98 Add Python BIN folder to the path
100 Add Python BIN folder to the path
99
101
100 You have to add the Python folder to the path, you can do it manually
102 You have to add the Python folder to the path, you can do it manually
101 (editing "PATH" environment variable) or using Windows Support Tools
103 (editing "PATH" environment variable) or using Windows Support Tools
102 that came preinstalled in Vista/7 and can be installed in Windows XP.
104 that came preinstalled in Vista/7 and can be installed in Windows XP.
103
105
104 - Using support tools on WINDOWS XP:
106 - Using support tools on WINDOWS XP:
105 If you use Windows XP you can install them using Windows XP CD and
107 If you use Windows XP you can install them using Windows XP CD and
106 navigating to \SUPPORT\TOOLS. There, execute Setup.EXE (not MSI).
108 navigating to \SUPPORT\TOOLS. There, execute Setup.EXE (not MSI).
107 Afterwards, open a CMD and type::
109 Afterwards, open a CMD and type::
108
110
109 SETX PATH "%PATH%;[your-python-path]" -M
111 SETX PATH "%PATH%;[your-python-path]" -M
110
112
111 Close CMD (the path variable will be updated then)
113 Close CMD (the path variable will be updated then)
112
114
113 - Using support tools on WINDOWS Vista/7:
115 - Using support tools on WINDOWS Vista/7:
114
116
115 Open a CMD and type::
117 Open a CMD and type::
116
118
117 SETX PATH "%PATH%;[your-python-path]" /M
119 SETX PATH "%PATH%;[your-python-path]" /M
118
120
119 Please substitute [your-python-path] with your Python installation path.
121 Please substitute [your-python-path] with your Python installation path.
120 Typically: C:\\Python27
122 Typically: C:\\Python27
121
123
122
124
123 Step 5 - Kallithea folder structure
125 Step 5 -- Kallithea folder structure
124 -----------------------------------
126 ------------------------------------
125
127
126 Create a Kallithea folder structure
128 Create a Kallithea folder structure
127
129
128 This is only a example to install Kallithea, you can of course change
130 This is only a example to install Kallithea, you can of course change
129 it. However, this guide will follow the proposed structure, so please
131 it. However, this guide will follow the proposed structure, so please
130 later adapt the paths if you change them. My recommendation is to use
132 later adapt the paths if you change them. My recommendation is to use
131 folders with NO SPACES. But you can try if you are brave...
133 folders with NO SPACES. But you can try if you are brave...
132
134
133 Create the following folder structure::
135 Create the following folder structure::
134
136
135 C:\Kallithea
137 C:\Kallithea
136 C:\Kallithea\Bin
138 C:\Kallithea\Bin
137 C:\Kallithea\Env
139 C:\Kallithea\Env
138 C:\Kallithea\Repos
140 C:\Kallithea\Repos
139
141
140
142
141 Step 6 - Install virtualenv
143 Step 6 -- Install virtualenv
142 ---------------------------
144 ----------------------------
143
145
144 Install Virtual Env for Python
146 Install Virtual Env for Python
145
147
146 Navigate to: http://www.virtualenv.org/en/latest/index.html#installation
148 Navigate to: http://www.virtualenv.org/en/latest/index.html#installation
147 Right click on "virtualenv.py" file and choose "Save link as...".
149 Right click on "virtualenv.py" file and choose "Save link as...".
148 Download to C:\\Kallithea (or whatever you want)
150 Download to C:\\Kallithea (or whatever you want)
149 (the file is located at
151 (the file is located at
150 https://raw.github.com/pypa/virtualenv/master/virtualenv.py)
152 https://raw.github.com/pypa/virtualenv/master/virtualenv.py)
151
153
152 Create a virtual Python environment in C:\\Kallithea\\Env (or similar). To
154 Create a virtual Python environment in C:\\Kallithea\\Env (or similar). To
153 do so, open a CMD (Python Path should be included in Step3), navigate
155 do so, open a CMD (Python Path should be included in Step3), navigate
154 where you downloaded "virtualenv.py", and write::
156 where you downloaded "virtualenv.py", and write::
155
157
156 python virtualenv.py C:\Kallithea\Env
158 python virtualenv.py C:\Kallithea\Env
157
159
158 (--no-site-packages is now the default behaviour of virtualenv, no need
160 (--no-site-packages is now the default behaviour of virtualenv, no need
159 to include it)
161 to include it)
160
162
161
163
162 Step 7 - Install Kallithea
164 Step 7 -- Install Kallithea
163 --------------------------
165 ---------------------------
164
166
165 Finally, install Kallithea
167 Finally, install Kallithea
166
168
167 Close previously opened command prompt/s, and open a Visual Studio 2008
169 Close previously opened command prompt/s, and open a Visual Studio 2008
168 Command Prompt (**IMPORTANT!!**). To do so, go to Start Menu, and then open
170 Command Prompt (**IMPORTANT!!**). To do so, go to Start Menu, and then open
169 "Microsoft Visual C++ 2008 Express Edition" -> "Visual Studio Tools" ->
171 "Microsoft Visual C++ 2008 Express Edition" -> "Visual Studio Tools" ->
170 "Visual Studio 2008 Command Prompt"
172 "Visual Studio 2008 Command Prompt"
171
173
172 .. note::
174 .. note::
173
175
174 64bit: For 64bit you need to modify the shortcut that is used to start the
176 64-bit: For 64-bit you need to modify the shortcut that is used to start the
175 Visual Studio 2008 Command Prompt. Use right-mouse click to open properties.
177 Visual Studio 2008 Command Prompt. Use right-mouse click to open properties.
176
178
177 Change commandline from::
179 Change commandline from::
178
180
179 %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"" x86
181 %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"" x86
180
182
181 to::
183 to::
182
184
183 %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"" amd64
185 %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"" amd64
184
186
185
187
186 In that CMD (loaded with VS2008 PATHs) type::
188 In that CMD (loaded with VS2008 PATHs) type::
187
189
188 cd C:\Kallithea\Env\Scripts (or similar)
190 cd C:\Kallithea\Env\Scripts (or similar)
189 activate
191 activate
190
192
191 The prompt will change into "(Env) C:\\Kallithea\\Env\\Scripts" or similar
193 The prompt will change into "(Env) C:\\Kallithea\\Env\\Scripts" or similar
192 (depending of your folder structure). Then type::
194 (depending of your folder structure). Then type::
193
195
194 pip install kallithea
196 pip install kallithea
195
197
196 (long step, please wait until fully complete)
198 (long step, please wait until fully complete)
197
199
198 Some warnings will appear, don't worry as they are normal.
200 Some warnings will appear, don't worry as they are normal.
199
201
200
202
201 Step 8 - Configuring Kallithea
203 Step 8 -- Configuring Kallithea
202 ------------------------------
204 -------------------------------
203
204
205
205 steps taken from http://packages.python.org/Kallithea/setup.html
206 steps taken from http://packages.python.org/Kallithea/setup.html
206
207
207 You have to use the same Visual Studio 2008 command prompt as Step7, so
208 You have to use the same Visual Studio 2008 command prompt as Step7, so
208 if you closed it reopen it following the same commands (including the
209 if you closed it reopen it following the same commands (including the
209 "activate" one). When ready, just type::
210 "activate" one). When ready, just type::
210
211
211 cd C:\Kallithea\Bin
212 cd C:\Kallithea\Bin
212 paster make-config Kallithea production.ini
213 paster make-config Kallithea production.ini
213
214
214 Then, you must edit production.ini to fit your needs (network address and
215 Then, you must edit production.ini to fit your needs (network address and
215 port, mail settings, database, whatever). I recommend using NotePad++
216 port, mail settings, database, whatever). I recommend using NotePad++
216 (free) or similar text editor, as it handles well the EndOfLine
217 (free) or similar text editor, as it handles well the EndOfLine
217 character differences between Unix and Windows
218 character differences between Unix and Windows
218 (http://notepad-plus-plus.org/)
219 (http://notepad-plus-plus.org/)
219
220
220 For the sake of simplicity lets run it with the default settings. After
221 For the sake of simplicity lets run it with the default settings. After
221 your edits (if any), in the previous Command Prompt, type::
222 your edits (if any), in the previous Command Prompt, type::
222
223
223 paster setup-db production.ini
224 paster setup-db production.ini
224
225
225 (this time a NEW database will be installed, you must follow a different
226 (this time a NEW database will be installed, you must follow a different
226 step to later UPGRADE to a newer Kallithea version)
227 step to later UPGRADE to a newer Kallithea version)
227
228
228 The script will ask you for confirmation about creating a NEW database,
229 The script will ask you for confirmation about creating a NEW database,
229 answer yes (y)
230 answer yes (y)
230 The script will ask you for repository path, answer C:\\Kallithea\\Repos
231 The script will ask you for repository path, answer C:\\Kallithea\\Repos
231 (or similar)
232 (or similar)
232 The script will ask you for admin username and password, answer "admin"
233 The script will ask you for admin username and password, answer "admin"
233 + "123456" (or whatever you want)
234 + "123456" (or whatever you want)
234 The script will ask you for admin mail, answer "admin@xxxx.com" (or
235 The script will ask you for admin mail, answer "admin@xxxx.com" (or
235 whatever you want)
236 whatever you want)
236
237
237 If you make some mistake and the script does not end, don't worry, start
238 If you make some mistake and the script does not end, don't worry, start
238 it again.
239 it again.
239
240
240
241
241 Step 9 - Running Kallithea
242 Step 9 -- Running Kallithea
242 --------------------------
243 ---------------------------
243
244
244
245
245 In the previous command prompt, being in the C:\\Kallithea\\Bin folder,
246 In the previous command prompt, being in the C:\\Kallithea\\Bin folder,
246 just type::
247 just type::
247
248
248 paster serve production.ini
249 paster serve production.ini
249
250
250 Open yout web server, and go to http://127.0.0.1:5000
251 Open yout web server, and go to http://127.0.0.1:5000
251
252
252 It works!! :-)
253 It works!! :-)
253
254
254 Remark:
255 Remark:
255 If it does not work first time, just Ctrl-C the CMD process and start it
256 If it does not work first time, just Ctrl-C the CMD process and start it
256 again. Don't forget the "http://" in Internet Explorer
257 again. Don't forget the "http://" in Internet Explorer
257
258
258
259
259
260
260 What this Guide does not cover:
261 What this Guide does not cover:
261
262
262 - Installing Celery
263 - Installing Celery
263 - Running Kallithea as Windows Service. You can investigate here:
264 - Running Kallithea as Windows Service. You can investigate here:
264
265
265 - http://pypi.python.org/pypi/wsgisvc
266 - http://pypi.python.org/pypi/wsgisvc
266 - http://ryrobes.com/python/running-python-scripts-as-a-windows-service/
267 - http://ryrobes.com/python/running-python-scripts-as-a-windows-service/
267 - http://wiki.pylonshq.com/display/pylonscookbook/How+to+run+Pylons+as+a+Windows+service
268 - http://wiki.pylonshq.com/display/pylonscookbook/How+to+run+Pylons+as+a+Windows+service
268
269
269 - Using Apache. You can investigate here:
270 - Using Apache. You can investigate here:
270
271
271 - https://groups.google.com/group/rhodecode/msg/c433074e813ffdc4
272 - https://groups.google.com/group/rhodecode/msg/c433074e813ffdc4
272
273
273
274
274 Upgrading
275 Upgrading
275 :::::::::
276 :::::::::
276
277
277 Stop running Kallithea
278 Stop running Kallithea
278 Open a CommandPrompt like in Step7 (VS2008 path + activate) and type::
279 Open a CommandPrompt like in Step7 (VS2008 path + activate) and type::
279
280
280 easy_install -U kallithea
281 easy_install -U kallithea
281 cd \Kallithea\Bin
282 cd \Kallithea\Bin
282
283
283 { backup your production.ini file now} ::
284 { backup your production.ini file now} ::
284
285
285 paster make-config Kallithea production.ini
286 paster make-config Kallithea production.ini
286
287
287 (check changes and update your production.ini accordingly) ::
288 (check changes and update your production.ini accordingly) ::
288
289
289 paster upgrade-db production.ini (update database)
290 paster upgrade-db production.ini (update database)
290
291
291 Full steps in http://packages.python.org/Kallithea/upgrade.html
292 Full steps in http://packages.python.org/Kallithea/upgrade.html
@@ -1,795 +1,819 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 so::
12 following command to do so::
13
13
14 paster make-config Kallithea my.ini
14 paster make-config Kallithea my.ini
15
15
16 This will create the file ``my.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.,
17 configuration file contains the various settings for Kallithea, e.g.
18 proxy port, email settings, usage of static files, cache, Celery
18 proxy port, email settings, usage of static files, cache, Celery
19 settings, and logging.
19 settings, and logging.
20
20
21
21
22 Next, you need to create the databases used by Kallithea. It is recommended to
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 database URL in your ``my.ini``
24 default, ensure you properly adjust the database 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 my.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 The setup process can be fully automated, example for lazy::
37 The ``setup-db`` values can also be given on the command line.
38 Example::
38
39
39 paster setup-db my.ini --user=nn --password=secret --email=nn@your.kallithea.server --repos=/srv/repos
40 paster setup-db my.ini --user=nn --password=secret --email=nn@example.org --repos=/srv/repos
40
41
41
42
42 The ``setup-db`` command will create all of the needed tables and an
43 The ``setup-db`` command will create all needed tables and an
43 admin account. When choosing a root path you can either use a new
44 admin account. When choosing a root path you can either use a new
44 empty location, or a location which already contains existing
45 empty location, or a location which already contains existing
45 repositories. If you choose a location which contains existing
46 repositories. If you choose a location which contains existing
46 repositories Kallithea will add all of the repositories at the chosen
47 repositories Kallithea will add all of the repositories at the chosen
47 location to its database. (Note: make sure you specify the correct
48 location to its database. (Note: make sure you specify the correct
48 path to the root).
49 path to the root).
49
50
50 .. note:: the given path for Mercurial_ repositories **must** be write
51 .. note:: the given path for Mercurial_ repositories **must** be write
51 accessible for the application. It's very important since
52 accessible for the application. It's very important since
52 the Kallithea web interface will work without write access,
53 the Kallithea web interface will work without write access,
53 but when trying to do a push it will fail with permission
54 but when trying to do a push it will fail with permission
54 denied errors unless it has write access.
55 denied errors unless it has write access.
55
56
56 You are now ready to use Kallithea. To run it simply execute::
57 You are now ready to use Kallithea. To run it simply execute::
57
58
58 paster serve my.ini
59 paster serve my.ini
59
60
60 - This command runs the Kallithea server. The web app should be available at
61 - This command runs the Kallithea server. The web app should be available at
61 http://127.0.0.1:5000. This ip and port is configurable via the my.ini
62 http://127.0.0.1:5000. The IP address and port is configurable via the
62 file created in previous step
63 configuration file created in the previous step.
63 - Use the admin account you created above when running ``setup-db``
64 - Log in to Kallithea using the admin account created when running ``setup-db``.
64 to login to the web app.
65 - The default permissions on each repository is read, and the owner is admin.
65 - The default permissions on each repository is read, and the owner is admin.
66 Remember to update these if needed.
66 Remember to update these if needed.
67 - In the admin panel you can toggle LDAP, anonymous, and permissions
67 - In the admin panel you can toggle LDAP, anonymous, and permissions
68 settings, as well as edit more advanced options on users and
68 settings, as well as edit more advanced options on users and
69 repositories
69 repositories.
70
70
71
71
72 Extensions
72 Extensions
73 ----------
73 ----------
74
74
75 Optionally users can create an ``rcextensions`` package that extends Kallithea
75 Optionally one can create an ``rcextensions`` package that extends Kallithea
76 functionality. To do this simply execute::
76 functionality.
77 To generate a skeleton extensions package, run::
77
78
78 paster make-rcext my.ini
79 paster make-rcext my.ini
79
80
80 This will create an ``rcextensions`` package next to the specified ``ini`` file.
81 This will create an ``rcextensions`` package next to the specified ``ini`` file.
81 With ``rcextensions`` it's possible to add additional mapping for whoosh,
82 With ``rcextensions`` it's possible to add additional mapping for whoosh,
82 stats and add additional code into the push/pull/create/delete repo hooks,
83 stats and add additional code into the push/pull/create/delete repo hooks,
83 for example for sending signals to build-bots such as Jenkins.
84 for example for sending signals to build-bots such as Jenkins.
84
85
85 See the ``__init__.py`` file inside the generated ``rcextensions`` package
86 See the ``__init__.py`` file inside the generated ``rcextensions`` package
86 for more details.
87 for more details.
87
88
88
89
89 Using Kallithea with SSH
90 Using Kallithea with SSH
90 ------------------------
91 ------------------------
91
92
92 Kallithea currently only hosts repositories using http and https. (The addition
93 Kallithea currently only hosts repositories using http and https. (The addition
93 of ssh hosting is a planned future feature.) However you can easily use ssh in
94 of ssh hosting is a planned future feature.) However you can easily use ssh in
94 parallel with Kallithea. (Repository access via ssh is a standard "out of
95 parallel with Kallithea. (Repository access via ssh is a standard "out of
95 the box" feature of Mercurial_ and you can use this to access any of the
96 the box" feature of Mercurial_ and you can use this to access any of the
96 repositories that Kallithea is hosting. See PublishingRepositories_)
97 repositories that Kallithea is hosting. See PublishingRepositories_)
97
98
98 Kallithea repository structures are kept in directories with the same name
99 Kallithea repository structures are kept in directories with the same name
99 as the project. When using repository groups, each group is a subdirectory.
100 as the project. When using repository groups, each group is a subdirectory.
100 This allows you to easily use ssh for accessing repositories.
101 This allows you to easily use ssh for accessing repositories.
101
102
102 In order to use ssh you need to make sure that your web server and the users'
103 In order to use ssh you need to make sure that your web server and the users'
103 login accounts have the correct permissions set on the appropriate directories.
104 login accounts have the correct permissions set on the appropriate directories.
104
105
105 .. note:: These permissions are independent of any permissions you
106 .. note:: These permissions are independent of any permissions you
106 have set up using the Kallithea web interface.
107 have set up using the Kallithea web interface.
107
108
108 If your main directory (the same as set in Kallithea settings) is for
109 If your main directory (the same as set in Kallithea settings) is for
109 example set to ``/srv/repos`` and the repository you are using is
110 example set to ``/srv/repos`` and the repository you are using is
110 named ``kallithea``, then to clone via ssh you should run::
111 named ``kallithea``, then to clone via ssh you should run::
111
112
112 hg clone ssh://user@server.com//srv/repos/kallithea
113 hg clone ssh://user@server.com//srv/repos/kallithea
113
114
114 Using other external tools such as mercurial-server_ or using ssh key-based
115 Using other external tools such as mercurial-server_ or using ssh key-based
115 authentication is fully supported.
116 authentication is fully supported.
116
117
117 .. note:: In an advanced setup, in order for your ssh access to use
118 .. note:: In an advanced setup, in order for your ssh access to use
118 the same permissions as set up via the Kallithea web
119 the same permissions as set up via the Kallithea web
119 interface, you can create an authentication hook to connect
120 interface, you can create an authentication hook to connect
120 to the Kallithea db and run check functions for permissions
121 to the Kallithea db and run check functions for permissions
121 against that.
122 against that.
122
123
123 Setting up Whoosh full text search
124 Setting up Whoosh full text search
124 ----------------------------------
125 ----------------------------------
125
126
126 The whoosh index can be built by using the paster
127 Kallithea provides full text search of repositories using `Whoosh`__.
127 command ``make-index``. To use ``make-index`` you must specify the configuration
128 file that stores the location of the index. You may specify the location of the
129 repositories (``--repo-location``). If not specified, this value is retrieved
130 from the Kallithea database.
131 It is also possible to specify a comma separated list of
132 repositories (``--index-only``) to build index only on chooses repositories
133 skipping any other found in repos location
134
128
135 You may optionally pass the option ``-f`` to enable a full index rebuild. Without
129 .. __: https://pythonhosted.org/Whoosh/
136 the ``-f`` option, indexing will run always in "incremental" mode.
137
130
138 For an incremental index build use::
131 For an incremental index build, run::
139
132
140 paster make-index my.ini
133 paster make-index my.ini
141
134
142 For a full index rebuild use::
135 For a full index rebuild, run::
143
136
144 paster make-index my.ini -f
137 paster make-index my.ini -f
145
138
139 The ``--repo-location`` option allows the location of the repositories to be overriden;
140 usually, the location is retrieved from the Kallithea database.
146
141
147 Building an index for just selected repositories is possible with such command::
142 The ``--index-only`` option can be used to limit the indexed repositories to a comma-separated list::
148
143
149 paster make-index my.ini --index-only=vcs,kallithea
144 paster make-index my.ini --index-only=vcs,kallithea
150
145
151
146
152 In order to do periodic index builds and keep your index always up to
147 To keep your index up-to-date it is necessary to do periodic index builds;
153 date, it is recommended to use a crontab entry. An example entry
148 for this, it is recommended to use a crontab entry. Example::
154 might look like this::
155
149
156 /path/to/python/bin/paster make-index /path/to/kallithea/my.ini
150 0 3 * * * /path/to/virtualenv/bin/paster make-index /path/to/kallithea/my.ini
157
151
158 When using incremental mode (the default) whoosh will check the last
152 When using incremental mode (the default), Whoosh will check the last
159 modification date of each file and add it to be reindexed if a newer file is
153 modification date of each file and add it to be reindexed if a newer file is
160 available. The indexing daemon checks for any removed files and removes them
154 available. The indexing daemon checks for any removed files and removes them
161 from index.
155 from index.
162
156
163 If you want to rebuild the index from scratch, you can use the ``-f`` flag as above,
157 If you want to rebuild the index from scratch, you can use the ``-f`` flag as above,
164 or in the admin panel you can check the "build from scratch" flag.
158 or in the admin panel you can check the "build from scratch" checkbox.
165
159
166
160
167 Setting up LDAP support
161 Setting up LDAP support
168 -----------------------
162 -----------------------
169
163
170 Kallithea supports LDAP authentication. In order
164 Kallithea supports LDAP authentication. In order
171 to use LDAP, you have to install the python-ldap_ package. This package is
165 to use LDAP, you have to install the python-ldap_ package. This package is
172 available via pypi, so you can install it by running::
166 available via PyPI, so you can install it by running::
173
167
174 pip install python-ldap
168 pip install python-ldap
175
169
176 .. note:: ``python-ldap`` requires some libraries to be installed on
170 .. note:: ``python-ldap`` requires some libraries to be installed on
177 your system, so before installing it check that you have at
171 your system, so before installing it check that you have at
178 least the ``openldap`` and ``sasl`` libraries.
172 least the ``openldap`` and ``sasl`` libraries.
179
173
180 LDAP settings are located in the Admin->LDAP section.
174 LDAP settings are located in the Admin->LDAP section.
181
175
182 Here's a typical LDAP setup::
176 Here's a typical LDAP setup::
183
177
184 Connection settings
178 Connection settings
185 Enable LDAP = checked
179 Enable LDAP = checked
186 Host = host.example.org
180 Host = host.example.org
187 Port = 389
181 Port = 389
188 Account = <account>
182 Account = <account>
189 Password = <password>
183 Password = <password>
190 Connection Security = LDAPS connection
184 Connection Security = LDAPS connection
191 Certificate Checks = DEMAND
185 Certificate Checks = DEMAND
192
186
193 Search settings
187 Search settings
194 Base DN = CN=users,DC=host,DC=example,DC=org
188 Base DN = CN=users,DC=host,DC=example,DC=org
195 LDAP Filter = (&(objectClass=user)(!(objectClass=computer)))
189 LDAP Filter = (&(objectClass=user)(!(objectClass=computer)))
196 LDAP Search Scope = SUBTREE
190 LDAP Search Scope = SUBTREE
197
191
198 Attribute mappings
192 Attribute mappings
199 Login Attribute = uid
193 Login Attribute = uid
200 First Name Attribute = firstName
194 First Name Attribute = firstName
201 Last Name Attribute = lastName
195 Last Name Attribute = lastName
202 Email Attribute = mail
196 Email Attribute = mail
203
197
204 If your user groups are placed in an Organisation Unit (OU) structure, the Search Settings configuration differs::
198 If your user groups are placed in an Organisation Unit (OU) structure, the Search Settings configuration differs::
205
199
206 Search settings
200 Search settings
207 Base DN = DC=host,DC=example,DC=org
201 Base DN = DC=host,DC=example,DC=org
208 LDAP Filter = (&(memberOf=CN=your user group,OU=subunit,OU=unit,DC=host,DC=example,DC=org)(objectClass=user))
202 LDAP Filter = (&(memberOf=CN=your user group,OU=subunit,OU=unit,DC=host,DC=example,DC=org)(objectClass=user))
209 LDAP Search Scope = SUBTREE
203 LDAP Search Scope = SUBTREE
210
204
211 .. _enable_ldap:
205 .. _enable_ldap:
212
206
213 Enable LDAP : required
207 Enable LDAP : required
214 Whether to use LDAP for authenticating users.
208 Whether to use LDAP for authenticating users.
215
209
216 .. _ldap_host:
210 .. _ldap_host:
217
211
218 Host : required
212 Host : required
219 LDAP server hostname or IP address. Can be also a comma separated
213 LDAP server hostname or IP address. Can be also a comma separated
220 list of servers to support LDAP fail-over.
214 list of servers to support LDAP fail-over.
221
215
222 .. _Port:
216 .. _Port:
223
217
224 Port : required
218 Port : required
225 389 for un-encrypted LDAP, 636 for SSL-encrypted LDAP.
219 389 for un-encrypted LDAP, 636 for SSL-encrypted LDAP.
226
220
227 .. _ldap_account:
221 .. _ldap_account:
228
222
229 Account : optional
223 Account : optional
230 Only required if the LDAP server does not allow anonymous browsing of
224 Only required if the LDAP server does not allow anonymous browsing of
231 records. This should be a special account for record browsing. This
225 records. This should be a special account for record browsing. This
232 will require `LDAP Password`_ below.
226 will require `LDAP Password`_ below.
233
227
234 .. _LDAP Password:
228 .. _LDAP Password:
235
229
236 Password : optional
230 Password : optional
237 Only required if the LDAP server does not allow anonymous browsing of
231 Only required if the LDAP server does not allow anonymous browsing of
238 records.
232 records.
239
233
240 .. _Enable LDAPS:
234 .. _Enable LDAPS:
241
235
242 Connection Security : required
236 Connection Security : required
243 Defines the connection to LDAP server
237 Defines the connection to LDAP server
244
238
245 No encryption
239 No encryption
246 Plain non encrypted connection
240 Plain non encrypted connection
247
241
248 LDAPS connection
242 LDAPS connection
249 Enable LDAPS connections. It will likely require `Port`_ to be set to
243 Enable LDAPS connections. It will likely require `Port`_ to be set to
250 a different value (standard LDAPS port is 636). When LDAPS is enabled
244 a different value (standard LDAPS port is 636). When LDAPS is enabled
251 then `Certificate Checks`_ is required.
245 then `Certificate Checks`_ is required.
252
246
253 START_TLS on LDAP connection
247 START_TLS on LDAP connection
254 START TLS connection
248 START TLS connection
255
249
256 .. _Certificate Checks:
250 .. _Certificate Checks:
257
251
258 Certificate Checks : optional
252 Certificate Checks : optional
259 How SSL certificates verification is handled - this is only useful when
253 How SSL certificates verification is handled - this is only useful when
260 `Enable LDAPS`_ is enabled. Only DEMAND or HARD offer full SSL security
254 `Enable LDAPS`_ is enabled. Only DEMAND or HARD offer full SSL security
261 while the other options are susceptible to man-in-the-middle attacks. SSL
255 while the other options are susceptible to man-in-the-middle attacks. SSL
262 certificates can be installed to /etc/openldap/cacerts so that the
256 certificates can be installed to /etc/openldap/cacerts so that the
263 DEMAND or HARD options can be used with self-signed certificates or
257 DEMAND or HARD options can be used with self-signed certificates or
264 certificates that do not have traceable certificates of authority.
258 certificates that do not have traceable certificates of authority.
265
259
266 NEVER
260 NEVER
267 A serve certificate will never be requested or checked.
261 A serve certificate will never be requested or checked.
268
262
269 ALLOW
263 ALLOW
270 A server certificate is requested. Failure to provide a
264 A server certificate is requested. Failure to provide a
271 certificate or providing a bad certificate will not terminate the
265 certificate or providing a bad certificate will not terminate the
272 session.
266 session.
273
267
274 TRY
268 TRY
275 A server certificate is requested. Failure to provide a
269 A server certificate is requested. Failure to provide a
276 certificate does not halt the session; providing a bad certificate
270 certificate does not halt the session; providing a bad certificate
277 halts the session.
271 halts the session.
278
272
279 DEMAND
273 DEMAND
280 A server certificate is requested and must be provided and
274 A server certificate is requested and must be provided and
281 authenticated for the session to proceed.
275 authenticated for the session to proceed.
282
276
283 HARD
277 HARD
284 The same as DEMAND.
278 The same as DEMAND.
285
279
286 .. _Base DN:
280 .. _Base DN:
287
281
288 Base DN : required
282 Base DN : required
289 The Distinguished Name (DN) where searches for users will be performed.
283 The Distinguished Name (DN) where searches for users will be performed.
290 Searches can be controlled by `LDAP Filter`_ and `LDAP Search Scope`_.
284 Searches can be controlled by `LDAP Filter`_ and `LDAP Search Scope`_.
291
285
292 .. _LDAP Filter:
286 .. _LDAP Filter:
293
287
294 LDAP Filter : optional
288 LDAP Filter : optional
295 A LDAP filter defined by RFC 2254. This is more useful when `LDAP
289 A LDAP filter defined by RFC 2254. This is more useful when `LDAP
296 Search Scope`_ is set to SUBTREE. The filter is useful for limiting
290 Search Scope`_ is set to SUBTREE. The filter is useful for limiting
297 which LDAP objects are identified as representing Users for
291 which LDAP objects are identified as representing Users for
298 authentication. The filter is augmented by `Login Attribute`_ below.
292 authentication. The filter is augmented by `Login Attribute`_ below.
299 This can commonly be left blank.
293 This can commonly be left blank.
300
294
301 .. _LDAP Search Scope:
295 .. _LDAP Search Scope:
302
296
303 LDAP Search Scope : required
297 LDAP Search Scope : required
304 This limits how far LDAP will search for a matching object.
298 This limits how far LDAP will search for a matching object.
305
299
306 BASE
300 BASE
307 Only allows searching of `Base DN`_ and is usually not what you
301 Only allows searching of `Base DN`_ and is usually not what you
308 want.
302 want.
309
303
310 ONELEVEL
304 ONELEVEL
311 Searches all entries under `Base DN`_, but not Base DN itself.
305 Searches all entries under `Base DN`_, but not Base DN itself.
312
306
313 SUBTREE
307 SUBTREE
314 Searches all entries below `Base DN`_, but not Base DN itself.
308 Searches all entries below `Base DN`_, but not Base DN itself.
315 When using SUBTREE `LDAP Filter`_ is useful to limit object
309 When using SUBTREE `LDAP Filter`_ is useful to limit object
316 location.
310 location.
317
311
318 .. _Login Attribute:
312 .. _Login Attribute:
319
313
320 Login Attribute : required
314 Login Attribute : required
321 The LDAP record attribute that will be matched as the USERNAME or
315 The LDAP record attribute that will be matched as the USERNAME or
322 ACCOUNT used to connect to Kallithea. This will be added to `LDAP
316 ACCOUNT used to connect to Kallithea. This will be added to `LDAP
323 Filter`_ for locating the User object. If `LDAP Filter`_ is specified as
317 Filter`_ for locating the User object. If `LDAP Filter`_ is specified as
324 "LDAPFILTER", `Login Attribute`_ is specified as "uid" and the user has
318 "LDAPFILTER", `Login Attribute`_ is specified as "uid" and the user has
325 connected as "jsmith" then the `LDAP Filter`_ will be augmented as below
319 connected as "jsmith" then the `LDAP Filter`_ will be augmented as below
326 ::
320 ::
327
321
328 (&(LDAPFILTER)(uid=jsmith))
322 (&(LDAPFILTER)(uid=jsmith))
329
323
330 .. _ldap_attr_firstname:
324 .. _ldap_attr_firstname:
331
325
332 First Name Attribute : required
326 First Name Attribute : required
333 The LDAP record attribute which represents the user's first name.
327 The LDAP record attribute which represents the user's first name.
334
328
335 .. _ldap_attr_lastname:
329 .. _ldap_attr_lastname:
336
330
337 Last Name Attribute : required
331 Last Name Attribute : required
338 The LDAP record attribute which represents the user's last name.
332 The LDAP record attribute which represents the user's last name.
339
333
340 .. _ldap_attr_email:
334 .. _ldap_attr_email:
341
335
342 Email Attribute : required
336 Email Attribute : required
343 The LDAP record attribute which represents the user's email address.
337 The LDAP record attribute which represents the user's email address.
344
338
345 If all data are entered correctly, and python-ldap_ is properly installed
339 If all data are entered correctly, and python-ldap_ is properly installed
346 users should be granted access to Kallithea with LDAP accounts. At this
340 users should be granted access to Kallithea with LDAP accounts. At this
347 time user information is copied from LDAP into the Kallithea user database.
341 time user information is copied from LDAP into the Kallithea user database.
348 This means that updates of an LDAP user object may not be reflected as a
342 This means that updates of an LDAP user object may not be reflected as a
349 user update in Kallithea.
343 user update in Kallithea.
350
344
351 If You have problems with LDAP access and believe You entered correct
345 If You have problems with LDAP access and believe You entered correct
352 information check out the Kallithea logs, any error messages sent from LDAP
346 information check out the Kallithea logs, any error messages sent from LDAP
353 will be saved there.
347 will be saved there.
354
348
355 Active Directory
349 Active Directory
356 ''''''''''''''''
350 ''''''''''''''''
357
351
358 Kallithea can use Microsoft Active Directory for user authentication. This
352 Kallithea can use Microsoft Active Directory for user authentication. This
359 is done through an LDAP or LDAPS connection to Active Directory. The
353 is done through an LDAP or LDAPS connection to Active Directory. The
360 following LDAP configuration settings are typical for using Active
354 following LDAP configuration settings are typical for using Active
361 Directory ::
355 Directory ::
362
356
363 Base DN = OU=SBSUsers,OU=Users,OU=MyBusiness,DC=v3sys,DC=local
357 Base DN = OU=SBSUsers,OU=Users,OU=MyBusiness,DC=v3sys,DC=local
364 Login Attribute = sAMAccountName
358 Login Attribute = sAMAccountName
365 First Name Attribute = givenName
359 First Name Attribute = givenName
366 Last Name Attribute = sn
360 Last Name Attribute = sn
367 Email Attribute = mail
361 Email Attribute = mail
368
362
369 All other LDAP settings will likely be site-specific and should be
363 All other LDAP settings will likely be site-specific and should be
370 appropriately configured.
364 appropriately configured.
371
365
372
366
373 Authentication by container or reverse-proxy
367 Authentication by container or reverse-proxy
374 --------------------------------------------
368 --------------------------------------------
375
369
376 Kallithea supports delegating the authentication
370 Kallithea supports delegating the authentication
377 of users to its WSGI container, or to a reverse-proxy server through which all
371 of users to its WSGI container, or to a reverse-proxy server through which all
378 clients access the application.
372 clients access the application.
379
373
380 When these authentication methods are enabled in Kallithea, it uses the
374 When these authentication methods are enabled in Kallithea, it uses the
381 username that the container/proxy (Apache/Nginx/etc) authenticated and doesn't
375 username that the container/proxy (Apache or Nginx, etc.) provides and doesn't
382 perform the authentication itself. The authorization, however, is still done by
376 perform the authentication itself. The authorization, however, is still done by
383 Kallithea according to its settings.
377 Kallithea according to its settings.
384
378
385 When a user logs in for the first time using these authentication methods,
379 When a user logs in for the first time using these authentication methods,
386 a matching user account is created in Kallithea with default permissions. An
380 a matching user account is created in Kallithea with default permissions. An
387 administrator can then modify it using Kallithea's admin interface.
381 administrator can then modify it using Kallithea's admin interface.
382
388 It's also possible for an administrator to create accounts and configure their
383 It's also possible for an administrator to create accounts and configure their
389 permissions before the user logs in for the first time.
384 permissions before the user logs in for the first time, using the :ref:`create-user` API.
390
385
391
386
392 Container-based authentication
387 Container-based authentication
393 ''''''''''''''''''''''''''''''
388 ''''''''''''''''''''''''''''''
394
389
395 In a container-based authentication setup, Kallithea reads the user name from
390 In a container-based authentication setup, Kallithea reads the user name from
396 the ``REMOTE_USER`` server variable provided by the WSGI container.
391 the ``REMOTE_USER`` server variable provided by the WSGI container.
397
392
398 After setting up your container (see `Apache's WSGI config`_), you'd need
393 After setting up your container (see `Apache with mod_wsgi`_), you'll need
399 to configure it to require authentication on the location configured for
394 to configure it to require authentication on the location configured for
400 Kallithea.
395 Kallithea.
401
396
402
397
403 Proxy pass-through authentication
398 Proxy pass-through authentication
404 '''''''''''''''''''''''''''''''''
399 '''''''''''''''''''''''''''''''''
405
400
406 In a proxy pass-through authentication setup, Kallithea reads the user name
401 In a proxy pass-through authentication setup, Kallithea reads the user name
407 from the ``X-Forwarded-User`` request header, which should be configured to be
402 from the ``X-Forwarded-User`` request header, which should be configured to be
408 sent by the reverse-proxy server.
403 sent by the reverse-proxy server.
409
404
410 After setting up your proxy solution (see `Apache virtual host reverse proxy example`_,
405 After setting up your proxy solution (see `Apache virtual host reverse proxy example`_,
411 `Apache as subdirectory`_ or `Nginx virtual host example`_), you'd need to
406 `Apache as subdirectory`_ or `Nginx virtual host example`_), you'll need to
412 configure the authentication and add the username in a request header named
407 configure the authentication and add the username in a request header named
413 ``X-Forwarded-User``.
408 ``X-Forwarded-User``.
414
409
415 For example, the following config section for Apache sets a subdirectory in a
410 For example, the following config section for Apache sets a subdirectory in a
416 reverse-proxy setup with basic auth::
411 reverse-proxy setup with basic auth:
412
413 .. code-block:: apache
417
414
418 <Location /<someprefix> >
415 <Location /someprefix>
419 ProxyPass http://127.0.0.1:5000/<someprefix>
416 ProxyPass http://127.0.0.1:5000/someprefix
420 ProxyPassReverse http://127.0.0.1:5000/<someprefix>
417 ProxyPassReverse http://127.0.0.1:5000/someprefix
421 SetEnvIf X-Url-Scheme https HTTPS=1
418 SetEnvIf X-Url-Scheme https HTTPS=1
422
419
423 AuthType Basic
420 AuthType Basic
424 AuthName "Kallithea authentication"
421 AuthName "Kallithea authentication"
425 AuthUserFile /srv/kallithea/.htpasswd
422 AuthUserFile /srv/kallithea/.htpasswd
426 require valid-user
423 Require valid-user
427
424
428 RequestHeader unset X-Forwarded-User
425 RequestHeader unset X-Forwarded-User
429
426
430 RewriteEngine On
427 RewriteEngine On
431 RewriteCond %{LA-U:REMOTE_USER} (.+)
428 RewriteCond %{LA-U:REMOTE_USER} (.+)
432 RewriteRule .* - [E=RU:%1]
429 RewriteRule .* - [E=RU:%1]
433 RequestHeader set X-Forwarded-User %{RU}e
430 RequestHeader set X-Forwarded-User %{RU}e
434 </Location>
431 </Location>
435
432
436
433
437 .. note::
434 .. note::
438 If you enable proxy pass-through authentication, make sure your server is
435 If you enable proxy pass-through authentication, make sure your server is
439 only accessible through the proxy. Otherwise, any client would be able to
436 only accessible through the proxy. Otherwise, any client would be able to
440 forge the authentication header and could effectively become authenticated
437 forge the authentication header and could effectively become authenticated
441 using any account of their liking.
438 using any account of their liking.
442
439
443
440
444 Integration with issue trackers
441 Integration with issue trackers
445 -------------------------------
442 -------------------------------
446
443
447 Kallithea provides a simple integration with issue trackers. It's possible
444 Kallithea provides a simple integration with issue trackers. It's possible
448 to define a regular expression that will fetch an issue id stored in a commit
445 to define a regular expression that will match an issue ID in commit messages,
449 messages and replace that with a URL to the issue. To enable this simply
446 and have that replaced with a URL to the issue. To enable this simply
450 uncomment the following variables in the ini file::
447 uncomment the following variables in the ini file::
451
448
452 issue_pat = (?:^#|\s#)(\w+)
449 issue_pat = (?:^#|\s#)(\w+)
453 issue_server_link = https://myissueserver.com/{repo}/issue/{id}
450 issue_server_link = https://myissueserver.com/{repo}/issue/{id}
454 issue_prefix = #
451 issue_prefix = #
455
452
456 ``issue_pat`` is the regular expression describing which strings in
453 ``issue_pat`` is the regular expression describing which strings in
457 commit messages will be treated as issue references. A match group in
454 commit messages will be treated as issue references. A match group in
458 parentheses should be used to specify the actual issue id.
455 parentheses should be used to specify the actual issue id.
459
456
460 The default expression matches issues in the format ``#<number>``, e.g., ``#300``.
457 The default expression matches issues in the format ``#<number>``, e.g., ``#300``.
461
458
462 Matched issues are replaced with the link specified as
459 Matched issue references are replaced with the link specified in
463 ``issue_server_link`` ``{id}`` is replaced with issue id, and
460 ``issue_server_link``. ``{id}`` is replaced with the issue ID, and
464 ``{repo}`` with the repository name. Since the # is stripped away,
461 ``{repo}`` with the repository name. Since the # is stripped away,
465 ``issue_prefix`` is prepended to the link text. ``issue_prefix`` doesn't
462 ``issue_prefix`` is prepended to the link text. ``issue_prefix`` doesn't
466 necessarily need to be ``#``: if you set issue prefix to ``ISSUE-`` this will
463 necessarily need to be ``#``: if you set issue prefix to ``ISSUE-`` this will
467 generate a URL in the format::
464 generate a URL in the format:
465
466 .. code-block:: html
468
467
469 <a href="https://myissueserver.com/example_repo/issue/300">ISSUE-300</a>
468 <a href="https://myissueserver.com/example_repo/issue/300">ISSUE-300</a>
470
469
471 If needed, more than one pattern can be specified by appending a unique suffix to
470 If needed, more than one pattern can be specified by appending a unique suffix to
472 the variables. For example::
471 the variables. For example::
473
472
474 issue_pat_wiki = (?:wiki-)(.+)
473 issue_pat_wiki = (?:wiki-)(.+)
475 issue_server_link_wiki = https://mywiki.com/{id}
474 issue_server_link_wiki = https://mywiki.com/{id}
476 issue_prefix_wiki = WIKI-
475 issue_prefix_wiki = WIKI-
477
476
478 With these settings, wiki pages can be referenced as wiki-some-id, and every
477 With these settings, wiki pages can be referenced as wiki-some-id, and every
479 such reference will be transformed into::
478 such reference will be transformed into:
479
480 .. code-block:: html
480
481
481 <a href="https://mywiki.com/some-id">WIKI-some-id</a>
482 <a href="https://mywiki.com/some-id">WIKI-some-id</a>
482
483
483
484
484 Hook management
485 Hook management
485 ---------------
486 ---------------
486
487
487 Hooks can be managed in similar way to that used in ``.hgrc`` files.
488 Hooks can be managed in similar way to that used in ``.hgrc`` files.
488 To access hooks setting click `advanced setup` in the `Hooks` section
489 To access hooks setting click `advanced setup` in the `Hooks` section
489 of Mercurial Settings in Admin.
490 of Mercurial Settings in Admin.
490
491
491 There are four built in hooks that cannot be changed (only enabled/disabled by
492 The built-in hooks cannot be modified, though they can be enabled or disabled in the *VCS* section.
492 checkboxes in the previous section).
493
493 To add another custom hook simply fill in the first section with
494 To add another custom hook simply fill in the first textbox with
494 ``<name>.<hook_type>`` and the second one with hook path. Example hooks
495 ``<name>.<hook_type>`` and the second with the hook path. Example hooks
495 can be found in ``kallithea.lib.hooks``.
496 can be found in ``kallithea.lib.hooks``.
496
497
497
498
498 Changing default encoding
499 Changing default encoding
499 -------------------------
500 -------------------------
500
501
501 By default, Kallithea uses UTF-8 encoding.
502 By default, Kallithea uses UTF-8 encoding.
502 This is configurable as ``default_encoding`` in the .ini file.
503 This is configurable as ``default_encoding`` in the .ini file.
503 This affects many parts in Kallithea including user names, filenames, and
504 This affects many parts in Kallithea including user names, filenames, and
504 encoding of commit messages. In addition Kallithea can detect if the ``chardet``
505 encoding of commit messages. In addition Kallithea can detect if the ``chardet``
505 library is installed. If ``chardet`` is detected Kallithea will fallback to it
506 library is installed. If ``chardet`` is detected Kallithea will fallback to it
506 when there are encode/decode errors.
507 when there are encode/decode errors.
507
508
508
509
509 Celery configuration
510 Celery configuration
510 --------------------
511 --------------------
511
512
512 Kallithea can use the distributed task queue system Celery_ to run tasks like
513 Kallithea can use the distributed task queue system Celery_ to run tasks like
513 cloning repositories or sending emails.
514 cloning repositories or sending emails.
514
515
515 Kallithea will in most setups work perfectly fine out of the box (without
516 Kallithea will in most setups work perfectly fine out of the box (without
516 Celery), executing all tasks in the web server process. Some tasks can however
517 Celery), executing all tasks in the web server process. Some tasks can however
517 take some time to run and it can be better to run such tasks asynchronously in
518 take some time to run and it can be better to run such tasks asynchronously in
518 a separate process so the web server can focus on serving web requests.
519 a separate process so the web server can focus on serving web requests.
519
520
520 For installation and configuration of Celery, see the `Celery documentation`_.
521 For installation and configuration of Celery, see the `Celery documentation`_.
521 Note that Celery requires a message broker service like RabbitMQ_ (recommended)
522 Note that Celery requires a message broker service like RabbitMQ_ (recommended)
522 or Redis_.
523 or Redis_.
523
524
524 The use of Celery is configured in the Kallithea ini configuration file.
525 The use of Celery is configured in the Kallithea ini configuration file.
525 To enable it, simply set::
526 To enable it, simply set::
526
527
527 use_celery = true
528 use_celery = true
528
529
529 and add or change the ``celery.*`` and ``broker.*`` configuration variables.
530 and add or change the ``celery.*`` and ``broker.*`` configuration variables.
530
531
531 Remember that the ini files use the format with '.' and not with '_' like
532 Remember that the ini files use the format with '.' and not with '_' like
532 Celery. So for example setting `BROKER_HOST` in Celery means setting
533 Celery. So for example setting `BROKER_HOST` in Celery means setting
533 `broker.host` in the configuration file.
534 `broker.host` in the configuration file.
534
535
535 To start the Celery process, run::
536 To start the Celery process, run::
536
537
537 paster celeryd <configfile.ini>
538 paster celeryd <configfile.ini>
538
539
539
540
540 .. note::
541 .. note::
541 Make sure you run this command from the same virtualenv, and with the same
542 Make sure you run this command from the same virtualenv, and with the same
542 user that Kallithea runs.
543 user that Kallithea runs.
543
544
545
544 HTTPS support
546 HTTPS support
545 -------------
547 -------------
546
548
547 Kallithea will by default generate URLs based on the WSGI environment.
549 Kallithea will by default generate URLs based on the WSGI environment.
548
550
549 Alternatively, you can use some special configuration settings to control
551 Alternatively, you can use some special configuration settings to control
550 directly which scheme/protocol Kallithea will use when generating URLs:
552 directly which scheme/protocol Kallithea will use when generating URLs:
551
553
552 - With ``https_fixup = true``, the scheme will be taken from the ``HTTP_X_URL_SCHEME``,
554 - With ``https_fixup = true``, the scheme will be taken from the
553 ``HTTP_X_FORWARDED_SCHEME`` or ``HTTP_X_FORWARDED_PROTO HTTP`` header (default ``http``).
555 ``X-Url-Scheme``, ``X-Forwarded-Scheme`` or ``X-Forwarded-Proto`` HTTP header
556 (default ``http``).
554 - With ``force_https = true`` the default will be ``https``.
557 - With ``force_https = true`` the default will be ``https``.
555 - With ``use_htsts = true``, it will set ``Strict-Transport-Security`` when using https.
558 - With ``use_htsts = true``, Kallithea will set ``Strict-Transport-Security`` when using https.
559
556
560
557 Nginx virtual host example
561 Nginx virtual host example
558 --------------------------
562 --------------------------
559
563
560 Sample config for nginx using proxy::
564 Sample config for Nginx using proxy:
565
566 .. code-block:: nginx
561
567
562 upstream kallithea {
568 upstream kallithea {
563 server 127.0.0.1:5000;
569 server 127.0.0.1:5000;
564 # add more instances for load balancing
570 # add more instances for load balancing
565 #server 127.0.0.1:5001;
571 #server 127.0.0.1:5001;
566 #server 127.0.0.1:5002;
572 #server 127.0.0.1:5002;
567 }
573 }
568
574
569 ## gist alias
575 ## gist alias
570 server {
576 server {
571 listen 443;
577 listen 443;
572 server_name gist.myserver.com;
578 server_name gist.myserver.com;
573 access_log /var/log/nginx/gist.access.log;
579 access_log /var/log/nginx/gist.access.log;
574 error_log /var/log/nginx/gist.error.log;
580 error_log /var/log/nginx/gist.error.log;
575
581
576 ssl on;
582 ssl on;
577 ssl_certificate gist.your.kallithea.server.crt;
583 ssl_certificate gist.your.kallithea.server.crt;
578 ssl_certificate_key gist.your.kallithea.server.key;
584 ssl_certificate_key gist.your.kallithea.server.key;
579
585
580 ssl_session_timeout 5m;
586 ssl_session_timeout 5m;
581
587
582 ssl_protocols SSLv3 TLSv1;
588 ssl_protocols SSLv3 TLSv1;
583 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;
589 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;
584 ssl_prefer_server_ciphers on;
590 ssl_prefer_server_ciphers on;
585
591
586 rewrite ^/(.+)$ https://your.kallithea.server/_admin/gists/$1;
592 rewrite ^/(.+)$ https://your.kallithea.server/_admin/gists/$1;
587 rewrite (.*) https://your.kallithea.server/_admin/gists;
593 rewrite (.*) https://your.kallithea.server/_admin/gists;
588 }
594 }
589
595
590 server {
596 server {
591 listen 443;
597 listen 443;
592 server_name your.kallithea.server;
598 server_name your.kallithea.server;
593 access_log /var/log/nginx/kallithea.access.log;
599 access_log /var/log/nginx/kallithea.access.log;
594 error_log /var/log/nginx/kallithea.error.log;
600 error_log /var/log/nginx/kallithea.error.log;
595
601
596 ssl on;
602 ssl on;
597 ssl_certificate your.kallithea.server.crt;
603 ssl_certificate your.kallithea.server.crt;
598 ssl_certificate_key your.kallithea.server.key;
604 ssl_certificate_key your.kallithea.server.key;
599
605
600 ssl_session_timeout 5m;
606 ssl_session_timeout 5m;
601
607
602 ssl_protocols SSLv3 TLSv1;
608 ssl_protocols SSLv3 TLSv1;
603 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;
609 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;
604 ssl_prefer_server_ciphers on;
610 ssl_prefer_server_ciphers on;
605
611
606 ## uncomment root directive if you want to serve static files by nginx
612 ## uncomment root directive if you want to serve static files by nginx
607 ## requires static_files = false in .ini file
613 ## requires static_files = false in .ini file
608 #root /path/to/installation/kallithea/public;
614 #root /path/to/installation/kallithea/public;
609 include /etc/nginx/proxy.conf;
615 include /etc/nginx/proxy.conf;
610 location / {
616 location / {
611 try_files $uri @kallithea;
617 try_files $uri @kallithea;
612 }
618 }
613
619
614 location @kallithea {
620 location @kallithea {
615 proxy_pass http://kallithea;
621 proxy_pass http://kallithea;
616 }
622 }
617
623
618 }
624 }
619
625
620 Here's the proxy.conf. It's tuned so it will not timeout on long
626 Here's the proxy.conf. It's tuned so it will not timeout on long
621 pushes or large pushes::
627 pushes or large pushes::
622
628
623 proxy_redirect off;
629 proxy_redirect off;
624 proxy_set_header Host $host;
630 proxy_set_header Host $host;
625 ## needed for container auth
631 ## needed for container auth
626 #proxy_set_header REMOTE_USER $remote_user;
632 #proxy_set_header REMOTE_USER $remote_user;
627 #proxy_set_header X-Forwarded-User $remote_user;
633 #proxy_set_header X-Forwarded-User $remote_user;
628 proxy_set_header X-Url-Scheme $scheme;
634 proxy_set_header X-Url-Scheme $scheme;
629 proxy_set_header X-Host $http_host;
635 proxy_set_header X-Host $http_host;
630 proxy_set_header X-Real-IP $remote_addr;
636 proxy_set_header X-Real-IP $remote_addr;
631 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
637 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
632 proxy_set_header Proxy-host $proxy_host;
638 proxy_set_header Proxy-host $proxy_host;
633 proxy_buffering off;
639 proxy_buffering off;
634 proxy_connect_timeout 7200;
640 proxy_connect_timeout 7200;
635 proxy_send_timeout 7200;
641 proxy_send_timeout 7200;
636 proxy_read_timeout 7200;
642 proxy_read_timeout 7200;
637 proxy_buffers 8 32k;
643 proxy_buffers 8 32k;
638 client_max_body_size 1024m;
644 client_max_body_size 1024m;
639 client_body_buffer_size 128k;
645 client_body_buffer_size 128k;
640 large_client_header_buffers 8 64k;
646 large_client_header_buffers 8 64k;
641
647
642
648
643 Apache virtual host reverse proxy example
649 Apache virtual host reverse proxy example
644 -----------------------------------------
650 -----------------------------------------
645
651
646 Here is a sample configuration file for apache using proxy::
652 Here is a sample configuration file for Apache using proxy:
653
654 .. code-block:: apache
647
655
648 <VirtualHost *:80>
656 <VirtualHost *:80>
649 ServerName hg.myserver.com
657 ServerName hg.myserver.com
650 ServerAlias hg.myserver.com
658 ServerAlias hg.myserver.com
651
659
652 <Proxy *>
660 <Proxy *>
653 Order allow,deny
661 # For Apache 2.4 and later:
654 Allow from all
662 Require all granted
663
664 # For Apache 2.2 and earlier, instead use:
665 # Order allow,deny
666 # Allow from all
655 </Proxy>
667 </Proxy>
656
668
657 #important !
669 #important !
658 #Directive to properly generate url (clone url) for pylons
670 #Directive to properly generate url (clone url) for pylons
659 ProxyPreserveHost On
671 ProxyPreserveHost On
660
672
661 #kallithea instance
673 #kallithea instance
662 ProxyPass / http://127.0.0.1:5000/
674 ProxyPass / http://127.0.0.1:5000/
663 ProxyPassReverse / http://127.0.0.1:5000/
675 ProxyPassReverse / http://127.0.0.1:5000/
664
676
665 #to enable https use line below
677 #to enable https use line below
666 #SetEnvIf X-Url-Scheme https HTTPS=1
678 #SetEnvIf X-Url-Scheme https HTTPS=1
667
668 </VirtualHost>
679 </VirtualHost>
669
680
670
681
671 Additional tutorial
682 Additional tutorial
672 http://pylonsbook.com/en/1.1/deployment.html#using-apache-to-proxy-requests-to-pylons
683 http://pylonsbook.com/en/1.1/deployment.html#using-apache-to-proxy-requests-to-pylons
673
684
674
685
675 Apache as subdirectory
686 Apache as subdirectory
676 ----------------------
687 ----------------------
677
688
678 Apache subdirectory part::
689 Apache subdirectory part:
690
691 .. code-block:: apache
679
692
680 <Location /<someprefix> >
693 <Location /<someprefix> >
681 ProxyPass http://127.0.0.1:5000/<someprefix>
694 ProxyPass http://127.0.0.1:5000/<someprefix>
682 ProxyPassReverse http://127.0.0.1:5000/<someprefix>
695 ProxyPassReverse http://127.0.0.1:5000/<someprefix>
683 SetEnvIf X-Url-Scheme https HTTPS=1
696 SetEnvIf X-Url-Scheme https HTTPS=1
684 </Location>
697 </Location>
685
698
686 Besides the regular apache setup you will need to add the following line
699 Besides the regular apache setup you will need to add the following line
687 into ``[app:main]`` section of your .ini file::
700 into ``[app:main]`` section of your .ini file::
688
701
689 filter-with = proxy-prefix
702 filter-with = proxy-prefix
690
703
691 Add the following at the end of the .ini file::
704 Add the following at the end of the .ini file::
692
705
693 [filter:proxy-prefix]
706 [filter:proxy-prefix]
694 use = egg:PasteDeploy#prefix
707 use = egg:PasteDeploy#prefix
695 prefix = /<someprefix>
708 prefix = /<someprefix>
696
709
697
710
698 then change ``<someprefix>`` into your chosen prefix
711 then change ``<someprefix>`` into your chosen prefix
699
712
700 Apache's WSGI config
713 Apache with mod_wsgi
701 --------------------
714 --------------------
702
715
703 Alternatively, Kallithea can be set up with Apache under mod_wsgi. For
716 Alternatively, Kallithea can be set up with Apache under mod_wsgi. For
704 that, you'll need to:
717 that, you'll need to:
705
718
706 - Install mod_wsgi. If using a Debian-based distro, you can install
719 - Install mod_wsgi. If using a Debian-based distro, you can install
707 the package libapache2-mod-wsgi::
720 the package libapache2-mod-wsgi::
708
721
709 aptitude install libapache2-mod-wsgi
722 aptitude install libapache2-mod-wsgi
710
723
711 - Enable mod_wsgi::
724 - Enable mod_wsgi::
712
725
713 a2enmod wsgi
726 a2enmod wsgi
714
727
715 - Create a wsgi dispatch script, like the one below. Make sure you
728 - Create a wsgi dispatch script, like the one below. Make sure you
716 check that the paths correctly point to where you installed Kallithea
729 check that the paths correctly point to where you installed Kallithea
717 and its Python Virtual Environment.
730 and its Python Virtual Environment.
718 - Enable the ``WSGIScriptAlias`` directive for the WSGI dispatch script,
731 - Enable the ``WSGIScriptAlias`` directive for the WSGI dispatch script,
719 as in the following example. Once again, check the paths are
732 as in the following example. Once again, check the paths are
720 correctly specified.
733 correctly specified.
721
734
722 Here is a sample excerpt from an Apache Virtual Host configuration file::
735 Here is a sample excerpt from an Apache Virtual Host configuration file:
736
737
738 .. code-block:: apache
723
739
724 WSGIDaemonProcess kallithea \
740 WSGIDaemonProcess kallithea \
725 processes=1 threads=4 \
741 processes=1 threads=4 \
726 python-path=/srv/kallithea/pyenv/lib/python2.7/site-packages
742 python-path=/srv/kallithea/pyenv/lib/python2.7/site-packages
727 WSGIScriptAlias / /srv/kallithea/dispatch.wsgi
743 WSGIScriptAlias / /srv/kallithea/dispatch.wsgi
728 WSGIPassAuthorization On
744 WSGIPassAuthorization On
729
745
730 Or if using a dispatcher WSGI script with proper virtualenv activation::
746 Or if using a dispatcher WSGI script with proper virtualenv activation:
747
748 .. code-block:: apache
731
749
732 WSGIDaemonProcess kallithea processes=1 threads=4
750 WSGIDaemonProcess kallithea processes=1 threads=4
733 WSGIScriptAlias / /srv/kallithea/dispatch.wsgi
751 WSGIScriptAlias / /srv/kallithea/dispatch.wsgi
734 WSGIPassAuthorization On
752 WSGIPassAuthorization On
735
753
736
754
737 .. note::
755 .. note::
738 When running apache as root, please make sure it doesn't run Kallithea as
756 When running apache as root, please make sure it doesn't run Kallithea as
739 root, for examply by adding: ``user=www-data group=www-data`` to the configuration.
757 root, for examply by adding: ``user=www-data group=www-data`` to the configuration.
740
758
741 .. note::
759 .. note::
742 If running Kallithea in multiprocess mode,
760 If running Kallithea in multiprocess mode,
743 make sure you set ``instance_id = *`` in the configuration so each process
761 make sure you set ``instance_id = *`` in the configuration so each process
744 gets it's own cache invalidation key.
762 gets it's own cache invalidation key.
745
763
746
764
747 Example WSGI dispatch script::
765 Example WSGI dispatch script:
766
767 .. code-block:: python
748
768
749 import os
769 import os
750 os.environ["HGENCODING"] = "UTF-8"
770 os.environ["HGENCODING"] = "UTF-8"
751 os.environ['PYTHON_EGG_CACHE'] = '/srv/kallithea/.egg-cache'
771 os.environ['PYTHON_EGG_CACHE'] = '/srv/kallithea/.egg-cache'
752
772
753 # sometimes it's needed to set the curent dir
773 # sometimes it's needed to set the curent dir
754 os.chdir('/srv/kallithea/')
774 os.chdir('/srv/kallithea/')
755
775
756 import site
776 import site
757 site.addsitedir("/srv/kallithea/pyenv/lib/python2.7/site-packages")
777 site.addsitedir("/srv/kallithea/pyenv/lib/python2.7/site-packages")
758
778
759 from paste.deploy import loadapp
779 from paste.deploy import loadapp
760 from paste.script.util.logging_config import fileConfig
780 from paste.script.util.logging_config import fileConfig
761
781
762 fileConfig('/srv/kallithea/my.ini')
782 fileConfig('/srv/kallithea/my.ini')
763 application = loadapp('config:/srv/kallithea/my.ini')
783 application = loadapp('config:/srv/kallithea/my.ini')
764
784
765 Or using proper virtualenv activation::
785 Or using proper virtualenv activation:
786
787 .. code-block:: python
766
788
767 activate_this = '/srv/kallithea/venv/bin/activate_this.py'
789 activate_this = '/srv/kallithea/venv/bin/activate_this.py'
768 execfile(activate_this,dict(__file__=activate_this))
790 execfile(activate_this, dict(__file__=activate_this))
769
791
770 import os
792 import os
771 os.environ['HOME'] = '/srv/kallithea'
793 os.environ['HOME'] = '/srv/kallithea'
772
794
773 ini = '/srv/kallithea/kallithea.ini'
795 ini = '/srv/kallithea/kallithea.ini'
774 from paste.script.util.logging_config import fileConfig
796 from paste.script.util.logging_config import fileConfig
775 fileConfig(ini)
797 fileConfig(ini)
776 from paste.deploy import loadapp
798 from paste.deploy import loadapp
777 application = loadapp('config:' + ini)
799 application = loadapp('config:' + ini)
778
800
779
801
780 Other configuration files
802 Other configuration files
781 -------------------------
803 -------------------------
782
804
783 Some example init.d scripts can be found in the ``init.d`` directory:
805 A number of `example init.d scripts`__ can be found in
784 https://kallithea-scm.org/repos/kallithea/files/tip/init.d/ .
806 the ``init.d`` directory of the Kallithea source.
807
808 .. __: https://kallithea-scm.org/repos/kallithea/files/tip/init.d/ .
785
809
786 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
810 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
787 .. _python: http://www.python.org/
811 .. _python: http://www.python.org/
788 .. _Mercurial: http://mercurial.selenic.com/
812 .. _Mercurial: http://mercurial.selenic.com/
789 .. _Celery: http://celeryproject.org/
813 .. _Celery: http://celeryproject.org/
790 .. _Celery documentation: http://docs.celeryproject.org/en/latest/getting-started/index.html
814 .. _Celery documentation: http://docs.celeryproject.org/en/latest/getting-started/index.html
791 .. _RabbitMQ: http://www.rabbitmq.com/
815 .. _RabbitMQ: http://www.rabbitmq.com/
792 .. _Redis: http://redis.io/
816 .. _Redis: http://redis.io/
793 .. _python-ldap: http://www.python-ldap.org/
817 .. _python-ldap: http://www.python-ldap.org/
794 .. _mercurial-server: http://www.lshift.net/mercurial-server.html
818 .. _mercurial-server: http://www.lshift.net/mercurial-server.html
795 .. _PublishingRepositories: http://mercurial.selenic.com/wiki/PublishingRepositories
819 .. _PublishingRepositories: http://mercurial.selenic.com/wiki/PublishingRepositories
@@ -1,178 +1,181 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 deletion
9 -------------------
9 -------------------
10
10
11 Currently when an admin or owner deletes a repository, Kallithea does
11 Currently when an admin or owner deletes a repository, Kallithea does
12 not physically delete said repository from the filesystem, but instead
12 not physically delete said repository from the filesystem, but instead
13 renames it in a special way so that it is not possible to push, clone
13 renames it in a special way so that it is not possible to push, clone
14 or access the repository.
14 or access the repository.
15
15
16 There is a special command for cleaning up such archived repos::
16 There is a special command for cleaning up such archived repositories::
17
17
18 paster cleanup-repos --older-than=30d my.ini
18 paster cleanup-repos --older-than=30d my.ini
19
19
20 This command scans for archived repositories that are older than
20 This command scans for archived repositories that are older than
21 30 days, displays them, and asks if you want to delete them (unless given
21 30 days, displays them, and asks if you want to delete them (unless given
22 the ``--dont-ask`` flag). If you host a large amount of repositories with
22 the ``--dont-ask`` flag). If you host a large amount of repositories with
23 forks that are constantly being deleted, it is recommended that you run this
23 forks that are constantly being deleted, it is recommended that you run this
24 command via crontab.
24 command via crontab.
25
25
26 It is worth noting that even if someone is given administrative access to
26 It is worth noting that even if someone is given administrative access to
27 Kallithea and deletes a repository, you can easily restore such an action by
27 Kallithea and deletes a repository, you can easily restore such an action by
28 renaming the repository directory, removing the ``rm__<date>`` prefix.
28 renaming the repository directory, removing the ``rm__<date>`` prefix.
29
29
30 File view: follow current branch
30 File view: follow current branch
31 --------------------------------
31 --------------------------------
32
32
33 In the file view, left and right arrows allow to jump to the previous and next
33 In the file view, left and right arrows allow to jump to the previous and next
34 revision. Depending on the way revisions were created in the repository, this
34 revision. Depending on the way revisions were created in the repository, this
35 could jump to a different branch. When the checkbox ``Follow current branch``
35 could jump to a different branch. When the checkbox ``Follow current branch``
36 is checked, these arrows will only jump to revisions on the same branch as the
36 is checked, these arrows will only jump to revisions on the same branch as the
37 currently visible revision. So for example, if someone is viewing files in the
37 currently visible revision. So for example, if someone is viewing files in the
38 ``beta`` branch and marks the `Follow current branch` checkbox, the < and >
38 ``beta`` branch and marks the `Follow current branch` checkbox, the < and >
39 arrows will only show revisions on the ``beta`` branch.
39 arrows will only show revisions on the ``beta`` branch.
40
40
41
41
42 Changelog features
42 Changelog features
43 ------------------
43 ------------------
44
44
45 The core feature of a repository's ``changelog`` page is to show the revisions
45 The core feature of a repository's ``changelog`` page is to show the revisions
46 in a repository. However, there are several other features available from the
46 in a repository. However, there are several other features available from the
47 changelog.
47 changelog.
48
48
49 Branch filter
49 Branch filter
50 By default, the changelog shows revisions from all branches in the
50 By default, the changelog shows revisions from all branches in the
51 repository. Use the branch filter to restrict to a given branch.
51 repository. Use the branch filter to restrict to a given branch.
52
52
53 Viewing a changeset
53 Viewing a changeset
54 A particular changeset can be opened by clicking on either the changeset
54 A particular changeset can be opened by clicking on either the changeset
55 hash or the commit message, or by ticking the checkbox and clicking the
55 hash or the commit message, or by ticking the checkbox and clicking the
56 ``Show selected changeset`` button at the top.
56 ``Show selected changeset`` button at the top.
57
57
58 Viewing all changes between two changesets
58 Viewing all changes between two changesets
59 To get a list of all changesets between two selected changesets, along with
59 To get a list of all changesets between two selected changesets, along with
60 the changes in each one of them, tick the checkboxes of the first and
60 the changes in each one of them, tick the checkboxes of the first and
61 last changeset in the desired range and click the ``Show selected changesets``
61 last changeset in the desired range and click the ``Show selected changesets``
62 button at the top. You can only show the range between the first and last
62 button at the top. You can only show the range between the first and last
63 checkbox (no cherry-picking).
63 checkbox (no cherry-picking).
64
64
65 From that page, you can proceed to viewing the overall delta between the
65 From that page, you can proceed to viewing the overall delta between the
66 selected changesets, by clicking the ``Compare revisions`` button.
66 selected changesets, by clicking the ``Compare revisions`` button.
67
67
68 Creating a pull request
68 Creating a pull request
69 You can create a new pull request for the changes of a particular changeset
69 You can create a new pull request for the changes of a particular changeset
70 (and its ancestors) by selecting it and clicking the ``Open new pull request
70 (and its ancestors) by selecting it and clicking the ``Open new pull request
71 for selected changesets`` button.
71 for selected changesets`` button.
72
72
73
73 Permanent repository URLs
74 Permanent repository URLs
74 -------------------------
75 -------------------------
75
76
76 Due to the complicated nature of repository grouping, URLs of repositories
77 Due to the complicated nature of repository grouping, URLs of repositories
77 can often change. For example, a repository originally accessible from::
78 can often change. For example, a repository originally accessible from::
78
79
79 http://server.com/repo_name
80 http://example.com/repo_name
80
81
81 would get a new URL after moving it to test_group::
82 would get a new URL after moving it to test_group::
82
83
83 http://server.com/test_group/repo_name
84 http://example.com/test_group/repo_name
84
85
85 Such moving of a repository to a group can be an issue for build systems and
86 Such moving of a repository to a group can be an issue for build systems and
86 other scripts where the repository paths are hardcoded. To mitigate this,
87 other scripts where the repository paths are hardcoded. To mitigate this,
87 Kallithea provides permanent URLs using the repository ID prefixed with an
88 Kallithea provides permanent URLs using the repository ID prefixed with an
88 underscore. In all Kallithea URLs, for example those for the changelog and the
89 underscore. In all Kallithea URLs, for example those for the changelog and the
89 file view, a repository name can be replaced by this ``_ID`` string. Since IDs
90 file view, a repository name can be replaced by this ``_ID`` string. Since IDs
90 are always the same, moving the repository to a different group will not affect
91 are always the same, moving the repository to a different group will not affect
91 such URLs.
92 such URLs.
92
93
93 In the example, the repository could also be accessible as::
94 In the example, the repository could also be accessible as::
94
95
95 http://server.com/_<ID>
96 http://example.com/_<ID>
96
97
97 The ID of a given repository can be shown from the repository ``Summary`` page,
98 The ID of a given repository can be shown from the repository ``Summary`` page,
98 by selecting the ``Show by ID`` button next to ``Clone URL``.
99 by selecting the ``Show by ID`` button next to ``Clone URL``.
99
100
101
100 Email notifications
102 Email notifications
101 -------------------
103 -------------------
102
104
103 When the administrator correctly specified the email settings in the Kallithea
105 With email settings properly configured in the Kallithea
104 configuration file, Kallithea will send emails on user registration and when
106 configuration file, Kallithea will send emails on user registration and when
105 errors occur.
107 errors occur.
106
108
107 Emails are also sent for comments on changesets. In this case, an email is sent
109 Emails are also sent for comments on changesets. In this case, an email is sent
108 to the committer of the changeset (if known to Kallithea), to all reviewers of
110 to the committer of the changeset (if known to Kallithea), to all reviewers of
109 the pull request (if applicable) and to all people mentioned in the comment
111 the pull request (if applicable) and to all people mentioned in the comment
110 using @mention notation.
112 using @mention notation.
111
113
112
114
113 Trending source files
115 Trending source files
114 ---------------------
116 ---------------------
115
117
116 Trending source files are calculated based on a predefined dictionary of known
118 Trending source files are calculated based on a predefined dictionary of known
117 types and extensions. If an extension is missing or you would like to scan
119 types and extensions. If an extension is missing or you would like to scan
118 custom files, it is possible to extend the ``LANGUAGES_EXTENSIONS_MAP``
120 custom files, it is possible to extend the ``LANGUAGES_EXTENSIONS_MAP``
119 dictionary located in ``kallithea/config/conf.py`` with new types.
121 dictionary located in ``kallithea/config/conf.py`` with new types.
120
122
121
123
122 Cloning remote repositories
124 Cloning remote repositories
123 ---------------------------
125 ---------------------------
124
126
125 Kallithea has the ability to clone repositories from given remote locations.
127 Kallithea has the ability to clone repositories from given remote locations.
126 Currently it supports the following options:
128 Currently it supports the following options:
127
129
128 - hg -> hg clone
130 - hg -> hg clone
129 - svn -> hg clone
131 - svn -> hg clone
130 - git -> git clone
132 - git -> git clone
131
133
132
134
133 .. note:: svn -> hg cloning requires the ``hgsubversion`` library to be
135 .. note:: svn -> hg cloning requires the ``hgsubversion`` library to be
134 installed.
136 installed.
135
137
136 If you need to clone repositories that are protected via basic authentication,
138 If you need to clone repositories that are protected via basic authentication,
137 you can pass the credentials in the URL, e.g.
139 you can pass the credentials in the URL, e.g.
138 ``http://user:passw@remote.server/repo``. Kallithea will then try to login and
140 ``http://user:passw@remote.server/repo``. Kallithea will then try to login and
139 clone using the given credentials. Please note that the given credentials will
141 clone using the given credentials. Please note that the given credentials will
140 be stored as plaintext inside the database. However, the authentication
142 be stored as plaintext inside the database. However, the authentication
141 information will not be shown in the clone URL on the summary page.
143 information will not be shown in the clone URL on the summary page.
142
144
143
145
144 Specific features configurable in the Admin settings
146 Specific features configurable in the Admin settings
145 ----------------------------------------------------
147 ----------------------------------------------------
146
148
147 In general, the Admin settings should be self-explanatory and will not be
149 In general, the Admin settings should be self-explanatory and will not be
148 described in more detail in this documentation. However, there are a few
150 described in more detail in this documentation. However, there are a few
149 features that merit further explanation.
151 features that merit further explanation.
150
152
151 Repository extra fields
153 Repository extra fields
152 ~~~~~~~~~~~~~~~~~~~~~~~
154 ~~~~~~~~~~~~~~~~~~~~~~~
153
155
154 In the `Visual` tab, there is an option `Use repository extra
156 In the *Visual* tab, there is an option "Use repository extra
155 fields`, which allows to set custom fields for each repository in the system.
157 fields", which allows to set custom fields for each repository in the system.
156 Each new field consists of 3 attributes: ``field key``, ``field label``,
158
157 ``field description``.
159 Once enabled site-wide, the custom fields can be edited per-repository under
160 *Options* | *Settings* | *Extra Fields*.
158
161
159 Example usage of such fields would be to define company-specific information
162 Example usage of such fields would be to define company-specific information
160 into repositories, e.g., defining a ``repo_manager`` key that would give info
163 into repositories, e.g., defining a ``repo_manager`` key that would give info
161 about a manager of each repository. There's no limit for adding custom fields.
164 about a manager of each repository. There's no limit for adding custom fields.
162 Newly created fields are accessible via the API.
165 Newly created fields are accessible via the API.
163
166
164 Meta tagging
167 Meta tagging
165 ~~~~~~~~~~~~
168 ~~~~~~~~~~~~
166
169
167 In the `Visual` tab, option `Stylify recognised meta tags` will cause Kallithea
170 In the *Visual* tab, option "Stylify recognised meta tags" will cause Kallithea
168 to turn certain meta-tags, detected in repository and repository group
171 to turn certain text fragments in repository and repository group
169 descriptions, into colored tags. Currently recognised tags are::
172 descriptions into colored tags. Currently recognised tags are::
170
173
171 [featured]
174 [featured]
172 [stale]
175 [stale]
173 [dead]
176 [dead]
174 [lang => lang]
177 [lang => lang]
175 [license => License]
178 [license => License]
176 [requires => Repo]
179 [requires => Repo]
177 [recommends => Repo]
180 [recommends => Repo]
178 [see => URI]
181 [see => URI]
@@ -1,28 +1,28 b''
1 .. _locking:
1 .. _locking:
2
2
3 ==================
3 ==================
4 Repository locking
4 Repository locking
5 ==================
5 ==================
6
6
7 Kallithea has a ``repository locking`` feature, disabled by default. When
7 Kallithea has a *repository locking* feature, disabled by default. When
8 enabled, every initial clone and every pull gives users (with write permission)
8 enabled, every initial clone and every pull gives users (with write permission)
9 the exclusive right to do a push.
9 the exclusive right to do a push.
10
10
11 When repository locking is enabled, repositories get a ``locked`` state that
11 When repository locking is enabled, repositories get a ``locked`` flag.
12 can be true or false. The hg/git commands ``hg/git clone``, ``hg/git pull``,
12 The hg/git commands ``hg/git clone``, ``hg/git pull``,
13 and ``hg/git push`` influence this state:
13 and ``hg/git push`` influence this state:
14
14
15 - A ``clone`` or ``pull`` action on the repository locks it (``locked=true``)
15 - A ``clone`` or ``pull`` action locks the target repository
16 if the user has write/admin permissions on this repository.
16 if the user has write/admin permissions on this repository.
17
17
18 - Kallithea will remember the user who locked the repository so only this
18 - Kallithea will remember the user who locked the repository so only this
19 specific user can unlock the repo (``locked=false``) by performing a ``push``
19 specific user can unlock the repo by performing a ``push``
20 command.
20 command.
21
21
22 - Every other command on a locked repository from this user and every command
22 - Every other command on a locked repository from this user and every command
23 from any other user will result in an HTTP return code 423 (Locked).
23 from any other user will result in an HTTP return code 423 (Locked).
24 Additionally, the HTTP error includes the <user> that locked the repository
24 Additionally, the HTTP error will mention the user that locked the repository
25 (e.g., “repository <repo> locked by user <user>”).
25 (e.g., “repository <repo> locked by user <user>”).
26
26
27 Each repository can be manually unlocked by an administrator from the
27 Each repository can be manually unlocked by an administrator from the
28 repository settings menu.
28 repository settings menu.
@@ -1,57 +1,57 b''
1 .. _performance:
1 .. _performance:
2
2
3 ================================
3 ================================
4 Optimizing Kallithea performance
4 Optimizing Kallithea performance
5 ================================
5 ================================
6
6
7 When serving a large amount of big repositories, Kallithea can start
7 When serving a large amount of big repositories, Kallithea can start
8 performing slower than expected. Because of the demanding nature of handling large
8 performing slower than expected. Because of the demanding nature of handling large
9 amounts of data from version control systems, here are some tips on how to get
9 amounts of data from version control systems, here are some tips on how to get
10 the best performance.
10 the best performance.
11
11
12 * Kallithea will perform better on machines with faster disks (SSD/SAN). It's
12 * Kallithea is often I/O bound, and hence a fast disk (SSD/SAN) is
13 more important to have a faster disk than a faster CPU.
13 usually more important than a fast CPU.
14
14
15 * Slowness on initial page can be easily fixed by grouping repositories, and/or
15 * Sluggish loading of the front page can easily be fixed by grouping repositories or by
16 increasing cache size (see below). This includes using the lightweight dashboard
16 increasing cache size (see below). This includes using the lightweight dashboard
17 option and ``vcs_full_cache`` setting in .ini file
17 option and ``vcs_full_cache`` setting in .ini file.
18
18
19
19
20 Follow these few steps to improve performance of Kallithea system.
20 Follow these few steps to improve performance of Kallithea system.
21
21
22
22
23 1. Increase cache
23 1. Increase cache
24
24
25 Tweak beaker cache settings in the ini file. The actual effect of that
25 Tweak beaker cache settings in the ini file. The actual effect of that
26 is questionable.
26 is questionable.
27
27
28 2. Switch from sqlite to postgres or mysql
28 2. Switch from SQLite to PostgreSQL or MySQL
29
29
30 sqlite is a good option when having a small load on the system. But due to
30 SQLite is a good option when having a small load on the system. But due to
31 locking issues with sqlite, it is not recommended to use it for larger
31 locking issues with SQLite, it is not recommended to use it for larger
32 deployments. Switching to mysql or postgres will result in an immediate
32 deployments. Switching to MySQL or PostgreSQL will result in an immediate
33 performance increase. A tool like SQLAlchemyGrate_ can be used for
33 performance increase. A tool like SQLAlchemyGrate_ can be used for
34 migrating to another database platform.
34 migrating to another database platform.
35
35
36 3. Scale Kallithea horizontally
36 3. Scale Kallithea horizontally
37
37
38 Scaling horizontally can give huge performance increases when dealing with
38 Scaling horizontally can give huge performance benefits when dealing with
39 large traffic (large amount of users, CI servers etc). Kallithea can be
39 large amounts of traffic (many users, CI servers, etc.). Kallithea can be
40 scaled horizontally on one (recommended) or multiple machines. In order
40 scaled horizontally on one (recommended) or multiple machines. In order
41 to scale horizontally you need to do the following:
41 to scale horizontally you need to do the following:
42
42
43 - Each instance needs its own .ini file and unique ``instance_id`` set.
43 - Each instance needs its own .ini file and unique ``instance_id`` set.
44 - Each instance's ``data`` storage needs to be configured to be stored on a
44 - Each instance's ``data`` storage needs to be configured to be stored on a
45 shared disk storage, preferably together with repositories. This ``data``
45 shared disk storage, preferably together with repositories. This ``data``
46 dir contains template caches, sessions, whoosh index and is used for
46 dir contains template caches, sessions, whoosh index and is used for
47 task locking (so it is safe across multiple instances). Set the
47 task locking (so it is safe across multiple instances). Set the
48 ``cache_dir``, ``index_dir``, ``beaker.cache.data_dir``, ``beaker.cache.lock_dir``
48 ``cache_dir``, ``index_dir``, ``beaker.cache.data_dir``, ``beaker.cache.lock_dir``
49 variables in each .ini file to a shared location across Kallithea instances
49 variables in each .ini file to a shared location across Kallithea instances
50 - If celery is used each instance should run a separate Celery instance, but
50 - If celery is used each instance should run a separate Celery instance, but
51 the message broker should be common to all of them (e.g., one
51 the message broker should be common to all of them (e.g., one
52 shared RabbitMQ server)
52 shared RabbitMQ server)
53 - Load balance using round robin or IP hash, recommended is writing LB rules
53 - Load balance using round robin or IP hash, recommended is writing LB rules
54 that will separate regular user traffic from automated processes like CI
54 that will separate regular user traffic from automated processes like CI
55 servers or build bots.
55 servers or build bots.
56
56
57 .. _SQLAlchemyGrate: https://github.com/shazow/sqlalchemygrate
57 .. _SQLAlchemyGrate: https://github.com/shazow/sqlalchemygrate
@@ -1,31 +1,31 b''
1 .. _statistics:
1 .. _statistics:
2
2
3 =====================
3 =====================
4 Repository statistics
4 Repository statistics
5 =====================
5 =====================
6
6
7 Kallithea has a ``repository statistics`` feature, disabled by default. When
7 Kallithea has a *repository statistics* feature, disabled by default. When
8 enabled, the amount of commits per committer is visualized in a timeline. This
8 enabled, the amount of commits per committer is visualized in a timeline. This
9 feature can be enabled using the ``Enable statistics`` checkbox on the
9 feature can be enabled using the ``Enable statistics`` checkbox on the
10 repository ``Settings`` page.
10 repository ``Settings`` page.
11
11
12 The statistics system makes heavy demands on the server resources, so
12 The statistics system makes heavy demands on the server resources, so
13 in order to keep a balance between usability and performance, statistics are
13 in order to keep a balance between usability and performance, statistics are
14 cached inside the database and gathered incrementally.
14 cached inside the database and gathered incrementally.
15
15
16 When Celery is disabled:
16 When Celery is disabled:
17
17
18 On each first visit to the summary page a set of 250 commits are parsed and
18 On each first visit to the summary page a set of 250 commits are parsed and
19 added to the statistics cache. This incremental gathering also happens on each
19 added to the statistics cache. This incremental gathering also happens on each
20 visit to the statistics page, until all commits are fetched.
20 visit to the statistics page, until all commits are fetched.
21
21
22 Statistics are kept cached until additional commits are added to the
22 Statistics are kept cached until additional commits are added to the
23 repository. In such a case Kallithea will only fetch the new commits when
23 repository. In such a case Kallithea will only fetch the new commits when
24 updating its statistics cache.
24 updating its statistics cache.
25
25
26 When Celery is enabled:
26 When Celery is enabled:
27
27
28 On the first visit to the summary page, Kallithea will create tasks that will
28 On the first visit to the summary page, Kallithea will create tasks that will
29 execute on Celery workers. These tasks will gather all of the statistics until
29 execute on Celery workers. These tasks will gather all of the statistics until
30 all commits are parsed. Each task parses 250 commits, then launches a new
30 all commits are parsed. Each task parses 250 commits, then launches a new
31 task.
31 task.
@@ -1,75 +1,76 b''
1 .. _troubleshooting:
1 .. _troubleshooting:
2
2
3
3 ===============
4 ===============
4 Troubleshooting
5 Troubleshooting
5 ===============
6 ===============
6
7
7 :Q: **Missing static files?**
8 :Q: **Missing static files?**
8 :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
9 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
10 for example:
11 for example:
11 ``/home/my-virtual-python/lib/python2.7/site-packages/kallithea/public``
12 ``/home/my-virtual-python/lib/python2.7/site-packages/kallithea/public``
12
13
13 |
14 |
14
15
15 :Q: **Can't install celery/rabbitmq?**
16 :Q: **Can't install celery/rabbitmq?**
16 :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.
17 Try out the great Celery docs for further help.
18 Try out the great Celery docs for further help.
18
19
19 |
20 |
20
21
21 :Q: **Long lasting push timeouts?**
22 :Q: **Long lasting push timeouts?**
22 :A: Make sure you set a longer timeout in your proxy/fcgi settings. Timeouts
23 :A: Make sure you set a longer timeout in your proxy/fcgi settings. Timeouts
23 are caused by the http server and not Kallithea.
24 are caused by the http server and not Kallithea.
24
25
25 |
26 |
26
27
27 :Q: **Large pushes timeouts?**
28 :Q: **Large pushes timeouts?**
28 :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
29 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
30 body.
31 body.
31
32
32 |
33 |
33
34
34 :Q: **Apache doesn't pass basicAuth on pull/push?**
35 :Q: **Apache doesn't pass basicAuth on pull/push?**
35 :A: Make sure you added ``WSGIPassAuthorization true``.
36 :A: Make sure you added ``WSGIPassAuthorization true``.
36
37
37 |
38 |
38
39
39 :Q: **Git fails on push/pull?**
40 :Q: **Git fails on push/pull?**
40 :A: Make sure you're using a WSGI http server that can handle chunked encoding
41 :A: Make sure you're using a WSGI http server that can handle chunked encoding
41 such as ``waitress`` or ``gunicorn``.
42 such as ``waitress`` or ``gunicorn``.
42
43
43 |
44 |
44
45
45 :Q: **How can I use hooks in Kallithea?**
46 :Q: **How can I use hooks in Kallithea?**
46 :A: It's easy if they are Python hooks: just use advanced link in
47 :A: It's easy if they are Python hooks: just use advanced link in
47 hooks section in Admin panel, that works only for Mercurial. If
48 hooks section in Admin panel, that works only for Mercurial. If
48 you want to use Git hooks, just install th proper one in the repository,
49 you want to use Git hooks, just install th proper one in the repository,
49 e.g., create a file `/gitrepo/hooks/pre-receive`. You can also use
50 e.g., create a file `/gitrepo/hooks/pre-receive`. You can also use
50 Kallithea-extensions to connect to callback hooks, for both Git
51 Kallithea-extensions to connect to callback hooks, for both Git
51 and Mercurial.
52 and Mercurial.
52
53
53 |
54 |
54
55
55 :Q: **Kallithea is slow for me, how can I make it faster?**
56 :Q: **Kallithea is slow for me, how can I make it faster?**
56 :A: See the :ref:`performance` section.
57 :A: See the :ref:`performance` section.
57
58
58 |
59 |
59
60
60 :Q: **UnicodeDecodeError on Apache mod_wsgi**
61 :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.
62 :A: Please read: https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/modwsgi/#if-you-get-a-unicodeencodeerror.
62
63
63 |
64 |
64
65
65 :Q: **Requests hanging on Windows**
66 :Q: **Requests hanging on Windows**
66 :A: Please try out with disabled Antivirus software, there are some known problems with Eset Anitivirus. Make sure
67 :A: Please try out with disabled Antivirus software, there are some known problems with Eset Anitivirus. Make sure
67 you have installed the latest Windows patches (especially KB2789397).
68 you have installed the latest Windows patches (especially KB2789397).
68
69
69
70
70 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
71 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
71 .. _python: http://www.python.org/
72 .. _python: http://www.python.org/
72 .. _mercurial: http://mercurial.selenic.com/
73 .. _mercurial: http://mercurial.selenic.com/
73 .. _celery: http://celeryproject.org/
74 .. _celery: http://celeryproject.org/
74 .. _rabbitmq: http://www.rabbitmq.com/
75 .. _rabbitmq: http://www.rabbitmq.com/
75 .. _python-ldap: http://www.python-ldap.org/
76 .. _python-ldap: http://www.python-ldap.org/
General Comments 0
You need to be logged in to leave comments. Login now