mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 15:49:26 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a12c4dd78e | ||
|
|
39c6f19592 | ||
|
|
f18c05a097 | ||
|
|
80f296ea19 | ||
|
|
b3e9283a58 | ||
|
|
2e140a3ae1 | ||
|
|
4d733c8886 | ||
|
|
62a7320baf | ||
|
|
3dc7c2f5c1 | ||
|
|
fe62bbee06 | ||
|
|
f7c0cd82a0 | ||
|
|
13a2014558 | ||
|
|
5981f94376 | ||
|
|
005e0f1513 | ||
|
|
63a0f0fbdc | ||
|
|
edc0be11a1 | ||
|
|
908b6e67c6 | ||
|
|
dfe46332db | ||
|
|
fcdf2e18b2 | ||
|
|
3c8f9bcf96 | ||
|
|
ebadd6d80d | ||
|
|
6062699074 | ||
|
|
df9d57ba70 | ||
|
|
ffca953539 | ||
|
|
bd4946124f | ||
|
|
8e18c63cee | ||
|
|
d201ca2574 | ||
|
|
b644f91090 | ||
|
|
931f51cf59 | ||
|
|
0909a11fd9 | ||
|
|
2ba2833699 | ||
|
|
20389263fb | ||
|
|
86141ccf3a | ||
|
|
b2fdf84ca0 | ||
|
|
8fbc456e1a | ||
|
|
4e43382496 | ||
|
|
0326d4f112 | ||
|
|
a87c13c5e0 | ||
|
|
5f3720c855 | ||
|
|
f548e020c4 | ||
|
|
7f21781c0b | ||
|
|
680b0f09f2 | ||
|
|
482943a63c | ||
|
|
2871aee18e | ||
|
|
ff46d9b36e | ||
|
|
fd5fcba543 |
@@ -99,11 +99,11 @@ docker run -itd --name mw-server --privileged=true -p 7200:7200 -p 80:80 -p 443:
|
||||
```
|
||||
|
||||
|
||||
### 版本更新 0.14.2
|
||||
### 版本更新 0.14.4
|
||||
|
||||
* 加入TgClient插件
|
||||
* 网站防篡改程序(测试中)
|
||||
* Docker(测试中)
|
||||
* 安装优化,redat系列优化。
|
||||
* PHP74-82在redat的安装修复(oniguruma)。
|
||||
* 面板端口修改优化。
|
||||
|
||||
### JSDelivr安装地址
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ from flask import request
|
||||
|
||||
class config_api:
|
||||
|
||||
__version = '0.14.2'
|
||||
__version = '0.14.4'
|
||||
__api_addr = 'data/api.json'
|
||||
|
||||
def __init__(self):
|
||||
|
||||
@@ -17,6 +17,7 @@ datadir = {$SERVER_APP_PATH}/data
|
||||
log-error = {$SERVER_APP_PATH}/data/error.log
|
||||
server-id = {$SERVER_ID}
|
||||
|
||||
explicit_defaults_for_timestamp=true
|
||||
default_storage_engine = InnoDB
|
||||
|
||||
|
||||
@@ -95,7 +96,7 @@ innodb_file_per_table = 1
|
||||
innodb_large_prefix = 1
|
||||
|
||||
secure-file-priv={$SERVER_APP_PATH}/tmp
|
||||
|
||||
#secure-file-priv=disabled
|
||||
[mysqldump]
|
||||
quick
|
||||
|
||||
|
||||
@@ -383,7 +383,7 @@ def initMysql57Data():
|
||||
myconf = serverdir + "/etc/my.cnf"
|
||||
user = pGetDbUser()
|
||||
cmd = 'cd ' + serverdir + ' && ./bin/mysqld --defaults-file=' + myconf + \
|
||||
' --initialize-insecure --explicit_defaults_for_timestamp'
|
||||
' --initialize-insecure --explicit_defaults_for_timestamp --user=mysql'
|
||||
data = mw.execShell(cmd)
|
||||
# print(data)
|
||||
return False
|
||||
|
||||
@@ -72,7 +72,6 @@ if [ "${action}" == "install" ] && [ -d ${serverPath}/php/${type} ];then
|
||||
cd ${rootPath}/plugins/php/versions/common && bash gettext.sh install ${type}
|
||||
cd ${rootPath}/plugins/php/versions/common && bash redis.sh install ${type}
|
||||
cd ${rootPath}/plugins/php/versions/common && bash memcached.sh install ${type}
|
||||
cd ${rootPath}/plugins/php/versions/common && bash zlib.sh install ${type}
|
||||
|
||||
if [ "${type}" -gt "72" ];then
|
||||
cd ${rootPath}/plugins/php/versions/common && bash zip.sh install ${type}
|
||||
|
||||
@@ -10,7 +10,6 @@ sourcePath=${serverPath}/source
|
||||
sysName=`uname`
|
||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||
|
||||
|
||||
function version_gt() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; }
|
||||
function version_le() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" == "$1"; }
|
||||
function version_lt() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" != "$1"; }
|
||||
@@ -29,6 +28,12 @@ cd ${rootPath}/plugins/php/lib && /bin/bash freetype_new.sh
|
||||
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
||||
cd ${rootPath}/plugins/php/lib && /bin/bash libzip.sh
|
||||
|
||||
# redat ge 8
|
||||
which yum
|
||||
if [ "$?" == "0" ];then
|
||||
cd ${rootPath}/plugins/php/lib && /bin/bash oniguruma.sh
|
||||
fi
|
||||
|
||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
|
||||
@@ -28,6 +28,12 @@ mkdir -p $serverPath/php
|
||||
cd ${rootPath}/plugins/php/lib && /bin/bash freetype_new.sh
|
||||
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
||||
|
||||
# redat ge 8
|
||||
which yum
|
||||
if [ "$?" == "0" ];then
|
||||
cd ${rootPath}/plugins/php/lib && /bin/bash oniguruma.sh
|
||||
fi
|
||||
|
||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
|
||||
@@ -28,6 +28,11 @@ mkdir -p $serverPath/php
|
||||
cd ${rootPath}/plugins/php/lib && /bin/bash freetype_new.sh
|
||||
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
||||
|
||||
# redat ge 8
|
||||
which yum
|
||||
if [ "$?" == "0" ];then
|
||||
cd ${rootPath}/plugins/php/lib && /bin/bash oniguruma.sh
|
||||
fi
|
||||
|
||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||
|
||||
|
||||
@@ -28,6 +28,11 @@ mkdir -p $serverPath/php
|
||||
cd ${rootPath}/plugins/php/lib && /bin/bash freetype_new.sh
|
||||
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
|
||||
|
||||
# redat ge 8
|
||||
which yum
|
||||
if [ "$?" == "0" ];then
|
||||
cd ${rootPath}/plugins/php/lib && /bin/bash oniguruma.sh
|
||||
fi
|
||||
|
||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||
|
||||
|
||||
@@ -44,15 +44,8 @@ def send_msg(bot, tag='ad', trigger_time=300):
|
||||
# https://t.me/gjgzs2022 | 19/m
|
||||
# ♻️CMS导航网♻️/💰流量变现💰 | 28/m
|
||||
# CK资源采集 |29/m
|
||||
# 高防服务器CDN请联系玥玥 |3/m
|
||||
|
||||
# https://zhaoziyuan.la/ | 15/m | 2m | next,5/15
|
||||
|
||||
keyboard = [
|
||||
[
|
||||
types.InlineKeyboardButton(
|
||||
text="海外服务器高防CDN请联系玥玥", url='https://t.me/CDNYUEYUE')
|
||||
],
|
||||
[
|
||||
types.InlineKeyboardButton(
|
||||
text="CK资源采集", url='https://ckzy1.com/')
|
||||
|
||||
@@ -43,12 +43,7 @@ def send_msg(bot, tag='ad', trigger_time=300):
|
||||
# https://t.me/gjgzs2022 | 19/m
|
||||
# ♻️CMS导航网♻️/💰流量变现💰 | 28/m
|
||||
# CK资源采集 |29/m
|
||||
# 高防服务器CDN请联系玥玥 |3/m
|
||||
keyboard = [
|
||||
[
|
||||
types.InlineKeyboardButton(
|
||||
text="海外服务器高防CDN请联系玥玥", url='https://t.me/CDNYUEYUE')
|
||||
],
|
||||
[
|
||||
types.InlineKeyboardButton(
|
||||
text="CK资源采集", url='https://ckzy1.com/')
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
# coding:utf-8
|
||||
|
||||
# func: 在其他发送推送AD
|
||||
# url: https://docs.telethon.dev/en/stable/modules/client.html
|
||||
import sys
|
||||
import io
|
||||
import os
|
||||
import time
|
||||
import re
|
||||
import json
|
||||
import base64
|
||||
import threading
|
||||
import asyncio
|
||||
|
||||
sys.path.append(os.getcwd() + "/class/core")
|
||||
import mw
|
||||
|
||||
from telethon import utils
|
||||
from telethon import functions, types
|
||||
from telethon.tl.functions.messages import AddChatUserRequest
|
||||
from telethon.tl.functions.channels import InviteToChannelRequest
|
||||
# 指定群ID
|
||||
chat_id_list = [-1001578009023]
|
||||
filter_g_id = [-1001771526434]
|
||||
|
||||
|
||||
msg_ad = "本人软件推广(30s)\n\n"
|
||||
msg_ad += "开源地址(Linux面板) mdserver-web,站长必备,不收费,无毒。源码为证。全靠TG乞讨! \n"
|
||||
msg_ad += "看个人简介,加入群聊,一起进步!\n"
|
||||
# msg_ad += "https://github.com/midoks/mdserver-web \n"
|
||||
# msg_ad += "\n"
|
||||
# msg_ad += "加入群聊,一起进步! \n"
|
||||
# msg_ad += "https://t.me/mdserver_web \n"
|
||||
# msg_ad += "不收费,无毒。源码为证。全靠TG乞讨!😭\n\n"
|
||||
# msg_ad += "捐赠地址 USDT(TRC20)\n"
|
||||
# msg_ad += "TVbNgrpeGBGZVm5gTLa21ADP7RpnPFhjya\n"
|
||||
# msg_ad += "日行一善,以后必定大富大贵\n"
|
||||
|
||||
|
||||
async def writeLog(log_str):
|
||||
if __name__ == "__main__":
|
||||
print(log_str)
|
||||
|
||||
now = mw.getDateFromNow()
|
||||
log_file = mw.getServerDir() + '/tgclient/task.log'
|
||||
mw.writeFileLog(now + ':' + log_str, log_file, limit_size=5 * 1024)
|
||||
return True
|
||||
|
||||
async def send_msg(client, chat_id, tag='ad', trigger_time=600):
|
||||
# 信号只在一个周期内执行一次|start
|
||||
lock_file = mw.getServerDir() + '/tgclient/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
|
||||
|
||||
msg = await client.send_message(chat_id, msg_ad)
|
||||
await asyncio.sleep(30)
|
||||
await client.delete_messages(chat_id, msg)
|
||||
await asyncio.sleep(3)
|
||||
|
||||
async def run(client):
|
||||
client.parse_mode = 'html'
|
||||
# for chat_id in chat_id_list:
|
||||
# await send_msg(client, chat_id)
|
||||
# await asyncio.sleep(30)
|
||||
|
||||
info = await client.get_dialogs()
|
||||
for chat in info:
|
||||
if chat.is_group and not chat.id in filter_g_id:
|
||||
# print(chat)
|
||||
await writeLog('name:{0} id:{1} is_user:{2} is_channel:{3} is_group:{4}'.format(
|
||||
chat.name, chat.id, chat.is_user, chat.is_channel, chat.is_group))
|
||||
try:
|
||||
await send_msg(client, chat.id, 'ad_' + str(chat.id))
|
||||
except Exception as e:
|
||||
await writeLog(str(e))
|
||||
|
||||
if __name__ == "__main__":
|
||||
pass
|
||||
@@ -24,21 +24,20 @@ from telebot.util import quick_markup
|
||||
chat_id_list = [-1001578009023, -1001979545570]
|
||||
|
||||
async def run(client):
|
||||
while True:
|
||||
for chat_id in chat_id_list:
|
||||
s = await client.send_message(chat_id, '开始自动检测已经注销群成员...')
|
||||
count = 0
|
||||
async for user in client.iter_participants(chat_id):
|
||||
if user.deleted:
|
||||
count += 1
|
||||
msg = await client.kick_participant(chat_id, user)
|
||||
for chat_id in chat_id_list:
|
||||
s = await client.send_message(chat_id, '开始自动检测已经注销群成员...')
|
||||
count = 0
|
||||
async for user in client.iter_participants(chat_id):
|
||||
if user.deleted:
|
||||
count += 1
|
||||
msg = await client.kick_participant(chat_id, user)
|
||||
|
||||
await client.edit_message(chat_id, s.id, '已经检测到有(%d)个账户已失效' % (count))
|
||||
await asyncio.sleep(3)
|
||||
await client.edit_message(chat_id, s.id, '自动检测已经注销群成员完毕!!!')
|
||||
await asyncio.sleep(3)
|
||||
await client.delete_messages(chat_id, s)
|
||||
await asyncio.sleep(300)
|
||||
await client.edit_message(chat_id, s.id, '已经检测到有(%d)个账户已失效' % (count))
|
||||
await asyncio.sleep(3)
|
||||
await client.edit_message(chat_id, s.id, '自动检测已经注销群成员完毕!!!')
|
||||
await asyncio.sleep(3)
|
||||
await client.delete_messages(chat_id, s)
|
||||
await asyncio.sleep(300)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -22,36 +22,34 @@ from telethon.tl.functions.channels import InviteToChannelRequest
|
||||
# 指定群ID
|
||||
chat_id = -1001979545570
|
||||
filter_user_id = 5568699210
|
||||
filter_g_id = [-1001771526434]
|
||||
|
||||
|
||||
async def run(client):
|
||||
while True:
|
||||
info = await client.get_dialogs()
|
||||
for chat in info:
|
||||
print('name:{0} ids:{1} is_user:{2} is_channel:{3} is_group:{4}'.format(
|
||||
chat.name, chat.id, chat.is_user, chat.is_channel, chat.is_group))
|
||||
if chat.is_group and chat.id != chat_id:
|
||||
list_user = []
|
||||
async for user in client.iter_participants(chat.id):
|
||||
# print(chat.id, user.id, user.first_name)
|
||||
if filter_user_id != user.id and user.username != None and user.bot == False:
|
||||
# print(user.first_name)
|
||||
list_user.append(user.username)
|
||||
# await client(AddChatUserRequest(
|
||||
# chat_id=chat_id, # chat_id
|
||||
# user_id=user.username, # 被邀请人id
|
||||
# fwd_limit=1000 # Allow the user to see the 10 last messages
|
||||
# ))
|
||||
# print(list_user)
|
||||
try:
|
||||
await client(InviteToChannelRequest(
|
||||
channel=chat_id, # chat_id
|
||||
users=list_user, # 被邀请人id
|
||||
))
|
||||
except Exception as e:
|
||||
print(str(e))
|
||||
info = await client.get_dialogs()
|
||||
for chat in info:
|
||||
is_sleep = True
|
||||
print('name:{0} id:{1} is_user:{2} is_channel:{3} is_group:{4}'.format(
|
||||
chat.name, chat.id, chat.is_user, chat.is_channel, chat.is_group))
|
||||
if chat.is_group and chat.id != chat_id:
|
||||
list_user = []
|
||||
async for user in client.iter_participants(chat.id):
|
||||
if chat.id in filter_g_id:
|
||||
is_sleep = False
|
||||
continue
|
||||
|
||||
await asyncio.sleep(80000)
|
||||
await asyncio.sleep(80000)
|
||||
if filter_user_id != user.id and user.username != None and user.bot == False:
|
||||
list_user.append(user.username)
|
||||
print(list_user)
|
||||
try:
|
||||
await client(InviteToChannelRequest(
|
||||
channel=chat_id, # chat_id
|
||||
users=list_user, # 被邀请人id
|
||||
))
|
||||
except Exception as e:
|
||||
print(str(e))
|
||||
if is_sleep:
|
||||
await asyncio.sleep(90000)
|
||||
|
||||
if __name__ == "__main__":
|
||||
pass
|
||||
|
||||
@@ -12,7 +12,10 @@ import asyncio
|
||||
import logging
|
||||
|
||||
# python /Users/midoks/Desktop/mwdev/server/tgclient/tgclient.py
|
||||
# cd /www/server/mdserver-web && python3 /www/server/tgclient/tgclient.py
|
||||
|
||||
'''
|
||||
cd /www/server/mdserver-web && source bin/activate && python3 /www/server/tgclient/tgclient.py
|
||||
'''
|
||||
|
||||
from telethon import TelegramClient
|
||||
|
||||
@@ -96,7 +99,7 @@ while True:
|
||||
|
||||
client = TelegramClient('mdioks', cfg['bot']['api_id'], cfg['bot']['api_hash'])
|
||||
|
||||
async def plugins_run():
|
||||
async def plugins_run_task():
|
||||
plist = getStartExtCfgByTag('client')
|
||||
for p in plist:
|
||||
try:
|
||||
@@ -107,6 +110,11 @@ async def plugins_run():
|
||||
writeLog(mw.getTracebackInfo())
|
||||
writeLog('----- client error end -------')
|
||||
|
||||
async def plugins_run():
|
||||
while True:
|
||||
await plugins_run_task()
|
||||
time.sleep(1)
|
||||
|
||||
async def main(loop):
|
||||
await client.start()
|
||||
|
||||
|
||||
@@ -36,10 +36,14 @@ $('input[name="host_ip"]').change(function(){
|
||||
|
||||
$('input[name="port"]').change(function(){
|
||||
var port = $(this).val();
|
||||
var old_port = $(this).data('port');
|
||||
$('.btn_port').removeAttr('disabled');
|
||||
$('.btn_port').unbind().click(function(){
|
||||
$.post('/config/set_port','port='+port, function(rdata){
|
||||
showMsg(rdata.msg,function(){window.location.reload();},{icon:rdata.status?1:2},2000);
|
||||
showMsg(rdata.msg,function(){
|
||||
window.location.href = window.location.href.replace(old_port,port);
|
||||
// window.location.reload();
|
||||
},{icon:rdata.status?1:2},5000);
|
||||
},'json');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
<p class="mtb15">
|
||||
<span class="set-tit text-right">面板端口</span>
|
||||
<input id="banport" name="port" class="inputtxt bt-input-text" type="numner" value="{{data['port']}}" maxlength="5">
|
||||
<input data-port="{{data['port']}}" id="banport" name="port" class="inputtxt bt-input-text" type="numner" value="{{data['port']}}" maxlength="5">
|
||||
<button type="button" class="btn btn-success btn-sm ml5 btn_port" disabled>保存</button>
|
||||
<span class="set-info c7">建议端口范围7200 - 65535</span>
|
||||
</p>
|
||||
|
||||
+11
-11
@@ -22,32 +22,32 @@ fi
|
||||
|
||||
if [ ${_os} == "Darwin" ]; then
|
||||
OSNAME='macos'
|
||||
elif grep -Eq "openSUSE" /etc/*-release; then
|
||||
elif grep -Eqi "openSUSE" /etc/*-release; then
|
||||
OSNAME='opensuse'
|
||||
zypper refresh
|
||||
zypper install cron wget curl zip unzip
|
||||
elif grep -Eq "FreeBSD" /etc/*-release; then
|
||||
elif grep -Eqi "FreeBSD" /etc/*-release; then
|
||||
OSNAME='freebsd'
|
||||
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
|
||||
elif grep -Eqi "CentOS" /etc/issue || grep -Eqi "CentOS" /etc/*-release; then
|
||||
OSNAME='rhel'
|
||||
yum install -y wget curl zip unzip tar crontabs
|
||||
elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
|
||||
OSNAME='fedora'
|
||||
yum install -y wget curl zip unzip tar crontabs
|
||||
elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
|
||||
elif grep -Eqi "Fedora" /etc/issue || grep -Eqi "Fedora" /etc/*-release; then
|
||||
OSNAME='rhel'
|
||||
yum install -y wget curl zip unzip tar crontabs
|
||||
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
|
||||
elif grep -Eqi "Rocky" /etc/issue || grep -Eqi "Rocky" /etc/*-release; then
|
||||
OSNAME='rhel'
|
||||
yum install -y wget curl zip unzip tar crontabs
|
||||
elif grep -Eqi "Amazon Linux" /etc/issue || grep -Eq "Amazon Linux" /etc/*-release; then
|
||||
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eqi "AlmaLinux" /etc/*-release; then
|
||||
OSNAME='rhel'
|
||||
yum install -y wget curl zip unzip tar crontabs
|
||||
elif grep -Eqi "Amazon Linux" /etc/issue || grep -Eqi "Amazon Linux" /etc/*-release; then
|
||||
OSNAME='amazon'
|
||||
yum install -y wget curl zip unzip tar crontabs
|
||||
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/os-release; then
|
||||
elif grep -Eqi "Debian" /etc/issue || grep -Eqi "Debian" /etc/os-release; then
|
||||
OSNAME='debian'
|
||||
apt update -y
|
||||
apt install -y wget curl zip unzip tar cron
|
||||
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/os-release; then
|
||||
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eqi "Ubuntu" /etc/os-release; then
|
||||
OSNAME='ubuntu'
|
||||
apt update -y
|
||||
apt install -y wget curl zip unzip tar cron
|
||||
|
||||
@@ -18,7 +18,9 @@ yum install -y python3-devel
|
||||
yum install -y python3-pip
|
||||
yum install -y python-devel
|
||||
yum install -y vixie-cron
|
||||
yum install -y curl-devel libmcrypt libmcrypt-devel
|
||||
yum install -y curl-devel
|
||||
yum install -y libmcrypt
|
||||
yum install -y libmcrypt-devel
|
||||
yum install -y mysql-devel
|
||||
yum install -y expect
|
||||
|
||||
|
||||
@@ -188,7 +188,12 @@ fi
|
||||
#https://blog.csdn.net/qq_36228377/article/details/123154344
|
||||
# ln -s /usr/include/x86_64-linux-gnu/curl /usr/include/curl
|
||||
if [ ! -d /usr/include/curl ];then
|
||||
ln -s /usr/include/x86_64-linux-gnu/curl /usr/include/curl
|
||||
SYS_ARCH=`arch`
|
||||
if [ -f /usr/include/x86_64-linux-gnu/curl ];then
|
||||
ln -s /usr/include/x86_64-linux-gnu/curl /usr/include/curl
|
||||
else
|
||||
ln -s /usr/include/${SYS_ARCH}-linux-gnu/curl /usr/include/curl
|
||||
fi
|
||||
fi
|
||||
|
||||
apt install -y graphviz bison re2c flex libsqlite3-dev libonig-dev perl g++ libtool libxslt1-dev
|
||||
|
||||
@@ -68,7 +68,7 @@ yum install -y epel-release
|
||||
|
||||
yum install -y libevent libevent-devel zip libmcrypt libmcrypt-devel
|
||||
yum install -y gcc libffi-devel python-devel openssl-devel
|
||||
yum install -y curl-devel libmcrypt libmcrypt-devel python3-devel
|
||||
yum install -y libmcrypt libmcrypt-devel python3-devel
|
||||
|
||||
yum install -y wget python-devel python-imaging libicu-devel unzip bzip2-devel gcc libxml2 libxml2-devel libjpeg-devel libpng-devel libwebp libwebp-devel pcre pcre-devel crontabs
|
||||
yum install -y net-tools
|
||||
|
||||
+31
-5
@@ -2,6 +2,7 @@
|
||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||
export PATH
|
||||
export LANG=en_US.UTF-8
|
||||
SYS_ARCH=`arch`
|
||||
|
||||
if [ ! -f /usr/bin/applydeltarpm ];then
|
||||
yum -y provides '*/applydeltarpm'
|
||||
@@ -28,6 +29,16 @@ if [ $VERSION_ID -ge 8 ];then
|
||||
PKGMGR='dnf'
|
||||
fi
|
||||
|
||||
echo "install remi source"
|
||||
if [ "$VERSION_ID" == "9" ];then
|
||||
echo "install remi start"
|
||||
if [ ! -f /etc/yum.repos.d/remi.repo ];then
|
||||
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-9.rpm
|
||||
rpm --import http://rpms.famillecollet.com/RPM-GPG-KEY-remi
|
||||
fi
|
||||
echo "install remi end"
|
||||
fi
|
||||
|
||||
#https need
|
||||
if [ ! -d /root/.acme.sh ];then
|
||||
curl https://get.acme.sh | sh
|
||||
@@ -119,11 +130,25 @@ $PKGMGR groupinstall -y "Development Tools"
|
||||
|
||||
if [ $VERSION_ID -ge 8 ];then
|
||||
# EL8 及以上
|
||||
if [ $VERSION_ID -ge 9 ];then
|
||||
REPOS='--enablerepo=appstream,baseos,epel,extras,crb'
|
||||
else
|
||||
REPOS='--enablerepo=appstream,baseos,epel,extras,powertools'
|
||||
fi
|
||||
|
||||
# find repo
|
||||
|
||||
REPO_LIST=(remi appstream baseos epel extras crb powertools)
|
||||
REPOS='--enablerepo='
|
||||
for REPO_VAR in ${REPO_LIST[@]}
|
||||
do
|
||||
if [ -f /etc/yum.repos.d/${REPO_VAR}.repo ];then
|
||||
REPOS="${REPOS},${REPO_VAR}"
|
||||
fi
|
||||
done
|
||||
REPOS=${REPOS//=,/=}
|
||||
echo "REPOS:${REPOS}"
|
||||
|
||||
# if [ $VERSION_ID -ge 9 ];then
|
||||
# REPOS='--enablerepo=remi,appstream,baseos,epel,extras,crb'
|
||||
# else
|
||||
# REPOS='--enablerepo=remi,appstream,baseos,epel,extras,powertools'
|
||||
# fi
|
||||
|
||||
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 \
|
||||
@@ -135,6 +160,7 @@ if [ $VERSION_ID -ge 8 ];then
|
||||
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
|
||||
# dnf --enablerepo=remi,appstream,baseos,epel,extras,powertools install -y oniguruma5php-devel
|
||||
dnf $REPOS install -y $rpms;
|
||||
if [ "$?" != "0" ];then
|
||||
dnf install -y $rpms;
|
||||
|
||||
@@ -108,11 +108,17 @@ apt install -y libicu-dev
|
||||
apt install -y build-essential
|
||||
|
||||
apt install -y libcurl4-openssl-dev
|
||||
apt install -y libcurl4-nss-dev
|
||||
apt install -y curl libcurl4-gnutls-dev
|
||||
#https://blog.csdn.net/qq_36228377/article/details/123154344
|
||||
# ln -s /usr/include/x86_64-linux-gnu/curl /usr/include/curl
|
||||
if [ ! -d /usr/include/curl ];then
|
||||
ln -s /usr/include/x86_64-linux-gnu/curl /usr/include/curl
|
||||
SYS_ARCH=`arch`
|
||||
if [ -f /usr/include/x86_64-linux-gnu/curl ];then
|
||||
ln -s /usr/include/x86_64-linux-gnu/curl /usr/include/curl
|
||||
else
|
||||
ln -s /usr/include/${SYS_ARCH}-linux-gnu/curl /usr/include/curl
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
||||
@@ -32,27 +32,27 @@ elif grep -Eq "openSUSE" /etc/*-release; then
|
||||
zypper refresh
|
||||
elif grep -Eq "FreeBSD" /etc/*-release; then
|
||||
OSNAME='freebsd'
|
||||
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
|
||||
elif grep -Eqi "CentOS" /etc/issue || grep -Eqi "CentOS" /etc/*-release; then
|
||||
OSNAME='rhel'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
|
||||
OSNAME='fedora'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
|
||||
elif grep -Eqi "Fedora" /etc/issue || grep -Eqi "Fedora" /etc/*-release; then
|
||||
OSNAME='rhel'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
|
||||
elif grep -Eqi "Rocky" /etc/issue || grep -Eqi "Rocky" /etc/*-release; then
|
||||
OSNAME='rhel'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "Amazon Linux" /etc/issue || grep -Eq "Amazon Linux" /etc/*-release; then
|
||||
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eqi "AlmaLinux" /etc/*-release; then
|
||||
OSNAME='rhel'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "Amazon Linux" /etc/issue || grep -Eqi "Amazon Linux" /etc/*-release; then
|
||||
OSNAME='amazon'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
||||
elif grep -Eqi "Debian" /etc/issue || grep -Eqi "Debian" /etc/*-release; then
|
||||
OSNAME='debian'
|
||||
apt update -y
|
||||
apt install -y devscripts
|
||||
apt install -y wget zip unzip
|
||||
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
||||
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eqi "Ubuntu" /etc/*-release; then
|
||||
OSNAME='ubuntu'
|
||||
apt install -y wget zip unzip
|
||||
else
|
||||
|
||||
+14
-14
@@ -22,33 +22,33 @@ fi
|
||||
|
||||
if [ ${_os} == "Darwin" ]; then
|
||||
OSNAME='macos'
|
||||
elif grep -Eq "openSUSE" /etc/*-release; then
|
||||
elif grep -Eqi "openSUSE" /etc/*-release; then
|
||||
OSNAME='opensuse'
|
||||
zypper refresh
|
||||
elif grep -Eq "FreeBSD" /etc/*-release; then
|
||||
elif grep -Eqi "FreeBSD" /etc/*-release; then
|
||||
OSNAME='freebsd'
|
||||
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
|
||||
OSNAME='centos'
|
||||
elif grep -Eqi "CentOS" /etc/issue || grep -Eqi "CentOS" /etc/*-release; then
|
||||
OSNAME='rhel'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
|
||||
OSNAME='fedora'
|
||||
elif grep -Eqi "Fedora" /etc/issue || grep -Eqi "Fedora" /etc/*-release; then
|
||||
OSNAME='rhel'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
|
||||
OSNAME='rocky'
|
||||
elif grep -Eqi "Rocky" /etc/issue || grep -Eqi "Rocky" /etc/*-release; then
|
||||
OSNAME='rhel'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
|
||||
OSNAME='alma'
|
||||
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eqi "AlmaLinux" /etc/*-release; then
|
||||
OSNAME='rhel'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "Amazon Linux" /etc/issue || grep -Eq "Amazon Linux" /etc/*-release; then
|
||||
elif grep -Eqi "Amazon Linux" /etc/issue || grep -Eqi "Amazon Linux" /etc/*-release; then
|
||||
OSNAME='amazon'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
||||
elif grep -Eqi "Debian" /etc/issue || grep -Eqi "Debian" /etc/*-release; then
|
||||
OSNAME='debian'
|
||||
apt install -y wget zip unzip
|
||||
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
||||
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eqi "Ubuntu" /etc/*-release; then
|
||||
OSNAME='ubuntu'
|
||||
apt install -y wget zip unzip
|
||||
elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then
|
||||
elif grep -Eqi "Raspbian" /etc/issue || grep -Eqi "Raspbian" /etc/*-release; then
|
||||
OSNAME='raspbian'
|
||||
else
|
||||
OSNAME='unknow'
|
||||
|
||||
+13
-13
@@ -22,33 +22,33 @@ fi
|
||||
|
||||
if [ ${_os} == "Darwin" ]; then
|
||||
OSNAME='macos'
|
||||
elif grep -Eq "openSUSE" /etc/*-release; then
|
||||
elif grep -Eqi "openSUSE" /etc/*-release; then
|
||||
OSNAME='opensuse'
|
||||
zypper refresh
|
||||
elif grep -Eq "FreeBSD" /etc/*-release; then
|
||||
elif grep -Eqi "FreeBSD" /etc/*-release; then
|
||||
OSNAME='freebsd'
|
||||
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
|
||||
elif grep -Eqi "CentOS" /etc/issue || grep -Eqi "CentOS" /etc/*-release; then
|
||||
OSNAME='centos'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
|
||||
OSNAME='fedora'
|
||||
elif grep -Eqi "Fedora" /etc/issue || grep -Eqi "Fedora" /etc/*-release; then
|
||||
OSNAME='rhel'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
|
||||
OSNAME='rocky'
|
||||
elif grep -Eqi "Rocky" /etc/issue || grep -Eqi "Rocky" /etc/*-release; then
|
||||
OSNAME='rhel'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
|
||||
OSNAME='alma'
|
||||
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eqi "AlmaLinux" /etc/*-release; then
|
||||
OSNAME='rhel'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "Amazon Linux" /etc/issue || grep -Eq "Amazon Linux" /etc/*-release; then
|
||||
elif grep -Eqi "Amazon Linux" /etc/issue || grep -Eqi "Amazon Linux" /etc/*-release; then
|
||||
OSNAME='amazon'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
||||
elif grep -Eqi "Debian" /etc/issue || grep -Eqi "Debian" /etc/*-release; then
|
||||
OSNAME='debian'
|
||||
apt install -y wget zip unzip
|
||||
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
||||
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eqi "Ubuntu" /etc/*-release; then
|
||||
OSNAME='ubuntu'
|
||||
apt install -y wget zip unzip
|
||||
elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then
|
||||
elif grep -Eqi "Raspbian" /etc/issue || grep -Eqi "Raspbian" /etc/*-release; then
|
||||
OSNAME='raspbian'
|
||||
else
|
||||
OSNAME='unknow'
|
||||
|
||||
Reference in New Issue
Block a user