From dc0405856c4cf5810f4ba285f6ac825d2c353f63 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Fri, 2 Aug 2019 17:46:05 +0800 Subject: [PATCH] update --- plugins/go-fastdfs/ico.png | Bin 0 -> 4550 bytes plugins/go-fastdfs/index.html | 21 +++ plugins/go-fastdfs/index.py | 266 +++++++++++++++++++++++++++++ plugins/go-fastdfs/info.json | 16 ++ plugins/go-fastdfs/init.d/solr.tpl | 78 +++++++++ plugins/go-fastdfs/install.sh | 51 ++++++ plugins/go-fastdfs/js/solr.js | 192 +++++++++++++++++++++ plugins/memcached/info.json | 2 +- plugins/mysql/info.json | 2 +- plugins/pureftp/info.json | 2 +- plugins/redis/info.json | 2 +- plugins/solr/info.json | 2 +- 12 files changed, 629 insertions(+), 5 deletions(-) create mode 100644 plugins/go-fastdfs/ico.png create mode 100755 plugins/go-fastdfs/index.html create mode 100755 plugins/go-fastdfs/index.py create mode 100755 plugins/go-fastdfs/info.json create mode 100644 plugins/go-fastdfs/init.d/solr.tpl create mode 100755 plugins/go-fastdfs/install.sh create mode 100755 plugins/go-fastdfs/js/solr.js diff --git a/plugins/go-fastdfs/ico.png b/plugins/go-fastdfs/ico.png new file mode 100644 index 0000000000000000000000000000000000000000..23f776333219a4a1b8d86e463ea1ceba34fded96 GIT binary patch literal 4550 zcmZ`-cRW@9|3A34?9i=jvf|oYn=8tm*?VW?~4uX&`Ac*;4-UkDD z@CS*5mIeyC{CB)=f0F@0v_I~mRE*u`8!Up%j3ygxZ&BTSs=}z{6y9JHDB%luTCy^A>Ze@?6kA9 z(7tcq^raz$A*1v0AURq+c<=X@m&GVfgM}tsxSUDxh_*f-WAT({V@5^>!;3F22o|b? zSaJr5JH>Up{QTuYyu7@ke0*;|wAPT)u(qL>`qLv)uSs&8uQ&JlNw>|2~Z zP3U#lPh_|iKIzfGDi^Rx#v&I`6@#^da?1)a7zVy1PQm-{&Sa&fk2?91-c#i$|M%aX zS#Fv1Pl($&Ur-VE~XxfUXeYNjkF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PZ>VG7>@Lc!J;ufw`$yA8xag2R!1#KqiV+wO^o7I%9WcDI4CvUuX+tKAWh#&%Cs>6ndSBDT|e!ey^mw{4Q=} zM5RhRaBD`gTW+Tf^Y>S8@?0mZO)@w!F|nZ1Sit&70^VOmky++m|E#HTz)5T$RAr;9 zt4k4u>RZu}MUeL$A0H31$_KL3CiliTaHMPMzZs*;Edx1#7Z6p653b|3kDFWnKYoZh zJv}WSj&awl;!i5t-{05c=HbZ<3<=puOi8iM%g9*#vpT}1UpcX`x=Mx%-PcKLNYBfw zGHdXdNMlr|QzbJtHeS`sNAgfnP*ea4r#E8kr6N`n(H@pzFji5)%8Q89pjp#aoF(8< zW$tcnZV*#4F&2w$?5OED_0TalpRSykn4p3_*1M09L5K*v2w4orPpOEDv%VjG=VvGT zG7r92u`c@$zf#bn^)30)s@E=jBk2k$n8G63wE!HA4q4su*`#g6m46nrj)W!t+VtF9XyouprL@w9*%Wk3bx~JiGww^=Po*j(u9Jk@kt|{y{z=5z!zWU7RWh$Tcjp zGczP}^>8?xgj;z`!o|tS&f5AWy=rY$6_wwA|9x{3`}v@zJu4<523biYZ%t`1KR<5; zMIIgokdc!|rE_UeuOc`&>=#tbg%X}TiFNEtCE$Po4OZr3jJBvIiMPLlU67nHlCwBF zJFB3h1M%>McA1URBXk5A2QVPsUx$WD=n8B!tJv;@hK72+kx$oz0SL&;%ikm2fBEG# z6`eH~C#Tpu+s=2*{u@~;ycyT7Qp6cln{Iq@@q6Ix?CfV{Wz`E@M#RZ_WsL*iOWuUu zUw~O8Es95ujjMIYu+7afAaCG<6_~DG1raB=qM-rrqlT4P(6ur#SHCz#xkAz`h2J* zpja}Q+1YANPTWh&%WH1A!YjLho!(QmKZk1RYhR|nvyFJwG0o1o0ph&PExlKH7PhuZ z@K);#85tRUu$|u3)zxzg3w96D=pJAqz5qG82l9GvwDTI~) literal 0 HcmV?d00001 diff --git a/plugins/go-fastdfs/index.html b/plugins/go-fastdfs/index.html new file mode 100755 index 000000000..576029102 --- /dev/null +++ b/plugins/go-fastdfs/index.html @@ -0,0 +1,21 @@ +
+
+
+

服务

+

自启动

+

管理

+

日志

+

说明

+
+
+
+
+
+
+ + \ No newline at end of file diff --git a/plugins/go-fastdfs/index.py b/plugins/go-fastdfs/index.py new file mode 100755 index 000000000..5a54012cf --- /dev/null +++ b/plugins/go-fastdfs/index.py @@ -0,0 +1,266 @@ +# coding: utf-8 + +import time +import random +import os +import json +import re +import sys + +sys.path.append(os.getcwd() + "/class/core") +import public + +app_debug = False +if public.isAppleSystem(): + app_debug = True + + +def getPluginName(): + return 'solr' + + +def getPluginDir(): + return public.getPluginDir() + '/' + getPluginName() + + +def getServerDir(): + return public.getServerDir() + '/' + getPluginName() + + +def getInitDFile(): + if app_debug: + return '/tmp/' + getPluginName() + return '/etc/init.d/' + getPluginName() + + +def getInitDTpl(): + return getPluginDir() + "/init.d/" + getPluginName() + ".tpl" + + +def getLog(): + return getServerDir() + "/server/logs/solr.log" + + +def getArgs(): + args = sys.argv[2:] + tmp = {} + args_len = len(args) + + if args_len == 1: + t = args[0].strip('{').strip('}') + t = t.split(':') + tmp[t[0]] = t[1] + elif args_len > 1: + for i in range(len(args)): + t = args[i].split(':') + tmp[t[0]] = t[1] + + return tmp + + +def checkArgs(data, ck=[]): + for i in range(len(ck)): + if not ck[i] in data: + return (False, public.returnJson(False, '参数:(' + ck[i] + ')没有!')) + return (True, public.returnJson(True, 'ok')) + + +def status(): + pn = getPluginName() + data = public.execShell( + "ps -ef|grep " + pn + " |grep -v grep | grep -v python | awk '{print $2}'") + if data[0] == '': + return 'stop' + return 'start' + + +def initDreplace(): + + file_tpl = getInitDTpl() + service_path = os.path.dirname(os.getcwd()) + + initD_path = getServerDir() + '/init.d' + if not os.path.exists(initD_path): + os.mkdir(initD_path) + + user = 'www' + if public.getOs() == 'darwin': + user = public.execShell( + "who | sed -n '2, 1p' |awk '{print $1}'")[0].strip() + + file_bin = initD_path + '/' + getPluginName() + if not os.path.exists(file_bin): + content = public.readFile(file_tpl) + content = content.replace('{$SERVER_PATH}', service_path) + content = content.replace('{$RUN_USER}', user) + public.writeFile(file_bin, content) + public.execShell('chmod +x ' + file_bin) + + return file_bin + + +def start(): + file = initDreplace() + data = public.execShell(file + ' start') + if data[1] == '': + return 'ok' + return 'fail' + + +def stop(): + file = initDreplace() + data = public.execShell(file + ' stop') + if data[1] == '': + return 'ok' + return 'fail' + + +def restart(): + file = initDreplace() + data = public.execShell(file + ' restart') + if data[1] == '': + return 'ok' + return 'fail' + + +def reload(): + file = initDreplace() + data = public.execShell(file + ' reload') + if data[1] == '': + return 'ok' + return 'fail' + + +def initdStatus(): + initd_bin = getInitDFile() + if os.path.exists(initd_bin): + return 'ok' + return 'fail' + + +def initdInstall(): + import shutil + + source_bin = initDreplace() + initd_bin = getInitDFile() + shutil.copyfile(source_bin, initd_bin) + public.execShell('chmod +x ' + initd_bin) + + if not app_debug: + public.execShell('chkconfig --add ' + getPluginName()) + return 'ok' + + +def initdUinstall(): + if not app_debug: + public.execShell('chkconfig --del ' + getPluginName()) + + initd_bin = getInitDFile() + + if os.path.exists(initd_bin): + os.remove(initd_bin) + return 'ok' + + +def collectionList(): + path = getServerDir() + '/server/solr' + listDir = os.listdir(path) + data = {} + dlist = [] + for dirname in listDir: + dirpath = path + '/' + dirname + if not os.path.isdir(dirpath): + continue + if dirname == 'configsets': + continue + + tmp = {} + tmp['name'] = dirname + dlist.append(tmp) + data['list'] = dlist + data['ip'] = public.getLocalIp() + data['port'] = '8983' + + content = public.readFile(path+'/solr.xml') + + rep = "jetty.port:(.*)\}" + tmp = re.search(rep, content) + port = tmp.groups()[0] + data['port'] = port + + return public.returnJson(True, 'OK', data) + + +def addCollection(): + args = getArgs() + data = checkArgs(args, ['name']) + if not data[0]: + return data[1] + + name = args['name'] + solr_bin = getServerDir() + "/bin/solr" + + retdata = public.execShell(solr_bin + ' create -c ' + name) + if retdata[1] != "": + return public.returnJson(False, '添加失败!:' + retdata[0]) + return public.returnJson(True, '添加成功!:' + retdata[0]) + + +def removeCollection(): + args = getArgs() + data = checkArgs(args, ['name']) + if not data[0]: + return data[1] + + name = args['name'] + solr_bin = getServerDir() + "/bin/solr" + + retdata = public.execShell(solr_bin + ' delete -c ' + name) + if retdata[1] != "": + return public.returnJson(False, '添加失败!:' + retdata[0]) + return public.returnJson(True, '添加成功!:' + retdata[0]) + + +def confFileCollection(): + args = getArgs() + data = checkArgs(args, ['name']) + if not data[0]: + return data[1] + + conf_file = getServerDir() + "/server/solr/" + \ + args['name'] + "/conf/" + args['conf_file'] + # print conf_file + return public.returnJson(True, 'OK', {'path': conf_file}) + + +# rsyncdReceive +if __name__ == "__main__": + func = sys.argv[1] + if func == 'status': + print status() + elif func == 'start': + print start() + elif func == 'stop': + print stop() + elif func == 'restart': + print restart() + elif func == 'reload': + print reload() + elif func == 'initd_status': + print initdStatus() + elif func == 'initd_install': + print initdInstall() + elif func == 'initd_uninstall': + print initdUinstall() + elif func == 'run_log': + print getLog() + elif func == 'collection_list': + print collectionList() + elif func == 'add_collection': + print addCollection() + elif func == 'remove_collection': + print removeCollection() + elif func == 'conf_file_collection': + print confFileCollection() + else: + print 'error' diff --git a/plugins/go-fastdfs/info.json b/plugins/go-fastdfs/info.json new file mode 100755 index 000000000..9870a8af9 --- /dev/null +++ b/plugins/go-fastdfs/info.json @@ -0,0 +1,16 @@ +{ + "id":10, + "title":"go-fastdfs", + "tip":"soft", + "name":"go-fastdfs", + "type":"软件", + "ps":"一个基于http协议的分布式文件系统", + "versions":"1.3.1", + "shell":"install.sh", + "checks":"server/go-fastdfs", + "path": "server/go-fastdfs", + "author":"midoks", + "home":"https://github.com/sjqzhang/go-fastdfs", + "date":"2019-08-02", + "pid":"2" +} \ No newline at end of file diff --git a/plugins/go-fastdfs/init.d/solr.tpl b/plugins/go-fastdfs/init.d/solr.tpl new file mode 100644 index 000000000..c2194130a --- /dev/null +++ b/plugins/go-fastdfs/init.d/solr.tpl @@ -0,0 +1,78 @@ +#!/bin/sh +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +### BEGIN INIT INFO +# Provides: solr +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Description: Controls Apache Solr as a Service +### END INIT INFO + +# Example of a very simple *nix init script that delegates commands to the bin/solr script +# Typical usage is to do: +# +# cp bin/init.d/solr /etc/init.d/solr +# chmod 755 /etc/init.d/solr +# chown root:root /etc/init.d/solr +# update-rc.d solr defaults +# update-rc.d solr enable + +# Where you extracted the Solr distribution bundle +SOLR_INSTALL_DIR="{$SERVER_PATH}/solr" + +if [ ! -d "$SOLR_INSTALL_DIR" ]; then + echo "$SOLR_INSTALL_DIR not found! Please check the SOLR_INSTALL_DIR setting in your $0 script." + exit 1 +fi + +# Path to an include file that defines environment specific settings to override default +# variables used by the bin/solr script. It's highly recommended to define this script so +# that you can keep the Solr binary files separated from live files (pid, logs, index data, etc) +# see bin/solr.in.sh for an example +SOLR_ENV="{$SERVER_PATH}/solr/bin/solr.in.sh" + +if [ ! -f "$SOLR_ENV" ]; then + echo "$SOLR_ENV not found! Please check the SOLR_ENV setting in your $0 script." + exit 1 +fi + +# Specify the user to run Solr as; if not set, then Solr will run as root. +# Running Solr as root is not recommended for production environments +RUNAS="{$RUN_USER}" + +# verify the specified run as user exists +runas_uid="`id -u "$RUNAS"`" +if [ $? -ne 0 ]; then + echo "User $RUNAS not found! Please create the $RUNAS user before running this script." + exit 1 +fi + +case "$1" in + start|stop|restart|status) + SOLR_CMD="$1" + ;; + *) + echo "Usage: $0 {start|stop|restart|status}" + exit +esac + +if [ -n "$RUNAS" ]; then + sh -c "SOLR_INCLUDE=\"$SOLR_ENV\" \"$SOLR_INSTALL_DIR/bin/solr\" $SOLR_CMD" - "$RUNAS" +else + SOLR_INCLUDE="$SOLR_ENV" "$SOLR_INSTALL_DIR/bin/solr" "$SOLR_CMD" +fi diff --git a/plugins/go-fastdfs/install.sh b/plugins/go-fastdfs/install.sh new file mode 100755 index 000000000..a45cea07b --- /dev/null +++ b/plugins/go-fastdfs/install.sh @@ -0,0 +1,51 @@ +#!/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") +sysName=`uname` + +install_tmp=${rootPath}/tmp/mw_install.pl + +action=$1 +version=$2 +Install_solr() +{ + echo '正在安装脚本文件...' > $install_tmp + mkdir -p $serverPath/solr + SOLR_DIR=${serverPath}/source/solr + mkdir -p $SOLR_DIR + if [ ! -f ${SOLR_DIR}/solr-8.2.0.tgz ];then + wget -O ${SOLR_DIR}/solr-8.2.0.tgz http://mirror.bit.edu.cn/apache/lucene/solr/8.2.0/solr-8.2.0.tgz + fi + + if [ ! -d $serverPath/solr/bin ];then + cd ${SOLR_DIR} && tar -zxvf solr-8.2.0.tgz + cp -rf ${SOLR_DIR}/solr-8.2.0/ $serverPath/solr + fi + + if [ -d $serverPath/solr/dist ]; then + wget -O $serverPath/solr/dist/mysql-connector-java-5.1.48.jar http://central.maven.org/maven2/mysql/mysql-connector-java/5.1.48/mysql-connector-java-5.1.48.jar + wget -O $serverPath/solr/dist/mysql-connector-java-8.0.17.jar http://central.maven.org/maven2/mysql/mysql-connector-java/8.0.17/mysql-connector-java-8.0.17.jar + fi + + echo "$version" > $serverPath/solr/version.pl + echo '安装完成' > $install_tmp + +} + +Uninstall_solr() +{ + rm -rf $serverPath/solr + echo "卸载完成" > $install_tmp +} + + +if [ "${1}" == 'install' ];then + Install_solr $version +else + Uninstall_solr $version +fi diff --git a/plugins/go-fastdfs/js/solr.js b/plugins/go-fastdfs/js/solr.js new file mode 100755 index 000000000..8b36e5ecb --- /dev/null +++ b/plugins/go-fastdfs/js/solr.js @@ -0,0 +1,192 @@ +function str2Obj(str){ + var data = {}; + kv = str.split('&'); + for(i in kv){ + v = kv[i].split('='); + data[v[0]] = v[1]; + } + return data; +} + +function pPost(method,args,callback, title){ + + var _args = null; + if (typeof(args) == 'string'){ + _args = JSON.stringify(str2Obj(args)); + } else { + _args = JSON.stringify(args); + } + + var _title = '正在获取...'; + if (typeof(title) != 'undefined'){ + _title = title; + } + + var loadT = layer.msg(_title, { icon: 16, time: 0, shade: 0.3 }); + $.post('/plugins/run', {name:'solr', func:method, args:_args}, function(data) { + layer.close(loadT); + if (!data.status){ + layer.msg(data.msg,{icon:0,time:2000,shade: [0.3, '#000']}); + return; + } + + if(typeof(callback) == 'function'){ + callback(data); + } + },'json'); +} + + +function collectionManagement(){ + pPost('collection_list', '', function(data){ + var rdata = $.parseJSON(data.data); + if (!rdata.status){ + layer.msg(rdata.msg,{icon:rdata.status?1:2,time:2000,shade: [0.3, '#000']}); + return; + } + + var list = rdata.data.list; + var con = ''; + con += '
'; + con += ''; + con += ''; + con += ''; + con += ''; + + con += ''; + + for (var i = 0; i < list.length; i++) { + con += ''+ + '' + + ' \ + '; + } + + con += ''; + con += '
collection操作(添加)'+ '|'+ 'WEB管理
' + list[i]['name']+'\ + 命令 \ + | 配置 \ + | 删除
'; + + $(".soft-man-con").html(con); + }); +} + + +function addCollection(){ + var loadOpen = layer.open({ + type: 1, + title: '添加Collection', + area: '400px', + content:"
\ +
\ + Collection\ +
\ + \ +
\ +
\ +
\ + \ +
\ +
", + }); + + $('#add_ok').click(function(){ + _data = {}; + _data['name'] = $('#name').val(); + var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 }); + pPost('add_collection', _data, function(data){ + var rdata = $.parseJSON(data.data); + layer.close(loadOpen); + layer.msg(rdata.msg,{icon:rdata.status?1:2,time:2000,shade: [0.3, '#000']}); + setTimeout(function(){collectionManagement();},2000); + }); + }); +} + +function removeCollection(name){ + var loadOpen = layer.open({ + type: 1, + title: '删除用户', + area: '350px', + content:"
\ +
你要确认要删除collection["+ name + "]
\ +
\ + \ + \ +
\ +
" + }); + + $('#solr_del_close').click(function(){ + layer.close(loadOpen); + }); + + $('#solr_del_ok').click(function(){ + var _data = {}; + _data['name'] = name; + var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 }); + + _data = {}; + _data['name'] = name; + var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 }); + pPost('remove_collection', _data, function(data){ + var rdata = $.parseJSON(data.data); + layer.close(loadOpen); + layer.msg(rdata.msg,{icon:rdata.status?1:2,time:2000,shade: [0.3, '#000']}); + setTimeout(function(){collectionManagement();},2000); + }); + }); +} + + +function confCollection(name){ + var html = ''; + html += ''; + html += ''; + + var loadOpen = layer.open({ + type: 1, + title: '['+name+']配置设置', + area: '240px', + content:'
'+html+'
' + }); +} + +function confFileCollection(name, conf_file){ + pPost('conf_file_collection', {'name':name, 'conf_file':conf_file}, function(data){ + var rdata = $.parseJSON(data.data); + if (rdata['status']){ + onlineEditFile(0, rdata['data']['path']); + } else { + layer.msg(rdata.msg,{icon:1,time:2000,shade: [0.3, '#000']}); + } + }); +} + + +function cmdCollection(name){ + var cmd = '
'; + cmd += ''; + cmd += ''; + cmd += ''; + cmd += '
增量更新curl "http://127.0.0.1:8983/solr/'+name+'/dataimport?command=delta-import&wt=json&clean=false&commit=true"
权限更新curl "http://127.0.0.1:8983/solr/'+name+'/dataimport?command=full-import&wt=json&clean=false&commit=true"
默认端口:8983(可修改),默认IP为本地,可修改。
'; + + layer.open({ + type: 1, + title: '命令', + area: '750px', + content:cmd, + }); +} + +function pRead(){ + var readme = '
    '; + readme += '
  • 使用默认solr端口,如有需要自行修改
  • '; + readme += '
  • 如果开启防火墙,需要放行solr设置的端口,例如(8983)
  • '; + readme += '
  • 数据源设置好后,需要在managed-schema中同时设置
  • '; + readme += '
  • wiki说明
  • '; + readme += '
'; + + $('.soft-man-con').html(readme); +} \ No newline at end of file diff --git a/plugins/memcached/info.json b/plugins/memcached/info.json index c0df0b735..f8383836e 100755 --- a/plugins/memcached/info.json +++ b/plugins/memcached/info.json @@ -1,6 +1,6 @@ { "sort": 7, - "ps": "Memcached 是一个高性能的分布式内存对象缓存系统", + "ps": "是一个高性能的分布式内存对象缓存系统", "name": "memcached", "title": "Memcached", "shell": "install.sh", diff --git a/plugins/mysql/info.json b/plugins/mysql/info.json index b25e3ba79..7051b9406 100755 --- a/plugins/mysql/info.json +++ b/plugins/mysql/info.json @@ -3,7 +3,7 @@ "tip":"soft", "name":"mysql", "type":"运行环境", - "ps":"MySQL是一种关系数据库管理系统!", + "ps":"一种关系数据库管理系统!", "todo_versions":["5.6","5.7","8.0"], "versions":["5.5"], "updates":["5.5.62"], diff --git a/plugins/pureftp/info.json b/plugins/pureftp/info.json index a9efa1414..9b6821ce0 100755 --- a/plugins/pureftp/info.json +++ b/plugins/pureftp/info.json @@ -2,7 +2,7 @@ "title":"PureFtpd", "tip":"soft", "name":"pureftp", - "ps":"PureFTPd是一款免费FTP服务器软件", + "ps":"一款免费FTP服务器软件", "versions": "1.0.47", "shell":"install.sh", "checks":"server/pureftp", diff --git a/plugins/redis/info.json b/plugins/redis/info.json index e9a70d269..938076319 100755 --- a/plugins/redis/info.json +++ b/plugins/redis/info.json @@ -1,6 +1,6 @@ { "sort": 7, - "ps": "Redis 是一个高性能的KV数据库", + "ps": "一个高性能的KV数据库", "name": "redis", "title": "Redis", "shell": "install.sh", diff --git a/plugins/solr/info.json b/plugins/solr/info.json index 201017635..16ae21d24 100755 --- a/plugins/solr/info.json +++ b/plugins/solr/info.json @@ -4,7 +4,7 @@ "tip":"soft", "name":"solr", "type":"软件", - "ps":"Solr是一个独立的企业级搜索应用服务器", + "ps":"一个独立的企业级搜索应用服务器", "versions":"8.2.0", "shell":"install.sh", "checks":"server/solr",