Changeset - 4d04ac08fff7
[Not reviewed]
default
0 3 0
Mads Kiilerich - 8 years ago 2017-08-12 16:36:28
mads@kiilerich.com
docs: fix some sphinx warnings

RST code blocks must have valid syntax, and <someprefix> could thus not be used
as placeholder.
3 files changed with 9 insertions and 5 deletions:
0 comments (0 inline, 0 general)
docs/setup.rst
Show inline comments
 
@@ -718,114 +718,114 @@ pushes or large pushes::
 
    proxy_buffers               8 32k;
 
    client_max_body_size        1024m;
 
    client_body_buffer_size     128k;
 
    large_client_header_buffers 8 64k;
 

	
 

	
 
Apache virtual host reverse proxy example
 
-----------------------------------------
 

	
 
Here is a sample configuration file for Apache using proxy:
 

	
 
.. code-block:: apache
 

	
 
    <VirtualHost *:80>
 
            ServerName kallithea.example.com
 

	
 
            <Proxy *>
 
              # For Apache 2.4 and later:
 
              Require all granted
 

	
 
              # For Apache 2.2 and earlier, instead use:
 
              # Order allow,deny
 
              # Allow from all
 
            </Proxy>
 

	
 
            #important !
 
            #Directive to properly generate url (clone url) for Kallithea
 
            ProxyPreserveHost On
 

	
 
            #kallithea instance
 
            ProxyPass / http://127.0.0.1:5000/
 
            ProxyPassReverse / http://127.0.0.1:5000/
 

	
 
            #to enable https use line below
 
            #SetEnvIf X-Url-Scheme https HTTPS=1
 
    </VirtualHost>
 

	
 
Additional tutorial
 
http://pylonsbook.com/en/1.1/deployment.html#using-apache-to-proxy-requests-to-pylons
 

	
 

	
 
Apache as subdirectory
 
----------------------
 

	
 
Apache subdirectory part:
 

	
 
.. code-block:: apache
 

	
 
    <Location /<someprefix> >
 
      ProxyPass http://127.0.0.1:5000/<someprefix>
 
      ProxyPassReverse http://127.0.0.1:5000/<someprefix>
 
    <Location /PREFIX >
 
      ProxyPass http://127.0.0.1:5000/PREFIX
 
      ProxyPassReverse http://127.0.0.1:5000/PREFIX
 
      SetEnvIf X-Url-Scheme https HTTPS=1
 
    </Location>
 

	
 
Besides the regular apache setup you will need to add the following line
 
into ``[app:main]`` section of your .ini file::
 

	
 
    filter-with = proxy-prefix
 

	
 
Add the following at the end of the .ini file::
 

	
 
    [filter:proxy-prefix]
 
    use = egg:PasteDeploy#prefix
 
    prefix = /<someprefix>
 
    prefix = /PREFIX
 

	
 
then change ``<someprefix>`` into your chosen prefix
 
then change ``PREFIX`` into your chosen prefix
 

	
 

	
 
Apache with mod_wsgi
 
--------------------
 

	
 
Alternatively, Kallithea can be set up with Apache under mod_wsgi. For
 
that, you'll need to:
 

	
 
- Install mod_wsgi. If using a Debian-based distro, you can install
 
  the package libapache2-mod-wsgi::
 

	
 
    aptitude install libapache2-mod-wsgi
 

	
 
- Enable mod_wsgi::
 

	
 
    a2enmod wsgi
 

	
 
- Add global Apache configuration to tell mod_wsgi that Python only will be
 
  used in the WSGI processes and shouldn't be initialized in the Apache
 
  processes::
 

	
 
    WSGIRestrictEmbedded On
 

	
 
- Create a wsgi dispatch script, like the one below. Make sure you
 
  check that the paths correctly point to where you installed Kallithea
 
  and its Python Virtual Environment.
 
- Enable the ``WSGIScriptAlias`` directive for the WSGI dispatch script,
 
  as in the following example. Once again, check the paths are
 
  correctly specified.
 

	
 
Here is a sample excerpt from an Apache Virtual Host configuration file:
 

	
 
.. code-block:: apache
 

	
 
    WSGIDaemonProcess kallithea processes=5 threads=1 maximum-requests=100 \
 
        python-home=/srv/kallithea/venv
 
    WSGIProcessGroup kallithea
 
    WSGIScriptAlias / /srv/kallithea/dispatch.wsgi
 
    WSGIPassAuthorization On
 

	
 
Or if using a dispatcher WSGI script with proper virtualenv activation:
 

	
 
.. code-block:: apache
 

	
 
    WSGIDaemonProcess kallithea processes=5 threads=1 maximum-requests=100
 
    WSGIProcessGroup kallithea
 
    WSGIScriptAlias / /srv/kallithea/dispatch.wsgi
 
    WSGIPassAuthorization On
docs/usage/vcs_support.rst
Show inline comments
 
@@ -93,58 +93,59 @@ import, importing them via the filesyste
 

	
 
Importing via web interface
 
^^^^^^^^^^^^^^^^^^^^^^^^^^^
 

	
 
For a small number of repositories, it may be easier to create the target
 
repositories through the Kallithea web interface, via *Admin > Repositories* or
 
via the *Add Repository* button on the entry page of the web interface.
 

	
 
Repositories can be nested in repository groups by first creating the group (via
 
*Admin > Repository Groups* or via the *Add Repository Group* button on the
 
entry page of the web interface) and then selecting the appropriate group when
 
adding the repository.
 

	
 
After creation of the (empty) repository, push the existing commits to the
 
*Clone URL* displayed on the repository summary page. For Git repositories,
 
first add the *Clone URL* as remote, then push the commits to that remote.  The
 
specific commands to execute are shown under the *Existing repository?* section
 
of the new repository's summary page.
 

	
 
A benefit of this method particular for Git repositories, is that the
 
Kallithea-specific Git hooks are installed automatically.  For Mercurial, no
 
hooks are required anyway.
 

	
 
Importing via the filesystem
 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 

	
 
The alternative method of importing repositories consists of creating the
 
repositories in the desired hierarchy on the filesystem and letting Kallithea
 
scan that location.
 

	
 
All repositories are stored in a central location on the filesystem. This
 
location is specified during installation (via ``setup-db``) and can be reviewed
 
at *Admin > Settings > VCS > Location of repositories*. Repository groups
 
(defined in *Admin > Repository Groups*) are represented by a directory in that
 
repository location. Repositories of the repository group are nested under that
 
directory.
 

	
 
To import a set of repositories and organize them in a certain repository group
 
structure, first place clones in the desired hierarchy at the configured
 
repository location.
 
These clones should be created without working directory. For Mercurial, this is
 
done with ``hg clone -U``, for Git with ``git clone --bare``.
 

	
 
When the repositories are added correctly on the filesystem:
 

	
 
* go to *Admin > Settings > Remap and Rescan* in the Kallithea web interface
 
* select the *Install Git hooks* checkbox when importing Git repositories
 
* click *Rescan Repositories*
 

	
 
This step will scan the filesystem and create the appropriate repository groups
 
and repositories in Kallithea.
 

	
 
*Note*: Once repository groups have been created this way, manage their access
 
permissions through the Kallithea web interface.
 

	
 

	
 
.. _waitress: http://pypi.python.org/pypi/waitress
 
.. _gunicorn: http://pypi.python.org/pypi/gunicorn
 
.. _subrepositories: http://mercurial.aragost.com/kick-start/en/subrepositories/
kallithea/i18n/how_to
Show inline comments
 
@@ -50,48 +50,51 @@ Manual creation of a new language transl
 
In the prepared development environment, run the following to ensure
 
all translation strings are extracted and up-to-date::
 

	
 
    python2 setup.py extract_messages
 

	
 
Create new language by executing following command::
 

	
 
    python2 setup.py init_catalog -l <new_language_code>
 

	
 
This creates a new translation under directory `kallithea/i18n/<new_language_code>`
 
based on the translation template file, `kallithea/i18n/kallithea.pot`.
 

	
 
Edit the new PO file located in `LC_MESSAGES` directory with poedit or your
 
favorite PO files editor. After you finished with the translations, check the
 
translation file for errors by executing::
 

	
 
    msgfmt -f -c kallithea/i18n/<new_language_code>/LC_MESSAGES/<updated_file.po>
 

	
 
Finally, compile the translations::
 

	
 
    python2 setup.py compile_catalog -l <new_language_code>
 

	
 

	
 
Updating translations
 
---------------------
 

	
 
Extract the latest versions of strings for translation by running::
 

	
 
    python2 setup.py extract_messages
 

	
 
Update the PO file by doing::
 

	
 
    python2 setup.py update_catalog -l <new_language_code>
 

	
 
Edit the new updated translation file. Repeat all steps after `init_catalog` step from
 
new translation instructions
 

	
 

	
 
Testing translations
 
--------------------
 

	
 
Edit kallithea/tests/test.ini file and set lang attribute to::
 

	
 
    lang=<new_language_code>
 

	
 
Run Kallithea tests by executing::
 

	
 
    py.test
 

	
 

	
 
.. _Weblate: http://weblate.org/
0 comments (0 inline, 0 general)