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