Configure environment requirements for btcloud
mainEnsure your server meets the following requirements before deployment:
PHP>= 8.0MySQL>= 5.6fileinfoextensionZipArchiveextension
repository·main·Indexed 24 days ago
https://github.com/flucont/btcloudA PHP-based third-party cloud site for Baota (BT) Panel that enables private deployment to ensure privacy, security, and compliance by removing account binding and ads. It includes tools for batch replacing URLs, managing plugin lists, and automating updates. The system provides CLI commands for cleaning ViteJS assets, decrypting BT Panel Python files, and bulk updating plugins across Linux and Windows environments.
Ensure your server meets the following requirements before deployment:
PHP >= 8.0MySQL >= 5.6fileinfo extensionZipArchive extensionTo integrate an official Linux Panel update package with a third-party cloud (btcloud), you must perform a series of file replacements, code modifications, and decryption steps.
Prerequisites:
https://www.bt.cn/api/panel/get_version?is_version=1http://download.bt.cn/install/update/LinuxPanel-<VERSION>.ziphttp://www.example.com.Core Modification Workflow:
.so files in the class folder.linux/PluginLoader.py into the class folder.php think decrypt classdir <path_to_panel_class_folder>php think decrypt all <path_to_panel_mod_folder>bt.cn API and download URLs to your third-party cloud URL (http://www.example.com).class/public.py, class/ajax.py) to bypass official checks and use your cloud configuration.panel6.zip), overwrite with your modified files, and re-package.php think decrypt classdir <面板class文件夹路径>
php think decrypt all <面板mod文件夹路径>To customize the BT Monitor installation package (e.g., for redirection or local hosting), follow these modification steps:
core/include/c_loader/PluginLoader.so and hook_import/PluginLoader.so. Copy btmonitor/PluginLoader.py into those directories.php think decrypt all <source_root_directory>
Note: A few file decryption failures are normal and can be ignored.https://api.bt.cn with http://www.example.com (Exclude /bt_monitor/latest_agent_version and /bt_monitor/ip_info).https://www.bt.cn/api/ with http://www.example.com/api/.https://download.bt.cn with http://www.example.com in modules/configModule/main.py and init.sh.core/include/public.py:def GetConfigValue(key):, add:
if key == 'home': return 'http://www.example.com'def write_request_log(reques = None):, add return.core/include/basic_monitor.py:def report_module_logs(self, force=False):, add return.def report_daily_active(self, force=False):, add return.update/update_btmonitor.sh, modify the download_Url variable within the Install_Monitor method..map files located in the static/js/ directory.php think decrypt all <源码根目录>To use aaPanel with a third-party cloud (btcloud), you must modify the official update packages to redirect API calls and downloads to your own server (e.g., http://www.example.com).
https://brandnew.aapanel.com/api/panel/getLatestOfficialVersionhttp://download.bt.cn/install/update/LinuxPanel_EN-<VERSION>.ziphttp://www.example.com in the instructions below with your actual btcloud URL..so files in the class folder.aapanel/PluginLoader.py into the class folder.php think decrypt classdir <path_to_panel_class_folder>
php think decrypt classdir <path_to_panel_class_v2_folder>https://wafapi2.aapanel.com and https://wafapi.aapanel.com with http://www.example.com (exclude task.py, ipsModel.py, and .js files).https://node.aapanel.com/install/update_7.x_en.sh with http://www.example.com/install/update_7.x_en.sh.https://node.aapanel.com/install/update_pro_en.sh with http://www.example.com/install/update_7.x_en.sh.bt_error/index.php.In several files, you must change public.get_url() to public.OfficialApiBase() to redirect traffic to your cloud:
class/ajax.py and class_v2/ajax_v2.pyclass/jobs.py and class_v2/jobs_v2.pyclass/system.py and class_v2/system_v2.pyIn class/public/common.py, implement the redirection:
def OfficialApiBase():
return 'http://www.example.com'In install/install_soft.sh, add these lines before execution to redirect download paths:
sed -i "s/http:\/\/download.bt.cn\/install\/public.sh/http:\/\/www.example.com\/install\/public.sh/" $name.sh"
sed -i "s/https:\/\/download.bt.cn\/install\/public.sh/http:\/\/www.example.com\/install\/public.sh/" $name.shpanel_7_en.zip)..so files are deleted from the class folder..zip for installation.To modify the official Windows Panel update package, follow these steps:
https://www.bt.cn/api/wpanel/get_version?is_version=1http://download.bt.cn/win/panel/panel_版本号.zip (replace 版本号 with the actual version number).btPanel.exe with a hex editor and perform the following replacements:https://api.bt.cn with http://api.bt.cn/https://www.bt.cn with http://www.bt.cn/api.bt.cn with any other domain.www.bt.cn with any other domain.Once deployed, use the following tools within the administration panel to manage your cloud site:
批量替换工具): Execute the command displayed on this page to batch replace http://www.example.com with your current website URL inside BT installation packages, update packages, and script files.系统基本设置): Configure the Baota Panel interface settings. You must prepare a Baota Panel installed with the latest official scripts and bound to an account to fetch the latest plugin lists and packages. Follow the interface instructions to install the required specialized plugin.定时任务设置): Execute the displayed command to fetch the latest plugin list from the official Baota source and perform batch downloads (incremental updates). Alternatively, you can download plugins individually from the plugin list./download on your website to access the one-click installation scripts for using this third-party cloud.To remove CAPTCHAs (calculation problems) and advertisements from the Vite-based UI:
bt.js to BTPanel/static/. In BTPanel/templates/default/software.html, insert the following script tag before window.vite_public_request_token:<script src="/static/bt.js"></script>php think cleanvitejs <path_to_panel_BTPanel/static/js>```javascript
<script src="/static/bt.js"></script>php think cleanvitejs <面板BTPanel/static/js路径>
Beyond core redirection, you can perform the following optional cleanups to improve the user experience on your btcloud instance:
bt.js to the end of BTPanel/static/vite/oldjs/public_backup.js.class/panelSite.py and class_v2/panel_site_v2.py, delete the blocks responsible for creating .htaccess, index.html, and 404.html.class/panelSite.py and class_v2/panel_site_v2.py, change root /www/server/nginx/html to return 400.BTPanel/static/vite/oldjs/upload-drog.js, add the checked attribute to id="all_operation".php think cleanvitejs <path_to_panel_BTPanel/static/js>BTPanel/languages/settings.json and add zh/server.json and all/zh.json.Modify class/panelPlugin.py to handle software updates and status checks:
__set_pyenv, after temp_file = public.readFile(filename), add:temp_file = temp_file.replace('http://download.bt.cn/install/public.sh', 'http://www.example.com/install/public.sh')
temp_file = temp_file.replace('https://download.bt.cn/install/public.sh', 'http://www.example.com/install/public.sh')def check_status(self, softInfo):, add at the end:if 'endtime' in softInfo:
softInfo['endtime'] = time.time() + 86400 * 3650plugin_bin.pl to plugin_list.json.public.total_keyword(get.query), public.run_thread(self.get_cloud_list_status, args=(get,)), and public.run_thread(self.is_verify_unbinding, args=(get,)).if 'endtime' in softInfo:
softInfo['endtime'] = time.time() + 86400 * 3650To ensure the panel uses your third-party cloud instead of official servers, modify class/public.py with the following logic:
def GetConfigValue(key):, add:if key == 'home': return 'http://www.example.com'def is_bind():, add return True.def check_domain_cloud(domain):, add return.def err_collect, add return.def get_improvement():, add return False.free_login_area, replace get_free_ips_area with get_ips_area.get_free_ip_info, update the IP retrieval to: res = get_ips_area([address]).login_send_body, change free_login_area(login_ip=server_ip_area) to free_login_area(login_ip=login_ip).check_area_panel, remove the cloud retrieval attempt and keep only: ip_area_dict = get_ip_location(client_ip).def GetConfigValue(key):
if key == 'home': return 'http://www.example.com'To update your existing installation:
data folder.Batch Replacement Tool -> Get Latest Plugin List (批量替换工具 -> 获取最新插件列表).Software Version Settings (修改软件版本设置).To deploy your own private Baota (BT) Panel cloud site, follow these steps:
composer install --no-dev to install dependencies. Release packages do not require this.public.ThinkPHP.