mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 02:09:26 +08:00
@@ -2,6 +2,7 @@
|
||||
<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 align="center">强烈推荐系统:debian</p>
|
||||
</p>
|
||||
|
||||
### 简介
|
||||
@@ -10,10 +11,11 @@
|
||||
复制了后台管理界面,按照自己想要的方式写了一版。
|
||||
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
|
||||
[](https://github.com/midoks/mdserver-web/wiki)
|
||||
[](https://www.jsdelivr.com/package/gh/midoks/mdserver-web)
|
||||
@@ -90,14 +92,12 @@ docker run -itd --name mw-server --privileged=true -p 7200:7200 -p 80:80 -p 443:
|
||||
```
|
||||
|
||||
|
||||
### 版本更新 0.11.3
|
||||
### 版本更新 0.11.4
|
||||
|
||||
* 域名绑定修改。
|
||||
* 面板ssl配置加入。
|
||||
* 文件搜索优化。
|
||||
* php加入phalcon。
|
||||
* 文件管理UI优化。
|
||||
* phpmyadmin优化。
|
||||
* PHP82正式释出。
|
||||
* PHP-fileinfo扩展优化。
|
||||
* 删除任务时删除日志。
|
||||
* 优化修改密码后的显示问题(#288)。
|
||||
|
||||
|
||||
### JSDelivr安装地址
|
||||
|
||||
@@ -27,7 +27,7 @@ from flask import request
|
||||
|
||||
class config_api:
|
||||
|
||||
__version = '0.11.3'
|
||||
__version = '0.11.4'
|
||||
__api_addr = 'data/api.json'
|
||||
|
||||
def __init__(self):
|
||||
|
||||
@@ -240,6 +240,11 @@ class files_api:
|
||||
system_api.system_api().restartTask()
|
||||
except:
|
||||
system_api.system_api().restartTask()
|
||||
|
||||
# 删除日志
|
||||
task_log = mw.getRunDir() + "/tmp/panelTask.pl"
|
||||
if os.path.exists(task_log):
|
||||
os.remove(task_log)
|
||||
return mw.returnJson(True, '任务已删除!')
|
||||
|
||||
# 上传文件
|
||||
|
||||
@@ -32,9 +32,9 @@ if [ ! -d $curPath/versions/$2 ];then
|
||||
fi
|
||||
|
||||
|
||||
if [ "${action}" == "install" ] && [ -d $serverPath/php/${type} ];then
|
||||
exit 0
|
||||
fi
|
||||
# if [ "${action}" == "install" ] && [ -d $serverPath/php/${type} ];then
|
||||
# exit 0
|
||||
# fi
|
||||
|
||||
if [ "${action}" == "uninstall" ];then
|
||||
|
||||
@@ -71,6 +71,12 @@ if [ "${action}" == "install" ] && [ -d ${serverPath}/php/${type} ];then
|
||||
cd ${rootPath}/plugins/php/versions/common && bash gettext.sh install ${type}
|
||||
cd ${rootPath}/plugins/php/versions/common && bash redis.sh install ${type}
|
||||
cd ${rootPath}/plugins/php/versions/common && bash memcached.sh install ${type}
|
||||
cd ${rootPath}/plugins/php/versions/common && bash zlib.sh install ${type}
|
||||
|
||||
if [ "${type}" -gt "72" ];then
|
||||
cd ${rootPath}/plugins/php/versions/common && bash zip.sh install ${type}
|
||||
fi
|
||||
|
||||
echo "install PHP${type} extend end"
|
||||
fi
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ function version_lt() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)"
|
||||
function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; }
|
||||
|
||||
|
||||
version=8.2.0RC7
|
||||
version=8.2.0
|
||||
PHP_VER=82
|
||||
Install_php()
|
||||
{
|
||||
@@ -32,8 +32,7 @@ cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
# wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://downloads.php.net/~pierrick/php-${version}.tar.xz
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://downloads.php.net/~pierrick/php-${version}.tar.xz
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://www.php.net/distributions/php-${version}.tar.xz
|
||||
fi
|
||||
|
||||
cd $sourcePath/php && tar -Jxf $sourcePath/php/php-${version}.tar.xz
|
||||
|
||||
@@ -49,6 +49,7 @@ Install_lib()
|
||||
if [ ! -f "$extFile" ];then
|
||||
|
||||
if [ ! -d $sourcePath/php${version}/ext ];then
|
||||
echo "cd ${rootPath}/plugins/php && /bin/bash install.sh install ${version}"
|
||||
cd ${rootPath}/plugins/php && /bin/bash install.sh install ${version}
|
||||
fi
|
||||
|
||||
@@ -57,9 +58,23 @@ Install_lib()
|
||||
$serverPath/php/$version/bin/phpize
|
||||
./configure --with-php-config=$serverPath/php/$version/bin/php-config
|
||||
|
||||
|
||||
# It is considered as a temporary bug
|
||||
if [ "$version" == "81" ] || [ "$version" == "82" ];then
|
||||
bash ${rootPath}/scripts/getos.sh
|
||||
OSNAME=`cat ${rootPath}/data/osname.pl`
|
||||
if [ "$OSNAME" == 'centos' ];then
|
||||
FILE_softmagic=$sourcePath/php${version}/ext/${LIBNAME}/libmagic/softmagic.c
|
||||
FIND_UNDEF_STRNDUP=`cat $FILE_softmagic|grep '#undef strndup'`
|
||||
if [ "$version" -gt "74" ] && [ "$FIND_UNDEF_STRNDUP" == "" ];then
|
||||
sed -i $BAK "s/char \*strndup/#undef strndup\nchar \*strndup/g" $FILE_softmagic
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
FIND_C99=`cat Makefile|grep c99`
|
||||
if [ "$FIND_C99" == "" ];then
|
||||
sed -i $BAK 's/CFLAGS \=/CFLAGS \= -std=c99/g' Makefile
|
||||
if [ "$version" -gt "74" ] && [ "$FIND_C99" == "" ];then
|
||||
sed -i $BAK 's/CFLAGS \=/CFLAGS \= -std=gnu99/g' Makefile
|
||||
fi
|
||||
|
||||
make clean && make && make install && make clean
|
||||
|
||||
@@ -20,12 +20,10 @@ LIBV=4.1.2
|
||||
if [ "$version" -lt "73" ];then
|
||||
echo "not support!"
|
||||
exit 1
|
||||
else
|
||||
fi
|
||||
|
||||
if [ "$version" -gt "74" ];then
|
||||
LIBV=5.1.2
|
||||
else
|
||||
echo "not support!"
|
||||
fi
|
||||
|
||||
LIB_PATH_NAME=lib/php
|
||||
|
||||
@@ -21,6 +21,8 @@ if [ "$version" == "52" ];then
|
||||
LIBV=2.2.7
|
||||
elif [ "$version" -lt "70" ];then
|
||||
LIBV=4.2.0
|
||||
elif [ "$version" -gt "74" ];then
|
||||
LIBV=5.3.5
|
||||
else
|
||||
echo 'ok'
|
||||
fi
|
||||
|
||||
@@ -31,11 +31,6 @@ if [ "$version" -eq "72" ] || [ "$version" -eq "73" ];then
|
||||
LIBV=3.2.5
|
||||
fi
|
||||
|
||||
if [ "$version" -eq "82" ];then
|
||||
echo "not need"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
LIB_PATH_NAME=lib/php
|
||||
if [ -d $serverPath/php/${version}/lib64 ];then
|
||||
|
||||
@@ -21,12 +21,6 @@ if [ "$version" -lt "70" ];then
|
||||
LIBV=1.2.5
|
||||
fi
|
||||
|
||||
if [ "$version" -eq "82" ];then
|
||||
echo "wait php82 release"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
LIB_PATH_NAME=lib/php
|
||||
if [ -d $serverPath/php/${version}/lib64 ];then
|
||||
LIB_PATH_NAME=lib64
|
||||
|
||||
@@ -520,8 +520,7 @@
|
||||
"73",
|
||||
"74",
|
||||
"80",
|
||||
"81",
|
||||
"82"
|
||||
"81"
|
||||
],
|
||||
"type": "框架",
|
||||
"msg": "Yaf是一个C语言编写的PHP框架",
|
||||
@@ -541,8 +540,7 @@
|
||||
"73",
|
||||
"74",
|
||||
"80",
|
||||
"81",
|
||||
"82"
|
||||
"81"
|
||||
],
|
||||
"type": "框架",
|
||||
"msg": "Yar是一个RPC框架",
|
||||
|
||||
@@ -331,7 +331,8 @@ case "$1" in
|
||||
echo -e "=================================================================="
|
||||
echo -e "$address"
|
||||
echo -e `python3 $mw_path/tools.py username`
|
||||
echo -e "password: $password"
|
||||
echo -e `python3 $mw_path/tools.py password`
|
||||
# echo -e "password: $password"
|
||||
echo -e "\033[33mWarning:\033[0m"
|
||||
echo -e "\033[33mIf you cannot access the panel. \033[0m"
|
||||
echo -e "\033[33mrelease the following port (${show_panel_ip}888|80|443|22) in the security group.\033[0m"
|
||||
|
||||
@@ -132,6 +132,22 @@ def set_panel_pwd(password, ncli=False):
|
||||
print(username)
|
||||
|
||||
|
||||
def show_panel_pwd():
|
||||
# 设置面板密码
|
||||
import db
|
||||
sql = db.Sql()
|
||||
password = sql.table('users').where('id=?', (1,)).getField('password')
|
||||
|
||||
file_pwd = ''
|
||||
if os.path.exists('data/default.pl'):
|
||||
file_pwd = mw.readFile('data/default.pl').strip()
|
||||
|
||||
if mw.md5(file_pwd) == password:
|
||||
print('password: ' + file_pwd)
|
||||
return
|
||||
print("the password has been changed!")
|
||||
|
||||
|
||||
def set_panel_username(username=None):
|
||||
# 随机面板用户名
|
||||
import db
|
||||
@@ -171,6 +187,8 @@ if __name__ == "__main__":
|
||||
set_panel_username(sys.argv[2])
|
||||
else:
|
||||
set_panel_username()
|
||||
elif method == 'password':
|
||||
show_panel_pwd()
|
||||
elif method == 'getServerIp':
|
||||
getServerIp()
|
||||
elif method == "cli":
|
||||
|
||||
Reference in New Issue
Block a user