fix install bug

pull/26/head
ibuler 2015-12-18 18:35:07 +08:00
parent 1fc86733ba
commit 0715e11c05
2 changed files with 14 additions and 11 deletions

View File

@ -14,7 +14,7 @@ os.environ['DJANGO_SETTINGS_MODULE'] = 'jumpserver.settings'
if django.get_version() != '1.6':
setup = django.setup()
from juser.user_api import db_add_user, server_add_user
from juser.user_api import db_add_user, get_object, User
from install import color_print
@ -25,7 +25,7 @@ class Setup(object):
def __init__(self):
self.admin_user = 'admin'
self.admin_pass = 'Lov@wife'
self.admin_pass = '5Lov@wife'
def _input_admin(self):
while True:
@ -54,18 +54,22 @@ class Setup(object):
execute_from_command_line(['manage.py', 'syncdb', '--noinput'])
def _create_admin(self):
user = get_object(User, username=self.admin_user)
if user:
user.delete()
db_add_user(username=self.admin_user, password=self.admin_pass, role='SU', name='admin', groups='',
admin_groups='', email='admin@jumpserver.org', uuid='MayBeYouAreTheFirstUser', is_active=True)
os.system('id %s || useradd %s' % (self.admin_user, self.admin_user))
os.system('id %s &> /dev/null || useradd %s' % (self.admin_user, self.admin_user))
@staticmethod
def _cp_zzsh():
os.chdir(jms_dir)
os.chdir(os.path.join(jms_dir, 'install'))
shutil.copy('zzjumpserver.sh', '/etc/profile.d/')
@staticmethod
def _run_service():
os.system('sh %s start' % os.path.join(jms_dir, 'service.sh'))
print
color_print('安装成功请访问web .')
def start(self):

View File

@ -1,7 +1,5 @@
#coding: utf8
[base]
url = http://j
url = http://192.168.244.129
key = 88aaaf7ffe3c6c04
log = debug
@ -13,12 +11,13 @@ password = mysql234
database = jumpserver
[websocket]
web_socket_host = j:3000
web_socket_host = 192.168.244.129:3000
[mail]
mail_enable = 1
email_host = smtp.exmail.qq.com
email_host = smtp.qq.com
email_port = 25
email_host_user = noreply@jumpserver.org
email_host_password = jumpserver1234
email_host_user = ibuler@qq.com
email_host_password = Hudie117...qq
email_use_tls = True