mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-09 22:19:26 +08:00
Binary file not shown.
|
After Width: | Height: | Size: 829 B |
Executable
+21
@@ -0,0 +1,21 @@
|
||||
<div class="bt-form">
|
||||
<div class="bt-w-main">
|
||||
<div class='plugin_version'></div>
|
||||
<div class="bt-w-menu">
|
||||
<p class="bgw" onclick="pluginService('ollama',$('.plugin_version').attr('version'));">服务</p>
|
||||
<p onclick="pluginInitD('ollama',$('.plugin_version').attr('version'));">自启动</p>
|
||||
<p onclick="ollama.readme();">说明</p>
|
||||
</div>
|
||||
<div class="bt-w-con pd15">
|
||||
<div class="soft-man-con"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
resetPluginWinHeight(530);
|
||||
$.getScript( "/plugins/file?name=ollama&f=js/ollama.js", function(){
|
||||
ollama.init();
|
||||
pluginService('ollama');
|
||||
});
|
||||
</script>
|
||||
Executable
+220
@@ -0,0 +1,220 @@
|
||||
# coding:utf-8
|
||||
|
||||
import sys
|
||||
import io
|
||||
import os
|
||||
import time
|
||||
import re
|
||||
import socket
|
||||
import json
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
web_dir = os.getcwd() + "/web"
|
||||
if os.path.exists(web_dir):
|
||||
sys.path.append(web_dir)
|
||||
os.chdir(web_dir)
|
||||
|
||||
import core.mw as mw
|
||||
|
||||
app_debug = False
|
||||
if mw.isAppleSystem():
|
||||
app_debug = True
|
||||
|
||||
|
||||
class App:
|
||||
__setupPath = '/www/server/ollama'
|
||||
__cfg = ''
|
||||
__agent_cfg = ''
|
||||
|
||||
def __init__(self):
|
||||
self.__setupPath = self.getServerDir()
|
||||
|
||||
def getArgs(self):
|
||||
args = sys.argv[3:]
|
||||
tmp = {}
|
||||
args_len = len(args)
|
||||
|
||||
if args_len == 1:
|
||||
t = args[0].strip('{').strip('}')
|
||||
t = t.split(':', 1)
|
||||
tmp[t[0]] = t[1]
|
||||
elif args_len > 1:
|
||||
for i in range(len(args)):
|
||||
t = args[i].split(':', 1)
|
||||
tmp[t[0]] = t[1]
|
||||
|
||||
return tmp
|
||||
|
||||
def checkArgs(self, data, ck=[]):
|
||||
for i in range(len(ck)):
|
||||
if not ck[i] in data:
|
||||
return (False, mw.returnJson(False, '参数:(' + ck[i] + ')没有!'))
|
||||
return (True, mw.returnJson(True, 'ok'))
|
||||
|
||||
|
||||
def getPluginName(self):
|
||||
return 'ollama'
|
||||
|
||||
def getPluginDir(self):
|
||||
return mw.getPluginDir() + '/' + self.getPluginName()
|
||||
|
||||
def getServerDir(self):
|
||||
return mw.getServerDir() + '/' + self.getPluginName()
|
||||
|
||||
def getHomeDir(self):
|
||||
if mw.isAppleSystem():
|
||||
user = mw.execShell(
|
||||
"who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
|
||||
return '/Users/' + user
|
||||
else:
|
||||
return '/root'
|
||||
|
||||
def getRunUser(self):
|
||||
if mw.isAppleSystem():
|
||||
user = mw.execShell(
|
||||
"who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
|
||||
return user
|
||||
else:
|
||||
return 'root'
|
||||
|
||||
def status(self):
|
||||
cmd = "ps -ef|grep " + self.getPluginName() + " |grep -v grep | grep -v python | awk '{print $2}'"
|
||||
data = mw.execShell(cmd)
|
||||
if data[0] == '':
|
||||
return "stop"
|
||||
return 'start'
|
||||
|
||||
def contentReplace(self, content):
|
||||
|
||||
service_path = mw.getServerDir()
|
||||
content = content.replace('{$ROOT_PATH}', mw.getFatherDir())
|
||||
content = content.replace('{$SERVER_PATH}', service_path)
|
||||
content = content.replace('{$RUN_USER}', self.getRunUser())
|
||||
content = content.replace('{$HOME_DIR}', self.getHomeDir())
|
||||
|
||||
return content
|
||||
|
||||
def initDreplace(self):
|
||||
|
||||
file_tpl = self.getInitdConfTpl()
|
||||
service_path = mw.getServerDir()
|
||||
|
||||
initD_path = self.getServerDir() + '/init.d'
|
||||
if not os.path.exists(initD_path):
|
||||
os.mkdir(initD_path)
|
||||
self.openPort()
|
||||
|
||||
file_bin = initD_path + '/' + self.getPluginName()
|
||||
|
||||
if not os.path.exists(file_bin):
|
||||
content = mw.readFile(file_tpl)
|
||||
content = self.contentReplace(content)
|
||||
mw.writeFile(file_bin, content)
|
||||
mw.execShell('chmod +x ' + file_bin)
|
||||
|
||||
# systemd
|
||||
# systemDir = mw.systemdCfgDir()
|
||||
# systemService = systemDir + '/nezha.service'
|
||||
# systemServiceTpl = self.getPluginDir() + '/init.d/nezha.service.tpl'
|
||||
# if os.path.exists(systemDir) and not os.path.exists(systemService):
|
||||
# service_path = mw.getServerDir()
|
||||
# se_content = mw.readFile(systemServiceTpl)
|
||||
# se_content = self.contentReplace(se_content)
|
||||
# mw.writeFile(systemService, se_content)
|
||||
# mw.execShell('systemctl daemon-reload')
|
||||
|
||||
return file_bin
|
||||
|
||||
def contentAgentReplace(self, content):
|
||||
path = self.__agent_cfg
|
||||
if os.path.exists(path):
|
||||
data = self.get_agent_cfg()
|
||||
content = content.replace('{$APP_HOST}', data['host'])
|
||||
content = content.replace('{$APP_SECRET}', data['secret'])
|
||||
|
||||
return content
|
||||
|
||||
|
||||
def init_cfg(self):
|
||||
self.initDreplace()
|
||||
|
||||
def oaOp(self, method):
|
||||
|
||||
file = self.initDreplace()
|
||||
|
||||
if not mw.isAppleSystem():
|
||||
cmd = 'systemctl {} {}'.format(method, self.getPluginName())
|
||||
data = mw.execShell(cmd)
|
||||
if data[1] == '':
|
||||
return 'ok'
|
||||
return 'fail'
|
||||
|
||||
data = mw.execShell(file + ' ' + method)
|
||||
if data[1] == '':
|
||||
return 'ok'
|
||||
return data[0]
|
||||
|
||||
def start(self):
|
||||
return self.oaOp('start')
|
||||
|
||||
def stop(self):
|
||||
return self.oaOp('stop')
|
||||
|
||||
def restart(self):
|
||||
return self.oaOp('restart')
|
||||
|
||||
def reload(self):
|
||||
return self.oaOp('reload')
|
||||
|
||||
def agOp(self, method):
|
||||
|
||||
if not mw.isAppleSystem():
|
||||
cmd = 'systemctl {} {}'.format(method, self.getPluginName())
|
||||
data = mw.execShell(cmd)
|
||||
if data[1] == '':
|
||||
return 'ok'
|
||||
return 'fail'
|
||||
|
||||
data = mw.execShell(file + ' ' + method)
|
||||
if data[1] == '':
|
||||
return 'ok'
|
||||
return data[0]
|
||||
|
||||
def start_agent(self):
|
||||
return self.agOp('start')
|
||||
|
||||
def stop_agent(self):
|
||||
return self.agOp('stop')
|
||||
|
||||
def restart_agent(self):
|
||||
return self.agOp('restart')
|
||||
|
||||
def reload_agent(self):
|
||||
return self.agentOp('reload')
|
||||
|
||||
def initd_status(self):
|
||||
cmd = 'systemctl status '+self.getPluginName()+' | grep loaded | grep "enabled;"'
|
||||
data = mw.execShell(cmd)
|
||||
if data[0] == '':
|
||||
return 'fail'
|
||||
return 'ok'
|
||||
|
||||
def initd_install(self):
|
||||
mw.execShell('systemctl enable '+self.getPluginName())
|
||||
return 'ok'
|
||||
|
||||
def initd_uninstall(self):
|
||||
mw.execShell('systemctl disable '+self.getPluginName())
|
||||
return 'ok'
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
func = sys.argv[1]
|
||||
classApp = App()
|
||||
try:
|
||||
data = eval("classApp." + func + "()")
|
||||
print(data)
|
||||
except Exception as e:
|
||||
print('error:' + str(e))
|
||||
Executable
+17
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"sort": 1,
|
||||
"ps": "Ollama是一个开源跨平台大模型工具",
|
||||
"name": "ollama",
|
||||
"title": "ollama",
|
||||
"shell": "install.sh",
|
||||
"versions":["1.0"],
|
||||
"tip": "soft",
|
||||
"checks": "server/ollama",
|
||||
"path": "server/ollama",
|
||||
"display": 1,
|
||||
"author": "ollama",
|
||||
"date": "2026-03-12",
|
||||
"home": "https://ollama.com/",
|
||||
"type": 7,
|
||||
"pid": "7"
|
||||
}
|
||||
Executable
+33
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||
export PATH
|
||||
|
||||
curPath=`pwd`
|
||||
rootPath=$(dirname "$curPath")
|
||||
rootPath=$(dirname "$rootPath")
|
||||
serverPath=$(dirname "$rootPath")
|
||||
|
||||
action=$1
|
||||
type=$2
|
||||
|
||||
if [ "${2}" == "" ];then
|
||||
echo '缺少安装脚本...'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ ! -d $curPath/versions/$2 ];then
|
||||
echo '缺少安装脚本2...'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
sh -x $curPath/versions/$2/install.sh $1
|
||||
|
||||
if [ "${action}" == "uninstall" ];then
|
||||
if [ -f /usr/lib/systemd/system/ollama.service ] || [ -f /lib/systemd/system/ollama.service ] ;then
|
||||
systemctl stop ollama
|
||||
systemctl disable ollama
|
||||
rm -rf /usr/lib/systemd/system/ollama.service
|
||||
rm -rf /lib/systemd/system/ollama.service
|
||||
systemctl daemon-reload
|
||||
fi
|
||||
fi
|
||||
Executable
+104
@@ -0,0 +1,104 @@
|
||||
var ollama = {
|
||||
plugin_name: 'ollama',
|
||||
init: function () {
|
||||
var _this = this;
|
||||
},
|
||||
|
||||
send:function(info){
|
||||
var tips = info['tips'];
|
||||
var method = info['method'];
|
||||
var args = info['data'];
|
||||
var callback = info['success'];
|
||||
|
||||
var loadT = layer.msg(tips, { icon: 16, time: 0, shade: 0.3 });
|
||||
|
||||
var data = {};
|
||||
data['name'] = 'ollama';
|
||||
data['func'] = method;
|
||||
data['version'] = $('.plugin_version').attr('version');
|
||||
|
||||
if (typeof(args) == 'string'){
|
||||
data['args'] = JSON.stringify(toArrayObject(args));
|
||||
} else {
|
||||
data['args'] = JSON.stringify(args);
|
||||
}
|
||||
|
||||
$.post('/plugins/run', data, function(res) {
|
||||
layer.close(loadT);
|
||||
if (!res.status){
|
||||
layer.msg(res.msg,{icon:2,time:10000});
|
||||
return;
|
||||
}
|
||||
|
||||
var ret_data = $.parseJSON(res.data);
|
||||
console.log("send:",ret_data);
|
||||
// if (!ret_data.status){
|
||||
// layer.msg(ret_data.msg,{icon:2,time:2000});
|
||||
// return;
|
||||
// }
|
||||
|
||||
// console.log("send2:",ret_data);
|
||||
|
||||
if(typeof(callback) == 'function'){
|
||||
callback(ret_data);
|
||||
}
|
||||
},'json');
|
||||
},
|
||||
|
||||
postCallback:function(info){
|
||||
var tips = info['tips'];
|
||||
var method = info['method'];
|
||||
var args = info['data'];
|
||||
var callback = info['success'];
|
||||
|
||||
var loadT = layer.msg(tips, { icon: 16, time: 0, shade: 0.3 });
|
||||
|
||||
var data = {};
|
||||
data['name'] = 'ollama';
|
||||
data['func'] = method;
|
||||
data['version'] = $('.plugin_version').attr('version');
|
||||
|
||||
if (typeof(args) == 'string'){
|
||||
data['args'] = JSON.stringify(toArrayObject(args));
|
||||
} else {
|
||||
data['args'] = JSON.stringify(args);
|
||||
}
|
||||
|
||||
$.post('/plugins/callback', data, function(res) {
|
||||
layer.close(loadT);
|
||||
if (!res.status){
|
||||
layer.msg(res.msg,{icon:2,time:10000});
|
||||
return;
|
||||
}
|
||||
|
||||
var ret_data = $.parseJSON(res.data);
|
||||
if (!ret_data.status){
|
||||
layer.msg(ret_data.msg,{icon:2,time:2000});
|
||||
return;
|
||||
}
|
||||
|
||||
if(typeof(callback) == 'function'){
|
||||
callback(res);
|
||||
}
|
||||
},'json');
|
||||
},
|
||||
|
||||
readme:function (){
|
||||
var readme = '<ul class="help-info-text c7">';
|
||||
readme += '<li>常用命令说明:</li>';
|
||||
readme += '</ul>';
|
||||
readme += '<div class="divtable mtb15">';
|
||||
readme += '<table class="table table-hover">';
|
||||
readme += '<thead><tr><th>命令</th><th>说明</th><th>示例</th></tr></thead>';
|
||||
readme += '<tbody>';
|
||||
readme += '<tr><td><code>ollama pull <模型名></code></td><td>仅下载指定的模型到本地,不立即运行</td><td><code>ollama pull deepseek-r1:7b</code></td></tr>';
|
||||
readme += '<tr><td><code>ollama run <模型名></code></td><td>下载(若本地无)并运行模型,进入交互界面</td><td><code>ollama run llama3.2</code></td></tr>';
|
||||
readme += '<tr><td><code>ollama list</code></td><td>列出所有已下载到本地的模型</td><td><code>ollama list</code></td></tr>';
|
||||
readme += '<tr><td><code>ollama ps</code></td><td>查看当前正在运行的模型</td><td><code>ollama ps</code></td></tr>';
|
||||
readme += '<tr><td><code>ollama stop <模型名></code></td><td>停止一个正在运行的模型</td><td><code>ollama stop llama3.2</code></td></tr>';
|
||||
readme += '<tr><td><code>ollama rm <模型名></code></td><td>从本地删除指定模型,释放磁盘空间</td><td><code>ollama rm llama3.2</code></td></tr>';
|
||||
readme += '<tr><td><code>ollama serve</code></td><td>启动 Ollama 后台服务(首次运行模型时也会自动启动)</td><td><code>ollama serve</code></td></tr>';
|
||||
readme += '</tbody></table></div>';
|
||||
$('.soft-man-con').html(readme);
|
||||
}
|
||||
}
|
||||
Executable
+77
@@ -0,0 +1,77 @@
|
||||
#!/bin/bash
|
||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||
export PATH
|
||||
|
||||
curPath=`pwd`
|
||||
rootPath=$(dirname "$curPath")
|
||||
rootPath=$(dirname "$rootPath")
|
||||
serverPath=$(dirname "$rootPath")
|
||||
|
||||
VERSION=1.0
|
||||
sysName=`uname`
|
||||
|
||||
# bash install.sh install 1.0
|
||||
# cd /www/server/mdserver-web/plugins/ollama && bash install.sh install 1.0
|
||||
# cd /Users/midoks/Desktop/mwdev/server/mdserver-web/plugins/ollama && bash install.sh install 1.0
|
||||
|
||||
bash ${rootPath}/scripts/getos.sh
|
||||
|
||||
|
||||
|
||||
OSNAME=`cat ${rootPath}/data/osname.pl`
|
||||
OSNAME_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
|
||||
|
||||
|
||||
ARCH="amd64"
|
||||
|
||||
get_arch() {
|
||||
TMP_ARCH=`arch`
|
||||
if [ "$TMP_ARCH" == "x86_64" ];then
|
||||
ARCH="amd64"
|
||||
elif [ "$TMP_ARCH" == "aarch64" ];then
|
||||
ARCH="arm64"
|
||||
else
|
||||
echo $ARCH
|
||||
fi
|
||||
}
|
||||
|
||||
Install_App()
|
||||
{
|
||||
curl -fsSL https://ollama.com/install.sh | sh
|
||||
|
||||
mkdir -p $serverPath/ollama
|
||||
echo "$VERSION" > $serverPath/ollama/version.pl
|
||||
|
||||
cd ${rootPath} && python3 ${rootPath}/plugins/ollama/index.py start
|
||||
echo 'install successful'
|
||||
}
|
||||
|
||||
Uninstall_App()
|
||||
{
|
||||
cd ${rootPath} && python3 ${rootPath}/plugins/ollama/index.py stop
|
||||
|
||||
systemctl stop ollama.service
|
||||
systemctl disable ollama.service
|
||||
rm -rf /etc/systemd/system/ollama.service
|
||||
systemctl daemon-reload
|
||||
rm -rf $(which ollama)
|
||||
rm -rf /usr/share/ollama
|
||||
rm -rf ~/.ollama
|
||||
|
||||
userdel ollama
|
||||
groupdel ollama
|
||||
|
||||
if command -v apt &> /dev/null; then
|
||||
apt remove -y ollama
|
||||
fi
|
||||
|
||||
rm -rf $serverPath/ollama
|
||||
echo "install fail"
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
Install_App
|
||||
else
|
||||
Uninstall_App
|
||||
fi
|
||||
@@ -13,6 +13,6 @@
|
||||
"home":"http://openresty.org",
|
||||
"date":"2017-11-24",
|
||||
"pid": "1",
|
||||
"versions": ["1.17.8","1.19.3","1.21.4","1.25.3","1.27.1","rtmp"],
|
||||
"versions": ["1.17.8","1.19.3","1.21.4","1.25.3","1.27.1","1.29.2","rtmp"],
|
||||
"updates": ["1.17.8.2","1.19.3.1","1.21.4.2","1.25.3.2"]
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
#!/bin/bash
|
||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin
|
||||
export PATH
|
||||
|
||||
# cd /Users/midoks/Desktop/mwdev/server/mdserver-web/plugins/openresty && bash install.sh install 1.29.2
|
||||
# cd /www/server/mdserver-web/plugins/openresty && bash install.sh install 1.29.2
|
||||
|
||||
curPath=`pwd`
|
||||
rootPath=$(dirname "$curPath")
|
||||
rootPath=$(dirname "$rootPath")
|
||||
serverPath=$(dirname "$rootPath")
|
||||
|
||||
sysName=`uname`
|
||||
action=$1
|
||||
type=$2
|
||||
|
||||
VERSION=1.29.2.1
|
||||
|
||||
openrestyDir=${serverPath}/source/openresty
|
||||
|
||||
Install_openresty()
|
||||
{
|
||||
if [ -d $serverPath/openresty ];then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# ----- cpu start ------
|
||||
if [ -z "${cpuCore}" ]; then
|
||||
cpuCore="1"
|
||||
fi
|
||||
|
||||
if [ -f /proc/cpuinfo ];then
|
||||
cpuCore=`cat /proc/cpuinfo | grep "processor" | wc -l`
|
||||
fi
|
||||
|
||||
MEM_INFO=$(free -m|grep Mem|awk '{printf("%.f",($2)/1024)}')
|
||||
if [ "${cpuCore}" != "1" ] && [ "${MEM_INFO}" != "0" ];then
|
||||
if [ "${cpuCore}" -gt "${MEM_INFO}" ];then
|
||||
cpuCore="${MEM_INFO}"
|
||||
fi
|
||||
else
|
||||
cpuCore="1"
|
||||
fi
|
||||
|
||||
if [ "$cpuCore" -gt "2" ];then
|
||||
cpuCore=`echo "$cpuCore" | awk '{printf("%.f",($1)*0.8)}'`
|
||||
else
|
||||
cpuCore="1"
|
||||
fi
|
||||
# ----- cpu end ------
|
||||
|
||||
mkdir -p ${openrestyDir}
|
||||
echo '正在安装脚本文件...'
|
||||
|
||||
# wget -O openresty-1.21.4.1.tar.gz https://openresty.org/download/openresty-1.21.4.1.tar.gz
|
||||
if [ ! -f ${openrestyDir}/openresty-${VERSION}.tar.gz ];then
|
||||
wget --no-check-certificate -O ${openrestyDir}/openresty-${VERSION}.tar.gz https://openresty.org/download/openresty-${VERSION}.tar.gz -T 3
|
||||
fi
|
||||
|
||||
DOWNLOAD_SIZE=`wc -c ${openrestyDir}/openresty-${VERSION}.tar.gz | awk '{print $1}'`
|
||||
if [ "$DOWNLOAD_SIZE" == "0" ];then
|
||||
echo 'download failed, download again'
|
||||
rm -rf ${openrestyDir}/openresty-${VERSION}.tar.gz
|
||||
fi
|
||||
|
||||
# Last Download Method
|
||||
if [ ! -f ${openrestyDir}/openresty-${VERSION}.tar.gz ];then
|
||||
wget --no-check-certificate -O ${openrestyDir}/openresty-${VERSION}.tar.gz http://dl.midoks.icu/soft/openresty/openresty-${VERSION}.tar.gz -T 3
|
||||
fi
|
||||
|
||||
cd ${openrestyDir} && tar -zxvf openresty-${VERSION}.tar.gz
|
||||
|
||||
OPTIONS=''
|
||||
|
||||
opensslVersion="1.1.1p"
|
||||
libresslVersion="3.9.1"
|
||||
pcreVersion='8.38'
|
||||
if [ "$sysName" == "Darwin" ];then
|
||||
|
||||
if [ ! -f ${openrestyDir}/pcre-${pcreVersion}.tar.gz ];then
|
||||
wget --no-check-certificate -O ${openrestyDir}/pcre-${pcreVersion}.tar.gz https://netix.dl.sourceforge.net/project/pcre/pcre/${pcreVersion}/pcre-${pcreVersion}.tar.gz
|
||||
fi
|
||||
|
||||
if [ ! -d ${openrestyDir}/pcre-${pcreVersion} ];then
|
||||
cd ${openrestyDir} && tar -zxvf pcre-${pcreVersion}.tar.gz
|
||||
fi
|
||||
OPTIONS="${OPTIONS} --with-pcre=${openrestyDir}/pcre-${pcreVersion}"
|
||||
|
||||
|
||||
if [ ! -f ${openrestyDir}/openssl-${opensslVersion}.tar.gz ];then
|
||||
wget --no-check-certificate -O ${openrestyDir}/openssl-${opensslVersion}.tar.gz https://www.openssl.org/source/openssl-${opensslVersion}.tar.gz
|
||||
fi
|
||||
|
||||
if [ ! -d ${openrestyDir}/openssl-${opensslVersion} ];then
|
||||
cd ${openrestyDir} && tar -zxvf openssl-${opensslVersion}.tar.gz
|
||||
fi
|
||||
OPTIONS="${OPTIONS} --with-openssl=${openrestyDir}/openssl-${opensslVersion}"
|
||||
|
||||
# BREW_DIR=`which brew`
|
||||
# BREW_DIR=${BREW_DIR/\/bin\/brew/}
|
||||
|
||||
# brew info openssl@1.1 | grep /opt/homebrew/Cellar/openssl@1.1 | cut -d \ -f 1 | awk 'END {print}'
|
||||
# OPENSSL_LIB_DEPEND_DIR=`brew info openssl@1.1 | grep ${BREW_DIR}/Cellar/openssl@1.1 | cut -d \ -f 1 | awk 'END {print}'`
|
||||
# OPTIONS="${OPTIONS} --with-openssl=${OPENSSL_LIB_DEPEND_DIR}"
|
||||
else
|
||||
if [ ! -f ${openrestyDir}/openssl-${opensslVersion}.tar.gz ];then
|
||||
wget --no-check-certificate -O ${openrestyDir}/openssl-${opensslVersion}.tar.gz https://www.openssl.org/source/openssl-${opensslVersion}.tar.gz
|
||||
fi
|
||||
|
||||
if [ ! -d ${openrestyDir}/openssl-${opensslVersion} ];then
|
||||
cd ${openrestyDir} && tar -zxvf openssl-${opensslVersion}.tar.gz
|
||||
fi
|
||||
OPTIONS="${OPTIONS} --with-openssl=${openrestyDir}/openssl-${opensslVersion}"
|
||||
|
||||
fi
|
||||
|
||||
if [[ "$VERSION" =~ "1.25.3" ]] || [[ "$VERSION" =~ "1.27.1" ]];then
|
||||
OPTIONS="${OPTIONS} --with-http_v3_module"
|
||||
|
||||
if [ ! -f ${openrestyDir}/libressl-${libresslVersion}.tar.gz ];then
|
||||
wget --no-check-certificate -O ${openrestyDir}/libressl-${libresslVersion}.tar.gz https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${libresslVersion}.tar.gz
|
||||
fi
|
||||
|
||||
if [ ! -d ${openrestyDir}/libressl-${libresslVersion} ];then
|
||||
cd ${openrestyDir} && tar -zxvf libressl-${libresslVersion}.tar.gz
|
||||
fi
|
||||
|
||||
OPTIONS="${OPTIONS} --with-cc-opt=-I${openrestyDir}/libressl-${libresslVersion}/libressl/build/include"
|
||||
OPTIONS="${OPTIONS} --with-cc-opt=-I${openrestyDir}/libressl-${libresslVersion}/libressl/build/lib"
|
||||
fi
|
||||
|
||||
|
||||
cd ${openrestyDir}/openresty-${VERSION} && ./configure \
|
||||
--prefix=$serverPath/openresty \
|
||||
$OPTIONS \
|
||||
--with-stream \
|
||||
--with-http_v2_module \
|
||||
--with-http_ssl_module \
|
||||
--with-http_slice_module \
|
||||
--with-http_stub_status_module \
|
||||
--with-http_sub_module \
|
||||
--with-http_realip_module
|
||||
# --without-luajit-gc64
|
||||
# --with-debug
|
||||
# 用于调式
|
||||
|
||||
CMD_MAKE=`which gmake`
|
||||
if [ "$?" == "0" ];then
|
||||
gmake -j${cpuCore} && gmake install && gmake clean
|
||||
else
|
||||
make -j${cpuCore} && make install && make clean
|
||||
fi
|
||||
|
||||
|
||||
if [ -d ${openrestyDir}/pcre-${pcreVersion} ];then
|
||||
rm -rf ${openrestyDir}/pcre-${pcreVersion}
|
||||
fi
|
||||
|
||||
if [ -d ${openrestyDir}/openssl-${opensslVersion} ];then
|
||||
rm -rf ${openrestyDir}/openssl-${opensslVersion}
|
||||
fi
|
||||
|
||||
if [ -d ${openrestyDir}/libressl-${libresslVersion} ];then
|
||||
rm -rf ${openrestyDir}/libressl-${libresslVersion}
|
||||
fi
|
||||
|
||||
if [ -d $openrestyDir/openresty-${VERSION} ];then
|
||||
rm -rf $openrestyDir/openresty-${VERSION}
|
||||
fi
|
||||
echo 'Installation of Openresty completed'
|
||||
}
|
||||
|
||||
Uninstall_openresty()
|
||||
{
|
||||
echo 'Uninstalling Openresty completed'
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
Install_openresty
|
||||
else
|
||||
Uninstall_openresty
|
||||
fi
|
||||
@@ -26,8 +26,18 @@ elif [ "$version" == "7.1" ];then
|
||||
LIBV=4.5.2
|
||||
elif [ "$version" == "7.0" ];then
|
||||
LIBV=4.3.0
|
||||
elif [ `echo "$version < 8.0"|bc` -eq 1 ];then
|
||||
LIBV=6.0.2
|
||||
elif [ "$version" == "8.1" ];then
|
||||
LIBV=6.1.7
|
||||
elif [ "$version" == "8.2" ];then
|
||||
LIBV=6.2.0
|
||||
elif [ "$version" == "8.3" ];then
|
||||
LIBV=6.2.0
|
||||
elif [ "$version" == "8.4" ];then
|
||||
LIBV=6.2.0
|
||||
elif [ "$version" == "8.5" ];then
|
||||
LIBV=6.1.6
|
||||
LIBV=6.2.0
|
||||
else
|
||||
echo 'ok'
|
||||
APT_INSTALL=1
|
||||
|
||||
@@ -565,7 +565,7 @@
|
||||
"check": "xhprof"
|
||||
},
|
||||
{
|
||||
"name": "Swoole",
|
||||
"name": "swoole",
|
||||
"versions": [
|
||||
"56",
|
||||
"70",
|
||||
|
||||
@@ -565,7 +565,7 @@
|
||||
"check": "xhprof"
|
||||
},
|
||||
{
|
||||
"name": "Swoole",
|
||||
"name": "swoole",
|
||||
"versions": [
|
||||
"56",
|
||||
"70",
|
||||
|
||||
@@ -17,11 +17,6 @@ version=$2
|
||||
LIBNAME=swoole
|
||||
LIBV=5.1.6
|
||||
|
||||
if [ "$version" == "85" ];then
|
||||
echo "not need"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$version" -lt "70" ];then
|
||||
LIBV=1.10.1
|
||||
elif [ "$version" == "70" ];then
|
||||
@@ -32,8 +27,16 @@ elif [ "$version" -le "74" ];then
|
||||
LIBV=4.8.10
|
||||
elif [ "$version" -lt "80" ];then
|
||||
LIBV=6.0.2
|
||||
elif [ "$version" -gt "80" ];then
|
||||
LIBV=6.0.2
|
||||
elif [ "$version" == "81" ];then
|
||||
LIBV=6.1.7
|
||||
elif [ "$version" == "82" ];then
|
||||
LIBV=6.2.0
|
||||
elif [ "$version" == "83" ];then
|
||||
LIBV=6.2.0
|
||||
elif [ "$version" == "84" ];then
|
||||
LIBV=6.2.0
|
||||
elif [ "$version" == "85" ];then
|
||||
LIBV=6.2.0
|
||||
else
|
||||
echo 'other?'
|
||||
exit 0
|
||||
|
||||
@@ -678,7 +678,7 @@
|
||||
"check": "xhprof.so"
|
||||
},
|
||||
{
|
||||
"name": "Swoole",
|
||||
"name": "swoole",
|
||||
"versions": [
|
||||
"53",
|
||||
"54",
|
||||
@@ -693,7 +693,8 @@
|
||||
"81",
|
||||
"82",
|
||||
"83",
|
||||
"84"
|
||||
"84",
|
||||
"85"
|
||||
],
|
||||
"type": "通用扩展",
|
||||
"msg": "异步、并行、高性能网络通信引擎",
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"name": "redis",
|
||||
"title": "Redis",
|
||||
"shell": "install.sh",
|
||||
"versions":["4.0.14","5.0.14","6.0.20","6.2.16","7.0.15","7.2.9", "7.4.7", "8.0.5", "8.2.4","8.6.0"],
|
||||
"versions":["4.0.14","5.0.14","6.0.20","6.2.21","7.0.15","7.2.13", "7.4.8", "8.0.6", "8.2.5", "8.4.2","8.6.1"],
|
||||
"tip": "soft",
|
||||
"checks": "server/redis",
|
||||
"path": "server/redis",
|
||||
|
||||
@@ -45,6 +45,10 @@ def send_msg(bot, tag='ad', trigger_time=300):
|
||||
mw.writeFile(lock_file, json.dumps(lock_data))
|
||||
# 信号只在一个周期内执行一次|end
|
||||
keyboard = [
|
||||
[
|
||||
types.InlineKeyboardButton(
|
||||
text="海内外实名KYC-执照代付✅域名", url='https://t.me/kdgzs')
|
||||
],
|
||||
[
|
||||
types.InlineKeyboardButton(
|
||||
text="高价收一切流量 @caifutong555", url='https://t.me/caifutong555')
|
||||
|
||||
@@ -57,8 +57,13 @@ def send_msg(bot, tag='ad', trigger_time=300):
|
||||
# https://t.me/gjgzs2022 | 22/m | @GJ_gzs
|
||||
# 实名认证/过人脸🕵️♀️各种账号处理✅ | 30/m| next,6/30 | @nngzs
|
||||
# 18+资源采集| 4/m | next,7/14 | @liuxingyu123
|
||||
# 海内外实名KYC-执照代付✅域名| 17/m | next,6/17 | @kdgzs
|
||||
|
||||
keyboard = [
|
||||
[
|
||||
types.InlineKeyboardButton(
|
||||
text="海内外实名KYC-执照代付✅域名", url='https://t.me/kdgzs')
|
||||
],
|
||||
[
|
||||
types.InlineKeyboardButton(
|
||||
text="高价收一切流量 @caifutong555", url='https://t.me/caifutong555')
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"name": "valkey",
|
||||
"title": "valkey",
|
||||
"shell": "install.sh",
|
||||
"versions":["8.0.1","8.1.3"],
|
||||
"versions":["8.0.1","8.1.3", "9.0.3"],
|
||||
"tip": "soft",
|
||||
"checks": "server/valkey",
|
||||
"path": "server/valkey",
|
||||
|
||||
@@ -45,7 +45,7 @@ def init_acme_cron():
|
||||
'name': name,
|
||||
'type': 'day-n',
|
||||
'week': "",
|
||||
'where1': "7",
|
||||
'where1': "15",
|
||||
'hour': 4,
|
||||
'minute': 15,
|
||||
'save': "",
|
||||
|
||||
@@ -74,6 +74,11 @@ class plugin(object):
|
||||
"title":"辅助插件",
|
||||
"type":6,
|
||||
"ps":""
|
||||
},
|
||||
{
|
||||
"title":"AI插件",
|
||||
"type":7,
|
||||
"ps":""
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user