Show More
@@ -696,10 +696,18 b' class DbManage(object):' | |||||
696 | def create_default_user(self): |
|
696 | def create_default_user(self): | |
697 | log.info('creating default user') |
|
697 | log.info('creating default user') | |
698 | # create default user for handling default permissions. |
|
698 | # create default user for handling default permissions. | |
699 |
UserModel().create_or_update(username= |
|
699 | user = UserModel().create_or_update(username=User.DEFAULT_USER, | |
700 |
password=str(uuid.uuid1())[: |
|
700 | password=str(uuid.uuid1())[:20], | |
701 | email='anonymous@rhodecode.org', |
|
701 | email='anonymous@rhodecode.org', | |
702 |
firstname='Anonymous', |
|
702 | firstname='Anonymous', | |
|
703 | lastname='User') | |||
|
704 | # based on configuration options activate/deactive this user which | |||
|
705 | # controlls anonymous access | |||
|
706 | if self.cli_args.get('public_access') is False: | |||
|
707 | log.info('Public access disabled') | |||
|
708 | user.active = False | |||
|
709 | Session().add(user) | |||
|
710 | Session().commit() | |||
703 |
|
711 | |||
704 | def create_permissions(self): |
|
712 | def create_permissions(self): | |
705 | """ |
|
713 | """ |
@@ -64,7 +64,16 b' class Command(AbstractInstallCommand):' | |||||
64 | dest='force_ask', |
|
64 | dest='force_ask', | |
65 | default=None, |
|
65 | default=None, | |
66 | help='Force no to every question') |
|
66 | help='Force no to every question') | |
67 |
|
67 | parser.add_option('--public-access', | ||
|
68 | action='store_true', | |||
|
69 | dest='public_access', | |||
|
70 | default=None, | |||
|
71 | help='Enable public access on this installation (default)') | |||
|
72 | parser.add_option('--no-public-access', | |||
|
73 | action='store_false', | |||
|
74 | dest='public_access', | |||
|
75 | default=None, | |||
|
76 | help='Disable public access on this installation ') | |||
68 | def command(self): |
|
77 | def command(self): | |
69 | config_spec = self.args[0] |
|
78 | config_spec = self.args[0] | |
70 | section = self.options.section_name |
|
79 | section = self.options.section_name |
@@ -1,6 +1,6 b'' | |||||
1 | psql -U postgres -h localhost -c 'drop database if exists rhodecode;' |
|
1 | psql -U postgres -h localhost -c 'drop database if exists rhodecode;' | |
2 | psql -U postgres -h localhost -c 'create database rhodecode;' |
|
2 | psql -U postgres -h localhost -c 'create database rhodecode;' | |
3 | paster setup-rhodecode rc.ini --force-yes --user=marcink --password=qweqwe --email=marcin@python-blog.com --repos=/home/marcink/repos |
|
3 | paster setup-rhodecode rc.ini --force-yes --user=marcink --password=qweqwe --email=marcin@python-blog.com --repos=/home/marcink/repos --no-public-access | |
4 | API_KEY=`psql -R " " -A -U postgres -h localhost -c "select api_key from users where admin=TRUE" -d rhodecode | awk '{print $2}'` |
|
4 | API_KEY=`psql -R " " -A -U postgres -h localhost -c "select api_key from users where admin=TRUE" -d rhodecode | awk '{print $2}'` | |
5 | echo "run those after running server" |
|
5 | echo "run those after running server" | |
6 | paster serve rc.ini --pid-file=rc.pid --daemon |
|
6 | paster serve rc.ini --pid-file=rc.pid --daemon |
General Comments 0
You need to be logged in to leave comments.
Login now