Changeset - a04d6926d694
[Not reviewed]
Merge default
0 9 0
Thomas De Schampheleire - 6 years ago 2020-06-17 21:52:16
thomas.de_schampheleire@nokia.com
merge stable
9 files changed with 39 insertions and 19 deletions:
0 comments (0 inline, 0 general)
development.ini
Show inline comments
 
@@ -362,6 +362,7 @@ logview.pylons.util = #eee
 
sqlalchemy.url = sqlite:///%(here)s/kallithea.db?timeout=60
 
#sqlalchemy.url = postgresql://user:pass@localhost/kallithea
 
#sqlalchemy.url = mysql://user:pass@localhost/kallithea?charset=utf8
 
## Note: the mysql:// prefix should also be used for MariaDB
 

	
 
sqlalchemy.pool_recycle = 3600
 

	
docs/overview.rst
Show inline comments
 
@@ -22,8 +22,8 @@ installing Kallithea.
 

	
 
3. **Create low level configuration file.**
 
    Use ``kallithea-cli config-create`` to create a ``.ini`` file with database
 
    connection info, mail server information, some web server configuration,
 
    etc.
 
    connection info, mail server information, configuration for the specified
 
    web server, etc.
 

	
 
4. **Populate the database.**
 
    Use ``kallithea-cli db-create`` with the ``.ini`` file to create the
 
@@ -141,9 +141,11 @@ installed.
 
  but build the Kallithea package itself locally instead of downloading it.)
 

	
 
.. note::
 
   Kallithea includes front-end code that needs to be processed first.
 
   The tool npm_ is used to download external dependencies and orchestrate the
 
   processing. The ``npm`` binary must thus be available.
 
   Kallithea includes front-end code that needs to be processed to prepare
 
   static files that can be served at run time and used on the client side. The
 
   tool npm_ is used to download external dependencies and orchestrate the
 
   processing. The ``npm`` binary must thus be available at install time but is
 
   not used at run time.
 

	
 

	
 
Web server
 
@@ -166,19 +168,24 @@ There are several web server options:
 
  Actual use in production might have different requirements and need extra
 
  work to make it manageable as a scalable system service.
 

	
 
  Gearbox comes with its own built-in web server but Kallithea defaults to use
 
  Waitress_. Gunicorn_ is also an option. These web servers have different
 
  limited feature sets.
 
  Gearbox comes with its own built-in web server for development but Kallithea
 
  defaults to using Waitress_. Gunicorn_ and Gevent_ are also options. These
 
  web servers have different limited feature sets.
 

	
 
  The web server used by ``gearbox`` is configured in the ``.ini`` file passed
 
  to it. The entry point for the WSGI application is configured
 
  in ``setup.py`` as ``kallithea.config.application:make_app``.
 
  The web server used by ``gearbox serve`` is configured in the ``.ini`` file.
 
  Create it with ``config-create`` using for example ``http_server=waitress``
 
  to get a configuration starting point for your choice of web server.
 

	
 
  (Gearbox will do like ``paste`` and use the WSGI application entry point
 
  ``kallithea.config.middleware:make_app`` as specified in ``setup.py``.)
 

	
 
- `Apache httpd`_ can serve WSGI applications directly using mod_wsgi_ and a
 
  simple Python file with the necessary configuration. This is a good option if
 
  Apache is an option.
 

	
 
- uWSGI_ is also a full web server with built-in WSGI module.
 
- uWSGI_ is also a full web server with built-in WSGI module. Use
 
  ``config-create`` with ``http_server=uwsgi`` to get a ``.ini`` file with
 
  uWSGI configuration.
 

	
 
- IIS_ can also server WSGI applications directly using isapi-wsgi_.
 

	
 
@@ -197,9 +204,18 @@ dynamically generated pages from a relat
 
also often used inside organizations with a limited amount of users and thus no
 
continuous hammering from the internet.
 

	
 
.. note::
 
   Kallithea, the libraries it uses, and Python itself do in several places use
 
   simple caching in memory. Caches and memory are not always released in a way
 
   that is suitable for long-running processes. They might appear to be leaking
 
   memory. The worker processes should thus regularly be restarted - for
 
   example after 1000 requests and/or one hour. This can usually be done by the
 
   web server or the tool used for running it as a system service.
 

	
 

	
 
.. _Python: http://www.python.org/
 
.. _Gunicorn: http://gunicorn.org/
 
.. _Gevent: http://www.gevent.org/
 
.. _Waitress: http://waitress.readthedocs.org/en/latest/
 
.. _Gearbox: http://turbogears.readthedocs.io/en/latest/turbogears/gearbox.html
 
.. _PyPI: https://pypi.python.org/pypi
docs/setup.rst
Show inline comments
 
@@ -24,7 +24,7 @@ Next, you need to create the databases u
 
use PostgreSQL or SQLite (default). If you choose a database other than the
 
default, ensure you properly adjust the database URL in your ``my.ini``
 
configuration file to use this other database. Kallithea currently supports
 
PostgreSQL, SQLite and MySQL databases. Create the database by running
 
PostgreSQL, SQLite and MariaDB/MySQL databases. Create the database by running
 
the following command::
 

	
 
    kallithea-cli db-create -c my.ini
 
@@ -54,7 +54,9 @@ path to the root).
 
          but when trying to do a push it will fail with permission
 
          denied errors unless it has write access.
 

	
 
Finally, prepare the front-end by running::
 
Finally, the front-end files must be prepared. This requires ``npm`` version 6
 
or later, which needs ``node.js`` (version 12 or later). Prepare the front-end
 
by running::
 

	
 
    kallithea-cli front-end-build
 

	
docs/upgrade.rst
Show inline comments
 
@@ -51,7 +51,7 @@ file.
 
If using PostgreSQL, please consult the documentation for the ``pg_dump``
 
utility.
 

	
 
If using MySQL, please consult the documentation for the ``mysqldump``
 
If using MariaDB/MySQL, please consult the documentation for the ``mysqldump``
 
utility.
 

	
 
Look for ``sqlalchemy.url`` in your configuration file to determine
docs/usage/performance.rst
Show inline comments
 
@@ -40,7 +40,7 @@ SQLite is a good option when having a sm
 
locking issues with SQLite, it is not recommended to use it for larger
 
deployments.
 

	
 
Switching to MySQL or PostgreSQL will result in an immediate performance
 
Switching to PostgreSQL or MariaDB/MySQL will result in an immediate performance
 
increase. A tool like SQLAlchemyGrate_ can be used for migrating to another
 
database platform.
 

	
kallithea/lib/paster_commands/template.ini.mako
Show inline comments
 
@@ -467,6 +467,7 @@ sqlalchemy.url = mysql://user:pass@local
 
%else:
 
#sqlalchemy.url = mysql://user:pass@localhost/kallithea?charset=utf8
 
%endif
 
<%text>##</%text> Note: the mysql:// prefix should also be used for MariaDB
 

	
 
sqlalchemy.pool_recycle = 3600
 

	
kallithea/lib/vcs/backends/hg/changeset.py
Show inline comments
 
@@ -329,7 +329,7 @@ class MercurialChangeset(BaseChangeset):
 
            #vals = url,rev,type
 
            loc = vals[0]
 
            cs = vals[1]
 
            dirnodes.append(SubModuleNode(k, url=loc, changeset=cs,
 
            dirnodes.append(SubModuleNode(safe_str(k), url=safe_str(loc), changeset=cs,
 
                                          alias=als))
 
        nodes = dirnodes + filenodes
 
        for node in nodes:
kallithea/lib/vcs/backends/hg/repository.py
Show inline comments
 
@@ -230,7 +230,7 @@ class MercurialRepository(BaseRepository
 
            return {}
 

	
 
        return OrderedDict(sorted(
 
            ((safe_str(n), ascii_str(h)) for n, h in self._repo._bookmarks.items()),
 
            ((safe_str(n), ascii_str(mercurial.node.hex(h))) for n, h in self._repo._bookmarks.items()),
 
            reverse=True,
 
            key=lambda x: x[0],  # sort by name
 
        ))
kallithea/lib/vcs/nodes.py
Show inline comments
 
@@ -603,4 +603,4 @@ class SubModuleNode(Node):
 
        then only last part is returned.
 
        """
 
        org = self.path.rstrip('/').rsplit('/', 1)[-1]
 
        return '%s @ %s' % (org, self.changeset.short_id)
 
        return '%s @ %s' % (org, safe_str(self.changeset.short_id))
0 comments (0 inline, 0 general)