Show More
@@ -362,6 +362,7 b' logview.pylons.util = #eee' | |||||
362 | sqlalchemy.url = sqlite:///%(here)s/kallithea.db?timeout=60 |
|
362 | sqlalchemy.url = sqlite:///%(here)s/kallithea.db?timeout=60 | |
363 | #sqlalchemy.url = postgresql://user:pass@localhost/kallithea |
|
363 | #sqlalchemy.url = postgresql://user:pass@localhost/kallithea | |
364 | #sqlalchemy.url = mysql://user:pass@localhost/kallithea?charset=utf8 |
|
364 | #sqlalchemy.url = mysql://user:pass@localhost/kallithea?charset=utf8 | |
|
365 | ## Note: the mysql:// prefix should also be used for MariaDB | |||
365 |
|
366 | |||
366 | sqlalchemy.pool_recycle = 3600 |
|
367 | sqlalchemy.pool_recycle = 3600 | |
367 |
|
368 |
@@ -22,8 +22,8 b' 2. **Install Kallithea software.**' | |||||
22 |
|
22 | |||
23 | 3. **Create low level configuration file.** |
|
23 | 3. **Create low level configuration file.** | |
24 | Use ``kallithea-cli config-create`` to create a ``.ini`` file with database |
|
24 | Use ``kallithea-cli config-create`` to create a ``.ini`` file with database | |
25 |
connection info, mail server information, |
|
25 | connection info, mail server information, configuration for the specified | |
26 | etc. |
|
26 | web server, etc. | |
27 |
|
27 | |||
28 | 4. **Populate the database.** |
|
28 | 4. **Populate the database.** | |
29 | Use ``kallithea-cli db-create`` with the ``.ini`` file to create the |
|
29 | Use ``kallithea-cli db-create`` with the ``.ini`` file to create the | |
@@ -141,9 +141,11 b' installed.' | |||||
141 | but build the Kallithea package itself locally instead of downloading it.) |
|
141 | but build the Kallithea package itself locally instead of downloading it.) | |
142 |
|
142 | |||
143 | .. note:: |
|
143 | .. note:: | |
144 |
Kallithea includes front-end code that needs to be processed |
|
144 | Kallithea includes front-end code that needs to be processed to prepare | |
145 | The tool npm_ is used to download external dependencies and orchestrate the |
|
145 | static files that can be served at run time and used on the client side. The | |
146 | processing. The ``npm`` binary must thus be available. |
|
146 | tool npm_ is used to download external dependencies and orchestrate the | |
|
147 | processing. The ``npm`` binary must thus be available at install time but is | |||
|
148 | not used at run time. | |||
147 |
|
149 | |||
148 |
|
150 | |||
149 | Web server |
|
151 | Web server | |
@@ -166,19 +168,24 b' There are several web server options:' | |||||
166 | Actual use in production might have different requirements and need extra |
|
168 | Actual use in production might have different requirements and need extra | |
167 | work to make it manageable as a scalable system service. |
|
169 | work to make it manageable as a scalable system service. | |
168 |
|
170 | |||
169 |
Gearbox comes with its own built-in web server but Kallithea |
|
171 | Gearbox comes with its own built-in web server for development but Kallithea | |
170 | Waitress_. Gunicorn_ is also an option. These web servers have different |
|
172 | defaults to using Waitress_. Gunicorn_ and Gevent_ are also options. These | |
171 | limited feature sets. |
|
173 | web servers have different limited feature sets. | |
172 |
|
174 | |||
173 |
The web server used by ``gearbox`` is configured in the ``.ini`` file |
|
175 | The web server used by ``gearbox serve`` is configured in the ``.ini`` file. | |
174 | to it. The entry point for the WSGI application is configured |
|
176 | Create it with ``config-create`` using for example ``http_server=waitress`` | |
175 | in ``setup.py`` as ``kallithea.config.application:make_app``. |
|
177 | to get a configuration starting point for your choice of web server. | |
|
178 | ||||
|
179 | (Gearbox will do like ``paste`` and use the WSGI application entry point | |||
|
180 | ``kallithea.config.middleware:make_app`` as specified in ``setup.py``.) | |||
176 |
|
181 | |||
177 | - `Apache httpd`_ can serve WSGI applications directly using mod_wsgi_ and a |
|
182 | - `Apache httpd`_ can serve WSGI applications directly using mod_wsgi_ and a | |
178 | simple Python file with the necessary configuration. This is a good option if |
|
183 | simple Python file with the necessary configuration. This is a good option if | |
179 | Apache is an option. |
|
184 | Apache is an option. | |
180 |
|
185 | |||
181 | - uWSGI_ is also a full web server with built-in WSGI module. |
|
186 | - uWSGI_ is also a full web server with built-in WSGI module. Use | |
|
187 | ``config-create`` with ``http_server=uwsgi`` to get a ``.ini`` file with | |||
|
188 | uWSGI configuration. | |||
182 |
|
189 | |||
183 | - IIS_ can also server WSGI applications directly using isapi-wsgi_. |
|
190 | - IIS_ can also server WSGI applications directly using isapi-wsgi_. | |
184 |
|
191 | |||
@@ -197,9 +204,18 b' dynamically generated pages from a relat' | |||||
197 | also often used inside organizations with a limited amount of users and thus no |
|
204 | also often used inside organizations with a limited amount of users and thus no | |
198 | continuous hammering from the internet. |
|
205 | continuous hammering from the internet. | |
199 |
|
206 | |||
|
207 | .. note:: | |||
|
208 | Kallithea, the libraries it uses, and Python itself do in several places use | |||
|
209 | simple caching in memory. Caches and memory are not always released in a way | |||
|
210 | that is suitable for long-running processes. They might appear to be leaking | |||
|
211 | memory. The worker processes should thus regularly be restarted - for | |||
|
212 | example after 1000 requests and/or one hour. This can usually be done by the | |||
|
213 | web server or the tool used for running it as a system service. | |||
|
214 | ||||
200 |
|
215 | |||
201 | .. _Python: http://www.python.org/ |
|
216 | .. _Python: http://www.python.org/ | |
202 | .. _Gunicorn: http://gunicorn.org/ |
|
217 | .. _Gunicorn: http://gunicorn.org/ | |
|
218 | .. _Gevent: http://www.gevent.org/ | |||
203 | .. _Waitress: http://waitress.readthedocs.org/en/latest/ |
|
219 | .. _Waitress: http://waitress.readthedocs.org/en/latest/ | |
204 | .. _Gearbox: http://turbogears.readthedocs.io/en/latest/turbogears/gearbox.html |
|
220 | .. _Gearbox: http://turbogears.readthedocs.io/en/latest/turbogears/gearbox.html | |
205 | .. _PyPI: https://pypi.python.org/pypi |
|
221 | .. _PyPI: https://pypi.python.org/pypi |
@@ -24,7 +24,7 b' Next, you need to create the databases u' | |||||
24 | use PostgreSQL or SQLite (default). If you choose a database other than the |
|
24 | use PostgreSQL or SQLite (default). If you choose a database other than the | |
25 | default, ensure you properly adjust the database URL in your ``my.ini`` |
|
25 | default, ensure you properly adjust the database URL in your ``my.ini`` | |
26 | configuration file to use this other database. Kallithea currently supports |
|
26 | configuration file to use this other database. Kallithea currently supports | |
27 | PostgreSQL, SQLite and MySQL databases. Create the database by running |
|
27 | PostgreSQL, SQLite and MariaDB/MySQL databases. Create the database by running | |
28 | the following command:: |
|
28 | the following command:: | |
29 |
|
29 | |||
30 | kallithea-cli db-create -c my.ini |
|
30 | kallithea-cli db-create -c my.ini | |
@@ -54,7 +54,9 b' path to the root).' | |||||
54 | but when trying to do a push it will fail with permission |
|
54 | but when trying to do a push it will fail with permission | |
55 | denied errors unless it has write access. |
|
55 | denied errors unless it has write access. | |
56 |
|
56 | |||
57 | Finally, prepare the front-end by running:: |
|
57 | Finally, the front-end files must be prepared. This requires ``npm`` version 6 | |
|
58 | or later, which needs ``node.js`` (version 12 or later). Prepare the front-end | |||
|
59 | by running:: | |||
58 |
|
60 | |||
59 | kallithea-cli front-end-build |
|
61 | kallithea-cli front-end-build | |
60 |
|
62 |
@@ -51,7 +51,7 b' file.' | |||||
51 | If using PostgreSQL, please consult the documentation for the ``pg_dump`` |
|
51 | If using PostgreSQL, please consult the documentation for the ``pg_dump`` | |
52 | utility. |
|
52 | utility. | |
53 |
|
53 | |||
54 | If using MySQL, please consult the documentation for the ``mysqldump`` |
|
54 | If using MariaDB/MySQL, please consult the documentation for the ``mysqldump`` | |
55 | utility. |
|
55 | utility. | |
56 |
|
56 | |||
57 | Look for ``sqlalchemy.url`` in your configuration file to determine |
|
57 | Look for ``sqlalchemy.url`` in your configuration file to determine |
@@ -40,7 +40,7 b' SQLite is a good option when having a sm' | |||||
40 | locking issues with SQLite, it is not recommended to use it for larger |
|
40 | locking issues with SQLite, it is not recommended to use it for larger | |
41 | deployments. |
|
41 | deployments. | |
42 |
|
42 | |||
43 |
Switching to |
|
43 | Switching to PostgreSQL or MariaDB/MySQL will result in an immediate performance | |
44 | increase. A tool like SQLAlchemyGrate_ can be used for migrating to another |
|
44 | increase. A tool like SQLAlchemyGrate_ can be used for migrating to another | |
45 | database platform. |
|
45 | database platform. | |
46 |
|
46 |
@@ -467,6 +467,7 b' sqlalchemy.url = mysql://user:pass@local' | |||||
467 | %else: |
|
467 | %else: | |
468 | #sqlalchemy.url = mysql://user:pass@localhost/kallithea?charset=utf8 |
|
468 | #sqlalchemy.url = mysql://user:pass@localhost/kallithea?charset=utf8 | |
469 | %endif |
|
469 | %endif | |
|
470 | <%text>##</%text> Note: the mysql:// prefix should also be used for MariaDB | |||
470 |
|
471 | |||
471 | sqlalchemy.pool_recycle = 3600 |
|
472 | sqlalchemy.pool_recycle = 3600 | |
472 |
|
473 |
@@ -329,7 +329,7 b' class MercurialChangeset(BaseChangeset):' | |||||
329 | #vals = url,rev,type |
|
329 | #vals = url,rev,type | |
330 | loc = vals[0] |
|
330 | loc = vals[0] | |
331 | cs = vals[1] |
|
331 | cs = vals[1] | |
332 | dirnodes.append(SubModuleNode(k, url=loc, changeset=cs, |
|
332 | dirnodes.append(SubModuleNode(safe_str(k), url=safe_str(loc), changeset=cs, | |
333 | alias=als)) |
|
333 | alias=als)) | |
334 | nodes = dirnodes + filenodes |
|
334 | nodes = dirnodes + filenodes | |
335 | for node in nodes: |
|
335 | for node in nodes: |
@@ -230,7 +230,7 b' class MercurialRepository(BaseRepository' | |||||
230 | return {} |
|
230 | return {} | |
231 |
|
231 | |||
232 | return OrderedDict(sorted( |
|
232 | return OrderedDict(sorted( | |
233 | ((safe_str(n), ascii_str(h)) for n, h in self._repo._bookmarks.items()), |
|
233 | ((safe_str(n), ascii_str(mercurial.node.hex(h))) for n, h in self._repo._bookmarks.items()), | |
234 | reverse=True, |
|
234 | reverse=True, | |
235 | key=lambda x: x[0], # sort by name |
|
235 | key=lambda x: x[0], # sort by name | |
236 | )) |
|
236 | )) |
@@ -603,4 +603,4 b' class SubModuleNode(Node):' | |||||
603 | then only last part is returned. |
|
603 | then only last part is returned. | |
604 | """ |
|
604 | """ | |
605 | org = self.path.rstrip('/').rsplit('/', 1)[-1] |
|
605 | org = self.path.rstrip('/').rsplit('/', 1)[-1] | |
606 | return '%s @ %s' % (org, self.changeset.short_id) |
|
606 | return '%s @ %s' % (org, safe_str(self.changeset.short_id)) |
General Comments 0
You need to be logged in to leave comments.
Login now