Changeset - 61a6a7bf2cbd
[Not reviewed]
beta
0 3 0
Marcin Kuzminski - 15 years ago 2011-05-03 21:52:38
marcin@python-works.com
small docs updates
3 files changed with 68 insertions and 49 deletions:
0 comments (0 inline, 0 general)
docs/changelog.rst
Show inline comments
 
@@ -28,24 +28,25 @@ news
 
- implemented #108 extended and more powerful LDAP configuration
 
- implemented #56 users groups
 
- major code rewrites optimized codes for speed and memory usage
 
- raw and diff downloads are now in git format
 
- setup command checks for write access to given path
 
- fixed many issues with international characters and unicode. It uses utf8
 
  decode with replace to provide less errors even with non utf8 encoded strings
 
- #125 added API KEY access to feeds
 
- #109 Repository can be created from external Mercurial link (aka. remote 
 
  repository, and manually updated (via pull) from admin panel
 
- beta git support - push/pull server + basic view for git repos
 
- added followers page and forks page
 
- server side file repository files edition with commits
 

	
 
fixes
 
-----
 

	
 
- fixed file browser bug, when switching into given form revision the url was 
 
  not changing
 
- fixed propagation to error controller on simplehg and simplegit middlewares
 
- fixed error when trying to make a download on empty repository
 
- fixed problem with '[' chars in commit messages in journal
 
- fixed #99 Unicode errors, on file node paths with non utf-8 characters
 
- journal fork fixes
 
- removed issue with space inside renamed repository after deletion
docs/installation.rst
Show inline comments
 
.. _installation:
 

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

	
 
``RhodeCode`` is written entirely in Python. In order to gain maximum performance
 
there are some third-party you must install. When RhodeCode is used 
 
together with celery you have to install some kind of message broker,
 
recommended one is rabbitmq_ to make the async tasks work.
 
``RhodeCode`` 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.
 

	
 
Of course RhodeCode 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 small repositories, RhodeCode will perform perfectly 
 
well without celery running.
 
   
 
If you make the decision to run RhodeCode with celery make sure you run 
 
celeryd using paster and message broker together with the application.   
 

	
 
Installing RhodeCode from Cheese Shop
 
-------------------------------------
 

	
 
Rhodecode requires python version 2.5 or higher.
 

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

	
 
    easy_install rhodecode
 

	
 
Or::
 

	
 
    pip install rhodecode
 

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

	
 
    python setup.py install
 

	
 

	
 
Step by step installation example
 
---------------------------------
 

	
 

	
 
- Assuming you have installed virtualenv_ create a new virtual environment using virtualenv:: 
 
For installing RhodeCode i highly recommend using separate virtualenv_. This
 
way many required by RhodeCode libraries will remain sandboxed from your main
 
python and making things less problematic when doing system python updates. 
 

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

	
 
    virtualenv --no-site-packages /var/www/rhodecode-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
 
   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 `/var/www/rhodecode-venv`. 
 
- Activate the virtualenv_ by running::
 

	
 
    source /var/www/rhodecode-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 somewhere on the filesystem for example::
 
- Make a folder for rhodecode data files, and configuration somewhere on the 
 
  filesystem. For example::
 

	
 
    mkdir /var/www/rhodecode
 
  
 
    
 
- Run this command to install rhodecode::
 
- Go into the created directory run this command to install rhodecode::
 

	
 
    easy_install rhodecode 
 
    easy_install rhodecode
 
  
 
  or::
 
 
 
    pip install rhodecode 
 

	
 
- This will install rhodecode together with pylons and all other required python
 
  libraries
 
- This will install rhodecode 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 
 
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
 
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 
 
without celery running.
 
   
 
If you make the decision to run RhodeCode 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
 
   work perfectly fine without them.
 

	
 

	
 
**Message Broker** 
 

	
 
- preferred is `RabbitMq <http://www.rabbitmq.com/>`_
 
- A possible alternative is `Redis <http://code.google.com/p/redis/>`_
 

	
 
For installation instructions you can visit: 
 
http://ask.github.com/celery/getting-started/index.html.
docs/setup.rst
Show inline comments
 
.. _setup:
 

	
 
Setup
 
=====
 

	
 

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

	
 
First, you will need to create a RhodeCode configuration file. Run the following
 
command to do this::
 
First, you will need to create a RhodeCode configuration file. Run the 
 
following command to do this::
 
 
 
    paster make-config RhodeCode 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 port,
 
  email settings, usage of static files, cache, celery settings and logging.
 
  configuration file contains the various settings for RhodeCode, 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
 
use sqlite (default) or postgresql. 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. Create the databases by running
 
the following command::
 

	
 
    paster setup-app 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
 
entering this "root" path ``setup-app`` will also prompt you for a username and password
 
for the initial admin account which ``setup-app`` sets up for you.
 
entering this "root" path ``setup-app`` will also prompt you for a username 
 
and password for the initial admin account which ``setup-app`` sets up for you.
 

	
 
- The ``setup-app`` 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 add all of the
 
  repositories at the chosen location to it's database. (Note: make sure you
 
  specify the correct path to the root).
 
  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 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 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.
 
  for the application. It's very important since the RhodeCode 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::
 
 
 
    paster serve production.ini
 
 
 
- This command runs the RhodeCode 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-app`` to login to the web app.
 
- Use the admin account you created above when running ``setup-app`` 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
 

	
 
Try copying your own mercurial repository into the "root" directory you are
 
using, then from within the RhodeCode web application choose Admin >
 
repositories. Then choose Add New Repository. Add the repository you copied into
 
the root. Test that you can browse your repository from within RhodeCode and then
 
try cloning your repository from RhodeCode with::
 
repositories. Then choose Add New Repository. Add the repository you copied 
 
into the root. Test that you can browse your repository from within RhodeCode 
 
and then try cloning your repository from RhodeCode with::
 

	
 
    hg clone http://127.0.0.1:5000/<repository name>
 

	
 
where *repository name* is replaced by the name of your repository.
 

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

	
 
RhodeCode 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
 
RhodeCode 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
 
the box" feature of mercurial_ and you can use this to access any of the
 
repositories that RhodeCode is hosting. See PublishingRepositories_)
 

	
 
RhodeCode 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.)
 
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.)
 

	
 
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
 
to clone via ssh you should run::
 

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

	
 
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
 
@@ -221,26 +223,26 @@ Connection Security : required
 
    LDAPS connection
 
        Enable ldaps connection. It will likely require `Port`_ to be set to 
 
        a different value (standard LDAPS port is 636). When LDAPS is enabled 
 
        then `Certificate Checks`_ is required.
 
        
 
    START_TLS on LDAP connection
 
        START TLS connection
 

	
 
.. _Certificate Checks:
 

	
 
Certificate Checks : optional
 
    How SSL certificates verification is handled - this is only useful when
 
    `Enable LDAPS`_ is enabled.  Only DEMAND or HARD offer full SSL security while
 
    the other options are susceptible to man-in-the-middle attacks.  SSL
 
    `Enable LDAPS`_ is enabled.  Only DEMAND or HARD offer full SSL security 
 
    while the other options are susceptible to man-in-the-middle attacks.  SSL
 
    certificates can be installed to /etc/openldap/cacerts so that the
 
    DEMAND or HARD options can be used with self-signed certificates or
 
    certificates that do not have traceable certificates of authority.
 

	
 
    NEVER
 
        A serve certificate will never be requested or checked.
 

	
 
    ALLOW
 
        A server certificate is requested.  Failure to provide a
 
        certificate or providing a bad certificate will not terminate the
 
        session.
 

	
 
@@ -350,36 +352,36 @@ Simply set use_celery=true in the ini fi
 
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.
 

	
 
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.
 
   Make sure you run this command from the same virtualenv, and with the same 
 
   user that rhodecode runs.
 
   
 
HTTPS support
 
-------------
 

	
 
There are two ways to enable https:
 

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

	
 

	
 
Nginx virtual host example
 
--------------------------
 

	
 
Sample config for nginx using proxy::
 

	
 
    server {
 
       listen          80;
 
       server_name     hg.myserver.com;
 
       access_log      /var/log/nginx/rhodecode.access.log;
 
       error_log       /var/log/nginx/rhodecode.error.log;
 
@@ -517,24 +519,25 @@ Troubleshooting
 
    are caused by https server and not RhodeCode.
 
    
 
| 
 

	
 
:Q: **Large pushes timeouts?**
 
:A: Make sure you set a proper max_body_size for the http server.
 

	
 
|
 

	
 
:Q: **Apache doesn't pass basicAuth on pull/push?**
 
:A: Make sure you added `WSGIPassAuthorization true`.
 

	
 
For further questions search the `Issues tracker`_, or post a message in the `google group rhodecode`_
 
For further questions search the `Issues tracker`_, or post a message in the 
 
`google group rhodecode`_
 

	
 
.. _virtualenv: http://pypi.python.org/pypi/virtualenv
 
.. _python: http://www.python.org/
 
.. _mercurial: http://mercurial.selenic.com/
 
.. _celery: http://celeryproject.org/
 
.. _rabbitmq: http://www.rabbitmq.com/
 
.. _python-ldap: http://www.python-ldap.org/
 
.. _mercurial-server: http://www.lshift.net/mercurial-server.html
 
.. _PublishingRepositories: http://mercurial.selenic.com/wiki/PublishingRepositories
 
.. _Issues tracker: https://bitbucket.org/marcinkuzminski/rhodecode/issues
 
.. _google group rhodecode: http://groups.google.com/group/rhodecode
 
\ No newline at end of file
0 comments (0 inline, 0 general)