Skip to content

Commit

Permalink
Merge pull request #397 from midoks/dev
Browse files Browse the repository at this point in the history
0.13.4
  • Loading branch information
midoks authored Mar 28, 2023
2 parents 265e17b + 2f39bd6 commit 3421bf6
Show file tree
Hide file tree
Showing 20 changed files with 359 additions and 57 deletions.
35 changes: 18 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,51 +99,52 @@ 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
```

### 备用地址

- 初始安装

```
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
```


Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion class/core/config_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

class config_api:

__version = '0.13.3'
__version = '0.13.4'
__api_addr = 'data/api.json'

def __init__(self):
Expand Down
4 changes: 2 additions & 2 deletions plugins/gitea/info.json
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion plugins/gitea/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 12 additions & 1 deletion plugins/openresty/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 27 additions & 0 deletions plugins/tgbot/startup/extend/init_cmd.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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


def init(bot):
bot.delete_my_commands(scope=None, language_code=None)
bot.set_my_commands(
commands=[
telebot.types.BotCommand("start", "查看帮助信息"),
telebot.types.BotCommand("faq", "查看bbs帖子主题【不要忘记:冒号】"),
],
)
18 changes: 17 additions & 1 deletion plugins/tgbot/startup/extend/push_ad.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand All @@ -66,4 +82,4 @@ def send_msg(bot, tag='ad', trigger_time=300):


def run(bot):
send_msg(bot, 'ad', 6 * 60 * 60)
send_msg(bot, 'ad', 1 * 60 * 60)
93 changes: 93 additions & 0 deletions plugins/tgbot/startup/extend/push_bbs_ntid.py
Original file line number Diff line number Diff line change
@@ -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())
87 changes: 87 additions & 0 deletions plugins/tgbot/startup/extend/push_notice_msg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# 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 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

# 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'),
types.InlineKeyboardButton(
text="搜索", url='https://bbs.midoks.me/search.php')
]
]
markup = types.InlineKeyboardMarkup(keyboard)
msg = bot.send_message(
chat_id, "由于在解决的问题的时候,不给信息,无法了解情况。以后不再群里回答技术问题。全部去论坛提问。在解决问题的过程中,可能需要面板信息,和SSH信息,如无法提供请不要提问。为了让群里都知晓。轮播一年", reply_markup=markup)

# print(msg.message_id)
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', 200)
Loading

0 comments on commit 3421bf6

Please sign in to comment.