Changeset - bdc438fb4fe4
[Not reviewed]
default
0 10 0
Marcin Kuzminski - 15 years ago 2011-02-19 14:00:01
marcin@python-works.com
Fixes for release 1.1.4
Docs updates
10 files changed with 202 insertions and 93 deletions:
0 comments (0 inline, 0 general)
README.rst
Show inline comments
 
@@ -4,12 +4,14 @@ Welcome to RhodeCode (RhodiumCode) docum
 
=================================================
 

	
 
``RhodeCode`` (formerly hg-app) is Pylons framework based Mercurial repository 
 
browser/management with build in push/pull server and full text search.
 
It works on http/https, has build in permission/authentication(+ldap) features 
 
It's similar to github or bitbucket, but it's suppose to run as standalone 
 
hosted application, it's open source and focuses more on restricted access to 
 
repositories. It's powered by vcs_ library that me and Lukasz Balcerzak created 
 
to handle many various version control systems.
 
browser/management tool with build in push/pull server and full text search.
 
It works on http/https, has build in permission/authentication system with 
 
ability to auth via LDAP. It's similar in some parts to github or bitbucket, 
 
but it's suppose to run as standalone hosted application, it's open source 
 
and donation ware and focuses more on providing customized, self administered 
 
interface for Mercurial(and soon GIT) repositories. It's powered by vcs_ 
 
library that me and Lukasz Balcerzak created to handle many various version 
 
control systems.
 

	
 
RhodeCode uses `Semantic Versioning <http://semver.org/>`_
 

	
 
@@ -45,7 +47,7 @@ Features
 
- Has it's own middleware to handle mercurial_ protocol request. 
 
  Each request can be logged and authenticated. Runs on threads unlikely to 
 
  hgweb. You can make multiple pulls/pushes simultaneous. Supports http/https 
 
  and ldap
 
  and LDAP
 
- Full permissions (private/read/write/admin) and authentication per project. 
 
  One account for web interface and mercurial_ push/pull/clone operations.
 
- Mako templates let's you customize look and feel of application.
 
@@ -60,7 +62,7 @@ Features
 
  (no external search servers required all in one application)
 
- Setup project descriptions and info inside built in db for easy, non 
 
  file-system operations
 
- Inteligent cache with invalidation after push or project change, provides high 
 
- Intelligent cache with invalidation after push or project change, provides high 
 
  performance and always up to date data.    
 
- Rss / atom feeds, gravatar support, download sources as zip/tar/gz
 
- Async tasks for speed and performance using celery_ (works without them too)  
 
@@ -77,20 +79,20 @@ Incoming / Plans
 

	
 
- project grouping
 
- User groups/teams
 
- ssh based authentication with server side key management
 
- code review (probably based on hg-review)
 
- full git_ support, with push/pull server (currently in beta tests)
 
- redmine integration
 
- public accessible activity feeds
 
- commit based build in wiki system
 
- clone points and cloning from remote repositories into rhodecode 
 
  (git_ and mercurial_)
 
- clone points and cloning from remote repositories into RhodeCode
 
- more statistics and graph (global annotation + some more statistics)
 
- other cools stuff that i can figure out (or You can help me figure out)
 

	
 
License
 
-------
 

	
 
``rhodecode`` is released under GPL_ license.
 
``RhodeCode`` is released under GPL_ license.
 

	
 

	
 
Mailing group Q&A
 
@@ -112,3 +114,13 @@ Online documentation
 

	
 
   make html
 

	
 
.. _virtualenv: http://pypi.python.org/pypi/virtualenv
 
.. _python: http://www.python.org/
 
.. _django: http://www.djangoproject.com/
 
.. _mercurial: http://mercurial.selenic.com/
 
.. _subversion: http://subversion.tigris.org/
 
.. _git: http://git-scm.com/
 
.. _celery: http://celeryproject.org/
 
.. _Sphinx: http://sphinx.pocoo.org/
 
.. _GPL: http://www.gnu.org/licenses/gpl.html
 
.. _vcs: http://pypi.python.org/pypi/vcs
 
\ No newline at end of file
docs/changelog.rst
Show inline comments
 
@@ -3,6 +3,21 @@
 
Changelog
 
=========
 

	
 
1.1.4 (**2011-02-19**)
 
======================
 

	
 
news
 
----
 

	
 
fixes
 
-----
 

	
 
- fixed formencode import problem on settings page, that caused server crash
 
  when that page was accessed as first after server start
 
- journal fixes
 
- fixed option to access repository just by entering http://server/<repo_name> 
 

	
 

	
 
1.1.3 (**2011-02-16**)
 
======================
 

	
 
@@ -29,7 +44,6 @@ fixes
 
- fixed #106 relation issues on databases different than sqlite
 
- fixed static files paths links to use of url() method
 

	
 

	
 
1.1.2 (**2011-01-12**)
 
======================
 

	
docs/contributing.rst
Show inline comments
 
@@ -6,4 +6,12 @@ Contributing in RhodeCode
 
If You would like to contribute to RhodeCode, please contact me, any help is
 
greatly appreciated.
 

	
 
Preferable method Would be to fork RhodeCode repository from bitbucket
 
https://bitbucket.org/marcinkuzminski/rhodecode and then open a pull request.
 
This way it's easier for me to merge.
 

	
 
To run RhodeCode in a development version You always need to install tip
 
version of RhodeCode and VCS library.
 

	
 

	
 
Thank You.
docs/installation.rst
Show inline comments
 
@@ -22,16 +22,16 @@ Rhodecode requires python 2.x greater th
 

	
 
Easiest way to install ``rhodecode`` is to run::
 

	
 
 easy_install rhodecode
 
    easy_install rhodecode
 

	
 
Or::
 

	
 
 pip install rhodecode
 
    pip install rhodecode
 

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

	
 
   python setup.py install
 
    python setup.py install
 

	
 

	
 
Step by step installation example
 
@@ -39,32 +39,45 @@ Step by step installation example
 

	
 

	
 
- Assuming You have installed virtualenv_ create one using. 
 
  The `--no-site-packages` will make sure non of Your system libs are linked 
 
  with this virtualenv_  
 

	
 
::
 

	
 
 virtualenv --no-site-packages /var/www/rhodecode-venv
 
    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
 
    source /var/www/rhodecode-venv/bin/activate
 

	
 
.. note:: If you're on 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 
 

	
 
::
 

	
 
  mkdir /var/www/rhodecode
 
    mkdir /var/www/rhodecode
 
  
 
    
 
- Run this command to install rhodecode
 

	
 
::
 

	
 
  easy_install rhodecode 
 
    easy_install rhodecode 
 

	
 
- this will install rhodecode together with pylons
 
  and all other required python libraries
docs/setup.rst
Show inline comments
 
@@ -7,7 +7,7 @@ Setup
 
Setting up the application
 
--------------------------
 

	
 
First You'll ned to create RhodeCode config file. Run the following command 
 
First You'll need to create RhodeCode config file. Run the following command 
 
to do this
 

	
 
::
 
@@ -19,8 +19,10 @@ to do this
 
  email settings, usage of static files, cache, celery settings and logging.
 

	
 

	
 
Next we need to create the database. I'll recommend to use sqlite (default) 
 
or postgresql. Make sure You properly adjust the db url in the .ini file to use
 
other than the default sqlite database
 

	
 
Next we need to create the database.
 

	
 
::
 

	
 
@@ -35,7 +37,7 @@ Next we need to create the database.
 
  interface will work even without such an access but, when trying to do a 
 
  push it'll eventually fail with permission denied errors. 
 

	
 
You are ready to use rhodecode, to run it simply execute
 
You are ready to use RhodeCode, to run it simply execute
 

	
 
::
 
 
 
@@ -50,37 +52,64 @@ You are ready to use rhodecode, to run i
 
  anonymous, permissions settings. As well as edit more advanced options on 
 
  users and repositories
 
  
 
Using RhodeCode with SSH
 
------------------------
 

	
 
RhodeCode repository structures are kept in directories with the same name 
 
as the project, when using repository groups, each group is a a subdirectory.
 
This will allow You to use ssh for accessing repositories quite easy. There
 
are some exceptions when using ssh for accessing repositories.
 

	
 
You have to make sure that the webserver as well as the ssh users have unix
 
permission for directories. Secondly when using ssh rhodecode will not 
 
authenticate those requests and permissions set by the web interface will not
 
work on the repositories accessed via ssh. There is a solution to this to use 
 
auth hooks, that connects to rhodecode db, and runs check functions for
 
permissions.
 

	
 

	
 
if Your main directory (the same as set in RhodeCode settings) is for example 
 
set for to **/home/hg** and repository You are using is `rhodecode`
 

	
 
The command runned should look like this::
 

	
 
    hg clone ssh://user@server.com/home/hg/rhodecode
 
  
 
Using external tools such as mercurial server or using ssh key based auth is
 
fully supported.
 
    
 
Setting up Whoosh full text search
 
----------------------------------
 

	
 
Index for whoosh can be build starting from version 1.1 using paster command
 
passing repo locations to index, as well as Your config file that stores
 
whoosh index files locations. There is possible to pass `-f` to the options
 
Starting from version 1.1 whoosh index can be build using paster command.
 
You have to specify the config file that stores location of index, and
 
location of repositories (`--repo-location`).
 

	
 
There is possible also to pass `-f` to the options
 
to enable full index rebuild. Without that indexing will run always in in
 
incremental mode.
 

	
 
::
 
incremental mode::
 

	
 
 paster make-index production.ini --repo-location=<location for repos> 
 
	paster make-index production.ini --repo-location=<location for repos> 
 

	
 

	
 
for full index rebuild You can use
 

	
 
::
 
for full index rebuild You can use::
 

	
 
 paster make-index production.ini -f --repo-location=<location for repos>
 
	paster make-index production.ini -f --repo-location=<location for repos>
 

	
 
- For full text search You can either put crontab entry for
 

	
 
This command can be run even from crontab in order to do periodical 
 
index builds and keep Your index always up to date. An example entry might 
 
look like this
 
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 /path/to/rhodecode/production.ini --repo-location=<location for repos> 
 
  
 
When using incremental(default) mode whoosh will check last modification date 
 
When using incremental (default) mode whoosh will check last modification date 
 
of each file and add it to reindex if newer file is available. Also indexing 
 
daemon checks for removed files and removes them from index. 
 

	
 
@@ -93,7 +122,7 @@ Setting up LDAP support
 
-----------------------
 

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

	
 
::
 
@@ -157,6 +186,7 @@ In order to make start using celery run:
 

	
 
 paster celeryd <configfile.ini>
 

	
 

	
 
.. note::
 
   Make sure You run this command from same virtualenv, and with the same user
 
   that rhodecode runs.
 
@@ -176,21 +206,21 @@ 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;
 
    location / {
 
            root /var/www/rhodecode/rhodecode/public/;
 
            if (!-f $request_filename){
 
                proxy_pass      http://127.0.0.1:5000;
 
            }
 
            #this is important if You want to use https !!!
 
            proxy_set_header X-Url-Scheme $scheme;
 
            include         /etc/nginx/proxy.conf;  
 
    }
 
 }  
 
    server {
 
       listen          80;
 
       server_name     hg.myserver.com;
 
       access_log      /var/log/nginx/rhodecode.access.log;
 
       error_log       /var/log/nginx/rhodecode.error.log;
 
       location / {
 
               root /var/www/rhodecode/rhodecode/public/;
 
               if (!-f $request_filename){
 
                   proxy_pass      http://127.0.0.1:5000;
 
               }
 
               #this is important if You want to use https !!!
 
               proxy_set_header X-Url-Scheme $scheme;
 
               include         /etc/nginx/proxy.conf;  
 
       }
 
    }  
 
  
 
Here's the proxy.conf. It's tuned so it'll not timeout on long
 
pushes and also on large pushes::
 
@@ -207,20 +237,20 @@ pushes and also on large pushes::
 
    proxy_connect_timeout       3600;
 
    proxy_send_timeout          3600;
 
    proxy_read_timeout          3600;
 
    proxy_buffer_size           8k;
 
    proxy_buffers               8 32k;
 
    proxy_buffer_size           16k;
 
    proxy_buffers               4 16k;
 
    proxy_busy_buffers_size     64k;
 
    proxy_temp_file_write_size  64k;
 
 
 
Also when using root path with nginx You might set the static files to false
 
in production.ini file::
 

	
 
  [app:main]
 
    use = egg:rhodecode
 
    full_stack = true
 
    static_files = false
 
    lang=en
 
    cache_dir = %(here)s/data
 
    [app:main]
 
      use = egg:rhodecode
 
      full_stack = true
 
      static_files = false
 
      lang=en
 
      cache_dir = %(here)s/data
 

	
 
To not have the statics served by the application. And improve speed.
 

	
 
@@ -257,6 +287,29 @@ Additional tutorial
 
http://wiki.pylonshq.com/display/pylonscookbook/Apache+as+a+reverse+proxy+for+Pylons
 

	
 

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

	
 

	
 
Apache subdirectory part::
 

	
 
    <Location /rhodecode>
 
      ProxyPass http://127.0.0.1:59542/rhodecode
 
      ProxyPassReverse http://127.0.0.1:59542/rhodecode
 
      SetEnvIf X-Url-Scheme https HTTPS=1
 
    </Location> 
 

	
 
Besides the regular apache setup You'll need to add such part to .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> 
 

	
 

	
 
Apache's example FCGI config
 
----------------------------
 

	
 
@@ -293,10 +346,13 @@ Troubleshooting
 
 
 
 - make sure You set a proper max_body_size for the http server
 

	
 
- Apache doesn't pass basicAuth on pull/push ?
 

	
 
 - Make sure You added `WSGIPassAuthorization true` 
 

	
 
.. _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/
 
\ No newline at end of file
 
.. _rabbitmq: http://www.rabbitmq.com/
 
.. _python-ldap: http://www.python-ldap.org/
docs/upgrade.rst
Show inline comments
 
@@ -25,6 +25,11 @@ This will display any changes made from 
 
current config. And tries to do an automerge. It's always better to do a backup
 
of config file and recheck the content after merge.
 

	
 
.. note::
 
   The next steps only apply to upgrading from non bugfix releases eg. from
 
   any minor or major releases. Bugfix releases (eg. 1.1.2->1.1.3) will 
 
   not have any database schema changes or whoosh library updates
 

	
 
It's also good to rebuild the whoosh index since after upgrading the whoosh 
 
version there could be introduced incompatible index changes.
 

	
 
@@ -33,7 +38,7 @@ The last step is to upgrade the database
 

	
 
::
 

	
 
 paster upgrade-db production.ini
 
    paster upgrade-db production.ini
 
 
 
This will upgrade schema, as well as update some default on the database,
 
always recheck the settings of the application, if there are no new options
rhodecode/__init__.py
Show inline comments
 
@@ -27,7 +27,7 @@
 
# MA  02110-1301, USA.
 

	
 

	
 
VERSION = (1, 1, 3)
 
VERSION = (1, 1, 4)
 
__version__ = '.'.join((str(each) for each in VERSION[:4]))
 
__dbversion__ = 2 #defines current db version for migrations
 

	
rhodecode/config/routing.py
Show inline comments
 
@@ -164,6 +164,8 @@ def make_map(config):
 
    map.connect('raw_changeset_home', '/{repo_name:.*}/raw-changeset/{revision}',
 
                controller='changeset', action='raw_changeset', revision='tip',
 
                conditions=dict(function=check_repo))
 
    map.connect('summary_home_', '/{repo_name:.*}',
 
                controller='summary', conditions=dict(function=check_repo))
 
    map.connect('summary_home', '/{repo_name:.*}/summary',
 
                controller='summary', conditions=dict(function=check_repo))
 
    map.connect('shortlog_home', '/{repo_name:.*}/shortlog',
rhodecode/controllers/settings.py
Show inline comments
 
@@ -27,8 +27,9 @@
 

	
 
import logging
 
import traceback
 
import formencode
 

	
 
import formencode
 
from formencode import htmlfill
 

	
 
from pylons import tmpl_context as c, request, url
 
from pylons.controllers.util import redirect
 
@@ -70,7 +71,7 @@ class SettingsController(BaseController)
 
            defaults.update({'perm_%s' % p.user.username:
 
                             p.permission.permission_name})
 

	
 
        return formencode.htmlfill.render(
 
        return htmlfill.render(
 
            render('settings/repo_settings.html'),
 
            defaults=defaults,
 
            encoding="UTF-8",
 
@@ -95,7 +96,7 @@ class SettingsController(BaseController)
 
            c.repo_info = repo_model.get_by_repo_name(repo_name)
 
            c.users_array = repo_model.get_users_js()
 
            errors.value.update({'user':c.repo_info.user.username})
 
            return formencode.htmlfill.render(
 
            return htmlfill.render(
 
                render('settings/repo_settings.html'),
 
                defaults=errors.value,
 
                errors=errors.error_dict or {},
 
@@ -180,7 +181,7 @@ class SettingsController(BaseController)
 
            c.new_repo = errors.value['fork_name']
 
            r = render('settings/repo_fork.html')
 

	
 
            return formencode.htmlfill.render(
 
            return htmlfill.render(
 
                r,
 
                defaults=errors.value,
 
                errors=errors.error_dict or {},
rhodecode/lib/helpers.py
Show inline comments
 
@@ -423,30 +423,28 @@ def action_parser(user_log):
 
        action, action_params = x
 

	
 
    def get_cs_links():
 
        if action == 'push':
 
            revs_limit = 5
 
            revs = action_params.split(',')
 
            cs_links = " " + ', '.join ([link(rev,
 
                    url('changeset_home',
 
                    repo_name=user_log.repository.repo_name,
 
                    revision=rev)) for rev in revs[:revs_limit] ])
 
            if len(revs) > revs_limit:
 
                uniq_id = revs[0]
 
                html_tmpl = ('<span> %s '
 
                '<a class="show_more" id="_%s" href="#">%s</a> '
 
                '%s</span>')
 
                cs_links += html_tmpl % (_('and'), uniq_id, _('%s more') \
 
                                            % (len(revs) - revs_limit),
 
                                            _('revisions'))
 
        revs_limit = 5
 
        revs = action_params.split(',')
 
        cs_links = " " + ', '.join ([link(rev,
 
                url('changeset_home',
 
                repo_name=user_log.repository.repo_name,
 
                revision=rev)) for rev in revs[:revs_limit] ])
 
        if len(revs) > revs_limit:
 
            uniq_id = revs[0]
 
            html_tmpl = ('<span> %s '
 
            '<a class="show_more" id="_%s" href="#">%s</a> '
 
            '%s</span>')
 
            cs_links += html_tmpl % (_('and'), uniq_id, _('%s more') \
 
                                        % (len(revs) - revs_limit),
 
                                        _('revisions'))
 

	
 
                html_tmpl = '<span id="%s" style="display:none"> %s </span>'
 
                cs_links += html_tmpl % (uniq_id, ', '.join([link(rev,
 
                    url('changeset_home',
 
                    repo_name=user_log.repository.repo_name,
 
                    revision=rev)) for rev in revs[revs_limit:] ]))
 
            html_tmpl = '<span id="%s" style="display:none"> %s </span>'
 
            cs_links += html_tmpl % (uniq_id, ', '.join([link(rev,
 
                url('changeset_home',
 
                repo_name=user_log.repository.repo_name,
 
                revision=rev)) for rev in revs[revs_limit:] ]))
 

	
 
            return cs_links
 
        return ''
 
        return cs_links
 

	
 
    def get_fork_name():
 
        repo_name = action_params
 
@@ -455,14 +453,14 @@ def action_parser(user_log):
 

	
 
    map = {'user_deleted_repo':(_('[deleted] repository'), None),
 
           'user_created_repo':(_('[created] repository'), None),
 
           'user_forked_repo':(_('[forked] repository'), get_fork_name),
 
           'user_forked_repo':(_('[forked] repository as'), get_fork_name),
 
           'user_updated_repo':(_('[updated] repository'), None),
 
           'admin_deleted_repo':(_('[delete] repository'), None),
 
           'admin_created_repo':(_('[created] repository'), None),
 
           'admin_forked_repo':(_('[forked] repository'), None),
 
           'admin_updated_repo':(_('[updated] repository'), None),
 
           'push':(_('[pushed] into'), get_cs_links),
 
           'pull':(_('[pulled] from'), None),
 
           'push':(_('[pushed] '), get_cs_links),
 
           'pull':(_('[pulled] '), None),
 
           'started_following_repo':(_('[started following] repository'), None),
 
           'stopped_following_repo':(_('[stopped following] repository'), None),
 
            }
0 comments (0 inline, 0 general)