mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 11:29:25 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3421bf6ab5 | ||
|
|
2f39bd600b | ||
|
|
acd5ec69e8 | ||
|
|
09878728af | ||
|
|
af82e9f129 | ||
|
|
c74630e738 | ||
|
|
e4e0697b4b | ||
|
|
11b5ac658b | ||
|
|
1306731164 | ||
|
|
bb6c933aee | ||
|
|
d6a93ef1e6 | ||
|
|
6610da402a | ||
|
|
3ace9cf51e | ||
|
|
49c7ec6073 | ||
|
|
8cf526667e | ||
|
|
6c42876411 | ||
|
|
79471e3806 | ||
|
|
cad06425fc | ||
|
|
6f1e11e474 | ||
|
|
59d13e50ce | ||
|
|
5da0746240 | ||
|
|
192ea8b029 | ||
|
|
bfc20b3e42 | ||
|
|
56bee5c752 | ||
|
|
312df5de1f | ||
|
|
4d3640286c | ||
|
|
20930806b6 | ||
|
|
71360b61da | ||
|
|
411645c9e2 | ||
|
|
3de4e1bfff | ||
|
|
34285f6051 | ||
|
|
84f0cda89b | ||
|
|
04012085ce | ||
|
|
265e17beac | ||
|
|
8849001384 | ||
|
|
d6c6ae5561 | ||
|
|
704b256408 | ||
|
|
d38e9f7ad0 | ||
|
|
04e43e051e | ||
|
|
9d9b39dfe2 | ||
|
|
196fbbdd7d | ||
|
|
22d94ce67c | ||
|
|
fc5970c65d | ||
|
|
ea03bb056a | ||
|
|
628175a8ee |
@@ -99,30 +99,31 @@ docker run -itd --name mw-server --privileged=true -p 7200:7200 -p 80:80 -p 443:
|
||||
```
|
||||
|
||||
|
||||
### 版本更新 0.13.3
|
||||
### 版本更新 0.13.4
|
||||
|
||||
* tgbot插件[增加扩展功能]。
|
||||
* 面板设置ssl功能优化。
|
||||
* 网站统计-计划任务归档优化。
|
||||
无重大更新
|
||||
|
||||
* 国内安装不在依赖gitee。
|
||||
* tgbot优化。
|
||||
|
||||
### JSDelivr安装地址
|
||||
|
||||
- 初始安装
|
||||
|
||||
```
|
||||
curl -fsSL https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/scripts/install.sh | bash
|
||||
curl --insecure -fsSL https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/scripts/install.sh | bash
|
||||
```
|
||||
|
||||
- 直接更新
|
||||
|
||||
```
|
||||
curl -fsSL https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/scripts/update.sh | bash
|
||||
curl --insecure -fsSL https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/scripts/update.sh | bash
|
||||
```
|
||||
|
||||
- 卸载脚本
|
||||
|
||||
```
|
||||
wget -O uninstall.sh https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/scripts/uninstall.sh && bash uninstall.sh
|
||||
wget --no-check-certificate -O uninstall.sh https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/scripts/uninstall.sh && bash uninstall.sh
|
||||
```
|
||||
|
||||
### 备用地址
|
||||
@@ -130,20 +131,20 @@ wget -O uninstall.sh https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/scri
|
||||
- 初始安装
|
||||
|
||||
```
|
||||
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install.sh | bash
|
||||
curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install.sh | bash
|
||||
curl --insecure -fsSL https://gitee.com/midoks/mdserver-web/raw/master/scripts/install.sh | bash
|
||||
```
|
||||
|
||||
- 直接更新
|
||||
|
||||
```
|
||||
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update.sh | bash
|
||||
curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update.sh | bash
|
||||
```
|
||||
|
||||
- 卸载脚本
|
||||
|
||||
```
|
||||
wget -O uninstall.sh https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/uninstall.sh && bash uninstall.sh
|
||||
wget --no-check-certificate -O uninstall.sh https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/uninstall.sh && bash uninstall.sh
|
||||
```
|
||||
|
||||
|
||||
@@ -152,22 +153,22 @@ wget -O uninstall.sh https://raw.githubusercontent.com/midoks/mdserver-web/maste
|
||||
- 需已经安装mdserver-web
|
||||
|
||||
```
|
||||
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/quick/app.sh | bash
|
||||
curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/quick/app.sh | bash
|
||||
```
|
||||
|
||||
|
||||
### DEV使用
|
||||
|
||||
```
|
||||
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 --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/install_dev.sh | bash
|
||||
curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh | bash
|
||||
|
||||
wget -O uninstall.sh https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/uninstall.sh && bash uninstall.sh
|
||||
wget --no-check-certificate -O uninstall.sh https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/uninstall.sh && bash uninstall.sh
|
||||
|
||||
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/quick/debug.sh | bash
|
||||
curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/quick/debug.sh | bash
|
||||
|
||||
curl -fsSL https://gitee.com/midoks/mdserver-web/raw/dev/scripts/install_dev.sh | bash
|
||||
curl -fsSL https://gitee.com/midoks/mdserver-web/raw/dev/scripts/update_dev.sh | bash
|
||||
curl --insecure -fsSL https://code.midoks.me/midoks/mdserver-web/raw/branch/dev/scripts/install_dev.sh | bash
|
||||
curl --insecure -fsSL https://code.midoks.me/midoks/mdserver-web/raw/branch/dev/scripts/update_dev.sh | bash
|
||||
```
|
||||
|
||||
### 捐赠地址 USDT(TRC20)
|
||||
|
||||
@@ -27,7 +27,7 @@ from flask import request
|
||||
|
||||
class config_api:
|
||||
|
||||
__version = '0.13.3'
|
||||
__version = '0.13.4'
|
||||
__api_addr = 'data/api.json'
|
||||
|
||||
def __init__(self):
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"ps": "Gitea 是一个开源社区驱动的轻量级代码托管解决方案。",
|
||||
"ps": "Gitea是一个开源社区驱动的轻量级代码托管解决方案。",
|
||||
"name": "gitea",
|
||||
"title": "Gitea",
|
||||
"versions": ["1.17.2"],
|
||||
"versions": ["1.17.2","1.18.5"],
|
||||
"tip": "soft",
|
||||
"install_pre_inspection":false,
|
||||
"uninstall_pre_inspection":true,
|
||||
|
||||
@@ -14,7 +14,7 @@ if [ -f ${rootPath}/bin/activate ];then
|
||||
fi
|
||||
|
||||
|
||||
URL_DOWNLOAD=https://dl.gitea.io/
|
||||
URL_DOWNLOAD=https://dl.gitea.com
|
||||
|
||||
|
||||
bash ${rootPath}/scripts/getos.sh
|
||||
|
||||
@@ -61,7 +61,18 @@ Install_openresty()
|
||||
|
||||
# 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 -O ${openrestyDir}/openresty-${VERSION}.tar.gz https://openresty.org/download/openresty-${VERSION}.tar.gz
|
||||
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 https://dl.midoks.me/soft/openresty/openresty-${VERSION}.tar.gz -T 3
|
||||
fi
|
||||
|
||||
cd ${openrestyDir} && tar -zxvf openresty-${VERSION}.tar.gz
|
||||
|
||||
@@ -46,6 +46,22 @@ def send_msg(bot, tag='ad', trigger_time=300):
|
||||
types.InlineKeyboardButton(
|
||||
text="赞助联系ME", url='tg://user?id=5568699210')
|
||||
],
|
||||
[
|
||||
types.InlineKeyboardButton(
|
||||
text="♻️CMS导航网♻️", url='https://t.me/maccms_jccms')
|
||||
],
|
||||
[
|
||||
types.InlineKeyboardButton(
|
||||
text="💰流量变现💰", url='https://t.me/taohaozhan')
|
||||
],
|
||||
[
|
||||
types.InlineKeyboardButton(
|
||||
text="🙎♂️代实名🙍♀️过人脸🅾️国际阿里云腾讯云(赞助商)", url='https://t.me/gjgzs2022')
|
||||
],
|
||||
[
|
||||
types.InlineKeyboardButton(
|
||||
text="💎DigitalVirt(赞助商)", url='https://digitalvirt.com/aff.php?aff=154')
|
||||
],
|
||||
[
|
||||
types.InlineKeyboardButton(
|
||||
text="论坛", url='https://bbs.midoks.me'),
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
# coding:utf-8
|
||||
|
||||
import sys
|
||||
import io
|
||||
import os
|
||||
import time
|
||||
import re
|
||||
import json
|
||||
import base64
|
||||
import threading
|
||||
|
||||
sys.path.append(os.getcwd() + "/class/core")
|
||||
import mw
|
||||
|
||||
import telebot
|
||||
from telebot import types
|
||||
from telebot.util import quick_markup
|
||||
|
||||
# 推送最新的帖子
|
||||
|
||||
chat_id = -1001578009023
|
||||
# chat_id = 5568699210
|
||||
|
||||
|
||||
def get_newest_tid():
|
||||
|
||||
api_new = 'https://bbs.midoks.me/plugin.php?id=external_api&f=bbs_newest'
|
||||
api_next = 'https://bbs.midoks.me/plugin.php?id=external_api&f=bbs_next_tid&tid='
|
||||
|
||||
tid_push = mw.getServerDir() + '/tgbot/bbs_newest_push.json'
|
||||
|
||||
if not os.path.exists(tid_push):
|
||||
data = mw.httpGet(api_new)
|
||||
data = json.loads(data)
|
||||
if data['code'] == 0:
|
||||
tid = data['data'][0]['tid']
|
||||
mw.writeFile(tid_push, tid)
|
||||
return True, data['data'][0]
|
||||
|
||||
tid = mw.readFile(tid_push)
|
||||
data = mw.httpGet(api_next + tid)
|
||||
data = json.loads(data)
|
||||
if data['code'] == 0 and len(data['data']) > 0:
|
||||
# print(data)
|
||||
tid = data['data'][0]['tid']
|
||||
mw.writeFile(tid_push, tid)
|
||||
return True, data['data'][0]
|
||||
return False, None
|
||||
|
||||
|
||||
def send_msg(bot, tag='ad', trigger_time=300):
|
||||
# 信号只在一个周期内执行一次|start
|
||||
lock_file = mw.getServerDir() + '/tgbot/lock.json'
|
||||
if not os.path.exists(lock_file):
|
||||
mw.writeFile(lock_file, '{}')
|
||||
|
||||
lock_data = json.loads(mw.readFile(lock_file))
|
||||
if tag in lock_data:
|
||||
diff_time = time.time() - lock_data[tag]['do_time']
|
||||
if diff_time >= trigger_time:
|
||||
lock_data[tag]['do_time'] = time.time()
|
||||
else:
|
||||
return False, 0, 0
|
||||
else:
|
||||
lock_data[tag] = {'do_time': time.time()}
|
||||
mw.writeFile(lock_file, json.dumps(lock_data))
|
||||
# 信号只在一个周期内执行一次|end
|
||||
|
||||
yes, info = get_newest_tid()
|
||||
if yes:
|
||||
url = 'https://bbs.midoks.me/thread-' + info['tid'] + '-1-1.html'
|
||||
keyboard = [
|
||||
[
|
||||
types.InlineKeyboardButton(text=info['subject'], url=url)
|
||||
],
|
||||
[
|
||||
types.InlineKeyboardButton(
|
||||
text="论坛", url='https://bbs.midoks.me'),
|
||||
types.InlineKeyboardButton(
|
||||
text="搜索", url='https://bbs.midoks.me/search.php')
|
||||
]
|
||||
]
|
||||
markup = types.InlineKeyboardMarkup(keyboard)
|
||||
bot.send_message(
|
||||
chat_id, "由【" + info['author'] + "】发帖!", reply_markup=markup)
|
||||
|
||||
|
||||
def run(bot):
|
||||
send_msg(bot, 'push_bbs_newest_tid', 300)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(get_newest_tid())
|
||||
+25
-4
@@ -40,11 +40,29 @@ def send_msg(bot, tag='ad', trigger_time=300):
|
||||
mw.writeFile(lock_file, json.dumps(lock_data))
|
||||
# 信号只在一个周期内执行一次|end
|
||||
|
||||
# https://t.me/gjgzs2022 | 19/m
|
||||
# ♻️CMS导航网♻️/💰流量变现💰 | 28/m
|
||||
keyboard = [
|
||||
[
|
||||
types.InlineKeyboardButton(
|
||||
text="为了不打扰双方,私聊解决问题先转100U,否则无视!", url='tg://user?id=5568699210')
|
||||
],
|
||||
[
|
||||
types.InlineKeyboardButton(
|
||||
text="♻️CMS导航网♻️", url='https://t.me/maccms_jccms')
|
||||
],
|
||||
[
|
||||
types.InlineKeyboardButton(
|
||||
text="💰流量变现💰", url='https://t.me/taohaozhan')
|
||||
],
|
||||
[
|
||||
types.InlineKeyboardButton(
|
||||
text="🙎♂️代实名🙍♀️过人脸🅾️国际阿里云腾讯云(赞助商)", url='https://t.me/gjgzs2022')
|
||||
],
|
||||
[
|
||||
types.InlineKeyboardButton(
|
||||
text="💎DigitalVirt(赞助商)", url='https://digitalvirt.com/aff.php?aff=154')
|
||||
],
|
||||
[
|
||||
types.InlineKeyboardButton(
|
||||
text="论坛", url='https://bbs.midoks.me'),
|
||||
@@ -57,10 +75,13 @@ def send_msg(bot, tag='ad', trigger_time=300):
|
||||
chat_id, "由于在解决的问题的时候,不给信息,无法了解情况。以后不再群里回答技术问题。全部去论坛提问。在解决问题的过程中,可能需要面板信息,和SSH信息,如无法提供请不要提问。为了让群里都知晓。轮播一年", reply_markup=markup)
|
||||
|
||||
# print(msg.message_id)
|
||||
time.sleep(10)
|
||||
del_msg = bot.delete_message(chat_id=chat_id, message_id=msg.message_id)
|
||||
# print(del_msg)
|
||||
time.sleep(50)
|
||||
try:
|
||||
bot.delete_message(
|
||||
chat_id=chat_id, message_id=msg.message_id)
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
|
||||
def run(bot):
|
||||
send_msg(bot, 'tmp_msg', 13)
|
||||
send_msg(bot, 'tmp_msg', 200)
|
||||
@@ -181,6 +181,13 @@ def answer_callback_query(bot, call):
|
||||
|
||||
def run(bot, message):
|
||||
text_body = message.text
|
||||
|
||||
# 过滤URL
|
||||
is_has_url = re.search(
|
||||
'(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]', text_body)
|
||||
if is_has_url:
|
||||
return bot
|
||||
|
||||
# print(text_body)
|
||||
if isThisCmd('/faq:', text_body):
|
||||
cmd_text = getReadCmd('/faq:', text_body)
|
||||
|
||||
@@ -179,6 +179,17 @@ def setDaemon(t):
|
||||
else:
|
||||
t.setDaemon(True)
|
||||
|
||||
|
||||
def runBot(bot):
|
||||
try:
|
||||
bot.polling()
|
||||
except Exception as e:
|
||||
writeLog('-----runBot error start -------')
|
||||
writeLog(str(e))
|
||||
writeLog('-----runBot error end -------')
|
||||
time.sleep(1)
|
||||
runBot(bot)
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
# 机器人推送任务
|
||||
@@ -190,5 +201,7 @@ if __name__ == "__main__":
|
||||
botPushOtherTask.start()
|
||||
|
||||
writeLog('启动成功')
|
||||
bot.polling()
|
||||
runBot(bot)
|
||||
|
||||
|
||||
# asyncio.run(bot.polling())
|
||||
|
||||
@@ -14,12 +14,26 @@ install_tmp=${rootPath}/tmp/mw_install.pl
|
||||
VERSION=$2
|
||||
sys_os=`uname`
|
||||
|
||||
cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
# cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
# HTTP_PREFIX="https://"
|
||||
# if [ ! -z "$cn" ];then
|
||||
# HTTP_PREFIX="https://ghproxy.com/"
|
||||
# fi
|
||||
|
||||
HTTP_PREFIX="https://"
|
||||
if [ ! -z "$cn" ];then
|
||||
LOCAL_ADDR=common
|
||||
ping -c 1 gihub.com > /dev/null 2>&1
|
||||
if [ "$?" != "0" ];then
|
||||
LOCAL_ADDR=cn
|
||||
HTTP_PREFIX="https://ghproxy.com/"
|
||||
fi
|
||||
|
||||
PIPSRC="https://pypi.python.org/simple"
|
||||
if [ "$LOCAL_ADDR" != "common" ];then
|
||||
PIPSRC="https://pypi.tuna.tsinghua.edu.cn/simple"
|
||||
fi
|
||||
|
||||
|
||||
if [ "$sys_os" == "Darwin" ];then
|
||||
BAK='_bak'
|
||||
else
|
||||
@@ -96,7 +110,7 @@ Install_App()
|
||||
fi
|
||||
|
||||
# https://github.com/P3TERX/GeoLite.mmdb
|
||||
pip install geoip2
|
||||
pip install geoip2 -i $PIPSRC
|
||||
# if [ ! -f $serverPath/webstats/GeoLite2-City.mmdb ];then
|
||||
# wget --no-check-certificate -O $serverPath/webstats/GeoLite2-City.mmdb https://github.com/P3TERX/GeoLite.mmdb/releases/download/2022.10.16/GeoLite2-City.mmdb
|
||||
# fi
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 209 KiB After Width: | Height: | Size: 65 KiB |
@@ -204,7 +204,7 @@ mw_update()
|
||||
if [ "$LOCAL_ADDR" == "common" ];then
|
||||
curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update.sh | bash
|
||||
else
|
||||
curl --insecure -fsSL https://gitee.com/midoks/mdserver-web/raw/master/scripts/install.sh | bash
|
||||
curl --insecure -fsSL https://code.midoks.me/midoks/mdserver-web/raw/branch/dev/scripts/update.sh | bash
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ mw_update_dev()
|
||||
if [ "$LOCAL_ADDR" == "common" ];then
|
||||
curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh | bash
|
||||
else
|
||||
curl --insecure -fsSL https://gitee.com/midoks/mdserver-web/raw/dev/scripts/update_dev.sh | bash
|
||||
curl --insecure -fsSL https://code.midoks.me/midoks/mdserver-web/raw/branch/dev/scripts/update_dev.sh | bash
|
||||
fi
|
||||
cd /www/server/mdserver-web
|
||||
}
|
||||
|
||||
+2
-2
@@ -85,7 +85,7 @@ if [ $OSNAME != "macos" ];then
|
||||
if [ "$LOCAL_ADDR" != "common" ];then
|
||||
curl --insecure -sSLo /tmp/master.zip https://gitee.com/midoks/mdserver-web/repository/archive/master.zip
|
||||
else
|
||||
curl --insecure -sSLo /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master
|
||||
curl --insecure -sSLo /tmp/master.zip https://code.midoks.me/midoks/mdserver-web/archive/master.zip
|
||||
fi
|
||||
|
||||
cd /tmp && unzip /tmp/master.zip
|
||||
@@ -113,7 +113,7 @@ fi
|
||||
echo "use system version: ${OSNAME}"
|
||||
if [ "${OSNAME}" == "macos" ];then
|
||||
if [ "$LOCAL_ADDR" != "common" ];then
|
||||
curl --insecure -fsSL https://gitee.com/midoks/mdserver-web/raw/dev/scripts/install/macos.sh | bash
|
||||
curl --insecure -fsSL https://code.midoks.me/midoks/mdserver-web/raw/branch/master/scripts/install/macos.sh | bash
|
||||
else
|
||||
curl --insecure -fsSL ${HTTP_PREFIX}https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/install/macos.sh | bash
|
||||
fi
|
||||
|
||||
@@ -125,13 +125,13 @@ if [ $VERSION_ID -ge 8 ];then
|
||||
REPOS='--enablerepo=appstream,baseos,epel,extras,powertools'
|
||||
fi
|
||||
|
||||
for rpms in autoconf bzip2 bzip2-devel c-ares-devel \
|
||||
for rpms in gcc gcc-c++ lsof autoconf bzip2 bzip2-devel c-ares-devel \
|
||||
ca-certificates cairo-devel cmake crontabs curl curl-devel diffutils e2fsprogs e2fsprogs-devel \
|
||||
expat-devel expect file flex gcc gcc-c++ gd gd-devel gettext gettext-devel glib2 glib2-devel glibc.i686 \
|
||||
expat-devel expect file flex gd gd-devel gettext gettext-devel glib2 glib2-devel glibc.i686 \
|
||||
gmp-devel kernel-devel libXpm-devel libaio-devel libcap libcurl libcurl-devel libevent libevent-devel \
|
||||
libicu-devel libidn libidn-devel libmcrypt libmcrypt-devel libmemcached libmemcached-devel \
|
||||
libpng libpng-devel libstdc++.so.6 libtirpc libtirpc-devel libtool libtool-libs libwebp libwebp-devel \
|
||||
libxml2 libxml2-devel libxslt libxslt-devel libarchive lsof make mysql-devel ncurses ncurses-devel net-tools \
|
||||
libxml2 libxml2-devel libxslt libxslt-devel libarchive make mysql-devel ncurses ncurses-devel net-tools \
|
||||
oniguruma oniguruma-devel patch pcre pcre-devel perl perl-Data-Dumper perl-devel procps psmisc python3-devel \
|
||||
readline-devel rpcgen sqlite-devel tar unzip vim-minimal wget zip zlib zlib-devel ;
|
||||
do
|
||||
@@ -142,13 +142,13 @@ if [ $VERSION_ID -ge 8 ];then
|
||||
done
|
||||
else
|
||||
# CentOS 7
|
||||
for rpms in autoconf bison bzip2 bzip2-devel c-ares-devel ca-certificates cairo-devel \
|
||||
for rpms in gcc gcc-c++ lsof autoconf bison bzip2 bzip2-devel c-ares-devel ca-certificates cairo-devel \
|
||||
cmake cmake3 crontabs curl curl-devel diffutils e2fsprogs e2fsprogs-devel expat-devel expect file \
|
||||
flex freetype freetype-devel gcc gcc-c++ gd gd-devel gettext gettext-devel git-core glib2 glib2-devel \
|
||||
flex freetype freetype-devel gd gd-devel gettext gettext-devel git-core glib2 glib2-devel \
|
||||
glibc.i686 gmp-devel graphviz icu kernel-devel libXpm-devel libaio-devel libcap libcurl libcurl-devel \
|
||||
libevent libevent-devel libicu-devel libidn libidn-devel libjpeg-devel libmcrypt libmcrypt-devel \
|
||||
libmemcached libmemcached-devel libpng-devel libstdc++.so.6 libtirpc libtirpc-devel libtool libtool-libs \
|
||||
libwebp libwebp-devel libxml2 libxml2-devel libxslt libxslt-devel libzip libzip-devel libzstd-devel lsof \
|
||||
libwebp libwebp-devel libxml2 libxml2-devel libxslt libxslt-devel libzip libzip-devel libzstd-devel \
|
||||
make mysql-devel ncurses ncurses-devel net-tools oniguruma oniguruma-devel openldap openldap-devel \
|
||||
openssl openssl-devel patch pcre pcre-devel perl perl-Data-Dumper perl-devel psmisc python-devel \
|
||||
python3-devel python3-pip re2c readline-devel rpcgen sqlite-devel tar unzip vim-minimal vixie-cron \
|
||||
|
||||
@@ -86,7 +86,7 @@ if [ $OSNAME != "macos" ];then
|
||||
if [ "$LOCAL_ADDR" == "common" ];then
|
||||
curl --insecure -sSLo /tmp/dev.zip ${HTTP_PREFIX}github.com/midoks/mdserver-web/archive/refs/heads/dev.zip
|
||||
else
|
||||
curl --insecure -sSLo /tmp/dev.zip https://gitee.com/midoks/mdserver-web/repository/archive/dev.zip
|
||||
curl --insecure -sSLo /tmp/dev.zip https://code.midoks.me/midoks/mdserver-web/archive/dev.tar.gz
|
||||
fi
|
||||
|
||||
cd /tmp && unzip /tmp/dev.zip
|
||||
@@ -116,7 +116,7 @@ echo "use system version: ${OSNAME}"
|
||||
|
||||
if [ "${OSNAME}" == "macos" ];then
|
||||
if [ "$LOCAL_ADDR" != "common" ];then
|
||||
curl --insecure -fsSL https://gitee.com/midoks/mdserver-web/raw/dev/scripts/install/macos.sh | bash
|
||||
curl --insecure -fsSL https://code.midoks.me/midoks/mdserver-web/raw/branch/master/scripts/install/macos.sh | bash
|
||||
else
|
||||
curl --insecure -fsSL ${HTTP_PREFIX}https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/install/macos.sh | bash
|
||||
fi
|
||||
|
||||
+9
-5
@@ -47,13 +47,16 @@ else
|
||||
echo "OK"
|
||||
fi
|
||||
|
||||
# cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
|
||||
HTTP_PREFIX="https://"
|
||||
LOCAL_ADDR=common
|
||||
ping -c 1 pypi.python.org > /dev/null 2>&1
|
||||
if [ "$?" != "0" ];then
|
||||
LOCAL_ADDR=cn
|
||||
HTTP_PREFIX="https://ghproxy.com/"
|
||||
ping -c 1 ipinfo.io > /dev/null 2>&1
|
||||
if [ "$?" == "0" ];then
|
||||
CN=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
if [ -z "$CN" ];then
|
||||
LOCAL_ADDR=cn
|
||||
HTTP_PREFIX="https://ghproxy.com/"
|
||||
fi
|
||||
fi
|
||||
|
||||
PIPSRC="https://pypi.python.org/simple"
|
||||
@@ -69,6 +72,7 @@ fi
|
||||
|
||||
which pip && pip install --upgrade pip -i $PIPSRC
|
||||
pip3 install --upgrade pip setuptools wheel -i $PIPSRC
|
||||
|
||||
cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt -i $PIPSRC
|
||||
|
||||
# pip3 install flask-caching==1.10.1
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ fi
|
||||
|
||||
|
||||
if [ "$LOCAL_ADDR" != "common" ];then
|
||||
curl --insecure -sSLo /tmp/master.zip https://gitee.com/midoks/mdserver-web/repository/archive/master.zip
|
||||
curl --insecure -sSLo /tmp/master.zip https://code.midoks.me/midoks/mdserver-web/archive/master.zip
|
||||
else
|
||||
curl --insecure -sSLo /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master
|
||||
fi
|
||||
|
||||
@@ -64,7 +64,7 @@ if [ "$?" != "0" ];then
|
||||
fi
|
||||
|
||||
if [ "$LOCAL_ADDR" != "common" ];then
|
||||
curl --insecure -sSLo /tmp/dev.zip https://gitee.com/midoks/mdserver-web/repository/archive/dev.zip
|
||||
curl --insecure -sSLo /tmp/dev.zip https://code.midoks.me/midoks/mdserver-web/archive/dev.zip
|
||||
else
|
||||
curl --insecure -sSLo /tmp/dev.zip https://github.com/midoks/mdserver-web/archive/refs/heads/dev.zip
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user