Compare commits

...
26 Commits
Author SHA1 Message Date
Mr Chen 422dea0e3f Update info.json 2019-03-15 17:48:31 +08:00
Mr Chen d52a355cc9 Update config_api.py 2019-03-15 17:45:55 +08:00
Mr Chen 389d87c2b5 Update index.py 2019-03-15 17:44:33 +08:00
Mr Chen 7ef8322731 Update index.py 2019-03-15 17:42:27 +08:00
Mr Chen d1a0b32bf6 Update gogs.tpl 2019-03-15 17:24:56 +08:00
Mr Chen 295cb399e3 Update gogs.tpl 2019-03-15 17:15:06 +08:00
Mr Chen db9477c22e Update install_centos.sh 2019-03-15 17:05:50 +08:00
Mr Chen b2ae6b67d6 Update install_centos.sh 2019-03-15 16:58:10 +08:00
Mr Chen bf5f0cecff Update config_api.py 2019-03-15 16:54:55 +08:00
Mr Chen 251503952d sphinx 自启动 done 2019-03-15 16:54:00 +08:00
Mr Chen 60445a565d pureftp 自启动 done 2019-03-15 16:50:20 +08:00
Mr Chen 6a8db02aa7 redis 自启动 done 2019-03-15 16:47:55 +08:00
Mr Chen ac50b335c3 memcached 自启动 done 2019-03-15 16:45:15 +08:00
Mr Chen c9826d5daf mysql 自启动done 2019-03-15 16:02:59 +08:00
Mr Chen ada8225e05 update 2019-03-15 15:23:54 +08:00
Mr Chen 613ca4bce0 Update index.py 2019-03-15 14:53:08 +08:00
Mr Chen 1bdfb0625a openresty 自启动 2019-03-15 14:52:18 +08:00
Mr Chen ad2e33fcd2 Update common.py 2019-03-15 14:43:00 +08:00
Mr Chen 6e846a4a51 Update common.py 2019-03-15 14:42:38 +08:00
Mr Chen dc76f0ca33 chkconfig自启动需要 2019-03-15 14:33:33 +08:00
Mr Chen c619f00c54 Update README.md 2019-03-14 17:14:28 +08:00
Mr Chen 015b132b85 update 2019-03-14 15:29:09 +08:00
Mr Chen 4e4b4ad308 Update info.json 2019-03-14 14:29:41 +08:00
Mr Chen 1226caaa39 Update update_centos.sh 2019-03-14 14:21:14 +08:00
Mr Chen 5a92027f20 Update update_centos.sh 2019-03-14 14:21:01 +08:00
Mr Chen ea6ed08461 Update update_centos.sh 2019-03-14 14:20:43 +08:00
25 changed files with 145 additions and 44 deletions
+4 -1
View File
@@ -1,5 +1,6 @@
# mdserver-web
简单的Linux面板
简单的Linux面板,感谢bt.cn写出如此好的web管理软件。我一看到,就知道这是我一直想要的页面化管理方式。
复制了后台管理界面,按照自己想要的方式写了一版。
### 自动安装
```
@@ -12,3 +13,5 @@ curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update.sh | sh
```
### wiki
+2
View File
@@ -68,6 +68,8 @@ def initInitD():
import shutil
shutil.copyfile(script_bin, initd_bin)
public.execShell('chmod +x ' + initd_bin)
#加入自启动
public.execShell('chkconfig --add mw')
def initUserInfo():
+10 -1
View File
@@ -15,7 +15,16 @@ from flask import request
class config_api:
__version = '0.4.2'
# 本版解决自启动问题
# openresty 自启动 done
# php 自启动 done
# mysql 自启动 done
# memcached 自启动 done
# redis 自启动 done
# pureftp 自启动 done
# sphinx 自启动 done
# 修复rsync自启动问题
__version = '0.5.6'
def __init__(self):
pass
+4 -1
View File
@@ -98,7 +98,7 @@ class plugins_api:
return public.returnJson(False, '缺少版本信息!', ())
infoJsonPos = self.__plugin_dir + '/' + name + '/' + 'info.json'
print infoJsonPos
# print infoJsonPos
if not os.path.exists(infoJsonPos):
return public.retJson(False, '配置文件不存在!', ())
@@ -165,6 +165,9 @@ class plugins_api:
+ " uninstall " + version
data = public.execShell(execstr)
if public.isAppleSystem():
print execstr
print data[0],data[1]
return public.returnJson(True, '卸载执行成功!')
# if data[1] == '':
# return public.returnJson(True, '已将卸载成功!')
+2
View File
@@ -300,6 +300,7 @@ def initdInstall():
initd_bin = getInitDFile()
shutil.copyfile(mem_bin, initd_bin)
public.execShell('chmod +x ' + initd_bin)
public.execShell('chkconfig --add ' + getPluginName())
return 'ok'
@@ -310,6 +311,7 @@ def initdUinstall():
return "Apple Computer does not support"
initd_bin = getInitDFile()
os.remove(initd_bin)
public.execShell('chkconfig --del ' + getPluginName())
return 'ok'
+2 -1
View File
@@ -30,7 +30,8 @@ if [ -f /etc/rc.d/init.d/functions ];then
fi
# Default values
HOME={$HOME_DIR}
export HOME={$HOME_DIR}
export USER={$RUN_USER}
NAME=gogs
GOGS_HOME={$SERVER_PATH}/gogs
GOGS_PATH=${GOGS_HOME}/$NAME
+4
View File
@@ -194,10 +194,12 @@ def initdInstall():
if public.isAppleSystem():
return "Apple Computer does not support"
mem_bin = initDreplace()
initd_bin = getInitDFile()
shutil.copyfile(mem_bin, initd_bin)
public.execShell('chmod +x ' + initd_bin)
public.execShell('chkconfig --add ' + getPluginName())
return 'ok'
@@ -205,6 +207,8 @@ def initdUinstall():
if not app_debug:
if public.isAppleSystem():
return "Apple Computer does not support"
public.execShell('chkconfig --del ' + getPluginName())
initd_bin = getInitDFile()
os.remove(initd_bin)
return 'ok'
+8 -11
View File
@@ -1,4 +1,5 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
@@ -7,35 +8,31 @@ rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
install_tmp=${rootPath}/tmp/mw_install.pl
Install_mem()
{
Install_mem(){
mkdir -p $serverPath/source
echo '正在安装脚本文件...' > $install_tmp
if [ ! -f $serverPath/source/memcached.tar.gz ];then
wget -O $serverPath/source/memcached.tar.gz http://www.memcached.org/files/memcached-1.5.12.tar.gz
if
fi
cd $serverPath/source && tar -zxvf memcached.tar.gz
mkdir -p $serverPath/memcached
cd memcached* && ./configure --prefix=$serverPath/memcached && make && make install
cd $serverPath/source/memcached*
./configure --prefix=$serverPath/memcached && make && make install
echo '1.5' > $serverPath/memcached/version.pl
echo '安装完成' > $install_tmp
echo 'install ok' > $install_tmp
}
Uninstall_mem()
{
$serverPath/memcached/init.d/memcached stop
rm -rf mkdir -p $serverPath/memcached
${serverPath}/memcached/init.d/memcached stop
rm -rf $serverPath/memcached
}
+2
View File
@@ -293,6 +293,7 @@ def initdInstall():
initd_bin = getInitDFile()
shutil.copyfile(mysql_bin, initd_bin)
public.execShell('chmod +x ' + initd_bin)
public.execShell('chkconfig --add ' + getPluginName())
return 'ok'
@@ -300,6 +301,7 @@ def initdUinstall():
if not app_debug:
if public.isAppleSystem():
return "Apple Computer does not support"
public.execShell('chkconfig --del ' + getPluginName())
initd_bin = getInitDFile()
os.remove(initd_bin)
return 'ok'
+2 -1
View File
@@ -4,7 +4,8 @@
"name":"mysql",
"type":"运行环境",
"ps":"MySQL是一种关系数据库管理系统!",
"versions":["5.5","5.6","5.7","8.0"],
"todo_versions":["5.6","5.7","8.0"],
"versions":["5.5"],
"updates":["5.5.62"],
"shell":"install.sh",
"checks":"server/mysql",
+4
View File
@@ -1,4 +1,8 @@
#!/bin/sh
# chkconfig: 2345 55 25
# Description: mysql service
# distro. For CentOS/Redhat run: 'chkconfig --add mysql'
# Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB
# This file is public domain and comes with NO WARRANTY of any kind
+3
View File
@@ -232,6 +232,7 @@ def initdInstall():
initd_bin = getInitDFile()
shutil.copyfile(source_bin, initd_bin)
public.execShell('chmod +x ' + initd_bin)
public.execShell('chkconfig --add ' + getPluginName())
return 'ok'
@@ -239,6 +240,8 @@ def initdUinstall():
if not app_debug:
if public.isAppleSystem():
return "Apple Computer does not support"
public.execShell('chkconfig --del ' + getPluginName())
initd_bin = getInitDFile()
os.remove(initd_bin)
return 'ok'
+1 -1
View File
@@ -2,7 +2,7 @@
# chkconfig: 2345 55 25
# Description: Startup script for nginx webserver on Debian. Place in /etc/init.d and
# run 'update-rc.d -f nginx defaults', or use the appropriate command on your
# distro. For CentOS/Redhat run: 'chkconfig --add nginx'
# distro. For CentOS/Redhat run: 'chkconfig --add openresty'
### BEGIN INIT INFO
# Provides: nginx
+1 -1
View File
@@ -3,6 +3,7 @@
<div class="bt-w-main">
<div class="bt-w-menu">
<p class="bgw" onclick="pluginService('php', $('.plugin_version').attr('version'));">服务</p>
<p onclick="pluginInitD('php', $('.plugin_version').attr('version'));">自启动</p>
<p onclick="phpLibConfig($('.plugin_version').attr('version'));">安装扩展</p>
<p onclick="phpSetConfig($('.plugin_version').attr('version'));">配置修改</p>
<p onclick="phpUploadLimitReq($('.plugin_version').attr('version'));">上传限制</p>
@@ -25,5 +26,4 @@
$.getScript( "/plugins/file?name=php&f=js/php.js", function(){
pluginService('php', $('.plugin_version').attr('version'));
});
</script>
+43 -2
View File
@@ -33,10 +33,10 @@ def getServerDir():
return public.getServerDir() + '/' + getPluginName()
def getInitDFile():
def getInitDFile(version):
if app_debug:
return '/tmp/' + getPluginName()
return '/etc/init.d/' + getPluginName()
return '/etc/init.d/' + getPluginName()+version
def getArgs():
@@ -216,6 +216,41 @@ def reload(version):
return phpOp(version, 'reload')
def initdStatus(version):
if not app_debug:
if public.isAppleSystem():
return "Apple Computer does not support"
initd_bin = getInitDFile(version)
if os.path.exists(initd_bin):
return 'ok'
return 'fail'
def initdInstall(version):
import shutil
if not app_debug:
if public.isAppleSystem():
return "Apple Computer does not support"
source_bin = initReplace(version)
initd_bin = getInitDFile(version)
shutil.copyfile(source_bin, initd_bin)
public.execShell('chmod +x ' + initd_bin)
public.execShell('chkconfig --add ' + getPluginName()+version)
return 'ok'
def initdUinstall(version):
if not app_debug:
if public.isAppleSystem():
return "Apple Computer does not support"
public.execShell('chkconfig --del ' + getPluginName())
initd_bin = getInitDFile(version)
os.remove(initd_bin)
return 'ok'
def fpmLog(version):
return getServerDir() + '/' + version + '/var/log/php-fpm.log'
@@ -595,6 +630,12 @@ if __name__ == "__main__":
print restart(version)
elif func == 'reload':
print reload(version)
elif func == 'initd_status':
print initdStatus(version)
elif func == 'initd_install':
print initdInstall(version)
elif func == 'initd_uninstall':
print initdUinstall(version)
elif func == 'fpm_log':
print fpmLog(version)
elif func == 'fpm_slow_log':
+2
View File
@@ -1,4 +1,6 @@
#! /bin/sh
# chkconfig: 2345 55 25
# description: PHP Service
### BEGIN INIT INFO
# Provides: php-fpm
+2
View File
@@ -166,6 +166,7 @@ def initdInstall():
initd_bin = getInitDFile()
shutil.copyfile(source_bin, initd_bin)
public.execShell('chmod +x ' + initd_bin)
public.execShell('chkconfig --add ' + getPluginName())
return 'ok'
@@ -176,6 +177,7 @@ def initdUinstall():
return "Apple Computer does not support"
initd_bin = getInitDFile()
os.remove(initd_bin)
public.execShell('chkconfig --del ' + getPluginName())
return 'ok'
+3
View File
@@ -172,6 +172,7 @@ def initdInstall():
initd_bin = getInitDFile()
shutil.copyfile(source_bin, initd_bin)
public.execShell('chmod +x ' + initd_bin)
public.execShell('chkconfig --add ' + getPluginName())
return 'ok'
@@ -179,6 +180,8 @@ def initdUinstall():
if not app_debug:
if public.isAppleSystem():
return "Apple Computer does not support"
public.execShell('chkconfig --del ' + getPluginName())
initd_bin = getInitDFile()
os.remove(initd_bin)
return 'ok'
+3 -4
View File
@@ -147,15 +147,14 @@ def initdStatus():
data = public.execShell('systemctl status rsyncd.service | grep enabled')
if data[0] == '':
return 'ok'
return 'fail'
return 'fail'
return 'ok'
def initdInstall():
if public.isAppleSystem():
return "Apple Computer does not support"
data = public.execShell('systemctl enable rsyncd.service')
if data[0] == '':
if data[0] != '':
return 'fail'
return 'ok'
+2
View File
@@ -206,6 +206,7 @@ def initdInstall():
initd_bin = getInitDFile()
shutil.copyfile(source_bin, initd_bin)
public.execShell('chmod +x ' + initd_bin)
public.execShell('chkconfig --add ' + getPluginName())
return 'ok'
@@ -215,6 +216,7 @@ def initdUinstall():
return "Apple Computer does not support"
initd_bin = getInitDFile()
os.remove(initd_bin)
public.execShell('chkconfig --del ' + getPluginName())
return 'ok'
+17 -13
View File
@@ -1773,9 +1773,13 @@ function pluginConfigSave(fileName) {
}
function pluginInitD(_name){
function pluginInitD(_name,_version){
if (typeof _version == 'undefined'){
_version = '';
}
var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 });
$.post('/plugins/run', {name:_name, func:'initd_status'}, function(data) {
$.post('/plugins/run', {name:_name, func:'initd_status',version : _version}, function(data) {
layer.close(loadT);
if( !data.status ){
layer.msg(data.msg,{icon:0,time:3000,shade: [0.3, '#000']});
@@ -1786,41 +1790,41 @@ function pluginInitD(_name){
return;
}
if (data.data == 'ok'){
pluginSetInitD(_name, true);
pluginSetInitD(_name, _version, true);
} else {
pluginSetInitD(_name, false);
pluginSetInitD(_name, _version, false);
}
},'json');
}
function pluginSetInitD(_name, status){
function pluginSetInitD(_name, _version, status){
var serviceCon ='<p class="status">当前状态:<span>'+(status ? '已加载' : '未加载' )+
'</span><span style="color: '+
(status?'#20a53a;':'red;')+
' margin-left: 3px;" class="glyphicon ' + (status?'glyphicon glyphicon-play':'glyphicon-pause')+'"></span></p><div class="sfm-opt">\
<button class="btn btn-default btn-sm" onclick="pluginOpInitD(\''+_name+'\',\''+(status?'initd_uninstall':'initd_install')+'\')">'+(status?'卸载':'加载')+'</button>\
<button class="btn btn-default btn-sm" onclick="pluginOpInitD(\''+_name+'\',\''+_version+'\',\''+(status?'initd_uninstall':'initd_install')+'\')">'+(status?'卸载':'加载')+'</button>\
</div>';
$(".soft-man-con").html(serviceCon);
}
function pluginOpInitD(a, b) {
var c = "name=" + a + "&func=" + b;
function pluginOpInitD(a, _version, b) {
var c = "name=" + a + "&func=" + b + "&version="+_version;
var d = "";
switch(b) {
case "initd_install":d = '加载';break;
case "initd_uninstall":d = '卸载';break;
}
layer.confirm( msgTpl('您真的要{1}{2}服务吗?', [d,a]), {icon:3,closeBtn: 2}, function() {
var e = layer.msg(msgTpl('正在{1}{2}服务,请稍候...',[d,a]), {icon: 16,time: 0});
layer.confirm( msgTpl('您真的要{1}{2}{3}服务吗?', [d,a,_version]), {icon:3,closeBtn: 2}, function() {
var e = layer.msg(msgTpl('正在{1}{2}{3}服务,请稍候...',[d,a,_version]), {icon: 16,time: 0});
$.post("/plugins/run", c, function(g) {
layer.close(e);
var f = g.data == 'ok' ? msgTpl('{1}服务已{2}',[a,d]) : msgTpl('{1}服务{2}失败!',[a,d]);
var f = g.data == 'ok' ? msgTpl('{1}{3}服务已{2}',[a,d,_version]) : msgTpl('{1}{3}服务{2}失败!',[a,d,_version]);
layer.msg(f, {icon: g.data == 'ok' ? 1 : 2});
if ( b == 'initd_install' && g.data == 'ok' ) {
pluginSetInitD(a, true);
pluginSetInitD(a, _version, true);
}else{
pluginSetInitD(a, false);
pluginSetInitD(a, _version, false);
}
if(g.data != 'ok') {
layer.msg(g.data, {icon: 2,time: 0,shade: 0.3,shadeClose: true});
+14
View File
@@ -1,4 +1,18 @@
#!/bin/bash
# chkconfig: 2345 55 25
# description: MW Cloud Service
### BEGIN INIT INFO
# Provides: bt
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts mw
# Description: starts the mw
### END INIT INFO
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
mw_path={$SERVER_PATH}
+2 -2
View File
@@ -15,7 +15,7 @@ if [ ! -f /usr/bin/applydeltarpm ];then
yum -y install deltarpm
fi
yum install -y wget curl libcurl
yum install -y wget curl curl-devel
#https need
curl https://get.acme.sh | sh
@@ -50,7 +50,7 @@ if [ "${isVersion}" == '' ];then
fi
yum install -y libzip-devel mysql-devel libjpeg* libpng* freetype* gd*
yum install -y libevent libevent-devel libzip-devel mysql-devel libjpeg* libpng* freetype* gd*
if [ ! -d '/www/server/mdserver-web' ];then
wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master
+2 -4
View File
@@ -10,6 +10,7 @@ rm -rf /tmp/master.zip
rm -rf /tmp/mdserver-web-master
yum install -y curl-devel
cd /www/server/mdserver-web/scripts && sh lib.sh
pip install -r /www/server/mdserver-web/requirements.txt
@@ -33,8 +34,6 @@ do
done
echo -e "start mw"
cd /www/server/mdserver-web && sh cli.sh start
isStart=`ps -ef|grep 'gunicorn -c setting.py app:app' |grep -v grep|awk '{print $2}'`
@@ -50,5 +49,4 @@ do
done
echo -e "start mw success"
cd /www/server/mdserver-web \
&& sh /etc/init.d/mw default
/etc/init.d/mw default
+6 -1
View File
@@ -1,8 +1,13 @@
[
{
"version": "0.5.6",
"content": "* openresty,php,mysql,memcached,redis,pureftp,sphinx自启动添加 <br/> * 修复rsync自启动问题",
"path": "https://github.com/midoks/mdserver-web/releases/download/0.5.6/mdserver-web.zip"
},
{
"version": "0.4.2",
"content": "* ssh工具优化<br/>* 面板收藏功能完成<br/>* 网站子目录绑定<br/>* 网站备份<br/>* 自动更新优化",
"path": "https://github.com//midoks/mdserver-web/archive/0.4.2.zip"
"path": "https://github.com/midoks/mdserver-web/releases/download/0.4.2/mdserver-web.zip"
},
{
"version": "0.0.6",