You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

148 lines
5.7 KiB

1 year ago
4 months ago
1 year ago
10 months ago
1 year ago
19 hours ago
5 months ago
10 months ago
1 year ago
5 months ago
1 year ago
4 months ago
1 year ago
9 months ago
5 months ago
4 months ago
19 hours ago
1 year ago
8 months ago
5 months ago
3 months ago
10 months ago
8 months ago
5 months ago
8 months ago
1 year ago
3 months ago
1 year ago
8 months ago
1 year ago
19 hours ago
3 weeks ago
1 year ago
10 months ago
1 year ago
10 months ago
1 year ago
10 months ago
1 year ago
5 months ago
5 months ago
1 year ago
7 months ago
1 year ago
  1. # Linux面板官方更新包修改记录
  2. 查询最新版本号:https://www.bt.cn/api/panel/get_version?is_version=1
  3. 官方更新包下载链接:http://download.bt.cn/install/update/LinuxPanel-版本号.zip
  4. 假设搭建的宝塔第三方云端网址是 http://www.example.com
  5. - 将class文件夹里面所有的.so文件删除
  6. - 将linux/PluginLoader.py复制到class文件夹
  7. - 批量解密模块文件:执行 php think decrypt classdir <面板class文件夹路径>
  8. - 全局搜索替换 https://api.bt.cn => http://www.example.com
  9. - 全局搜索替换 https://www.bt.cn/api/ => http://www.example.com/api/(需排除clearModel.py、scanningModel.py、ipsModel.py、js文件)
  10. - 全局搜索替换 http://www.bt.cn/api/ => http://www.example.com/api/(需排除js文件)
  11. - 全局搜索替换 https://download.bt.cn/install/update6.sh => http://www.example.com/install/update6.sh
  12. http://download.bt.cn/install/update6.sh => http://www.example.com/install/update6.sh
  13. http://download.bt.cn/install/update/ => http://www.example.com/install/update/
  14. - 搜索并删除提交异常报告的代码 bt_error/index.php
  15. - class/ajax.py 文件 \# 是否执行升级程序 下面的 public.get_url() 改成 public.GetConfigValue('home')
  16. class/jobs.py 文件 \#尝试升级到独立环境 下面的 public.get_url() 改成 public.GetConfigValue('home')
  17. class/system.py 文件 RepPanel和UpdatePro方法内的 public.get_url() 改成 public.GetConfigValue('home')
  18. - class/public.py 在
  19. ```python
  20. def GetConfigValue(key):
  21. ```
  22. 这一行下面加上
  23. ```python
  24. if key == 'home': return 'http://www.example.com'
  25. ```
  26. 在 def is_bind(): 这一行下面加上 return True
  27. 在 def check_domain_cloud(domain): 这一行下面加上 return
  28. 在 def err_collect 这一行下面加上 return
  29. 在 def get_improvement(): 这一行下面加上 return False
  30. 在free_login_area方法内get_free_ips_area替换成get_ips_area
  31. 在get_free_ip_info方法内,获取IP的部分改成res = get_ips_area([address])
  32. 在login_send_body方法内,free_login_area(login_ip=server_ip_area的server_ip_area改成login_ip
  33. - class/panelPlugin.py 文件,删除public.total_keyword(get.query)这一行
  34. __set_pyenv方法内,temp_file = public.readFile(filename)这行代码下面加上
  35. ```python
  36. temp_file = temp_file.replace('http://download.bt.cn/install/public.sh', 'http://www.example.com/install/public.sh')
  37. temp_file = temp_file.replace('https://download.bt.cn/install/public.sh', 'http://www.example.com/install/public.sh')
  38. ```
  39. def check_status(self, softInfo): 方法最后一行加上
  40. ```python
  41. if 'endtime' in softInfo:
  42. softInfo['endtime'] = time.time() + 86400 * 3650
  43. ```
  44. plugin_bin.pl 改成 plugin_list.json
  45. - class/plugin_deployment.py 文件,__setup_php_environment方法和GetJarPath方法内替换 public.GetConfigValue('home') => 'https://www.bt.cn'
  46. - class/config.py 文件,get_nps方法内data['nps'] = False改成True,get_nps_new方法下面加上 return public.returnMsg(False, "获取问卷失败")
  47. def err_collection(self, get): 这一行下面加上 return public.returnMsg(True, "OK")
  48. - class/push/site_push.py 文件,'https://www.bt.cn' => 'http://www.example.com'
  49. - script/flush_plugin.py 文件,删除clear_hosts()一行
  50. - script/reload_check.py 文件,在第2行插入sys.exit()
  51. - script/local_fix.sh 文件,${D_NODE_URL}替换成www.example.com
  52. - tools.py 文件,u_input == 16下面的public.get_url()替换成public.GetConfigValue('home')
  53. - install/install_soft.sh 在. 执行之前加入以下代码
  54. ```shell
  55. sed -i "s/http:\/\/download.bt.cn\/install\/public.sh/http:\/\/www.example.com\/install\/public.sh/" lib.sh
  56. sed -i "s/https:\/\/download.bt.cn\/install\/public.sh/http:\/\/www.example.com\/install\/public.sh/" lib.sh
  57. ```
  58. - install/public.sh 用官网最新版的[public.sh](http://download.bt.cn/install/public.sh)替换,并去除最下面bt_check一行
  59. - 去除无用的定时任务:task.py 文件 删除以下几行
  60. "check_panel_msg": self.check_panel_msg,
  61. "update_software_list": self.update_software_list,
  62. PluginLoader.daemon_panel()
  63. check_node_status()
  64. - 去除WebRTC连接:BTPanel/static/js/public.js 删除stun.start();这一行
  65. - 去除内页广告:BTPanel/templates/default/layout.html 删除两处getPaymentStatus();
  66. - 删除问卷调查:BTPanel/templates/default/layout.html 删除if(window.localStorage.getItem('panelNPS') == null)以及下面的行
  67. - [可选]去除各种计算题:复制bt.js到 BTPanel/static/ ,在 BTPanel/templates/default/layout.html 的\</body\>前面加入
  68. ```javascript
  69. <script src="/static/bt.js"></script>
  70. ```
  71. 在 BTPanel/templates/default/software.html 的 \<script\>window.vite_public_request_token 前面加入
  72. - [可选]去除创建网站自动创建的垃圾文件:在class/panelSite.py,分别删除
  73. htaccess = self.sitePath + '/.htaccess'
  74. index = self.sitePath + '/index.html'
  75. doc404 = self.sitePath + '/404.html'
  76. 这3行及分别接下来的4行代码
  77. - [可选]关闭未绑定域名提示页面:在class/panelSite.py,root /www/server/nginx/html改成return 400
  78. - [可选]关闭自动生成访问日志:在 BTPanel/\_\_init\_\_.py 删除public.write_request_log这一行
  79. - [可选]新版vite页面去除需求反馈、各种广告、计算题等,执行 php think cleanvitejs <面板BTPanel/static/vite/js路径>
  80. 解压安装包[panel6.zip](http://download.bt.cn/install/src/panel6.zip),将更新包改好的文件覆盖到里面,然后重新打包,即可更新安装包。(
  81. 别忘了删除class文件夹里面所有的.so文件)