Changeset - 53128b6b9a4d
[Not reviewed]
Marcin Kuzminski - 15 years ago 2010-10-12 23:17:25
marcin@python-works.com
added password validation, second try on paster setup-app,
docs update, and fixed beaker cache settings in ini files.
6 files changed with 86 insertions and 63 deletions:
0 comments (0 inline, 0 general)
development.ini
Show inline comments
 
@@ -44,32 +44,33 @@ static_files = true
 
lang=en
 
cache_dir = %(here)s/data
 

	
 
####################################
 
###         BEAKER CACHE        ####
 
####################################
 
 beaker.cache.data_dir=/%(here)s/data/cache/data
 
 beaker.cache.lock_dir=/%(here)s/data/cache/lock
 
 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
 
 beaker.cache.long_term.type=memory
 
 beaker.cache.long_term.expire=36000
 
beaker.cache.data_dir=/%(here)s/data/cache/data
 
beaker.cache.lock_dir=/%(here)s/data/cache/lock
 
beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
 

	
 
 beaker.cache.short_term.type=memory
 
 beaker.cache.short_term.expire=60
 
beaker.cache.super_short_term.type=memory
 
beaker.cache.super_short_term.expire=10
 

	
 
beaker.cache.short_term.type=memory
 
beaker.cache.short_term.expire=60
 

	
 
 beaker.cache.super_short_term.type=memory
 
 beaker.cache.super_short_term.expire=10
 
 
 
 beaker.cache.sql_cache_short.type=memory
 
 beaker.cache.sql_cache_short.expire=5
 
 
 
 beaker.cache.sql_cache_med.type=memory
 
 beaker.cache.sql_cache_med.expire=360
 
 
 
 beaker.cache.sql_cache_long.type=file
 
 beaker.cache.sql_cache_long.expire=3600
 
beaker.cache.long_term.type=memory
 
beaker.cache.long_term.expire=36000
 

	
 
beaker.cache.sql_cache_short.type=memory
 
beaker.cache.sql_cache_short.expire=5
 

	
 
beaker.cache.sql_cache_med.type=memory
 
beaker.cache.sql_cache_med.expire=360
 

	
 
beaker.cache.sql_cache_long.type=file
 
beaker.cache.sql_cache_long.expire=3600
 

	
 
####################################
 
###       BEAKER SESSION        ####
 
####################################
 
## Type of storage used for the session, current types are 
 
## "dbm", "file", "memcached", "database", and "memory". 
docs/changelog.rst
Show inline comments
 
@@ -5,12 +5,15 @@ Changelog
 

	
 
1.0.0rc4  (**2010-10-12**)
 

	
 
- fixed python2.5 missing simplejson imports (thanks to Jens Bäckman)
 
- removed cache_manager settings from sqlalchemy meta
 
- added sqlalchemy cache settings to ini files
 
- validated password length and added second try of failure on paster setup-app
 
- fixed setup database destroy prompt even when there was no db
 

	
 

	
 
1.0.0rc3 (**2010-10-11**)
 

	
 
- fixed i18n during installation.
 

	
 
1.0.0rc2 (**2010-10-11**)
docs/setup.rst
Show inline comments
 
@@ -14,13 +14,13 @@ Setting up the application
 
- This will create `production.ini` config inside the directory
 
  this config contain various settings for rhodecode, e.g port, email settings
 
  static files, cache and logging.
 

	
 
::
 

	
 
 paster setup-app production.ini` 
 
 paster setup-app production.ini
 

	
 
- This command will create all needed tables and an admin account. 
 
  When asked for a path You can either use a new location of one with already 
 
  existing ones. RhodeCode will simply add all new found repositories to 
 
  it's database. Also make sure You specify correct path to repositories.
 
- Remember that the given path for mercurial_ repositories must be write 
production.ini
Show inline comments
 
@@ -44,32 +44,33 @@ static_files = false
 
lang=en
 
cache_dir = %(here)s/data
 

	
 
####################################
 
###         BEAKER CACHE        ####
 
####################################
 
 beaker.cache.data_dir=/%(here)s/data/cache/data
 
 beaker.cache.lock_dir=/%(here)s/data/cache/lock
 
 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
 
 beaker.cache.long_term.type=memory
 
 beaker.cache.long_term.expire=36000
 
beaker.cache.data_dir=/%(here)s/data/cache/data
 
beaker.cache.lock_dir=/%(here)s/data/cache/lock
 
beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
 

	
 
 beaker.cache.short_term.type=memory
 
 beaker.cache.short_term.expire=60
 
beaker.cache.super_short_term.type=memory
 
beaker.cache.super_short_term.expire=10
 

	
 
beaker.cache.short_term.type=memory
 
beaker.cache.short_term.expire=60
 

	
 
 beaker.cache.super_short_term.type=memory
 
 beaker.cache.super_short_term.expire=10
 
 
 
 beaker.cache.sql_cache_short.type=memory
 
 beaker.cache.sql_cache_short.expire=5
 
 
 
 beaker.cache.sql_cache_med.type=memory
 
 beaker.cache.sql_cache_med.expire=360
 
 
 
 beaker.cache.sql_cache_long.type=file
 
 beaker.cache.sql_cache_long.expire=3600
 
beaker.cache.long_term.type=memory
 
beaker.cache.long_term.expire=36000
 

	
 
beaker.cache.sql_cache_short.type=memory
 
beaker.cache.sql_cache_short.expire=5
 

	
 
beaker.cache.sql_cache_med.type=memory
 
beaker.cache.sql_cache_med.expire=360
 

	
 
beaker.cache.sql_cache_long.type=file
 
beaker.cache.sql_cache_long.expire=3600
 

	
 
####################################
 
###       BEAKER SESSION        ####
 
####################################
 
## Type of storage used for the session, current types are 
 
## "dbm", "file", "memcached", "database", and "memory".
rhodecode/config/deployment.ini_tmpl
Show inline comments
 
@@ -45,32 +45,33 @@ lang=en
 
cache_dir = %(here)s/data
 
app_instance_uuid = ${app_instance_uuid}
 

	
 
####################################
 
###         BEAKER CACHE        ####
 
####################################
 
 beaker.cache.data_dir=/%(here)s/data/cache/data
 
 beaker.cache.lock_dir=/%(here)s/data/cache/lock
 
 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
 
 beaker.cache.long_term.type=memory
 
 beaker.cache.long_term.expire=36000
 
beaker.cache.data_dir=/%(here)s/data/cache/data
 
beaker.cache.lock_dir=/%(here)s/data/cache/lock
 
beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
 

	
 
 beaker.cache.short_term.type=memory
 
 beaker.cache.short_term.expire=60
 
beaker.cache.super_short_term.type=memory
 
beaker.cache.super_short_term.expire=10
 

	
 
beaker.cache.short_term.type=memory
 
beaker.cache.short_term.expire=60
 

	
 
 beaker.cache.super_short_term.type=memory
 
 beaker.cache.super_short_term.expire=10
 
 
 
 beaker.cache.sql_cache_short.type=memory
 
 beaker.cache.sql_cache_short.expire=5
 
 
 
 beaker.cache.sql_cache_med.type=memory
 
 beaker.cache.sql_cache_med.expire=360
 
 
 
 beaker.cache.sql_cache_long.type=file
 
 beaker.cache.sql_cache_long.expire=3600
 
beaker.cache.long_term.type=memory
 
beaker.cache.long_term.expire=36000
 

	
 
beaker.cache.sql_cache_short.type=memory
 
beaker.cache.sql_cache_short.expire=5
 

	
 
beaker.cache.sql_cache_med.type=memory
 
beaker.cache.sql_cache_med.expire=360
 

	
 
beaker.cache.sql_cache_long.type=file
 
beaker.cache.sql_cache_long.expire=3600
 

	
 
####################################
 
###       BEAKER SESSION        ####
 
####################################
 
## Type of storage used for the session, current types are 
 
## "dbm", "file", "memcached", "database", and "memory".
rhodecode/lib/db_manage.py
Show inline comments
 
@@ -53,22 +53,21 @@ class DbManage(object):
 
    
 
    def check_for_db(self, override):
 
        db_path = jn(self.root, self.dbname)
 
        log.info('checking for existing db in %s', db_path)
 
        if os.path.isfile(db_path):
 
            self.db_exists = True
 
            log.info('database exist')
 
            if not override:
 
                raise Exception('database already exists')
 

	
 
    def create_tables(self, override=False):
 
        """
 
        Create a auth database
 
        """
 
        self.check_for_db(override)
 
        if override:
 
        if self.db_exists:
 
            log.info("database exist and it's going to be destroyed")
 
            if self.tests:
 
                destroy = True
 
            else:
 
                destroy = ask_ok('Are you sure to destroy old database ? [y/n]')
 
            if not destroy:
 
@@ -76,21 +75,39 @@ class DbManage(object):
 
            if self.db_exists and destroy:
 
                os.remove(jn(self.root, self.dbname))
 
        checkfirst = not override
 
        meta.Base.metadata.create_all(checkfirst=checkfirst)
 
        log.info('Created tables for %s', self.dbname)
 
    
 
    def admin_prompt(self):
 
    def admin_prompt(self, second=False):
 
        if not self.tests:
 
            import getpass
 
            
 
            
 
            def get_password():
 
                password = getpass.getpass('Specify admin password (min 6 chars):')
 
                confirm = getpass.getpass('Confirm password:')
 
            
 
                if password != confirm:
 
                    log.error('passwords mismatch')
 
                    return False
 
                if len(password) < 6:
 
                    log.error('password is to short use at least 6 characters')
 
                    return False
 
                                
 
                return password
 
            
 
            username = raw_input('Specify admin username:')
 
            password = getpass.getpass('Specify admin password:')
 
            confirm = getpass.getpass('Confirm password:')
 
            if password != confirm:
 
                log.error('passwords mismatch')
 
                sys.exit()
 
            
 
            password = get_password()
 
            if not password:
 
                #second try
 
                password = get_password()
 
                if not password:
 
                    sys.exit()
 
                
 
            email = raw_input('Specify admin email:')
 
            self.create_user(username, password, email, True)
 
        else:
 
            log.info('creating admin and regular test users')
 
            self.create_user('test_admin', 'test12', 'test_admin@mail.com', True)
 
            self.create_user('test_regular', 'test12', 'test_regular@mail.com', False)
0 comments (0 inline, 0 general)