Merge pull request #473 from midoks/dev

mysql初始安装优化
pull/475/head
Mr Chen 2 years ago committed by GitHub
commit c77efccd19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      .gitignore
  2. 4
      plugins/mariadb/index.py
  3. 3
      plugins/mysql-apt/index.py
  4. 4
      plugins/mysql-yum/index.py
  5. 4
      plugins/mysql/index.py
  6. 5
      plugins/openresty/index.py

1
.gitignore vendored

@ -158,6 +158,7 @@ data/unauthorized_status.pl
plugins/vip_*
plugins/own_*
plugins/my_*
plugins/op_auth
plugins/l2tp
plugins/openlitespeed
plugins/tamper_proof

@ -402,6 +402,8 @@ def initMariaDbPwd():
pwd + ' -e "drop database test";'
mw.execShell(drop_test_db)
pSqliteDb('config').where('id=?', (1,)).save('mysql_root', (pwd,))
# 删除冗余账户
hostname = mw.execShell('hostname')[0].strip()
if hostname != 'localhost':
@ -412,8 +414,6 @@ def initMariaDbPwd():
drop_root_hostname = serverdir + '/bin/mysql --defaults-file=' + \
myconf + ' -uroot -p' + pwd + ' -e "drop user \'root\'@\'' + hostname + '\'";'
mw.execShell(drop_root_hostname)
pSqliteDb('config').where('id=?', (1,)).save('mysql_root', (pwd,))
return True

@ -405,6 +405,8 @@ def initMysql8Pwd():
pwd + ' -e "drop database test";'
mw.execShell(drop_test_db)
pSqliteDb('config').where('id=?', (1,)).save('mysql_root', (pwd,))
# 删除冗余账户
hostname = mw.execShell('hostname')[0].strip()
if hostname != 'localhost':
@ -416,7 +418,6 @@ def initMysql8Pwd():
myconf + ' -uroot -p' + pwd + ' -e "drop user \'root\'@\'' + hostname + '\'";'
mw.execShell(drop_root_hostname)
pSqliteDb('config').where('id=?', (1,)).save('mysql_root', (pwd,))
return True

@ -394,6 +394,8 @@ def initMysql8Pwd():
pwd + ' -e "drop database test";'
mw.execShell(drop_test_db)
pSqliteDb('config').where('id=?', (1,)).save('mysql_root', (pwd,))
# 删除冗余账户
hostname = mw.execShell('hostname')[0].strip()
if hostname != 'localhost':
@ -404,8 +406,6 @@ def initMysql8Pwd():
drop_root_hostname = cmd_my + ' --defaults-file=' + \
myconf + ' -uroot -p' + pwd + ' -e "drop user \'root\'@\'' + hostname + '\'";'
mw.execShell(drop_root_hostname)
pSqliteDb('config').where('id=?', (1,)).save('mysql_root', (pwd,))
return True

@ -509,6 +509,8 @@ def initMysql8Pwd():
myconf + ' -uroot -p' + pwd + ' -e "drop database test";'
mw.execShell(drop_test_db)
pSqliteDb('config').where('id=?', (1,)).save('mysql_root', (pwd,))
# 删除冗余账户
hostname = mw.execShell('hostname')[0].strip()
if hostname != 'localhost':
@ -520,8 +522,6 @@ def initMysql8Pwd():
myconf + ' -uroot -p' + pwd + ' -e "drop user \'root\'@\'' + hostname + '\'";'
mw.execShell(drop_root_hostname)
pSqliteDb('config').where('id=?', (1,)).save('mysql_root', (pwd,))
return True

@ -86,6 +86,11 @@ def getOs():
data = {}
data['os'] = mw.getOs()
ng_exe_bin = getServerDir() + "/nginx/sbin/nginx"
if mw.isAppleSystem():
data['auth'] = True
return mw.getJson(data)
if checkAuthEq(ng_exe_bin, 'root'):
data['auth'] = True
else:

Loading…
Cancel
Save