pull/26/head
wangyong 2015-12-19 22:49:46 +08:00
commit 0d5fa418af
3 changed files with 26 additions and 23 deletions

View File

@ -36,7 +36,7 @@ Web批量执行命令
### 特点
* 完全开源GPL授权
* 完全开源GPL授权
* Python编写容易再次开发
* 实现了跳板机基本功能,认证、授权、审计
* 集成了Ansible批量命令等
@ -52,6 +52,8 @@ Web批量执行命令
[Jumpserver官网](http://www.jumpserver.org)
[论坛](http://bbs.jumpserver.org)
[demo站点](http://demo.jumpserver.org)
### 团队

View File

@ -64,7 +64,7 @@ class PreSetup(object):
self.db_host = '127.0.0.1'
self.db_port = 3306
self.db_user = 'jumpserver'
self.db_pass = 'mysql234'
self.db_pass = '5Lov@wife'
self.db = 'jumpserver'
self.mail_host = 'smtp.qq.com'
self.mail_port = 25
@ -93,6 +93,7 @@ class PreSetup(object):
def _setup_mysql(self):
color_print('开始安装设置mysql (请手动设置mysql安全)', 'green')
color_print('默认用户名: %s 密码密码: %s' % (self.db_user, self.db_pass), 'green')
bash('yum -y install mysql-server')
bash('service mysqld start')
bash('mysql -e "create database %s default charset=utf8"' % self.db)
@ -151,22 +152,21 @@ class PreSetup(object):
def _input_mysql(self):
while True:
db_host = raw_input('请输入数据库服务器IP [127.0.0.1]: ')
db_port = raw_input('请输入数据库服务器端口 [3306]: ')
db_user = raw_input('请输入数据库服务器用户 [root]: ')
db_pass = raw_input('请输入数据库服务器密码: ')
db = raw_input('请输入使用的数据库 [jumpserver]: ')
if db_host: self.db_host = db_host
if db_port: self.db_port = db_port
if db_user: self.db_user = db_user
if db_pass: self.db_pass = db_pass
if db: self.db = db
mysql = raw_input('是否使用已经存在的数据库服务器? (y/n) [n]: ')
if mysql != 'y':
self._setup_mysql()
else:
db_host = raw_input('请输入数据库服务器IP [127.0.0.1]: ')
db_port = raw_input('请输入数据库服务器端口 [3306]: ')
db_user = raw_input('请输入数据库服务器用户 [root]: ')
db_pass = raw_input('请输入数据库服务器密码: ')
db = raw_input('请输入使用的数据库 [jumpserver]: ')
if db_host: self.db_host = db_host
if db_port: self.db_port = db_port
if db_user: self.db_user = db_user
if db_pass: self.db_pass = db_pass
if db: self.db = db
if self._test_db_conn():
break
@ -176,10 +176,12 @@ class PreSetup(object):
def _input_smtp(self):
while True:
self.mail_host = raw_input('请输入SMTP地址: ').strip()
self.mail_port = int(raw_input('请输入SMTP端口: ').strip())
mail_port = int(raw_input('请输入SMTP端口 [25]: ').strip())
self.mail_addr = raw_input('请输入账户: ').strip()
self.mail_pass = raw_input('请输入密码: ').strip()
if mail_port: self.mail_port = mail_port
if self._test_mail():
color_print('\n\t请登陆邮箱查收邮件, 然后确认是否继续安装\n', 'green')
smtp = raw_input('是否继续? (y/n) [y]: ')
@ -192,17 +194,16 @@ class PreSetup(object):
@staticmethod
def _pull():
color_print('开始更新jumpserver', 'green')
bash('git pull')
# bash('git pull')
os.chdir(jms_dir)
os.chmod('logs', 0777)
os.chmod('keys', 0777)
def start(self):
self._rpm_repo()
self._depend_rpm()
self._require_pip()
# self._rpm_repo()
# self._depend_rpm()
# self._require_pip()
self._set_env()
self._pull()
self._input_ip()
self._input_mysql()
self._input_smtp()

View File

@ -17,7 +17,7 @@ web_socket_host = 192.168.244.129:3000
mail_enable = 1
email_host = smtp.qq.com
email_port = 25
email_host_user = ibuler@qq.com
email_host_password = Hudie117...qq
email_host_user = xxxxxxxx@qq.com
email_host_password = xxxxxx
email_use_tls = True