Skip to content

Commit

Permalink
Merge pull request #185 from midoks/dev
Browse files Browse the repository at this point in the history
0.9.9
  • Loading branch information
midoks authored Sep 9, 2022
2 parents 1517d8d + becb7f8 commit 4b71d6b
Show file tree
Hide file tree
Showing 37 changed files with 601 additions and 184 deletions.
44 changes: 39 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
### mdserver-web 0.9.7
<p align="center">
<img alt="logo" src="https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/route/static/logo.png" height="140" />
<h3 align="center">mdserver-web</h3>
<p align="center">一款简单Linux面板服务</p>
</p>

### 简介

简单的Linux面板,感谢BT.CN写出如此好的web管理软件。我一看到,就知道这是我一直想要的页面化管理方式。
复制了后台管理界面,按照自己想要的方式写了一版。
Expand Down Expand Up @@ -61,6 +67,15 @@ PHP[53-72]支持phpMyAdmin[4.4.15]
PHP[72-81]支持phpMyAdmin[5.2.0]
```

# AD - VPS推荐 - 🙏

- [ZZZ评测](https://www.zzzvps.com/)

| 服务商 | LOGO | 推广地址 | 优惠码 |
| ------------- |----------|-----------|-------|
| digitalvirt |[![digitalvirt](https://digitalvirt.com/templates/BlueWhite/img/logo-dark.svg)](https://digitalvirt.com/aff.php?aff=154) | https://digitalvirt.com/aff.php?aff=154 | 9SYDY7UH0U |
| 搬瓦工 |[![搬瓦工](https://bwh81.net/templates/organicbandwagon/images/logo.png)](https://bandwagonhost.com/aff.php?aff=54161) | https://bandwagonhost.com/aff.php?aff=54161 | BWH3HYATVBJW |

# Docker

-[DDSRem](https://github.com/DDSRem)开发维护。
Expand All @@ -71,10 +86,19 @@ docker run -itd --name mw-server --privileged=true -p 7200:7200 -p 80:80 -p 443:
```


### 版本更新 0.9.7
### 版本更新 0.9.9

* 更换Logo。
* 增加amazon linux系统支持。
* 修复rsyncd在debian或ubuntu下安装失败问题。
* Readme加入一AD。
* PHP-YUM|PHP-APT优化[性能调整]
* 优化Gogs使用MySQL的方式。
* 配置模板添加一个whmcs。
* MySQL和MariaDB无法直接卸载。
* OpenResty加入http_realip_module模块。
* PHP加入igbinary扩展。

* haproxy插件添加.
* 细节优化.

### JSDelivr安装地址

Expand Down Expand Up @@ -120,9 +144,19 @@ curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/qu
```
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/install_dev.sh | bash
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh | bash
curl -fsSL https://gitee.com/midoks/mdserver-web/raw/master/scripts/install_dev.sh | bash
curl -fsSL https://gitee.com/midoks/mdserver-web/raw/master/scripts/update_dev.sh | bash
```

### 捐赠地址 USDT(TRC20)

TVbNgrpeGBGZVm5gTLa21ADP7RpnPFhjya


### 微信赞助

[![截图](https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/route/static/img/weixin_zz.jpg)](https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/route/static/img/weixin_zz.jpg)


Expand All @@ -138,7 +172,7 @@ curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/up

### 感谢开发赞助

[![digitalvirt](https://digitalvirt.com/templates/BlueWhite/img/logo-dark.svg)](https://digitalvirt.com/)
[![digitalvirt](https://digitalvirt.com/templates/BlueWhite/img/logo-dark.svg)](https://digitalvirt.com/aff.php?aff=154)

### 授权许可

Expand Down
2 changes: 1 addition & 1 deletion class/core/config_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

class config_api:

__version = '0.9.7'
__version = '0.9.9'

def __init__(self):
pass
Expand Down
2 changes: 1 addition & 1 deletion class/core/site_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ def setCertToSiteApi(self):
certName = request.form.get('certName', '')
siteName = request.form.get('siteName', '')
try:
path = self.sslDir + siteName
path = self.sslDir + siteName.strip()
if not os.path.exists(path):
return mw.returnJson(False, '证书不存在!')

Expand Down
3 changes: 3 additions & 0 deletions class/plugin/orm.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ def setCharset(self, charset):
def setPort(self, port):
self.__DB_PORT = port

def setUser(self, user):
self.__DB_USER = user

def setPwd(self, pwd):
self.__DB_PASS = pwd

Expand Down
6 changes: 6 additions & 0 deletions class/plugin/ormDb.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ def setPwd(self, pwd):
def getPwd(self):
return self.__DB_PASS

def setDbName(self, name):
self.__DB_NAME = name

def setUser(self, user):
self.__DB_USER = user

def execute(self, sql):
# 执行SQL语句返回受影响行
if not self.__Conn():
Expand Down
91 changes: 0 additions & 91 deletions plugins/gogs/class/mysqlDb.py

This file was deleted.

24 changes: 12 additions & 12 deletions plugins/gogs/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ def getPluginName():
def getPluginDir():
return mw.getPluginDir() + '/' + getPluginName()

sys.path.append(getPluginDir() + "/class")
import mysqlDb


def getServerDir():
return mw.getServerDir() + '/' + getPluginName()
Expand Down Expand Up @@ -235,16 +232,19 @@ def getDbConfValue():


def pMysqlDb(conf):

host = conf['HOST'].split(':')
conn = mysqlDb.mysqlDb()
# pymysql
db = mw.getMyORM()
# MySQLdb |
# db = mw.getMyORMDb()

conn.setHost(host[0])
conn.setUser(conf['USER'])
conn.setPwd(conf['PASSWD'])
conn.setPort(int(host[1]))
conn.setDb(conf['NAME'])
return conn
db.setPort(int(host[1]))
db.setUser(conf['USER'])
db.setPwd(conf['PASSWD'])
db.setDbName(conf['NAME'])
# db.setSocket(getSocketFile())
db.setCharset("utf8")
return db


def pSqliteDb(conf):
Expand Down Expand Up @@ -476,7 +476,7 @@ def userList():

start = (page - 1) * page_size
list_count = pQuery('select count(id) as num from user')
count = list_count[0][0]
count = list_count[0]["num"]
list_data = pQuery(
'select id,name,email from user order by id desc limit ' + str(start) + ',' + str(page_size))
data['list'] = mw.getPage({'count': count, 'p': page,
Expand Down
2 changes: 2 additions & 0 deletions plugins/gogs/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ getBit(){

Install_gogs()
{
pip3 install mysqlclient

mkdir -p $serverPath/source/gogs

echo '正在安装脚本文件...' > $install_tmp
Expand Down
8 changes: 4 additions & 4 deletions plugins/gogs/js/gogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,11 @@ function gogsUserList(page, search) {

ulist = rdata['data']['data'];
for (i in ulist){
email = ulist[i][2] == '' ? '无' : ulist[i][2];
content += '<tr><td>'+ulist[i][0]+'</td>'+
'<td>'+ulist[i][1]+'</td>'+
email = ulist[i]["email"] == '' ? '无' : ulist[i]["email"];
content += '<tr><td>'+ulist[i]["id"]+'</td>'+
'<td>'+ulist[i]["name"]+'</td>'+
'<td>'+email+'</td>'+
'<td><a class="btlink" onclick="userProjectList(\''+ulist[i][1]+'\')">项目管理</a></td>'+
'<td><a class="btlink" onclick="userProjectList(\''+ulist[i]["name"]+'\')">项目管理</a></td>'+
'</tr>';
}

Expand Down
7 changes: 5 additions & 2 deletions plugins/mariadb/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -2180,8 +2180,11 @@ def installPreInspection(version):


def uninstallPreInspection(version):
# return "请手动删除MySQL[{}]".format(version)
return 'ok'
stop(version)
if mw.isDebugMode():
return 'ok'

return "请手动删除MariaDB[{}]<br/> rm -rf {}".format(version, getServerDir())

if __name__ == "__main__":
func = sys.argv[1]
Expand Down
7 changes: 5 additions & 2 deletions plugins/mysql/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -2338,8 +2338,11 @@ def installPreInspection(version):


def uninstallPreInspection(version):
# return "请手动删除MySQL[{}]".format(version)
return 'ok'
stop(version)
if mw.isDebugMode():
return 'ok'

return "请手动删除MySQL[{}]<br/> rm -rf {}".format(version, getServerDir())

if __name__ == "__main__":
func = sys.argv[1]
Expand Down
4 changes: 3 additions & 1 deletion plugins/openresty/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,12 @@ Install_openresty()
# --with-openssl=$serverPath/source/lib/openssl-1.0.2q
cd ${openrestyDir}/openresty-${VERSION} && ./configure \
--prefix=$serverPath/openresty \
--with-ipv6 \
--with-http_v2_module \
--with-http_ssl_module \
--with-http_slice_module \
--with-http_stub_status_module
--with-http_stub_status_module \
--with-http_realip_module

make -j${cpuCore} && make install && make clean

Expand Down
6 changes: 3 additions & 3 deletions plugins/php-apt/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,8 @@ def setFpmConfig(version):
max_spare_servers = args['max_spare_servers']
pm = args['pm']

file = getServerDir() + '/php' + version + '/php-fpm.d/www.conf'
conf = mw.readFile(file)
filefpm = getFpmConfFile(version)
conf = mw.readFile(filefpm)

rep = "\s*pm.max_children\s*=\s*([0-9]+)\s*"
conf = re.sub(rep, "\npm.max_children = " + max_children, conf)
Expand All @@ -437,7 +437,7 @@ def setFpmConfig(version):
rep = "\s*pm\s*=\s*(\w+)\s*"
conf = re.sub(rep, "\npm = " + pm + "\n", conf)

mw.writeFile(file, conf)
mw.writeFile(filefpm, conf)
reload(version)

msg = mw.getInfo('设置PHP-{1}并发设置,max_children={2},start_servers={3},min_spare_servers={4},max_spare_servers={5}',
Expand Down
20 changes: 20 additions & 0 deletions plugins/php-apt/versions/phplib.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
{
"name": "pdo",
"versions": [
"56",
"70",
"71",
"72",
"73",
"74",
"80",
"81",
Expand All @@ -16,6 +21,11 @@
"name": "mysqlnd",
"versions": [
"56",
"70",
"71",
"72",
"73",
"74",
"80",
"81",
"82"
Expand All @@ -29,6 +39,11 @@
"name": "sqlite3",
"versions": [
"56",
"70",
"71",
"72",
"73",
"74",
"80",
"81",
"82"
Expand All @@ -50,6 +65,11 @@
"name": "odbc",
"versions": [
"56",
"70",
"71",
"72",
"73",
"74",
"80",
"81",
"82"
Expand Down
Loading

0 comments on commit 4b71d6b

Please sign in to comment.