diff --git a/README.md b/README.md index 4ece252d9..2893c28fb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -### mdserver-web 0.9.1 +### mdserver-web 0.9.2 简单的Linux面板,感谢BT.CN写出如此好的web管理软件。我一看到,就知道这是我一直想要的页面化管理方式。 复制了后台管理界面,按照自己想要的方式写了一版。 @@ -22,6 +22,7 @@ - 吹水组 - https://t.me/mdserver_web - [兼容性测试报告](/compatibility.md) +- [常用命令说明](/cmd.md) ### 主要插件介绍 @@ -70,10 +71,10 @@ docker run -itd --name mw-server --privileged=true -p 7200:7200 -p 80:80 -p 443: ``` -### 版本更新 0.9.1 +### 版本更新 0.9.2 -* 菜单修复. -* 更新修复. +* 批量域名添加修复。 +* 常用命令说明。 ### JSDelivr安装地址 diff --git a/class/core/config_api.py b/class/core/config_api.py index 4317e45d4..e086f58a9 100755 --- a/class/core/config_api.py +++ b/class/core/config_api.py @@ -16,7 +16,7 @@ from flask import request class config_api: # mariadb 优化 - __version = '0.9.1' + __version = '0.9.2' def __init__(self): pass diff --git a/class/core/db.py b/class/core/db.py index 218fb97ac..901d0c8cd 100755 --- a/class/core/db.py +++ b/class/core/db.py @@ -171,7 +171,7 @@ class Sql(): def getField(self, keyName): # 取回指定字段 result = self.field(keyName).select() - if len(result) >= 1: + if len(result) == 1: return result[0][keyName] return result diff --git a/class/core/site_api.py b/class/core/site_api.py index ad597ada0..31ce3812b 100755 --- a/class/core/site_api.py +++ b/class/core/site_api.py @@ -878,6 +878,9 @@ class site_api: domain = request.form.get('domain', '') webname = request.form.get('webname', '') pid = request.form.get('id', '') + return self.addDomain(domain, webname, pid) + + def addDomain(self, domain, webname, pid): if len(domain) < 3: return mw.returnJson(False, '域名不能为空!') domains = domain.split(',') @@ -2184,7 +2187,7 @@ location ^~ {from} { sdomain = domain swebname = self.siteName spid = str(pid) - # self.addDomain(domain, webname, pid) + self.addDomain(domain, webname, pid) mw.M('domain').add('pid,name,port,addtime', (pid, self.siteName, self.sitePort, mw.getDate())) diff --git a/cmd.md b/cmd.md new file mode 100644 index 000000000..aebedfb93 --- /dev/null +++ b/cmd.md @@ -0,0 +1,68 @@ +### 常用命令说明 + + +- 面板相关命令 + +``` +/etc/init.d/mw default + +service mw [start|stop|reload|restart|status] +``` + +- OpenResty + +``` + +sytemctl [start|stop|reload|restart|status] openresty + +``` + +- MySQL + +``` + +sytemctl [start|stop|reload|restart|status] mysql + +``` + +- MariaDB + +``` + +sytemctl [start|stop|reload|restart|status] mariadb + +``` + +- PHP + +``` + +sytemctl [start|stop|reload|restart|status] php[54-81] + +sytemctl start php71 +``` + +- Redis + +``` + +sytemctl [start|stop|reload|restart|status] redis + +``` + +- Memcached + +``` + +sytemctl [start|stop|reload|restart|status] memcached + +``` + + +- sphinx + +``` + +sytemctl [start|stop|reload|restart|status] sphinx + +``` diff --git a/plugins/op_waf/index.py b/plugins/op_waf/index.py index c435ad7a0..2577aebec 100755 --- a/plugins/op_waf/index.py +++ b/plugins/op_waf/index.py @@ -901,8 +901,11 @@ def getWafConf(): return mw.readFile(conf) -def getWafSite(): - return '' +def installPreInspection(): + check_op = mw.getServerDir() + "/openresty" + if not os.path.exists(check_op): + return "请先安装OpenResty" + return 'ok' if __name__ == "__main__": @@ -917,6 +920,8 @@ if __name__ == "__main__": print(restart()) elif func == 'reload': print(reload()) + elif func == 'install_pre_inspection': + print(installPreInspection()) elif func == 'conf': print(getConf()) elif func == 'get_rule': diff --git a/plugins/op_waf/install.sh b/plugins/op_waf/install.sh index e4a6e9a97..481fbd07c 100755 --- a/plugins/op_waf/install.sh +++ b/plugins/op_waf/install.sh @@ -18,9 +18,13 @@ Install_of(){ echo '0.1' > $serverPath/op_waf/version.pl echo 'install ok' > $install_tmp + + cd ${rootPath} && python3 plugins/op_waf/index.py start } Uninstall_of(){ + + cd ${rootPath} && python3 plugins/op_waf/index.py stop rm -rf $serverPath/op_waf } diff --git a/plugins/openresty/index.py b/plugins/openresty/index.py index 8fe7e0386..489a2571c 100755 --- a/plugins/openresty/index.py +++ b/plugins/openresty/index.py @@ -296,6 +296,10 @@ def errorLogPath(): return getServerDir() + '/nginx/logs/error.log' +def installPreInspection(): + return 'ok' + + if __name__ == "__main__": func = sys.argv[1] if func == 'status': @@ -314,6 +318,8 @@ if __name__ == "__main__": print(initdInstall()) elif func == 'initd_uninstall': print(initdUinstall()) + elif func == 'install_pre_inspection': + print(installPreInspection()) elif func == 'conf': print(getConf()) elif func == 'get_os': diff --git a/plugins/openresty/info.json b/plugins/openresty/info.json index 606fdc769..7ec66ae27 100755 --- a/plugins/openresty/info.json +++ b/plugins/openresty/info.json @@ -5,6 +5,7 @@ "type":"其他插件", "ps":"轻量级,占有内存少,并发能力强", "shell":"install.sh", + "install_pre_inspection":true, "checks":"server/openresty", "path":"server/openresty", "author":"agentzh", diff --git a/version/info.json b/version/info.json index f6696c261..d33ce3142 100644 --- a/version/info.json +++ b/version/info.json @@ -1,9 +1,14 @@ [ + { + "version": "0.9.2", + "content": "* 批量域名添加修复。
* 常用命令说明。", + "path": "https://github.com/midoks/mdserver-web/releases/download/0.9.2/mdserver-web.zip" + }, { "version": "0.9.1", "content": "* 菜单修复。
* 更新修复", "path": "https://github.com/midoks/mdserver-web/releases/download/0.9.1/mdserver-web.zip", - "purge":"https://purge.jsdelivr.net/gh/midoks/mdserver-web@latest/scripts/update.sh", + "purge":"https://purge.jsdelivr.net/gh/midoks/mdserver-web@latest/scripts/update.sh" }, { "version": "0.9.0",