Merge pull request #698 from midoks/dev

openresty配置优化
pull/710/head
Mr Chen 4 months ago committed by GitHub
commit 4cc5194939
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      plugins/openresty/conf/nginx.conf
  2. 25
      plugins/openresty/index.py
  3. 21
      plugins/tgbot/startup/extend/push_ad.py
  4. 23
      plugins/tgbot/startup/extend/push_notice_msg.py

@ -1,5 +1,6 @@
user {$OS_USER} {$OS_USER_GROUP};
worker_processes auto;
worker_cpu_affinity auto;
error_log {$SERVER_PATH}/openresty/nginx/logs/error.log crit;
pid {$SERVER_PATH}/openresty/nginx/logs/nginx.pid;

@ -503,6 +503,23 @@ def getCfg():
return mw.returnJson(True, "ok", rdata)
def replaceChar(value, index, new_char):
return value[:index] + new_char + value[index+1:]
def makeWorkerCpuAffinity(val):
if val == "auto":
return "auto"
if mw.isNumber(val):
core_num = int(val)
default_core_str = "0"*core_num
core_num_arr = []
for x in range(core_num):
t = replaceChar(default_core_str, x , "1")
core_num_arr.append(t)
return " ".join(core_num_arr)
return 'auto'
def setCfg():
@ -544,6 +561,14 @@ def setCfg():
if not re.search(r"\d+", v):
return mw.returnJson(False, '参数值错误,请输入数字整数')
if k == "worker_processes" :
k_wca = "worker_cpu_affinity"
rep_wca = r"%s\s+[^\;\n]+" % k_wca
v_wca = makeWorkerCpuAffinity(v)
newconf = "%s %s" % (k_wca, v_wca)
content = re.sub(rep_wca, newconf, content)
if re.search(rep, content):
newconf = "%s %s" % (k, v)
content = re.sub(rep, newconf, content)

@ -47,35 +47,20 @@ def send_msg(bot, tag='ad', trigger_time=300):
# 跨链混币器Cce.Cash💰低手续费💰隔断溯源 | 10/m | next,6/10 | @hu ge
# TTKCDN 无视移动墙/GFW/SNI阻断 TG第一性价比 | 10/m | @ssdpflood
# SJ资源网播放计费| 14/m | next,4/14 |@sjllzyw
# https://t.me/gjgzs2022 | 22/m | @GJ_gzs
# 综合包网/NG接口开户 | 28/m | 6m | next,4/28 | x
# 实名认证/过人脸🕵各种账号处理✅ | 30/m| next,6/30 | @nngzs
# 桃花资源采集| 13/m| next,1/13 | @xiaolizi1122
# 桃花资源采集| 13/m| next,7/13 | @xiaolizi1122
keyboard = [
[
types.InlineKeyboardButton(
text="TTKCDN 性价比最高的商业CDN", url='https://t.me/ssdpflood')
],
[
types.InlineKeyboardButton(
text="TTKCDN 过河南郑州/泉州等地区阻断", url='https://t.me/ssdpflood')
],
[
types.InlineKeyboardButton(
text="TTKCDN 私人定制 属于你自己的独立CDN", url='https://t.me/ssdpflood')
],
[
types.InlineKeyboardButton(
text="TTKCDN 全系主动防御 全球威胁情报网", url='https://t.me/ssdpflood')
text="SJ资源网播放计费", url='https://sjzy.tv?mw')
],
[
types.InlineKeyboardButton(
text="跨链混币器Cce.Cash💰低手续费💰隔断溯源", url='https://cce.cash/#/main/home?MW')
],
[
types.InlineKeyboardButton(
text="TTKCDN 无视移动墙/GFW/SNI阻断 TG第一性价比", url='https://t.me/ssdpflood')
],
[
types.InlineKeyboardButton(
text="桃花资源采集🚀 ", url='https://thzy.me')

@ -56,35 +56,20 @@ def send_msg(bot, tag='ad', trigger_time=300):
# 跨链混币器Cce.Cash💰低手续费💰隔断溯源 | 10/m | next,6/10 | @hu ge
# TTKCDN | 10/m | @ssdpflood | 5
# SJ资源网播放计费| 14/m | next,4/14 |@sjllzyw
# https://t.me/gjgzs2022 | 22/m | @GJ_gzs
# 综合包网/NG接口开户 | 28/m | 6m | next,4/28 | x
# 实名认证/过人脸🕵各种账号处理✅ | 30/m| next,6/30 | @nngzs
# 桃花资源采集| 13/m| next,1/13 | @xiaolizi1122
# 桃花资源采集| 13/m| next,7/13 | @xiaolizi1122
keyboard = [
[
types.InlineKeyboardButton(
text="TTKCDN 性价比最高的商业CDN", url='https://t.me/ssdpflood')
],
[
types.InlineKeyboardButton(
text="TTKCDN 过河南郑州/泉州等地区阻断", url='https://t.me/ssdpflood')
],
[
types.InlineKeyboardButton(
text="TTKCDN 私人定制 属于你自己的独立CDN", url='https://t.me/ssdpflood')
],
[
types.InlineKeyboardButton(
text="TTKCDN 全系主动防御 全球威胁情报网", url='https://t.me/ssdpflood')
text="SJ资源网播放计费", url='https://sjzy.tv?mw')
],
[
types.InlineKeyboardButton(
text="跨链混币器Cce.Cash💰低手续费💰隔断溯源", url='https://cce.cash/#/main/home?MW')
],
[
types.InlineKeyboardButton(
text="TTKCDN 无视移动墙/GFW/SNI阻断 TG第一性价比", url='https://t.me/ssdpflood')
],
[
types.InlineKeyboardButton(
text="桃花资源采集🚀 ", url='https://thzy.me')
@ -119,7 +104,7 @@ def send_msg(bot, tag='ad', trigger_time=300):
types.InlineKeyboardButton(
text="@ME", url='tg://user?id=5568699210'),
types.InlineKeyboardButton(
text="150RMB/月[已满]", url='tg://user?id=5568699210')
text="150RMB/月", url='tg://user?id=5568699210')
]
]
markup = types.InlineKeyboardMarkup(keyboard)

Loading…
Cancel
Save