Changeset - e73a69cb98dc
[Not reviewed]
Bradley M. Kuhn - 12 years ago 2014-07-03 01:04:41
bkuhn@sfconservancy.org
Rename some strings examples and commands in documentation
19 files changed with 224 insertions and 226 deletions:
0 comments (0 inline, 0 general)
README.rst
Show inline comments
 
@@ -22,21 +22,21 @@ different version control systems.
 
RhodeCode uses `PEP386 versioning <http://www.python.org/dev/peps/pep-0386/>`_
 

	
 
Installation
 
------------
 
Stable releases of RhodeCode are best installed via::
 

	
 
    easy_install rhodecode
 
    easy_install kallithea
 

	
 
Or::
 

	
 
    pip install rhodecode
 
    pip install kallithea
 

	
 
Detailed instructions and links may be found on the Installation page.
 

	
 
Please visit http://packages.python.org/RhodeCode/installation.html for
 
Please visit http://packages.python.org/Kallithea/installation.html for
 
more details
 

	
 

	
 
Source code
 
-----------
 

	
 
@@ -135,14 +135,14 @@ You can follow this project on Twitter, 
 

	
 

	
 
Online documentation
 
--------------------
 

	
 
Online documentation for the current version of RhodeCode is available at
 
 - http://packages.python.org/RhodeCode/
 
 - http://rhodecode.readthedocs.org/en/latest/index.html
 
 - http://packages.python.org/Kallithea/
 
 - http://kallithea.readthedocs.org/
 

	
 
You may also build the documentation for yourself - go into ``docs/`` and run::
 

	
 
   make html
 

	
 
(You need to have sphinx_ installed to build the documentation. If you don't
docs/Makefile
Show inline comments
 
@@ -69,23 +69,23 @@ htmlhelp:
 

	
 
qthelp:
 
	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
 
	@echo
 
	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
 
	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
 
	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/RhodeCode.qhcp"
 
	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Kallithea.qhcp"
 
	@echo "To view the help file:"
 
	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/RhodeCode.qhc"
 
	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Kallithea.qhc"
 

	
 
devhelp:
 
	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
 
	@echo
 
	@echo "Build finished."
 
	@echo "To view the help file:"
 
	@echo "# mkdir -p $$HOME/.local/share/devhelp/RhodeCode"
 
	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/RhodeCode"
 
	@echo "# mkdir -p $$HOME/.local/share/devhelp/Kallithea"
 
	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Kallithea"
 
	@echo "# devhelp"
 

	
 
epub:
 
	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
 
	@echo
 
	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
docs/api/api.rst
Show inline comments
 
@@ -2,38 +2,38 @@
 

	
 
===
 
API
 
===
 

	
 

	
 
Starting from RhodeCode version 1.2 a simple API was implemented.
 
Starting from Kallithea version 1.2 a simple API was implemented.
 
There's a single schema for calling all api methods. API is implemented
 
with JSON protocol both ways. An url to send API request to RhodeCode is
 
with JSON protocol both ways. An url to send API request to Kallithea is
 
<your_server>/_admin/api
 

	
 
API ACCESS FOR WEB VIEWS
 
++++++++++++++++++++++++
 

	
 
API access can also be turned on for each web view in RhodeCode that is
 
API access can also be turned on for each web view in Kallithea that is
 
decorated with `@LoginRequired` decorator. To enable API access simple change
 
the standard login decorator to `@LoginRequired(api_access=True)`.
 

	
 
To make this operation easier, starting from version 1.7.0 there's a white list
 
of views that will have API access enabled. Simply edit `api_access_controllers_whitelist`
 
option in your .ini file, and define views that should have API access enabled.
 
Following example shows how to enable API access to patch/diff raw file and archive
 
in RhodeCode::
 
in Kallithea::
 

	
 
    api_access_controllers_whitelist =
 
        ChangesetController:changeset_patch,
 
        ChangesetController:changeset_raw,
 
        FilesController:raw,
 
        FilesController:archivefile
 

	
 

	
 
After this change, a rhodecode view can be accessed without login by adding a
 
After this change, a Kallithea view can be accessed without login by adding a
 
GET parameter `?api_key=<api_key>` to url. By default this is only
 
enabled on RSS/ATOM feed views. Exposing raw diffs is a good way to integrate with
 
3rd party services like code review, or build farms that could download archives.
 

	
 

	
 
API ACCESS
 
@@ -59,13 +59,13 @@ Simply provide
 

	
 
.. note::
 

	
 
    api_key can be found in your user account page
 

	
 

	
 
RhodeCode API will return always a JSON-RPC response::
 
Kallithea API will return always a JSON-RPC response::
 

	
 
    {
 
        "id":<id>, # matching id sent by request
 
        "result": "<result>"|null, # JSON formatted result, null if any errors
 
        "error": "null"|<error_message> # JSON formatted error (if any)
 
    }
 
@@ -75,14 +75,14 @@ calling api *error* key from response wi
 
and result will be null.
 

	
 

	
 
API CLIENT
 
++++++++++
 

	
 
From version 1.4 RhodeCode adds a script that allows to easily
 
communicate with API. After installing RhodeCode a `kallithea-api` script
 
From version 1.4 Kallithea adds a script that allows to easily
 
communicate with API. After installing Kallithea a `kallithea-api` script
 
will be available.
 

	
 
To get started quickly simply run::
 

	
 
  kallithea-api _create_config --apikey=<youapikey> --apihost=<your.kallithea.server>
 

	
 
@@ -93,25 +93,25 @@ both of the arguments to be able to comm
 

	
 
after that simply run any api command for example get_repo::
 

	
 
 kallithea-api get_repo
 

	
 
 calling {"api_key": "<apikey>", "id": 75, "args": {}, "method": "get_repo"} to http://127.0.0.1:5000
 
 rhodecode said:
 
 Kallithea said:
 
 {'error': 'Missing non optional `repoid` arg in JSON DATA',
 
  'id': 75,
 
  'result': None}
 

	
 
Ups looks like we forgot to add an argument
 

	
 
Let's try again now giving the repoid as parameters::
 

	
 
    kallithea-api get_repo repoid:rhodecode
 
    kallithea-api get_repo repoid:myrepo
 

	
 
    calling {"api_key": "<apikey>", "id": 39, "args": {"repoid": "rhodecode"}, "method": "get_repo"} to http://127.0.0.1:5000
 
    rhodecode said:
 
    calling {"api_key": "<apikey>", "id": 39, "args": {"repoid": "myrepo"}, "method": "get_repo"} to http://127.0.0.1:5000
 
    Kallithea said:
 
    {'error': None,
 
     'id': 39,
 
     'result': <json data...>}
 

	
 

	
 

	
 
@@ -143,13 +143,13 @@ OUTPUT::
 

	
 

	
 
rescan_repos
 
------------
 

	
 
Dispatch rescan repositories action. If remove_obsolete is set
 
RhodeCode will delete repos that are in database but not in the filesystem.
 
Kallithea will delete repos that are in database but not in the filesystem.
 
This command can be executed only using api_key belonging to user with admin
 
rights.
 

	
 
INPUT::
 

	
 
    id : <id_for_response>
 
@@ -222,13 +222,13 @@ OUTPUT::
 
    error :  null
 

	
 

	
 
show_ip
 
-------
 

	
 
Shows IP address as seen from RhodeCode server, together with all
 
Shows IP address as seen from Kallithea server, together with all
 
defined IP addresses for given user.
 
This command can be executed only using api_key belonging to user with admin
 
rights.
 

	
 
INPUT::
 

	
docs/conf.py
Show inline comments
 
# -*- coding: utf-8 -*-
 
#
 
# RhodeCode documentation build configuration file, created by
 
# Kallithea documentation build configuration file, created by
 
# sphinx-quickstart on Sun Oct 10 16:46:37 2010.
 
#
 
# This file is execfile()d with the current directory set to its containing dir.
 
#
 
# Note that not all possible configuration values are present in this
 
# autogenerated file.
 
@@ -41,13 +41,13 @@ source_suffix = '.rst'
 
#source_encoding = 'utf-8-sig'
 

	
 
# The master toctree document.
 
master_doc = 'index'
 

	
 
# General information about the project.
 
project = u'RhodeCode'
 
project = u'Kallithea'
 
copyright = u'%s, Marcin Kuzminski' % (datetime.datetime.now().year)
 

	
 
# The version info for the project you're documenting, acts as replacement for
 
# |version| and |release|, also used in various other places throughout the
 
# built documents.
 
#
 
@@ -168,13 +168,13 @@ html_theme_path = ['theme']
 
#html_use_opensearch = ''
 

	
 
# This is the file name suffix for HTML files (e.g. ".xhtml").
 
#html_file_suffix = None
 

	
 
# Output file base name for HTML help builder.
 
htmlhelp_basename = 'RhodeCodedoc'
 
htmlhelp_basename = 'Kallithea-docs'
 

	
 

	
 
# -- Options for LaTeX output --------------------------------------------------
 

	
 
# The paper size ('letter' or 'a4').
 
#latex_paper_size = 'letter'
 
@@ -182,13 +182,13 @@ htmlhelp_basename = 'RhodeCodedoc'
 
# The font size ('10pt', '11pt' or '12pt').
 
#latex_font_size = '10pt'
 

	
 
# Grouping the document tree into LaTeX files. List of tuples
 
# (source start file, target name, title, author, documentclass [howto/manual]).
 
latex_documents = [
 
  ('index', 'RhodeCode.tex', u'RhodeCode Documentation',
 
  ('index', 'Kallithea.tex', u'Kallithea Documentation',
 
   u'Marcin Kuzminski', 'manual'),
 
]
 

	
 
# The name of an image file (relative to this directory) to place at the top of
 
# the title page.
 
#latex_logo = None
 
@@ -215,13 +215,13 @@ latex_documents = [
 

	
 
# -- Options for manual page output --------------------------------------------
 

	
 
# One entry per manual page. List of tuples
 
# (source start file, name, description, authors, manual section).
 
man_pages = [
 
    ('index', 'kallithea', u'RhodeCode Documentation',
 
    ('index', 'kallithea', u'Kallithea Documentation',
 
     [u'Marcin Kuzminski'], 1)
 
]
 

	
 

	
 
# Example configuration for intersphinx: refer to the Python standard library.
 
intersphinx_mapping = {'http://docs.python.org/': None}
docs/contributing.rst
Show inline comments
 
.. _contributing:
 

	
 
=========================
 
Contributing to RhodeCode
 
Contributing to Kallithea
 
=========================
 

	
 
If you would like to contribute to RhodeCode, please contact me, any help is
 
If you would like to contribute to Kallithea, please contact us, any help is
 
greatly appreciated!
 

	
 
Could I request that you make your source contributions by first forking the
 
RhodeCode repository on bitbucket_
 
Kallithea repository on bitbucket_
 
https://bitbucket.org/conservancy/kallithea and then make your changes to
 
your forked repository. Please post all fixes into **dev** bookmark since your
 
change might be already fixed there and i try to merge all fixes from dev into
 
stable, and not the other way. Finally, when you are finished with your changes,
 
please send me a pull request.
 
please send us a pull request.
 

	
 
To run RhodeCode in a development version you always need to install the latest
 
required libs. Simply clone rhodecode and switch to beta branch::
 
To run Kallithea in a development version you always need to install the latest
 
required libs. Simply clone Kallithea and switch to beta branch::
 

	
 
    hg clone https://kallithea-scm.org/repos/kallithea
 

	
 
after downloading/pulling RhodeCode make sure you run::
 
after downloading/pulling Kallithea make sure you run::
 

	
 
    python setup.py develop
 

	
 
command to install/verify all required packages, and prepare development
 
enviroment.
 

	
 
@@ -43,11 +43,9 @@ There's a special set of tests for push/
 
    paster serve test.ini --pid-file=test.pid --daemon
 
    RC_WHOOSH_TEST_DISABLE=1 RC_NO_TMP_PATH=1 nosetests -x kallithea/tests/other/test_vcs_operations.py
 
    kill -9 $(cat test.pid)
 

	
 

	
 
| Thank you for any contributions!
 
|  Marcin
 

	
 

	
 

	
 
.. _bitbucket: http://bitbucket.org/
docs/installation.rst
Show inline comments
 
.. _installation:
 

	
 
============
 
Installation
 
============
 

	
 
``RhodeCode`` is written entirely in Python. Before posting any issues make
 
``Kallithea`` is written entirely in Python. Before posting any issues make
 
sure, your not missing any system libraries and using right version of
 
libraries required by RhodeCode. There's also restriction in terms of mercurial
 
clients. Minimal version of hg client known working fine with RhodeCode is
 
libraries required by Kallithea. There's also restriction in terms of mercurial
 
clients. Minimal version of hg client known working fine with Kallithea is
 
**1.6**. If you're using older client, please upgrade.
 

	
 

	
 
Installing RhodeCode from PyPI (aka "Cheeseshop")
 
Installing Kallithea from PyPI (aka "Cheeseshop")
 
-------------------------------------------------
 

	
 
Rhodecode requires python version 2.5 or higher.
 
Kallithea requires python version 2.5 or higher.
 

	
 
The easiest way to install ``rhodecode`` is to run::
 
The easiest way to install ``kallithea`` is to run::
 

	
 
    easy_install rhodecode
 
    easy_install kallithea
 

	
 
Or::
 

	
 
    pip install rhodecode
 
    pip install kallithea
 

	
 
If you prefer to install RhodeCode manually simply grab latest release from
 
http://pypi.python.org/pypi/RhodeCode, decompress the archive and run::
 
If you prefer to install Kallithea manually simply grab latest release from
 
http://pypi.python.org/pypi/Kallithea, decompress the archive and run::
 

	
 
    python setup.py install
 

	
 
Step by step installation example for Windows
 
---------------------------------------------
 

	
 
@@ -36,81 +36,81 @@ Step by step installation example for Wi
 

	
 

	
 
Step by step installation example for Linux
 
-------------------------------------------
 

	
 

	
 
For installing RhodeCode i highly recommend using separate virtualenv_. This
 
way many required by RhodeCode libraries will remain sandboxed from your main
 
For installing Kallithea i highly recommend using separate virtualenv_. This
 
way many required by Kallithea libraries will remain sandboxed from your main
 
python and making things less problematic when doing system python updates.
 

	
 
Alternative very detailed installation instructions for Ubuntu Server with
 
celery, indexer and daemon scripts: https://gist.github.com/4546398
 

	
 

	
 
- Assuming you have installed virtualenv_ create a new virtual environment
 
  using virtualenv command::
 

	
 
    virtualenv --no-site-packages /opt/rhodecode-venv
 
    virtualenv --no-site-packages /opt/kallithea-venv
 

	
 

	
 
.. note:: Using ``--no-site-packages`` when generating your
 
   virtualenv is **very important**. This flag provides the necessary
 
   isolation for running the set of packages required by
 
   RhodeCode.  If you do not specify ``--no-site-packages``,
 
   it's possible that RhodeCode will not install properly into
 
   Kallithea.  If you do not specify ``--no-site-packages``,
 
   it's possible that Kallithea will not install properly into
 
   the virtualenv, or, even if it does, may not run properly,
 
   depending on the packages you've already got installed into your
 
   Python's "main" site-packages dir.
 

	
 

	
 
- this will install new virtualenv_ into `/opt/rhodecode-venv`.
 
- this will install new virtualenv_ into `/opt/kallithea-venv`.
 
- Activate the virtualenv_ by running::
 

	
 
    source /opt/rhodecode-venv/bin/activate
 
    source /opt/kallithea-venv/bin/activate
 

	
 
.. note:: If you're using UNIX, *do not* use ``sudo`` to run the
 
   ``virtualenv`` script.  It's perfectly acceptable (and desirable)
 
   to create a virtualenv as a normal user.
 

	
 
- Make a folder for rhodecode data files, and configuration somewhere on the
 
- Make a folder for Kallithea data files, and configuration somewhere on the
 
  filesystem. For example::
 

	
 
    mkdir /opt/rhodecode
 
    mkdir /opt/kallithea
 

	
 

	
 
- Go into the created directory run this command to install rhodecode::
 
- Go into the created directory run this command to install kallithea::
 

	
 
    easy_install rhodecode
 
    easy_install kallithea
 

	
 
  or::
 

	
 
    pip install rhodecode
 
    pip install kallithea
 

	
 
- This will install rhodecode together with pylons and all other required
 
- This will install Kallithea together with pylons and all other required
 
  python libraries into activated virtualenv
 

	
 
Requirements for Celery (optional)
 
----------------------------------
 

	
 
In order to gain maximum performance
 
there are some third-party you must install. When RhodeCode is used
 
there are some third-party you must install. When Kallithea is used
 
together with celery you have to install some kind of message broker,
 
recommended one is rabbitmq_ to make the async tasks work.
 

	
 
Of course RhodeCode works in sync mode also and then you do not have to install
 
Of course Kallithea works in sync mode also and then you do not have to install
 
any third party applications. However, using Celery_ will give you a large
 
speed improvement when using many big repositories. If you plan to use
 
RhodeCode for say 7 to 10 repositories, RhodeCode will perform perfectly well
 
Kallithea for say 7 to 10 repositories, Kallithea will perform perfectly well
 
without celery running.
 

	
 
If you make the decision to run RhodeCode with celery make sure you run
 
If you make the decision to run Kallithea with celery make sure you run
 
celeryd using paster and message broker together with the application.
 

	
 
.. note::
 
   Installing message broker and using celery is optional, RhodeCode will
 
   Installing message broker and using celery is optional, Kallithea will
 
   work perfectly fine without them.
 

	
 

	
 
**Message Broker**
 

	
 
- preferred is `RabbitMq <http://www.rabbitmq.com/>`_
docs/installation_win.rst
Show inline comments
 
@@ -2,13 +2,13 @@
 

	
 

	
 
Step by step Installation for Windows
 
=====================================
 

	
 

	
 
RhodeCode step-by-step install Guide for Windows
 
Kallithea step-by-step install Guide for Windows
 

	
 
Target OS: Windows XP SP3 32bit English (Clean installation)
 
+ All Windows Updates until 24-may-2012
 

	
 
.. note::
 

	
 
@@ -118,55 +118,55 @@ that came preinstalled in Vista/7 and ca
 
    SETX PATH "%PATH%;[your-python-path]" /M
 

	
 
  Please substitute [your-python-path] with your Python installation path.
 
  Typically: C:\\Python27
 

	
 

	
 
Step5 - RhodeCode folder structure
 
Step5 - Kallithea folder structure
 
----------------------------------
 

	
 
Create a RhodeCode folder structure
 
Create a Kallithea folder structure
 

	
 
This is only a example to install RhodeCode, you can of course change
 
This is only a example to install Kallithea, you can of course change
 
it. However, this guide will follow the proposed structure, so please
 
later adapt the paths if you change them. My recommendation is to use
 
folders with NO SPACES. But you can try if you are brave...
 

	
 
Create the following folder structure::
 

	
 
  C:\RhodeCode
 
  C:\RhodeCode\Bin
 
  C:\RhodeCode\Env
 
  C:\RhodeCode\Repos
 
  C:\Kallithea
 
  C:\Kallithea\Bin
 
  C:\Kallithea\Env
 
  C:\Kallithea\Repos
 

	
 

	
 
Step6 - Install virtualenv
 
---------------------------
 

	
 
Install Virtual Env for Python
 

	
 
Navigate to: http://www.virtualenv.org/en/latest/index.html#installation
 
Right click on "virtualenv.py" file and choose "Save link as...".
 
Download to C:\\RhodeCode (or whatever you want)
 
Download to C:\\Kallithea (or whatever you want)
 
(the file is located at
 
https://raw.github.com/pypa/virtualenv/master/virtualenv.py)
 

	
 
Create a virtual Python environment in C:\\RhodeCode\\Env (or similar). To
 
Create a virtual Python environment in C:\\Kallithea\\Env (or similar). To
 
do so, open a CMD (Python Path should be included in Step3), navigate
 
where you downloaded "virtualenv.py", and write::
 

	
 
 python virtualenv.py C:\RhodeCode\Env
 
 python virtualenv.py C:\Kallithea\Env
 

	
 
(--no-site-packages is now the default behaviour of virtualenv, no need
 
to include it)
 

	
 

	
 
Step7 - Install RhodeCode
 
Step7 - Install Kallithea
 
-------------------------
 

	
 
Finally, install RhodeCode
 
Finally, install Kallithea
 

	
 
Close previously opened command prompt/s, and open a Visual Studio 2008
 
Command Prompt (**IMPORTANT!!**). To do so, go to Start Menu, and then open
 
"Microsoft Visual C++ 2008 Express Edition" -> "Visual Studio Tools" ->
 
"Visual Studio 2008 Command Prompt"
 

	
 
@@ -183,37 +183,37 @@ to::
 

	
 
%comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"" amd64
 

	
 

	
 
In that CMD (loaded with VS2008 PATHs) type::
 

	
 
  cd C:\RhodeCode\Env\Scripts (or similar)
 
  cd C:\Kallithea\Env\Scripts (or similar)
 
  activate
 

	
 
The prompt will change into "(Env) C:\\RhodeCode\\Env\\Scripts" or similar
 
The prompt will change into "(Env) C:\\Kallithea\\Env\\Scripts" or similar
 
(depending of your folder structure). Then type::
 

	
 
 pip install rhodecode
 
 pip install kallithea
 

	
 
(long step, please wait until fully complete)
 

	
 
Some warnings will appear, don't worry as they are normal.
 

	
 

	
 
Step8 - Configuring RhodeCode
 
Step8 - Configuring Kallithea
 
-----------------------------
 

	
 

	
 
steps taken from http://packages.python.org/RhodeCode/setup.html
 
steps taken from http://packages.python.org/Kallithea/setup.html
 

	
 
You have to use the same Visual Studio 2008 command prompt as Step7, so
 
if you closed it reopen it following the same commands (including the
 
"activate" one). When ready, just type::
 

	
 
  cd C:\RhodeCode\Bin
 
  paster make-config RhodeCode production.ini
 
  cd C:\Kallithea\Bin
 
  paster make-config Kallithea production.ini
 

	
 
Then, you must edit production.ini to fit your needs (ip address, ip
 
port, mail settings, database, whatever). I recommend using NotePad++
 
(free) or similar text editor, as it handles well the EndOfLine
 
character differences between Unix and Windows
 
(http://notepad-plus-plus.org/)
 
@@ -221,32 +221,32 @@ character differences between Unix and W
 
For the sake of simplicity lets run it with the default settings. After
 
your edits (if any), in the previous Command Prompt, type::
 

	
 
 paster setup-db production.ini
 

	
 
(this time a NEW database will be installed, you must follow a different
 
step to later UPGRADE to a newer RhodeCode version)
 
step to later UPGRADE to a newer Kallithea version)
 

	
 
The script will ask you for confirmation about creating a NEW database,
 
answer yes (y)
 
The script will ask you for repository path, answer C:\\RhodeCode\\Repos
 
The script will ask you for repository path, answer C:\\Kallithea\\Repos
 
(or similar)
 
The script will ask you for admin username and password, answer "admin"
 
+ "123456" (or whatever you want)
 
The script will ask you for admin mail, answer "admin@xxxx.com" (or
 
whatever you want)
 

	
 
If you make some mistake and the script does not end, don't worry, start
 
it again.
 

	
 

	
 
Step9 - Running RhodeCode
 
Step9 - Running Kallithea
 
-------------------------
 

	
 

	
 
In the previous command prompt, being in the C:\\RhodeCode\\Bin folder,
 
In the previous command prompt, being in the C:\\Kallithea\\Bin folder,
 
just type::
 

	
 
 paster serve production.ini
 

	
 
Open yout web server, and go to http://127.0.0.1:5000
 

	
 
@@ -258,13 +258,13 @@ again. Don't forget the "http://" in Int
 

	
 

	
 

	
 
What this Guide does not cover:
 

	
 
- Installing Celery
 
- Running RhodeCode as Windows Service. You can investigate here:
 
- Running Kallithea as Windows Service. You can investigate here:
 

	
 
  - http://pypi.python.org/pypi/wsgisvc
 
  - http://ryrobes.com/python/running-python-scripts-as-a-windows-service/
 
  - http://wiki.pylonshq.com/display/pylonscookbook/How+to+run+Pylons+as+a+Windows+service
 

	
 
- Using Apache. You can investigate here:
 
@@ -272,21 +272,21 @@ What this Guide does not cover:
 
  - https://groups.google.com/group/rhodecode/msg/c433074e813ffdc4
 

	
 

	
 
Upgrading
 
=========
 

	
 
Stop running RhodeCode
 
Stop running Kallithea
 
Open a CommandPrompt like in Step7 (VS2008 path + activate) and type::
 

	
 
 easy_install -U rhodecode
 
 cd \RhodeCode\Bin
 
 easy_install -U kallithea
 
 cd \Kallithea\Bin
 

	
 
{ backup your production.ini file now} ::
 

	
 
 paster make-config RhodeCode production.ini
 
 paster make-config Kallithea production.ini
 

	
 
(check changes and update your production.ini accordingly) ::
 

	
 
 paster upgrade-db production.ini (update database)
 

	
 
Full steps in http://packages.python.org/RhodeCode/upgrade.html
 
Full steps in http://packages.python.org/Kallithea/upgrade.html
docs/make.bat
Show inline comments
 
@@ -85,15 +85,15 @@ if "%1" == "htmlhelp" (
 

	
 
if "%1" == "qthelp" (
 
	%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
 
	echo.
 
	echo.Build finished; now you can run "qcollectiongenerator" with the ^
 
.qhcp project file in %BUILDDIR%/qthelp, like this:
 
	echo.^> qcollectiongenerator %BUILDDIR%\qthelp\RhodeCode.qhcp
 
	echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Kallithea.qhcp
 
	echo.To view the help file:
 
	echo.^> assistant -collectionFile %BUILDDIR%\qthelp\RhodeCode.ghc
 
	echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Kallithea.ghc
 
	goto end
 
)
 

	
 
if "%1" == "devhelp" (
 
	%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
 
	echo.
docs/setup.rst
Show inline comments
 
@@ -2,124 +2,124 @@
 

	
 
=====
 
Setup
 
=====
 

	
 

	
 
Setting up RhodeCode
 
Setting up Kallithea
 
--------------------
 

	
 
First, you will need to create a RhodeCode configuration file. Run the
 
First, you will need to create a Kallithea configuration file. Run the
 
following command to do this::
 

	
 
    paster make-config RhodeCode production.ini
 
    paster make-config Kallithea production.ini
 

	
 
- This will create the file `production.ini` in the current directory. This
 
  configuration file contains the various settings for RhodeCode, e.g proxy
 
  configuration file contains the various settings for Kallithea, e.g proxy
 
  port, email settings, usage of static files, cache, celery settings and
 
  logging.
 

	
 

	
 
Next, you need to create the databases used by RhodeCode. I recommend that you
 
Next, you need to create the databases used by Kallithea. I recommend that you
 
use postgresql or sqlite (default). If you choose a database other than the
 
default ensure you properly adjust the db url in your production.ini
 
configuration file to use this other database. RhodeCode currently supports
 
configuration file to use this other database. Kallithea currently supports
 
postgresql, sqlite and mysql databases. Create the database by running
 
the following command::
 

	
 
    paster setup-db production.ini
 

	
 
This will prompt you for a "root" path. This "root" path is the location where
 
RhodeCode will store all of its repositories on the current machine. After
 
Kallithea will store all of its repositories on the current machine. After
 
entering this "root" path ``setup-db`` will also prompt you for a username
 
and password for the initial admin account which ``setup-db`` sets
 
up for you.
 

	
 
setup process can be fully automated, example for lazy::
 

	
 
    paster setup-db production.ini --user=nn --password=secret --email=nn@your.kallithea.server --repos=/home/nn/my_repos
 

	
 

	
 
- The ``setup-db`` command will create all of the needed tables and an
 
  admin account. When choosing a root path you can either use a new empty
 
  location, or a location which already contains existing repositories. If you
 
  choose a location which contains existing repositories RhodeCode will simply
 
  choose a location which contains existing repositories Kallithea will simply
 
  add all of the repositories at the chosen location to it's database.
 
  (Note: make sure you specify the correct path to the root).
 
- Note: the given path for mercurial_ repositories **must** be write accessible
 
  for the application. It's very important since the RhodeCode web interface
 
  for the application. It's very important since the Kallithea web interface
 
  will work without write access, but when trying to do a push it will
 
  eventually fail with permission denied errors unless it has write access.
 

	
 
You are now ready to use RhodeCode, to run it simply execute::
 
You are now ready to use Kallithea, to run it simply execute::
 

	
 
    paster serve production.ini
 

	
 
- This command runs the RhodeCode server. The web app should be available at the
 
- This command runs the Kallithea server. The web app should be available at the
 
  127.0.0.1:5000. This ip and port is configurable via the production.ini
 
  file created in previous step
 
- Use the admin account you created above when running ``setup-db``
 
  to login to the web app.
 
- The default permissions on each repository is read, and the owner is admin.
 
  Remember to update these if needed.
 
- In the admin panel you can toggle ldap, anonymous, permissions settings. As
 
  well as edit more advanced options on users and repositories
 

	
 
Optionally users can create `rcextensions` package that extends RhodeCode
 
Optionally users can create `rcextensions` package that extends Kallithea
 
functionality. To do this simply execute::
 

	
 
    paster make-rcext production.ini
 

	
 
This will create `rcextensions` package in the same place that your `ini` file
 
lives. With `rcextensions` it's possible to add additional mapping for whoosh,
 
stats and add additional code into the push/pull/create/delete repo hooks.
 
For example for sending signals to build-bots such as jenkins.
 
Please see the `__init__.py` file inside `rcextensions` package
 
for more details.
 

	
 

	
 
Using RhodeCode with SSH
 
Using Kallithea with SSH
 
------------------------
 

	
 
RhodeCode currently only hosts repositories using http and https. (The addition
 
Kallithea currently only hosts repositories using http and https. (The addition
 
of ssh hosting is a planned future feature.) However you can easily use ssh in
 
parallel with RhodeCode. (Repository access via ssh is a standard "out of
 
parallel with Kallithea. (Repository access via ssh is a standard "out of
 
the box" feature of mercurial_ and you can use this to access any of the
 
repositories that RhodeCode is hosting. See PublishingRepositories_)
 
repositories that Kallithea is hosting. See PublishingRepositories_)
 

	
 
RhodeCode repository structures are kept in directories with the same name
 
Kallithea repository structures are kept in directories with the same name
 
as the project. When using repository groups, each group is a subdirectory.
 
This allows you to easily use ssh for accessing repositories.
 

	
 
In order to use ssh you need to make sure that your web-server and the users
 
login accounts have the correct permissions set on the appropriate directories.
 
(Note that these permissions are independent of any permissions you have set up
 
using the RhodeCode web interface.)
 
using the Kallithea web interface.)
 

	
 
If your main directory (the same as set in RhodeCode settings) is for example
 
set to **/home/hg** and the repository you are using is named `rhodecode`, then
 
If your main directory (the same as set in Kallithea settings) is for example
 
set to **/home/hg** and the repository you are using is named `kallithea`, then
 
to clone via ssh you should run::
 

	
 
    hg clone ssh://user@server.com/home/hg/rhodecode
 
    hg clone ssh://user@server.com/home/hg/kallithea
 

	
 
Using other external tools such as mercurial-server_ or using ssh key based
 
authentication is fully supported.
 

	
 
Note: In an advanced setup, in order for your ssh access to use the same
 
permissions as set up via the RhodeCode web interface, you can create an
 
authentication hook to connect to the rhodecode db and runs check functions for
 
permissions as set up via the Kallithea web interface, you can create an
 
authentication hook to connect to the Kallithea db and runs check functions for
 
permissions against that.
 

	
 
Setting up Whoosh full text search
 
----------------------------------
 

	
 
Starting from version 1.1 the whoosh index can be build by using the paster
 
command ``make-index``. To use ``make-index`` you must specify the configuration
 
file that stores the location of the index. You may specify the location of the
 
repositories (`--repo-location`).  If not specified, this value is retrieved
 
from the RhodeCode database.  This was required prior to 1.2.  Starting from
 
from the Kallithea database.  This was required prior to 1.2.  Starting from
 
version 1.2 it is also possible to specify a comma separated list of
 
repositories (`--index-only`) to build index only on chooses repositories
 
skipping any other found in repos location
 

	
 
You may optionally pass the option `-f` to enable a full index rebuild. Without
 
the `-f` option, indexing will run always in "incremental" mode.
 
@@ -132,20 +132,20 @@ For a full index rebuild use::
 

	
 
    paster make-index production.ini -f
 

	
 

	
 
building index just for chosen repositories is possible with such command::
 

	
 
 paster make-index production.ini --index-only=vcs,rhodecode
 
 paster make-index production.ini --index-only=vcs,kallithea
 

	
 

	
 
In order to do periodical index builds and keep your index always up to date.
 
It's recommended to do a crontab entry for incremental indexing.
 
An example entry might look like this::
 

	
 
    /path/to/python/bin/paster make-index /path/to/rhodecode/production.ini
 
    /path/to/python/bin/paster make-index /path/to/kallithea/production.ini
 

	
 
When using incremental mode (the default) whoosh will check the last
 
modification date of each file and add it to be reindexed if a newer file is
 
available. The indexing daemon checks for any removed files and removes them
 
from index.
 

	
 
@@ -153,13 +153,13 @@ If you want to rebuild index from scratc
 
or in the admin panel you can check `build from scratch` flag.
 

	
 

	
 
Setting up LDAP support
 
-----------------------
 

	
 
RhodeCode starting from version 1.1 supports ldap authentication. In order
 
Kallithea starting from version 1.1 supports ldap authentication. In order
 
to use LDAP, you have to install the python-ldap_ package. This package is
 
available via pypi, so you can install it by running
 

	
 
using easy_install::
 

	
 
    easy_install python-ldap
 
@@ -311,13 +311,13 @@ LDAP Search Scope : required
 
        location.
 

	
 
.. _Login Attribute:
 

	
 
Login Attribute : required
 
    The LDAP record attribute that will be matched as the USERNAME or
 
    ACCOUNT used to connect to RhodeCode.  This will be added to `LDAP
 
    ACCOUNT used to connect to Kallithea.  This will be added to `LDAP
 
    Filter`_ for locating the User object.  If `LDAP Filter`_ is specified as
 
    "LDAPFILTER", `Login Attribute`_ is specified as "uid" and the user has
 
    connected as "jsmith" then the `LDAP Filter`_ will be augmented as below
 
    ::
 

	
 
        (&(LDAPFILTER)(uid=jsmith))
 
@@ -335,25 +335,25 @@ Last Name Attribute : required
 
.. _ldap_attr_email:
 

	
 
Email Attribute : required
 
    The LDAP record attribute which represents the user's email address.
 

	
 
If all data are entered correctly, and python-ldap_ is properly installed
 
users should be granted access to RhodeCode with ldap accounts.  At this
 
time user information is copied from LDAP into the RhodeCode user database.
 
users should be granted access to Kallithea with ldap accounts.  At this
 
time user information is copied from LDAP into the Kallithea user database.
 
This means that updates of an LDAP user object may not be reflected as a
 
user update in RhodeCode.
 
user update in Kallithea.
 

	
 
If You have problems with LDAP access and believe You entered correct
 
information check out the RhodeCode logs, any error messages sent from LDAP
 
information check out the Kallithea logs, any error messages sent from LDAP
 
will be saved there.
 

	
 
Active Directory
 
''''''''''''''''
 

	
 
RhodeCode can use Microsoft Active Directory for user authentication.  This
 
Kallithea can use Microsoft Active Directory for user authentication.  This
 
is done through an LDAP or LDAPS connection to Active Directory.  The
 
following LDAP configuration settings are typical for using Active
 
Directory ::
 

	
 
 Base DN              = OU=SBSUsers,OU=Users,OU=MyBusiness,DC=v3sys,DC=local
 
 Login Attribute      = sAMAccountName
 
@@ -365,47 +365,47 @@ All other LDAP settings will likely be s
 
appropriately configured.
 

	
 

	
 
Authentication by container or reverse-proxy
 
--------------------------------------------
 

	
 
Starting with version 1.3, RhodeCode supports delegating the authentication
 
Starting with version 1.3, Kallithea supports delegating the authentication
 
of users to its WSGI container, or to a reverse-proxy server through which all
 
clients access the application.
 

	
 
When these authentication methods are enabled in RhodeCode, it uses the
 
When these authentication methods are enabled in Kallithea, it uses the
 
username that the container/proxy (Apache/Nginx/etc) authenticated and doesn't
 
perform the authentication itself. The authorization, however, is still done by
 
RhodeCode according to its settings.
 
Kallithea according to its settings.
 

	
 
When a user logs in for the first time using these authentication methods,
 
a matching user account is created in RhodeCode with default permissions. An
 
administrator can then modify it using RhodeCode's admin interface.
 
a matching user account is created in Kallithea with default permissions. An
 
administrator can then modify it using Kallithea's admin interface.
 
It's also possible for an administrator to create accounts and configure their
 
permissions before the user logs in for the first time.
 

	
 
Container-based authentication
 
''''''''''''''''''''''''''''''
 

	
 
In a container-based authentication setup, RhodeCode reads the user name from
 
In a container-based authentication setup, Kallithea reads the user name from
 
the ``REMOTE_USER`` server variable provided by the WSGI container.
 

	
 
After setting up your container (see `Apache's WSGI config`_), you'd need
 
to configure it to require authentication on the location configured for
 
RhodeCode.
 
Kallithea.
 

	
 
In order for RhodeCode to start using the provided username, you should set the
 
In order for Kallithea to start using the provided username, you should set the
 
following in the [app:main] section of your .ini file::
 

	
 
    container_auth_enabled = true
 

	
 

	
 
Proxy pass-through authentication
 
'''''''''''''''''''''''''''''''''
 

	
 
In a proxy pass-through authentication setup, RhodeCode reads the user name
 
In a proxy pass-through authentication setup, Kallithea reads the user name
 
from the ``X-Forwarded-User`` request header, which should be configured to be
 
sent by the reverse-proxy server.
 

	
 
After setting up your proxy solution (see `Apache virtual host reverse proxy example`_,
 
`Apache as subdirectory`_ or `Nginx virtual host example`_), you'd need to
 
configure the authentication and add the username in a request header named
 
@@ -417,25 +417,25 @@ reverse-proxy setup with basic auth::
 
    <Location /<someprefix> >
 
      ProxyPass http://127.0.0.1:5000/<someprefix>
 
      ProxyPassReverse http://127.0.0.1:5000/<someprefix>
 
      SetEnvIf X-Url-Scheme https HTTPS=1
 

	
 
      AuthType Basic
 
      AuthName "RhodeCode authentication"
 
      AuthUserFile /home/web/rhodecode/.htpasswd
 
      AuthName "Kallithea authentication"
 
      AuthUserFile /home/web/kallithea/.htpasswd
 
      require valid-user
 

	
 
      RequestHeader unset X-Forwarded-User
 

	
 
      RewriteEngine On
 
      RewriteCond %{LA-U:REMOTE_USER} (.+)
 
      RewriteRule .* - [E=RU:%1]
 
      RequestHeader set X-Forwarded-User %{RU}e
 
    </Location>
 

	
 
In order for RhodeCode to start using the forwarded username, you should set
 
In order for Kallithea to start using the forwarded username, you should set
 
the following in the [app:main] section of your .ini file::
 

	
 
    proxypass_auth_enabled = true
 

	
 
.. note::
 
   If you enable proxy pass-through authentication, make sure your server is
 
@@ -443,13 +443,13 @@ the following in the [app:main] section 
 
   forge the authentication header and could effectively become authenticated
 
   using any account of their liking.
 

	
 
Integration with Issue trackers
 
-------------------------------
 

	
 
RhodeCode provides a simple integration with issue trackers. It's possible
 
Kallithea provides a simple integration with issue trackers. It's possible
 
to define a regular expression that will fetch issue id stored in commit
 
messages and replace that with an url to this issue. To enable this simply
 
uncomment following variables in the ini file::
 

	
 
    issue_pat = (?:^#|\s#)(\w+)
 
    issue_server_link = https://myissueserver.com/{repo}/issue/{id}
 
@@ -480,24 +480,24 @@ To add another custom hook simply fill i
 
can be found at *kallithea.lib.hooks*.
 

	
 

	
 
Changing default encoding
 
-------------------------
 

	
 
By default RhodeCode uses utf8 encoding, starting from 1.3 series this
 
By default Kallithea uses utf8 encoding, starting from 1.3 series this
 
can be changed, simply edit default_encoding in .ini file to desired one.
 
This affects many parts in rhodecode including committers names, filenames,
 
encoding of commit messages. In addition RhodeCode can detect if `chardet`
 
library is installed. If `chardet` is detected RhodeCode will fallback to it
 
This affects many parts in Kallithea including committers names, filenames,
 
encoding of commit messages. In addition Kallithea can detect if `chardet`
 
library is installed. If `chardet` is detected Kallithea will fallback to it
 
when there are encode/decode errors.
 

	
 

	
 
Setting Up Celery
 
-----------------
 

	
 
Since version 1.1 celery is configured by the rhodecode ini configuration files.
 
Since version 1.1 celery is configured by the Kallithea ini configuration files.
 
Simply set use_celery=true in the ini file then add / change the configuration
 
variables inside the ini file.
 

	
 
Remember that the ini files use the format with '.' not with '_' like celery.
 
So for example setting `BROKER_HOST` in celery means setting `broker.host` in
 
the config file.
 
@@ -506,20 +506,20 @@ In order to start using celery run::
 

	
 
 paster celeryd <configfile.ini>
 

	
 

	
 
.. note::
 
   Make sure you run this command from the same virtualenv, and with the same
 
   user that rhodecode runs.
 
   user that Kallithea runs.
 

	
 
HTTPS support
 
-------------
 

	
 
There are two ways to enable https:
 

	
 
- Set HTTP_X_URL_SCHEME in your http server headers, than rhodecode will
 
- Set HTTP_X_URL_SCHEME in your http server headers, than Kallithea will
 
  recognize this headers and make proper https redirections
 
- Alternatively, change the `force_https = true` flag in the ini configuration
 
  to force using https, no headers are needed than to enable https
 

	
 

	
 
Nginx virtual host example
 
@@ -555,14 +555,14 @@ Sample config for nginx using proxy::
 
       rewrite (.*)    https://your.kallithea.server/_admin/gists;
 
    }
 

	
 
    server {
 
       listen          443;
 
       server_name     your.kallithea.server;
 
       access_log      /var/log/nginx/rhodecode.access.log;
 
       error_log       /var/log/nginx/rhodecode.error.log;
 
       access_log      /var/log/nginx/kallithea.access.log;
 
       error_log       /var/log/nginx/kallithea.error.log;
 

	
 
       ssl on;
 
       ssl_certificate     your.kallithea.server.crt;
 
       ssl_certificate_key your.kallithea.server.key;
 

	
 
       ssl_session_timeout 5m;
 
@@ -623,13 +623,13 @@ Here is a sample configuration file for 
 
            </Proxy>
 

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

	
 
            #rhodecode instance
 
            #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
 

	
 
@@ -665,68 +665,68 @@ Add the following at the end of the .ini
 

	
 
then change <someprefix> into your chosen prefix
 

	
 
Apache's WSGI config
 
--------------------
 

	
 
Alternatively, RhodeCode can be set up with Apache under mod_wsgi. For
 
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
 

	
 
- Create a wsgi dispatch script, like the one below. Make sure you
 
  check the paths correctly point to where you installed RhodeCode
 
  check 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::
 

	
 
    WSGIDaemonProcess pylons \
 
        threads=4 \
 
        python-path=/home/web/rhodecode/pyenv/lib/python2.6/site-packages
 
    WSGIScriptAlias / /home/web/rhodecode/dispatch.wsgi
 
        python-path=/home/web/kallithea/pyenv/lib/python2.6/site-packages
 
    WSGIScriptAlias / /home/web/kallithea/dispatch.wsgi
 
    WSGIPassAuthorization On
 

	
 
.. note::
 
   when running apache as root please add: `user=www-data group=www-data`
 
   into above configuration
 

	
 
.. note::
 
   Running RhodeCode in multiprocess mode in apache is not supported,
 
   Running Kallithea in multiprocess mode in apache is not supported,
 
   make sure you don't specify `processes=num` directive in the config
 

	
 

	
 
Example wsgi dispatch script::
 

	
 
    import os
 
    os.environ["HGENCODING"] = "UTF-8"
 
    os.environ['PYTHON_EGG_CACHE'] = '/home/web/rhodecode/.egg-cache'
 
    os.environ['PYTHON_EGG_CACHE'] = '/home/web/kallithea/.egg-cache'
 

	
 
    # sometimes it's needed to set the curent dir
 
    os.chdir('/home/web/rhodecode/')
 
    os.chdir('/home/web/kallithea/')
 

	
 
    import site
 
    site.addsitedir("/home/web/rhodecode/pyenv/lib/python2.6/site-packages")
 
    site.addsitedir("/home/web/kallithea/pyenv/lib/python2.6/site-packages")
 

	
 
    from paste.deploy import loadapp
 
    from paste.script.util.logging_config import fileConfig
 

	
 
    fileConfig('/home/web/rhodecode/production.ini')
 
    application = loadapp('config:/home/web/rhodecode/production.ini')
 
    fileConfig('/home/web/kallithea/production.ini')
 
    application = loadapp('config:/home/web/kallithea/production.ini')
 

	
 
Note: when using mod_wsgi you'll need to install the same version of
 
Mercurial that's inside RhodeCode's virtualenv also on the system's Python
 
Mercurial that's inside Kallithea's virtualenv also on the system's Python
 
environment.
 

	
 

	
 
Other configuration files
 
-------------------------
 

	
docs/upgrade.rst
Show inline comments
 
@@ -9,54 +9,54 @@ Upgrading from PyPI (aka "Cheeseshop")
 

	
 
.. note::
 
   Firstly, it is recommended that you **always** perform a database and
 
   configuration backup before doing an upgrade.
 

	
 
   (These directions will use '{version}' to note that this is the version of
 
   Rhodecode that these files were used with.  If backing up your RhodeCode
 
   Kallithea that these files were used with.  If backing up your Kallithea
 
   instance from version 1.3.6 to 1.4.0, the ``production.ini`` file would be
 
   backed up to ``production.ini.1-3-6``.)
 

	
 

	
 
If using a sqlite database, stop the Rhodecode process/daemon/service, and
 
If using a sqlite database, stop the Kallithea process/daemon/service, and
 
then make a copy of the database file::
 

	
 
 service kallithea stop
 
 cp rhodecode.db rhodecode.db.{version}
 
 cp kallithea.db kallithea.db.{version}
 

	
 

	
 
Back up your configuration file::
 

	
 
 cp production.ini production.ini.{version}
 

	
 

	
 
Ensure that you are using the Python Virtual Environment that you'd originally
 
installed Rhodecode in::
 
installed Kallithea in::
 

	
 
 pip freeze
 

	
 
will list all packages installed in the current environment.  If Rhodecode
 
will list all packages installed in the current environment.  If Kallithea
 
isn't listed, change virtual environments to your venv location::
 

	
 
 source /opt/rhodecode-venv/bin/activate
 
 source /opt/kallithea-venv/bin/activate
 

	
 

	
 
Once you have verified the environment you can upgrade ``Rhodecode`` with::
 
Once you have verified the environment you can upgrade ``Kallithea`` with::
 

	
 
 easy_install -U rhodecode
 
 easy_install -U kallithea
 

	
 
Or::
 

	
 
 pip install --upgrade rhodecode
 
 pip install --upgrade kallithea
 

	
 

	
 
Then run the following command from the installation directory::
 

	
 
 paster make-config RhodeCode production.ini
 
 paster make-config Kallithea production.ini
 

	
 
This will display any changes made by the new version of RhodeCode to your
 
This will display any changes made by the new version of Kallithea to your
 
current configuration. It will try to perform an automerge. It's recommended
 
that you re-check the content after the automerge.
 

	
 
.. note::
 
   Please always make sure your .ini files are up to date. Often errors are
 
   caused by missing params added in new versions.
 
@@ -77,27 +77,27 @@ options that need to be set.
 

	
 

	
 
.. note::
 
   DB schema upgrade library has some limitations and can sometimes fail if you try to
 
   upgrade from older major releases. In such case simply run upgrades sequentially, eg.
 
   upgrading from 1.2.X to 1.5.X should be done like that: 1.2.X. > 1.3.X > 1.4.X > 1.5.X
 
   You can always specify what version of RhodeCode you want to install for example in pip
 
   `pip install RhodeCode==1.3.6`
 
   You can always specify what version of Kallithea you want to install for example in pip
 
   `pip install Kallithea==1.3.6`
 

	
 
You may find it helpful to clear out your log file so that new errors are
 
readily apparent::
 

	
 
 echo > rhodecode.log
 
 echo > kallithea.log
 

	
 
Once that is complete, you may now start your upgraded Rhodecode Instance::
 
Once that is complete, you may now start your upgraded Kallithea Instance::
 

	
 
 service kallithea start
 

	
 
Or::
 

	
 
 paster serve /var/www/rhodecode/production.ini
 
 paster serve /var/www/kallithea/production.ini
 

	
 
.. note::
 
   If you're using Celery, make sure you restart all instances of it after
 
   upgrade.
 

	
 
.. _virtualenv: http://pypi.python.org/pypi/virtualenv
docs/usage/backup.rst
Show inline comments
 
.. _backup:
 

	
 
====================
 
Backing up RhodeCode
 
Backing up Kallithea
 
====================
 

	
 

	
 
Settings
 
--------
 

	
 
Just copy your .ini file, it contains all RhodeCode settings.
 
Just copy your .ini file, it contains all Kallithea settings.
 

	
 
Whoosh index
 
------------
 

	
 
Whoosh index is located in **/data/index** directory where you installed
 
RhodeCode ie. the same place where the ini file is located
 
Kallithea ie. the same place where the ini file is located
 

	
 

	
 
Database
 
--------
 

	
 
When using sqlite just copy rhodecode.db.
 
When using sqlite just copy kallithea.db.
 
Any other database engine requires a manual backup operation.
 

	
 
Database backup will contain all gathered statistics
docs/usage/debugging.rst
Show inline comments
 
.. _debugging:
 

	
 
===================
 
Debugging RhodeCode
 
Debugging Kallithea
 
===================
 

	
 
If you encountered problems with RhodeCode here are some instructions how to
 
If you encountered problems with Kallithea here are some instructions how to
 
possibly debug them.
 

	
 
** First make sure you're using the latest version available.**
 

	
 
enable detailed debug
 
---------------------
 

	
 
RhodeCode uses standard python logging modules to log it's output.
 
Kallithea uses standard python logging modules to log it's output.
 
By default only loggers with INFO level are displayed. To enable full output
 
change `level = DEBUG` for all logging handlers in currently used .ini file.
 
This change will allow to see much more detailed output in the logfile or
 
console. This generally helps a lot to track issues.
 

	
 

	
docs/usage/general.rst
Show inline comments
 
.. _general:
 

	
 
=======================
 
General RhodeCode usage
 
General Kallithea usage
 
=======================
 

	
 

	
 
Repository deleting
 
-------------------
 

	
 
Currently when admin/owner deletes a repository, RhodeCode does not physically
 
Currently when admin/owner deletes a repository, Kallithea does not physically
 
delete a repository from filesystem, it renames it in a special way so it's
 
not possible to push,clone or access repository. It's worth a notice that,
 
even if someone will be given administrative access to RhodeCode and will
 
even if someone will be given administrative access to Kallithea and will
 
delete a repository You can easy restore such action by restoring `rm__<date>`
 
from the repository name, and internal repository storage (.hg/.git). There
 
is also a special command for cleaning such archived repos::
 

	
 
    paster cleanup-repos --older-than=30d production.ini
 

	
 
@@ -57,13 +57,13 @@ example::
 
  http://server.com/repo_name
 
  # after insertion to test_group group the url will be
 
  http://server.com/test_group/repo_name
 

	
 
This can be an issue for build systems and any other hardcoded scripts, moving
 
repository to a group leads to a need for changing external systems. To
 
overcome this RhodeCode introduces a non changable replacement url. It's
 
overcome this Kallithea introduces a non changable replacement url. It's
 
simply an repository ID prefixed with `_` above urls are also accessible as::
 

	
 
  http://server.com/_<ID>
 

	
 
Since ID are always the same moving the repository will not affect such url.
 
the _<ID> syntax can be used anywhere in the system so urls with repo_name
 
@@ -71,19 +71,19 @@ for changelogs, files and other can be e
 

	
 

	
 
Mailing
 
-------
 

	
 
When administrator will fill up the mailing settings in .ini files
 
RhodeCode will send mails on user registration, or when RhodeCode errors occur
 
Kallithea will send mails on user registration, or when Kallithea errors occur
 
on errors the mails will have a detailed traceback of error.
 

	
 

	
 
Mails are also sent for code comments. If someone comments on a changeset
 
mail is sent to all participants, the person who commited the changeset
 
(if present in RhodeCode), and to all people mentioned with @mention system.
 
(if present in Kallithea), and to all people mentioned with @mention system.
 

	
 

	
 
Trending source files
 
---------------------
 

	
 
Trending source files are calculated based on pre defined dict of known
 
@@ -92,13 +92,13 @@ custom files it's possible to add new ty
 
located in `/kallithea/lib/celerylib/tasks.py`
 

	
 

	
 
Cloning remote repositories
 
---------------------------
 

	
 
RhodeCode has an ability to clone remote repos from given remote locations.
 
Kallithea has an ability to clone remote repos from given remote locations.
 
Currently it support following options:
 

	
 
- hg  -> hg clone
 
- svn -> hg clone
 
- git -> git clone
 

	
 
@@ -106,37 +106,37 @@ Currently it support following options:
 
.. note::
 

	
 
    - *`svn -> hg` cloning requires `hgsubversion` library to be installed.*
 

	
 
If you need to clone repositories that are protected via basic auth, you
 
might pass the url with stored credentials inside eg.
 
`http://user:passw@remote.server/repo`, RhodeCode will try to login and clone
 
`http://user:passw@remote.server/repo`, Kallithea will try to login and clone
 
using given credentials. Please take a note that they will be stored as
 
plaintext inside the database. RhodeCode will remove auth info when showing the
 
plaintext inside the database. Kallithea will remove auth info when showing the
 
clone url in summary page.
 

	
 

	
 

	
 
Visual settings in admin pannel
 
-------------------------------
 

	
 

	
 
Visualisation settings in RhodeCode settings view are extra customizations
 
Visualisation settings in Kallithea settings view are extra customizations
 
of server behavior. There are 3 main section in the settings.
 

	
 
General
 
~~~~~~~
 

	
 
`Use repository extra fields` option allows to set a custom fields for each
 
repository in the system. Each new field consists of 3 attributes `field key`,
 
`field label`, `field description`. Example usage of such fields would be to
 
define company specific information into repositories eg. defining repo_manager
 
key that would add give info about a manager of each repository. There's no
 
limit for adding custom fields. Newly created fields are accessible via API.
 

	
 
`Show RhodeCode version` option toggles displaying exact RhodeCode version in
 
`Show Kallithea version` option toggles displaying exact Kallithea version in
 
the footer
 

	
 

	
 
Dashboard items
 
~~~~~~~~~~~~~~~
 

	
 
@@ -150,13 +150,13 @@ Show public repo icon / Show private rep
 
public/private icons should be shown in the UI.
 

	
 

	
 
Meta-Tagging
 
~~~~~~~~~~~~
 

	
 
With this option enabled, special metatags that are recognisible by RhodeCode
 
With this option enabled, special metatags that are recognisible by Kallithea
 
will be turned into colored tags. Currently available tags are::
 

	
 
    [featured]
 
    [stale]
 
    [dead]
 
    [lang => lang]
docs/usage/git_support.rst
Show inline comments
 
@@ -2,24 +2,24 @@
 

	
 
===========
 
GIT support
 
===========
 

	
 

	
 
Git support in RhodeCode 1.3 was enabled by default. You need to have a git
 
Git support in Kallithea 1.3 was enabled by default. You need to have a git
 
client installed on the machine to make git fully work.
 

	
 
Although There is one limitation on git usage.
 

	
 
- large pushes requires a http server with chunked encoding support.
 

	
 
if you plan to use git you need to run RhodeCode with some
 
if you plan to use git you need to run Kallithea with some
 
http server that supports chunked encoding which git http protocol uses,
 
i recommend using waitress_ or gunicorn_ (linux only) for `paste` wsgi app
 
replacement. Starting from version 1.4 waitress_ is the default wsgi server
 
used in RhodeCode.
 
used in Kallithea.
 

	
 
To use, simply change change the following in the .ini file::
 

	
 
    use = egg:Paste#http
 

	
 
to::
docs/usage/locking.rst
Show inline comments
 
.. _locking:
 

	
 
===================================
 
RhodeCode repository locking system
 
Kallithea repository locking system
 
===================================
 

	
 

	
 
| Repos with **locking function=disabled** is the default, that's how repos work
 
  today.
 
| Repos with **locking function=enabled** behaves like follows:
 
@@ -17,13 +17,13 @@ influence this state:
 
  if the user has write/admin permissions on this repo
 

	
 
- The command `hg/git clone <repo>` will lock that repo (locked=true) if the
 
  user has write/admin permissions on this repo
 

	
 

	
 
RhodeCode will remember the user id who locked the repo
 
Kallithea will remember the user id who locked the repo
 
only this specific user can unlock the repo (locked=false) by calling
 

	
 
- `hg/git push <repo>`
 

	
 
every other command on that repo from this user and
 
every command from any other user will result in http return code 423 (locked)
docs/usage/performance.rst
Show inline comments
 
.. _performance:
 

	
 
================================
 
Optimizing RhodeCode Performance
 
Optimizing Kallithea Performance
 
================================
 

	
 
When serving large amount of big repositories RhodeCode can start
 
When serving large amount of big repositories Kallithea can start
 
performing slower than expected. Because of demanding nature of handling large
 
amount of data from version control systems here are some tips how to get
 
the best performance.
 

	
 
* RhodeCode will perform better on machines with faster disks (SSD/SAN). It's
 
* Kallithea will perform better on machines with faster disks (SSD/SAN). It's
 
  more important to have faster disk than faster CPU.
 

	
 
* Slowness on initial page can be easily fixed by grouping repositories, and/or
 
  increasing cache size (see below), that includes using lightweight dashboard
 
  option and vcs_full_cache setting in .ini file
 

	
 

	
 
Follow these few steps to improve performance of RhodeCode system.
 
Follow these few steps to improve performance of Kallithea system.
 

	
 

	
 
1. Increase cache
 

	
 
    in the .ini file::
 

	
 
     beaker.cache.sql_cache_long.expire=3600 <-- set this to higher number
 

	
 
    This option affects the cache expiration time for main page. Having
 
    few hundreds of repositories on main page can sometimes make the system
 
    to behave slow when cache expires for all of them. Increasing `expire`
 
    option to day (86400) or a week (604800) will improve general response
 
    times for the main page. RhodeCode has an intelligent cache expiration
 
    times for the main page. Kallithea has an intelligent cache expiration
 
    system and it will expire cache for repositories that had been changed.
 

	
 
2. Switch from sqlite to postgres or mysql
 

	
 
    sqlite is a good option when having small load on the system. But due to
 
    locking issues with sqlite, it's not recommended to use it for larger
 
    setup. Switching to mysql or postgres will result in a immediate
 
    performance increase.
 

	
 
3. Scale RhodeCode horizontally
 
3. Scale Kallithea horizontally
 

	
 
    Scaling horizontally can give huge performance increase when dealing with
 
    large traffic (large amount of users, CI servers etc). RhodeCode can be
 
    large traffic (large amount of users, CI servers etc). Kallithea can be
 
    scaled horizontally on one (recommended) or multiple machines. In order
 
    to scale horizontally you need to do the following:
 

	
 
    - each instance needs it's own .ini file and unique `instance_id` set in them
 
    - each instance `data` storage needs to be configured to be stored on a
 
      shared disk storage, preferably together with repositories. This `data`
 
      dir contains template caches, sessions, whoosh index and it's used for
 
      tasks locking (so it's safe across multiple instances). Set the
 
      `cache_dir`, `index_dir`, `beaker.cache.data_dir`, `beaker.cache.lock_dir`
 
      variables in each .ini file to shared location across RhodeCode instances
 
      variables in each .ini file to shared location across Kallithea instances
 
    - if celery is used each instance should run separate celery instance, but
 
      the message broken should be common to all of them (ex one rabbitmq
 
      shared server)
 
    - load balance using round robin or ip hash, recommended is writing LB rules
 
      that will separate regular user traffic from automated processes like CI
 
      servers or build bots.
docs/usage/statistics.rst
Show inline comments
 
.. _statistics:
 

	
 
==========
 
Statistics
 
==========
 

	
 
The RhodeCode statistics system makes heavy demands of the server resources, so
 
The Kallithea statistics system makes heavy demands of the server resources, so
 
in order to keep a balance between usability and performance, the statistics are
 
cached inside db and are gathered incrementally, this is how RhodeCode does
 
cached inside db and are gathered incrementally, this is how Kallithea does
 
this:
 

	
 
With Celery disabled
 
--------------------
 

	
 
- On each first visit to the summary page a set of 250 commits are parsed and
 
  updates statistics cache.
 
- This happens on each single visit to the statistics page until all commits are
 
  fetched. Statistics are kept cached until additional commits are added to the
 
  repository. In such a case RhodeCode will only fetch the new commits when
 
  repository. In such a case Kallithea will only fetch the new commits when
 
  updating it's cache.
 

	
 

	
 
With Celery enabled
 
-------------------
 

	
 
- On the first visit to the summary page RhodeCode will create tasks that will
 
- On the first visit to the summary page Kallithea will create tasks that will
 
  execute on celery workers. This task will gather all of the stats until all
 
  commits are parsed, each task will parse 250 commits, and run the next task to
 
  parse next 250 commits, until all of the commits are parsed.
 

	
 
.. note::
 
   At any time you can disable statistics on each repository via the repository
docs/usage/subrepos.rst
Show inline comments
 
.. _subrepos:
 

	
 
=============================================
 
working with RhodeCode and mercurial subrepos
 
working with Kallithea and mercurial subrepos
 
=============================================
 

	
 
example usage of Subrepos with RhodeCode::
 
example usage of Subrepos with Kallithea::
 

	
 
    ## init a simple repo
 
    hg init repo1
 
    cd repo1
 
    echo "file1" > file1
 
    hg add file1
 
    hg ci --message "initial file 1"
 

	
 
    #clone subrepo we want to add
 
    hg clone http://rc.local/subrepo
 

	
 
    ## use path like url to existing repo in RhodeCode
 
    ## use path like url to existing repo in Kallithea
 
    echo "subrepo = http://rc.local/subrepo" > .hgsub
 

	
 
    hg add .hgsub
 
    hg ci --message "added remote subrepo"
 

	
 

	
 

	
 
In file list of repo1 you will see a connected subrepo at revision it was
 
during cloning.
 
Clicking in subrepos link should send you to proper repository in RhodeCode
 
Clicking in subrepos link should send you to proper repository in Kallithea
 

	
 
cloning repo1 will also clone attached subrepository.
 

	
 
Next we can edit the subrepo data, and push back to RhodeCode. This will update
 
Next we can edit the subrepo data, and push back to Kallithea. This will update
 
both of repositories.
 

	
 
see http://mercurial.aragost.com/kick-start/en/subrepositories/ for more
 
information about subrepositories
docs/usage/troubleshooting.rst
Show inline comments
 
@@ -11,20 +11,20 @@ Troubleshooting
 
   for example:
 
   /home/my-virtual-python/lib/python2.6/site-packages/kallithea/public
 

	
 
|
 

	
 
:Q: **Can't install celery/rabbitmq?**
 
:A: Don't worry RhodeCode works without them too. No extra setup is required.
 
:A: Don't worry Kallithea works without them too. No extra setup is required.
 
    Try out great celery docs for further help.
 

	
 
|
 

	
 
:Q: **Long lasting push timeouts?**
 
:A: Make sure you set a longer timeouts in your proxy/fcgi settings, timeouts
 
    are caused by https server and not RhodeCode.
 
    are caused by https server and not Kallithea.
 

	
 
|
 

	
 
:Q: **Large pushes timeouts?**
 
:A: Make sure you set a proper max_body_size for the http server. Very often
 
    Apache, Nginx or other http servers kill the connection due to to large
 
@@ -40,22 +40,22 @@ Troubleshooting
 
:Q: **Git fails on push/pull?**
 
:A: Make sure you're using an wsgi http server that can handle chunked encoding
 
    such as `waitress` or `gunicorn`
 

	
 
|
 

	
 
:Q: **How i use hooks in RhodeCode?**
 
:Q: **How i use hooks in Kallithea?**
 
:A: It's easy if they are python hooks just use advanced link in hooks section
 
    in Admin panel, that works only for Mercurial. If you want to use githooks,
 
    just install proper one in repository eg. create file in
 
    `/gitrepo/hooks/pre-receive`. You can also use RhodeCode-extensions to
 
    `/gitrepo/hooks/pre-receive`. You can also use Kallithea-extensions to
 
    connect to callback hooks, for both Git and Mercurial.
 

	
 
|
 

	
 
:Q: **RhodeCode is slow for me, how can i make it faster?**
 
:Q: **Kallithea is slow for me, how can i make it faster?**
 
:A: See the :ref:`performance` section
 

	
 
|
 

	
 
:Q: **UnicodeDecodeError on Apache mod_wsgi**
 
:A: Please read: https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/modwsgi/#if-you-get-a-unicodeencodeerror
0 comments (0 inline, 0 general)