##// END OF EJS Templates
added password validation, second try on paster setup-app,...
marcink -
r597:53128b6b rhodecode-0.0.1.0.0rc4 default
parent child Browse files
Show More
@@ -47,26 +47,27 b' cache_dir = %(here)s/data'
47 ####################################
47 ####################################
48 ### BEAKER CACHE ####
48 ### BEAKER CACHE ####
49 ####################################
49 ####################################
50 beaker.cache.data_dir=/%(here)s/data/cache/data
50 beaker.cache.data_dir=/%(here)s/data/cache/data
51 beaker.cache.lock_dir=/%(here)s/data/cache/lock
51 beaker.cache.lock_dir=/%(here)s/data/cache/lock
52 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
52 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
53 beaker.cache.long_term.type=memory
54 beaker.cache.long_term.expire=36000
55
53
56 beaker.cache.short_term.type=memory
54 beaker.cache.super_short_term.type=memory
57 beaker.cache.short_term.expire=60
55 beaker.cache.super_short_term.expire=10
56
57 beaker.cache.short_term.type=memory
58 beaker.cache.short_term.expire=60
58
59
59 beaker.cache.super_short_term.type=memory
60 beaker.cache.long_term.type=memory
60 beaker.cache.super_short_term.expire=10
61 beaker.cache.long_term.expire=36000
61
62
62 beaker.cache.sql_cache_short.type=memory
63 beaker.cache.sql_cache_short.type=memory
63 beaker.cache.sql_cache_short.expire=5
64 beaker.cache.sql_cache_short.expire=5
64
65
65 beaker.cache.sql_cache_med.type=memory
66 beaker.cache.sql_cache_med.type=memory
66 beaker.cache.sql_cache_med.expire=360
67 beaker.cache.sql_cache_med.expire=360
67
68
68 beaker.cache.sql_cache_long.type=file
69 beaker.cache.sql_cache_long.type=file
69 beaker.cache.sql_cache_long.expire=3600
70 beaker.cache.sql_cache_long.expire=3600
70
71
71 ####################################
72 ####################################
72 ### BEAKER SESSION ####
73 ### BEAKER SESSION ####
@@ -8,6 +8,9 b' 1.0.0rc4 (**2010-10-12**)'
8 - fixed python2.5 missing simplejson imports (thanks to Jens BΓ€ckman)
8 - fixed python2.5 missing simplejson imports (thanks to Jens BΓ€ckman)
9 - removed cache_manager settings from sqlalchemy meta
9 - removed cache_manager settings from sqlalchemy meta
10 - added sqlalchemy cache settings to ini files
10 - added sqlalchemy cache settings to ini files
11 - validated password length and added second try of failure on paster setup-app
12 - fixed setup database destroy prompt even when there was no db
13
11
14
12 1.0.0rc3 (**2010-10-11**)
15 1.0.0rc3 (**2010-10-11**)
13
16
@@ -17,7 +17,7 b' Setting up the application'
17
17
18 ::
18 ::
19
19
20 paster setup-app production.ini`
20 paster setup-app production.ini
21
21
22 - This command will create all needed tables and an admin account.
22 - This command will create all needed tables and an admin account.
23 When asked for a path You can either use a new location of one with already
23 When asked for a path You can either use a new location of one with already
@@ -47,26 +47,27 b' cache_dir = %(here)s/data'
47 ####################################
47 ####################################
48 ### BEAKER CACHE ####
48 ### BEAKER CACHE ####
49 ####################################
49 ####################################
50 beaker.cache.data_dir=/%(here)s/data/cache/data
50 beaker.cache.data_dir=/%(here)s/data/cache/data
51 beaker.cache.lock_dir=/%(here)s/data/cache/lock
51 beaker.cache.lock_dir=/%(here)s/data/cache/lock
52 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
52 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
53 beaker.cache.long_term.type=memory
54 beaker.cache.long_term.expire=36000
55
53
56 beaker.cache.short_term.type=memory
54 beaker.cache.super_short_term.type=memory
57 beaker.cache.short_term.expire=60
55 beaker.cache.super_short_term.expire=10
56
57 beaker.cache.short_term.type=memory
58 beaker.cache.short_term.expire=60
58
59
59 beaker.cache.super_short_term.type=memory
60 beaker.cache.long_term.type=memory
60 beaker.cache.super_short_term.expire=10
61 beaker.cache.long_term.expire=36000
61
62
62 beaker.cache.sql_cache_short.type=memory
63 beaker.cache.sql_cache_short.type=memory
63 beaker.cache.sql_cache_short.expire=5
64 beaker.cache.sql_cache_short.expire=5
64
65
65 beaker.cache.sql_cache_med.type=memory
66 beaker.cache.sql_cache_med.type=memory
66 beaker.cache.sql_cache_med.expire=360
67 beaker.cache.sql_cache_med.expire=360
67
68
68 beaker.cache.sql_cache_long.type=file
69 beaker.cache.sql_cache_long.type=file
69 beaker.cache.sql_cache_long.expire=3600
70 beaker.cache.sql_cache_long.expire=3600
70
71
71 ####################################
72 ####################################
72 ### BEAKER SESSION ####
73 ### BEAKER SESSION ####
@@ -48,26 +48,27 b' app_instance_uuid = ${app_instance_uuid}'
48 ####################################
48 ####################################
49 ### BEAKER CACHE ####
49 ### BEAKER CACHE ####
50 ####################################
50 ####################################
51 beaker.cache.data_dir=/%(here)s/data/cache/data
51 beaker.cache.data_dir=/%(here)s/data/cache/data
52 beaker.cache.lock_dir=/%(here)s/data/cache/lock
52 beaker.cache.lock_dir=/%(here)s/data/cache/lock
53 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
53 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
54 beaker.cache.long_term.type=memory
55 beaker.cache.long_term.expire=36000
56
54
57 beaker.cache.short_term.type=memory
55 beaker.cache.super_short_term.type=memory
58 beaker.cache.short_term.expire=60
56 beaker.cache.super_short_term.expire=10
57
58 beaker.cache.short_term.type=memory
59 beaker.cache.short_term.expire=60
59
60
60 beaker.cache.super_short_term.type=memory
61 beaker.cache.long_term.type=memory
61 beaker.cache.super_short_term.expire=10
62 beaker.cache.long_term.expire=36000
62
63
63 beaker.cache.sql_cache_short.type=memory
64 beaker.cache.sql_cache_short.type=memory
64 beaker.cache.sql_cache_short.expire=5
65 beaker.cache.sql_cache_short.expire=5
65
66
66 beaker.cache.sql_cache_med.type=memory
67 beaker.cache.sql_cache_med.type=memory
67 beaker.cache.sql_cache_med.expire=360
68 beaker.cache.sql_cache_med.expire=360
68
69
69 beaker.cache.sql_cache_long.type=file
70 beaker.cache.sql_cache_long.type=file
70 beaker.cache.sql_cache_long.expire=3600
71 beaker.cache.sql_cache_long.expire=3600
71
72
72 ####################################
73 ####################################
73 ### BEAKER SESSION ####
74 ### BEAKER SESSION ####
@@ -56,7 +56,6 b' class DbManage(object):'
56 log.info('checking for existing db in %s', db_path)
56 log.info('checking for existing db in %s', db_path)
57 if os.path.isfile(db_path):
57 if os.path.isfile(db_path):
58 self.db_exists = True
58 self.db_exists = True
59 log.info('database exist')
60 if not override:
59 if not override:
61 raise Exception('database already exists')
60 raise Exception('database already exists')
62
61
@@ -65,7 +64,7 b' class DbManage(object):'
65 Create a auth database
64 Create a auth database
66 """
65 """
67 self.check_for_db(override)
66 self.check_for_db(override)
68 if override:
67 if self.db_exists:
69 log.info("database exist and it's going to be destroyed")
68 log.info("database exist and it's going to be destroyed")
70 if self.tests:
69 if self.tests:
71 destroy = True
70 destroy = True
@@ -79,15 +78,33 b' class DbManage(object):'
79 meta.Base.metadata.create_all(checkfirst=checkfirst)
78 meta.Base.metadata.create_all(checkfirst=checkfirst)
80 log.info('Created tables for %s', self.dbname)
79 log.info('Created tables for %s', self.dbname)
81
80
82 def admin_prompt(self):
81 def admin_prompt(self, second=False):
83 if not self.tests:
82 if not self.tests:
84 import getpass
83 import getpass
84
85
86 def get_password():
87 password = getpass.getpass('Specify admin password (min 6 chars):')
88 confirm = getpass.getpass('Confirm password:')
89
90 if password != confirm:
91 log.error('passwords mismatch')
92 return False
93 if len(password) < 6:
94 log.error('password is to short use at least 6 characters')
95 return False
96
97 return password
98
85 username = raw_input('Specify admin username:')
99 username = raw_input('Specify admin username:')
86 password = getpass.getpass('Specify admin password:')
100
87 confirm = getpass.getpass('Confirm password:')
101 password = get_password()
88 if password != confirm:
102 if not password:
89 log.error('passwords mismatch')
103 #second try
90 sys.exit()
104 password = get_password()
105 if not password:
106 sys.exit()
107
91 email = raw_input('Specify admin email:')
108 email = raw_input('Specify admin email:')
92 self.create_user(username, password, email, True)
109 self.create_user(username, password, email, True)
93 else:
110 else:
General Comments 0
You need to be logged in to leave comments. Login now