mirror of
https://github.com/flucont/btcloud.git
synced 2025-10-15 15:20:24 +00:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0bf1aa2260 | ||
![]() |
9a63bc921b | ||
![]() |
5d305b47de |
@@ -1,8 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
Linux_Version="7.9.8"
|
Linux_Version="7.9.10"
|
||||||
Windows_Version="7.8.0"
|
Windows_Version="7.8.0"
|
||||||
Btm_Version="2.0.8"
|
Btm_Version="2.1.7"
|
||||||
|
|
||||||
FILES=(
|
FILES=(
|
||||||
public/install/src/panel6.zip
|
public/install/src/panel6.zip
|
||||||
|
@@ -12,15 +12,15 @@ INSERT INTO `cloud_config` (`key`, `value`) VALUES
|
|||||||
('bt_key', ''),
|
('bt_key', ''),
|
||||||
('whitelist', '0'),
|
('whitelist', '0'),
|
||||||
('download_page', '1'),
|
('download_page', '1'),
|
||||||
('new_version', '7.9.8'),
|
('new_version', '7.9.10'),
|
||||||
('update_msg', '暂无更新日志'),
|
('update_msg', '暂无更新日志'),
|
||||||
('update_date', '2023-01-29'),
|
('update_date', '2023-05-09'),
|
||||||
('new_version_win', '7.8.0'),
|
('new_version_win', '7.8.0'),
|
||||||
('update_msg_win', '暂无更新日志'),
|
('update_msg_win', '暂无更新日志'),
|
||||||
('update_date_win', '2022-12-08'),
|
('update_date_win', '2022-12-08'),
|
||||||
('new_version_btm', '2.0.8'),
|
('new_version_btm', '2.1.7'),
|
||||||
('update_msg_btm', '暂无更新日志'),
|
('update_msg_btm', '暂无更新日志'),
|
||||||
('update_date_btm', '2023-03-31'),
|
('update_date_btm', '2023-05-18'),
|
||||||
('updateall_type', '0'),
|
('updateall_type', '0'),
|
||||||
('syskey', 'UqP94LtI8eWAIgCP');
|
('syskey', 'UqP94LtI8eWAIgCP');
|
||||||
|
|
||||||
|
@@ -36,9 +36,9 @@ setup_path="/www"
|
|||||||
python_bin=$setup_path/server/panel/pyenv/bin/python
|
python_bin=$setup_path/server/panel/pyenv/bin/python
|
||||||
cpu_cpunt=$(cat /proc/cpuinfo|grep processor|wc -l)
|
cpu_cpunt=$(cat /proc/cpuinfo|grep processor|wc -l)
|
||||||
|
|
||||||
if [ "$1" ];then
|
# if [ "$1" ];then
|
||||||
IDC_CODE=$1
|
# IDC_CODE=$1
|
||||||
fi
|
# fi
|
||||||
|
|
||||||
GetSysInfo(){
|
GetSysInfo(){
|
||||||
if [ -s "/etc/redhat-release" ];then
|
if [ -s "/etc/redhat-release" ];then
|
||||||
@@ -231,7 +231,7 @@ get_node_url(){
|
|||||||
|
|
||||||
echo '---------------------------------------------';
|
echo '---------------------------------------------';
|
||||||
echo "Selected download node...";
|
echo "Selected download node...";
|
||||||
nodes=(https://dg2.bt.cn https://dg1.bt.cn https://download.bt.cn);
|
nodes=(https://dg2.bt.cn https://download.bt.cn https://ctcc1-node.bt.cn https://cmcc1-node.bt.cn https://ctcc2-node.bt.cn https://hk1-node.bt.cn https://na1-node.bt.cn https://jp1-node.bt.cn);
|
||||||
|
|
||||||
if [ "$1" ];then
|
if [ "$1" ];then
|
||||||
nodes=($(echo ${nodes[*]}|sed "s#${1}##"))
|
nodes=($(echo ${nodes[*]}|sed "s#${1}##"))
|
||||||
@@ -307,6 +307,15 @@ Install_RPM_Pack(){
|
|||||||
echo "exclude=httpd nginx php mysql mairadb python-psutil python2-psutil" >> $yumPath
|
echo "exclude=httpd nginx php mysql mairadb python-psutil python2-psutil" >> $yumPath
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -f "/etc/redhat-release" ] && [ $(cat /etc/os-release|grep PLATFORM_ID|grep -oE "el8") ];then
|
||||||
|
yum config-manager --set-enabled powertools
|
||||||
|
yum config-manager --set-enabled PowerTools
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "/etc/redhat-release" ] && [ $(cat /etc/os-release|grep PLATFORM_ID|grep -oE "el9") ];then
|
||||||
|
dnf config-manager --set-enabled crb -y
|
||||||
|
fi
|
||||||
|
|
||||||
#SYS_TYPE=$(uname -a|grep x86_64)
|
#SYS_TYPE=$(uname -a|grep x86_64)
|
||||||
#yumBaseUrl=$(cat /etc/yum.repos.d/CentOS-Base.repo|grep baseurl=http|cut -d '=' -f 2|cut -d '$' -f 1|head -n 1)
|
#yumBaseUrl=$(cat /etc/yum.repos.d/CentOS-Base.repo|grep baseurl=http|cut -d '=' -f 2|cut -d '$' -f 1|head -n 1)
|
||||||
#[ "${yumBaseUrl}" ] && checkYumRepo=$(curl --connect-timeout 5 --head -s -o /dev/null -w %{http_code} ${yumBaseUrl})
|
#[ "${yumBaseUrl}" ] && checkYumRepo=$(curl --connect-timeout 5 --head -s -o /dev/null -w %{http_code} ${yumBaseUrl})
|
||||||
@@ -524,7 +533,7 @@ Install_Python_Lib(){
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
py_version="3.7.8"
|
py_version="3.7.16"
|
||||||
mkdir -p $pyenv_path
|
mkdir -p $pyenv_path
|
||||||
echo "True" > /www/disk.pl
|
echo "True" > /www/disk.pl
|
||||||
if [ ! -w /www/disk.pl ];then
|
if [ ! -w /www/disk.pl ];then
|
||||||
@@ -601,7 +610,7 @@ Install_Python_Lib(){
|
|||||||
cd ~
|
cd ~
|
||||||
rm -rf $python_src_path
|
rm -rf $python_src_path
|
||||||
wget -O $pyenv_path/pyenv/bin/activate $download_Url/install/pyenv/activate.panel -T 5
|
wget -O $pyenv_path/pyenv/bin/activate $download_Url/install/pyenv/activate.panel -T 5
|
||||||
wget -O $pyenv_path/pyenv/pip.txt $download_Url/install/pyenv/pip-3.7.8.txt -T 5
|
wget -O $pyenv_path/pyenv/pip.txt $download_Url/install/pyenv/pip-3.7.16.txt -T 5
|
||||||
ln -sf $pyenv_path/pyenv/bin/pip3.7 $pyenv_path/pyenv/bin/pip
|
ln -sf $pyenv_path/pyenv/bin/pip3.7 $pyenv_path/pyenv/bin/pip
|
||||||
ln -sf $pyenv_path/pyenv/bin/python3.7 $pyenv_path/pyenv/bin/python
|
ln -sf $pyenv_path/pyenv/bin/python3.7 $pyenv_path/pyenv/bin/python
|
||||||
ln -sf $pyenv_path/pyenv/bin/pip3.7 /usr/bin/btpip
|
ln -sf $pyenv_path/pyenv/bin/pip3.7 /usr/bin/btpip
|
||||||
@@ -611,8 +620,24 @@ Install_Python_Lib(){
|
|||||||
$pyenv_path/pyenv/bin/pip install -U setuptools==65.5.0
|
$pyenv_path/pyenv/bin/pip install -U setuptools==65.5.0
|
||||||
$pyenv_path/pyenv/bin/pip install -U wheel==0.34.2
|
$pyenv_path/pyenv/bin/pip install -U wheel==0.34.2
|
||||||
$pyenv_path/pyenv/bin/pip install -r $pyenv_path/pyenv/pip.txt
|
$pyenv_path/pyenv/bin/pip install -r $pyenv_path/pyenv/pip.txt
|
||||||
|
|
||||||
|
wget -O pip-packs.txt $download_Url/install/pyenv/pip-packs.txt
|
||||||
|
PIP_PACKS=$(cat pip-packs.txt)
|
||||||
|
for P_PACK in ${PIP_PACKS};
|
||||||
|
do
|
||||||
|
btpip show ${P_PACK} > /dev/null 2>&1
|
||||||
|
if [ "$?" == "1" ];then
|
||||||
|
btpip install ${P_PACK}
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
rm -f pip-packs.txt
|
||||||
|
|
||||||
source $pyenv_path/pyenv/bin/activate
|
source $pyenv_path/pyenv/bin/activate
|
||||||
|
|
||||||
|
btpip install psutil
|
||||||
|
btpip install gevent
|
||||||
|
|
||||||
is_gevent=$($python_bin -m gevent 2>&1|grep -oE package)
|
is_gevent=$($python_bin -m gevent 2>&1|grep -oE package)
|
||||||
is_psutil=$($python_bin -m psutil 2>&1|grep -oE package)
|
is_psutil=$($python_bin -m psutil 2>&1|grep -oE package)
|
||||||
if [ "${is_gevent}" != "${is_psutil}" ];then
|
if [ "${is_gevent}" != "${is_psutil}" ];then
|
||||||
@@ -626,6 +651,9 @@ Install_Bt(){
|
|||||||
else
|
else
|
||||||
panelPort=$(expr $RANDOM % 55535 + 10000)
|
panelPort=$(expr $RANDOM % 55535 + 10000)
|
||||||
fi
|
fi
|
||||||
|
if [ "${PANEL_PORT}" ];then
|
||||||
|
panelPort=$PANEL_PORT
|
||||||
|
fi
|
||||||
mkdir -p ${setup_path}/server/panel/logs
|
mkdir -p ${setup_path}/server/panel/logs
|
||||||
mkdir -p ${setup_path}/server/panel/vhost/apache
|
mkdir -p ${setup_path}/server/panel/vhost/apache
|
||||||
mkdir -p ${setup_path}/server/panel/vhost/nginx
|
mkdir -p ${setup_path}/server/panel/vhost/nginx
|
||||||
@@ -719,8 +747,15 @@ Set_Bt_Panel(){
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
password=$(cat /dev/urandom | head -n 16 | md5sum | head -c 8)
|
password=$(cat /dev/urandom | head -n 16 | md5sum | head -c 8)
|
||||||
|
if [ "$PANEL_PASSWORD" ];then
|
||||||
|
password=$PANEL_PASSWORD
|
||||||
|
fi
|
||||||
sleep 1
|
sleep 1
|
||||||
admin_auth="/www/server/panel/data/admin_path.pl"
|
admin_auth="/www/server/panel/data/admin_path.pl"
|
||||||
|
if [ "${SAFE_PATH}" ];then
|
||||||
|
auth_path=$SAFE_PATH
|
||||||
|
echo "/${auth_path}" > ${admin_auth}
|
||||||
|
fi
|
||||||
if [ ! -f ${admin_auth} ];then
|
if [ ! -f ${admin_auth} ];then
|
||||||
auth_path=$(cat /dev/urandom | head -n 16 | md5sum | head -c 8)
|
auth_path=$(cat /dev/urandom | head -n 16 | md5sum | head -c 8)
|
||||||
echo "/${auth_path}" > ${admin_auth}
|
echo "/${auth_path}" > ${admin_auth}
|
||||||
@@ -742,6 +777,9 @@ Set_Bt_Panel(){
|
|||||||
$python_bin -m py_compile tools.py
|
$python_bin -m py_compile tools.py
|
||||||
$python_bin tools.py username
|
$python_bin tools.py username
|
||||||
username=$($python_bin tools.py panel ${password})
|
username=$($python_bin tools.py panel ${password})
|
||||||
|
if [ "$PANEL_USER" ];then
|
||||||
|
username=$PANEL_USER
|
||||||
|
fi
|
||||||
cd ~
|
cd ~
|
||||||
echo "${password}" > ${setup_path}/server/panel/default.pl
|
echo "${password}" > ${setup_path}/server/panel/default.pl
|
||||||
chmod 600 ${setup_path}/server/panel/default.pl
|
chmod 600 ${setup_path}/server/panel/default.pl
|
||||||
@@ -758,6 +796,12 @@ Set_Bt_Panel(){
|
|||||||
lsattr python3.7 python
|
lsattr python3.7 python
|
||||||
Red_Error "ERROR: The BT-Panel service startup failed." "ERROR: 宝塔启动失败"
|
Red_Error "ERROR: The BT-Panel service startup failed." "ERROR: 宝塔启动失败"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$PANEL_USER" ];then
|
||||||
|
cd ${setup_path}/server/panel/
|
||||||
|
btpython -c 'import tools;tools.set_panel_username("'$PANEL_USER'")'
|
||||||
|
cd ~
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
Set_Firewall(){
|
Set_Firewall(){
|
||||||
sshPort=$(cat /etc/ssh/sshd_config | grep 'Port '|awk '{print $2}')
|
sshPort=$(cat /etc/ssh/sshd_config | grep 'Port '|awk '{print $2}')
|
||||||
@@ -903,6 +947,35 @@ echo "
|
|||||||
| 为了您的正常使用,请确保使用全新或纯净的系统安装宝塔面板,不支持已部署项目/环境的系统安装
|
| 为了您的正常使用,请确保使用全新或纯净的系统安装宝塔面板,不支持已部署项目/环境的系统安装
|
||||||
+----------------------------------------------------------------------
|
+----------------------------------------------------------------------
|
||||||
"
|
"
|
||||||
|
|
||||||
|
while [ ${#} -gt 0 ]; do
|
||||||
|
case $1 in
|
||||||
|
-u|--user)
|
||||||
|
PANEL_USER=$2
|
||||||
|
shift 1
|
||||||
|
;;
|
||||||
|
-p|--password)
|
||||||
|
PANEL_PASSWORD=$2
|
||||||
|
shift 1
|
||||||
|
;;
|
||||||
|
-P|--port)
|
||||||
|
PANEL_PORT=$2
|
||||||
|
shift 1
|
||||||
|
;;
|
||||||
|
--safe-path)
|
||||||
|
SAFE_PATH=$2
|
||||||
|
shift 1
|
||||||
|
;;
|
||||||
|
-y)
|
||||||
|
go="y"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
IDC_CODE=$1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift 1
|
||||||
|
done
|
||||||
|
|
||||||
while [ "$go" != 'y' ] && [ "$go" != 'n' ]
|
while [ "$go" != 'y' ] && [ "$go" != 'n' ]
|
||||||
do
|
do
|
||||||
read -p "Do you want to install Bt-Panel to the $setup_path directory now?(y/n): " go;
|
read -p "Do you want to install Bt-Panel to the $setup_path directory now?(y/n): " go;
|
||||||
@@ -915,7 +988,7 @@ fi
|
|||||||
ARCH_LINUX=$(cat /etc/os-release |grep "Arch Linux")
|
ARCH_LINUX=$(cat /etc/os-release |grep "Arch Linux")
|
||||||
if [ "${ARCH_LINUX}" ] && [ -f "/usr/bin/pacman" ];then
|
if [ "${ARCH_LINUX}" ] && [ -f "/usr/bin/pacman" ];then
|
||||||
pacman -Sy
|
pacman -Sy
|
||||||
pacman -S curl wget unzip firewalld openssl pkg-config make gcc cmake libxml2 libxslt libvpx gd libsodium oniguruma sqlite libzip autoconf inetutils sudo --noconfirm
|
pacman -S curl wget unzip firewalld openssl pkg-config make gcc cmake libxml2 libxslt libvpx gd libsodium oniguruma sqlite libzip autoconf inetutils sudo --noconfirm
|
||||||
fi
|
fi
|
||||||
|
|
||||||
Install_Main
|
Install_Main
|
||||||
@@ -948,3 +1021,4 @@ endTime=`date +%s`
|
|||||||
((outTime=($endTime-$startTime)/60))
|
((outTime=($endTime-$startTime)/60))
|
||||||
echo -e "Time consumed:\033[32m $outTime \033[0mMinute!"
|
echo -e "Time consumed:\033[32m $outTime \033[0mMinute!"
|
||||||
|
|
||||||
|
|
||||||
|
@@ -213,6 +213,8 @@ Install_Python_Lib(){
|
|||||||
$pyenv_path/pyenv/bin/pip install cachelib
|
$pyenv_path/pyenv/bin/pip install cachelib
|
||||||
$pyenv_path/pyenv/bin/pip install py7zr
|
$pyenv_path/pyenv/bin/pip install py7zr
|
||||||
$pyenv_path/pyenv/bin/pip install backports.lzma
|
$pyenv_path/pyenv/bin/pip install backports.lzma
|
||||||
|
$pyenv_path/pyenv/bin/pip install pandas
|
||||||
|
$pyenv_path/pyenv/bin/pip install msgpack
|
||||||
fi
|
fi
|
||||||
source $pyenv_path/pyenv/bin/activate
|
source $pyenv_path/pyenv/bin/activate
|
||||||
chmod -R 700 $pyenv_path/pyenv/bin
|
chmod -R 700 $pyenv_path/pyenv/bin
|
||||||
@@ -270,6 +272,8 @@ Install_Python_Lib(){
|
|||||||
$pyenv_path/pyenv/bin/pip install cachelib
|
$pyenv_path/pyenv/bin/pip install cachelib
|
||||||
$pyenv_path/pyenv/bin/pip install py7zr
|
$pyenv_path/pyenv/bin/pip install py7zr
|
||||||
$pyenv_path/pyenv/bin/pip install backports.lzma
|
$pyenv_path/pyenv/bin/pip install backports.lzma
|
||||||
|
$pyenv_path/pyenv/bin/pip install pandas
|
||||||
|
$pyenv_path/pyenv/bin/pip install msgpack
|
||||||
if [ ! -f $pyenv_path/pyenv/bin/python ];then
|
if [ ! -f $pyenv_path/pyenv/bin/python ];then
|
||||||
rm -f $pyenv_file
|
rm -f $pyenv_file
|
||||||
Red_Error "ERROR: Install python env fielded." "ERROR: 下载堡塔云监控主控端运行环境失败,请尝试重新安装!"
|
Red_Error "ERROR: Install python env fielded." "ERROR: 下载堡塔云监控主控端运行环境失败,请尝试重新安装!"
|
||||||
@@ -325,6 +329,8 @@ Install_Python_Lib(){
|
|||||||
$pyenv_path/pyenv/bin/pip install cachelib
|
$pyenv_path/pyenv/bin/pip install cachelib
|
||||||
$pyenv_path/pyenv/bin/pip install py7zr
|
$pyenv_path/pyenv/bin/pip install py7zr
|
||||||
$pyenv_path/pyenv/bin/pip install backports.lzma
|
$pyenv_path/pyenv/bin/pip install backports.lzma
|
||||||
|
$pyenv_path/pyenv/bin/pip install pandas
|
||||||
|
$pyenv_path/pyenv/bin/pip install msgpack
|
||||||
source $pyenv_path/pyenv/bin/activate
|
source $pyenv_path/pyenv/bin/activate
|
||||||
|
|
||||||
is_gevent=$($python_bin -m gevent 2>&1|grep -oE package)
|
is_gevent=$($python_bin -m gevent 2>&1|grep -oE package)
|
||||||
@@ -360,7 +366,7 @@ EOF
|
|||||||
sleep 1
|
sleep 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
version="2.0.8"
|
version="2.1.7"
|
||||||
file_name="bt-monitor"
|
file_name="bt-monitor"
|
||||||
agent_src="bt-monitor.zip"
|
agent_src="bt-monitor.zip"
|
||||||
|
|
||||||
@@ -462,16 +468,24 @@ Start_Monitor(){
|
|||||||
curl -sSO ${download_Url}/install/btmonitoragent.sh && bash btmonitoragent.sh https://127.0.0.1:806 $md5_pl
|
curl -sSO ${download_Url}/install/btmonitoragent.sh && bash btmonitoragent.sh https://127.0.0.1:806 $md5_pl
|
||||||
target_dir="/usr/local/btmonitoragent"
|
target_dir="/usr/local/btmonitoragent"
|
||||||
if [ ! -f "$target_dir/BT-MonitorAgent" ];then
|
if [ ! -f "$target_dir/BT-MonitorAgent" ];then
|
||||||
echo "ERROR: 安装云监控被控端失败,正在尝试重新安装!"
|
tail -n 10 ${monitor_path}/logs/error.log
|
||||||
curl -sSO ${download_Url}/install/btmonitoragent.sh && bash btmonitoragent.sh https://127.0.0.1:806 $md5_pl
|
echo ""
|
||||||
|
ps aux|grep -v grep|grep ${monitor_path}
|
||||||
if [ ! -f "$target_dir/BT-MonitorAgent" ];then
|
netstat -tulnp|grep ${panelPort}
|
||||||
|
/etc/init.d/btm restart
|
||||||
|
if [ "$?" -eq 0 ]; then
|
||||||
|
echo -e "\033[31m安装云监控被控端失败,正在尝试重新安装!\033[0m"
|
||||||
|
sleep 15
|
||||||
|
curl -sSO ${download_Url}/install/btmonitoragent.sh && bash btmonitoragent.sh https://127.0.0.1:806 $md5_pl
|
||||||
|
if [ ! -f "$target_dir/BT-MonitorAgent" ];then
|
||||||
|
Red_Error "ERROR: 安装云监控被控端失败,请尝试重新安装!"
|
||||||
|
fi
|
||||||
|
else
|
||||||
Red_Error "ERROR: 安装云监控被控端失败,请尝试重新安装!"
|
Red_Error "ERROR: 安装云监控被控端失败,请尝试重新安装!"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
/etc/init.d/btm restart > /dev/null 2>&1
|
/etc/init.d/btm restart > /dev/null 2>&1
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Set_Firewall(){
|
Set_Firewall(){
|
||||||
@@ -708,22 +722,23 @@ Check_Sys_Write(){
|
|||||||
|
|
||||||
for dir in ${read_dir[@]}
|
for dir in ${read_dir[@]}
|
||||||
do
|
do
|
||||||
touch $dir/btm_install_test_111.pl
|
if [[ -d "$dir" ]]; then
|
||||||
state=$(echo $?)
|
touch $dir/btm_install_test_111.pl
|
||||||
#echo $state
|
state=$(echo $?)
|
||||||
if [[ "$state" != "0" ]];then
|
if [[ "$state" != "0" ]];then
|
||||||
echo -e "\033[31m错误:检测到系统关键目录不可写! $read_dir \033[0m"
|
echo -e "\033[31m错误:检测到系统关键目录不可写! $read_dir \033[0m"
|
||||||
echo "1、如果安装了[宝塔系统加固],请先临时关闭"
|
echo "1、如果安装了[宝塔系统加固],请先临时关闭"
|
||||||
echo "2、如果安装了云锁,请临时关闭[系统加固]功能"
|
echo "2、如果安装了云锁,请临时关闭[系统加固]功能"
|
||||||
echo "3、如果安装了安全狗,请临时关闭[系统防护]功能"
|
echo "3、如果安装了安全狗,请临时关闭[系统防护]功能"
|
||||||
echo "4、如果使用了其它安全软件,请先卸载 "
|
echo "4、如果使用了其它安全软件,请先卸载 "
|
||||||
echo -e "5、如果使用了禁止写入命令,请执行命令取消禁止写入:\n chattr -iaR $read_dir "
|
echo -e "5、如果使用了禁止写入命令,请执行命令取消禁止写入:\n chattr -iaR $read_dir "
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "\033[31m解决以上问题后,请尝试重新安装! \033[0m"
|
echo -e "\033[31m解决以上问题后,请尝试重新安装! \033[0m"
|
||||||
echo -e "如果无法解决请截图以上报错信息发帖至论坛www.bt.cn/bbs求助"
|
echo -e "如果无法解决请截图以上报错信息发帖至论坛www.bt.cn/bbs求助"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
rm -f $dir/btm_install_test_111.pl
|
rm -f $dir/btm_install_test_111.pl
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -12,16 +12,16 @@ if [ ! -d /www/server/panel/BTPanel ];then
|
|||||||
exit 0;
|
exit 0;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "/www/server/panel/pyenv/bin/python3" ];then
|
||||||
|
echo "============================================="
|
||||||
|
echo "错误, 当前面板过旧/py-2.7/无pyenv环境,无法升级至最新版面板"
|
||||||
|
echo "请截图发帖至论坛www.bt.cn/bbs求助"
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
public_file=/www/server/panel/install/public.sh
|
public_file=/www/server/panel/install/public.sh
|
||||||
publicFileMd5=$(md5sum ${public_file} 2>/dev/null|awk '{print $1}')
|
if [ ! -f $public_file ];then
|
||||||
md5check="f6ccaaec227577b87a22bf162004667b"
|
|
||||||
if [ "${publicFileMd5}" != "${md5check}" ]; then
|
|
||||||
wget -O Tpublic.sh $Btapi_Url/install/public.sh -T 20;
|
wget -O Tpublic.sh $Btapi_Url/install/public.sh -T 20;
|
||||||
publicFileMd5=$(md5sum Tpublic.sh 2>/dev/null|awk '{print $1}')
|
|
||||||
if [ "${publicFileMd5}" == "${md5check}" ]; then
|
|
||||||
\cp -rpa Tpublic.sh $public_file
|
|
||||||
fi
|
|
||||||
rm -f Tpublic.sh
|
|
||||||
fi
|
fi
|
||||||
. $public_file
|
. $public_file
|
||||||
|
|
||||||
@@ -42,12 +42,16 @@ download_Url=$NODE_URL
|
|||||||
setup_path=/www
|
setup_path=/www
|
||||||
version=$(curl -Ss --connect-timeout 5 -m 2 $Btapi_Url/api/panel/get_version)
|
version=$(curl -Ss --connect-timeout 5 -m 2 $Btapi_Url/api/panel/get_version)
|
||||||
if [ "$version" = '' ];then
|
if [ "$version" = '' ];then
|
||||||
version='7.9.8'
|
version='7.9.9'
|
||||||
fi
|
fi
|
||||||
armCheck=$(uname -m|grep arm)
|
armCheck=$(uname -m|grep arm)
|
||||||
if [ "${armCheck}" ];then
|
if [ "${armCheck}" ];then
|
||||||
version='7.7.0'
|
version='7.7.0'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$1" ];then
|
||||||
|
version=$1
|
||||||
|
fi
|
||||||
wget -T 5 -O /tmp/panel.zip $Btapi_Url/install/update/LinuxPanel-${version}.zip
|
wget -T 5 -O /tmp/panel.zip $Btapi_Url/install/update/LinuxPanel-${version}.zip
|
||||||
dsize=$(du -b /tmp/panel.zip|awk '{print $1}')
|
dsize=$(du -b /tmp/panel.zip|awk '{print $1}')
|
||||||
if [ $dsize -lt 10240 ];then
|
if [ $dsize -lt 10240 ];then
|
||||||
@@ -69,10 +73,11 @@ rm -f /www/server/panel/class/*.pyc
|
|||||||
#pip install itsdangerous==0.24
|
#pip install itsdangerous==0.24
|
||||||
|
|
||||||
pip_list=$($mypip list)
|
pip_list=$($mypip list)
|
||||||
request_v=$(echo "$pip_list"|grep requests)
|
request_v=$(btpip list 2>/dev/null|grep "requests "|awk '{print $2}'|cut -d '.' -f 2)
|
||||||
if [ "$request_v" = "" ];then
|
if [ "$request_v" = "" ] || [ "${request_v}" -gt "28" ];then
|
||||||
$mypip install requests
|
$mypip install requests==2.27.1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
openssl_v=$(echo "$pip_list"|grep pyOpenSSL)
|
openssl_v=$(echo "$pip_list"|grep pyOpenSSL)
|
||||||
if [ "$openssl_v" = "" ];then
|
if [ "$openssl_v" = "" ];then
|
||||||
$mypip install pyOpenSSL
|
$mypip install pyOpenSSL
|
||||||
|
@@ -70,7 +70,7 @@ select_node(){
|
|||||||
get_version(){
|
get_version(){
|
||||||
version=$(curl -Ss --connect-timeout 5 -m 2 $Btapi_Url/api/panel/get_version)
|
version=$(curl -Ss --connect-timeout 5 -m 2 $Btapi_Url/api/panel/get_version)
|
||||||
if [ "$version" = '' ];then
|
if [ "$version" = '' ];then
|
||||||
version='7.9.8'
|
version='7.9.9'
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -333,9 +333,9 @@ update_panel(){
|
|||||||
|
|
||||||
chattr -i /etc/init.d/bt
|
chattr -i /etc/init.d/bt
|
||||||
chmod +x /etc/init.d/bt
|
chmod +x /etc/init.d/bt
|
||||||
if [ $up_plugin = 1 ];then
|
# if [ $up_plugin = 1 ];then
|
||||||
$pyenv_bin/python /www/server/panel/tools.py update_to6
|
# $pyenv_bin/python /www/server/panel/tools.py update_to6
|
||||||
fi
|
# fi
|
||||||
}
|
}
|
||||||
|
|
||||||
update_start(){
|
update_start(){
|
||||||
|
@@ -105,5 +105,8 @@ class panel_update:
|
|||||||
|
|
||||||
os.system("echo f|xcopy /s /c /e /y /r {} {}".format(public.to_path(tmpPath),public.to_path(panelPath)))
|
os.system("echo f|xcopy /s /c /e /y /r {} {}".format(public.to_path(tmpPath),public.to_path(panelPath)))
|
||||||
|
|
||||||
return public.returnMsg(True,"升级面板成功,重启面板后生效.");
|
if os.path.exists('C:/update.py'): os.remove('C:/update.py')
|
||||||
|
os.system('bt restart')
|
||||||
|
|
||||||
|
return public.returnMsg(True,"升级面板成功.");
|
||||||
|
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
安装包下载链接:http://download.bt.cn/install/src/bt-monitor-版本号.zip
|
安装包下载链接:http://download.bt.cn/install/src/bt-monitor-版本号.zip
|
||||||
|
|
||||||
- 删除core/include/c_loader/PluginLoader.so,将btmonitor/PluginLoader.py复制到这个文件夹
|
- 删除core/include/c_loader/PluginLoader.so,sqlite_server/PluginLoader.so,将btmonitor/PluginLoader.py复制到这个文件夹
|
||||||
|
|
||||||
- 批量解密源码:执行 php think decrypt all <源码根目录>
|
- 批量解密源码:执行 php think decrypt all <源码根目录>
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
def write_request_log(reques = None): 这一行下面加上 return
|
def write_request_log(reques = None): 这一行下面加上 return
|
||||||
|
|
||||||
- core/basic_monitor.py
|
- core/include/basic_monitor.py
|
||||||
|
|
||||||
在 def report_module_logs(self, force=False): 这一行下面加上 return
|
在 def report_module_logs(self, force=False): 这一行下面加上 return
|
||||||
|
|
||||||
@@ -40,5 +40,14 @@
|
|||||||
|
|
||||||
- init.sh https://download.bt.cn => http://www.example.com
|
- init.sh https://download.bt.cn => http://www.example.com
|
||||||
|
|
||||||
- BT-MONITOR 取消第一个CreateSSL方法定义的注释,删除第二个CreateSSL方法定义
|
- BT-MONITOR 在
|
||||||
|
|
||||||
|
```python
|
||||||
|
def CreateSSL():
|
||||||
|
```
|
||||||
|
|
||||||
|
这一行下面加上
|
||||||
|
|
||||||
|
```python
|
||||||
|
return CreateSSL_offline()
|
||||||
|
```
|
||||||
|
@@ -3,7 +3,7 @@ import public,os,sys,json
|
|||||||
|
|
||||||
#获取插件列表(0/1)
|
#获取插件列表(0/1)
|
||||||
def get_plugin_list(force = 0):
|
def get_plugin_list(force = 0):
|
||||||
api_root_url = 'https://api.bt.cn'
|
api_root_url = 'http://www.example.com'
|
||||||
api_url = api_root_url+ '/panel/get_plugin_list'
|
api_url = api_root_url+ '/panel/get_plugin_list'
|
||||||
cache_file = 'data/plugin_list.json'
|
cache_file = 'data/plugin_list.json'
|
||||||
|
|
||||||
@@ -120,3 +120,17 @@ def path_check(path):
|
|||||||
if i in list:
|
if i in list:
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
#数据加密
|
||||||
|
def db_encrypt(data):
|
||||||
|
result = {}
|
||||||
|
result['status'] = True
|
||||||
|
result['msg'] = data
|
||||||
|
return result
|
||||||
|
|
||||||
|
#数据解密
|
||||||
|
def db_decrypt(data):
|
||||||
|
result = {}
|
||||||
|
result['status'] = True
|
||||||
|
result['msg'] = data
|
||||||
|
return result
|
||||||
|
@@ -71,12 +71,8 @@
|
|||||||
|
|
||||||
- 去除无用的定时任务:task.py 文件 删除以下几行
|
- 去除无用的定时任务:task.py 文件 删除以下几行
|
||||||
|
|
||||||
"update_software_list": update_software_list,
|
|
||||||
|
|
||||||
"check_panel_msg": check_panel_msg,
|
"check_panel_msg": check_panel_msg,
|
||||||
|
|
||||||
PluginLoader.daemon_panel()
|
|
||||||
|
|
||||||
- 去除WebRTC连接:BTPanel/static/js/public.js 删除stun.start();这一行
|
- 去除WebRTC连接:BTPanel/static/js/public.js 删除stun.start();这一行
|
||||||
|
|
||||||
- 去除首页广告:BTPanel/static/js/index.js 文件删除最下面index.recommend_paid_version()这一行
|
- 去除首页广告:BTPanel/static/js/index.js 文件删除最下面index.recommend_paid_version()这一行
|
||||||
@@ -105,6 +101,8 @@
|
|||||||
|
|
||||||
- [可选]关闭自动生成访问日志:在 BTPanel/\_\_init\_\_.py 删除public.write_request_log()这一行
|
- [可选]关闭自动生成访问日志:在 BTPanel/\_\_init\_\_.py 删除public.write_request_log()这一行
|
||||||
|
|
||||||
|
- [可选]删除小图标广告:在BTPanel/static/js/site.js,删除“WAF防火墙,保护网站安全”对应的html标签,files.js,删除“开启保护,文件无法编辑”对应的html标签
|
||||||
|
|
||||||
|
|
||||||
解压安装包panel6.zip,将更新包改好的文件覆盖到里面,然后重新打包,即可更新安装包。(
|
解压安装包panel6.zip,将更新包改好的文件覆盖到里面,然后重新打包,即可更新安装包。(
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user