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.

80 lines
3.0 KiB

4 months ago
  1. # Windows面板官方更新包修改记录
  2. 查询最新版本号:https://www.bt.cn/api/wpanel/get_version?is_version=1
  3. 官方更新包下载链接:http://download.bt.cn/win/panel/panel_版本号.zip
  4. 假设搭建的宝塔第三方云端网址是 http://www.example.com
  5. Windows版宝塔由于加密文件太多,无法全部解密,因此无法做到全开源。
  6. - 删除PluginLoader.pyd,将win/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/(需排除ipsModel.py)
  10. - 全局搜索替换 https://download.bt.cn/win/panel/data/setup.py => http://www.example.com/win/panel/data/setup.py
  11. - class/panel_update.py 文件 public.get_url() => 'http://www.example.com'
  12. - class/public.py 在
  13. ```python
  14. def GetConfigValue(key):
  15. ```
  16. 这一行下面加上
  17. ```python
  18. if key == 'home': return 'http://www.example.com'
  19. ```
  20. 在 def is_bind(): 这一行下面加上 return True
  21. 在 def check_domain_cloud(domain): 这一行下面加上 return
  22. 在 get_update_file() 方法里面 get_url() => GetConfigValue('home')
  23. - class/plugin_deployment.py 文件 get_icon 和 SetupPackage 方法内,替换 public.GetConfigValue('home') => 'https://www.bt.cn'
  24. - 去除无用的定时任务:task.py 文件
  25. 删除 p = threading.Thread(target=check_files_panel) 以及下面2行
  26. 删除 p = threading.Thread(target=check_panel_msg) 以及下面2行
  27. 删除 p = threading.Thread(target=update_software_list) 以及下面2行
  28. - 去除面板日志上报:script/site_task.py 文件
  29. - 删除最下面 logs_analysis() 这1行
  30. - 去除首页广告:BTPanel/static/js/index.js 文件删除最下面index.recommend_paid_version()这一行以及index.consultancy_services()这一行
  31. - 去除首页自动检测更新,避免频繁请求云端:BTPanel/static/js/index.js 文件注释掉bt.system.check_update这一段代码外的setTimeout
  32. - 去除内页广告:BTPanel/templates/default/layout.html 删除getPaymentStatus();这一行
  33. - [可选]去除各种计算题:复制win/bt.js到 BTPanel/static/ ,在 BTPanel/templates/default/layout.html 的尾部加入
  34. ```javascript
  35. <script src="/static/bt.js"></script>
  36. ```
  37. - [可选]去除创建网站自动创建的垃圾文件:class/panelSite.py 文件
  38. 删除 htaccess = self.sitePath + '/.htaccess' 以及下面2行
  39. 删除 index = self.sitePath + '/index.html' 以及下面6行
  40. 删除 doc404 = self.sitePath + '/404.html' 以及下面6行
  41. 删除 if not os.path.exists(self.sitePath + '/.htaccess') 这一行
  42. - [可选]关闭自动生成访问日志:在 BTPanel/\_\_init\_\_.py 删除public.write_request_log()这一行
  43. - [可选]上传文件默认选中覆盖,在BTPanel/static/js/upload-drog.js,id="all_operation"加checked属性