Changeset - f99075170eb4
[Not reviewed]
README.rst
Show inline comments
 
-------------------------------------
 
Pylons based replacement for hgwebdir
 
-------------------------------------
 
--------------------------------------------------------------
 
Pylons based repository management for mercurial (and soon git)
 
--------------------------------------------------------------
 

	
 
Fully customizable, with authentication, permissions. Based on vcs library.
 

	
 
**Overview**
 

	
 
- has it's own middleware to handle mercurial protocol request each request can 
 
  be logged and authenticated + threaded performance unlikely to hgweb
 
- full permissions per project read/write/admin access even on mercurial request
 
- mako templates let's you customize look and feel of application.
 
- diffs annotations and source code all colored by pygments.
 
- mercurial branch graph and yui-flot powered graphs with zooming and statistics
 
- admin interface for performing user/permission managements as well as repository
 
  management. 
 
  management.
 
- server side forks, it's possible to fork a project and hack it free without
 
  breaking the main.   
 
- full text search of source codes with indexing daemons using whoosh
 
  (no external search servers required all in one application)
 
- async tasks for speed and performance using celery (works without them too)  
 
- Additional settings for mercurial web, (hooks editable from admin
 
  panel !) also manage paths, archive, remote messages  
 
- backup scripts can do backup of whole app and send it over scp to desired location
 
@@ -29,33 +31,32 @@ Fully customizable, with authentication,
 

	
 
**Incoming**
 

	
 
- code review based on hg-review (when it's stable)
 
- git support (when vcs can handle it - almost there !)
 
- commit based wikis
 
- in server forks
 
- clonning from remote repositories into hg-app 
 
- clonning from remote repositories into rhodecode (git/mercurial)
 
- other cools stuff that i can figure out (or You can help me figure out)
 

	
 
.. note::
 
   This software is still in beta mode. 
 
   I don't guarantee that it'll work correctly.
 
   
 

	
 
-------------
 
Installation
 
-------------
 

	
 
- I highly recommend to install new virtualenv for hg-app see 
 
- I highly recommend to install new virtualenv for rhodecode see 
 
  http://pypi.python.org/pypi/virtualenv
 
- Create new virtualenv using `virtualenv --no-site-packages /var/www/hgapp-venv`
 
  this will install new virtual env into /var/www/hgapp-venv. 
 
- Create new virtualenv using `virtualenv --no-site-packages /var/www/rhodecode-venv`
 
  this will install new virtual env into /var/www/rhodecode-venv. 
 
  Activate the virtualenv by running 
 
  `source activate /var/www/hgapp-venv/bin/activate`   
 
- Make a folder for hg-app somewhere on the filesystem for example /var/www/hgapp  
 
- Download and extract http://bitbucket.org/marcinkuzminski/hg-app/get/tip.zip
 
  `source activate /var/www/rhodecode-venv/bin/activate`   
 
- Make a folder for rhodecode somewhere on the filesystem for example /var/www/rhodecode  
 
- Download and extract http://bitbucket.org/marcinkuzminski/rhodecode/get/tip.zip
 
  into created directory.
 
- Run `python setup.py install` in order to install the application and all
 
  needed dependencies. Make sure that You're using activated virutalenv  
 
- Run `paster setup-app production.ini` it should create all needed tables 
 
  and an admin account make sure You specify correct path to repositories. 
 
- Remember that the given path for mercurial repositories must be write 
 
@@ -63,19 +64,19 @@ Installation
 
- Run paster serve development.ini - or you can use sample init.d scripts.
 
  the app should be available at the 127.0.0.1:5000
 
- Use admin account you created to login.
 
- Default permissions on each repository is read, and owner is admin. So remember
 
  to update these.
 
- In order to use full power of async tasks, You must install message broker
 
  preferably rabbitmq and start celeryd daemon together with hg-app. 
 
  preferably rabbitmq and start celeryd daemon together with rhodecode. 
 
  The app should gain a lot of speed and become much more responsible. 
 
  For installation instructions You can visit: 
 
  http://ask.github.com/celery/getting-started/index.html. 
 
- All needed configs are inside hg-app ie. celeryconfig.py , production.ini
 
- All needed configs are inside rhodecode ie. celeryconfig.py , production.ini
 
  You can configure the email, ports, loggers, workers from there.
 
- For full text search You can either put crontab entry for 
 
  `python /var/www/hgapp/rhodecode/lib/indexers/daemon.py incremental <path_to_repos>`
 
  `python /var/www/rhodecode/rhodecode/lib/indexers/daemon.py incremental <path_to_repos>`
 
  or run indexer from admin panel. This will scann the repos given in the 
 
  application setup or given path for daemon.py and each scann in incremental 
 
  mode will scann only changed files, 
 
  Hg Update hook must be activated to index the content it's enabled by default
 
  after setup
 
\ No newline at end of file
development.ini
Show inline comments
 
################################################################################
 
################################################################################
 
# hg-app - Pylons environment configuration                                    #
 
# rhodecode - Pylons environment configuration                                    #
 
#                                                                              # 
 
# The %(here)s variable will be replaced with the parent directory of this file#
 
################################################################################
 

	
 
[DEFAULT]
 
debug = true
 
################################################################################
 
## Uncomment and replace with the address which should receive                ## 
 
## any error reports after application crash								  ##
 
## Additionally those settings will be used by hg-app mailing system          ##
 
## Additionally those settings will be used by rhodecode mailing system          ##
 
################################################################################
 
#email_to = admin@localhost
 
#error_email_from = paste_error@localhost
 
#app_email_from = hg-app-noreply@localhost
 
#app_email_from = rhodecode-noreply@localhost
 
#error_message =
 

	
 
#smtp_server = mail.server.com
 
#smtp_username = 
 
#smtp_password =
 
#smtp_port = 
 
@@ -63,13 +63,13 @@ beaker.cache.super_short_term.expire=10
 
## Type of storage used for the session, current types are 
 
## "dbm", "file", "memcached", "database", and "memory". 
 
## The storage uses the Container API 
 
##that is also used by the cache system.
 
beaker.session.type = file
 

	
 
beaker.session.key = hg-app
 
beaker.session.key = rhodecode
 
beaker.session.secret = g654dcno0-9873jhgfreyu
 
beaker.session.timeout = 36000
 

	
 
##auto save the session to not to use .save()
 
beaker.session.auto = False
 

	
init.d/rhodecode_daemon
Show inline comments
 
file renamed from init.d/hg_app_daemon to init.d/rhodecode_daemon
init.d/rhodecode_daemon2
Show inline comments
 
file renamed from init.d/hg_app_daemon2 to init.d/rhodecode_daemon2
 
#!/bin/sh -e
 
########################################
 
#### THIS IS AN DEBIAN INIT.D SCRIPT####
 
########################################
 

	
 
### BEGIN INIT INFO
 
# Provides:          hg-app          
 
# Provides:          rhodecode          
 
# Required-Start:    $all
 
# Required-Stop:     $all
 
# Default-Start:     2 3 4 5
 
# Default-Stop:      0 1 6
 
# Short-Description: starts instance of hg-app
 
# Description:       starts instance of hg-app using start-stop-daemon
 
# Short-Description: starts instance of rhodecode
 
# Description:       starts instance of rhodecode using start-stop-daemon
 
### END INIT INFO
 

	
 
APP_NAME="rhodecode"
 
APP_HOMEDIR="marcink/python_workspace"
 
APP_PATH="/home/$APP_HOMEDIR/$APP_NAME"
 

	
production.ini
Show inline comments
 
################################################################################
 
################################################################################
 
# hg-app - Pylons environment configuration                                    #
 
# rhodecode - Pylons environment configuration                                    #
 
#                                                                              # 
 
# The %(here)s variable will be replaced with the parent directory of this file#
 
################################################################################
 

	
 
[DEFAULT]
 
debug = true
 
################################################################################
 
## Uncomment and replace with the address which should receive                ## 
 
## any error reports after application crash								  ##
 
## Additionally those settings will be used by hg-app mailing system          ##
 
## Additionally those settings will be used by rhodecode mailing system          ##
 
################################################################################
 
#email_to = admin@localhost
 
#error_email_from = paste_error@localhost
 
#app_email_from = hg-app-noreply@localhost
 
#app_email_from = rhodecode-noreply@localhost
 
#error_message =
 

	
 
#smtp_server = mail.server.com
 
#smtp_username = 
 
#smtp_password = 
 
#smtp_port = 
 
@@ -63,13 +63,13 @@ beaker.cache.super_short_term.expire=10
 
## Type of storage used for the session, current types are 
 
## dbm, file, memcached, database, and memory. 
 
## The storage uses the Container API 
 
##that is also used by the cache system.
 
beaker.session.type = file
 

	
 
beaker.session.key = hg-app
 
beaker.session.key = rhodecode
 
beaker.session.secret = g654dcno0-9873jhgfreyu
 
beaker.session.timeout = 36000
 

	
 
##auto save the session to not to use .save()
 
beaker.session.auto = False
 

	
rhodecode/config/deployment.ini_tmpl
Show inline comments
 
################################################################################
 
################################################################################
 
# hg-app - Pylons environment configuration                                    #
 
# rhodecode - Pylons environment configuration                                    #
 
#                                                                              # 
 
# The %(here)s variable will be replaced with the parent directory of this file#
 
################################################################################
 

	
 
[DEFAULT]
 
debug = true
 
################################################################################
 
## Uncomment and replace with the address which should receive                ## 
 
## any error reports after application crash								  ##
 
## Additionally those settings will be used by hg-app mailing system          ##
 
## Additionally those settings will be used by rhodecode mailing system          ##
 
################################################################################
 
#email_to = admin@localhost
 
#error_email_from = paste_error@localhost
 
#app_email_from = hg-app-noreply@localhost
 
#app_email_from = rhodecode-noreply@localhost
 
#error_message =
 

	
 
#smtp_server = mail.server.com
 
#smtp_username = 
 
#smtp_password = 
 
#smtp_port = 
 
@@ -64,13 +64,13 @@ beaker.cache.super_short_term.expire=10
 
## Type of storage used for the session, current types are 
 
## dbm, file, memcached, database, and memory. 
 
## The storage uses the Container API 
 
##that is also used by the cache system.
 
beaker.session.type = file
 

	
 
beaker.session.key = hg-app
 
beaker.session.key = rhodecode
 
beaker.session.secret = ${app_instance_secret}
 
beaker.session.timeout = 36000
 

	
 
##auto save the session to not to use .save()
 
beaker.session.auto = False
 

	
rhodecode/controllers/admin/settings.py
Show inline comments
 
@@ -30,13 +30,13 @@ from pylons.i18n.translation import _
 
from rhodecode.lib import helpers as h
 
from rhodecode.lib.auth import LoginRequired, HasPermissionAllDecorator, \
 
    HasPermissionAnyDecorator
 
from rhodecode.lib.base import BaseController, render
 
from rhodecode.lib.utils import repo2db_mapper, invalidate_cache, \
 
    set_rhodecode_config, get_hg_settings, get_hg_ui_settings, make_ui
 
from rhodecode.model.db import User, UserLog, HgAppSettings, HgAppUi
 
from rhodecode.model.db import User, UserLog, RhodeCodeSettings, RhodeCodeUi
 
from rhodecode.model.forms import UserForm, ApplicationSettingsForm, \
 
    ApplicationUiSettingsForm
 
from rhodecode.model.hg_model import HgModel
 
from rhodecode.model.user_model import UserModel
 
from rhodecode.lib.celerylib import tasks, run_task
 
import formencode
 
@@ -113,18 +113,18 @@ class SettingsController(BaseController)
 
            
 
            application_form = ApplicationSettingsForm()()
 
            try:
 
                form_result = application_form.to_python(dict(request.POST))
 
            
 
                try:
 
                    hgsettings1 = self.sa.query(HgAppSettings)\
 
                    .filter(HgAppSettings.app_settings_name == 'title').one()
 
                    hgsettings1 = self.sa.query(RhodeCodeSettings)\
 
                    .filter(RhodeCodeSettings.app_settings_name == 'title').one()
 
                    hgsettings1.app_settings_value = form_result['rhodecode_title'] 
 
                    
 
                    hgsettings2 = self.sa.query(HgAppSettings)\
 
                    .filter(HgAppSettings.app_settings_name == 'realm').one()
 
                    hgsettings2 = self.sa.query(RhodeCodeSettings)\
 
                    .filter(RhodeCodeSettings.app_settings_name == 'realm').one()
 
                    hgsettings2.app_settings_value = form_result['rhodecode_realm'] 
 
                    
 
                    
 
                    self.sa.add(hgsettings1)
 
                    self.sa.add(hgsettings2)
 
                    self.sa.commit()
 
@@ -152,28 +152,28 @@ class SettingsController(BaseController)
 
            application_form = ApplicationUiSettingsForm()()
 
            try:
 
                form_result = application_form.to_python(dict(request.POST))
 
            
 
                try:
 
                    
 
                    hgsettings1 = self.sa.query(HgAppUi)\
 
                    .filter(HgAppUi.ui_key == 'push_ssl').one()
 
                    hgsettings1 = self.sa.query(RhodeCodeUi)\
 
                    .filter(RhodeCodeUi.ui_key == 'push_ssl').one()
 
                    hgsettings1.ui_value = form_result['web_push_ssl']
 
                    
 
                    hgsettings2 = self.sa.query(HgAppUi)\
 
                    .filter(HgAppUi.ui_key == '/').one()
 
                    hgsettings2 = self.sa.query(RhodeCodeUi)\
 
                    .filter(RhodeCodeUi.ui_key == '/').one()
 
                    hgsettings2.ui_value = form_result['paths_root_path']                    
 
                    
 
                    
 
                    #HOOKS
 
                    hgsettings3 = self.sa.query(HgAppUi)\
 
                    .filter(HgAppUi.ui_key == 'changegroup.update').one()
 
                    hgsettings3 = self.sa.query(RhodeCodeUi)\
 
                    .filter(RhodeCodeUi.ui_key == 'changegroup.update').one()
 
                    hgsettings3.ui_active = bool(form_result['hooks_changegroup_update'])  
 
                    
 
                    hgsettings4 = self.sa.query(HgAppUi)\
 
                    .filter(HgAppUi.ui_key == 'changegroup.repo_size').one()
 
                    hgsettings4 = self.sa.query(RhodeCodeUi)\
 
                    .filter(RhodeCodeUi.ui_key == 'changegroup.repo_size').one()
 
                    hgsettings4.ui_active = bool(form_result['hooks_changegroup_repo_size'])                                          
 
                    
 
                    
 
                    
 
                    
 
                    self.sa.add(hgsettings1)
rhodecode/controllers/login.py
Show inline comments
 
@@ -98,13 +98,13 @@ class LoginController(BaseController):
 
                
 
            register_form = RegisterForm()()
 
            try:
 
                form_result = register_form.to_python(dict(request.POST))
 
                form_result['active'] = c.auto_active
 
                user_model.create_registration(form_result)
 
                h.flash(_('You have successfully registered into hg-app'),
 
                h.flash(_('You have successfully registered into rhodecode'),
 
                            category='success')                
 
                return redirect(url('login_home'))
 
                               
 
            except formencode.Invalid as errors:
 
                return htmlfill.render(
 
                    render('/register.html'),
rhodecode/lib/celerylib/tasks.py
Show inline comments
 
@@ -20,32 +20,32 @@ def get_session():
 
    from sqlalchemy.orm import sessionmaker, scoped_session
 
    engine = engine_from_config(dict(config.items('app:main')), 'sqlalchemy.db1.')
 
    sa = scoped_session(sessionmaker(bind=engine))
 
    return sa
 

	
 
def get_hg_settings():
 
    from rhodecode.model.db import HgAppSettings
 
    from rhodecode.model.db import RhodeCodeSettings
 
    try:
 
        sa = get_session()
 
        ret = sa.query(HgAppSettings).all()
 
        ret = sa.query(RhodeCodeSettings).all()
 
    finally:
 
        sa.remove()
 
        
 
    if not ret:
 
        raise Exception('Could not get application settings !')
 
    settings = {}
 
    for each in ret:
 
        settings['rhodecode_' + each.app_settings_name] = each.app_settings_value    
 
    
 
    return settings
 

	
 
def get_hg_ui_settings():
 
    from rhodecode.model.db import HgAppUi
 
    from rhodecode.model.db import RhodeCodeUi
 
    try:
 
        sa = get_session()
 
        ret = sa.query(HgAppUi).all()
 
        ret = sa.query(RhodeCodeUi).all()
 
    finally:
 
        sa.remove()
 
        
 
    if not ret:
 
        raise Exception('Could not get application ui settings !')
 
    settings = {}
 
@@ -236,14 +236,14 @@ def reset_user_password(user_email):
 
            
 
        except:
 
            log.error(traceback.format_exc())
 
            sa.rollback()
 
        
 
        run_task(send_email, user_email,
 
                 "Your new hg-app password",
 
                 'Your new hg-app password:%s' % (new_passwd))
 
                 "Your new rhodecode password",
 
                 'Your new rhodecode password:%s' % (new_passwd))
 
        log.info('send new password mail to %s', user_email)
 
        
 
        
 
    except:
 
        log.error('Failed to update user password')
 
        log.error(traceback.format_exc())
rhodecode/lib/db_manage.py
Show inline comments
 
@@ -31,13 +31,13 @@ import uuid
 
ROOT = dn(dn(dn(os.path.realpath(__file__))))
 
sys.path.append(ROOT)
 

	
 
from rhodecode.lib.auth import get_crypt_password
 
from rhodecode.lib.utils import ask_ok
 
from rhodecode.model import init_model
 
from rhodecode.model.db import User, Permission, HgAppUi, HgAppSettings, \
 
from rhodecode.model.db import User, Permission, RhodeCodeUi, RhodeCodeSettings, \
 
    UserToPerm
 
from rhodecode.model import meta
 
from sqlalchemy.engine import create_engine
 
import logging
 

	
 
log = logging.getLogger(__name__)
 
@@ -104,56 +104,56 @@ class DbManage(object):
 
            path = test_repo_path
 
            
 
        if not os.path.isdir(path):
 
            log.error('You entered wrong path: %s', path)
 
            sys.exit()
 
        
 
        hooks1 = HgAppUi()
 
        hooks1 = RhodeCodeUi()
 
        hooks1.ui_section = 'hooks'
 
        hooks1.ui_key = 'changegroup.update'
 
        hooks1.ui_value = 'hg update >&2'
 
        
 
        hooks2 = HgAppUi()
 
        hooks2 = RhodeCodeUi()
 
        hooks2.ui_section = 'hooks'
 
        hooks2.ui_key = 'changegroup.repo_size'
 
        hooks2.ui_value = 'python:rhodecode.lib.hooks.repo_size' 
 
                
 
        web1 = HgAppUi()
 
        web1 = RhodeCodeUi()
 
        web1.ui_section = 'web'
 
        web1.ui_key = 'push_ssl'
 
        web1.ui_value = 'false'
 
                
 
        web2 = HgAppUi()
 
        web2 = RhodeCodeUi()
 
        web2.ui_section = 'web'
 
        web2.ui_key = 'allow_archive'
 
        web2.ui_value = 'gz zip bz2'
 
                
 
        web3 = HgAppUi()
 
        web3 = RhodeCodeUi()
 
        web3.ui_section = 'web'
 
        web3.ui_key = 'allow_push'
 
        web3.ui_value = '*'
 
        
 
        web4 = HgAppUi()
 
        web4 = RhodeCodeUi()
 
        web4.ui_section = 'web'
 
        web4.ui_key = 'baseurl'
 
        web4.ui_value = '/'                        
 
        
 
        paths = HgAppUi()
 
        paths = RhodeCodeUi()
 
        paths.ui_section = 'paths'
 
        paths.ui_key = '/'
 
        paths.ui_value = os.path.join(path, '*')
 
        
 
        
 
        hgsettings1 = HgAppSettings()
 
        hgsettings1 = RhodeCodeSettings()
 
        
 
        hgsettings1.app_settings_name = 'realm'
 
        hgsettings1.app_settings_value = 'hg-app authentication'
 
        hgsettings1.app_settings_value = 'rhodecode authentication'
 
        
 
        hgsettings2 = HgAppSettings()
 
        hgsettings2 = RhodeCodeSettings()
 
        hgsettings2.app_settings_name = 'title'
 
        hgsettings2.app_settings_value = 'hg-app'      
 
        hgsettings2.app_settings_value = 'rhodecode'      
 
        
 
        try:
 
            self.sa.add(hooks1)
 
            self.sa.add(hooks2)
 
            self.sa.add(web1)
 
            self.sa.add(web2)
 
@@ -212,14 +212,14 @@ class DbManage(object):
 
                 ('repository.write', 'Repository write access'),
 
                 ('repository.admin', 'Repository admin access'),
 
                 ('hg.admin', 'Hg Administrator'),
 
                 ('hg.create.repository', 'Repository create'),
 
                 ('hg.create.none', 'Repository creation disabled'),
 
                 ('hg.register.none', 'Register disabled'),
 
                 ('hg.register.manual_activate', 'Register new user with hg-app without manual activation'),
 
                 ('hg.register.auto_activate', 'Register new user with hg-app without auto activation'),
 
                 ('hg.register.manual_activate', 'Register new user with rhodecode without manual activation'),
 
                 ('hg.register.auto_activate', 'Register new user with rhodecode without auto activation'),
 
                ]
 
        
 
        for p in perms:
 
            new_perm = Permission()
 
            new_perm.permission_name = p[0]
 
            new_perm.permission_longname = p[1]
rhodecode/lib/indexers/daemon.py
Show inline comments
 
#!/usr/bin/env python
 
# encoding: utf-8
 
# whoosh indexer daemon for hg-app
 
# whoosh indexer daemon for rhodecode
 
# Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
 
#
 
# This program is free software; you can redistribute it and/or
 
# modify it under the terms of the GNU General Public License
 
# as published by the Free Software Foundation; version 2
 
# of the License or (at your opinion) any later version of the license.
rhodecode/lib/middleware/simplehg.py
Show inline comments
 
@@ -126,13 +126,13 @@ class SimpleHg(object):
 
            return HTTPInternalServerError()(environ, start_response)
 
        
 
        #invalidate cache on push
 
        if action == 'push':
 
            self.__invalidate_cache(repo_name)
 
            messages = []
 
            messages.append('thank you for using hg-app')
 
            messages.append('thank you for using rhodecode')
 
        
 
            return self.msg_wrapper(app, environ, start_response, messages)
 
        else:
 
            return app(environ, start_response)           
 

	
 

	
rhodecode/lib/utils.py
Show inline comments
 
@@ -23,13 +23,13 @@ Utilities for hg app
 
@author: marcink
 
"""
 
from beaker.cache import cache_region
 
from mercurial import ui, config, hg
 
from mercurial.error import RepoError
 
from rhodecode.model import meta
 
from rhodecode.model.db import Repository, User, HgAppUi, HgAppSettings, UserLog
 
from rhodecode.model.db import Repository, User, RhodeCodeUi, RhodeCodeSettings, UserLog
 
from vcs.backends.base import BaseChangeset
 
from vcs.utils.lazy import LazyProperty
 
import logging
 
import datetime
 
import os
 

	
 
@@ -124,22 +124,22 @@ def ask_ok(prompt, retries=4, complaint=
 
        print complaint
 
        
 
@cache_region('super_short_term', 'cached_hg_ui')
 
def get_hg_ui_cached():
 
    try:
 
        sa = meta.Session
 
        ret = sa.query(HgAppUi).all()
 
        ret = sa.query(RhodeCodeUi).all()
 
    finally:
 
        meta.Session.remove()
 
    return ret
 

	
 

	
 
def get_hg_settings():
 
    try:
 
        sa = meta.Session
 
        ret = sa.query(HgAppSettings).all()
 
        ret = sa.query(RhodeCodeSettings).all()
 
    finally:
 
        meta.Session.remove()
 
        
 
    if not ret:
 
        raise Exception('Could not get application settings !')
 
    settings = {}
 
@@ -148,13 +148,13 @@ def get_hg_settings():
 
    
 
    return settings
 

	
 
def get_hg_ui_settings():
 
    try:
 
        sa = meta.Session
 
        ret = sa.query(HgAppUi).all()
 
        ret = sa.query(RhodeCodeUi).all()
 
    finally:
 
        meta.Session.remove()
 
        
 
    if not ret:
 
        raise Exception('Could not get application ui settings !')
 
    settings = {}
rhodecode/model/db.py
Show inline comments
 
@@ -4,20 +4,20 @@ from sqlalchemy.orm import relation, bac
 
from sqlalchemy.orm.session import Session
 
from vcs.utils.lazy import LazyProperty
 
import logging
 

	
 
log = logging.getLogger(__name__)
 

	
 
class HgAppSettings(Base):
 
class RhodeCodeSettings(Base):
 
    __tablename__ = 'rhodecode_settings'
 
    __table_args__ = (UniqueConstraint('app_settings_name'), {'useexisting':True})
 
    app_settings_id = Column("app_settings_id", INTEGER(), nullable=False, unique=True, default=None, primary_key=True)
 
    app_settings_name = Column("app_settings_name", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
 
    app_settings_value = Column("app_settings_value", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
 

	
 
class HgAppUi(Base):
 
class RhodeCodeUi(Base):
 
    __tablename__ = 'rhodecode_ui'
 
    __table_args__ = {'useexisting':True}
 
    ui_id = Column("ui_id", INTEGER(), nullable=False, unique=True, default=None, primary_key=True)
 
    ui_section = Column("ui_section", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
 
    ui_key = Column("ui_key", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
 
    ui_value = Column("ui_value", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
rhodecode/templates/login.html
Show inline comments
 
## -*- coding: utf-8 -*-
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" id="mainhtml">
 
    <head>
 
        <title>${_('Sign In to hg-app')}</title>
 
        <title>${_('Sign In to rhodecode')}</title>
 
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
 
        <link rel="icon" href="/images/hgicon.png" type="image/png" />
 
        <meta name="robots" content="index, nofollow"/>
 
            
 
        <!-- stylesheets -->
 
        <link rel="stylesheet" type="text/css" href="/css/reset.css" />
 
@@ -16,13 +16,13 @@
 

	
 
    </head>
 
    <body>
 
<div id="login">
 
            <!-- login -->
 
            <div class="title">
 
                <h5>${_('Sign In to hg-app')}</h5>
 
                <h5>${_('Sign In to rhodecode')}</h5>
 
                <div class="corner tl"></div>
 
                <div class="corner tr"></div>
 
            </div>
 
            <div class="inner">            
 
                ${h.form(h.url.current(came_from=c.came_from))}
 
                <div class="form">
rhodecode/templates/password_reset.html
Show inline comments
 
## -*- coding: utf-8 -*-
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" id="mainhtml">
 
    <head>
 
        <title>${_('Reset You password to hg-app')}</title>
 
        <title>${_('Reset You password to rhodecode')}</title>
 
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
 
        <link rel="icon" href="/images/hgicon.png" type="image/png" />
 
        <meta name="robots" content="index, nofollow"/>
 
            
 
        <!-- stylesheets -->
 
        <link rel="stylesheet" type="text/css" href="/css/reset.css" />
 
@@ -16,13 +16,13 @@
 

	
 
    </head>
 
    <body>
 
		<div id="register">
 
			
 
			<div class="title">
 
				<h5>${_('Reset You password to hg-app')}</h5>
 
				<h5>${_('Reset You password to rhodecode')}</h5>
 
                <div class="corner tl"></div>
 
                <div class="corner tr"></div>				
 
			</div>
 
			<div class="inner">
 
			    ${h.form(url('password_reset'))}
 
			    <div class="form">
rhodecode/templates/register.html
Show inline comments
 
## -*- coding: utf-8 -*-
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" id="mainhtml">
 
    <head>
 
        <title>${_('Sign Up to hg-app')}</title>
 
        <title>${_('Sign Up to rhodecode')}</title>
 
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
 
        <link rel="icon" href="/images/hgicon.png" type="image/png" />
 
        <meta name="robots" content="index, nofollow"/>
 
            
 
        <!-- stylesheets -->
 
        <link rel="stylesheet" type="text/css" href="/css/reset.css" />
 
@@ -16,13 +16,13 @@
 

	
 
    </head>
 
    <body>
 
		<div id="register">
 
			
 
			<div class="title">
 
				<h5>${_('Sign Up to hg-app')}</h5>
 
				<h5>${_('Sign Up to rhodecode')}</h5>
 
                <div class="corner tl"></div>
 
                <div class="corner tr"></div>				
 
			</div>
 
			<div class="inner">
 
			    ${h.form(url('register'))}
 
			    <div class="form">
rhodecode/tests/functional/test_login.py
Show inline comments
 
@@ -59,13 +59,13 @@ class TestLoginController(TestController
 
        assert 'invalid user name' in response.body, 'No error username message in response'
 
        assert 'invalid password' in response.body, 'No error password message in response'
 
                
 
        
 
    def test_register(self):
 
        response = self.app.get(url(controller='login', action='register'))
 
        assert 'Sign Up to hg-app' in response.body, 'wrong page for user registration'
 
        assert 'Sign Up to rhodecode' in response.body, 'wrong page for user registration'
 
        
 
    def test_register_err_same_username(self):
 
        response = self.app.post(url(controller='login', action='register'),
 
                                            {'username':'test_admin',
 
                                             'password':'test',
 
                                             'email':'goodmail@domain.com',
 
@@ -101,13 +101,13 @@ class TestLoginController(TestController
 
                                             'password':password,
 
                                             'email':email,
 
                                             'name':name,
 
                                             'lastname':lastname})
 
        print response.body
 
        assert response.status == '302 Found', 'Wrong response from register page got %s' % response.status        
 
        assert 'You have successfully registered into hg-app' in response.session['flash'][0], 'No flash message about user registration'
 
        assert 'You have successfully registered into rhodecode' in response.session['flash'][0], 'No flash message about user registration'
 
        
 
        ret = self.sa.query(User).filter(User.username == 'test_regular4').one()
 
        assert ret.username == username , 'field mismatch %s %s' % (ret.username, username)
 
        assert check_password(password, ret.password) == True , 'password mismatch'
 
        assert ret.email == email , 'field mismatch %s %s' % (ret.email, email)
 
        assert ret.name == name , 'field mismatch %s %s' % (ret.name, name)
 
@@ -137,11 +137,11 @@ class TestLoginController(TestController
 
                                             'name':name,
 
                                             'lastname':lastname})        
 
        #register new user for email test
 
        response = self.app.post(url(controller='login', action='password_reset'),
 
                                            {'email':email, })
 
        print response.session['flash']
 
        assert 'You have successfully registered into hg-app' in response.session['flash'][0], 'No flash message about user registration'
 
        assert 'You have successfully registered into rhodecode' in response.session['flash'][0], 'No flash message about user registration'
 
        assert 'Your new password was sent' in response.session['flash'][1], 'No flash message about password reset'
 
        
 
        
 
        
setup.py
Show inline comments
 
@@ -4,16 +4,16 @@ try:
 
except ImportError:
 
    from ez_setup import use_setuptools
 
    use_setuptools()
 
    from setuptools import setup, find_packages
 

	
 
setup(
 
    name='HgApp-%s' % get_version(),
 
    name='RhodeCode-%s' % get_version(),
 
    version=get_version(),
 
    description='Mercurial repository serving and browsing app',
 
    keywords='mercurial web hgwebdir replacement serving hgweb',
 
    keywords='mercurial web hgwebdir replacement serving hgweb rhodecode',
 
    license='BSD',
 
    author='marcin kuzminski',
 
    author_email='marcin@python-works.com',
 
    url='http://hg.python-works.com',
 
    install_requires=[
 
        "Pylons>=1.0.0",
test.ini
Show inline comments
 
################################################################################
 
################################################################################
 
# hg-app - Pylons environment configuration                                    #
 
# rhodecode - Pylons environment configuration                                    #
 
#                                                                              # 
 
# The %(here)s variable will be replaced with the parent directory of this file#
 
################################################################################
 

	
 
[DEFAULT]
 
debug = true
 
################################################################################
 
## Uncomment and replace with the address which should receive                ## 
 
## any error reports after application crash								  ##
 
## Additionally those settings will be used by hg-app mailing system          ##
 
## Additionally those settings will be used by rhodecode mailing system          ##
 
################################################################################
 
#email_to = admin@localhost
 
#error_email_from = paste_error@localhost
 
#app_email_from = hg-app-noreply@localhost
 
#app_email_from = rhodecode-noreply@localhost
 
#error_message =
 

	
 
#smtp_server = mail.server.com
 
#smtp_username = 
 
#smtp_password = 
 
#smtp_port = 
 
@@ -63,13 +63,13 @@ beaker.cache.super_short_term.expire=10
 
## Type of storage used for the session, current types are 
 
## "dbm", "file", "memcached", "database", and "memory". 
 
## The storage uses the Container API 
 
##that is also used by the cache system.
 
beaker.session.type = file
 

	
 
beaker.session.key = hg-app
 
beaker.session.key = rhodecode
 
beaker.session.secret = g654dcno0-9873jhgfreyu
 
beaker.session.timeout = 36000
 

	
 
##auto save the session to not to use .save()
 
beaker.session.auto = False
 

	
0 comments (0 inline, 0 general)