mirror of
https://github.com/flucont/btcloud.git
synced 2025-10-14 14:20:22 +00:00
update
This commit is contained in:
@@ -107,13 +107,13 @@ class CleanViteJs extends Command
|
||||
$flag = false;
|
||||
|
||||
if(strpos($file, 'window.location.protocol.indexOf("https")>=0')!==false){ //index
|
||||
$file = str_replace('(window.location.protocol.indexOf("https")>=0)', '1', $file);
|
||||
$file = str_replace('window.location.protocol.indexOf("https")>=0', '!0', $file);
|
||||
$code = $this->getExtendCode($file, 'isGetCoupon:', 2);
|
||||
if($code){
|
||||
$file = str_replace($code, '{}', $file);
|
||||
}
|
||||
$file = preg_replace('!recommendShow:\w+,!', 'recommendShow:!1,', $file, 1);
|
||||
$code = $this->getExtendCode($file, '"需求反馈"', 1, '[', ']');
|
||||
$code = $this->getExtendCode($file, '"打开需求反馈"', 1, '[', ']');
|
||||
if($code){
|
||||
$file = str_replace($code, '[]', $file);
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
Linux_Version="9.6.0"
|
||||
Linux_Version="11.0.0"
|
||||
Windows_Version="8.2.2"
|
||||
Aapanel_Version="7.0.16"
|
||||
Btm_Version="2.3.0"
|
||||
@@ -23,6 +23,7 @@ public/install/update/LinuxPanel_EN-${Aapanel_Version}.zip
|
||||
public/install/install_7.0_en.sh
|
||||
public/install/update_7.x_en.sh
|
||||
)
|
||||
PL_FILE="public/install/update/LinuxPanel-${Linux_Version}.pl"
|
||||
|
||||
DIR=$1
|
||||
SITEURL=$2
|
||||
@@ -80,6 +81,10 @@ do
|
||||
fi
|
||||
done
|
||||
|
||||
HASH=$(sha256sum "${DIR}public/install/update/LinuxPanel-${Linux_Version}.zip" | awk '{print $1}')
|
||||
TIMESTAMP=$(date +%s)
|
||||
printf '{"hash": "%s", "update_time": "%s"}' "$HASH" "$TIMESTAMP" > "${DIR}${PL_FILE}"
|
||||
|
||||
echo "=========================="
|
||||
echo "处理完成"
|
||||
echo "=========================="
|
||||
|
@@ -104,17 +104,17 @@
|
||||
<div class="panel-body">
|
||||
<form onsubmit="return saveSetting(this)" method="post" class="form" role="form">
|
||||
<div class="form-group">
|
||||
<label>宝塔Linux面板最新版本号:</label>
|
||||
<label>aaPanel面板最新版本号:</label>
|
||||
<input type="text" name="new_version_en" value="{:config_get('new_version_en')}" class="form-control"/>
|
||||
<font color="green">用于一键更新脚本获取最新版本号,以及检测更新接口。并确保已在/public/install/update/放置对应版本更新包</font>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>宝塔Linux面板更新日志:</label>
|
||||
<label>aaPanel面板更新日志:</label>
|
||||
<textarea class="form-control" name="update_msg_en" rows="5" placeholder="支持HTML代码">{:config_get('update_msg_en')}</textarea>
|
||||
<font color="green">用于检测更新接口返回</font>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>宝塔Linux面板更新日期:</label>
|
||||
<label>aaPanel面板更新日期:</label>
|
||||
<input type="date" name="update_date_en" value="{:config_get('update_date_en')}" class="form-control"/>
|
||||
<font color="green">用于检测更新接口返回</font>
|
||||
</div>
|
||||
|
@@ -12,15 +12,15 @@ INSERT INTO `cloud_config` (`key`, `value`) VALUES
|
||||
('bt_key', ''),
|
||||
('whitelist', '0'),
|
||||
('download_page', '1'),
|
||||
('new_version', '9.4.0'),
|
||||
('new_version', '11.0.0'),
|
||||
('update_msg', '暂无更新日志'),
|
||||
('update_date', '2025-01-09'),
|
||||
('update_date', '2025-07-24'),
|
||||
('new_version_win', '8.2.2'),
|
||||
('update_msg_win', '暂无更新日志'),
|
||||
('update_date_win', '2024-12-30'),
|
||||
('new_version_en', '7.0.13'),
|
||||
('new_version_en', '7.0.21'),
|
||||
('update_msg_en', '暂无更新日志'),
|
||||
('update_date_en', '2024-11-17'),
|
||||
('update_date_en', '2025-07-22'),
|
||||
('new_version_btm', '2.3.0'),
|
||||
('update_msg_btm', '暂无更新日志'),
|
||||
('update_date_btm', '2024-04-24'),
|
||||
|
@@ -421,8 +421,8 @@ Check_apt_status(){
|
||||
retries=0
|
||||
|
||||
while [ $retries -lt $MAX_RETRIES ]; do
|
||||
output=$(ps aux| grep -E '(apt|apt-get)\s' 2>&1)
|
||||
check_output=$(echo "$output" | grep -E '(apt|apt-get)\s')
|
||||
output=$(ps aux |grep -E '(apt|apt-get)\s' 2>&1)
|
||||
check_output=$(echo "$output" | grep -v _apt | grep -E '(apt|apt-get)\s')
|
||||
|
||||
#If check_output is empty, terminate the loop
|
||||
if [ -z "$check_output" ]; then
|
||||
@@ -1862,19 +1862,40 @@ Set_Firewall() {
|
||||
Get_Ip_Address() {
|
||||
getIpAddress=""
|
||||
# getIpAddress=$(curl -sS --connect-timeout 10 -m 60 https://brandnew.aapanel.com/api/common/getClientIP)
|
||||
getIpAddress=$(curl -sSk --connect-timeout 10 -m 60 https://www.aapanel.com/api/common/getClientIP)
|
||||
# if [ -z "${getIpAddress}" ] || [ "${getIpAddress}" = "0.0.0.0" ]; then
|
||||
# isHosts=$(cat /etc/hosts|grep 'www.bt.cn')
|
||||
# if [ -z "${isHosts}" ];then
|
||||
# echo "" >> /etc/hosts
|
||||
# echo "103.224.251.67 www.bt.cn" >> /etc/hosts
|
||||
# #getIpAddress=$(curl -sS --connect-timeout 10 -m 60 https://brandnew.aapanel.com/api/common/getClientIP)
|
||||
# getIpAddress=$(curl -sS --connect-timeout 10 -m 60 https://www.bt.cn/Api/getIpAddress)
|
||||
# if [ -z "${getIpAddress}" ];then
|
||||
# sed -i "/bt.cn/d" /etc/hosts
|
||||
# fi
|
||||
# fi
|
||||
# fi
|
||||
# getIpAddress=$(curl -sSk --connect-timeout 10 -m 60 https://www.aapanel.com/api/common/getClientIP)
|
||||
|
||||
|
||||
ipv4_address=""
|
||||
ipv6_address=""
|
||||
ipv4_address=$(curl -4 -sS --connect-timeout 10 -m 15 https://www.aapanel.com/api/common/getClientIP 2>&1)
|
||||
if [ -z "${ipv4_address}" ];then
|
||||
ipv4_address=$(curl -4 -sS --connect-timeout 10 -m 15 https://ifconfig.me 2>&1)
|
||||
if [ -z "${ipv4_address}" ];then
|
||||
ipv4_address=$(curl -4 -sS --connect-timeout 10 -m 15 https://www.bt.cn/Api/getIpAddress 2>&1)
|
||||
fi
|
||||
fi
|
||||
IPV4_REGEX="^([0-9]{1,3}\.){3}[0-9]{1,3}$"
|
||||
if ! [[ $ipv4_address =~ $IPV4_REGEX ]]; then
|
||||
ipv4_address=""
|
||||
fi
|
||||
|
||||
ipv6_address=$(curl -6 -sS --connect-timeout 10 -m 15 https://www.aapanel.com/api/common/getClientIP 2>&1)
|
||||
# IPV6_REGEX="^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$"
|
||||
IPV6_REGEX="^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4}$"
|
||||
if ! [[ $ipv6_address =~ $IPV6_REGEX ]]; then
|
||||
ipv6_address=""
|
||||
else
|
||||
if [[ ! $ipv6_address =~ ^\[ ]]; then
|
||||
ipv6_address="[$ipv6_address]"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "${ipv4_address}" ];then
|
||||
getIpAddress=$ipv4_address
|
||||
elif [ "${ipv6_address}" ];then
|
||||
getIpAddress=$ipv6_address
|
||||
fi
|
||||
|
||||
|
||||
ipv4Check=$($python_bin -c "import re; print(re.match(r'^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$','${getIpAddress}'))")
|
||||
if [ "${ipv4Check}" == "None" ]; then
|
||||
@@ -1886,7 +1907,7 @@ Get_Ip_Address() {
|
||||
getIpAddress=$(echo "[$getIpAddress]")
|
||||
echo "True" >${setup_path}/server/panel/data/ipv6.pl
|
||||
sleep 1
|
||||
/etc/init.d/bt restart
|
||||
# /etc/init.d/bt restart
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@@ -239,7 +239,8 @@ Set_Repo_Url(){
|
||||
if [ "${PM}"="apt-get" ];then
|
||||
ALI_CLOUD_CHECK=$(grep Alibaba /etc/motd)
|
||||
Tencent_Cloud=$(cat /etc/hostname |grep -E VM-[0-9]+-[0-9]+)
|
||||
if [ "${ALI_CLOUD_CHECK}" ] || [ "${Tencent_Cloud}" ];then
|
||||
VELINUX_CHECK=$(grep veLinux /etc/os-release)
|
||||
if [ "${ALI_CLOUD_CHECK}" ] || [ "${Tencent_Cloud}" ] || [ "${VELINUX_CHECK}" ];then
|
||||
return
|
||||
fi
|
||||
|
||||
@@ -1146,6 +1147,9 @@ Set_Bt_Panel(){
|
||||
fi
|
||||
/etc/init.d/bt stop
|
||||
sleep 5
|
||||
if [ ! -f "/www/server/panel/data/port.pl" ];then
|
||||
echo "8888" > /www/server/panel/data/port.pl
|
||||
fi
|
||||
/etc/init.d/bt start
|
||||
sleep 5
|
||||
isStart=$(ps aux |grep 'BT-Panel'|grep -v grep|awk '{print $2}')
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +0,0 @@
|
||||
{"hash": "c097e387cb3f2baf34a222191de7130bd878215ffa4ba8cef2d337e3466e6963", "update_time": "1747723203"}
|
Binary file not shown.
@@ -167,6 +167,7 @@ pip_list=$($mypip list 2>&1)
|
||||
request_v=$(btpip list 2>/dev/null|grep "requests "|awk '{print $2}'|cut -d '.' -f 2)
|
||||
if [ "$request_v" = "" ] || [ "${request_v}" -gt "28" ];then
|
||||
$mypip install requests==2.27.1
|
||||
$mypip install chardet==4.0.0
|
||||
fi
|
||||
|
||||
NATSORT_C=$(echo $pip_list|grep natsort)
|
||||
|
@@ -947,11 +947,11 @@ version=$(curl -Ss --connect-timeout 12 -m 2 $Btapi_Url/api/panel/getLatestOffic
|
||||
check_version_num=$( echo "$version"|grep -Eo '^[0-9]+' )
|
||||
if [ "$check_version_num" = '' ];then
|
||||
echo "Check version failed!"
|
||||
version='7.0.13'
|
||||
version='7.0.21'
|
||||
fi
|
||||
|
||||
if [ "$version" = '' ];then
|
||||
version='7.0.13'
|
||||
version='7.0.21'
|
||||
fi
|
||||
|
||||
# if [ "$1" ];then
|
||||
@@ -970,6 +970,10 @@ fi
|
||||
unzip -o /tmp/panel.zip -d $setup_path/server/ > /dev/null
|
||||
rm -f /tmp/panel.zip
|
||||
|
||||
if [ -f "/www/server/panel/data/is_beta.pl" ];then
|
||||
rm -f /www/server/panel/data/is_beta.pl
|
||||
fi
|
||||
|
||||
Update_Py_Lib
|
||||
|
||||
cd $setup_path/server/panel/
|
||||
|
@@ -150,6 +150,7 @@ Route::group('api', function () {
|
||||
Route::post('/panel/submit_feature_invoked_bulk', 'api/return_success');
|
||||
Route::post('/panel/submit_expand_pack_used', 'api/return_success');
|
||||
Route::get('/panel/getLatestOfficialVersion', 'api/get_version_en');
|
||||
Route::post('/cert/user/list', 'api/nps_questions');
|
||||
|
||||
Route::miss('api/return_error');
|
||||
});
|
||||
|
Reference in New Issue
Block a user