pull/561/head
Mr Chen 1 year ago
parent c4bc66e410
commit 6702fb94a0
  1. 1
      plugins/mongodb/config/mongodb.conf
  2. 4
      plugins/mongodb/index.py

@ -7,7 +7,6 @@ processManagement:
security: security:
authorization: disabled authorization: disabled
javascriptEnabled: false javascriptEnabled: false
keyFile: {$SERVER_PATH}/mongodb/mongodb.key
storage: storage:
dbPath: {$SERVER_PATH}/mongodb/data dbPath: {$SERVER_PATH}/mongodb/data
directoryPerDB: true directoryPerDB: true

@ -190,8 +190,6 @@ def mongdbClient():
port = getConfPort() port = getConfPort()
auth = getConfAuth() auth = getConfAuth()
mg_root = pSqliteDb('config').where('id=?', (1,)).getField('mg_root') mg_root = pSqliteDb('config').where('id=?', (1,)).getField('mg_root')
# print(auth)
if auth == 'disabled': if auth == 'disabled':
client = pymongo.MongoClient(host='127.0.0.1', port=int(port), directConnection=True) client = pymongo.MongoClient(host='127.0.0.1', port=int(port), directConnection=True)
else: else:
@ -406,11 +404,13 @@ def setConfigAuth():
d = getConfigData() d = getConfigData()
if d['security']['authorization'] == 'enabled': if d['security']['authorization'] == 'enabled':
d['security']['authorization'] = 'disabled' d['security']['authorization'] = 'disabled'
del d['security']['keyFile']
setConfig(d) setConfig(d)
restart() restart()
return mw.returnJson(True,'关闭成功') return mw.returnJson(True,'关闭成功')
else: else:
d['security']['authorization'] = 'enabled' d['security']['authorization'] = 'enabled'
d['security']['keyFile'] = getServerDir()+'/mongodb.key'
setConfig(d) setConfig(d)
restart() restart()
return mw.returnJson(True,'开启成功') return mw.returnJson(True,'开启成功')

Loading…
Cancel
Save