##// END OF EJS Templates
docs: consistent spacing around headings...
Mads Kiilerich -
r5433:fbbe80e3 default
parent child Browse files
Show More
@@ -1,213 +1,215 b''
1 ================
1 ================
2 Kallithea README
2 Kallithea README
3 ================
3 ================
4
4
5
5 About
6 About
6 -----
7 -----
7
8
8 **Kallithea** is a fast and powerful management tool for Mercurial_ and Git_
9 **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
10 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
11 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
12 to authenticate via LDAP or ActiveDirectory. Kallithea also provides simple API
12 so it's easy to integrate with existing external systems.
13 so it's easy to integrate with existing external systems.
13
14
14 Kallithea is similar in some respects to GitHub_ or Bitbucket_, however
15 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
16 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,
17 open-source donationware and focuses more on providing a customised,
17 self-administered interface for Mercurial_ and Git_ repositories. Kallithea
18 self-administered interface for Mercurial_ and Git_ repositories. Kallithea
18 works on Unix-like systems and Windows, and is powered by the vcs_ library
19 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
20 created by Łukasz Balcerzak and Marcin KuΕΊmiΕ„ski to uniformly handle multiple
20 version control systems.
21 version control systems.
21
22
22 Kallithea was forked from RhodeCode in July 2014 and has been heavily modified.
23 Kallithea was forked from RhodeCode in July 2014 and has been heavily modified.
23
24
24
25
25 Installation
26 Installation
26 ------------
27 ------------
28
27 Kallithea requires Python_ 2.x and it is recommended to install it in a
29 Kallithea requires Python_ 2.x and it is recommended to install it in a
28 virtualenv_. Official releases of Kallithea can be installed with::
30 virtualenv_. Official releases of Kallithea can be installed with::
29
31
30 pip install kallithea
32 pip install kallithea
31
33
32 The development repository is kept very stable and used in production by the
34 The development repository is kept very stable and used in production by the
33 developers -- you can do the same.
35 developers -- you can do the same.
34
36
35 Please visit https://docs.kallithea-scm.org/en/latest/installation.html for
37 Please visit https://docs.kallithea-scm.org/en/latest/installation.html for
36 more details.
38 more details.
37
39
38
40
39 Source code
41 Source code
40 -----------
42 -----------
41
43
42 The latest sources can be obtained from
44 The latest sources can be obtained from
43 https://kallithea-scm.org/repos/kallithea.
45 https://kallithea-scm.org/repos/kallithea.
44
46
45 The issue tracker and a repository mirror can be found at Bitbucket_ on
47 The issue tracker and a repository mirror can be found at Bitbucket_ on
46 https://bitbucket.org/conservancy/kallithea.
48 https://bitbucket.org/conservancy/kallithea.
47
49
48
50
49 Kallithea features
51 Kallithea features
50 ------------------
52 ------------------
51
53
52 - Has its own middleware to handle Mercurial_ and Git_ protocol requests. Each
54 - Has its own middleware to handle Mercurial_ and Git_ protocol requests. Each
53 request is authenticated and logged together with IP address.
55 request is authenticated and logged together with IP address.
54 - Built for speed and performance. You can make multiple pulls/pushes
56 - Built for speed and performance. You can make multiple pulls/pushes
55 simultaneously. Proven to work with thousands of repositories and users.
57 simultaneously. Proven to work with thousands of repositories and users.
56 - Supports http/https, LDAP, AD, proxy-pass authentication.
58 - Supports http/https, LDAP, AD, proxy-pass authentication.
57 - Full permissions (private/read/write/admin) together with IP restrictions for
59 - Full permissions (private/read/write/admin) together with IP restrictions for
58 each repository, additional explicit forking, repositories group and
60 each repository, additional explicit forking, repositories group and
59 repository creation permissions.
61 repository creation permissions.
60 - User groups for easier permission management.
62 - User groups for easier permission management.
61 - Repository groups let you group repos and manage them easier. They come with
63 - Repository groups let you group repos and manage them easier. They come with
62 permission delegation features, so you can delegate groups management.
64 permission delegation features, so you can delegate groups management.
63 - Users can fork other users repos, and compare them at any time.
65 - Users can fork other users repos, and compare them at any time.
64 - Built-in versioned paste functionality (Gist) for sharing code snippets.
66 - Built-in versioned paste functionality (Gist) for sharing code snippets.
65 - Integrates easily with other systems, with custom created mappers you can
67 - Integrates easily with other systems, with custom created mappers you can
66 connect it to almost any issue tracker, and with a JSON-RPC API you can make
68 connect it to almost any issue tracker, and with a JSON-RPC API you can make
67 much more.
69 much more.
68 - Built-in commit API lets you add, edit and commit files right from Kallithea
70 - Built-in commit API lets you add, edit and commit files right from Kallithea
69 web interface using simple editor or upload binary files using simple form.
71 web interface using simple editor or upload binary files using simple form.
70 - Powerful pull request driven review system with inline commenting, changeset
72 - Powerful pull request driven review system with inline commenting, changeset
71 statuses, and notification system.
73 statuses, and notification system.
72 - Importing and syncing repositories from remote locations for Git_, Mercurial_
74 - Importing and syncing repositories from remote locations for Git_, Mercurial_
73 and Subversion.
75 and Subversion.
74 - Mako templates let you customize the look and feel of the application.
76 - Mako templates let you customize the look and feel of the application.
75 - Beautiful diffs, annotations and source code browsing all colored by
77 - Beautiful diffs, annotations and source code browsing all colored by
76 pygments. Raw diffs are made in Git-diff format for both VCS systems,
78 pygments. Raw diffs are made in Git-diff format for both VCS systems,
77 including Git_ binary-patches.
79 including Git_ binary-patches.
78 - Mercurial_ and Git_ DAG graphs and Flot-powered graphs with zooming and
80 - Mercurial_ and Git_ DAG graphs and Flot-powered graphs with zooming and
79 statistics to track activity for repositories.
81 statistics to track activity for repositories.
80 - Admin interface with user/permission management. Admin activity journal, logs
82 - Admin interface with user/permission management. Admin activity journal, logs
81 pulls, pushes, forks, registrations and other actions made by all users.
83 pulls, pushes, forks, registrations and other actions made by all users.
82 - Server side forks. It is possible to fork a project and modify it freely
84 - Server side forks. It is possible to fork a project and modify it freely
83 without breaking the main repository.
85 without breaking the main repository.
84 - reST and Markdown README support for repositories.
86 - reST and Markdown README support for repositories.
85 - Full text search powered by Whoosh on the source files, commit messages, and
87 - Full text search powered by Whoosh on the source files, commit messages, and
86 file names. Built-in indexing daemons, with optional incremental index build
88 file names. Built-in indexing daemons, with optional incremental index build
87 (no external search servers required all in one application).
89 (no external search servers required all in one application).
88 - Setup project descriptions/tags and info inside built in DB for easy,
90 - Setup project descriptions/tags and info inside built in DB for easy,
89 non-filesystem operations.
91 non-filesystem operations.
90 - Intelligent cache with invalidation after push or project change, provides
92 - Intelligent cache with invalidation after push or project change, provides
91 high performance and always up to date data.
93 high performance and always up to date data.
92 - RSS/Atom feeds, Gravatar support, downloadable sources as zip/tar/gz.
94 - RSS/Atom feeds, Gravatar support, downloadable sources as zip/tar/gz.
93 - Optional async tasks for speed and performance using Celery_.
95 - Optional async tasks for speed and performance using Celery_.
94 - Backup scripts can do backup of whole app and send it over scp to desired
96 - Backup scripts can do backup of whole app and send it over scp to desired
95 location.
97 location.
96 - Based on Pylons, SQLAlchemy, SQLite, Whoosh, vcs.
98 - Based on Pylons, SQLAlchemy, SQLite, Whoosh, vcs.
97
99
98
100
99 License
101 License
100 -------
102 -------
101
103
102 **Kallithea** is released under the GPLv3 license. Kallithea is a `Software
104 **Kallithea** is released under the GPLv3 license. Kallithea is a `Software
103 Freedom Conservancy`_ project and thus controlled by a non-profit organization.
105 Freedom Conservancy`_ project and thus controlled by a non-profit organization.
104 No commercial entity can take ownership of the project and change the
106 No commercial entity can take ownership of the project and change the
105 direction.
107 direction.
106
108
107 Kallithea started out as an effort to make sure the existing GPLv3 codebase
109 Kallithea started out as an effort to make sure the existing GPLv3 codebase
108 would stay available under a legal license. Kallithea thus has to stay GPLv3
110 would stay available under a legal license. Kallithea thus has to stay GPLv3
109 compatible ... but we are also happy it is GPLv3 and happy to keep it that way.
111 compatible ... but we are also happy it is GPLv3 and happy to keep it that way.
110 A different license (such as AGPL) could perhaps help attract a different
112 A different license (such as AGPL) could perhaps help attract a different
111 community with a different mix of Free Software people and companies but we are
113 community with a different mix of Free Software people and companies but we are
112 happy with the current focus.
114 happy with the current focus.
113
115
114
116
115 Community
117 Community
116 ---------
118 ---------
117
119
118 **Kallithea** is maintained by its users who contribute the fixes they would
120 **Kallithea** is maintained by its users who contribute the fixes they would
119 like to see.
121 like to see.
120
122
121 Get in touch with the rest of the community:
123 Get in touch with the rest of the community:
122
124
123 - Join the mailing list users and developers -- see
125 - Join the mailing list users and developers -- see
124 http://lists.sfconservancy.org/mailman/listinfo/kallithea-general.
126 http://lists.sfconservancy.org/mailman/listinfo/kallithea-general.
125
127
126 - Use IRC and join #kallithea on FreeNode (irc.freenode.net) or use
128 - Use IRC and join #kallithea on FreeNode (irc.freenode.net) or use
127 http://webchat.freenode.net/?channels=kallithea.
129 http://webchat.freenode.net/?channels=kallithea.
128
130
129 - Follow Kallithea on Twitter, **@KallitheaSCM**.
131 - Follow Kallithea on Twitter, **@KallitheaSCM**.
130
132
131 - Issues can be reported at `issue tracker
133 - Issues can be reported at `issue tracker
132 <https://bitbucket.org/conservancy/kallithea/issues>`_.
134 <https://bitbucket.org/conservancy/kallithea/issues>`_.
133
135
134 .. note::
136 .. note::
135
137
136 Please try to read the documentation before posting any issues,
138 Please try to read the documentation before posting any issues,
137 especially the **troubleshooting section**
139 especially the **troubleshooting section**
138
140
139
141
140 Online documentation
142 Online documentation
141 --------------------
143 --------------------
142
144
143 Online documentation for the current version of Kallithea is available at
145 Online documentation for the current version of Kallithea is available at
144 https://pythonhosted.org/Kallithea/. Documentation for the current development
146 https://pythonhosted.org/Kallithea/. Documentation for the current development
145 version can be found on https://docs.kallithea-scm.org/.
147 version can be found on https://docs.kallithea-scm.org/.
146
148
147 You can also build the documentation locally: go to ``docs/`` and run::
149 You can also build the documentation locally: go to ``docs/`` and run::
148
150
149 make html
151 make html
150
152
151 .. note:: You need to have Sphinx_ installed to build the
153 .. note:: You need to have Sphinx_ installed to build the
152 documentation. If you don't have Sphinx_ installed you can
154 documentation. If you don't have Sphinx_ installed you can
153 install it via the command: ``pip install sphinx`` .
155 install it via the command: ``pip install sphinx`` .
154
156
155
157
156 Converting from RhodeCode
158 Converting from RhodeCode
157 -------------------------
159 -------------------------
158
160
159 Currently, you have two options for working with an existing RhodeCode
161 Currently, you have two options for working with an existing RhodeCode
160 database:
162 database:
161
163
162 - keep the database unconverted (intended for testing and evaluation)
164 - keep the database unconverted (intended for testing and evaluation)
163 - convert the database in a one-time step
165 - convert the database in a one-time step
164
166
165 Maintaining interoperability
167 Maintaining interoperability
166 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
168 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
167
169
168 Interoperability with RhodeCode 2.2.X installations is provided so you don't
170 Interoperability with RhodeCode 2.2.X installations is provided so you don't
169 have to immediately commit to switching to Kallithea. This option will most
171 have to immediately commit to switching to Kallithea. This option will most
170 likely go away once the two projects have diverged significantly.
172 likely go away once the two projects have diverged significantly.
171
173
172 To run Kallithea on a RhodeCode database, run::
174 To run Kallithea on a RhodeCode database, run::
173
175
174 echo "BRAND = 'rhodecode'" > kallithea/brand.py
176 echo "BRAND = 'rhodecode'" > kallithea/brand.py
175
177
176 This location will depend on where you installed Kallithea. If you installed
178 This location will depend on where you installed Kallithea. If you installed
177 via::
179 via::
178
180
179 python setup.py install
181 python setup.py install
180
182
181 then you will find this location at
183 then you will find this location at
182 ``$VIRTUAL_ENV/lib/python2.7/site-packages/Kallithea-0.1-py2.7.egg/kallithea``.
184 ``$VIRTUAL_ENV/lib/python2.7/site-packages/Kallithea-0.1-py2.7.egg/kallithea``.
183
185
184 One-time conversion
186 One-time conversion
185 ~~~~~~~~~~~~~~~~~~~
187 ~~~~~~~~~~~~~~~~~~~
186
188
187 Alternatively, if you would like to convert the database for good, you can use
189 Alternatively, if you would like to convert the database for good, you can use
188 a helper script provided by Kallithea. This script will operate directly on the
190 a helper script provided by Kallithea. This script will operate directly on the
189 database, using the database string you can find in your ``production.ini`` (or
191 database, using the database string you can find in your ``production.ini`` (or
190 ``development.ini``) file. For example, if using SQLite::
192 ``development.ini``) file. For example, if using SQLite::
191
193
192 cd /path/to/kallithea
194 cd /path/to/kallithea
193 cp /path/to/rhodecode/rhodecode.db kallithea.db
195 cp /path/to/rhodecode/rhodecode.db kallithea.db
194 pip install sqlalchemy-migrate
196 pip install sqlalchemy-migrate
195 python kallithea/bin/rebranddb.py sqlite:///kallithea.db
197 python kallithea/bin/rebranddb.py sqlite:///kallithea.db
196
198
197 .. Note::
199 .. Note::
198
200
199 If you started out using the branding interoperability approach mentioned
201 If you started out using the branding interoperability approach mentioned
200 above, watch out for stray brand.pyc after removing brand.py.
202 above, watch out for stray brand.pyc after removing brand.py.
201
203
202
204
203 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
205 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
204 .. _Python: http://www.python.org/
206 .. _Python: http://www.python.org/
205 .. _Sphinx: http://sphinx.pocoo.org/
207 .. _Sphinx: http://sphinx.pocoo.org/
206 .. _Mercurial: http://mercurial.selenic.com/
208 .. _Mercurial: http://mercurial.selenic.com/
207 .. _Bitbucket: http://bitbucket.org/
209 .. _Bitbucket: http://bitbucket.org/
208 .. _GitHub: http://github.com/
210 .. _GitHub: http://github.com/
209 .. _Subversion: http://subversion.tigris.org/
211 .. _Subversion: http://subversion.tigris.org/
210 .. _Git: http://git-scm.com/
212 .. _Git: http://git-scm.com/
211 .. _Celery: http://celeryproject.org/
213 .. _Celery: http://celeryproject.org/
212 .. _vcs: http://pypi.python.org/pypi/vcs
214 .. _vcs: http://pypi.python.org/pypi/vcs
213 .. _Software Freedom Conservancy: http://sfconservancy.org/
215 .. _Software Freedom Conservancy: http://sfconservancy.org/
@@ -1,1072 +1,1047 b''
1 .. _api:
1 .. _api:
2
2
3 ===
3 ===
4 API
4 API
5 ===
5 ===
6
6
7
8 Kallithea has a simple JSON RPC API with a single schema for calling all API
7 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
8 methods. Everything is available by sending JSON encoded http(s) requests to
10 ``<your_server>/_admin/api``.
9 ``<your_server>/_admin/api``.
11
10
12
11
13 API access for web views
12 API access for web views
14 ++++++++++++++++++++++++
13 ++++++++++++++++++++++++
15
14
16 API access can also be turned on for each web view in Kallithea that is
15 API access can also be turned on for each web view in Kallithea that is
17 decorated with the ``@LoginRequired`` decorator. Some views use
16 decorated with the ``@LoginRequired`` decorator. Some views use
18 ``@LoginRequired(api_access=True)`` and are always available. By default only
17 ``@LoginRequired(api_access=True)`` and are always available. By default only
19 RSS/Atom feed views are enabled. Other views are
18 RSS/Atom feed views are enabled. Other views are
20 only available if they have been whitelisted. Edit the
19 only available if they have been whitelisted. Edit the
21 ``api_access_controllers_whitelist`` option in your .ini file and define views
20 ``api_access_controllers_whitelist`` option in your .ini file and define views
22 that should have API access enabled.
21 that should have API access enabled.
23
22
24 For example, to enable API access to patch/diff, raw file and archive::
23 For example, to enable API access to patch/diff, raw file and archive::
25
24
26 api_access_controllers_whitelist =
25 api_access_controllers_whitelist =
27 ChangesetController:changeset_patch,
26 ChangesetController:changeset_patch,
28 ChangesetController:changeset_raw,
27 ChangesetController:changeset_raw,
29 FilesController:raw,
28 FilesController:raw,
30 FilesController:archivefile
29 FilesController:archivefile
31
30
32 After this change, a Kallithea view can be accessed without login by adding a
31 After this change, a Kallithea view can be accessed without login by adding a
33 GET parameter ``?api_key=<api_key>`` to the URL.
32 GET parameter ``?api_key=<api_key>`` to the URL.
34
33
35 Exposing raw diffs is a good way to integrate with
34 Exposing raw diffs is a good way to integrate with
36 third-party services like code review, or build farms that can download archives.
35 third-party services like code review, or build farms that can download archives.
37
36
38
37
39 API access
38 API access
40 ++++++++++
39 ++++++++++
41
40
42 Clients must send JSON encoded JSON-RPC requests::
41 Clients must send JSON encoded JSON-RPC requests::
43
42
44 {
43 {
45 "id: "<id>",
44 "id: "<id>",
46 "api_key": "<api_key>",
45 "api_key": "<api_key>",
47 "method": "<method_name>",
46 "method": "<method_name>",
48 "args": {"<arg_key>": "<arg_val>"}
47 "args": {"<arg_key>": "<arg_val>"}
49 }
48 }
50
49
51 For example, to pull to a local "CPython" mirror using curl::
50 For example, to pull to a local "CPython" mirror using curl::
52
51
53 curl https://example.com/_admin/api -X POST -H 'content-type:text/plain' \
52 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"}}'
53 --data-binary '{"id":1,"api_key":"xe7cdb2v278e4evbdf5vs04v832v0efvcbcve4a3","method":"pull","args":{"repo":"CPython"}}'
55
54
56 In general, provide
55 In general, provide
57 - *id*, a value of any type, can be used to match the response with the request that it is replying to.
56 - *id*, a value of any type, can be used to match the response with the request that it is replying to.
58 - *api_key*, for authentication and permission validation.
57 - *api_key*, for authentication and permission validation.
59 - *method*, the name of the method to call -- a list of available methods can be found below.
58 - *method*, the name of the method to call -- a list of available methods can be found below.
60 - *args*, the arguments to pass to the method.
59 - *args*, the arguments to pass to the method.
61
60
62 .. note::
61 .. note::
63
62
64 api_key can be found or set on the user account page.
63 api_key can be found or set on the user account page.
65
64
66 The response to the JSON-RPC API call will always be a JSON structure::
65 The response to the JSON-RPC API call will always be a JSON structure::
67
66
68 {
67 {
69 "id": <id>, # the id that was used in the request
68 "id": <id>, # the id that was used in the request
70 "result": <result>|null, # JSON formatted result (null on error)
69 "result": <result>|null, # JSON formatted result (null on error)
71 "error": null|<error_message> # JSON formatted error (null on success)
70 "error": null|<error_message> # JSON formatted error (null on success)
72 }
71 }
73
72
74 All responses from the API will be ``HTTP/1.0 200 OK``. If an error occurs,
73 All responses from the API will be ``HTTP/1.0 200 OK``. If an error occurs,
75 the reponse will have a failure description in *error* and
74 the reponse will have a failure description in *error* and
76 *result* will be null.
75 *result* will be null.
77
76
78
77
79 API client
78 API client
80 ++++++++++
79 ++++++++++
81
80
82 Kallithea comes with a ``kallithea-api`` command line tool, providing a convenient
81 Kallithea comes with a ``kallithea-api`` command line tool, providing a convenient
83 way to call the JSON-RPC API.
82 way to call the JSON-RPC API.
84
83
85 For example, to call ``get_repo``::
84 For example, to call ``get_repo``::
86
85
87 kallithea-api --apihost=<your.kallithea.server.url> --apikey=<yourapikey> get_repo
86 kallithea-api --apihost=<your.kallithea.server.url> --apikey=<yourapikey> get_repo
88
87
89 calling {"api_key": "<apikey>", "id": 75, "args": {}, "method": "get_repo"} to http://127.0.0.1:5000
88 calling {"api_key": "<apikey>", "id": 75, "args": {}, "method": "get_repo"} to http://127.0.0.1:5000
90 Kallithea said:
89 Kallithea said:
91 {'error': 'Missing non optional `repoid` arg in JSON DATA',
90 {'error': 'Missing non optional `repoid` arg in JSON DATA',
92 'id': 75,
91 'id': 75,
93 'result': None}
92 'result': None}
94
93
95 Oops, looks like we forgot to add an argument. Let's try again, now
94 Oops, looks like we forgot to add an argument. Let's try again, now
96 providing the ``repoid`` as a parameter::
95 providing the ``repoid`` as a parameter::
97
96
98 kallithea-api get_repo repoid:myrepo
97 kallithea-api get_repo repoid:myrepo
99
98
100 calling {"api_key": "<apikey>", "id": 39, "args": {"repoid": "myrepo"}, "method": "get_repo"} to http://127.0.0.1:5000
99 calling {"api_key": "<apikey>", "id": 39, "args": {"repoid": "myrepo"}, "method": "get_repo"} to http://127.0.0.1:5000
101 Kallithea said:
100 Kallithea said:
102 {'error': None,
101 {'error': None,
103 'id': 39,
102 'id': 39,
104 'result': <json data...>}
103 'result': <json data...>}
105
104
106 To avoid specifying ``apihost`` and ``apikey`` every time, run::
105 To avoid specifying ``apihost`` and ``apikey`` every time, run::
107
106
108 kallithea-api --save-config --apihost=<your.kallithea.server.url> --apikey=<yourapikey>
107 kallithea-api --save-config --apihost=<your.kallithea.server.url> --apikey=<yourapikey>
109
108
110 This will create a ``~/.config/kallithea`` with the specified hostname and API key
109 This will create a ``~/.config/kallithea`` with the specified hostname and API key
111 so you don't have to specify them every time.
110 so you don't have to specify them every time.
112
111
113
112
114 API methods
113 API methods
115 +++++++++++
114 +++++++++++
116
115
117
116
118 pull
117 pull
119 ----
118 ----
120
119
121 Pull the given repo from remote location. Can be used to automatically keep
120 Pull the given repo from remote location. Can be used to automatically keep
122 remote repos up to date.
121 remote repos up to date.
123 This command can only be executed using the api_key of a user with admin rights.
122 This command can only be executed using the api_key of a user with admin rights.
124
123
125 INPUT::
124 INPUT::
126
125
127 id : <id_for_response>
126 id : <id_for_response>
128 api_key : "<api_key>"
127 api_key : "<api_key>"
129 method : "pull"
128 method : "pull"
130 args : {
129 args : {
131 "repoid" : "<reponame or repo_id>"
130 "repoid" : "<reponame or repo_id>"
132 }
131 }
133
132
134 OUTPUT::
133 OUTPUT::
135
134
136 id : <id_given_in_input>
135 id : <id_given_in_input>
137 result : "Pulled from `<reponame>`"
136 result : "Pulled from `<reponame>`"
138 error : null
137 error : null
139
138
140
141 rescan_repos
139 rescan_repos
142 ------------
140 ------------
143
141
144 Rescan repositories. If ``remove_obsolete`` is set,
142 Rescan repositories. If ``remove_obsolete`` is set,
145 Kallithea will delete repos that are in the database but not in the filesystem.
143 Kallithea will delete repos that are in the database but not in the filesystem.
146 This command can only be executed using the api_key of a user with admin rights.
144 This command can only be executed using the api_key of a user with admin rights.
147
145
148 INPUT::
146 INPUT::
149
147
150 id : <id_for_response>
148 id : <id_for_response>
151 api_key : "<api_key>"
149 api_key : "<api_key>"
152 method : "rescan_repos"
150 method : "rescan_repos"
153 args : {
151 args : {
154 "remove_obsolete" : "<boolean = Optional(False)>"
152 "remove_obsolete" : "<boolean = Optional(False)>"
155 }
153 }
156
154
157 OUTPUT::
155 OUTPUT::
158
156
159 id : <id_given_in_input>
157 id : <id_given_in_input>
160 result : "{'added': [<list of names of added repos>],
158 result : "{'added': [<list of names of added repos>],
161 'removed': [<list of names of removed repos>]}"
159 'removed': [<list of names of removed repos>]}"
162 error : null
160 error : null
163
161
164
165 invalidate_cache
162 invalidate_cache
166 ----------------
163 ----------------
167
164
168 Invalidate the cache for a repository.
165 Invalidate the cache for a repository.
169 This command can only be executed using the api_key of a user with admin rights,
166 This command can only be executed using the api_key of a user with admin rights,
170 or that of a regular user with admin or write access to the repository.
167 or that of a regular user with admin or write access to the repository.
171
168
172 INPUT::
169 INPUT::
173
170
174 id : <id_for_response>
171 id : <id_for_response>
175 api_key : "<api_key>"
172 api_key : "<api_key>"
176 method : "invalidate_cache"
173 method : "invalidate_cache"
177 args : {
174 args : {
178 "repoid" : "<reponame or repo_id>"
175 "repoid" : "<reponame or repo_id>"
179 }
176 }
180
177
181 OUTPUT::
178 OUTPUT::
182
179
183 id : <id_given_in_input>
180 id : <id_given_in_input>
184 result : "Caches of repository `<reponame>`"
181 result : "Caches of repository `<reponame>`"
185 error : null
182 error : null
186
183
187
188 lock
184 lock
189 ----
185 ----
190
186
191 Set the locking state on the given repository by the given user.
187 Set the locking state on the given repository by the given user.
192 If the param ``userid`` is skipped, it is set to the ID of the user who is calling this method.
188 If the param ``userid`` is skipped, it is set to the ID of the user who is calling this method.
193 If param ``locked`` is skipped, the current lock state of the repository is returned.
189 If param ``locked`` is skipped, the current lock state of the repository is returned.
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.
190 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.
195
191
196 INPUT::
192 INPUT::
197
193
198 id : <id_for_response>
194 id : <id_for_response>
199 api_key : "<api_key>"
195 api_key : "<api_key>"
200 method : "lock"
196 method : "lock"
201 args : {
197 args : {
202 "repoid" : "<reponame or repo_id>"
198 "repoid" : "<reponame or repo_id>"
203 "userid" : "<user_id or username = Optional(=apiuser)>",
199 "userid" : "<user_id or username = Optional(=apiuser)>",
204 "locked" : "<bool true|false = Optional(=None)>"
200 "locked" : "<bool true|false = Optional(=None)>"
205 }
201 }
206
202
207 OUTPUT::
203 OUTPUT::
208
204
209 id : <id_given_in_input>
205 id : <id_given_in_input>
210 result : {
206 result : {
211 "repo": "<reponame>",
207 "repo": "<reponame>",
212 "locked": "<bool true|false>",
208 "locked": "<bool true|false>",
213 "locked_since": "<float lock_time>",
209 "locked_since": "<float lock_time>",
214 "locked_by": "<username>",
210 "locked_by": "<username>",
215 "msg": "User `<username>` set lock state for repo `<reponame>` to `<false|true>`"
211 "msg": "User `<username>` set lock state for repo `<reponame>` to `<false|true>`"
216 }
212 }
217 error : null
213 error : null
218
214
219
220 get_ip
215 get_ip
221 ------
216 ------
222
217
223 Return IP address as seen from Kallithea server, together with all
218 Return IP address as seen from Kallithea server, together with all
224 defined IP addresses for given user.
219 defined IP addresses for given user.
225 This command can only be executed using the api_key of a user with admin rights.
220 This command can only be executed using the api_key of a user with admin rights.
226
221
227 INPUT::
222 INPUT::
228
223
229 id : <id_for_response>
224 id : <id_for_response>
230 api_key : "<api_key>"
225 api_key : "<api_key>"
231 method : "get_ip"
226 method : "get_ip"
232 args : {
227 args : {
233 "userid" : "<user_id or username>",
228 "userid" : "<user_id or username>",
234 }
229 }
235
230
236 OUTPUT::
231 OUTPUT::
237
232
238 id : <id_given_in_input>
233 id : <id_given_in_input>
239 result : {
234 result : {
240 "ip_addr_server": <ip_from_clien>",
235 "ip_addr_server": <ip_from_clien>",
241 "user_ips": [
236 "user_ips": [
242 {
237 {
243 "ip_addr": "<ip_with_mask>",
238 "ip_addr": "<ip_with_mask>",
244 "ip_range": ["<start_ip>", "<end_ip>"],
239 "ip_range": ["<start_ip>", "<end_ip>"],
245 },
240 },
246 ...
241 ...
247 ]
242 ]
248 }
243 }
249
244
250 error : null
245 error : null
251
246
252
253 get_user
247 get_user
254 --------
248 --------
255
249
256 Get a user by username or userid. The result is empty if user can't be found.
250 Get a user by username or userid. The result is empty if user can't be found.
257 If userid param is skipped, it is set to id of user who is calling this method.
251 If userid param is skipped, it is set to id of user who is calling this method.
258 Any userid can be specified when the command is executed using the api_key of a user with admin rights.
252 Any userid can be specified when the command is executed using the api_key of a user with admin rights.
259 Regular users can only speicy their own userid.
253 Regular users can only speicy their own userid.
260
254
261
255
262 INPUT::
256 INPUT::
263
257
264 id : <id_for_response>
258 id : <id_for_response>
265 api_key : "<api_key>"
259 api_key : "<api_key>"
266 method : "get_user"
260 method : "get_user"
267 args : {
261 args : {
268 "userid" : "<username or user_id Optional(=apiuser)>"
262 "userid" : "<username or user_id Optional(=apiuser)>"
269 }
263 }
270
264
271 OUTPUT::
265 OUTPUT::
272
266
273 id : <id_given_in_input>
267 id : <id_given_in_input>
274 result: None if user does not exist or
268 result: None if user does not exist or
275 {
269 {
276 "user_id" : "<user_id>",
270 "user_id" : "<user_id>",
277 "api_key" : "<api_key>",
271 "api_key" : "<api_key>",
278 "username" : "<username>",
272 "username" : "<username>",
279 "firstname": "<firstname>",
273 "firstname": "<firstname>",
280 "lastname" : "<lastname>",
274 "lastname" : "<lastname>",
281 "email" : "<email>",
275 "email" : "<email>",
282 "emails": "<list_of_all_additional_emails>",
276 "emails": "<list_of_all_additional_emails>",
283 "ip_addresses": "<list_of_ip_addresses_for_user>",
277 "ip_addresses": "<list_of_ip_addresses_for_user>",
284 "active" : "<bool>",
278 "active" : "<bool>",
285 "admin" :Β  "<bool>",
279 "admin" :Β  "<bool>",
286 "ldap_dn" : "<ldap_dn>",
280 "ldap_dn" : "<ldap_dn>",
287 "last_login": "<last_login>",
281 "last_login": "<last_login>",
288 "permissions": {
282 "permissions": {
289 "global": ["hg.create.repository",
283 "global": ["hg.create.repository",
290 "repository.read",
284 "repository.read",
291 "hg.register.manual_activate"],
285 "hg.register.manual_activate"],
292 "repositories": {"repo1": "repository.none"},
286 "repositories": {"repo1": "repository.none"},
293 "repositories_groups": {"Group1": "group.read"}
287 "repositories_groups": {"Group1": "group.read"}
294 },
288 },
295 }
289 }
296 error: null
290 error: null
297
291
298
299 get_users
292 get_users
300 ---------
293 ---------
301
294
302 List all existing users.
295 List all existing users.
303 This command can only be executed using the api_key of a user with admin rights.
296 This command can only be executed using the api_key of a user with admin rights.
304
297
305
298
306 INPUT::
299 INPUT::
307
300
308 id : <id_for_response>
301 id : <id_for_response>
309 api_key : "<api_key>"
302 api_key : "<api_key>"
310 method : "get_users"
303 method : "get_users"
311 args : { }
304 args : { }
312
305
313 OUTPUT::
306 OUTPUT::
314
307
315 id : <id_given_in_input>
308 id : <id_given_in_input>
316 result: [
309 result: [
317 {
310 {
318 "user_id" : "<user_id>",
311 "user_id" : "<user_id>",
319 "api_key" : "<api_key>",
312 "api_key" : "<api_key>",
320 "username" : "<username>",
313 "username" : "<username>",
321 "firstname": "<firstname>",
314 "firstname": "<firstname>",
322 "lastname" : "<lastname>",
315 "lastname" : "<lastname>",
323 "email" : "<email>",
316 "email" : "<email>",
324 "emails": "<list_of_all_additional_emails>",
317 "emails": "<list_of_all_additional_emails>",
325 "ip_addresses": "<list_of_ip_addresses_for_user>",
318 "ip_addresses": "<list_of_ip_addresses_for_user>",
326 "active" : "<bool>",
319 "active" : "<bool>",
327 "admin" :Β  "<bool>",
320 "admin" :Β  "<bool>",
328 "ldap_dn" : "<ldap_dn>",
321 "ldap_dn" : "<ldap_dn>",
329 "last_login": "<last_login>",
322 "last_login": "<last_login>",
330 },
323 },
331 …
324 …
332 ]
325 ]
333 error: null
326 error: null
334
327
335
328
336 .. _create-user:
329 .. _create-user:
337
330
338 create_user
331 create_user
339 -----------
332 -----------
340
333
341 Create new user.
334 Create new user.
342 This command can only be executed using the api_key of a user with admin rights.
335 This command can only be executed using the api_key of a user with admin rights.
343
336
344
337
345 INPUT::
338 INPUT::
346
339
347 id : <id_for_response>
340 id : <id_for_response>
348 api_key : "<api_key>"
341 api_key : "<api_key>"
349 method : "create_user"
342 method : "create_user"
350 args : {
343 args : {
351 "username" : "<username>",
344 "username" : "<username>",
352 "email" : "<useremail>",
345 "email" : "<useremail>",
353 "password" : "<password = Optional(None)>",
346 "password" : "<password = Optional(None)>",
354 "firstname" : "<firstname> = Optional(None)",
347 "firstname" : "<firstname> = Optional(None)",
355 "lastname" : "<lastname> = Optional(None)",
348 "lastname" : "<lastname> = Optional(None)",
356 "active" : "<bool> = Optional(True)",
349 "active" : "<bool> = Optional(True)",
357 "admin" : "<bool> = Optional(False)",
350 "admin" : "<bool> = Optional(False)",
358 "ldap_dn" : "<ldap_dn> = Optional(None)"
351 "ldap_dn" : "<ldap_dn> = Optional(None)"
359 }
352 }
360
353
361 OUTPUT::
354 OUTPUT::
362
355
363 id : <id_given_in_input>
356 id : <id_given_in_input>
364 result: {
357 result: {
365 "msg" : "created new user `<username>`",
358 "msg" : "created new user `<username>`",
366 "user": {
359 "user": {
367 "user_id" : "<user_id>",
360 "user_id" : "<user_id>",
368 "username" : "<username>",
361 "username" : "<username>",
369 "firstname": "<firstname>",
362 "firstname": "<firstname>",
370 "lastname" : "<lastname>",
363 "lastname" : "<lastname>",
371 "email" : "<email>",
364 "email" : "<email>",
372 "emails": "<list_of_all_additional_emails>",
365 "emails": "<list_of_all_additional_emails>",
373 "active" : "<bool>",
366 "active" : "<bool>",
374 "admin" :Β  "<bool>",
367 "admin" :Β  "<bool>",
375 "ldap_dn" : "<ldap_dn>",
368 "ldap_dn" : "<ldap_dn>",
376 "last_login": "<last_login>",
369 "last_login": "<last_login>",
377 },
370 },
378 }
371 }
379 error: null
372 error: null
380
373
381 Example::
374 Example::
382
375
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
376 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
377
385
386 update_user
378 update_user
387 -----------
379 -----------
388
380
389 Update the given user if such user exists.
381 Update the given user if such user exists.
390 This command can only be executed using the api_key of a user with admin rights.
382 This command can only be executed using the api_key of a user with admin rights.
391
383
392
384
393 INPUT::
385 INPUT::
394
386
395 id : <id_for_response>
387 id : <id_for_response>
396 api_key : "<api_key>"
388 api_key : "<api_key>"
397 method : "update_user"
389 method : "update_user"
398 args : {
390 args : {
399 "userid" : "<user_id or username>",
391 "userid" : "<user_id or username>",
400 "username" : "<username> = Optional(None)",
392 "username" : "<username> = Optional(None)",
401 "email" : "<useremail> = Optional(None)",
393 "email" : "<useremail> = Optional(None)",
402 "password" : "<password> = Optional(None)",
394 "password" : "<password> = Optional(None)",
403 "firstname" : "<firstname> = Optional(None)",
395 "firstname" : "<firstname> = Optional(None)",
404 "lastname" : "<lastname> = Optional(None)",
396 "lastname" : "<lastname> = Optional(None)",
405 "active" : "<bool> = Optional(None)",
397 "active" : "<bool> = Optional(None)",
406 "admin" : "<bool> = Optional(None)",
398 "admin" : "<bool> = Optional(None)",
407 "ldap_dn" : "<ldap_dn> = Optional(None)"
399 "ldap_dn" : "<ldap_dn> = Optional(None)"
408 }
400 }
409
401
410 OUTPUT::
402 OUTPUT::
411
403
412 id : <id_given_in_input>
404 id : <id_given_in_input>
413 result: {
405 result: {
414 "msg" : "updated user ID:<userid> <username>",
406 "msg" : "updated user ID:<userid> <username>",
415 "user": {
407 "user": {
416 "user_id" : "<user_id>",
408 "user_id" : "<user_id>",
417 "api_key" : "<api_key>",
409 "api_key" : "<api_key>",
418 "username" : "<username>",
410 "username" : "<username>",
419 "firstname": "<firstname>",
411 "firstname": "<firstname>",
420 "lastname" : "<lastname>",
412 "lastname" : "<lastname>",
421 "email" : "<email>",
413 "email" : "<email>",
422 "emails": "<list_of_all_additional_emails>",
414 "emails": "<list_of_all_additional_emails>",
423 "active" : "<bool>",
415 "active" : "<bool>",
424 "admin" :Β  "<bool>",
416 "admin" :Β  "<bool>",
425 "ldap_dn" : "<ldap_dn>",
417 "ldap_dn" : "<ldap_dn>",
426 "last_login": "<last_login>",
418 "last_login": "<last_login>",
427 },
419 },
428 }
420 }
429 error: null
421 error: null
430
422
431
432 delete_user
423 delete_user
433 -----------
424 -----------
434
425
435 Delete the given user if such a user exists.
426 Delete the given user if such a user exists.
436 This command can only be executed using the api_key of a user with admin rights.
427 This command can only be executed using the api_key of a user with admin rights.
437
428
438
429
439 INPUT::
430 INPUT::
440
431
441 id : <id_for_response>
432 id : <id_for_response>
442 api_key : "<api_key>"
433 api_key : "<api_key>"
443 method : "delete_user"
434 method : "delete_user"
444 args : {
435 args : {
445 "userid" : "<user_id or username>",
436 "userid" : "<user_id or username>",
446 }
437 }
447
438
448 OUTPUT::
439 OUTPUT::
449
440
450 id : <id_given_in_input>
441 id : <id_given_in_input>
451 result: {
442 result: {
452 "msg" : "deleted user ID:<userid> <username>",
443 "msg" : "deleted user ID:<userid> <username>",
453 "user": null
444 "user": null
454 }
445 }
455 error: null
446 error: null
456
447
457
458 get_user_group
448 get_user_group
459 --------------
449 --------------
460
450
461 Get an existing user group.
451 Get an existing user group.
462 This command can only be executed using the api_key of a user with admin rights.
452 This command can only be executed using the api_key of a user with admin rights.
463
453
464
454
465 INPUT::
455 INPUT::
466
456
467 id : <id_for_response>
457 id : <id_for_response>
468 api_key : "<api_key>"
458 api_key : "<api_key>"
469 method : "get_user_group"
459 method : "get_user_group"
470 args : {
460 args : {
471 "usergroupid" : "<user group id or name>"
461 "usergroupid" : "<user group id or name>"
472 }
462 }
473
463
474 OUTPUT::
464 OUTPUT::
475
465
476 id : <id_given_in_input>
466 id : <id_given_in_input>
477 result : None if group not exist
467 result : None if group not exist
478 {
468 {
479 "users_group_id" : "<id>",
469 "users_group_id" : "<id>",
480 "group_name" : "<groupname>",
470 "group_name" : "<groupname>",
481 "active": "<bool>",
471 "active": "<bool>",
482 "members" : [
472 "members" : [
483 {
473 {
484 "user_id" : "<user_id>",
474 "user_id" : "<user_id>",
485 "api_key" : "<api_key>",
475 "api_key" : "<api_key>",
486 "username" : "<username>",
476 "username" : "<username>",
487 "firstname": "<firstname>",
477 "firstname": "<firstname>",
488 "lastname" : "<lastname>",
478 "lastname" : "<lastname>",
489 "email" : "<email>",
479 "email" : "<email>",
490 "emails": "<list_of_all_additional_emails>",
480 "emails": "<list_of_all_additional_emails>",
491 "active" : "<bool>",
481 "active" : "<bool>",
492 "admin" :Β  "<bool>",
482 "admin" :Β  "<bool>",
493 "ldap_dn" : "<ldap_dn>",
483 "ldap_dn" : "<ldap_dn>",
494 "last_login": "<last_login>",
484 "last_login": "<last_login>",
495 },
485 },
496 …
486 …
497 ]
487 ]
498 }
488 }
499 error : null
489 error : null
500
490
501
502 get_user_groups
491 get_user_groups
503 ---------------
492 ---------------
504
493
505 List all existing user groups.
494 List all existing user groups.
506 This command can only be executed using the api_key of a user with admin rights.
495 This command can only be executed using the api_key of a user with admin rights.
507
496
508
497
509 INPUT::
498 INPUT::
510
499
511 id : <id_for_response>
500 id : <id_for_response>
512 api_key : "<api_key>"
501 api_key : "<api_key>"
513 method : "get_user_groups"
502 method : "get_user_groups"
514 args : { }
503 args : { }
515
504
516 OUTPUT::
505 OUTPUT::
517
506
518 id : <id_given_in_input>
507 id : <id_given_in_input>
519 result : [
508 result : [
520 {
509 {
521 "users_group_id" : "<id>",
510 "users_group_id" : "<id>",
522 "group_name" : "<groupname>",
511 "group_name" : "<groupname>",
523 "active": "<bool>",
512 "active": "<bool>",
524 },
513 },
525 …
514 …
526 ]
515 ]
527 error : null
516 error : null
528
517
529
530 create_user_group
518 create_user_group
531 -----------------
519 -----------------
532
520
533 Create a new user group.
521 Create a new user group.
534 This command can only be executed using the api_key of a user with admin rights.
522 This command can only be executed using the api_key of a user with admin rights.
535
523
536
524
537 INPUT::
525 INPUT::
538
526
539 id : <id_for_response>
527 id : <id_for_response>
540 api_key : "<api_key>"
528 api_key : "<api_key>"
541 method : "create_user_group"
529 method : "create_user_group"
542 args: {
530 args: {
543 "group_name": "<groupname>",
531 "group_name": "<groupname>",
544 "owner" : "<owner_name_or_id = Optional(=apiuser)>",
532 "owner" : "<owner_name_or_id = Optional(=apiuser)>",
545 "active": "<bool> = Optional(True)"
533 "active": "<bool> = Optional(True)"
546 }
534 }
547
535
548 OUTPUT::
536 OUTPUT::
549
537
550 id : <id_given_in_input>
538 id : <id_given_in_input>
551 result: {
539 result: {
552 "msg": "created new user group `<groupname>`",
540 "msg": "created new user group `<groupname>`",
553 "users_group": {
541 "users_group": {
554 "users_group_id" : "<id>",
542 "users_group_id" : "<id>",
555 "group_name" : "<groupname>",
543 "group_name" : "<groupname>",
556 "active": "<bool>",
544 "active": "<bool>",
557 },
545 },
558 }
546 }
559 error: null
547 error: null
560
548
561
562 add_user_to_user_group
549 add_user_to_user_group
563 ----------------------
550 ----------------------
564
551
565 Adds a user to a user group. If the user already is in that group, success will be
552 Adds a user to a user group. If the user already is in that group, success will be
566 ``false``.
553 ``false``.
567 This command can only be executed using the api_key of a user with admin rights.
554 This command can only be executed using the api_key of a user with admin rights.
568
555
569
556
570 INPUT::
557 INPUT::
571
558
572 id : <id_for_response>
559 id : <id_for_response>
573 api_key : "<api_key>"
560 api_key : "<api_key>"
574 method : "add_user_user_group"
561 method : "add_user_user_group"
575 args: {
562 args: {
576 "usersgroupid" : "<user group id or name>",
563 "usersgroupid" : "<user group id or name>",
577 "userid" : "<user_id or username>",
564 "userid" : "<user_id or username>",
578 }
565 }
579
566
580 OUTPUT::
567 OUTPUT::
581
568
582 id : <id_given_in_input>
569 id : <id_given_in_input>
583 result: {
570 result: {
584 "success": True|False # depends on if member is in group
571 "success": True|False # depends on if member is in group
585 "msg": "added member `<username>` to a user group `<groupname>` |
572 "msg": "added member `<username>` to a user group `<groupname>` |
586 User is already in that group"
573 User is already in that group"
587 }
574 }
588 error: null
575 error: null
589
576
590
591 remove_user_from_user_group
577 remove_user_from_user_group
592 ---------------------------
578 ---------------------------
593
579
594 Remove a user from a user group. If the user isn't in the given group, success will
580 Remove a user from a user group. If the user isn't in the given group, success will
595 be ``false``.
581 be ``false``.
596 This command can only be executed using the api_key of a user with admin rights.
582 This command can only be executed using the api_key of a user with admin rights.
597
583
598
584
599 INPUT::
585 INPUT::
600
586
601 id : <id_for_response>
587 id : <id_for_response>
602 api_key : "<api_key>"
588 api_key : "<api_key>"
603 method : "remove_user_from_user_group"
589 method : "remove_user_from_user_group"
604 args: {
590 args: {
605 "usersgroupid" : "<user group id or name>",
591 "usersgroupid" : "<user group id or name>",
606 "userid" : "<user_id or username>",
592 "userid" : "<user_id or username>",
607 }
593 }
608
594
609 OUTPUT::
595 OUTPUT::
610
596
611 id : <id_given_in_input>
597 id : <id_given_in_input>
612 result: {
598 result: {
613 "success": True|False, # depends on if member is in group
599 "success": True|False, # depends on if member is in group
614 "msg": "removed member <username> from user group <groupname> |
600 "msg": "removed member <username> from user group <groupname> |
615 User wasn't in group"
601 User wasn't in group"
616 }
602 }
617 error: null
603 error: null
618
604
619
620 get_repo
605 get_repo
621 --------
606 --------
622
607
623 Get an existing repository by its name or repository_id. Members will contain
608 Get an existing repository by its name or repository_id. Members will contain
624 either users_group or users associated to that repository.
609 either users_group or users associated to that repository.
625 This command can only be executed using the api_key of a user with admin rights,
610 This command can only be executed using the api_key of a user with admin rights,
626 or that of a regular user with at least read access to the repository.
611 or that of a regular user with at least read access to the repository.
627
612
628 INPUT::
613 INPUT::
629
614
630 id : <id_for_response>
615 id : <id_for_response>
631 api_key : "<api_key>"
616 api_key : "<api_key>"
632 method : "get_repo"
617 method : "get_repo"
633 args: {
618 args: {
634 "repoid" : "<reponame or repo_id>"
619 "repoid" : "<reponame or repo_id>"
635 }
620 }
636
621
637 OUTPUT::
622 OUTPUT::
638
623
639 id : <id_given_in_input>
624 id : <id_given_in_input>
640 result: None if repository does not exist or
625 result: None if repository does not exist or
641 {
626 {
642 "repo_id" : "<repo_id>",
627 "repo_id" : "<repo_id>",
643 "repo_name" : "<reponame>"
628 "repo_name" : "<reponame>"
644 "repo_type" : "<repo_type>",
629 "repo_type" : "<repo_type>",
645 "clone_uri" : "<clone_uri>",
630 "clone_uri" : "<clone_uri>",
646 "enable_downloads": "<bool>",
631 "enable_downloads": "<bool>",
647 "enable_locking": "<bool>",
632 "enable_locking": "<bool>",
648 "enable_statistics": "<bool>",
633 "enable_statistics": "<bool>",
649 "private": "<bool>",
634 "private": "<bool>",
650 "created_on" : "<date_time_created>",
635 "created_on" : "<date_time_created>",
651 "description" : "<description>",
636 "description" : "<description>",
652 "landing_rev": "<landing_rev>",
637 "landing_rev": "<landing_rev>",
653 "last_changeset": {
638 "last_changeset": {
654 "author": "<full_author>",
639 "author": "<full_author>",
655 "date": "<date_time_of_commit>",
640 "date": "<date_time_of_commit>",
656 "message": "<commit_message>",
641 "message": "<commit_message>",
657 "raw_id": "<raw_id>",
642 "raw_id": "<raw_id>",
658 "revision": "<numeric_revision>",
643 "revision": "<numeric_revision>",
659 "short_id": "<short_id>"
644 "short_id": "<short_id>"
660 }
645 }
661 "owner": "<repo_owner>",
646 "owner": "<repo_owner>",
662 "fork_of": "<name_of_fork_parent>",
647 "fork_of": "<name_of_fork_parent>",
663 "members" : [
648 "members" : [
664 {
649 {
665 "type": "user",
650 "type": "user",
666 "user_id" : "<user_id>",
651 "user_id" : "<user_id>",
667 "api_key" : "<api_key>",
652 "api_key" : "<api_key>",
668 "username" : "<username>",
653 "username" : "<username>",
669 "firstname": "<firstname>",
654 "firstname": "<firstname>",
670 "lastname" : "<lastname>",
655 "lastname" : "<lastname>",
671 "email" : "<email>",
656 "email" : "<email>",
672 "emails": "<list_of_all_additional_emails>",
657 "emails": "<list_of_all_additional_emails>",
673 "active" : "<bool>",
658 "active" : "<bool>",
674 "admin" :Β  "<bool>",
659 "admin" :Β  "<bool>",
675 "ldap_dn" : "<ldap_dn>",
660 "ldap_dn" : "<ldap_dn>",
676 "last_login": "<last_login>",
661 "last_login": "<last_login>",
677 "permission" : "repository.(read|write|admin)"
662 "permission" : "repository.(read|write|admin)"
678 },
663 },
679 …
664 …
680 {
665 {
681 "type": "users_group",
666 "type": "users_group",
682 "id" : "<usersgroupid>",
667 "id" : "<usersgroupid>",
683 "name" : "<usersgroupname>",
668 "name" : "<usersgroupname>",
684 "active": "<bool>",
669 "active": "<bool>",
685 "permission" : "repository.(read|write|admin)"
670 "permission" : "repository.(read|write|admin)"
686 },
671 },
687 …
672 …
688 ]
673 ]
689 "followers": [
674 "followers": [
690 {
675 {
691 "user_id" : "<user_id>",
676 "user_id" : "<user_id>",
692 "username" : "<username>",
677 "username" : "<username>",
693 "api_key" : "<api_key>",
678 "api_key" : "<api_key>",
694 "firstname": "<firstname>",
679 "firstname": "<firstname>",
695 "lastname" : "<lastname>",
680 "lastname" : "<lastname>",
696 "email" : "<email>",
681 "email" : "<email>",
697 "emails": "<list_of_all_additional_emails>",
682 "emails": "<list_of_all_additional_emails>",
698 "ip_addresses": "<list_of_ip_addresses_for_user>",
683 "ip_addresses": "<list_of_ip_addresses_for_user>",
699 "active" : "<bool>",
684 "active" : "<bool>",
700 "admin" :Β  "<bool>",
685 "admin" :Β  "<bool>",
701 "ldap_dn" : "<ldap_dn>",
686 "ldap_dn" : "<ldap_dn>",
702 "last_login": "<last_login>",
687 "last_login": "<last_login>",
703 },
688 },
704 …
689 …
705 ]
690 ]
706 }
691 }
707 error: null
692 error: null
708
693
709
710 get_repos
694 get_repos
711 ---------
695 ---------
712
696
713 List all existing repositories.
697 List all existing repositories.
714 This command can only be executed using the api_key of a user with admin rights,
698 This command can only be executed using the api_key of a user with admin rights,
715 or that of a regular user with at least read access to the repository.
699 or that of a regular user with at least read access to the repository.
716
700
717
701
718 INPUT::
702 INPUT::
719
703
720 id : <id_for_response>
704 id : <id_for_response>
721 api_key : "<api_key>"
705 api_key : "<api_key>"
722 method : "get_repos"
706 method : "get_repos"
723 args: { }
707 args: { }
724
708
725 OUTPUT::
709 OUTPUT::
726
710
727 id : <id_given_in_input>
711 id : <id_given_in_input>
728 result: [
712 result: [
729 {
713 {
730 "repo_id" : "<repo_id>",
714 "repo_id" : "<repo_id>",
731 "repo_name" : "<reponame>"
715 "repo_name" : "<reponame>"
732 "repo_type" : "<repo_type>",
716 "repo_type" : "<repo_type>",
733 "clone_uri" : "<clone_uri>",
717 "clone_uri" : "<clone_uri>",
734 "private" : "<bool>",
718 "private" : "<bool>",
735 "created_on" : "<datetimecreated>",
719 "created_on" : "<datetimecreated>",
736 "description" : "<description>",
720 "description" : "<description>",
737 "landing_rev": "<landing_rev>",
721 "landing_rev": "<landing_rev>",
738 "owner": "<repo_owner>",
722 "owner": "<repo_owner>",
739 "fork_of": "<name_of_fork_parent>",
723 "fork_of": "<name_of_fork_parent>",
740 "enable_downloads": "<bool>",
724 "enable_downloads": "<bool>",
741 "enable_locking": "<bool>",
725 "enable_locking": "<bool>",
742 "enable_statistics": "<bool>",
726 "enable_statistics": "<bool>",
743 },
727 },
744 …
728 …
745 ]
729 ]
746 error: null
730 error: null
747
731
748
749 get_repo_nodes
732 get_repo_nodes
750 --------------
733 --------------
751
734
752 Return a list of files and directories for a given path at the given revision.
735 Return a list of files and directories for a given path at the given revision.
753 It is possible to specify ret_type to show only ``files`` or ``dirs``.
736 It is possible to specify ret_type to show only ``files`` or ``dirs``.
754 This command can only be executed using the api_key of a user with admin rights.
737 This command can only be executed using the api_key of a user with admin rights.
755
738
756
739
757 INPUT::
740 INPUT::
758
741
759 id : <id_for_response>
742 id : <id_for_response>
760 api_key : "<api_key>"
743 api_key : "<api_key>"
761 method : "get_repo_nodes"
744 method : "get_repo_nodes"
762 args: {
745 args: {
763 "repoid" : "<reponame or repo_id>"
746 "repoid" : "<reponame or repo_id>"
764 "revision" : "<revision>",
747 "revision" : "<revision>",
765 "root_path" : "<root_path>",
748 "root_path" : "<root_path>",
766 "ret_type" : "<ret_type> = Optional('all')"
749 "ret_type" : "<ret_type> = Optional('all')"
767 }
750 }
768
751
769 OUTPUT::
752 OUTPUT::
770
753
771 id : <id_given_in_input>
754 id : <id_given_in_input>
772 result: [
755 result: [
773 {
756 {
774 "name" : "<name>"
757 "name" : "<name>"
775 "type" : "<type>",
758 "type" : "<type>",
776 },
759 },
777 …
760 …
778 ]
761 ]
779 error: null
762 error: null
780
763
781
782 create_repo
764 create_repo
783 -----------
765 -----------
784
766
785 Create a repository. If the repository name contains "/", all needed repository
767 Create a repository. If the repository name contains "/", all needed repository
786 groups will be created. For example "foo/bar/baz" will create repository groups
768 groups will be created. For example "foo/bar/baz" will create repository groups
787 "foo", "bar" (with "foo" as parent), and create "baz" repository with
769 "foo", "bar" (with "foo" as parent), and create "baz" repository with
788 "bar" as group.
770 "bar" as group.
789 This command can only be executed using the api_key of a user with admin rights,
771 This command can only be executed using the api_key of a user with admin rights,
790 or that of a regular user with create repository permission.
772 or that of a regular user with create repository permission.
791 Regular users cannot specify owner parameter.
773 Regular users cannot specify owner parameter.
792
774
793
775
794 INPUT::
776 INPUT::
795
777
796 id : <id_for_response>
778 id : <id_for_response>
797 api_key : "<api_key>"
779 api_key : "<api_key>"
798 method : "create_repo"
780 method : "create_repo"
799 args: {
781 args: {
800 "repo_name" : "<reponame>",
782 "repo_name" : "<reponame>",
801 "owner" : "<owner_name_or_id = Optional(=apiuser)>",
783 "owner" : "<owner_name_or_id = Optional(=apiuser)>",
802 "repo_type" : "<repo_type> = Optional('hg')",
784 "repo_type" : "<repo_type> = Optional('hg')",
803 "description" : "<description> = Optional('')",
785 "description" : "<description> = Optional('')",
804 "private" : "<bool> = Optional(False)",
786 "private" : "<bool> = Optional(False)",
805 "clone_uri" : "<clone_uri> = Optional(None)",
787 "clone_uri" : "<clone_uri> = Optional(None)",
806 "landing_rev" : "<landing_rev> = Optional('tip')",
788 "landing_rev" : "<landing_rev> = Optional('tip')",
807 "enable_downloads": "<bool> = Optional(False)",
789 "enable_downloads": "<bool> = Optional(False)",
808 "enable_locking": "<bool> = Optional(False)",
790 "enable_locking": "<bool> = Optional(False)",
809 "enable_statistics": "<bool> = Optional(False)",
791 "enable_statistics": "<bool> = Optional(False)",
810 }
792 }
811
793
812 OUTPUT::
794 OUTPUT::
813
795
814 id : <id_given_in_input>
796 id : <id_given_in_input>
815 result: {
797 result: {
816 "msg": "Created new repository `<reponame>`",
798 "msg": "Created new repository `<reponame>`",
817 "repo": {
799 "repo": {
818 "repo_id" : "<repo_id>",
800 "repo_id" : "<repo_id>",
819 "repo_name" : "<reponame>"
801 "repo_name" : "<reponame>"
820 "repo_type" : "<repo_type>",
802 "repo_type" : "<repo_type>",
821 "clone_uri" : "<clone_uri>",
803 "clone_uri" : "<clone_uri>",
822 "private" : "<bool>",
804 "private" : "<bool>",
823 "created_on" : "<datetimecreated>",
805 "created_on" : "<datetimecreated>",
824 "description" : "<description>",
806 "description" : "<description>",
825 "landing_rev": "<landing_rev>",
807 "landing_rev": "<landing_rev>",
826 "owner": "<username or user_id>",
808 "owner": "<username or user_id>",
827 "fork_of": "<name_of_fork_parent>",
809 "fork_of": "<name_of_fork_parent>",
828 "enable_downloads": "<bool>",
810 "enable_downloads": "<bool>",
829 "enable_locking": "<bool>",
811 "enable_locking": "<bool>",
830 "enable_statistics": "<bool>",
812 "enable_statistics": "<bool>",
831 },
813 },
832 }
814 }
833 error: null
815 error: null
834
816
835
836 update_repo
817 update_repo
837 -----------
818 -----------
838
819
839 Update a repository.
820 Update a repository.
840 This command can only be executed using the api_key of a user with admin rights,
821 This command can only be executed using the api_key of a user with admin rights,
841 or that of a regular user with create repository permission.
822 or that of a regular user with create repository permission.
842 Regular users cannot specify owner parameter.
823 Regular users cannot specify owner parameter.
843
824
844
825
845 INPUT::
826 INPUT::
846
827
847 id : <id_for_response>
828 id : <id_for_response>
848 api_key : "<api_key>"
829 api_key : "<api_key>"
849 method : "update_repo"
830 method : "update_repo"
850 args: {
831 args: {
851 "repoid" : "<reponame or repo_id>"
832 "repoid" : "<reponame or repo_id>"
852 "name" : "<reponame> = Optional('')",
833 "name" : "<reponame> = Optional('')",
853 "group" : "<group_id> = Optional(None)",
834 "group" : "<group_id> = Optional(None)",
854 "owner" : "<owner_name_or_id = Optional(=apiuser)>",
835 "owner" : "<owner_name_or_id = Optional(=apiuser)>",
855 "description" : "<description> = Optional('')",
836 "description" : "<description> = Optional('')",
856 "private" : "<bool> = Optional(False)",
837 "private" : "<bool> = Optional(False)",
857 "clone_uri" : "<clone_uri> = Optional(None)",
838 "clone_uri" : "<clone_uri> = Optional(None)",
858 "landing_rev" : "<landing_rev> = Optional('tip')",
839 "landing_rev" : "<landing_rev> = Optional('tip')",
859 "enable_downloads": "<bool> = Optional(False)",
840 "enable_downloads": "<bool> = Optional(False)",
860 "enable_locking": "<bool> = Optional(False)",
841 "enable_locking": "<bool> = Optional(False)",
861 "enable_statistics": "<bool> = Optional(False)",
842 "enable_statistics": "<bool> = Optional(False)",
862 }
843 }
863
844
864 OUTPUT::
845 OUTPUT::
865
846
866 id : <id_given_in_input>
847 id : <id_given_in_input>
867 result: {
848 result: {
868 "msg": "updated repo ID:repo_id `<reponame>`",
849 "msg": "updated repo ID:repo_id `<reponame>`",
869 "repository": {
850 "repository": {
870 "repo_id" : "<repo_id>",
851 "repo_id" : "<repo_id>",
871 "repo_name" : "<reponame>"
852 "repo_name" : "<reponame>"
872 "repo_type" : "<repo_type>",
853 "repo_type" : "<repo_type>",
873 "clone_uri" : "<clone_uri>",
854 "clone_uri" : "<clone_uri>",
874 "private": "<bool>",
855 "private": "<bool>",
875 "created_on" : "<datetimecreated>",
856 "created_on" : "<datetimecreated>",
876 "description" : "<description>",
857 "description" : "<description>",
877 "landing_rev": "<landing_rev>",
858 "landing_rev": "<landing_rev>",
878 "owner": "<username or user_id>",
859 "owner": "<username or user_id>",
879 "fork_of": "<name_of_fork_parent>",
860 "fork_of": "<name_of_fork_parent>",
880 "enable_downloads": "<bool>",
861 "enable_downloads": "<bool>",
881 "enable_locking": "<bool>",
862 "enable_locking": "<bool>",
882 "enable_statistics": "<bool>",
863 "enable_statistics": "<bool>",
883 "last_changeset": {
864 "last_changeset": {
884 "author": "<full_author>",
865 "author": "<full_author>",
885 "date": "<date_time_of_commit>",
866 "date": "<date_time_of_commit>",
886 "message": "<commit_message>",
867 "message": "<commit_message>",
887 "raw_id": "<raw_id>",
868 "raw_id": "<raw_id>",
888 "revision": "<numeric_revision>",
869 "revision": "<numeric_revision>",
889 "short_id": "<short_id>"
870 "short_id": "<short_id>"
890 }
871 }
891 "locked_by": "<username>",
872 "locked_by": "<username>",
892 "locked_date": "<float lock_time>",
873 "locked_date": "<float lock_time>",
893 },
874 },
894 }
875 }
895 error: null
876 error: null
896
877
897
898 fork_repo
878 fork_repo
899 ---------
879 ---------
900
880
901 Create a fork of the given repo. If using Celery, this will
881 Create a fork of the given repo. If using Celery, this will
902 return success message immediately and a fork will be created
882 return success message immediately and a fork will be created
903 asynchronously.
883 asynchronously.
904 This command can only be executed using the api_key of a user with admin
884 This command can only be executed using the api_key of a user with admin
905 rights, or with the global fork permission, by a regular user with create
885 rights, or with the global fork permission, by a regular user with create
906 repository permission and at least read access to the repository.
886 repository permission and at least read access to the repository.
907 Regular users cannot specify owner parameter.
887 Regular users cannot specify owner parameter.
908
888
909
889
910 INPUT::
890 INPUT::
911
891
912 id : <id_for_response>
892 id : <id_for_response>
913 api_key : "<api_key>"
893 api_key : "<api_key>"
914 method : "fork_repo"
894 method : "fork_repo"
915 args: {
895 args: {
916 "repoid" : "<reponame or repo_id>",
896 "repoid" : "<reponame or repo_id>",
917 "fork_name": "<forkname>",
897 "fork_name": "<forkname>",
918 "owner": "<username or user_id = Optional(=apiuser)>",
898 "owner": "<username or user_id = Optional(=apiuser)>",
919 "description": "<description>",
899 "description": "<description>",
920 "copy_permissions": "<bool>",
900 "copy_permissions": "<bool>",
921 "private": "<bool>",
901 "private": "<bool>",
922 "landing_rev": "<landing_rev>"
902 "landing_rev": "<landing_rev>"
923
903
924 }
904 }
925
905
926 OUTPUT::
906 OUTPUT::
927
907
928 id : <id_given_in_input>
908 id : <id_given_in_input>
929 result: {
909 result: {
930 "msg": "Created fork of `<reponame>` as `<forkname>`",
910 "msg": "Created fork of `<reponame>` as `<forkname>`",
931 "success": true
911 "success": true
932 }
912 }
933 error: null
913 error: null
934
914
935
936 delete_repo
915 delete_repo
937 -----------
916 -----------
938
917
939 Delete a repository.
918 Delete a repository.
940 This command can only be executed using the api_key of a user with admin rights,
919 This command can only be executed using the api_key of a user with admin rights,
941 or that of a regular user with admin access to the repository.
920 or that of a regular user with admin access to the repository.
942 When ``forks`` param is set it is possible to detach or delete forks of the deleted repository.
921 When ``forks`` param is set it is possible to detach or delete forks of the deleted repository.
943
922
944
923
945 INPUT::
924 INPUT::
946
925
947 id : <id_for_response>
926 id : <id_for_response>
948 api_key : "<api_key>"
927 api_key : "<api_key>"
949 method : "delete_repo"
928 method : "delete_repo"
950 args: {
929 args: {
951 "repoid" : "<reponame or repo_id>",
930 "repoid" : "<reponame or repo_id>",
952 "forks" : "`delete` or `detach` = Optional(None)"
931 "forks" : "`delete` or `detach` = Optional(None)"
953 }
932 }
954
933
955 OUTPUT::
934 OUTPUT::
956
935
957 id : <id_given_in_input>
936 id : <id_given_in_input>
958 result: {
937 result: {
959 "msg": "Deleted repository `<reponame>`",
938 "msg": "Deleted repository `<reponame>`",
960 "success": true
939 "success": true
961 }
940 }
962 error: null
941 error: null
963
942
964
965 grant_user_permission
943 grant_user_permission
966 ---------------------
944 ---------------------
967
945
968 Grant permission for a user on the given repository, or update the existing one if found.
946 Grant permission for a user on the given repository, or update the existing one if found.
969 This command can only be executed using the api_key of a user with admin rights.
947 This command can only be executed using the api_key of a user with admin rights.
970
948
971
949
972 INPUT::
950 INPUT::
973
951
974 id : <id_for_response>
952 id : <id_for_response>
975 api_key : "<api_key>"
953 api_key : "<api_key>"
976 method : "grant_user_permission"
954 method : "grant_user_permission"
977 args: {
955 args: {
978 "repoid" : "<reponame or repo_id>"
956 "repoid" : "<reponame or repo_id>"
979 "userid" : "<username or user_id>"
957 "userid" : "<username or user_id>"
980 "perm" : "(repository.(none|read|write|admin))",
958 "perm" : "(repository.(none|read|write|admin))",
981 }
959 }
982
960
983 OUTPUT::
961 OUTPUT::
984
962
985 id : <id_given_in_input>
963 id : <id_given_in_input>
986 result: {
964 result: {
987 "msg" : "Granted perm: `<perm>` for user: `<username>` in repo: `<reponame>`",
965 "msg" : "Granted perm: `<perm>` for user: `<username>` in repo: `<reponame>`",
988 "success": true
966 "success": true
989 }
967 }
990 error: null
968 error: null
991
969
992
993 revoke_user_permission
970 revoke_user_permission
994 ----------------------
971 ----------------------
995
972
996 Revoke permission for a user on the given repository.
973 Revoke permission for a user on the given repository.
997 This command can only be executed using the api_key of a user with admin rights.
974 This command can only be executed using the api_key of a user with admin rights.
998
975
999
976
1000 INPUT::
977 INPUT::
1001
978
1002 id : <id_for_response>
979 id : <id_for_response>
1003 api_key : "<api_key>"
980 api_key : "<api_key>"
1004 method : "revoke_user_permission"
981 method : "revoke_user_permission"
1005 args: {
982 args: {
1006 "repoid" : "<reponame or repo_id>"
983 "repoid" : "<reponame or repo_id>"
1007 "userid" : "<username or user_id>"
984 "userid" : "<username or user_id>"
1008 }
985 }
1009
986
1010 OUTPUT::
987 OUTPUT::
1011
988
1012 id : <id_given_in_input>
989 id : <id_given_in_input>
1013 result: {
990 result: {
1014 "msg" : "Revoked perm for user: `<username>` in repo: `<reponame>`",
991 "msg" : "Revoked perm for user: `<username>` in repo: `<reponame>`",
1015 "success": true
992 "success": true
1016 }
993 }
1017 error: null
994 error: null
1018
995
1019
1020 grant_user_group_permission
996 grant_user_group_permission
1021 ---------------------------
997 ---------------------------
1022
998
1023 Grant permission for a user group on the given repository, or update the
999 Grant permission for a user group on the given repository, or update the
1024 existing one if found.
1000 existing one if found.
1025 This command can only be executed using the api_key of a user with admin rights.
1001 This command can only be executed using the api_key of a user with admin rights.
1026
1002
1027
1003
1028 INPUT::
1004 INPUT::
1029
1005
1030 id : <id_for_response>
1006 id : <id_for_response>
1031 api_key : "<api_key>"
1007 api_key : "<api_key>"
1032 method : "grant_user_group_permission"
1008 method : "grant_user_group_permission"
1033 args: {
1009 args: {
1034 "repoid" : "<reponame or repo_id>"
1010 "repoid" : "<reponame or repo_id>"
1035 "usersgroupid" : "<user group id or name>"
1011 "usersgroupid" : "<user group id or name>"
1036 "perm" : "(repository.(none|read|write|admin))",
1012 "perm" : "(repository.(none|read|write|admin))",
1037 }
1013 }
1038
1014
1039 OUTPUT::
1015 OUTPUT::
1040
1016
1041 id : <id_given_in_input>
1017 id : <id_given_in_input>
1042 result: {
1018 result: {
1043 "msg" : "Granted perm: `<perm>` for group: `<usersgroupname>` in repo: `<reponame>`",
1019 "msg" : "Granted perm: `<perm>` for group: `<usersgroupname>` in repo: `<reponame>`",
1044 "success": true
1020 "success": true
1045 }
1021 }
1046 error: null
1022 error: null
1047
1023
1048
1049 revoke_user_group_permission
1024 revoke_user_group_permission
1050 ----------------------------
1025 ----------------------------
1051
1026
1052 Revoke permission for a user group on the given repository.
1027 Revoke permission for a user group on the given repository.
1053 This command can only be executed using the api_key of a user with admin rights.
1028 This command can only be executed using the api_key of a user with admin rights.
1054
1029
1055 INPUT::
1030 INPUT::
1056
1031
1057 id : <id_for_response>
1032 id : <id_for_response>
1058 api_key : "<api_key>"
1033 api_key : "<api_key>"
1059 method : "revoke_user_group_permission"
1034 method : "revoke_user_group_permission"
1060 args: {
1035 args: {
1061 "repoid" : "<reponame or repo_id>"
1036 "repoid" : "<reponame or repo_id>"
1062 "usersgroupid" : "<user group id or name>"
1037 "usersgroupid" : "<user group id or name>"
1063 }
1038 }
1064
1039
1065 OUTPUT::
1040 OUTPUT::
1066
1041
1067 id : <id_given_in_input>
1042 id : <id_given_in_input>
1068 result: {
1043 result: {
1069 "msg" : "Revoked perm for group: `<usersgroupname>` in repo: `<reponame>`",
1044 "msg" : "Revoked perm for group: `<usersgroupname>` in repo: `<reponame>`",
1070 "success": true
1045 "success": true
1071 }
1046 }
1072 error: null
1047 error: null
@@ -1,9 +1,10 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
9 .. __: https://kallithea-scm.org/repos/kallithea/changelog
10 .. __: https://kallithea-scm.org/repos/kallithea/changelog
@@ -1,156 +1,159 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 on Our Own Kallithea (aka OOK) at
14 The main repository is hosted on Our Own Kallithea (aka OOK) at
15 https://kallithea-scm.org/repos/kallithea/, 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 tracking`_. 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`_ or :ref:`IRC <readme>` 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
27 Getting started
28 Getting started
28 ---------------
29 ---------------
29
30
30 To get started with development::
31 To get started with development::
31
32
32 hg clone https://kallithea-scm.org/repos/kallithea
33 hg clone https://kallithea-scm.org/repos/kallithea
33 cd kallithea
34 cd kallithea
34 virtualenv ../kallithea-venv
35 virtualenv ../kallithea-venv
35 source ../kallithea-venv/bin/activate
36 source ../kallithea-venv/bin/activate
36 python setup.py develop
37 python setup.py develop
37 paster make-config Kallithea my.ini
38 paster make-config Kallithea my.ini
38 paster setup-db my.ini --user=user --email=user@example.com --password=password --repos=/tmp
39 paster setup-db my.ini --user=user --email=user@example.com --password=password --repos=/tmp
39 paster serve my.ini --reload &
40 paster serve my.ini --reload &
40 firefox http://127.0.0.1:5000/
41 firefox http://127.0.0.1:5000/
41
42
42 You can also start out by forking https://bitbucket.org/conservancy/kallithea
43 You can also start out by forking https://bitbucket.org/conservancy/kallithea
43 on Bitbucket_ and create a local clone of your own fork.
44 on Bitbucket_ and create a local clone of your own fork.
44
45
45
46
46 Running tests
47 Running tests
47 -------------
48 -------------
48
49
49 After finishing your changes make sure all tests pass cleanly. You can run
50 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
51 the testsuite running ``nosetests`` from the project root, or if you use tox
51 run ``tox`` for Python 2.6--2.7 with multiple database test.
52 run ``tox`` for Python 2.6--2.7 with multiple database test.
52
53
53 When running tests, Kallithea uses `kallithea/tests/test.ini` and populates the
54 When running tests, Kallithea uses `kallithea/tests/test.ini` and populates the
54 SQLite database specified there.
55 SQLite database specified there.
55
56
56 It is possible to avoid recreating the full test database on each invocation of
57 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::
58 the tests, thus eliminating the initial delay. To achieve this, run the tests as::
58
59
59 paster serve kallithea/tests/test.ini --pid-file=test.pid --daemon
60 paster serve kallithea/tests/test.ini --pid-file=test.pid --daemon
60 KALLITHEA_WHOOSH_TEST_DISABLE=1 KALLITHEA_NO_TMP_PATH=1 nosetests
61 KALLITHEA_WHOOSH_TEST_DISABLE=1 KALLITHEA_NO_TMP_PATH=1 nosetests
61 kill -9 $(cat test.pid)
62 kill -9 $(cat test.pid)
62
63
63 You can run individual tests by specifying their path as argument to nosetests.
64 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
65 nosetests also has many more options, see `nosetests -h`. Some useful options
65 are::
66 are::
66
67
67 -x, --stop Stop running tests after the first error or failure
68 -x, --stop Stop running tests after the first error or failure
68 -s, --nocapture Don't capture stdout (any stdout output will be
69 -s, --nocapture Don't capture stdout (any stdout output will be
69 printed immediately) [NOSE_NOCAPTURE]
70 printed immediately) [NOSE_NOCAPTURE]
70 --failed Run the tests that failed in the last test run.
71 --failed Run the tests that failed in the last test run.
71
72
73
72 Coding/contribution guidelines
74 Coding/contribution guidelines
73 ------------------------------
75 ------------------------------
74
76
75 Kallithea is GPLv3 and we assume all contributions are made by the
77 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
78 committer/contributor and under GPLv3 unless explicitly stated. We do care a
77 lot about preservation of copyright and license information for existing code
79 lot about preservation of copyright and license information for existing code
78 that is brought into the project.
80 that is brought into the project.
79
81
80 We don't have a formal coding/formatting standard. We are currently using a mix
82 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
83 of Mercurial (http://mercurial.selenic.com/wiki/CodingStyle), pep8, and
82 consistency with existing code. Run whitespacecleanup.sh to avoid stupid
84 consistency with existing code. Run whitespacecleanup.sh to avoid stupid
83 whitespace noise in your patches.
85 whitespace noise in your patches.
84
86
85 We support both Python 2.6.x and 2.7.x and nothing else. For now we don't care
87 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.
88 about Python 3 compatibility.
87
89
88 We try to support the most common modern web browsers. IE9 is still supported
90 We try to support the most common modern web browsers. IE9 is still supported
89 to the extent it is feasible, IE8 is not.
91 to the extent it is feasible, IE8 is not.
90
92
91 We primarily support Linux and OS X on the server side but Windows should also work.
93 We primarily support Linux and OS X on the server side but Windows should also work.
92
94
93 HTML templates should use 2 spaces for indentation ... but be pragmatic. We
95 HTML templates should use 2 spaces for indentation ... but be pragmatic. We
94 should use templates cleverly and avoid duplication. We should use reasonable
96 should use templates cleverly and avoid duplication. We should use reasonable
95 semantic markup with element classes and IDs that can be used for styling and testing.
97 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
98 We should only use inline styles in places where it really is semantic (such as
97 ``display: none``).
99 ``display: none``).
98
100
99 JavaScript must use ``;`` between/after statements. Indentation 4 spaces. Inline
101 JavaScript must use ``;`` between/after statements. Indentation 4 spaces. Inline
100 multiline functions should be indented two levels -- one for the ``()`` and one for
102 multiline functions should be indented two levels -- one for the ``()`` and one for
101 ``{}``.
103 ``{}``.
102 Variables holding jQuery objects should be named with a leading ``$``.
104 Variables holding jQuery objects should be named with a leading ``$``.
103
105
104 Commit messages should have a leading short line summarizing the changes. For
106 Commit messages should have a leading short line summarizing the changes. For
105 bug fixes, put ``(Issue #123)`` at the end of this line.
107 bug fixes, put ``(Issue #123)`` at the end of this line.
106
108
107 Use American English grammar and spelling overall. Use `English title case`_ for
109 Use American English grammar and spelling overall. Use `English title case`_ for
108 page titles, button labels, headers, and 'labels' for fields in forms.
110 page titles, button labels, headers, and 'labels' for fields in forms.
109
111
110 .. _English title case: https://en.wikipedia.org/wiki/Capitalization#Title_case
112 .. _English title case: https://en.wikipedia.org/wiki/Capitalization#Title_case
111
113
112 Contributions will be accepted in most formats -- such as pull requests on
114 Contributions will be accepted in most formats -- such as pull requests on
113 bitbucket, something hosted on your own Kallithea instance, or patches sent by
115 bitbucket, something hosted on your own Kallithea instance, or patches sent by
114 email to the `kallithea-general`_ mailing list.
116 email to the `kallithea-general`_ mailing list.
115
117
116 Make sure to test your changes both manually and with the automatic tests
118 Make sure to test your changes both manually and with the automatic tests
117 before posting.
119 before posting.
118
120
119 We care about quality and review and keeping a clean repository history. We
121 We care about quality and review and keeping a clean repository history. We
120 might give feedback that requests polishing contributions until they are
122 might give feedback that requests polishing contributions until they are
121 "perfect". We might also rebase and collapse and make minor adjustments to your
123 "perfect". We might also rebase and collapse and make minor adjustments to your
122 changes when we apply them.
124 changes when we apply them.
123
125
124 We try to make sure we have consensus on the direction the project is taking.
126 We try to make sure we have consensus on the direction the project is taking.
125 Everything non-sensitive should be discussed in public -- preferably on the
127 Everything non-sensitive should be discussed in public -- preferably on the
126 mailing list. We aim at having all non-trivial changes reviewed by at least
128 mailing list. We aim at having all non-trivial changes reviewed by at least
127 one other core developer before pushing. Obvious non-controversial changes will
129 one other core developer before pushing. Obvious non-controversial changes will
128 be handled more casually.
130 be handled more casually.
129
131
130 For now we just have one official branch ("default") and will keep it so stable
132 For now we just have one official branch ("default") and will keep it so stable
131 that it can be (and is) used in production. Experimental changes should live
133 that it can be (and is) used in production. Experimental changes should live
132 elsewhere (for example in a pull request) until they are ready.
134 elsewhere (for example in a pull request) until they are ready.
133
135
134 .. _translations:
136 .. _translations:
135 .. include:: ./../kallithea/i18n/how_to
137 .. include:: ./../kallithea/i18n/how_to
136
138
139
137 "Roadmap"
140 "Roadmap"
138 ---------
141 ---------
139
142
140 We do not have a road map but are waiting for your contributions. Refer to the
143 We do not have a road map but are waiting for your contributions. Refer to the
141 wiki_ for some ideas of places we might want to go -- contributions in these
144 wiki_ for some ideas of places we might want to go -- contributions in these
142 areas are very welcome.
145 areas are very welcome.
143
146
144
147
145 Thank you for your contribution!
148 Thank you for your contribution!
146 --------------------------------
149 --------------------------------
147
150
148
151
149 .. _Weblate: http://weblate.org/
152 .. _Weblate: http://weblate.org/
150 .. _issue tracking: https://bitbucket.org/conservancy/kallithea/issues?status=new&status=open
153 .. _issue tracking: https://bitbucket.org/conservancy/kallithea/issues?status=new&status=open
151 .. _pull requests: https://bitbucket.org/conservancy/kallithea/pull-requests
154 .. _pull requests: https://bitbucket.org/conservancy/kallithea/pull-requests
152 .. _bitbucket: http://bitbucket.org/
155 .. _bitbucket: http://bitbucket.org/
153 .. _mailing list: http://lists.sfconservancy.org/mailman/listinfo/kallithea-general
156 .. _mailing list: http://lists.sfconservancy.org/mailman/listinfo/kallithea-general
154 .. _kallithea-general: http://lists.sfconservancy.org/mailman/listinfo/kallithea-general
157 .. _kallithea-general: http://lists.sfconservancy.org/mailman/listinfo/kallithea-general
155 .. _Hosted Weblate: https://hosted.weblate.org/projects/kallithea/kallithea/
158 .. _Hosted Weblate: https://hosted.weblate.org/projects/kallithea/kallithea/
156 .. _wiki: https://bitbucket.org/conservancy/kallithea/wiki/Home
159 .. _wiki: https://bitbucket.org/conservancy/kallithea/wiki/Home
@@ -1,80 +1,80 b''
1 .. _index:
1 .. _index:
2
2
3 #######################
3 #######################
4 Kallithea Documentation
4 Kallithea Documentation
5 #######################
5 #######################
6
6
7
8 **Readme**
7 **Readme**
9
8
10 .. toctree::
9 .. toctree::
11 :maxdepth: 1
10 :maxdepth: 1
12
11
13 readme
12 readme
14
13
15 **Installation**
14 **Installation**
16
15
17 .. toctree::
16 .. toctree::
18 :maxdepth: 1
17 :maxdepth: 1
19
18
20 overview
19 overview
21 installation
20 installation
22 installation_win
21 installation_win
23 installation_win_old
22 installation_win_old
24 installation_iis
23 installation_iis
25 setup
24 setup
26
25
27 **Usage**
26 **Usage**
28
27
29 .. toctree::
28 .. toctree::
30 :maxdepth: 1
29 :maxdepth: 1
31
30
32 usage/general
31 usage/general
33 usage/vcs_support
32 usage/vcs_support
34 usage/locking
33 usage/locking
35 usage/statistics
34 usage/statistics
36
35
37 **Administrator's guide**
36 **Administrator's guide**
38
37
39 .. toctree::
38 .. toctree::
40 :maxdepth: 1
39 :maxdepth: 1
41
40
42 usage/email
41 usage/email
43 usage/performance
42 usage/performance
44 usage/backup
43 usage/backup
45 usage/debugging
44 usage/debugging
46 usage/troubleshooting
45 usage/troubleshooting
47
46
48 **Development**
47 **Development**
49
48
50 .. toctree::
49 .. toctree::
51 :maxdepth: 1
50 :maxdepth: 1
52
51
53 contributing
52 contributing
54 changelog
53 changelog
55
54
56 **API**
55 **API**
57
56
58 .. toctree::
57 .. toctree::
59 :maxdepth: 1
58 :maxdepth: 1
60
59
61 api/api
60 api/api
62 api/models
61 api/models
63
62
64
63
65 Other topics
64 Other topics
66 ------------
65 ------------
67
66
68 * :ref:`genindex`
67 * :ref:`genindex`
69 * :ref:`search`
68 * :ref:`search`
70
69
70
71 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
71 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
72 .. _python: http://www.python.org/
72 .. _python: http://www.python.org/
73 .. _django: http://www.djangoproject.com/
73 .. _django: http://www.djangoproject.com/
74 .. _mercurial: http://mercurial.selenic.com/
74 .. _mercurial: http://mercurial.selenic.com/
75 .. _bitbucket: http://bitbucket.org/
75 .. _bitbucket: http://bitbucket.org/
76 .. _subversion: http://subversion.tigris.org/
76 .. _subversion: http://subversion.tigris.org/
77 .. _git: http://git-scm.com/
77 .. _git: http://git-scm.com/
78 .. _celery: http://celeryproject.org/
78 .. _celery: http://celeryproject.org/
79 .. _Sphinx: http://sphinx.pocoo.org/
79 .. _Sphinx: http://sphinx.pocoo.org/
80 .. _vcs: http://pypi.python.org/pypi/vcs
80 .. _vcs: http://pypi.python.org/pypi/vcs
@@ -1,204 +1,208 b''
1 .. _installation:
1 .. _installation:
2
2
3 ==========================
3 ==========================
4 Installation on Unix/Linux
4 Installation on Unix/Linux
5 ==========================
5 ==========================
6
6
7 The following describes three different ways of installing 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 up-to-date and track any 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, preferably inside a virtualenv
11 source in a Kallithea repository clone, preferably inside a virtualenv
12 virtual Python environment.
12 virtual Python environment.
13
13
14 - :ref:`installation-virtualenv`: If you prefer to only use released versions
14 - :ref:`installation-virtualenv`: If you prefer to only use released versions
15 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
16 Python environment using `virtualenv`. The advantages of this method over
16 Python environment using `virtualenv`. The advantages of this method over
17 direct installation is that Kallithea and its dependencies are completely
17 direct installation is that Kallithea and its dependencies are completely
18 contained inside the virtualenv (which also means you can have multiple
18 contained inside the virtualenv (which also means you can have multiple
19 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
20 virtualenv directory) and does not require root privileges.
20 virtualenv directory) and does not require root privileges.
21
21
22 - :ref:`installation-without-virtualenv`: The alternative method of installing
22 - :ref:`installation-without-virtualenv`: The alternative method of installing
23 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
24 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
25 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
26 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
27 needed by other packages.
27 needed by other packages.
28
28
29 .. _installation-source:
29 .. _installation-source:
30
30
31
31 Installation from repository source
32 Installation from repository source
32 -----------------------------------
33 -----------------------------------
33
34
34 To install Kallithea in a virtualenv_ using the stable branch of the development
35 To install Kallithea in a virtualenv_ using the stable branch of the development
35 repository, follow the instructions below::
36 repository, follow the instructions below::
36
37
37 hg clone https://kallithea-scm.org/repos/kallithea -u stable
38 hg clone https://kallithea-scm.org/repos/kallithea -u stable
38 cd kallithea
39 cd kallithea
39 virtualenv ../kallithea-venv
40 virtualenv ../kallithea-venv
40 source ../kallithea-venv/bin/activate
41 source ../kallithea-venv/bin/activate
41 python setup.py develop
42 python setup.py develop
42 python setup.py compile_catalog # for translation of the UI
43 python setup.py compile_catalog # for translation of the UI
43
44
44 You can now proceed to :ref:`setup`.
45 You can now proceed to :ref:`setup`.
45
46
46 To upgrade, simply update the repository with ``hg pull -u`` and restart the
47 To upgrade, simply update the repository with ``hg pull -u`` and restart the
47 server.
48 server.
48
49
49 .. _installation-virtualenv:
50 .. _installation-virtualenv:
50
51
52
51 Installing a released version in a virtualenv
53 Installing a released version in a virtualenv
52 ---------------------------------------------
54 ---------------------------------------------
53
55
54 It is highly recommended to use a separate virtualenv_ for installing Kallithea.
56 It is highly recommended to use a separate virtualenv_ for installing Kallithea.
55 This way, all libraries required by Kallithea will be installed separately from your
57 This way, all libraries required by Kallithea will be installed separately from your
56 main Python installation and other applications and things will be less
58 main Python installation and other applications and things will be less
57 problematic when upgrading the system or Kallithea.
59 problematic when upgrading the system or Kallithea.
58 An additional benefit of virtualenv_ is that it doesn't require root privileges.
60 An additional benefit of virtualenv_ is that it doesn't require root privileges.
59
61
60 - Assuming you have installed virtualenv_, create a new virtual environment
62 - Assuming you have installed virtualenv_, create a new virtual environment
61 for example, in `/srv/kallithea/venv`, using the virtualenv command::
63 for example, in `/srv/kallithea/venv`, using the virtualenv command::
62
64
63 virtualenv /srv/kallithea/venv
65 virtualenv /srv/kallithea/venv
64
66
65 - Activate the virtualenv_ in your current shell session by running::
67 - Activate the virtualenv_ in your current shell session by running::
66
68
67 source /srv/kallithea/venv/bin/activate
69 source /srv/kallithea/venv/bin/activate
68
70
69 .. note:: You can't use UNIX ``sudo`` to source the ``virtualenv`` script; it
71 .. note:: You can't use UNIX ``sudo`` to source the ``virtualenv`` script; it
70 will "activate" a shell that terminates immediately. It is also perfectly
72 will "activate" a shell that terminates immediately. It is also perfectly
71 acceptable (and desirable) to create a virtualenv as a normal user.
73 acceptable (and desirable) to create a virtualenv as a normal user.
72
74
73 - Make a folder for Kallithea data files, and configuration somewhere on the
75 - Make a folder for Kallithea data files, and configuration somewhere on the
74 filesystem. For example::
76 filesystem. For example::
75
77
76 mkdir /srv/kallithea
78 mkdir /srv/kallithea
77
79
78 - Go into the created directory and run this command to install Kallithea::
80 - Go into the created directory and run this command to install Kallithea::
79
81
80 pip install kallithea
82 pip install kallithea
81
83
82 Alternatively, download a .tar.gz from http://pypi.python.org/pypi/Kallithea,
84 Alternatively, download a .tar.gz from http://pypi.python.org/pypi/Kallithea,
83 extract it and run::
85 extract it and run::
84
86
85 python setup.py install
87 python setup.py install
86
88
87 - This will install Kallithea together with pylons_ and all other required
89 - This will install Kallithea together with pylons_ and all other required
88 python libraries into the activated virtualenv.
90 python libraries into the activated virtualenv.
89
91
90 You can now proceed to :ref:`setup`.
92 You can now proceed to :ref:`setup`.
91
93
92 .. _installation-without-virtualenv:
94 .. _installation-without-virtualenv:
93
95
96
94 Installing a released version without virtualenv
97 Installing a released version without virtualenv
95 ------------------------------------------------
98 ------------------------------------------------
96
99
97 For installation without virtualenv, 'just' use::
100 For installation without virtualenv, 'just' use::
98
101
99 pip install kallithea
102 pip install kallithea
100
103
101 Note that this method requires root privileges and will install packages
104 Note that this method requires root privileges and will install packages
102 globally without using the system's package manager.
105 globally without using the system's package manager.
103
106
104 To install as a regular user in ``~/.local``, you can use::
107 To install as a regular user in ``~/.local``, you can use::
105
108
106 pip install --user kallithea
109 pip install --user kallithea
107
110
108 You can now proceed to :ref:`setup`.
111 You can now proceed to :ref:`setup`.
109
112
113
110 Upgrading Kallithea from Python Package Index (PyPI)
114 Upgrading Kallithea from Python Package Index (PyPI)
111 ----------------------------------------------------
115 ----------------------------------------------------
112
116
113 .. note::
117 .. note::
114 It is strongly recommended that you **always** perform a database and
118 It is strongly recommended that you **always** perform a database and
115 configuration backup before doing an upgrade.
119 configuration backup before doing an upgrade.
116
120
117 These directions will use '{version}' to note that this is the version of
121 These directions will use '{version}' to note that this is the version of
118 Kallithea that these files were used with. If backing up your Kallithea
122 Kallithea that these files were used with. If backing up your Kallithea
119 instance from version 0.1 to 0.2, the ``my.ini`` file could be
123 instance from version 0.1 to 0.2, the ``my.ini`` file could be
120 backed up to ``my.ini.0-1``.
124 backed up to ``my.ini.0-1``.
121
125
122
126
123 If using a SQLite database, stop the Kallithea process/daemon/service, and
127 If using a SQLite database, stop the Kallithea process/daemon/service, and
124 then make a copy of the database file::
128 then make a copy of the database file::
125
129
126 service kallithea stop
130 service kallithea stop
127 cp kallithea.db kallithea.db.{version}
131 cp kallithea.db kallithea.db.{version}
128
132
129
133
130 Back up your configuration file::
134 Back up your configuration file::
131
135
132 cp my.ini my.ini.{version}
136 cp my.ini my.ini.{version}
133
137
134
138
135 Ensure that you are using the Python virtual environment that you originally
139 Ensure that you are using the Python virtual environment that you originally
136 installed Kallithea in by running::
140 installed Kallithea in by running::
137
141
138 pip freeze
142 pip freeze
139
143
140 This will list all packages installed in the current environment. If
144 This will list all packages installed in the current environment. If
141 Kallithea isn't listed, activate the correct virtual environment::
145 Kallithea isn't listed, activate the correct virtual environment::
142
146
143 source /srv/kallithea/venv/bin/activate
147 source /srv/kallithea/venv/bin/activate
144
148
145
149
146 Once you have verified the environment you can upgrade Kallithea with::
150 Once you have verified the environment you can upgrade Kallithea with::
147
151
148 pip install --upgrade kallithea
152 pip install --upgrade kallithea
149
153
150
154
151 Then run the following command from the installation directory::
155 Then run the following command from the installation directory::
152
156
153 paster make-config Kallithea my.ini
157 paster make-config Kallithea my.ini
154
158
155 This will display any changes made by the new version of Kallithea to your
159 This will display any changes made by the new version of Kallithea to your
156 current configuration. It will try to perform an automerge. It is recommended
160 current configuration. It will try to perform an automerge. It is recommended
157 that you recheck the content after the automerge.
161 that you recheck the content after the automerge.
158
162
159 .. note::
163 .. note::
160 Please always make sure your .ini files are up to date. Errors can
164 Please always make sure your .ini files are up to date. Errors can
161 often be caused by missing parameters added in new versions.
165 often be caused by missing parameters added in new versions.
162
166
163
167
164 It is also recommended that you rebuild the whoosh index after upgrading since
168 It is also recommended that you rebuild the whoosh index after upgrading since
165 the new whoosh version could introduce some incompatible index changes. Please
169 the new whoosh version could introduce some incompatible index changes. Please
166 read the changelog to see if there were any changes to whoosh.
170 read the changelog to see if there were any changes to whoosh.
167
171
168
172
169 The final step is to upgrade the database. To do this simply run::
173 The final step is to upgrade the database. To do this simply run::
170
174
171 paster upgrade-db my.ini
175 paster upgrade-db my.ini
172
176
173 This will upgrade the schema and update some of the defaults in the database,
177 This will upgrade the schema and update some of the defaults in the database,
174 and will always recheck the settings of the application, if there are no new
178 and will always recheck the settings of the application, if there are no new
175 options that need to be set.
179 options that need to be set.
176
180
177
181
178 .. note::
182 .. note::
179 The DB schema upgrade library has some limitations and can sometimes fail if you try to
183 The DB schema upgrade library has some limitations and can sometimes fail if you try to
180 upgrade from older major releases. In such a case simply run upgrades sequentially, e.g.,
184 upgrade from older major releases. In such a case simply run upgrades sequentially, e.g.,
181 upgrading from 0.1.X to 0.3.X should be done like this: 0.1.X. > 0.2.X > 0.3.X
185 upgrading from 0.1.X to 0.3.X should be done like this: 0.1.X. > 0.2.X > 0.3.X
182 You can always specify what version of Kallithea you want to install for example in pip
186 You can always specify what version of Kallithea you want to install for example in pip
183 `pip install Kallithea==0.2`
187 `pip install Kallithea==0.2`
184
188
185 You may find it helpful to clear out your log file so that new errors are
189 You may find it helpful to clear out your log file so that new errors are
186 readily apparent::
190 readily apparent::
187
191
188 echo > kallithea.log
192 echo > kallithea.log
189
193
190 Once that is complete, you may now start your upgraded Kallithea Instance::
194 Once that is complete, you may now start your upgraded Kallithea Instance::
191
195
192 service kallithea start
196 service kallithea start
193
197
194 Or::
198 Or::
195
199
196 paster serve /srv/kallithea/my.ini
200 paster serve /srv/kallithea/my.ini
197
201
198 .. note::
202 .. note::
199 If you're using Celery, make sure you restart all instances of it after
203 If you're using Celery, make sure you restart all instances of it after
200 upgrade.
204 upgrade.
201
205
202
206
203 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
207 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
204 .. _pylons: http://www.pylonsproject.org/
208 .. _pylons: http://www.pylonsproject.org/
@@ -1,108 +1,110 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
15 Prerequisites
16 Prerequisites
16 -------------
17 -------------
17
18
18 Apart from the normal requirements for Kallithea, it is also necessary to get an
19 Apart from the normal requirements for Kallithea, it is also necessary to get an
19 ISAPI-WSGI bridge module, e.g. isapi-wsgi.
20 ISAPI-WSGI bridge module, e.g. isapi-wsgi.
20
21
22
21 Installation
23 Installation
22 ------------
24 ------------
23
25
24 The following assumes that your Kallithea is at ``c:\inetpub\kallithea``, and
26 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
27 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.
28 own virtual folder will be noted where appropriate.
27
29
28 Application pool
30 Application pool
29 ................
31 ................
30
32
31 Make sure that there is a unique application pool for the Kallithea application
33 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.
34 with an identity that has read access to the Kallithea distribution.
33
35
34 The application pool does not need to be able to run any managed code. If you
36 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
37 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
38 the advanced settings for the application pool; otherwise Python will not be able
37 to run on the website and neither will Kallithea.
39 to run on the website and neither will Kallithea.
38
40
39 .. note::
41 .. note::
40
42
41 The application pool can be the same as an existing application pool,
43 The application pool can be the same as an existing application pool,
42 as long as the Kallithea requirements are met by the existing pool.
44 as long as the Kallithea requirements are met by the existing pool.
43
45
44
45 ISAPI handler
46 ISAPI handler
46 .............
47 .............
47
48
48 The ISAPI handler can be generated using::
49 The ISAPI handler can be generated using::
49
50
50 paster install-iis my.ini --root=/
51 paster install-iis my.ini --root=/
51
52
52 This will generate a ``dispatch.py`` file in the current directory that contains
53 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
54 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
55 has been generated, it is necessary to run the following command due to the way
55 that ISAPI-WSGI is made::
56 that ISAPI-WSGI is made::
56
57
57 python dispatch.py install
58 python dispatch.py install
58
59
59 This accomplishes two things: generating an ISAPI compliant DLL file,
60 This accomplishes two things: generating an ISAPI compliant DLL file,
60 ``_dispatch.dll``, and installing a script map handler into IIS for the
61 ``_dispatch.dll``, and installing a script map handler into IIS for the
61 ``--root`` specified above pointing to ``_dispatch.dll``.
62 ``--root`` specified above pointing to ``_dispatch.dll``.
62
63
63 The ISAPI handler is registered to all file extensions, so it will automatically
64 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
65 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
66 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
67 middleware WSGI handler that Kallithea runs within and each HTTP request to the
67 site will be processed through this logic henceforth.
68 site will be processed through this logic henceforth.
68
69
69 Authentication with Kallithea using IIS authentication modules
70 Authentication with Kallithea using IIS authentication modules
70 ..............................................................
71 ..............................................................
71
72
72 The recommended way to handle authentication with Kallithea using IIS is to let
73 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.
74 IIS handle all the authentication and just pass it to Kallithea.
74
75
75 To move responsibility into IIS from Kallithea, we need to configure Kallithea
76 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
77 to let external systems handle authentication and then let Kallithea create the
77 user automatically. To do this, access the administration's authentication page
78 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
79 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*.
80 added, enable it with the ``REMOTE_USER`` header and check *Clean username*.
80 Finally, save the changes on this page.
81 Finally, save the changes on this page.
81
82
82 Switch to the administration's permissions page and disable anonymous access,
83 Switch to the administration's permissions page and disable anonymous access,
83 otherwise Kallithea will not attempt to use the authenticated user name. By
84 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
85 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
86 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
87 user database with an external tool, or set it to *Automatic activation of
87 external account*. Finally, save the changes.
88 external account*. Finally, save the changes.
88
89
89 The last necessary step is to enable the relevant authentication in IIS, e.g.
90 The last necessary step is to enable the relevant authentication in IIS, e.g.
90 Windows authentication.
91 Windows authentication.
91
92
93
92 Troubleshooting
94 Troubleshooting
93 ---------------
95 ---------------
94
96
95 Typically, any issues in this setup will either be entirely in IIS or entirely
97 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
98 in Kallithea (or Kallithea's WSGI/paster middleware). Consequently, two
97 different options for finding issues exist: IIS' failed request tracking which
99 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
100 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``.
101 ISAPI-WSGI wrapper above uses ``win32traceutil``, which is part of ``pywin32``.
100
102
101 In order to dump output from WSGI using ``win32traceutil`` it is sufficient to
103 In order to dump output from WSGI using ``win32traceutil`` it is sufficient to
102 type the following in a console window::
104 type the following in a console window::
103
105
104 python -m win32traceutil
106 python -m win32traceutil
105
107
106 and any exceptions occurring in the WSGI layer and below (i.e. in the Kallithea
108 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
109 application itself) that are uncaught, will be printed here complete with stack
108 traces, making it a lot easier to identify issues.
110 traces, making it a lot easier to identify issues.
@@ -1,254 +1,245 b''
1 .. _installation_win:
1 .. _installation_win:
2
2
3 ================================================================
3 ================================================================
4 Installation and upgrade on Windows (7/Server 2008 R2 and newer)
4 Installation and upgrade on Windows (7/Server 2008 R2 and newer)
5 ================================================================
5 ================================================================
6
6
7
7 First time install
8 First time install
8 ::::::::::::::::::
9 ::::::::::::::::::
9
10
10 Target OS: Windows 7 and newer or Windows Server 2008 R2 and newer
11 Target OS: Windows 7 and newer or Windows Server 2008 R2 and newer
11
12
12 Tested on Windows 8.1, Windows Server 2008 R2 and Windows Server 2012
13 Tested on Windows 8.1, Windows Server 2008 R2 and Windows Server 2012
13
14
14 To install on an older version of Windows, see `<installation_win_old.html>`_
15 To install on an older version of Windows, see `<installation_win_old.html>`_
15
16
16
17 Step 1 - Install Python
17 Step 1 - Install Python
18 -----------------------
18 -----------------------
19
19
20 Install Python 2.x.y (x = 6 or 7). Latest version is recommended. If you need another version, they can run side by side.
20 Install Python 2.x.y (x = 6 or 7). Latest version is recommended. If you need another version, they can run side by side.
21
21
22 .. warning:: Python 3.x is not supported.
22 .. warning:: Python 3.x is not supported.
23
23
24 - Download Python 2.x.y from http://www.python.org/download/
24 - Download Python 2.x.y from http://www.python.org/download/
25 - Choose and click on the version
25 - Choose and click on the version
26 - Click on "Windows X86-64 Installer" for x64 or "Windows x86 MSI installer" for Win32.
26 - Click on "Windows X86-64 Installer" for x64 or "Windows x86 MSI installer" for Win32.
27 - Disable UAC or run the installer with admin privileges. If you chose to disable UAC, do not forget to reboot afterwards.
27 - Disable UAC or run the installer with admin privileges. If you chose to disable UAC, do not forget to reboot afterwards.
28
28
29 While writing this guide, the latest version was v2.7.9.
29 While writing this guide, the latest version was v2.7.9.
30 Remember the specific major and minor versions installed, because they will
30 Remember the specific major and minor versions installed, because they will
31 be needed in the next step. In this case, it is "2.7".
31 be needed in the next step. In this case, it is "2.7".
32
32
33
34 Step 2 - Python BIN
33 Step 2 - Python BIN
35 -------------------
34 -------------------
36
35
37 Add Python BIN folder to the path. This can be done manually (editing
36 Add Python BIN folder to the path. This can be done manually (editing
38 "PATH" environment variable) or by using Windows Support Tools that
37 "PATH" environment variable) or by using Windows Support Tools that
39 come pre-installed in Windows Vista/7 and later.
38 come pre-installed in Windows Vista/7 and later.
40
39
41 Open a CMD and type::
40 Open a CMD and type::
42
41
43 SETX PATH "%PATH%;[your-python-path]" /M
42 SETX PATH "%PATH%;[your-python-path]" /M
44
43
45 Please substitute [your-python-path] with your Python installation
44 Please substitute [your-python-path] with your Python installation
46 path. Typically this is ``C:\\Python27``.
45 path. Typically this is ``C:\\Python27``.
47
46
48
49 Step 3 - Install pywin32 extensions
47 Step 3 - Install pywin32 extensions
50 -----------------------------------
48 -----------------------------------
51
49
52 Download pywin32 from:
50 Download pywin32 from:
53 http://sourceforge.net/projects/pywin32/files/
51 http://sourceforge.net/projects/pywin32/files/
54
52
55 - Click on "pywin32" folder
53 - Click on "pywin32" folder
56 - Click on the first folder (in this case, Build 219, maybe newer when you try)
54 - Click on the first folder (in this case, Build 219, maybe newer when you try)
57 - Choose the file ending with ".amd64-py2.x.exe" (".win32-py2.x.exe"
55 - Choose the file ending with ".amd64-py2.x.exe" (".win32-py2.x.exe"
58 for Win32) where x is the minor version of Python you installed.
56 for Win32) where x is the minor version of Python you installed.
59 When writing this guide, the file was:
57 When writing this guide, the file was:
60 http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/pywin32-219.win-amd64-py2.7.exe/download
58 http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/pywin32-219.win-amd64-py2.7.exe/download
61 (x64)
59 (x64)
62 http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/pywin32-219.win32-py2.7.exe/download
60 http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/pywin32-219.win32-py2.7.exe/download
63 (Win32)
61 (Win32)
64
62
65
66 Step 4 - Install pip
63 Step 4 - Install pip
67 --------------------
64 --------------------
68
65
69 pip is a package management system for Python. You will need it to install Kallithea and its dependencies.
66 pip is a package management system for Python. You will need it to install Kallithea and its dependencies.
70
67
71 If you installed Python 2.7.9+, you already have it (as long as you ran the installer with admin privileges or disabled UAC).
68 If you installed Python 2.7.9+, you already have it (as long as you ran the installer with admin privileges or disabled UAC).
72
69
73 If it was not installed or if you are using Python>=2.6,<2.7.9:
70 If it was not installed or if you are using Python>=2.6,<2.7.9:
74
71
75 - Go to https://bootstrap.pypa.io
72 - Go to https://bootstrap.pypa.io
76 - Right-click on get-pip.py and choose Saves as...
73 - Right-click on get-pip.py and choose Saves as...
77 - Run "python get-pip.py" in the folder where you downloaded get-pip.py (may require admin access).
74 - Run "python get-pip.py" in the folder where you downloaded get-pip.py (may require admin access).
78
75
79 .. note::
76 .. note::
80
77
81 See http://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows
78 See http://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows
82 for details and alternative methods.
79 for details and alternative methods.
83
80
84 Note that pip.exe will be placed inside your Python installation's
81 Note that pip.exe will be placed inside your Python installation's
85 Scripts folder, which is likely not on your path. To correct this,
82 Scripts folder, which is likely not on your path. To correct this,
86 open a CMD and type::
83 open a CMD and type::
87
84
88 SETX PATH "%PATH%;[your-python-path]\Scripts" /M
85 SETX PATH "%PATH%;[your-python-path]\Scripts" /M
89
86
90
91 Step 5 - Kallithea folder structure
87 Step 5 - Kallithea folder structure
92 -----------------------------------
88 -----------------------------------
93
89
94 Create a Kallithea folder structure.
90 Create a Kallithea folder structure.
95
91
96 This is only an example to install Kallithea. Of course, you can
92 This is only an example to install Kallithea. Of course, you can
97 change it. However, this guide will follow the proposed structure, so
93 change it. However, this guide will follow the proposed structure, so
98 please later adapt the paths if you change them. Folders without
94 please later adapt the paths if you change them. Folders without
99 spaces are recommended.
95 spaces are recommended.
100
96
101 Create the following folder structure::
97 Create the following folder structure::
102
98
103 C:\Kallithea
99 C:\Kallithea
104 C:\Kallithea\Bin
100 C:\Kallithea\Bin
105 C:\Kallithea\Env
101 C:\Kallithea\Env
106 C:\Kallithea\Repos
102 C:\Kallithea\Repos
107
103
108
109 Step 6 - Install virtualenv
104 Step 6 - Install virtualenv
110 ---------------------------
105 ---------------------------
111
106
112 .. note::
107 .. note::
113 A python virtual environment will allow for isolation between the Python packages of your system and those used for Kallithea.
108 A python virtual environment will allow for isolation between the Python packages of your system and those used for Kallithea.
114 It is strongly recommended to use it to ensure that Kallithea does not change a dependency that other software uses or vice versa.
109 It is strongly recommended to use it to ensure that Kallithea does not change a dependency that other software uses or vice versa.
115
110
116 In a command prompt type::
111 In a command prompt type::
117
112
118 pip install virtualenv
113 pip install virtualenv
119
114
120 Virtualenv will now be inside your Python Scripts path (C:\\Python27\\Scripts or similar).
115 Virtualenv will now be inside your Python Scripts path (C:\\Python27\\Scripts or similar).
121
116
122 To create a virtual environment, run::
117 To create a virtual environment, run::
123
118
124 virtualenv C:\Kallithea\Env
119 virtualenv C:\Kallithea\Env
125
120
126
127 Step 7 - Install Kallithea
121 Step 7 - Install Kallithea
128 --------------------------
122 --------------------------
129
123
130 In order to install Kallithea, you need to be able to run "pip install kallithea". It will use pip to install the Kallithea Python package and its dependencies.
124 In order to install Kallithea, you need to be able to run "pip install kallithea". It will use pip to install the Kallithea Python package and its dependencies.
131 Some Python packages use managed code and need to be compiled.
125 Some Python packages use managed code and need to be compiled.
132 This can be done on Linux without any special steps. On Windows, you will need to install Microsoft Visual C++ compiler for Python 2.7.
126 This can be done on Linux without any special steps. On Windows, you will need to install Microsoft Visual C++ compiler for Python 2.7.
133
127
134 Download and install "Microsoft Visual C++ Compiler for Python 2.7" from http://aka.ms/vcpython27
128 Download and install "Microsoft Visual C++ Compiler for Python 2.7" from http://aka.ms/vcpython27
135
129
136 .. note::
130 .. note::
137 You can also install the dependencies using already compiled Windows binaries packages. A good source of compiled Python packages is http://www.lfd.uci.edu/~gohlke/pythonlibs/. However, not all of the necessary packages for Kallithea are on this site and some are hard to find, so we will stick with using the compiler.
131 You can also install the dependencies using already compiled Windows binaries packages. A good source of compiled Python packages is http://www.lfd.uci.edu/~gohlke/pythonlibs/. However, not all of the necessary packages for Kallithea are on this site and some are hard to find, so we will stick with using the compiler.
138
132
139 In a command prompt type (adapting paths if necessary)::
133 In a command prompt type (adapting paths if necessary)::
140
134
141 cd C:\Kallithea\Env\Scripts
135 cd C:\Kallithea\Env\Scripts
142 activate
136 activate
143
137
144 The prompt will change into "(Env) C:\\Kallithea\\Env\\Scripts" or similar
138 The prompt will change into "(Env) C:\\Kallithea\\Env\\Scripts" or similar
145 (depending of your folder structure). Then type::
139 (depending of your folder structure). Then type::
146
140
147 pip install kallithea
141 pip install kallithea
148
142
149 .. note:: This will take some time. Please wait patiently until it is fully
143 .. note:: This will take some time. Please wait patiently until it is fully
150 complete. Some warnings will appear. Don't worry, they are
144 complete. Some warnings will appear. Don't worry, they are
151 normal.
145 normal.
152
146
153
154 Step 8 - Install git (optional)
147 Step 8 - Install git (optional)
155 -------------------------------
148 -------------------------------
156
149
157 Mercurial being a python package, it was installed automatically when doing "pip install kallithea".
150 Mercurial being a python package, it was installed automatically when doing "pip install kallithea".
158
151
159 You need to install git manually if you want Kallithea to be able to host git repositories.
152 You need to install git manually if you want Kallithea to be able to host git repositories.
160
153
161 See http://git-scm.com/book/en/v2/Getting-Started-Installing-Git#Installing-on-Windows for instructions.
154 See http://git-scm.com/book/en/v2/Getting-Started-Installing-Git#Installing-on-Windows for instructions.
162
155
163
164 Step 9 - Configuring Kallithea
156 Step 9 - Configuring Kallithea
165 ------------------------------
157 ------------------------------
166
158
167 Steps taken from `<setup.html>`_
159 Steps taken from `<setup.html>`_
168
160
169 You have to use the same command prompt as in Step 7, so if you closed
161 You have to use the same command prompt as in Step 7, so if you closed
170 it, reopen it following the same commands (including the "activate"
162 it, reopen it following the same commands (including the "activate"
171 one). When ready, type::
163 one). When ready, type::
172
164
173 cd C:\Kallithea\Bin
165 cd C:\Kallithea\Bin
174 paster make-config Kallithea production.ini
166 paster make-config Kallithea production.ini
175
167
176 Then you must edit production.ini to fit your needs (IP address, IP
168 Then you must edit production.ini to fit your needs (IP address, IP
177 port, mail settings, database, etc.). `NotePad++`__ or a similar text
169 port, mail settings, database, etc.). `NotePad++`__ or a similar text
178 editor is recommended to properly handle the newline character
170 editor is recommended to properly handle the newline character
179 differences between Unix and Windows.
171 differences between Unix and Windows.
180
172
181 __ http://notepad-plus-plus.org/
173 __ http://notepad-plus-plus.org/
182
174
183 For the sake of simplicity, run it with the default settings. After your edits (if any) in the previous command prompt, type::
175 For the sake of simplicity, run it with the default settings. After your edits (if any) in the previous command prompt, type::
184
176
185 paster setup-db production.ini
177 paster setup-db production.ini
186
178
187 .. warning:: This time a *new* database will be installed. You must
179 .. warning:: This time a *new* database will be installed. You must
188 follow a different step to later *upgrade* to a newer
180 follow a different step to later *upgrade* to a newer
189 Kallithea version)
181 Kallithea version)
190
182
191 The script will ask you for confirmation about creating a new database, answer yes (y)
183 The script will ask you for confirmation about creating a new database, answer yes (y)
192
184
193 The script will ask you for the repository path, answer C:\\Kallithea\\Repos (or similar).
185 The script will ask you for the repository path, answer C:\\Kallithea\\Repos (or similar).
194
186
195 The script will ask you for the admin username and password, answer "admin" + "123456" (or whatever you want)
187 The script will ask you for the admin username and password, answer "admin" + "123456" (or whatever you want)
196
188
197 The script will ask you for admin mail, answer "admin@xxxx.com" (or whatever you want).
189 The script will ask you for admin mail, answer "admin@xxxx.com" (or whatever you want).
198
190
199 If you make a mistake and the script doesn't end, don't worry: start it again.
191 If you make a mistake and the script doesn't end, don't worry: start it again.
200
192
201 If you decided not to install git, you will get errors about it that you can ignore.
193 If you decided not to install git, you will get errors about it that you can ignore.
202
194
203
204 Step 10 - Running Kallithea
195 Step 10 - Running Kallithea
205 ---------------------------
196 ---------------------------
206
197
207 In the previous command prompt, being in the C:\\Kallithea\\Bin folder, type::
198 In the previous command prompt, being in the C:\\Kallithea\\Bin folder, type::
208
199
209 paster serve production.ini
200 paster serve production.ini
210
201
211 Open your web server, and go to http://127.0.0.1:5000
202 Open your web server, and go to http://127.0.0.1:5000
212
203
213 It works!! :-)
204 It works!! :-)
214
205
215 Remark:
206 Remark:
216 If it does not work the first time, Ctrl-C the CMD process and start it again. Don't forget the "http://" in Internet Explorer.
207 If it does not work the first time, Ctrl-C the CMD process and start it again. Don't forget the "http://" in Internet Explorer.
217
208
218
209
219 What this guide does not cover:
210 What this guide does not cover:
220
211
221 - Installing Celery
212 - Installing Celery
222 - Running Kallithea as a Windows Service. You can investigate here:
213 - Running Kallithea as a Windows Service. You can investigate here:
223
214
224 - http://pypi.python.org/pypi/wsgisvc
215 - http://pypi.python.org/pypi/wsgisvc
225 - http://ryrobes.com/python/running-python-scripts-as-a-windows-service/
216 - http://ryrobes.com/python/running-python-scripts-as-a-windows-service/
226 - http://wiki.pylonshq.com/display/pylonscookbook/How+to+run+Pylons+as+a+Windows+service
217 - http://wiki.pylonshq.com/display/pylonscookbook/How+to+run+Pylons+as+a+Windows+service
227
218
228 - Using Apache. You can investigate here:
219 - Using Apache. You can investigate here:
229
220
230 - https://groups.google.com/group/rhodecode/msg/c433074e813ffdc4
221 - https://groups.google.com/group/rhodecode/msg/c433074e813ffdc4
231
222
232
223
233 Upgrading
224 Upgrading
234 :::::::::
225 :::::::::
235
226
236 Stop running Kallithea
227 Stop running Kallithea
237 Open a CommandPrompt like in Step 7 (cd to C:\Kallithea\Env\Scripts and activate) and type::
228 Open a CommandPrompt like in Step 7 (cd to C:\Kallithea\Env\Scripts and activate) and type::
238
229
239 pip install kallithea --upgrade
230 pip install kallithea --upgrade
240 cd \Kallithea\Bin
231 cd \Kallithea\Bin
241
232
242 Backup your production.ini file now.
233 Backup your production.ini file now.
243
234
244 Then run::
235 Then run::
245
236
246 paster make-config Kallithea production.ini
237 paster make-config Kallithea production.ini
247
238
248 Look for changes and update your production.ini accordingly.
239 Look for changes and update your production.ini accordingly.
249
240
250 Next, update the database::
241 Next, update the database::
251
242
252 paster upgrade-db production.ini
243 paster upgrade-db production.ini
253
244
254 More details can be found in `<upgrade.html>`_.
245 More details can be found in `<upgrade.html>`_.
@@ -1,292 +1,282 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
7 First-time install
8 First-time install
8 ::::::::::::::::::
9 ::::::::::::::::::
9
10
10 Target OS: Windows XP SP3 32-bit English (Clean installation)
11 Target OS: Windows XP SP3 32-bit English (Clean installation)
11 + All Windows Updates until 24-may-2012
12 + All Windows Updates until 24-may-2012
12
13
13 .. note::
14 .. note::
14
15
15 This installation is for 32-bit systems, for 64-bit Windows you might need
16 This installation is for 32-bit systems, for 64-bit Windows you might need
16 to download proper 64-bit versions of the different packages (Windows Installer, Win32py extensions)
17 to download proper 64-bit versions of the different packages (Windows Installer, Win32py extensions)
17 plus some extra tweaks.
18 plus some extra tweaks.
18 These extra steps haven been marked as "64-bit".
19 These extra steps haven been marked as "64-bit".
19 Tested on Windows Server 2008 R2 SP1, 9-feb-2013.
20 Tested on Windows Server 2008 R2 SP1, 9-feb-2013.
20 If you run into any 64-bit related problems, please check these pages:
21 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/
22 - 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
23 - http://bugs.python.org/issue7511
23
24
24 Step 1 - Install Visual Studio 2008 Express
25 Step 1 - Install Visual Studio 2008 Express
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 64-bit: 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 64-bit: 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 32-bit.
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
60 Step 2 -- Install Python
59 Step 2 -- Install Python
61 ------------------------
60 ------------------------
62
61
63 Install Python 2.x.y (x = 6 or 7) x86 version (32-bit). DO NOT USE A 3.x version.
62 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:
63 Download Python 2.x.y from:
65 http://www.python.org/download/
64 http://www.python.org/download/
66
65
67 Choose "Windows Installer" (32-bit version) not "Windows X86-64
66 Choose "Windows Installer" (32-bit version) not "Windows X86-64
68 Installer". While writing this guide, the latest version was v2.7.3.
67 Installer". While writing this guide, the latest version was v2.7.3.
69 Remember the specific major and minor version installed, because it will
68 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".
69 be needed in the next step. In this case, it is "2.7".
71
70
72 .. note::
71 .. note::
73
72
74 64-bit: Just download and install the 64-bit version of python.
73 64-bit: Just download and install the 64-bit version of python.
75
74
76
77 Step 3 -- Install Win32py extensions
75 Step 3 -- Install Win32py extensions
78 ------------------------------------
76 ------------------------------------
79
77
80 Download pywin32 from:
78 Download pywin32 from:
81 http://sourceforge.net/projects/pywin32/files/
79 http://sourceforge.net/projects/pywin32/files/
82
80
83 - Click on "pywin32" folder
81 - Click on "pywin32" folder
84 - Click on the first folder (in this case, Build 217, maybe newer when you try)
82 - Click on the first folder (in this case, Build 217, maybe newer when you try)
85 - Choose the file ending with ".win32-py2.x.exe" -> x being the minor
83 - Choose the file ending with ".win32-py2.x.exe" -> x being the minor
86 version of Python you installed (in this case, 7)
84 version of Python you installed (in this case, 7)
87 When writing this guide, the file was:
85 When writing this guide, the file was:
88 http://sourceforge.net/projects/pywin32/files/pywin32/Build%20217/pywin32-217.win32-py2.7.exe/download
86 http://sourceforge.net/projects/pywin32/files/pywin32/Build%20217/pywin32-217.win32-py2.7.exe/download
89
87
90 .. note::
88 .. note::
91
89
92 64-bit: Download and install the 64-bit version.
90 64-bit: Download and install the 64-bit version.
93 At the time of writing you can find this at:
91 At the time of writing you can find this at:
94 http://sourceforge.net/projects/pywin32/files/pywin32/Build%20218/pywin32-218.win-amd64-py2.7.exe/download
92 http://sourceforge.net/projects/pywin32/files/pywin32/Build%20218/pywin32-218.win-amd64-py2.7.exe/download
95
93
96
97 Step 4 -- Python BIN
94 Step 4 -- Python BIN
98 --------------------
95 --------------------
99
96
100 Add Python BIN folder to the path
97 Add Python BIN folder to the path
101
98
102 You have to add the Python folder to the path, you can do it manually
99 You have to add the Python folder to the path, you can do it manually
103 (editing "PATH" environment variable) or using Windows Support Tools
100 (editing "PATH" environment variable) or using Windows Support Tools
104 that came preinstalled in Vista/7 and can be installed in Windows XP.
101 that came preinstalled in Vista/7 and can be installed in Windows XP.
105
102
106 - Using support tools on WINDOWS XP:
103 - Using support tools on WINDOWS XP:
107 If you use Windows XP you can install them using Windows XP CD and
104 If you use Windows XP you can install them using Windows XP CD and
108 navigating to \SUPPORT\TOOLS. There, execute Setup.EXE (not MSI).
105 navigating to \SUPPORT\TOOLS. There, execute Setup.EXE (not MSI).
109 Afterwards, open a CMD and type::
106 Afterwards, open a CMD and type::
110
107
111 SETX PATH "%PATH%;[your-python-path]" -M
108 SETX PATH "%PATH%;[your-python-path]" -M
112
109
113 Close CMD (the path variable will be updated then)
110 Close CMD (the path variable will be updated then)
114
111
115 - Using support tools on WINDOWS Vista/7:
112 - Using support tools on WINDOWS Vista/7:
116
113
117 Open a CMD and type::
114 Open a CMD and type::
118
115
119 SETX PATH "%PATH%;[your-python-path]" /M
116 SETX PATH "%PATH%;[your-python-path]" /M
120
117
121 Please substitute [your-python-path] with your Python installation path.
118 Please substitute [your-python-path] with your Python installation path.
122 Typically: C:\\Python27
119 Typically: C:\\Python27
123
120
124
125 Step 5 -- Kallithea folder structure
121 Step 5 -- Kallithea folder structure
126 ------------------------------------
122 ------------------------------------
127
123
128 Create a Kallithea folder structure
124 Create a Kallithea folder structure
129
125
130 This is only a example to install Kallithea, you can of course change
126 This is only a example to install Kallithea, you can of course change
131 it. However, this guide will follow the proposed structure, so please
127 it. However, this guide will follow the proposed structure, so please
132 later adapt the paths if you change them. My recommendation is to use
128 later adapt the paths if you change them. My recommendation is to use
133 folders with NO SPACES. But you can try if you are brave...
129 folders with NO SPACES. But you can try if you are brave...
134
130
135 Create the following folder structure::
131 Create the following folder structure::
136
132
137 C:\Kallithea
133 C:\Kallithea
138 C:\Kallithea\Bin
134 C:\Kallithea\Bin
139 C:\Kallithea\Env
135 C:\Kallithea\Env
140 C:\Kallithea\Repos
136 C:\Kallithea\Repos
141
137
142
143 Step 6 -- Install virtualenv
138 Step 6 -- Install virtualenv
144 ----------------------------
139 ----------------------------
145
140
146 Install Virtual Env for Python
141 Install Virtual Env for Python
147
142
148 Navigate to: http://www.virtualenv.org/en/latest/index.html#installation
143 Navigate to: http://www.virtualenv.org/en/latest/index.html#installation
149 Right click on "virtualenv.py" file and choose "Save link as...".
144 Right click on "virtualenv.py" file and choose "Save link as...".
150 Download to C:\\Kallithea (or whatever you want)
145 Download to C:\\Kallithea (or whatever you want)
151 (the file is located at
146 (the file is located at
152 https://raw.github.com/pypa/virtualenv/master/virtualenv.py)
147 https://raw.github.com/pypa/virtualenv/master/virtualenv.py)
153
148
154 Create a virtual Python environment in C:\\Kallithea\\Env (or similar). To
149 Create a virtual Python environment in C:\\Kallithea\\Env (or similar). To
155 do so, open a CMD (Python Path should be included in Step3), navigate
150 do so, open a CMD (Python Path should be included in Step3), navigate
156 where you downloaded "virtualenv.py", and write::
151 where you downloaded "virtualenv.py", and write::
157
152
158 python virtualenv.py C:\Kallithea\Env
153 python virtualenv.py C:\Kallithea\Env
159
154
160 (--no-site-packages is now the default behaviour of virtualenv, no need
155 (--no-site-packages is now the default behaviour of virtualenv, no need
161 to include it)
156 to include it)
162
157
163
164 Step 7 -- Install Kallithea
158 Step 7 -- Install Kallithea
165 ---------------------------
159 ---------------------------
166
160
167 Finally, install Kallithea
161 Finally, install Kallithea
168
162
169 Close previously opened command prompt/s, and open a Visual Studio 2008
163 Close previously opened command prompt/s, and open a Visual Studio 2008
170 Command Prompt (**IMPORTANT!!**). To do so, go to Start Menu, and then open
164 Command Prompt (**IMPORTANT!!**). To do so, go to Start Menu, and then open
171 "Microsoft Visual C++ 2008 Express Edition" -> "Visual Studio Tools" ->
165 "Microsoft Visual C++ 2008 Express Edition" -> "Visual Studio Tools" ->
172 "Visual Studio 2008 Command Prompt"
166 "Visual Studio 2008 Command Prompt"
173
167
174 .. note::
168 .. note::
175
169
176 64-bit: For 64-bit you need to modify the shortcut that is used to start the
170 64-bit: For 64-bit you need to modify the shortcut that is used to start the
177 Visual Studio 2008 Command Prompt. Use right-mouse click to open properties.
171 Visual Studio 2008 Command Prompt. Use right-mouse click to open properties.
178
172
179 Change commandline from::
173 Change commandline from::
180
174
181 %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"" x86
175 %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"" x86
182
176
183 to::
177 to::
184
178
185 %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"" amd64
179 %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"" amd64
186
180
187
181
188 In that CMD (loaded with VS2008 PATHs) type::
182 In that CMD (loaded with VS2008 PATHs) type::
189
183
190 cd C:\Kallithea\Env\Scripts (or similar)
184 cd C:\Kallithea\Env\Scripts (or similar)
191 activate
185 activate
192
186
193 The prompt will change into "(Env) C:\\Kallithea\\Env\\Scripts" or similar
187 The prompt will change into "(Env) C:\\Kallithea\\Env\\Scripts" or similar
194 (depending of your folder structure). Then type::
188 (depending of your folder structure). Then type::
195
189
196 pip install kallithea
190 pip install kallithea
197
191
198 (long step, please wait until fully complete)
192 (long step, please wait until fully complete)
199
193
200 Some warnings will appear, don't worry as they are normal.
194 Some warnings will appear, don't worry as they are normal.
201
195
202
203 Step 8 -- Configuring Kallithea
196 Step 8 -- Configuring Kallithea
204 -------------------------------
197 -------------------------------
205
198
206 steps taken from http://packages.python.org/Kallithea/setup.html
199 steps taken from http://packages.python.org/Kallithea/setup.html
207
200
208 You have to use the same Visual Studio 2008 command prompt as Step7, so
201 You have to use the same Visual Studio 2008 command prompt as Step7, so
209 if you closed it reopen it following the same commands (including the
202 if you closed it reopen it following the same commands (including the
210 "activate" one). When ready, just type::
203 "activate" one). When ready, just type::
211
204
212 cd C:\Kallithea\Bin
205 cd C:\Kallithea\Bin
213 paster make-config Kallithea production.ini
206 paster make-config Kallithea production.ini
214
207
215 Then, you must edit production.ini to fit your needs (network address and
208 Then, you must edit production.ini to fit your needs (network address and
216 port, mail settings, database, whatever). I recommend using NotePad++
209 port, mail settings, database, whatever). I recommend using NotePad++
217 (free) or similar text editor, as it handles well the EndOfLine
210 (free) or similar text editor, as it handles well the EndOfLine
218 character differences between Unix and Windows
211 character differences between Unix and Windows
219 (http://notepad-plus-plus.org/)
212 (http://notepad-plus-plus.org/)
220
213
221 For the sake of simplicity lets run it with the default settings. After
214 For the sake of simplicity lets run it with the default settings. After
222 your edits (if any), in the previous Command Prompt, type::
215 your edits (if any), in the previous Command Prompt, type::
223
216
224 paster setup-db production.ini
217 paster setup-db production.ini
225
218
226 (this time a NEW database will be installed, you must follow a different
219 (this time a NEW database will be installed, you must follow a different
227 step to later UPGRADE to a newer Kallithea version)
220 step to later UPGRADE to a newer Kallithea version)
228
221
229 The script will ask you for confirmation about creating a NEW database,
222 The script will ask you for confirmation about creating a NEW database,
230 answer yes (y)
223 answer yes (y)
231 The script will ask you for repository path, answer C:\\Kallithea\\Repos
224 The script will ask you for repository path, answer C:\\Kallithea\\Repos
232 (or similar)
225 (or similar)
233 The script will ask you for admin username and password, answer "admin"
226 The script will ask you for admin username and password, answer "admin"
234 + "123456" (or whatever you want)
227 + "123456" (or whatever you want)
235 The script will ask you for admin mail, answer "admin@xxxx.com" (or
228 The script will ask you for admin mail, answer "admin@xxxx.com" (or
236 whatever you want)
229 whatever you want)
237
230
238 If you make some mistake and the script does not end, don't worry, start
231 If you make some mistake and the script does not end, don't worry, start
239 it again.
232 it again.
240
233
241
242 Step 9 -- Running Kallithea
234 Step 9 -- Running Kallithea
243 ---------------------------
235 ---------------------------
244
236
245
246 In the previous command prompt, being in the C:\\Kallithea\\Bin folder,
237 In the previous command prompt, being in the C:\\Kallithea\\Bin folder,
247 just type::
238 just type::
248
239
249 paster serve production.ini
240 paster serve production.ini
250
241
251 Open yout web server, and go to http://127.0.0.1:5000
242 Open yout web server, and go to http://127.0.0.1:5000
252
243
253 It works!! :-)
244 It works!! :-)
254
245
255 Remark:
246 Remark:
256 If it does not work first time, just Ctrl-C the CMD process and start it
247 If it does not work first time, just Ctrl-C the CMD process and start it
257 again. Don't forget the "http://" in Internet Explorer
248 again. Don't forget the "http://" in Internet Explorer
258
249
259
250
260
261 What this Guide does not cover:
251 What this Guide does not cover:
262
252
263 - Installing Celery
253 - Installing Celery
264 - Running Kallithea as Windows Service. You can investigate here:
254 - Running Kallithea as Windows Service. You can investigate here:
265
255
266 - http://pypi.python.org/pypi/wsgisvc
256 - http://pypi.python.org/pypi/wsgisvc
267 - http://ryrobes.com/python/running-python-scripts-as-a-windows-service/
257 - http://ryrobes.com/python/running-python-scripts-as-a-windows-service/
268 - http://wiki.pylonshq.com/display/pylonscookbook/How+to+run+Pylons+as+a+Windows+service
258 - http://wiki.pylonshq.com/display/pylonscookbook/How+to+run+Pylons+as+a+Windows+service
269
259
270 - Using Apache. You can investigate here:
260 - Using Apache. You can investigate here:
271
261
272 - https://groups.google.com/group/rhodecode/msg/c433074e813ffdc4
262 - https://groups.google.com/group/rhodecode/msg/c433074e813ffdc4
273
263
274
264
275 Upgrading
265 Upgrading
276 :::::::::
266 :::::::::
277
267
278 Stop running Kallithea
268 Stop running Kallithea
279 Open a CommandPrompt like in Step7 (VS2008 path + activate) and type::
269 Open a CommandPrompt like in Step7 (VS2008 path + activate) and type::
280
270
281 easy_install -U kallithea
271 easy_install -U kallithea
282 cd \Kallithea\Bin
272 cd \Kallithea\Bin
283
273
284 { backup your production.ini file now} ::
274 { backup your production.ini file now} ::
285
275
286 paster make-config Kallithea production.ini
276 paster make-config Kallithea production.ini
287
277
288 (check changes and update your production.ini accordingly) ::
278 (check changes and update your production.ini accordingly) ::
289
279
290 paster upgrade-db production.ini (update database)
280 paster upgrade-db production.ini (update database)
291
281
292 Full steps in http://packages.python.org/Kallithea/upgrade.html
282 Full steps in http://packages.python.org/Kallithea/upgrade.html
@@ -1,142 +1,141 b''
1 .. _overview:
1 .. _overview:
2
2
3 =====================
3 =====================
4 Installation overview
4 Installation overview
5 =====================
5 =====================
6
6
7
8 Some overview and some details that can help understanding the options when
7 Some overview and some details that can help understanding the options when
9 installing Kallithea.
8 installing Kallithea.
10
9
11
10
12 Python environment
11 Python environment
13 ------------------
12 ------------------
14
13
15 **Kallithea** is written entirely in Python_ and requires Python version
14 **Kallithea** is written entirely in Python_ and requires Python version
16 2.6 or higher. Python 3.x is currently not supported.
15 2.6 or higher. Python 3.x is currently not supported.
17
16
18 Given a Python installation, there are different ways of providing the
17 Given a Python installation, there are different ways of providing the
19 environment for running Python applications. Each of them pretty much
18 environment for running Python applications. Each of them pretty much
20 corresponds to a ``site-packages`` directory somewhere where packages can be
19 corresponds to a ``site-packages`` directory somewhere where packages can be
21 installed.
20 installed.
22
21
23 Kallithea itself can be run from source or be installed, but even when running
22 Kallithea itself can be run from source or be installed, but even when running
24 from source, there are some dependencies that must be installed in the Python
23 from source, there are some dependencies that must be installed in the Python
25 environment used for running Kallithea.
24 environment used for running Kallithea.
26
25
27 - Packages *could* be installed in Python's ``site-packages`` directory ... but
26 - Packages *could* be installed in Python's ``site-packages`` directory ... but
28 that would require running pip_ as root and it would be hard to uninstall or
27 that would require running pip_ as root and it would be hard to uninstall or
29 upgrade and is probably not a good idea unless using a package manager.
28 upgrade and is probably not a good idea unless using a package manager.
30
29
31 - Packages could also be installed in ``~/.local`` ... but that is probably
30 - Packages could also be installed in ``~/.local`` ... but that is probably
32 only a good idea if using a dedicated user per application or instance.
31 only a good idea if using a dedicated user per application or instance.
33
32
34 - Finally, it can be installed in a virtualenv_. That is a very lightweight
33 - Finally, it can be installed in a virtualenv_. That is a very lightweight
35 "container" where each Kallithea instance can get its own dedicated and
34 "container" where each Kallithea instance can get its own dedicated and
36 self-contained virtual environment.
35 self-contained virtual environment.
37
36
38 We recommend using virtualenv for installing Kallithea.
37 We recommend using virtualenv for installing Kallithea.
39
38
40
39
41 Installation methods
40 Installation methods
42 --------------------
41 --------------------
43
42
44 Kallithea must be installed on a server. Kallithea is installed in a Python
43 Kallithea must be installed on a server. Kallithea is installed in a Python
45 environment so it can use packages that are installed there and make itself
44 environment so it can use packages that are installed there and make itself
46 available for other packages.
45 available for other packages.
47
46
48 Two different cases will pretty much cover the options for how it can be
47 Two different cases will pretty much cover the options for how it can be
49 installed.
48 installed.
50
49
51 - The Kallithea source repository can be cloned and used - it is kept stable and
50 - The Kallithea source repository can be cloned and used - it is kept stable and
52 can be used in production. The Kallithea maintainers use the development
51 can be used in production. The Kallithea maintainers use the development
53 branch in production. The advantage of installation from source and regularly
52 branch in production. The advantage of installation from source and regularly
54 updating it is that you take advantage of the most recent improvements. Using
53 updating it is that you take advantage of the most recent improvements. Using
55 it directly from a DVCS also means that it is easy to track local customizations.
54 it directly from a DVCS also means that it is easy to track local customizations.
56
55
57 Running ``setup.py develop`` in the source will use pip to install the
56 Running ``setup.py develop`` in the source will use pip to install the
58 necessary dependencies in the Python environment and create a
57 necessary dependencies in the Python environment and create a
59 ``.../site-packages/Kallithea.egg-link`` file there that points at the Kallithea
58 ``.../site-packages/Kallithea.egg-link`` file there that points at the Kallithea
60 source.
59 source.
61
60
62 - Kallithea can also be installed from ready-made packages using a package manager.
61 - Kallithea can also be installed from ready-made packages using a package manager.
63 The official released versions are available on PyPI_ and can be downloaded and
62 The official released versions are available on PyPI_ and can be downloaded and
64 installed with all dependencies using ``pip install kallithea``.
63 installed with all dependencies using ``pip install kallithea``.
65
64
66 With this method, Kallithea is installed in the Python environment as any
65 With this method, Kallithea is installed in the Python environment as any
67 other package, usually as a ``.../site-packages/Kallithea-X-py2.7.egg/``
66 other package, usually as a ``.../site-packages/Kallithea-X-py2.7.egg/``
68 directory with Python files and everything else that is needed.
67 directory with Python files and everything else that is needed.
69
68
70 (``pip install kallithea`` from a source tree will do pretty much the same
69 (``pip install kallithea`` from a source tree will do pretty much the same
71 but build the Kallithea package itself locally instead of downloading it.)
70 but build the Kallithea package itself locally instead of downloading it.)
72
71
73
72
74 Web server
73 Web server
75 ----------
74 ----------
76
75
77 Kallithea is (primarily) a WSGI_ application that must be run from a web
76 Kallithea is (primarily) a WSGI_ application that must be run from a web
78 server that serves WSGI applications over HTTP.
77 server that serves WSGI applications over HTTP.
79
78
80 Kallithea itself is not serving HTTP (or HTTPS); that is the web server's
79 Kallithea itself is not serving HTTP (or HTTPS); that is the web server's
81 responsibility. Kallithea does however need to know its own user facing URL
80 responsibility. Kallithea does however need to know its own user facing URL
82 (protocol, address, port and path) for each HTTP request. Kallithea will
81 (protocol, address, port and path) for each HTTP request. Kallithea will
83 usually use its own HTML/cookie based authentication but can also be configured
82 usually use its own HTML/cookie based authentication but can also be configured
84 to use web server authentication.
83 to use web server authentication.
85
84
86 There are several web server options:
85 There are several web server options:
87
86
88 - Kallithea uses the Paste_ tool as command line interface. Paste provides
87 - Kallithea uses the Paste_ tool as command line interface. Paste provides
89 ``paster serve`` as a convenient way to launch a Python WSGI / web server
88 ``paster serve`` as a convenient way to launch a Python WSGI / web server
90 from the command line. That is perfect for development and evaluation.
89 from the command line. That is perfect for development and evaluation.
91 Actual use in production might have different requirements and need extra
90 Actual use in production might have different requirements and need extra
92 work to make it manageable as a scalable system service.
91 work to make it manageable as a scalable system service.
93
92
94 Paste comes with its own built-in web server but Kallithea defaults to use
93 Paste comes with its own built-in web server but Kallithea defaults to use
95 Waitress_. Gunicorn_ is also an option. These web servers have different
94 Waitress_. Gunicorn_ is also an option. These web servers have different
96 limited feature sets.
95 limited feature sets.
97
96
98 The web server used by ``paster`` is configured in the ``.ini`` file passed
97 The web server used by ``paster`` is configured in the ``.ini`` file passed
99 to it. The entry point for the WSGI application is configured
98 to it. The entry point for the WSGI application is configured
100 in ``setup.py`` as ``kallithea.config.middleware:make_app``.
99 in ``setup.py`` as ``kallithea.config.middleware:make_app``.
101
100
102 - `Apache httpd`_ can serve WSGI applications directly using mod_wsgi_ and a
101 - `Apache httpd`_ can serve WSGI applications directly using mod_wsgi_ and a
103 simple Python file with the necessary configuration. This is a good option if
102 simple Python file with the necessary configuration. This is a good option if
104 Apache is an option.
103 Apache is an option.
105
104
106 - uWSGI_ is also a full web server with built-in WSGI module.
105 - uWSGI_ is also a full web server with built-in WSGI module.
107
106
108 - IIS_ can also server WSGI applications directly using isapi-wsgi_.
107 - IIS_ can also server WSGI applications directly using isapi-wsgi_.
109
108
110 - A `reverse HTTP proxy <https://en.wikipedia.org/wiki/Reverse_proxy>`_
109 - A `reverse HTTP proxy <https://en.wikipedia.org/wiki/Reverse_proxy>`_
111 can be put in front of another web server which has WSGI support.
110 can be put in front of another web server which has WSGI support.
112 Such a layered setup can be complex but might in some cases be the right
111 Such a layered setup can be complex but might in some cases be the right
113 option, for example to standardize on one internet-facing web server, to add
112 option, for example to standardize on one internet-facing web server, to add
114 encryption or special authentication or for other security reasons, to
113 encryption or special authentication or for other security reasons, to
115 provide caching of static files, or to provide load balancing or fail-over.
114 provide caching of static files, or to provide load balancing or fail-over.
116 Nginx_, Varnish_ and HAProxy_ are often used for this purpose, often in front
115 Nginx_, Varnish_ and HAProxy_ are often used for this purpose, often in front
117 of a ``paster`` server that somehow is wrapped as a service.
116 of a ``paster`` server that somehow is wrapped as a service.
118
117
119 The best option depends on what you are familiar with and the requirements for
118 The best option depends on what you are familiar with and the requirements for
120 performance and stability. Also, keep in mind that Kallithea mainly is serving
119 performance and stability. Also, keep in mind that Kallithea mainly is serving
121 dynamically generated pages from a relatively slow Python process. Kallithea is
120 dynamically generated pages from a relatively slow Python process. Kallithea is
122 also often used inside organizations with a limited amount of users and thus no
121 also often used inside organizations with a limited amount of users and thus no
123 continuous hammering from the internet.
122 continuous hammering from the internet.
124
123
125
124
126 .. _Python: http://www.python.org/
125 .. _Python: http://www.python.org/
127 .. _Gunicorn: http://gunicorn.org/
126 .. _Gunicorn: http://gunicorn.org/
128 .. _Waitress: http://waitress.readthedocs.org/en/latest/
127 .. _Waitress: http://waitress.readthedocs.org/en/latest/
129 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
128 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
130 .. _Paste: http://pythonpaste.org/
129 .. _Paste: http://pythonpaste.org/
131 .. _PyPI: https://pypi.python.org/pypi
130 .. _PyPI: https://pypi.python.org/pypi
132 .. _Apache httpd: http://httpd.apache.org/
131 .. _Apache httpd: http://httpd.apache.org/
133 .. _mod_wsgi: https://code.google.com/p/modwsgi/
132 .. _mod_wsgi: https://code.google.com/p/modwsgi/
134 .. _isapi-wsgi: https://github.com/hexdump42/isapi-wsgi
133 .. _isapi-wsgi: https://github.com/hexdump42/isapi-wsgi
135 .. _uWSGI: https://uwsgi-docs.readthedocs.org/en/latest/
134 .. _uWSGI: https://uwsgi-docs.readthedocs.org/en/latest/
136 .. _nginx: http://nginx.org/en/
135 .. _nginx: http://nginx.org/en/
137 .. _iis: http://en.wikipedia.org/wiki/Internet_Information_Services
136 .. _iis: http://en.wikipedia.org/wiki/Internet_Information_Services
138 .. _pip: http://en.wikipedia.org/wiki/Pip_%28package_manager%29
137 .. _pip: http://en.wikipedia.org/wiki/Pip_%28package_manager%29
139 .. _WSGI: http://en.wikipedia.org/wiki/Web_Server_Gateway_Interface
138 .. _WSGI: http://en.wikipedia.org/wiki/Web_Server_Gateway_Interface
140 .. _pylons: http://www.pylonsproject.org/
139 .. _pylons: http://www.pylonsproject.org/
141 .. _HAProxy: http://www.haproxy.org/
140 .. _HAProxy: http://www.haproxy.org/
142 .. _Varnish: https://www.varnish-cache.org/
141 .. _Varnish: https://www.varnish-cache.org/
@@ -1,819 +1,820 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-db`` values can also be given on the command line.
37 The ``setup-db`` values can also be given on the command line.
38 Example::
38 Example::
39
39
40 paster setup-db my.ini --user=nn --password=secret --email=nn@example.org --repos=/srv/repos
40 paster setup-db my.ini --user=nn --password=secret --email=nn@example.org --repos=/srv/repos
41
41
42
42
43 The ``setup-db`` command will create all needed tables and an
43 The ``setup-db`` command will create all needed tables and an
44 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
45 empty location, or a location which already contains existing
45 empty location, or a location which already contains existing
46 repositories. If you choose a location which contains existing
46 repositories. If you choose a location which contains existing
47 repositories Kallithea will add all of the repositories at the chosen
47 repositories Kallithea will add all of the repositories at the chosen
48 location to its database. (Note: make sure you specify the correct
48 location to its database. (Note: make sure you specify the correct
49 path to the root).
49 path to the root).
50
50
51 .. note:: the given path for Mercurial_ repositories **must** be write
51 .. note:: the given path for Mercurial_ repositories **must** be write
52 accessible for the application. It's very important since
52 accessible for the application. It's very important since
53 the Kallithea web interface will work without write access,
53 the Kallithea web interface will work without write access,
54 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
55 denied errors unless it has write access.
55 denied errors unless it has write access.
56
56
57 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::
58
58
59 paster serve my.ini
59 paster serve my.ini
60
60
61 - 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
62 http://127.0.0.1:5000. The IP address and port is configurable via the
62 http://127.0.0.1:5000. The IP address and port is configurable via the
63 configuration file created in the previous step.
63 configuration file created in the previous step.
64 - Log in to Kallithea using the admin account created when running ``setup-db``.
64 - Log in to Kallithea using the admin account created when running ``setup-db``.
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 one can create an ``rcextensions`` package that extends Kallithea
75 Optionally one can create an ``rcextensions`` package that extends Kallithea
76 functionality.
76 functionality.
77 To generate a skeleton extensions package, run::
77 To generate a skeleton extensions package, run::
78
78
79 paster make-rcext my.ini
79 paster make-rcext my.ini
80
80
81 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.
82 With ``rcextensions`` it's possible to add additional mapping for whoosh,
82 With ``rcextensions`` it's possible to add additional mapping for whoosh,
83 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,
84 for example for sending signals to build-bots such as Jenkins.
84 for example for sending signals to build-bots such as Jenkins.
85
85
86 See the ``__init__.py`` file inside the generated ``rcextensions`` package
86 See the ``__init__.py`` file inside the generated ``rcextensions`` package
87 for more details.
87 for more details.
88
88
89
89
90 Using Kallithea with SSH
90 Using Kallithea with SSH
91 ------------------------
91 ------------------------
92
92
93 Kallithea currently only hosts repositories using http and https. (The addition
93 Kallithea currently only hosts repositories using http and https. (The addition
94 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
95 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
96 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
97 repositories that Kallithea is hosting. See PublishingRepositories_)
97 repositories that Kallithea is hosting. See PublishingRepositories_)
98
98
99 Kallithea repository structures are kept in directories with the same name
99 Kallithea repository structures are kept in directories with the same name
100 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.
101 This allows you to easily use ssh for accessing repositories.
101 This allows you to easily use ssh for accessing repositories.
102
102
103 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'
104 login accounts have the correct permissions set on the appropriate directories.
104 login accounts have the correct permissions set on the appropriate directories.
105
105
106 .. note:: These permissions are independent of any permissions you
106 .. note:: These permissions are independent of any permissions you
107 have set up using the Kallithea web interface.
107 have set up using the Kallithea web interface.
108
108
109 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
110 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
111 named ``kallithea``, then to clone via ssh you should run::
111 named ``kallithea``, then to clone via ssh you should run::
112
112
113 hg clone ssh://user@server.com//srv/repos/kallithea
113 hg clone ssh://user@server.com//srv/repos/kallithea
114
114
115 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
116 authentication is fully supported.
116 authentication is fully supported.
117
117
118 .. 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
119 the same permissions as set up via the Kallithea web
119 the same permissions as set up via the Kallithea web
120 interface, you can create an authentication hook to connect
120 interface, you can create an authentication hook to connect
121 to the Kallithea db and run check functions for permissions
121 to the Kallithea db and run check functions for permissions
122 against that.
122 against that.
123
123
124
124 Setting up Whoosh full text search
125 Setting up Whoosh full text search
125 ----------------------------------
126 ----------------------------------
126
127
127 Kallithea provides full text search of repositories using `Whoosh`__.
128 Kallithea provides full text search of repositories using `Whoosh`__.
128
129
129 .. __: https://pythonhosted.org/Whoosh/
130 .. __: https://pythonhosted.org/Whoosh/
130
131
131 For an incremental index build, run::
132 For an incremental index build, run::
132
133
133 paster make-index my.ini
134 paster make-index my.ini
134
135
135 For a full index rebuild, run::
136 For a full index rebuild, run::
136
137
137 paster make-index my.ini -f
138 paster make-index my.ini -f
138
139
139 The ``--repo-location`` option allows the location of the repositories to be overriden;
140 The ``--repo-location`` option allows the location of the repositories to be overriden;
140 usually, the location is retrieved from the Kallithea database.
141 usually, the location is retrieved from the Kallithea database.
141
142
142 The ``--index-only`` option can be used to limit the indexed repositories to a comma-separated list::
143 The ``--index-only`` option can be used to limit the indexed repositories to a comma-separated list::
143
144
144 paster make-index my.ini --index-only=vcs,kallithea
145 paster make-index my.ini --index-only=vcs,kallithea
145
146
146
147
147 To keep your index up-to-date it is necessary to do periodic index builds;
148 To keep your index up-to-date it is necessary to do periodic index builds;
148 for this, it is recommended to use a crontab entry. Example::
149 for this, it is recommended to use a crontab entry. Example::
149
150
150 0 3 * * * /path/to/virtualenv/bin/paster make-index /path/to/kallithea/my.ini
151 0 3 * * * /path/to/virtualenv/bin/paster make-index /path/to/kallithea/my.ini
151
152
152 When using incremental mode (the default), Whoosh will check the last
153 When using incremental mode (the default), Whoosh will check the last
153 modification date of each file and add it to be reindexed if a newer file is
154 modification date of each file and add it to be reindexed if a newer file is
154 available. The indexing daemon checks for any removed files and removes them
155 available. The indexing daemon checks for any removed files and removes them
155 from index.
156 from index.
156
157
157 If you want to rebuild the index from scratch, you can use the ``-f`` flag as above,
158 If you want to rebuild the index from scratch, you can use the ``-f`` flag as above,
158 or in the admin panel you can check the "build from scratch" checkbox.
159 or in the admin panel you can check the "build from scratch" checkbox.
159
160
160
161
161 Setting up LDAP support
162 Setting up LDAP support
162 -----------------------
163 -----------------------
163
164
164 Kallithea supports LDAP authentication. In order
165 Kallithea supports LDAP authentication. In order
165 to use LDAP, you have to install the python-ldap_ package. This package is
166 to use LDAP, you have to install the python-ldap_ package. This package is
166 available via PyPI, so you can install it by running::
167 available via PyPI, so you can install it by running::
167
168
168 pip install python-ldap
169 pip install python-ldap
169
170
170 .. note:: ``python-ldap`` requires some libraries to be installed on
171 .. note:: ``python-ldap`` requires some libraries to be installed on
171 your system, so before installing it check that you have at
172 your system, so before installing it check that you have at
172 least the ``openldap`` and ``sasl`` libraries.
173 least the ``openldap`` and ``sasl`` libraries.
173
174
174 Choose *Admin > Authentication*, click the ``kallithea.lib.auth_modules.auth_ldap`` button
175 Choose *Admin > Authentication*, click the ``kallithea.lib.auth_modules.auth_ldap`` button
175 and then *Save*, to enable the LDAP plugin and configure its settings.
176 and then *Save*, to enable the LDAP plugin and configure its settings.
176
177
177 Here's a typical LDAP setup::
178 Here's a typical LDAP setup::
178
179
179 Connection settings
180 Connection settings
180 Enable LDAP = checked
181 Enable LDAP = checked
181 Host = host.example.org
182 Host = host.example.org
182 Port = 389
183 Port = 389
183 Account = <account>
184 Account = <account>
184 Password = <password>
185 Password = <password>
185 Connection Security = LDAPS connection
186 Connection Security = LDAPS connection
186 Certificate Checks = DEMAND
187 Certificate Checks = DEMAND
187
188
188 Search settings
189 Search settings
189 Base DN = CN=users,DC=host,DC=example,DC=org
190 Base DN = CN=users,DC=host,DC=example,DC=org
190 LDAP Filter = (&(objectClass=user)(!(objectClass=computer)))
191 LDAP Filter = (&(objectClass=user)(!(objectClass=computer)))
191 LDAP Search Scope = SUBTREE
192 LDAP Search Scope = SUBTREE
192
193
193 Attribute mappings
194 Attribute mappings
194 Login Attribute = uid
195 Login Attribute = uid
195 First Name Attribute = firstName
196 First Name Attribute = firstName
196 Last Name Attribute = lastName
197 Last Name Attribute = lastName
197 Email Attribute = mail
198 Email Attribute = mail
198
199
199 If your user groups are placed in an Organisation Unit (OU) structure, the Search Settings configuration differs::
200 If your user groups are placed in an Organisation Unit (OU) structure, the Search Settings configuration differs::
200
201
201 Search settings
202 Search settings
202 Base DN = DC=host,DC=example,DC=org
203 Base DN = DC=host,DC=example,DC=org
203 LDAP Filter = (&(memberOf=CN=your user group,OU=subunit,OU=unit,DC=host,DC=example,DC=org)(objectClass=user))
204 LDAP Filter = (&(memberOf=CN=your user group,OU=subunit,OU=unit,DC=host,DC=example,DC=org)(objectClass=user))
204 LDAP Search Scope = SUBTREE
205 LDAP Search Scope = SUBTREE
205
206
206 .. _enable_ldap:
207 .. _enable_ldap:
207
208
208 Enable LDAP : required
209 Enable LDAP : required
209 Whether to use LDAP for authenticating users.
210 Whether to use LDAP for authenticating users.
210
211
211 .. _ldap_host:
212 .. _ldap_host:
212
213
213 Host : required
214 Host : required
214 LDAP server hostname or IP address. Can be also a comma separated
215 LDAP server hostname or IP address. Can be also a comma separated
215 list of servers to support LDAP fail-over.
216 list of servers to support LDAP fail-over.
216
217
217 .. _Port:
218 .. _Port:
218
219
219 Port : required
220 Port : required
220 389 for un-encrypted LDAP, 636 for SSL-encrypted LDAP.
221 389 for un-encrypted LDAP, 636 for SSL-encrypted LDAP.
221
222
222 .. _ldap_account:
223 .. _ldap_account:
223
224
224 Account : optional
225 Account : optional
225 Only required if the LDAP server does not allow anonymous browsing of
226 Only required if the LDAP server does not allow anonymous browsing of
226 records. This should be a special account for record browsing. This
227 records. This should be a special account for record browsing. This
227 will require `LDAP Password`_ below.
228 will require `LDAP Password`_ below.
228
229
229 .. _LDAP Password:
230 .. _LDAP Password:
230
231
231 Password : optional
232 Password : optional
232 Only required if the LDAP server does not allow anonymous browsing of
233 Only required if the LDAP server does not allow anonymous browsing of
233 records.
234 records.
234
235
235 .. _Enable LDAPS:
236 .. _Enable LDAPS:
236
237
237 Connection Security : required
238 Connection Security : required
238 Defines the connection to LDAP server
239 Defines the connection to LDAP server
239
240
240 No encryption
241 No encryption
241 Plain non encrypted connection
242 Plain non encrypted connection
242
243
243 LDAPS connection
244 LDAPS connection
244 Enable LDAPS connections. It will likely require `Port`_ to be set to
245 Enable LDAPS connections. It will likely require `Port`_ to be set to
245 a different value (standard LDAPS port is 636). When LDAPS is enabled
246 a different value (standard LDAPS port is 636). When LDAPS is enabled
246 then `Certificate Checks`_ is required.
247 then `Certificate Checks`_ is required.
247
248
248 START_TLS on LDAP connection
249 START_TLS on LDAP connection
249 START TLS connection
250 START TLS connection
250
251
251 .. _Certificate Checks:
252 .. _Certificate Checks:
252
253
253 Certificate Checks : optional
254 Certificate Checks : optional
254 How SSL certificates verification is handled - this is only useful when
255 How SSL certificates verification is handled - this is only useful when
255 `Enable LDAPS`_ is enabled. Only DEMAND or HARD offer full SSL security
256 `Enable LDAPS`_ is enabled. Only DEMAND or HARD offer full SSL security
256 while the other options are susceptible to man-in-the-middle attacks. SSL
257 while the other options are susceptible to man-in-the-middle attacks. SSL
257 certificates can be installed to /etc/openldap/cacerts so that the
258 certificates can be installed to /etc/openldap/cacerts so that the
258 DEMAND or HARD options can be used with self-signed certificates or
259 DEMAND or HARD options can be used with self-signed certificates or
259 certificates that do not have traceable certificates of authority.
260 certificates that do not have traceable certificates of authority.
260
261
261 NEVER
262 NEVER
262 A serve certificate will never be requested or checked.
263 A serve certificate will never be requested or checked.
263
264
264 ALLOW
265 ALLOW
265 A server certificate is requested. Failure to provide a
266 A server certificate is requested. Failure to provide a
266 certificate or providing a bad certificate will not terminate the
267 certificate or providing a bad certificate will not terminate the
267 session.
268 session.
268
269
269 TRY
270 TRY
270 A server certificate is requested. Failure to provide a
271 A server certificate is requested. Failure to provide a
271 certificate does not halt the session; providing a bad certificate
272 certificate does not halt the session; providing a bad certificate
272 halts the session.
273 halts the session.
273
274
274 DEMAND
275 DEMAND
275 A server certificate is requested and must be provided and
276 A server certificate is requested and must be provided and
276 authenticated for the session to proceed.
277 authenticated for the session to proceed.
277
278
278 HARD
279 HARD
279 The same as DEMAND.
280 The same as DEMAND.
280
281
281 .. _Base DN:
282 .. _Base DN:
282
283
283 Base DN : required
284 Base DN : required
284 The Distinguished Name (DN) where searches for users will be performed.
285 The Distinguished Name (DN) where searches for users will be performed.
285 Searches can be controlled by `LDAP Filter`_ and `LDAP Search Scope`_.
286 Searches can be controlled by `LDAP Filter`_ and `LDAP Search Scope`_.
286
287
287 .. _LDAP Filter:
288 .. _LDAP Filter:
288
289
289 LDAP Filter : optional
290 LDAP Filter : optional
290 A LDAP filter defined by RFC 2254. This is more useful when `LDAP
291 A LDAP filter defined by RFC 2254. This is more useful when `LDAP
291 Search Scope`_ is set to SUBTREE. The filter is useful for limiting
292 Search Scope`_ is set to SUBTREE. The filter is useful for limiting
292 which LDAP objects are identified as representing Users for
293 which LDAP objects are identified as representing Users for
293 authentication. The filter is augmented by `Login Attribute`_ below.
294 authentication. The filter is augmented by `Login Attribute`_ below.
294 This can commonly be left blank.
295 This can commonly be left blank.
295
296
296 .. _LDAP Search Scope:
297 .. _LDAP Search Scope:
297
298
298 LDAP Search Scope : required
299 LDAP Search Scope : required
299 This limits how far LDAP will search for a matching object.
300 This limits how far LDAP will search for a matching object.
300
301
301 BASE
302 BASE
302 Only allows searching of `Base DN`_ and is usually not what you
303 Only allows searching of `Base DN`_ and is usually not what you
303 want.
304 want.
304
305
305 ONELEVEL
306 ONELEVEL
306 Searches all entries under `Base DN`_, but not Base DN itself.
307 Searches all entries under `Base DN`_, but not Base DN itself.
307
308
308 SUBTREE
309 SUBTREE
309 Searches all entries below `Base DN`_, but not Base DN itself.
310 Searches all entries below `Base DN`_, but not Base DN itself.
310 When using SUBTREE `LDAP Filter`_ is useful to limit object
311 When using SUBTREE `LDAP Filter`_ is useful to limit object
311 location.
312 location.
312
313
313 .. _Login Attribute:
314 .. _Login Attribute:
314
315
315 Login Attribute : required
316 Login Attribute : required
316 The LDAP record attribute that will be matched as the USERNAME or
317 The LDAP record attribute that will be matched as the USERNAME or
317 ACCOUNT used to connect to Kallithea. This will be added to `LDAP
318 ACCOUNT used to connect to Kallithea. This will be added to `LDAP
318 Filter`_ for locating the User object. If `LDAP Filter`_ is specified as
319 Filter`_ for locating the User object. If `LDAP Filter`_ is specified as
319 "LDAPFILTER", `Login Attribute`_ is specified as "uid" and the user has
320 "LDAPFILTER", `Login Attribute`_ is specified as "uid" and the user has
320 connected as "jsmith" then the `LDAP Filter`_ will be augmented as below
321 connected as "jsmith" then the `LDAP Filter`_ will be augmented as below
321 ::
322 ::
322
323
323 (&(LDAPFILTER)(uid=jsmith))
324 (&(LDAPFILTER)(uid=jsmith))
324
325
325 .. _ldap_attr_firstname:
326 .. _ldap_attr_firstname:
326
327
327 First Name Attribute : required
328 First Name Attribute : required
328 The LDAP record attribute which represents the user's first name.
329 The LDAP record attribute which represents the user's first name.
329
330
330 .. _ldap_attr_lastname:
331 .. _ldap_attr_lastname:
331
332
332 Last Name Attribute : required
333 Last Name Attribute : required
333 The LDAP record attribute which represents the user's last name.
334 The LDAP record attribute which represents the user's last name.
334
335
335 .. _ldap_attr_email:
336 .. _ldap_attr_email:
336
337
337 Email Attribute : required
338 Email Attribute : required
338 The LDAP record attribute which represents the user's email address.
339 The LDAP record attribute which represents the user's email address.
339
340
340 If all data are entered correctly, and python-ldap_ is properly installed
341 If all data are entered correctly, and python-ldap_ is properly installed
341 users should be granted access to Kallithea with LDAP accounts. At this
342 users should be granted access to Kallithea with LDAP accounts. At this
342 time user information is copied from LDAP into the Kallithea user database.
343 time user information is copied from LDAP into the Kallithea user database.
343 This means that updates of an LDAP user object may not be reflected as a
344 This means that updates of an LDAP user object may not be reflected as a
344 user update in Kallithea.
345 user update in Kallithea.
345
346
346 If You have problems with LDAP access and believe You entered correct
347 If You have problems with LDAP access and believe You entered correct
347 information check out the Kallithea logs, any error messages sent from LDAP
348 information check out the Kallithea logs, any error messages sent from LDAP
348 will be saved there.
349 will be saved there.
349
350
350 Active Directory
351 Active Directory
351 ''''''''''''''''
352 ''''''''''''''''
352
353
353 Kallithea can use Microsoft Active Directory for user authentication. This
354 Kallithea can use Microsoft Active Directory for user authentication. This
354 is done through an LDAP or LDAPS connection to Active Directory. The
355 is done through an LDAP or LDAPS connection to Active Directory. The
355 following LDAP configuration settings are typical for using Active
356 following LDAP configuration settings are typical for using Active
356 Directory ::
357 Directory ::
357
358
358 Base DN = OU=SBSUsers,OU=Users,OU=MyBusiness,DC=v3sys,DC=local
359 Base DN = OU=SBSUsers,OU=Users,OU=MyBusiness,DC=v3sys,DC=local
359 Login Attribute = sAMAccountName
360 Login Attribute = sAMAccountName
360 First Name Attribute = givenName
361 First Name Attribute = givenName
361 Last Name Attribute = sn
362 Last Name Attribute = sn
362 Email Attribute = mail
363 Email Attribute = mail
363
364
364 All other LDAP settings will likely be site-specific and should be
365 All other LDAP settings will likely be site-specific and should be
365 appropriately configured.
366 appropriately configured.
366
367
367
368
368 Authentication by container or reverse-proxy
369 Authentication by container or reverse-proxy
369 --------------------------------------------
370 --------------------------------------------
370
371
371 Kallithea supports delegating the authentication
372 Kallithea supports delegating the authentication
372 of users to its WSGI container, or to a reverse-proxy server through which all
373 of users to its WSGI container, or to a reverse-proxy server through which all
373 clients access the application.
374 clients access the application.
374
375
375 When these authentication methods are enabled in Kallithea, it uses the
376 When these authentication methods are enabled in Kallithea, it uses the
376 username that the container/proxy (Apache or Nginx, etc.) provides and doesn't
377 username that the container/proxy (Apache or Nginx, etc.) provides and doesn't
377 perform the authentication itself. The authorization, however, is still done by
378 perform the authentication itself. The authorization, however, is still done by
378 Kallithea according to its settings.
379 Kallithea according to its settings.
379
380
380 When a user logs in for the first time using these authentication methods,
381 When a user logs in for the first time using these authentication methods,
381 a matching user account is created in Kallithea with default permissions. An
382 a matching user account is created in Kallithea with default permissions. An
382 administrator can then modify it using Kallithea's admin interface.
383 administrator can then modify it using Kallithea's admin interface.
383
384
384 It's also possible for an administrator to create accounts and configure their
385 It's also possible for an administrator to create accounts and configure their
385 permissions before the user logs in for the first time, using the :ref:`create-user` API.
386 permissions before the user logs in for the first time, using the :ref:`create-user` API.
386
387
387
388 Container-based authentication
388 Container-based authentication
389 ''''''''''''''''''''''''''''''
389 ''''''''''''''''''''''''''''''
390
390
391 In a container-based authentication setup, Kallithea reads the user name from
391 In a container-based authentication setup, Kallithea reads the user name from
392 the ``REMOTE_USER`` server variable provided by the WSGI container.
392 the ``REMOTE_USER`` server variable provided by the WSGI container.
393
393
394 After setting up your container (see `Apache with mod_wsgi`_), you'll need
394 After setting up your container (see `Apache with mod_wsgi`_), you'll need
395 to configure it to require authentication on the location configured for
395 to configure it to require authentication on the location configured for
396 Kallithea.
396 Kallithea.
397
397
398
399 Proxy pass-through authentication
398 Proxy pass-through authentication
400 '''''''''''''''''''''''''''''''''
399 '''''''''''''''''''''''''''''''''
401
400
402 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
403 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
404 sent by the reverse-proxy server.
403 sent by the reverse-proxy server.
405
404
406 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`_,
407 `Apache as subdirectory`_ or `Nginx virtual host example`_), you'll need to
406 `Apache as subdirectory`_ or `Nginx virtual host example`_), you'll need to
408 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
409 ``X-Forwarded-User``.
408 ``X-Forwarded-User``.
410
409
411 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
412 reverse-proxy setup with basic auth:
411 reverse-proxy setup with basic auth:
413
412
414 .. code-block:: apache
413 .. code-block:: apache
415
414
416 <Location /someprefix>
415 <Location /someprefix>
417 ProxyPass http://127.0.0.1:5000/someprefix
416 ProxyPass http://127.0.0.1:5000/someprefix
418 ProxyPassReverse http://127.0.0.1:5000/someprefix
417 ProxyPassReverse http://127.0.0.1:5000/someprefix
419 SetEnvIf X-Url-Scheme https HTTPS=1
418 SetEnvIf X-Url-Scheme https HTTPS=1
420
419
421 AuthType Basic
420 AuthType Basic
422 AuthName "Kallithea authentication"
421 AuthName "Kallithea authentication"
423 AuthUserFile /srv/kallithea/.htpasswd
422 AuthUserFile /srv/kallithea/.htpasswd
424 Require valid-user
423 Require valid-user
425
424
426 RequestHeader unset X-Forwarded-User
425 RequestHeader unset X-Forwarded-User
427
426
428 RewriteEngine On
427 RewriteEngine On
429 RewriteCond %{LA-U:REMOTE_USER} (.+)
428 RewriteCond %{LA-U:REMOTE_USER} (.+)
430 RewriteRule .* - [E=RU:%1]
429 RewriteRule .* - [E=RU:%1]
431 RequestHeader set X-Forwarded-User %{RU}e
430 RequestHeader set X-Forwarded-User %{RU}e
432 </Location>
431 </Location>
433
432
434
433
435 .. note::
434 .. note::
436 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
437 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
438 forge the authentication header and could effectively become authenticated
437 forge the authentication header and could effectively become authenticated
439 using any account of their liking.
438 using any account of their liking.
440
439
441
440
442 Integration with issue trackers
441 Integration with issue trackers
443 -------------------------------
442 -------------------------------
444
443
445 Kallithea provides a simple integration with issue trackers. It's possible
444 Kallithea provides a simple integration with issue trackers. It's possible
446 to define a regular expression that will match an issue ID in commit messages,
445 to define a regular expression that will match an issue ID in commit messages,
447 and have that replaced 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
448 uncomment the following variables in the ini file::
447 uncomment the following variables in the ini file::
449
448
450 issue_pat = (?:^#|\s#)(\w+)
449 issue_pat = (?:^#|\s#)(\w+)
451 issue_server_link = https://myissueserver.com/{repo}/issue/{id}
450 issue_server_link = https://myissueserver.com/{repo}/issue/{id}
452 issue_prefix = #
451 issue_prefix = #
453
452
454 ``issue_pat`` is the regular expression describing which strings in
453 ``issue_pat`` is the regular expression describing which strings in
455 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
456 parentheses should be used to specify the actual issue id.
455 parentheses should be used to specify the actual issue id.
457
456
458 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``.
459
458
460 Matched issue references are replaced with the link specified in
459 Matched issue references are replaced with the link specified in
461 ``issue_server_link``. ``{id}`` is replaced with the issue ID, and
460 ``issue_server_link``. ``{id}`` is replaced with the issue ID, and
462 ``{repo}`` with the repository name. Since the # is stripped away,
461 ``{repo}`` with the repository name. Since the # is stripped away,
463 ``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
464 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
465 generate a URL in the format:
464 generate a URL in the format:
466
465
467 .. code-block:: html
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:
480
479
481 .. code-block:: html
480 .. code-block:: html
482
481
483 <a href="https://mywiki.com/some-id">WIKI-some-id</a>
482 <a href="https://mywiki.com/some-id">WIKI-some-id</a>
484
483
485
484
486 Hook management
485 Hook management
487 ---------------
486 ---------------
488
487
489 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.
490 To manage hooks, choose *Admin > Settings > Hooks*.
489 To manage hooks, choose *Admin > Settings > Hooks*.
491
490
492 The built-in hooks cannot be modified, though they can be enabled or disabled in the *VCS* section.
491 The built-in hooks cannot be modified, though they can be enabled or disabled in the *VCS* section.
493
492
494 To add another custom hook simply fill in the first textbox with
493 To add another custom hook simply fill in the first textbox with
495 ``<name>.<hook_type>`` and the second with the hook path. Example hooks
494 ``<name>.<hook_type>`` and the second with the hook path. Example hooks
496 can be found in ``kallithea.lib.hooks``.
495 can be found in ``kallithea.lib.hooks``.
497
496
498
497
499 Changing default encoding
498 Changing default encoding
500 -------------------------
499 -------------------------
501
500
502 By default, Kallithea uses UTF-8 encoding.
501 By default, Kallithea uses UTF-8 encoding.
503 This is configurable as ``default_encoding`` in the .ini file.
502 This is configurable as ``default_encoding`` in the .ini file.
504 This affects many parts in Kallithea including user names, filenames, and
503 This affects many parts in Kallithea including user names, filenames, and
505 encoding of commit messages. In addition Kallithea can detect if the ``chardet``
504 encoding of commit messages. In addition Kallithea can detect if the ``chardet``
506 library is installed. If ``chardet`` is detected Kallithea will fallback to it
505 library is installed. If ``chardet`` is detected Kallithea will fallback to it
507 when there are encode/decode errors.
506 when there are encode/decode errors.
508
507
509
508
510 Celery configuration
509 Celery configuration
511 --------------------
510 --------------------
512
511
513 Kallithea can use the distributed task queue system Celery_ to run tasks like
512 Kallithea can use the distributed task queue system Celery_ to run tasks like
514 cloning repositories or sending emails.
513 cloning repositories or sending emails.
515
514
516 Kallithea will in most setups work perfectly fine out of the box (without
515 Kallithea will in most setups work perfectly fine out of the box (without
517 Celery), executing all tasks in the web server process. Some tasks can however
516 Celery), executing all tasks in the web server process. Some tasks can however
518 take some time to run and it can be better to run such tasks asynchronously in
517 take some time to run and it can be better to run such tasks asynchronously in
519 a separate process so the web server can focus on serving web requests.
518 a separate process so the web server can focus on serving web requests.
520
519
521 For installation and configuration of Celery, see the `Celery documentation`_.
520 For installation and configuration of Celery, see the `Celery documentation`_.
522 Note that Celery requires a message broker service like RabbitMQ_ (recommended)
521 Note that Celery requires a message broker service like RabbitMQ_ (recommended)
523 or Redis_.
522 or Redis_.
524
523
525 The use of Celery is configured in the Kallithea ini configuration file.
524 The use of Celery is configured in the Kallithea ini configuration file.
526 To enable it, simply set::
525 To enable it, simply set::
527
526
528 use_celery = true
527 use_celery = true
529
528
530 and add or change the ``celery.*`` and ``broker.*`` configuration variables.
529 and add or change the ``celery.*`` and ``broker.*`` configuration variables.
531
530
532 Remember that the ini files use the format with '.' and not with '_' like
531 Remember that the ini files use the format with '.' and not with '_' like
533 Celery. So for example setting `BROKER_HOST` in Celery means setting
532 Celery. So for example setting `BROKER_HOST` in Celery means setting
534 `broker.host` in the configuration file.
533 `broker.host` in the configuration file.
535
534
536 To start the Celery process, run::
535 To start the Celery process, run::
537
536
538 paster celeryd <configfile.ini>
537 paster celeryd <configfile.ini>
539
538
540
539
541 .. note::
540 .. note::
542 Make sure you run this command from the same virtualenv, and with the same
541 Make sure you run this command from the same virtualenv, and with the same
543 user that Kallithea runs.
542 user that Kallithea runs.
544
543
545
544
546 HTTPS support
545 HTTPS support
547 -------------
546 -------------
548
547
549 Kallithea will by default generate URLs based on the WSGI environment.
548 Kallithea will by default generate URLs based on the WSGI environment.
550
549
551 Alternatively, you can use some special configuration settings to control
550 Alternatively, you can use some special configuration settings to control
552 directly which scheme/protocol Kallithea will use when generating URLs:
551 directly which scheme/protocol Kallithea will use when generating URLs:
553
552
554 - With ``https_fixup = true``, the scheme will be taken from the
553 - With ``https_fixup = true``, the scheme will be taken from the
555 ``X-Url-Scheme``, ``X-Forwarded-Scheme`` or ``X-Forwarded-Proto`` HTTP header
554 ``X-Url-Scheme``, ``X-Forwarded-Scheme`` or ``X-Forwarded-Proto`` HTTP header
556 (default ``http``).
555 (default ``http``).
557 - With ``force_https = true`` the default will be ``https``.
556 - With ``force_https = true`` the default will be ``https``.
558 - With ``use_htsts = true``, Kallithea will set ``Strict-Transport-Security`` when using https.
557 - With ``use_htsts = true``, Kallithea will set ``Strict-Transport-Security`` when using https.
559
558
560
559
561 Nginx virtual host example
560 Nginx virtual host example
562 --------------------------
561 --------------------------
563
562
564 Sample config for Nginx using proxy:
563 Sample config for Nginx using proxy:
565
564
566 .. code-block:: nginx
565 .. code-block:: nginx
567
566
568 upstream kallithea {
567 upstream kallithea {
569 server 127.0.0.1:5000;
568 server 127.0.0.1:5000;
570 # add more instances for load balancing
569 # add more instances for load balancing
571 #server 127.0.0.1:5001;
570 #server 127.0.0.1:5001;
572 #server 127.0.0.1:5002;
571 #server 127.0.0.1:5002;
573 }
572 }
574
573
575 ## gist alias
574 ## gist alias
576 server {
575 server {
577 listen 443;
576 listen 443;
578 server_name gist.myserver.com;
577 server_name gist.myserver.com;
579 access_log /var/log/nginx/gist.access.log;
578 access_log /var/log/nginx/gist.access.log;
580 error_log /var/log/nginx/gist.error.log;
579 error_log /var/log/nginx/gist.error.log;
581
580
582 ssl on;
581 ssl on;
583 ssl_certificate gist.your.kallithea.server.crt;
582 ssl_certificate gist.your.kallithea.server.crt;
584 ssl_certificate_key gist.your.kallithea.server.key;
583 ssl_certificate_key gist.your.kallithea.server.key;
585
584
586 ssl_session_timeout 5m;
585 ssl_session_timeout 5m;
587
586
588 ssl_protocols SSLv3 TLSv1;
587 ssl_protocols SSLv3 TLSv1;
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;
588 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;
590 ssl_prefer_server_ciphers on;
589 ssl_prefer_server_ciphers on;
591
590
592 rewrite ^/(.+)$ https://your.kallithea.server/_admin/gists/$1;
591 rewrite ^/(.+)$ https://your.kallithea.server/_admin/gists/$1;
593 rewrite (.*) https://your.kallithea.server/_admin/gists;
592 rewrite (.*) https://your.kallithea.server/_admin/gists;
594 }
593 }
595
594
596 server {
595 server {
597 listen 443;
596 listen 443;
598 server_name your.kallithea.server;
597 server_name your.kallithea.server;
599 access_log /var/log/nginx/kallithea.access.log;
598 access_log /var/log/nginx/kallithea.access.log;
600 error_log /var/log/nginx/kallithea.error.log;
599 error_log /var/log/nginx/kallithea.error.log;
601
600
602 ssl on;
601 ssl on;
603 ssl_certificate your.kallithea.server.crt;
602 ssl_certificate your.kallithea.server.crt;
604 ssl_certificate_key your.kallithea.server.key;
603 ssl_certificate_key your.kallithea.server.key;
605
604
606 ssl_session_timeout 5m;
605 ssl_session_timeout 5m;
607
606
608 ssl_protocols SSLv3 TLSv1;
607 ssl_protocols SSLv3 TLSv1;
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;
608 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;
610 ssl_prefer_server_ciphers on;
609 ssl_prefer_server_ciphers on;
611
610
612 ## uncomment root directive if you want to serve static files by nginx
611 ## uncomment root directive if you want to serve static files by nginx
613 ## requires static_files = false in .ini file
612 ## requires static_files = false in .ini file
614 #root /path/to/installation/kallithea/public;
613 #root /path/to/installation/kallithea/public;
615 include /etc/nginx/proxy.conf;
614 include /etc/nginx/proxy.conf;
616 location / {
615 location / {
617 try_files $uri @kallithea;
616 try_files $uri @kallithea;
618 }
617 }
619
618
620 location @kallithea {
619 location @kallithea {
621 proxy_pass http://kallithea;
620 proxy_pass http://kallithea;
622 }
621 }
623
622
624 }
623 }
625
624
626 Here's the proxy.conf. It's tuned so it will not timeout on long
625 Here's the proxy.conf. It's tuned so it will not timeout on long
627 pushes or large pushes::
626 pushes or large pushes::
628
627
629 proxy_redirect off;
628 proxy_redirect off;
630 proxy_set_header Host $host;
629 proxy_set_header Host $host;
631 ## needed for container auth
630 ## needed for container auth
632 #proxy_set_header REMOTE_USER $remote_user;
631 #proxy_set_header REMOTE_USER $remote_user;
633 #proxy_set_header X-Forwarded-User $remote_user;
632 #proxy_set_header X-Forwarded-User $remote_user;
634 proxy_set_header X-Url-Scheme $scheme;
633 proxy_set_header X-Url-Scheme $scheme;
635 proxy_set_header X-Host $http_host;
634 proxy_set_header X-Host $http_host;
636 proxy_set_header X-Real-IP $remote_addr;
635 proxy_set_header X-Real-IP $remote_addr;
637 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
636 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
638 proxy_set_header Proxy-host $proxy_host;
637 proxy_set_header Proxy-host $proxy_host;
639 proxy_buffering off;
638 proxy_buffering off;
640 proxy_connect_timeout 7200;
639 proxy_connect_timeout 7200;
641 proxy_send_timeout 7200;
640 proxy_send_timeout 7200;
642 proxy_read_timeout 7200;
641 proxy_read_timeout 7200;
643 proxy_buffers 8 32k;
642 proxy_buffers 8 32k;
644 client_max_body_size 1024m;
643 client_max_body_size 1024m;
645 client_body_buffer_size 128k;
644 client_body_buffer_size 128k;
646 large_client_header_buffers 8 64k;
645 large_client_header_buffers 8 64k;
647
646
648
647
649 Apache virtual host reverse proxy example
648 Apache virtual host reverse proxy example
650 -----------------------------------------
649 -----------------------------------------
651
650
652 Here is a sample configuration file for Apache using proxy:
651 Here is a sample configuration file for Apache using proxy:
653
652
654 .. code-block:: apache
653 .. code-block:: apache
655
654
656 <VirtualHost *:80>
655 <VirtualHost *:80>
657 ServerName hg.myserver.com
656 ServerName hg.myserver.com
658 ServerAlias hg.myserver.com
657 ServerAlias hg.myserver.com
659
658
660 <Proxy *>
659 <Proxy *>
661 # For Apache 2.4 and later:
660 # For Apache 2.4 and later:
662 Require all granted
661 Require all granted
663
662
664 # For Apache 2.2 and earlier, instead use:
663 # For Apache 2.2 and earlier, instead use:
665 # Order allow,deny
664 # Order allow,deny
666 # Allow from all
665 # Allow from all
667 </Proxy>
666 </Proxy>
668
667
669 #important !
668 #important !
670 #Directive to properly generate url (clone url) for pylons
669 #Directive to properly generate url (clone url) for pylons
671 ProxyPreserveHost On
670 ProxyPreserveHost On
672
671
673 #kallithea instance
672 #kallithea instance
674 ProxyPass / http://127.0.0.1:5000/
673 ProxyPass / http://127.0.0.1:5000/
675 ProxyPassReverse / http://127.0.0.1:5000/
674 ProxyPassReverse / http://127.0.0.1:5000/
676
675
677 #to enable https use line below
676 #to enable https use line below
678 #SetEnvIf X-Url-Scheme https HTTPS=1
677 #SetEnvIf X-Url-Scheme https HTTPS=1
679 </VirtualHost>
678 </VirtualHost>
680
679
681
680
682 Additional tutorial
681 Additional tutorial
683 http://pylonsbook.com/en/1.1/deployment.html#using-apache-to-proxy-requests-to-pylons
682 http://pylonsbook.com/en/1.1/deployment.html#using-apache-to-proxy-requests-to-pylons
684
683
685
684
686 Apache as subdirectory
685 Apache as subdirectory
687 ----------------------
686 ----------------------
688
687
689 Apache subdirectory part:
688 Apache subdirectory part:
690
689
691 .. code-block:: apache
690 .. code-block:: apache
692
691
693 <Location /<someprefix> >
692 <Location /<someprefix> >
694 ProxyPass http://127.0.0.1:5000/<someprefix>
693 ProxyPass http://127.0.0.1:5000/<someprefix>
695 ProxyPassReverse http://127.0.0.1:5000/<someprefix>
694 ProxyPassReverse http://127.0.0.1:5000/<someprefix>
696 SetEnvIf X-Url-Scheme https HTTPS=1
695 SetEnvIf X-Url-Scheme https HTTPS=1
697 </Location>
696 </Location>
698
697
699 Besides the regular apache setup you will need to add the following line
698 Besides the regular apache setup you will need to add the following line
700 into ``[app:main]`` section of your .ini file::
699 into ``[app:main]`` section of your .ini file::
701
700
702 filter-with = proxy-prefix
701 filter-with = proxy-prefix
703
702
704 Add the following at the end of the .ini file::
703 Add the following at the end of the .ini file::
705
704
706 [filter:proxy-prefix]
705 [filter:proxy-prefix]
707 use = egg:PasteDeploy#prefix
706 use = egg:PasteDeploy#prefix
708 prefix = /<someprefix>
707 prefix = /<someprefix>
709
708
710
709
711 then change ``<someprefix>`` into your chosen prefix
710 then change ``<someprefix>`` into your chosen prefix
712
711
712
713 Apache with mod_wsgi
713 Apache with mod_wsgi
714 --------------------
714 --------------------
715
715
716 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
717 that, you'll need to:
717 that, you'll need to:
718
718
719 - 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
720 the package libapache2-mod-wsgi::
720 the package libapache2-mod-wsgi::
721
721
722 aptitude install libapache2-mod-wsgi
722 aptitude install libapache2-mod-wsgi
723
723
724 - Enable mod_wsgi::
724 - Enable mod_wsgi::
725
725
726 a2enmod wsgi
726 a2enmod wsgi
727
727
728 - 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
729 check that the paths correctly point to where you installed Kallithea
729 check that the paths correctly point to where you installed Kallithea
730 and its Python Virtual Environment.
730 and its Python Virtual Environment.
731 - Enable the ``WSGIScriptAlias`` directive for the WSGI dispatch script,
731 - Enable the ``WSGIScriptAlias`` directive for the WSGI dispatch script,
732 as in the following example. Once again, check the paths are
732 as in the following example. Once again, check the paths are
733 correctly specified.
733 correctly specified.
734
734
735 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
736
737
737
738 .. code-block:: apache
738 .. code-block:: apache
739
739
740 WSGIDaemonProcess kallithea \
740 WSGIDaemonProcess kallithea \
741 processes=1 threads=4 \
741 processes=1 threads=4 \
742 python-path=/srv/kallithea/pyenv/lib/python2.7/site-packages
742 python-path=/srv/kallithea/pyenv/lib/python2.7/site-packages
743 WSGIScriptAlias / /srv/kallithea/dispatch.wsgi
743 WSGIScriptAlias / /srv/kallithea/dispatch.wsgi
744 WSGIPassAuthorization On
744 WSGIPassAuthorization On
745
745
746 Or if using a dispatcher WSGI script with proper virtualenv activation:
746 Or if using a dispatcher WSGI script with proper virtualenv activation:
747
747
748 .. code-block:: apache
748 .. code-block:: apache
749
749
750 WSGIDaemonProcess kallithea processes=1 threads=4
750 WSGIDaemonProcess kallithea processes=1 threads=4
751 WSGIScriptAlias / /srv/kallithea/dispatch.wsgi
751 WSGIScriptAlias / /srv/kallithea/dispatch.wsgi
752 WSGIPassAuthorization On
752 WSGIPassAuthorization On
753
753
754
754
755 .. note::
755 .. note::
756 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
757 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.
758
758
759 .. note::
759 .. note::
760 If running Kallithea in multiprocess mode,
760 If running Kallithea in multiprocess mode,
761 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
762 gets it's own cache invalidation key.
762 gets it's own cache invalidation key.
763
763
764
764
765 Example WSGI dispatch script:
765 Example WSGI dispatch script:
766
766
767 .. code-block:: python
767 .. code-block:: python
768
768
769 import os
769 import os
770 os.environ["HGENCODING"] = "UTF-8"
770 os.environ["HGENCODING"] = "UTF-8"
771 os.environ['PYTHON_EGG_CACHE'] = '/srv/kallithea/.egg-cache'
771 os.environ['PYTHON_EGG_CACHE'] = '/srv/kallithea/.egg-cache'
772
772
773 # sometimes it's needed to set the curent dir
773 # sometimes it's needed to set the curent dir
774 os.chdir('/srv/kallithea/')
774 os.chdir('/srv/kallithea/')
775
775
776 import site
776 import site
777 site.addsitedir("/srv/kallithea/pyenv/lib/python2.7/site-packages")
777 site.addsitedir("/srv/kallithea/pyenv/lib/python2.7/site-packages")
778
778
779 from paste.deploy import loadapp
779 from paste.deploy import loadapp
780 from paste.script.util.logging_config import fileConfig
780 from paste.script.util.logging_config import fileConfig
781
781
782 fileConfig('/srv/kallithea/my.ini')
782 fileConfig('/srv/kallithea/my.ini')
783 application = loadapp('config:/srv/kallithea/my.ini')
783 application = loadapp('config:/srv/kallithea/my.ini')
784
784
785 Or using proper virtualenv activation:
785 Or using proper virtualenv activation:
786
786
787 .. code-block:: python
787 .. code-block:: python
788
788
789 activate_this = '/srv/kallithea/venv/bin/activate_this.py'
789 activate_this = '/srv/kallithea/venv/bin/activate_this.py'
790 execfile(activate_this, dict(__file__=activate_this))
790 execfile(activate_this, dict(__file__=activate_this))
791
791
792 import os
792 import os
793 os.environ['HOME'] = '/srv/kallithea'
793 os.environ['HOME'] = '/srv/kallithea'
794
794
795 ini = '/srv/kallithea/kallithea.ini'
795 ini = '/srv/kallithea/kallithea.ini'
796 from paste.script.util.logging_config import fileConfig
796 from paste.script.util.logging_config import fileConfig
797 fileConfig(ini)
797 fileConfig(ini)
798 from paste.deploy import loadapp
798 from paste.deploy import loadapp
799 application = loadapp('config:' + ini)
799 application = loadapp('config:' + ini)
800
800
801
801
802 Other configuration files
802 Other configuration files
803 -------------------------
803 -------------------------
804
804
805 A number of `example init.d scripts`__ can be found in
805 A number of `example init.d scripts`__ can be found in
806 the ``init.d`` directory of the Kallithea source.
806 the ``init.d`` directory of the Kallithea source.
807
807
808 .. __: https://kallithea-scm.org/repos/kallithea/files/tip/init.d/ .
808 .. __: https://kallithea-scm.org/repos/kallithea/files/tip/init.d/ .
809
809
810
810 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
811 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
811 .. _python: http://www.python.org/
812 .. _python: http://www.python.org/
812 .. _Mercurial: http://mercurial.selenic.com/
813 .. _Mercurial: http://mercurial.selenic.com/
813 .. _Celery: http://celeryproject.org/
814 .. _Celery: http://celeryproject.org/
814 .. _Celery documentation: http://docs.celeryproject.org/en/latest/getting-started/index.html
815 .. _Celery documentation: http://docs.celeryproject.org/en/latest/getting-started/index.html
815 .. _RabbitMQ: http://www.rabbitmq.com/
816 .. _RabbitMQ: http://www.rabbitmq.com/
816 .. _Redis: http://redis.io/
817 .. _Redis: http://redis.io/
817 .. _python-ldap: http://www.python-ldap.org/
818 .. _python-ldap: http://www.python-ldap.org/
818 .. _mercurial-server: http://www.lshift.net/mercurial-server.html
819 .. _mercurial-server: http://www.lshift.net/mercurial-server.html
819 .. _PublishingRepositories: http://mercurial.selenic.com/wiki/PublishingRepositories
820 .. _PublishingRepositories: http://mercurial.selenic.com/wiki/PublishingRepositories
@@ -1,26 +1,27 b''
1 .. _backup:
1 .. _backup:
2
2
3 ====================
3 ====================
4 Backing up Kallithea
4 Backing up Kallithea
5 ====================
5 ====================
6
6
7
7
8 Settings
8 Settings
9 --------
9 --------
10
10
11 Just copy your .ini file, it contains all Kallithea settings.
11 Just copy your .ini file, it contains all Kallithea settings.
12
12
13
13 Whoosh index
14 Whoosh index
14 ------------
15 ------------
15
16
16 The Whoosh index is located in the ``data/index`` directory where you installed
17 The Whoosh index is located in the ``data/index`` directory where you installed
17 Kallithea, i.e., the same place where the ini file is located
18 Kallithea, i.e., the same place where the ini file is located
18
19
19
20
20 Database
21 Database
21 --------
22 --------
22
23
23 When using sqlite just copy kallithea.db.
24 When using sqlite just copy kallithea.db.
24 Any other database engine requires a manual backup operation.
25 Any other database engine requires a manual backup operation.
25
26
26 A database backup will contain all gathered statistics.
27 A database backup will contain all gathered statistics.
@@ -1,32 +1,33 b''
1 .. _debugging:
1 .. _debugging:
2
2
3 ===================
3 ===================
4 Debugging Kallithea
4 Debugging Kallithea
5 ===================
5 ===================
6
6
7 If you encounter problems with Kallithea, here are some instructions
7 If you encounter problems with Kallithea, here are some instructions
8 on how to debug them.
8 on how to debug them.
9
9
10 .. note:: First make sure you're using the latest version available.
10 .. note:: First make sure you're using the latest version available.
11
11
12
12 Enable detailed debug
13 Enable detailed debug
13 ---------------------
14 ---------------------
14
15
15 Kallithea uses the standard Python ``logging`` module to log its output.
16 Kallithea uses the standard Python ``logging`` module to log its output.
16 By default only loggers with ``INFO`` level are displayed. To enable full output
17 By default only loggers with ``INFO`` level are displayed. To enable full output
17 change ``level = DEBUG`` for all logging handlers in the currently used .ini file.
18 change ``level = DEBUG`` for all logging handlers in the currently used .ini file.
18 This change will allow you to see much more detailed output in the log file or
19 This change will allow you to see much more detailed output in the log file or
19 console. This generally helps a lot to track issues.
20 console. This generally helps a lot to track issues.
20
21
21
22
22 Enable interactive debug mode
23 Enable interactive debug mode
23 -----------------------------
24 -----------------------------
24
25
25 To enable interactive debug mode simply comment out ``set debug = false`` in
26 To enable interactive debug mode simply comment out ``set debug = false`` in
26 the .ini file. This will trigger an interactive debugger each time
27 the .ini file. This will trigger an interactive debugger each time
27 there is an error in the browser, or send a http link if an error occured in the backend. This
28 there is an error in the browser, or send a http link if an error occured in the backend. This
28 is a great tool for fast debugging as you get a handy Python console right
29 is a great tool for fast debugging as you get a handy Python console right
29 in the web view.
30 in the web view.
30
31
31 .. warning:: NEVER ENABLE THIS ON PRODUCTION! The interactive console
32 .. warning:: NEVER ENABLE THIS ON PRODUCTION! The interactive console
32 can be a serious security threat to your system.
33 can be a serious security threat to your system.
@@ -1,70 +1,74 b''
1 .. _email:
1 .. _email:
2
2
3 ==============
3 ==============
4 Email settings
4 Email settings
5 ==============
5 ==============
6
6
7 The Kallithea configuration file has several email related settings. When
7 The Kallithea configuration file has several email related settings. When
8 these contain correct values, Kallithea will send email in the situations
8 these contain correct values, Kallithea will send email in the situations
9 described below. If the email configuration is not correct so that emails
9 described below. If the email configuration is not correct so that emails
10 cannot be sent, all mails will show up in the log output.
10 cannot be sent, all mails will show up in the log output.
11
11
12 Before any email can be sent, an SMTP server has to be configured using the
12 Before any email can be sent, an SMTP server has to be configured using the
13 configuration file setting ``smtp_server``. If required for that server, specify
13 configuration file setting ``smtp_server``. If required for that server, specify
14 a username (``smtp_username``) and password (``smtp_password``), a non-standard
14 a username (``smtp_username``) and password (``smtp_password``), a non-standard
15 port (``smtp_port``), encryption settings (``smtp_use_tls`` or ``smtp_use_ssl``)
15 port (``smtp_port``), encryption settings (``smtp_use_tls`` or ``smtp_use_ssl``)
16 and/or specific authentication parameters (``smtp_auth``).
16 and/or specific authentication parameters (``smtp_auth``).
17
17
18
18 Application emails
19 Application emails
19 ------------------
20 ------------------
20
21
21 Kallithea sends an email to `users` on several occasions:
22 Kallithea sends an email to `users` on several occasions:
22
23
23 - when comments are given on one of their changesets
24 - when comments are given on one of their changesets
24 - when comments are given on changesets they are reviewer on or on which they
25 - when comments are given on changesets they are reviewer on or on which they
25 commented regardless
26 commented regardless
26 - when they are invited as reviewer in pull requests
27 - when they are invited as reviewer in pull requests
27 - when they request a password reset
28 - when they request a password reset
28
29
29 Kallithea sends an email to all `administrators` upon new account registration.
30 Kallithea sends an email to all `administrators` upon new account registration.
30 Administrators are users with the ``Admin`` flag set on the *Admin > Users*
31 Administrators are users with the ``Admin`` flag set on the *Admin > Users*
31 page.
32 page.
32
33
33 When Kallithea wants to send an email but due to an error cannot correctly
34 When Kallithea wants to send an email but due to an error cannot correctly
34 determine the intended recipients, the administrators and the addresses
35 determine the intended recipients, the administrators and the addresses
35 specified in ``email_to`` in the configuration file are used as fallback.
36 specified in ``email_to`` in the configuration file are used as fallback.
36
37
37 Recipients will see these emails originating from the sender specified in the
38 Recipients will see these emails originating from the sender specified in the
38 ``app_email_from`` setting in the configuration file. This setting can either
39 ``app_email_from`` setting in the configuration file. This setting can either
39 contain only an email address, like `kallithea-noreply@example.com`, or both
40 contain only an email address, like `kallithea-noreply@example.com`, or both
40 a name and an address in the following format: `Kallithea
41 a name and an address in the following format: `Kallithea
41 <kallithea-noreply@example.com>`. The subject of these emails can
42 <kallithea-noreply@example.com>`. The subject of these emails can
42 optionally be prefixed with the value of ``email_prefix`` in the configuration
43 optionally be prefixed with the value of ``email_prefix`` in the configuration
43 file.
44 file.
44
45
46
45 Error emails
47 Error emails
46 ------------
48 ------------
47
49
48 When an exception occurs in Kallithea -- and unless interactive debugging is
50 When an exception occurs in Kallithea -- and unless interactive debugging is
49 enabled using ``set debug = true`` in the ``[app:main]`` section of the
51 enabled using ``set debug = true`` in the ``[app:main]`` section of the
50 configuration file -- an email with exception details is sent by WebError_'s
52 configuration file -- an email with exception details is sent by WebError_'s
51 ``ErrorMiddleware`` to the addresses specified in ``email_to`` in the
53 ``ErrorMiddleware`` to the addresses specified in ``email_to`` in the
52 configuration file.
54 configuration file.
53
55
54 Recipients will see these emails originating from the sender specified in the
56 Recipients will see these emails originating from the sender specified in the
55 ``error_email_from`` setting in the configuration file. This setting can either
57 ``error_email_from`` setting in the configuration file. This setting can either
56 contain only an email address, like `kallithea-noreply@example.com`, or both
58 contain only an email address, like `kallithea-noreply@example.com`, or both
57 a name and an address in the following format: `Kallithea Errors
59 a name and an address in the following format: `Kallithea Errors
58 <kallithea-noreply@example.com>`.
60 <kallithea-noreply@example.com>`.
59
61
60 *Note:* The WebError_ package does not respect ``smtp_port`` and assumes the
62 *Note:* The WebError_ package does not respect ``smtp_port`` and assumes the
61 standard SMTP port (25). If you have a remote SMTP server with a different port,
63 standard SMTP port (25). If you have a remote SMTP server with a different port,
62 you could set up a local forwarding SMTP server on port 25.
64 you could set up a local forwarding SMTP server on port 25.
63
65
66
64 References
67 References
65 ----------
68 ----------
66
69
67 - `Error Middleware (Pylons documentation) <http://pylons-webframework.readthedocs.org/en/latest/debugging.html#error-middleware>`_
70 - `Error Middleware (Pylons documentation) <http://pylons-webframework.readthedocs.org/en/latest/debugging.html#error-middleware>`_
68 - `ErrorHandler (Pylons modules documentation) <http://pylons-webframework.readthedocs.org/en/latest/modules/middleware.html#pylons.middleware.ErrorHandler>`_
71 - `ErrorHandler (Pylons modules documentation) <http://pylons-webframework.readthedocs.org/en/latest/modules/middleware.html#pylons.middleware.ErrorHandler>`_
69
72
73
70 .. _WebError: https://pypi.python.org/pypi/WebError
74 .. _WebError: https://pypi.python.org/pypi/WebError
@@ -1,181 +1,182 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 deletion
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 repositories::
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
30 File view: follow current branch
31 File view: follow current branch
31 --------------------------------
32 --------------------------------
32
33
33 In the file view, left and right arrows allow to jump to the previous and next
34 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
35 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``
36 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
37 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
38 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 >
39 ``beta`` branch and marks the `Follow current branch` checkbox, the < and >
39 arrows will only show revisions on the ``beta`` branch.
40 arrows will only show revisions on the ``beta`` branch.
40
41
41
42
42 Changelog features
43 Changelog features
43 ------------------
44 ------------------
44
45
45 The core feature of a repository's ``changelog`` page is to show the revisions
46 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
47 in a repository. However, there are several other features available from the
47 changelog.
48 changelog.
48
49
49 Branch filter
50 Branch filter
50 By default, the changelog shows revisions from all branches in the
51 By default, the changelog shows revisions from all branches in the
51 repository. Use the branch filter to restrict to a given branch.
52 repository. Use the branch filter to restrict to a given branch.
52
53
53 Viewing a changeset
54 Viewing a changeset
54 A particular changeset can be opened by clicking on either the changeset
55 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
56 hash or the commit message, or by ticking the checkbox and clicking the
56 ``Show selected changeset`` button at the top.
57 ``Show selected changeset`` button at the top.
57
58
58 Viewing all changes between two changesets
59 Viewing all changes between two changesets
59 To get a list of all changesets between two selected changesets, along with
60 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
61 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``
62 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
63 button at the top. You can only show the range between the first and last
63 checkbox (no cherry-picking).
64 checkbox (no cherry-picking).
64
65
65 From that page, you can proceed to viewing the overall delta between the
66 From that page, you can proceed to viewing the overall delta between the
66 selected changesets, by clicking the ``Compare revisions`` button.
67 selected changesets, by clicking the ``Compare revisions`` button.
67
68
68 Creating a pull request
69 Creating a pull request
69 You can create a new pull request for the changes of a particular changeset
70 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
71 (and its ancestors) by selecting it and clicking the ``Open new pull request
71 for selected changesets`` button.
72 for selected changesets`` button.
72
73
73
74
74 Permanent repository URLs
75 Permanent repository URLs
75 -------------------------
76 -------------------------
76
77
77 Due to the complicated nature of repository grouping, URLs of repositories
78 Due to the complicated nature of repository grouping, URLs of repositories
78 can often change. For example, a repository originally accessible from::
79 can often change. For example, a repository originally accessible from::
79
80
80 http://example.com/repo_name
81 http://example.com/repo_name
81
82
82 would get a new URL after moving it to test_group::
83 would get a new URL after moving it to test_group::
83
84
84 http://example.com/test_group/repo_name
85 http://example.com/test_group/repo_name
85
86
86 Such moving of a repository to a group can be an issue for build systems and
87 Such moving of a repository to a group can be an issue for build systems and
87 other scripts where the repository paths are hardcoded. To mitigate this,
88 other scripts where the repository paths are hardcoded. To mitigate this,
88 Kallithea provides permanent URLs using the repository ID prefixed with an
89 Kallithea provides permanent URLs using the repository ID prefixed with an
89 underscore. In all Kallithea URLs, for example those for the changelog and the
90 underscore. In all Kallithea URLs, for example those for the changelog and the
90 file view, a repository name can be replaced by this ``_ID`` string. Since IDs
91 file view, a repository name can be replaced by this ``_ID`` string. Since IDs
91 are always the same, moving the repository to a different group will not affect
92 are always the same, moving the repository to a different group will not affect
92 such URLs.
93 such URLs.
93
94
94 In the example, the repository could also be accessible as::
95 In the example, the repository could also be accessible as::
95
96
96 http://example.com/_<ID>
97 http://example.com/_<ID>
97
98
98 The ID of a given repository can be shown from the repository ``Summary`` page,
99 The ID of a given repository can be shown from the repository ``Summary`` page,
99 by selecting the ``Show by ID`` button next to ``Clone URL``.
100 by selecting the ``Show by ID`` button next to ``Clone URL``.
100
101
101
102
102 Email notifications
103 Email notifications
103 -------------------
104 -------------------
104
105
105 With email settings properly configured in the Kallithea
106 With email settings properly configured in the Kallithea
106 configuration file, Kallithea will send emails on user registration and when
107 configuration file, Kallithea will send emails on user registration and when
107 errors occur.
108 errors occur.
108
109
109 Emails are also sent for comments on changesets. In this case, an email is sent
110 Emails are also sent for comments on changesets. In this case, an email is sent
110 to the committer of the changeset (if known to Kallithea), to all reviewers of
111 to the committer of the changeset (if known to Kallithea), to all reviewers of
111 the pull request (if applicable) and to all people mentioned in the comment
112 the pull request (if applicable) and to all people mentioned in the comment
112 using @mention notation.
113 using @mention notation.
113
114
114
115
115 Trending source files
116 Trending source files
116 ---------------------
117 ---------------------
117
118
118 Trending source files are calculated based on a predefined dictionary of known
119 Trending source files are calculated based on a predefined dictionary of known
119 types and extensions. If an extension is missing or you would like to scan
120 types and extensions. If an extension is missing or you would like to scan
120 custom files, it is possible to extend the ``LANGUAGES_EXTENSIONS_MAP``
121 custom files, it is possible to extend the ``LANGUAGES_EXTENSIONS_MAP``
121 dictionary located in ``kallithea/config/conf.py`` with new types.
122 dictionary located in ``kallithea/config/conf.py`` with new types.
122
123
123
124
124 Cloning remote repositories
125 Cloning remote repositories
125 ---------------------------
126 ---------------------------
126
127
127 Kallithea has the ability to clone repositories from given remote locations.
128 Kallithea has the ability to clone repositories from given remote locations.
128 Currently it supports the following options:
129 Currently it supports the following options:
129
130
130 - hg -> hg clone
131 - hg -> hg clone
131 - svn -> hg clone
132 - svn -> hg clone
132 - git -> git clone
133 - git -> git clone
133
134
134
135
135 .. note:: svn -> hg cloning requires the ``hgsubversion`` library to be
136 .. note:: svn -> hg cloning requires the ``hgsubversion`` library to be
136 installed.
137 installed.
137
138
138 If you need to clone repositories that are protected via basic authentication,
139 If you need to clone repositories that are protected via basic authentication,
139 you can pass the credentials in the URL, e.g.
140 you can pass the credentials in the URL, e.g.
140 ``http://user:passw@remote.server/repo``. Kallithea will then try to login and
141 ``http://user:passw@remote.server/repo``. Kallithea will then try to login and
141 clone using the given credentials. Please note that the given credentials will
142 clone using the given credentials. Please note that the given credentials will
142 be stored as plaintext inside the database. However, the authentication
143 be stored as plaintext inside the database. However, the authentication
143 information will not be shown in the clone URL on the summary page.
144 information will not be shown in the clone URL on the summary page.
144
145
145
146
146 Specific features configurable in the Admin settings
147 Specific features configurable in the Admin settings
147 ----------------------------------------------------
148 ----------------------------------------------------
148
149
149 In general, the Admin settings should be self-explanatory and will not be
150 In general, the Admin settings should be self-explanatory and will not be
150 described in more detail in this documentation. However, there are a few
151 described in more detail in this documentation. However, there are a few
151 features that merit further explanation.
152 features that merit further explanation.
152
153
153 Repository extra fields
154 Repository extra fields
154 ~~~~~~~~~~~~~~~~~~~~~~~
155 ~~~~~~~~~~~~~~~~~~~~~~~
155
156
156 In the *Visual* tab, there is an option "Use repository extra
157 In the *Visual* tab, there is an option "Use repository extra
157 fields", which allows to set custom fields for each repository in the system.
158 fields", which allows to set custom fields for each repository in the system.
158
159
159 Once enabled site-wide, the custom fields can be edited per-repository under
160 Once enabled site-wide, the custom fields can be edited per-repository under
160 *Options* | *Settings* | *Extra Fields*.
161 *Options* | *Settings* | *Extra Fields*.
161
162
162 Example usage of such fields would be to define company-specific information
163 Example usage of such fields would be to define company-specific information
163 into repositories, e.g., defining a ``repo_manager`` key that would give info
164 into repositories, e.g., defining a ``repo_manager`` key that would give info
164 about a manager of each repository. There's no limit for adding custom fields.
165 about a manager of each repository. There's no limit for adding custom fields.
165 Newly created fields are accessible via the API.
166 Newly created fields are accessible via the API.
166
167
167 Meta tagging
168 Meta tagging
168 ~~~~~~~~~~~~
169 ~~~~~~~~~~~~
169
170
170 In the *Visual* tab, option "Stylify recognised meta tags" will cause Kallithea
171 In the *Visual* tab, option "Stylify recognised meta tags" will cause Kallithea
171 to turn certain text fragments in repository and repository group
172 to turn certain text fragments in repository and repository group
172 descriptions into colored tags. Currently recognised tags are::
173 descriptions into colored tags. Currently recognised tags are::
173
174
174 [featured]
175 [featured]
175 [stale]
176 [stale]
176 [dead]
177 [dead]
177 [lang => lang]
178 [lang => lang]
178 [license => License]
179 [license => License]
179 [requires => Repo]
180 [requires => Repo]
180 [recommends => Repo]
181 [recommends => Repo]
181 [see => URI]
182 [see => URI]
@@ -1,57 +1,58 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 is often I/O bound, and hence a fast disk (SSD/SAN) is
12 * Kallithea is often I/O bound, and hence a fast disk (SSD/SAN) is
13 usually more important than a fast CPU.
13 usually more important than a fast CPU.
14
14
15 * Sluggish loading of the front page can easily be fixed by grouping repositories or by
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 PostgreSQL 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 PostgreSQL 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 benefits when dealing with
38 Scaling horizontally can give huge performance benefits when dealing with
39 large amounts of traffic (many 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
57 .. _SQLAlchemyGrate: https://github.com/shazow/sqlalchemygrate
58 .. _SQLAlchemyGrate: https://github.com/shazow/sqlalchemygrate
@@ -1,82 +1,88 b''
1 .. _vcs_support:
1 .. _vcs_support:
2
2
3 ===============================
3 ===============================
4 Version control systems support
4 Version control systems support
5 ===============================
5 ===============================
6
6
7 Kallithea supports Git and Mercurial repositories out-of-the-box.
7 Kallithea supports Git and Mercurial repositories out-of-the-box.
8 For Git, you do need the ``git`` command line client installed on the server.
8 For Git, you do need the ``git`` command line client installed on the server.
9
9
10 You can always disable Git or Mercurial support by editing the
10 You can always disable Git or Mercurial support by editing the
11 file ``kallithea/__init__.py`` and commenting out the backend.
11 file ``kallithea/__init__.py`` and commenting out the backend.
12
12
13 .. code-block:: python
13 .. code-block:: python
14
14
15 BACKENDS = {
15 BACKENDS = {
16 'hg': 'Mercurial repository',
16 'hg': 'Mercurial repository',
17 #'git': 'Git repository',
17 #'git': 'Git repository',
18 }
18 }
19
19
20
20 Git support
21 Git support
21 -----------
22 -----------
22
23
24
23 Web server with chunked encoding
25 Web server with chunked encoding
24 ````````````````````````````````
26 ````````````````````````````````
27
25 Large Git pushes require an HTTP server with support for
28 Large Git pushes require an HTTP server with support for
26 chunked encoding for POST. The Python web servers waitress_ and
29 chunked encoding for POST. The Python web servers waitress_ and
27 gunicorn_ (Linux only) can be used. By default, Kallithea uses
30 gunicorn_ (Linux only) can be used. By default, Kallithea uses
28 waitress_ for `paster serve` instead of the built-in `paste` WSGI
31 waitress_ for `paster serve` instead of the built-in `paste` WSGI
29 server.
32 server.
30
33
31 The paster server is controlled in the .ini file::
34 The paster server is controlled in the .ini file::
32
35
33 use = egg:waitress#main
36 use = egg:waitress#main
34
37
35 or::
38 or::
36
39
37 use = egg:gunicorn#main
40 use = egg:gunicorn#main
38
41
39
42
40 Also make sure to comment out the following options::
43 Also make sure to comment out the following options::
41
44
42 threadpool_workers =
45 threadpool_workers =
43 threadpool_max_requests =
46 threadpool_max_requests =
44 use_threadpool =
47 use_threadpool =
45
48
46
49
47 Mercurial support
50 Mercurial support
48 -----------------
51 -----------------
49
52
53
50 Working with Mercurial subrepositories
54 Working with Mercurial subrepositories
51 ``````````````````````````````````````
55 ``````````````````````````````````````
56
52 This section explains how to use Mercurial subrepositories_ in Kallithea.
57 This section explains how to use Mercurial subrepositories_ in Kallithea.
53
58
54 Example usage::
59 Example usage::
55
60
56 ## init a simple repo
61 ## init a simple repo
57 hg init mainrepo
62 hg init mainrepo
58 cd mainrepo
63 cd mainrepo
59 echo "file" > file
64 echo "file" > file
60 hg add file
65 hg add file
61 hg ci --message "initial file"
66 hg ci --message "initial file"
62
67
63 # clone subrepo we want to add from Kallithea
68 # clone subrepo we want to add from Kallithea
64 hg clone http://kallithea.local/subrepo
69 hg clone http://kallithea.local/subrepo
65
70
66 ## specify URL to existing repo in Kallithea as subrepository path
71 ## specify URL to existing repo in Kallithea as subrepository path
67 echo "subrepo = http://kallithea.local/subrepo" > .hgsub
72 echo "subrepo = http://kallithea.local/subrepo" > .hgsub
68 hg add .hgsub
73 hg add .hgsub
69 hg ci --message "added remote subrepo"
74 hg ci --message "added remote subrepo"
70
75
71 In the file list of a clone of ``mainrepo`` you will see a connected
76 In the file list of a clone of ``mainrepo`` you will see a connected
72 subrepository at the revision it was cloned with. Clicking on the
77 subrepository at the revision it was cloned with. Clicking on the
73 subrepository link sends you to the proper repository in Kallithea.
78 subrepository link sends you to the proper repository in Kallithea.
74
79
75 Cloning ``mainrepo`` will also clone the attached subrepository.
80 Cloning ``mainrepo`` will also clone the attached subrepository.
76
81
77 Next we can edit the subrepository data, and push back to Kallithea. This will
82 Next we can edit the subrepository data, and push back to Kallithea. This will
78 update both repositories.
83 update both repositories.
79
84
85
80 .. _waitress: http://pypi.python.org/pypi/waitress
86 .. _waitress: http://pypi.python.org/pypi/waitress
81 .. _gunicorn: http://pypi.python.org/pypi/gunicorn
87 .. _gunicorn: http://pypi.python.org/pypi/gunicorn
82 .. _subrepositories: http://mercurial.aragost.com/kick-start/en/subrepositories/
88 .. _subrepositories: http://mercurial.aragost.com/kick-start/en/subrepositories/
@@ -1,92 +1,97 b''
1 ============
1 ============
2 Translations
2 Translations
3 ============
3 ============
4
4
5 Translations are available on Hosted Weblate at the following URL:
5 Translations are available on Hosted Weblate at the following URL:
6
6
7 https://hosted.weblate.org/projects/kallithea/kallithea/
7 https://hosted.weblate.org/projects/kallithea/kallithea/
8
8
9 Registered users may contribute to the existing languages, or request a new
9 Registered users may contribute to the existing languages, or request a new
10 language translations.
10 language translations.
11
11
12
12 Translating using Weblate
13 Translating using Weblate
13 -------------------------
14 -------------------------
14
15
15 Weblate_ offers a simple and easy to use interface featuring glossary, machine
16 Weblate_ offers a simple and easy to use interface featuring glossary, machine
16 translation, suggestions based on similar translations in other projects,
17 translation, suggestions based on similar translations in other projects,
17 automatic checks etc. Weblate imports the source code tree directly from
18 automatic checks etc. Weblate imports the source code tree directly from
18 the version control system, and commits edits back from time to time.
19 the version control system, and commits edits back from time to time.
19
20
20 When registering at Weblate, make sure you name and email address you prefer to
21 When registering at Weblate, make sure you name and email address you prefer to
21 be used when your changes are committed. We can and probably will amend changesets
22 be used when your changes are committed. We can and probably will amend changesets
22 coming from Weblate, but having things right from the beginning makes things easier.
23 coming from Weblate, but having things right from the beginning makes things easier.
23
24
24 Weblate performs sanity checks all the time and tries to prevent you from ignoring
25 Weblate performs sanity checks all the time and tries to prevent you from ignoring
25 them. Most common mistakes are inconsistent punctuation, whitespaces, missing or extra
26 them. Most common mistakes are inconsistent punctuation, whitespaces, missing or extra
26 format parameters, untranslated strings copied into the translation. Please perform
27 format parameters, untranslated strings copied into the translation. Please perform
27 necessary corrections when they're needed, or override the false positives.
28 necessary corrections when they're needed, or override the false positives.
28
29
30
29 Merging translations from Weblate
31 Merging translations from Weblate
30 ---------------------------------
32 ---------------------------------
31
33
32 Weblate rebases its changes every time it pulls from our repository. Pulls are triggered
34 Weblate rebases its changes every time it pulls from our repository. Pulls are triggered
33 by a web hook from Our Own Kallithea every time it receives new commits. Usually merging
35 by a web hook from Our Own Kallithea every time it receives new commits. Usually merging
34 the new translations is a straightforward process consisting of a pull from Weblate-hosted
36 the new translations is a straightforward process consisting of a pull from Weblate-hosted
35 repository which is available under Data Exports tab in Weblate interface.
37 repository which is available under Data Exports tab in Weblate interface.
36
38
37 Weblate tries to minimise the number of commits, but that's not always work, especially
39 Weblate tries to minimise the number of commits, but that's not always work, especially
38 when two translators work with different languages at more or less the same time.
40 when two translators work with different languages at more or less the same time.
39 It makes sense sometimes to re-order or fold commits by the same author when they touch
41 It makes sense sometimes to re-order or fold commits by the same author when they touch
40 just the same language translation. That, however, may confuse Weblate sometimes, in
42 just the same language translation. That, however, may confuse Weblate sometimes, in
41 which case it should be manually convinced it has to discard the commits it created by
43 which case it should be manually convinced it has to discard the commits it created by
42 using its administrative interface.
44 using its administrative interface.
43
45
46
44 Manual creation of a new language translation
47 Manual creation of a new language translation
45 ---------------------------------------------
48 ---------------------------------------------
46
49
47 In the prepared development environment, run the following to ensure
50 In the prepared development environment, run the following to ensure
48 all translation strings are extracted and up-to-date::
51 all translation strings are extracted and up-to-date::
49
52
50 python setup.py extract_messages
53 python setup.py extract_messages
51
54
52 Create new language by executing following command::
55 Create new language by executing following command::
53
56
54 python setup.py init_catalog -l <new_language_code>
57 python setup.py init_catalog -l <new_language_code>
55
58
56 This creates a new translation under directory `kallithea/i18n/<new_language_code>`
59 This creates a new translation under directory `kallithea/i18n/<new_language_code>`
57 based on the translation template file, `kallithea/i18n/kallithea.pot`.
60 based on the translation template file, `kallithea/i18n/kallithea.pot`.
58
61
59 Edit the new PO file located in `LC_MESSAGES` directory with poedit or your
62 Edit the new PO file located in `LC_MESSAGES` directory with poedit or your
60 favorite PO files editor. After you finished with the translations, check the
63 favorite PO files editor. After you finished with the translations, check the
61 translation file for errors by executing::
64 translation file for errors by executing::
62
65
63 msgfmt -f -c kallithea/i18n/<new_language_code>/LC_MESSAGES/<updated_file.po>
66 msgfmt -f -c kallithea/i18n/<new_language_code>/LC_MESSAGES/<updated_file.po>
64
67
65 Finally, compile the translations::
68 Finally, compile the translations::
66
69
67 python setup.py compile_catalog -l <new_language_code>
70 python setup.py compile_catalog -l <new_language_code>
68
71
72
69 Updating translations
73 Updating translations
70 ---------------------
74 ---------------------
71
75
72 Extract the latest versions of strings for translation by running::
76 Extract the latest versions of strings for translation by running::
73
77
74 python setup.py extract_messages
78 python setup.py extract_messages
75
79
76 Update the PO file by doing::
80 Update the PO file by doing::
77
81
78 python setup.py update_catalog -l <new_language_code>
82 python setup.py update_catalog -l <new_language_code>
79
83
80 Edit the new updated translation file. Repeat all steps after `init_catalog` step from
84 Edit the new updated translation file. Repeat all steps after `init_catalog` step from
81 new translation instructions
85 new translation instructions
82
86
87
83 Testing translations
88 Testing translations
84 --------------------
89 --------------------
85
90
86 Edit kallithea/tests/test.ini file and set lang attribute to::
91 Edit kallithea/tests/test.ini file and set lang attribute to::
87
92
88 lang=<new_language_code>
93 lang=<new_language_code>
89
94
90 Run Kallithea tests by executing::
95 Run Kallithea tests by executing::
91
96
92 nosetests
97 nosetests
General Comments 0
You need to be logged in to leave comments. Login now