mirror of https://github.com/jumpserver/jumpserver
fix install bug
parent
1fc86733ba
commit
0715e11c05
|
@ -14,7 +14,7 @@ os.environ['DJANGO_SETTINGS_MODULE'] = 'jumpserver.settings'
|
||||||
if django.get_version() != '1.6':
|
if django.get_version() != '1.6':
|
||||||
setup = django.setup()
|
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
|
from install import color_print
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ class Setup(object):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.admin_user = 'admin'
|
self.admin_user = 'admin'
|
||||||
self.admin_pass = 'Lov@wife'
|
self.admin_pass = '5Lov@wife'
|
||||||
|
|
||||||
def _input_admin(self):
|
def _input_admin(self):
|
||||||
while True:
|
while True:
|
||||||
|
@ -54,18 +54,22 @@ class Setup(object):
|
||||||
execute_from_command_line(['manage.py', 'syncdb', '--noinput'])
|
execute_from_command_line(['manage.py', 'syncdb', '--noinput'])
|
||||||
|
|
||||||
def _create_admin(self):
|
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='',
|
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)
|
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
|
@staticmethod
|
||||||
def _cp_zzsh():
|
def _cp_zzsh():
|
||||||
os.chdir(jms_dir)
|
os.chdir(os.path.join(jms_dir, 'install'))
|
||||||
shutil.copy('zzjumpserver.sh', '/etc/profile.d/')
|
shutil.copy('zzjumpserver.sh', '/etc/profile.d/')
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _run_service():
|
def _run_service():
|
||||||
os.system('sh %s start' % os.path.join(jms_dir, 'service.sh'))
|
os.system('sh %s start' % os.path.join(jms_dir, 'service.sh'))
|
||||||
|
print
|
||||||
color_print('安装成功,请访问web .')
|
color_print('安装成功,请访问web .')
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
#coding: utf8
|
|
||||||
|
|
||||||
[base]
|
[base]
|
||||||
url = http://j
|
url = http://192.168.244.129
|
||||||
key = 88aaaf7ffe3c6c04
|
key = 88aaaf7ffe3c6c04
|
||||||
log = debug
|
log = debug
|
||||||
|
|
||||||
|
@ -13,12 +11,13 @@ password = mysql234
|
||||||
database = jumpserver
|
database = jumpserver
|
||||||
|
|
||||||
[websocket]
|
[websocket]
|
||||||
web_socket_host = j:3000
|
web_socket_host = 192.168.244.129:3000
|
||||||
|
|
||||||
[mail]
|
[mail]
|
||||||
mail_enable = 1
|
mail_enable = 1
|
||||||
email_host = smtp.exmail.qq.com
|
email_host = smtp.qq.com
|
||||||
email_port = 25
|
email_port = 25
|
||||||
email_host_user = noreply@jumpserver.org
|
email_host_user = ibuler@qq.com
|
||||||
email_host_password = jumpserver1234
|
email_host_password = Hudie117...qq
|
||||||
email_use_tls = True
|
email_use_tls = True
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue