### Installation Wizard Source: https://github.com/flucont/btcloud/blob/main/_autodocs/endpoints.md Initiates the installation wizard for first-time setup. ```APIDOC ## POST /installapp ### Description Initiates the installation wizard for first-time setup. ### Method POST ### Endpoint /installapp ### Controller install/index ### Access First-run setup only. ``` -------------------------------- ### GET /api/SetupCount Source: https://github.com/flucont/btcloud/blob/main/_autodocs/endpoints.md Installation counter endpoint (no-operation). ```APIDOC ## GET /api/SetupCount ### Description Installation counter (no-op). ### Method GET ### Endpoint /api/SetupCount ### Response Returns 'ok' ``` -------------------------------- ### Admin Settings POST Request Example Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/admin-controller.md Example of a POST request to update system settings, including username, password, and version. ```http POST /admin/set admin_username=newuser&admin_password=newpass&new_version=7.11.0 ``` -------------------------------- ### Environment Variables Example Source: https://github.com/flucont/btcloud/blob/main/_autodocs/configuration.md Example of .env file format for database and application configuration. Ensure sensitive information like passwords are kept secure. ```env # Database DB_TYPE=mysql DB_HOST=localhost DB_PORT=3306 DB_NAME=btcloud DB_USER=root DB_PWD=password # App APP_DEBUG=false APP_ENV=production ``` -------------------------------- ### Get Plugin List (Linux/aaPanel) Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Retrieves the plugin list for Linux or aaPanel installations. Uses client IP for context. Returns an empty object if the checklist fails. ```php public function get_plugin_list(): \think\Response ``` ```json { "list": [ { "name": "plugin_name", "type": 5, "endtime": 0 } ], "ip": "127.0.0.1", "serverid": "", "aln": "encrypted_value", "beta": 0, "uid": 1, "skey": "", "pro": -1, "ltd": 4733404800 } ``` ```php // Called from panel installation, no direct parameters needed // Response contains full plugin catalog $response = $this->get_plugin_list(); ``` -------------------------------- ### Get Panel Configuration Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/btapi-class.md Retrieve the panel's configuration details, including installed modules and system information. Use this for standard Baota panels. ```php $config = $btapi->get_config(); // Array with configuration data ``` -------------------------------- ### GET / Source: https://github.com/flucont/btcloud/blob/main/_autodocs/endpoints.md Serves the main landing page of the BTCloud system. ```APIDOC ## GET / ### Description Main landing page ### Method GET ### Endpoint / ``` -------------------------------- ### Plugin Download Success Response Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/admin-controller.md Example of a successful response after downloading a plugin. ```json { "code": 0, "msg": "下载成功" } ``` -------------------------------- ### Get Plugin List (aaPanel English) Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Retrieves the plugin list specifically for aaPanel English installations. Uses client IP for context. ```php public function get_plugin_list_en(): \think\Response ``` ```http // aaPanel requests plugin list GET /api/panel/getSoftListEn ``` -------------------------------- ### Example Error Alert Usage Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/admin-controller.md Example of how to use the alert method to display an error and redirect the user. ```php return $this->alert(-1, 'Configuration save failed', '/admin/set', 3); ``` -------------------------------- ### GET /api/panel/get_beta_logs, /api/panel/getBetaVersionLogs, /api/wpanel/get_beta_logs Source: https://github.com/flucont/btcloud/blob/main/_autodocs/endpoints.md Returns the beta version changelog. ```APIDOC ## GET /api/panel/get_beta_logs, /api/panel/getBetaVersionLogs, /api/wpanel/get_beta_logs ### Description Returns beta version changelog. ### Method GET ### Endpoint /api/panel/get_beta_logs, /api/panel/getBetaVersionLogs, /api/wpanel/get_beta_logs ### Response #### Success Response - **beta_ps** (string) - Message indicating if there are beta logs available. - **list** (array) - List of beta version log entries. ### Response Example { "beta_ps": "当前暂无内测版", "list": [] } ``` -------------------------------- ### Get Auth Token Success Response Source: https://github.com/flucont/btcloud/blob/main/_autodocs/endpoints.md Example of a successful response when generating an account binding token. ```json { "status": true, "msg": "登录成功!", "data": "hex_encoded_user_info" } ``` -------------------------------- ### Example .env File Source: https://github.com/flucont/btcloud/blob/main/_autodocs/configuration.md A template for the `.env` file, showing common environment variables for application configuration, including database and debugging settings. ```env APP_DEBUG=false DB_TYPE=mysql DB_HOST=localhost DB_PORT=3306 DB_NAME=btcloud DB_USER=root DB_PWD= ``` -------------------------------- ### GET /api/panel/get_panel_version Source: https://github.com/flucont/btcloud/blob/main/_autodocs/endpoints.md Retrieves version information and the SHA256 hash for the Linux installer. ```APIDOC ## GET /api/panel/get_panel_version ### Description Returns version info and SHA256 hash for Linux installer ### Method GET ### Endpoint /api/panel/get_panel_version ### Response #### Success Response - **version** (string) - The panel version number. - **hash** (string) - The SHA256 hash of the installer. - **update_time** (integer) - Timestamp of the last update. ### Response Example ```json { "version": "7.10.0", "hash": "sha256_hash", "update_time": 1672531200 } ``` ``` -------------------------------- ### Get Panel Version - PHP Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Provides version information and the SHA256 hash for the Linux panel installer. The response is a JSON object containing version, hash, and update time. ```php public function get_panel_version(): \think\Response ``` ```json { "version": "7.10.0", "hash": "sha256_hash_value", "update_time": unix_timestamp } ``` -------------------------------- ### Get One-Click Deployment Applications List Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Retrieves a list of applications available for one-click deployment. Requires the operating system type as a parameter. ```php public function get_deplist(): \think\Response ``` -------------------------------- ### Get One-Click Deployment List Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/btapi-class.md Retrieves a list of applications available for one-click deployment. The response includes application details and available versions. ```php [ 'type' => 'source', 'list' => [ [ 'name' => 'app_name', 'title' => 'Application Title', 'versions' => [...] ] ] ] ``` -------------------------------- ### Get Recommended Plugins and Service Info Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Retrieves information about recommended plugins and customer service details, including QQ and group numbers. ```php public function get_plugin_remarks(): \think\Response ``` -------------------------------- ### get_config() Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/btapi-class.md Retrieves the overall panel configuration, including installed modules, system information, and settings. ```APIDOC ## GET /config ### Description Retrieves panel configuration. ### Method GET ### Endpoint `{BT_PANEL}/config?action=get_config` ### Parameters #### Query Parameters - **action** (string) - Required - `get_config` ### Response #### Success Response (200) - **installed modules** (array) - Description of installed modules - **system info** (object) - Description of system information - **settings** (object) - Description of panel settings ### Response Example ```json { "installed modules": [], "system info": {}, "settings": {} } ``` ``` -------------------------------- ### Application Settings Configuration Source: https://github.com/flucont/btcloud/blob/main/_autodocs/configuration.md Example of application settings in ThinkPHP's `config/app.php` file, including debug mode and timezone. ```php 'debug' => env('APP_DEBUG', false), 'app_trace' => false, 'timezone' => 'Asia/Shanghai', ``` -------------------------------- ### set() Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/admin-controller.md Manages system settings. Accepts GET requests to display settings forms and POST requests to update configuration values. ```APIDOC ## set() ### Description Displays and updates system settings. ### Method GET, POST ### Endpoint /admin/set ### Parameters #### Query Parameters (for GET request) - **mod** (string) - Optional - Default: 'sys' - Settings module (e.g., 'sys', 'version'). #### Request Body (for POST request - AJAX) All POST parameters are treated as configuration key-value pairs to be updated. ### Request Example (POST) ``` POST /admin/set admin_username=newuser&admin_password=newpass&new_version=7.11.0 ``` ### Response #### Success Response (200) - **code** (integer) - 0 on success #### Response Example (Success) ```json { "code": 0 } ``` ### Data Assigned to View (GET Request) - **mod** - Current module - **conf** - Configuration array - **runtime** - Runtime status - **is_user_www** - Boolean indicating if running as www user ``` -------------------------------- ### Is Obtained Btw Trial Success Response Source: https://github.com/flucont/btcloud/blob/main/_autodocs/endpoints.md Example of a successful response when checking if a trial license was obtained. ```json { "status": true, "err_no": 0, "data": "hex_encoded_json", "msg": "检测成功" } ``` -------------------------------- ### Get Plugin List Source: https://github.com/flucont/btcloud/blob/main/_autodocs/README.md Retrieves a list of available plugins for a specified operating system. Assumes the Plugins class and its methods are accessible. ```php $plugins = Plugins::get_plugin_list('Linux'); foreach ($plugins['list'] as $plugin) { echo $plugin['name'] . ' v' . $plugin['versions'][0]['version']; } ``` -------------------------------- ### Admin Plugin Management Source: https://github.com/flucont/btcloud/blob/main/_autodocs/endpoints.md Manage installed plugins and extensions. ```APIDOC ## GET /admin/plugins ### Description Manage installed plugins and extensions. ### Method GET ### Endpoint /admin/plugins ### Access Requires valid admin authentication. ``` -------------------------------- ### Authorization Login Success Response Source: https://github.com/flucont/btcloud/blob/main/_autodocs/endpoints.md Example of a successful response from the alternative account binding endpoint. ```json { "status": true, "err_no": 0, "msg": "账号绑定成功", "data": "hex_encoded_user_info" } ``` -------------------------------- ### Admin Login POST Request Response (Success) Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/admin-controller.md Example of a successful JSON response after an admin login attempt. ```json { "code": 0, "msg": "Success message" } ``` -------------------------------- ### GET /api/index/get_win_date Source: https://github.com/flucont/btcloud/blob/main/_autodocs/endpoints.md Returns the formatted server date and time. ```APIDOC ## GET /api/index/get_win_date ### Description Returns formatted date/time. ### Method GET ### Endpoint /api/index/get_win_date ### Response String in format "Y-m-d H:i:s" ``` -------------------------------- ### GET/POST /panel/getSoftList, /panel/getSoftListEn Source: https://github.com/flucont/btcloud/blob/main/_autodocs/endpoints.md Returns a list of plugins for aaPanel installations, similar to the Linux plugin list. Requires IP-based access control. ```APIDOC ## GET/POST /panel/getSoftList, /panel/getSoftListEn ### Description Returns plugin list for aaPanel installations ### Method GET, POST ### Endpoint /api/panel/getSoftList, /api/panel/getSoftListEn ### Response - Same as Linux plugin list ``` -------------------------------- ### Update License Success Response Source: https://github.com/flucont/btcloud/blob/main/_autodocs/endpoints.md Example of a successful response when generating an encrypted license. ```json { "status": true, "err_no": 0, "msg": "授权获取成功", "data": "hex_encoded_response" } ``` -------------------------------- ### Plugin Download Error Response Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/admin-controller.md Example of an error response when downloading a plugin fails. ```json { "code": -1, "msg": "Error details" } ``` -------------------------------- ### JSON Response: Alternative Success Format Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Example of an alternative success response format including a nonce. ```json { "success": true, "res": "操作成功", "nonce": unix_timestamp } ``` -------------------------------- ### Linux Plugin List Response Source: https://github.com/flucont/btcloud/blob/main/_autodocs/endpoints.md Example JSON response for retrieving a list of plugins for Linux panels. This endpoint requires IP-based access control. ```json { "list": [ { "name": "nginx", "title": "Nginx", "type": 5, "versions": [ { "version": "1.24.0", "download": "url", "md5": "hash" } ] } ], "ip": "client_ip", "serverid": "", "aln": "encrypted_value", "beta": 0, "uid": 1, "skey": "", "pro": -1, "ltd": 4733404800 } ``` -------------------------------- ### Get Plugin Auth Win - PHP Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Returns an encrypted JSON authorization list specifically for Windows panels, including Windows-specific product IDs. ```php public function get_plugin_auth_win(): string ``` -------------------------------- ### ThinkPHP Database Configuration Source: https://github.com/flucont/btcloud/blob/main/_autodocs/configuration.md Example of database configuration within ThinkPHP's `config/database.php` file, using environment variables for connection details. ```php 'default' => env('DB_TYPE', 'mysql'), 'connections' => [ 'mysql' => [ 'type' => 'mysql', 'hostname' => env('DB_HOST', 'localhost'), 'database' => env('DB_NAME', 'btcloud'), 'username' => env('DB_USER', 'root'), 'password' => env('DB_PWD', ''), 'charset' => 'utf8mb4', 'prefix' => '', ], ], ``` -------------------------------- ### get_panel_version Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Provides version information and the SHA256 hash for the Linux panel installer. It also includes the update time. ```APIDOC ## get_panel_version() ### Description Returns version info and SHA256 hash for the Linux panel installer, along with the update time. ### Method GET ### Endpoint /get_panel_version ### Response ```json { "version": "7.10.0", "hash": "sha256_hash_value", "update_time": unix_timestamp } ``` ``` -------------------------------- ### Replace URL in `site_push.py` Source: https://github.com/flucont/btcloud/blob/main/wiki/update.md This modification in `site_push.py` replaces a specific official URL with a custom example domain. ```python class/push/site_push.py 文件,'https://www.bt.cn' => 'http://www.example.com' ``` -------------------------------- ### Get Configuration Value Source: https://github.com/flucont/btcloud/blob/main/_autodocs/configuration.md Retrieves a configuration value from the database. Use the default parameter when a key might not exist. ```php function config_get($key, $default = null): mixed { // Implementation omitted for brevity } ``` ```php $username = config_get('admin_username', 'admin'); $version = config_get('new_version'); ``` -------------------------------- ### Synchronize Deployment List Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/admin-controller.md Synchronizes the deployment list by fetching data from the Baota API. This is a GET request and requires CheckAdmin middleware. ```php public function refresh_deplist() ``` -------------------------------- ### Get Beta Version Changelog Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Retrieves the changelog for beta versions. If no beta versions are available, it indicates so. ```php public function get_beta_logs(): \think\Response ``` -------------------------------- ### Download Plugin Package (aaPanel) Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Downloads a plugin package for aaPanel installations. Requires plugin name and version. Supports the same validation as `download_plugin()`. ```php public function download_plugin_en(): void ``` -------------------------------- ### Get Plugin List Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/btapi-class.md Retrieve a comprehensive list of all available plugins from the Baota panel. Iterate through the list to access individual plugin details. ```php $plugins = $btapi->get_plugin_list(); foreach ($plugins['list'] as $plugin) { echo $plugin['name'] . " - " . $plugin['title']; } ``` -------------------------------- ### login() Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/admin-controller.md Handles admin login. It can return the login form via GET request or authenticate credentials via POST request. ```APIDOC ## login() ### Description Admin login page and authentication handler. ### Method GET, POST ### Endpoint /admin/login ### Parameters #### Query Parameters (for GET request) None #### Request Body (for POST request - AJAX) - **username** (string) - Required - Admin username - **password** (string) - Required - Admin password - **code** (string) - Required - CAPTCHA verification code ### Request Example (POST) ```json { "username": "admin", "password": "password123", "code": "abcd" } ``` ### Response #### Success Response (200) - **code** (integer) - 0 for success - **msg** (string) - Success message #### Response Example (Success) ```json { "code": 0, "msg": "Login successful" } ``` #### Error Responses - **code** (integer) - -1 for error - **msg** (string) - Error message (e.g., "用户名或密码不能为空", "验证码错误", "用户名或密码错误") #### Error Response Example ```json { "code": -1, "msg": "用户名或密码不能为空" } ``` ``` -------------------------------- ### Plugin Download Flow Diagram Source: https://github.com/flucont/btcloud/blob/main/_autodocs/ARCHITECTURE.md Details the steps involved in downloading a plugin, highlighting the distinct paths for Official API and Third-Party integrations. ```text Panel Request: /down/download_plugin?name=nginx&version=1.24.0 ↓ Api::download_plugin() ↓ Check IP whitelist/blacklist ↓ Validate parameters ↓ Plugins::download_plugin() ↓ ┌─ Official API: BtPlugins::download_plugin() │ → Btapi::get_plugin_filename() │ → Btapi::download() │ → Extract & decrypt if encrypted │ → Save to data/plugins/package/ │ └─ Third-Party: ThirdPlugins::download_plugin() → HTTP POST to remote cloud endpoint → Download and validate MD5 → Save to data/plugins/package/ ↓ Return ZIP file to panel ``` -------------------------------- ### Get Decrypted Plugin Main File Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/btapi-class.md Get the decrypted content of a plugin's main file. This is useful for accessing or analyzing plugin code. ```php $btapi->get_decode_plugin_main($plugin_name, $version); ``` -------------------------------- ### Get Baota Cloud Control Version Info Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Fetches general version information for Baota Cloud Control. ```php public function cloudc_version_info(): \think\Response ``` -------------------------------- ### Get Update Logs - PHP Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Retrieves the update changelog for panels, returning a JSONP response. Accepts a 'type' GET parameter to specify the panel type (Windows or Linux). ```php public function get_update_logs(): \think\Response ``` ```json [ { "title": "Linux面板7.10.0", "body": "Update message...", "addtime": "2024-01-01" } ] ``` -------------------------------- ### GET /admin/logout Source: https://github.com/flucont/btcloud/blob/main/_autodocs/endpoints.md Logs out the admin user. ```APIDOC ## GET /admin/logout ### Description Admin logout. ### Method GET ### Endpoint /admin/logout ``` -------------------------------- ### Instantiate Btapi Class Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/btapi-class.md Initialize the Btapi class with the Baota panel URL and API key. ```php $btapi = new Btapi('http://baota.example.com:7800/', 'api_key_here'); ``` -------------------------------- ### Version Info with Download URLs Source: https://github.com/flucont/btcloud/blob/main/_autodocs/endpoints.md JSON response providing version information, including download URLs and update messages, for panel installations. Supports multiple versions and account-specific details. ```json { "OfficialVersion": { "version": "7.10.0", "downUrl": "http://example.com/install/update/LinuxPanel-7.10.0.zip", "updateMsg": "Update message", "uptime": "2024-01-01" }, "OfficialVersionLatest": [], "AccountVersion": [] } ``` -------------------------------- ### GET /admin/verifycode Source: https://github.com/flucont/btcloud/blob/main/_autodocs/endpoints.md Generates a CAPTCHA image for verification. ```APIDOC ## GET /admin/verifycode ### Description CAPTCHA image generation. ### Method GET ### Endpoint /admin/verifycode ### Middleware SessionInit ``` -------------------------------- ### Get Version - PHP Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Returns the latest Linux panel version number as a string. This version is configured via the 'new_version' key. ```php public function get_version(): string ``` -------------------------------- ### GET /api/Pluginother/get_file, /api/plugin/download Source: https://github.com/flucont/btcloud/blob/main/_autodocs/endpoints.md Downloads auxiliary plugin files. Requires IP check and includes security measures against path traversal. ```APIDOC ## GET /api/Pluginother/get_file, /api/plugin/download ### Description Downloads auxiliary plugin files. This endpoint requires an IP check and has security measures in place to prevent path traversal. ### Method GET ### Endpoint /api/Pluginother/get_file, /api/plugin/download ### Parameters #### Query Parameters - **fname** (string) - Required - Filename to download - **filename** (string) - Optional - Alternative filename parameter ### Security Path traversal protection (no dots in parent directory). ``` -------------------------------- ### index() Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/admin-controller.md Displays the admin dashboard with system information and plugin statistics. ```APIDOC ## index() ### Description Admin dashboard showing system information and statistics. ### Method GET ### Endpoint /admin/index ### Response HTML dashboard view ### Data Assigned to View - **$stat** (object) - Plugin statistics including total, free, pro, ltd, third plugins, runtime status, and record counts. - **$info** (object) - System information including framework version, PHP version, MySQL version, web server info, OS, and current date/time. ``` -------------------------------- ### GET /admin/login Source: https://github.com/flucont/btcloud/blob/main/_autodocs/endpoints.md Renders the admin login page. ```APIDOC ## GET /admin/login ### Description Admin login page. ### Method GET ### Endpoint /admin/login ### Middleware SessionInit ``` -------------------------------- ### GET /api/panel/get_spider Source: https://github.com/flucont/btcloud/blob/main/_autodocs/endpoints.md Returns spiders by type (category). ```APIDOC ## GET /api/panel/get_spider ### Description Returns spiders by type (category). ### Method GET ### Endpoint /api/panel/get_spider ### Parameters #### Path Parameters None #### Query Parameters - **spider** (integer) - Spider type ID ### Request Example ``` /api/panel/get_spider?spider=1 ``` ### Response #### Success Response (200) - Array of IP addresses ### Response Example ```json [ "ip1", "ip2" ] ``` ``` -------------------------------- ### Get Plugin Main File Path Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/btapi-class.md Retrieve the file path for a plugin's main Python file on the panel server. ```php $btapi->get_plugin_main_filename($plugin_name, $version); ``` -------------------------------- ### get_plugin_list() Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Retrieves the list of available plugins for Linux/aapanel installations. It uses the client's IP address from the request context and returns a JSON object with plugin details. An empty object is returned if the checklist fails. ```APIDOC ## get_plugin_list() ### Description Returns the plugin list for Linux/aapanel panels. Uses client IP from request context. ### Method GET (inferred from context, not explicitly stated) ### Endpoint /api/panel/get_plugin_list (inferred from context, not explicitly stated) ### Parameters None ### Response #### Success Response (200) - **list** (array) - Array of plugin objects, each with `name`, `type`, and `endtime`. - **ip** (string) - Client IP address. - **serverid** (string) - Server identifier. - **aln** (string) - Encrypted value. - **beta** (integer) - Beta flag. - **uid** (integer) - User identifier. - **skey** (string) - Session key. - **pro** (integer) - Professional status. - **ltd** (integer) - License end time. #### Response Example ```json { "list": [ { "name": "plugin_name", "type": 5, "endtime": 0 } ], "ip": "127.0.0.1", "serverid": "", "aln": "encrypted_value", "beta": 0, "uid": 1, "skey": "", "pro": -1, "ltd": 4733404800 } ``` ### Throws/Errors - Returns JSON error if IP is blacklisted or not in whitelist. ``` -------------------------------- ### GET /api/common/getClientIP Source: https://github.com/flucont/btcloud/blob/main/_autodocs/endpoints.md Returns client IP address. ```APIDOC ## GET /api/common/getClientIP, /api/getIpAddress ### Description Returns client IP address. ### Method GET ### Endpoint /api/common/getClientIP, /api/getIpAddress ### Response #### Success Response (200) - Plain text IP address ### Response Example ``` 192.168.1.1 ``` ``` -------------------------------- ### Configuration Management Helper Functions Source: https://github.com/flucont/btcloud/blob/main/_autodocs/README.md Provides functions for retrieving and setting configuration values within the BTCloud system. These are essential for managing system settings and application behavior. ```PHP config_get() config_set() ``` -------------------------------- ### Get Panel Configuration (Go Version) Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/btapi-class.md Retrieve the panel's configuration details using the Go version endpoint. This is recommended for newer Go-based Baota panels. ```php $config = $btapi->get_config_go(); ``` -------------------------------- ### GET /api/index/get_time Source: https://github.com/flucont/btcloud/blob/main/_autodocs/endpoints.md Returns the current server Unix timestamp. ```APIDOC ## GET /api/index/get_time ### Description Returns server Unix timestamp. ### Method GET ### Endpoint /api/index/get_time ### Response Integer timestamp ``` -------------------------------- ### Display Deployment Applications List Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/admin-controller.md Displays the interface for managing deployment applications. Requires CheckAdmin middleware. ```php public function deplist() ``` -------------------------------- ### GET /api/panel/is_pro Source: https://github.com/flucont/btcloud/blob/main/_autodocs/endpoints.md Returns the pro edition status of the panel (deprecated). ```APIDOC ## GET /api/panel/is_pro ### Description Returns pro edition status (deprecated). ### Method GET ### Endpoint /api/panel/is_pro ### Response #### Success Response - **endtime** (boolean) - Indicates if the pro edition has expired. - **code** (integer) - Status code, likely 1 for pro. ### Response Example { "endtime": true, "code": 1 } ``` -------------------------------- ### Get Plugin List (Windows) Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Retrieves the plugin list for Windows panels. Supports optional encryption using server and user identifiers. Returns an encrypted string for 'windows_go' OS versions. ```php public function get_plugin_list_win(): \think\Response | string ``` ```http // Windows panel plugin list request POST /panel/get_plugin_list_win POST data: os_version=windows_go&serverid=SERVER123&uid=USER123 ``` -------------------------------- ### Download Plugin Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/admin-controller.md Downloads a specified plugin from the cloud to the local cache. Requires plugin name, version, and OS type. ```php public function download_plugin() ``` -------------------------------- ### GET /api/panel/getLatestOfficialVersion Source: https://github.com/flucont/btcloud/blob/main/_autodocs/endpoints.md Retrieves the latest official version number for the aaPanel. ```APIDOC ## GET /api/panel/getLatestOfficialVersion ### Description Returns latest aaPanel version ### Method GET ### Endpoint /api/panel/getLatestOfficialVersion ### Response - Plain text version string ``` -------------------------------- ### plugins() Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/admin-controller.md Displays the plugin management interface for Linux systems. ```APIDOC ## GET /plugins ### Description Displays the plugin management interface for Linux systems. ### Method GET ### Endpoint /plugins ### Returns HTML plugin management view ``` -------------------------------- ### GET /wpanel/get_version Source: https://github.com/flucont/btcloud/blob/main/_autodocs/endpoints.md Retrieves the latest version number for the Windows panel. ```APIDOC ## GET /wpanel/get_version ### Description Returns latest Windows panel version ### Method GET ### Endpoint /wpanel/get_version ### Response - Plain text version string ``` -------------------------------- ### Replace `public.sh` and Remove `bt_check` Source: https://github.com/flucont/btcloud/blob/main/wiki/update.md This instruction indicates replacing the `install/public.sh` file with the latest version from the official website and removing the `bt_check` line at the end of the file. ```bash install/public.sh 用官网最新版的[public.sh](http://download.bt.cn/install/public.sh)替换,并去除最下面bt_check一行 ``` -------------------------------- ### GET /panel/get_version Source: https://github.com/flucont/btcloud/blob/main/_autodocs/endpoints.md Retrieves the latest version number for the Linux panel. ```APIDOC ## GET /panel/get_version ### Description Returns latest Linux panel version number ### Method GET ### Endpoint /api/panel/get_version ### Response - Plain text version string (e.g., "7.10.0") ``` -------------------------------- ### get_deplist Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Returns a list of one-click deployment applications. Accepts the operating system type via POST. ```APIDOC ## get_deplist ### Description Returns a list of one-click deployment applications. Accepts the operating system type via POST. ### Method POST ### Endpoint /get_deplist ### Parameters #### Request Body - **os** (string) - POST - Operating system type. ### Request Example ```json { "os": "linux" } ``` ### Response #### Success Response (200) - Deployment list JSON or empty array if not available. ``` -------------------------------- ### GET /download Source: https://github.com/flucont/btcloud/blob/main/_autodocs/endpoints.md Provides access to the download script generation page. ```APIDOC ## GET /download ### Description Download script generation page ### Method GET ### Endpoint /download ``` -------------------------------- ### JSON Response: Empty Array Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Example of an empty JSON array response. ```json [] ``` -------------------------------- ### refresh_deplist() Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/plugins-library.md Synchronizes the one-click deployment list for a specified operating system. ```APIDOC ## refresh_deplist() ### Description Synchronizes the one-click deployment list. This function updates the deployment list file for the specified operating system. ### Method `public static function refresh_deplist($os = 'Linux'): void` ### Parameters #### Path Parameters - **os** (string) - Optional - Operating system type. Defaults to 'Linux'. ### File Location `data/{os}/config/deployment_list.json` ### Throws/Errors - `Exception` if file write fails ``` -------------------------------- ### Get Server Unix Timestamp Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Returns the current server Unix timestamp. ```php public function get_time(): int ``` -------------------------------- ### get_plugin_main_filename() Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/btapi-class.md Gets the file path for a plugin's main Python file. ```APIDOC ## GET /plugin ### Description Gets path to plugin main Python file. ### Method GET ### Endpoint `{BT_PANEL}/plugin?action=a&name=kaixin&s=download_plugin_main` ### Parameters #### Query Parameters - **action** (string) - Required - `a` - **name** (string) - Required - `kaixin` - **s** (string) - Required - `download_plugin_main` - **plugin_name** (string) - Required - Plugin name - **version** (string) - Required - Version number ### Response #### Success Response (200) - **(string)** - Path to the plugin's main Python file on the panel server ### Response Example ```json "/path/to/plugin/main.py" ``` ``` -------------------------------- ### download_plugin() Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Downloads a plugin package. It requires the plugin name, version, and operating system as parameters. The function validates these parameters and returns the plugin package as a binary file. ```APIDOC ## download_plugin() ### Description Downloads a plugin package by name and version for a specified operating system. ### Method GET ### Endpoint /down/download_plugin ### Parameters #### Query Parameters - **name** (string) - Required - Plugin name (alphanumeric + underscore). Validation: `/^[a-zA-Z0-9_]+$/`. - **version** (string) - Required - Version number (numeric with dots). Validation: `/^[0-9.]+$/`. - **os** (string) - Optional - Operating system (Windows or Linux). Defaults to Linux. ### Response #### Success Response (200) - Binary file download of plugin package (.zip) ### Throws/Errors - `'参数不能为空'` (parameters empty) - `'参数不正确'` (invalid parameter format) - `'你的服务器被禁止使用此云端'` (IP blacklisted) - `'云端不存在该插件包'` (package not found) ### Example ``` GET /down/download_plugin?name=nginx&version=1.24.0&os=Linux ``` ``` -------------------------------- ### JSON Response: NPS Questions Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Example of a response containing NPS survey questions. ```json { "err_no": 0, "success": true, "res": [], "nonce": unix_timestamp } ``` -------------------------------- ### JSON Response: Pagination Structure Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Example of a response containing pagination information and data. ```json { "page": "pagination_html_string", "data": [] } ``` -------------------------------- ### get_deplist() Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/btapi-class.md Retrieves the list of applications available for one-click deployment. This includes application names, titles, and available versions. ```APIDOC ## GET /plugin?action=a&name=kaixin&s=get_deplist ### Description Retrieves one-click deployment list. ### Method GET ### Endpoint {BT_PANEL}/plugin?action=a&name=kaixin&s=get_deplist ### Response #### Success Response (200) - **type** (string) - Type of deployment list ('source') - **list** (array) - List of applications available for deployment. Each item contains: - **name** (string) - Application name - **title** (string) - Application title - **versions** (array) - Available versions ``` -------------------------------- ### JSON Response: Alternative Error Format Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Example of an alternative error response format. ```json { "success": false, "res": "不支持当前操作" } ``` -------------------------------- ### JSON Response: Generic Error Format Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Example of a generic error response format. ```json { "status": false, "msg": "不支持当前操作" } ``` -------------------------------- ### get_plugin_list() Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/btapi-class.md Fetches the complete list of available plugins from the Baota panel. ```APIDOC ## GET /plugin ### Description Fetches complete plugin list from panel. ### Method GET ### Endpoint `{BT_PANEL}/plugin?action=a&name=kaixin&s=get_plugin_list` ### Parameters #### Query Parameters - **action** (string) - Required - `a` - **name** (string) - Required - `kaixin` - **s** (string) - Required - `get_plugin_list` ### Response #### Success Response (200) - **type** (string) - Type of plugin source - **list** (array) - Array of plugin objects, each containing name, title, versions, etc. ### Response Example ```json { "type": "source", "list": [ { "name": "nginx", "title": "Nginx", "versions": [], "type": 5 } ] } ``` ``` -------------------------------- ### Authorization Info Success Response Source: https://github.com/flucont/btcloud/blob/main/_autodocs/endpoints.md Example of a successful response when refreshing authorization information. ```json { "status": true, "err_no": 0, "data": "hex_encoded_license" } ``` -------------------------------- ### pluginswin() Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/admin-controller.md Displays the plugin management interface for Windows systems. ```APIDOC ## GET /pluginswin ### Description Displays the plugin management interface for Windows systems. ### Method GET ### Endpoint /pluginswin ### Returns HTML Windows plugin view ``` -------------------------------- ### get_plugin_filename() Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/btapi-class.md Gets the download URL for a specific plugin package based on its name and version. ```APIDOC ## GET /plugin ### Description Gets download URL for a plugin package. ### Method GET ### Endpoint `{BT_PANEL}/plugin?action=a&name=kaixin&s=download_plugin` ### Parameters #### Query Parameters - **action** (string) - Required - `a` - **name** (string) - Required - `kaixin` - **s** (string) - Required - `download_plugin` - **plugin_name** (string) - Required - Plugin name - **version** (string) - Required - Version number ### Response #### Success Response (200) - **status** (boolean) - Indicates success - **filename** (string) - Path to the plugin package #### Error Response - **status** (boolean) - Indicates failure - **msg** (string) - Error message ### Response Example ```json { "status": true, "filename": "/path/to/plugin-1.0.0.zip" } ``` ``` -------------------------------- ### JSON Response: NPS Submit Success Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Example of a successful response after submitting an NPS survey. ```json { "err_no": 0, "success": true, "res": "Success", "nonce": unix_timestamp } ``` -------------------------------- ### download_plugin() Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/admin-controller.md Downloads a specified plugin from the cloud to the local cache. ```APIDOC ## POST /download_plugin ### Description Downloads a specified plugin from the cloud to the local cache. ### Method POST ### Endpoint /download_plugin ### Parameters #### Query Parameters - **name** (string) - Required - Plugin name - **version** (string) - Required - Version to download - **os** (string) - Required - Operating system ### Response #### Success Response (200) - **code** (integer) - 0 - **msg** (string) - "下载成功" #### Error Response (e.g., 400) - **code** (integer) - -1 - **msg** (string) - Error details ``` -------------------------------- ### Baota API Failure Response Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/admin-controller.md Example of a failed response when testing the Baota API connection. ```json { "code": -1, "msg": "第三方云端连接测试失败" } ``` -------------------------------- ### Retrieve Deployment List Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/plugins-library.md Retrieves the cached deployment list for a given operating system. Returns an array of deployment applications or false if the list is not cached. The list is stored in a JSON file. ```php public static function get_deplist($os = 'Linux'): array|bool ``` ```php $deployments = Plugins::get_deplist(); if ($deployments) { echo "Available deployments: " . count($deployments['list']); } ``` -------------------------------- ### get_config_go() Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/btapi-class.md Retrieves panel configuration using the Go version endpoint, suitable for newer Baota panels. ```APIDOC ## GET /panel/get_config ### Description Retrieves panel configuration for Go-based panels. ### Method GET ### Endpoint `{BT_PANEL}/panel/get_config` ### Response #### Success Response (200) - **(array)** - Panel configuration data ### Response Example ```json [ // Configuration details ] ``` ``` -------------------------------- ### Baota API Success Response Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/admin-controller.md Example of a successful response when testing the Baota API connection. ```json { "code": 0, "msg": "第三方云端连接测试成功!" } ``` -------------------------------- ### Clear System Caches Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/admin-controller.md Clears all framework caches. This is a GET request and requires CheckAdmin middleware. ```php public function cleancache() ``` -------------------------------- ### get_plugin_list_en() Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Fetches the plugin list specifically for aaPanel (English) installations. This method relies on the client's IP address from the request context and returns a JSON object containing the plugin list. ```APIDOC ## get_plugin_list_en() ### Description Returns plugin list for aaPanel (English) installations. Uses client IP from request context. ### Method GET (inferred from context, not explicitly stated) ### Endpoint /api/panel/getSoftListEn ### Parameters None ### Response #### Success Response (200) - JSON object containing plugin list for aaPanel. ### Throws/Errors - Returns JSON error if IP is blacklisted. ``` -------------------------------- ### JSON Response: Email Quota Information Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Example of a response detailing email quota usage and availability. ```json { "success": true, "msg": "获取成功", "res": { "free": { "surplus": "120000", "total": "120000", "used": "0" }, "period": { "surplus": "2000000", "total": "2000000", "used": "0" } } } ``` -------------------------------- ### JSON Response: User Giveaway Eligibility Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Example of a response indicating user giveaway eligibility status. ```json { "no_exceed_limit": false, "user_give": true } ``` -------------------------------- ### JSON Response: NPS Check Success Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Example of a successful response for checking NPS survey status. ```json { "err_no": 0, "success": true, "res": true, "nonce": unix_timestamp } ``` -------------------------------- ### POST /api/Btdeployment/get_deplist Source: https://github.com/flucont/btcloud/blob/main/_autodocs/endpoints.md Returns one-click deployment applications. ```APIDOC ## POST /api/Btdeployment/get_deplist, /api/panel/get_deplist ### Description Returns one-click deployment applications. ### Method POST ### Endpoint /api/Btdeployment/get_deplist, /api/panel/get_deplist ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **os** (string) - Operating system type ### Request Example ```json { "os": "linux" } ``` ### Response #### Success Response (200) - **type** (string) - Source type - **list** (array) - List of deployment applications - **name** (string) - Application name - **title** (string) - Application title - **versions** (array) - Available versions ### Response Example ```json { "type": "source", "list": [ { "name": "wordpress", "title": "WordPress", "versions": [...] } ] } ``` ``` -------------------------------- ### Download Plugin Package Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Downloads a plugin package by name, version, and OS. Supports validation for plugin name, version, and OS. Returns a binary .zip file. ```php public function download_plugin(): void ``` ```http // Download nginx-1.24.0.zip GET /down/download_plugin?name=nginx&version=1.24.0&os=Linux ``` -------------------------------- ### POST /down/download_plugin_main Source: https://github.com/flucont/btcloud/blob/main/_autodocs/endpoints.md Downloads the main Python file for a plugin. Requires IP check and supports binary downloads. ```APIDOC ## POST /down/download_plugin_main ### Description Downloads the main Python file for a plugin. This endpoint requires an IP check and supports binary downloads. ### Method POST ### Endpoint /down/download_plugin_main ### Parameters #### Request Body - **name** (string) - Required - Plugin name - **version** (string) - Required - Version number - **os** (string) - Required - OS type ### Response Python source file content. ``` -------------------------------- ### SQL CREATE TABLE for Record Source: https://github.com/flucont/btcloud/blob/main/_autodocs/types.md Defines the 'record' table schema for tracking IP usage history, including IP address, acquisition time, and usage time. ```sql CREATE TABLE record ( id int PRIMARY KEY AUTO_INCREMENT, ip varchar(50) NOT NULL, addtime datetime, usetime datetime ); ``` -------------------------------- ### Get Client IP Address Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Returns the client's IP address by utilizing the `real_ip()` function. ```php public function get_ip_address(): string ``` -------------------------------- ### get_plugin_remarks() Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Retrieves recommended plugins and customer service information. ```APIDOC ## get_plugin_remarks() ### Description Returns information about recommended plugins and customer service details. ### Method GET (assumed, as no method is specified and it retrieves data) ### Endpoint /api/get_plugin_remarks (assumed, based on function name) ### Response #### Success Response - **list** (array) - A list of recommended plugins. - **pro_list** (array) - A list of pro plugins. - **kfqq** (string) - QQ number for customer service. - **kf** (string) - Customer service identifier. - **qun** (string) - Group number for customer service. ### Response Example ```json { "list": [], "pro_list": [], "kfqq": "", "kf": "", "qun": "" } ``` ``` -------------------------------- ### get_plugin_list_win() Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Retrieves the plugin list for Windows panels. It accepts POST parameters for OS version, server ID, and user ID, which can be used for encryption. Returns a JSON response or an encrypted string. ```APIDOC ## get_plugin_list_win() ### Description Returns the plugin list for Windows panels, with optional encryption. Accepts POST parameters for OS version, server ID, and user ID. ### Method POST ### Endpoint /panel/get_plugin_list_win ### Parameters #### Request Body - **os_version** (string) - Required - Windows version identifier. If 'windows_go', response is encrypted. - **serverid** (string) - Optional - Server identifier for encryption. - **uid** (string) - Optional - User identifier for encryption. ### Response #### Success Response (200) - JSON response with plugin list for standard Windows. - Encrypted string if `os_version` is 'windows_go'. ### Throws/Errors - Returns JSON error if IP is blacklisted. ### Example ``` POST /panel/get_plugin_list_win POST data: os_version=windows_go&serverid=SERVER123&uid=USER123 ``` ``` -------------------------------- ### GET /api/getUpdateLogs Source: https://github.com/flucont/btcloud/blob/main/_autodocs/endpoints.md Fetches the update changelog for the panel. Requires a 'type' parameter to specify the panel type. ```APIDOC ## GET /api/getUpdateLogs ### Description Returns update changelog ### Method GET ### Endpoint /api/getUpdateLogs ### Parameters #### Query Parameters - **type** (string) - Required - Panel type ("Windows" or else Linux) ### Response #### Success Response (JSONP) - **title** (string) - Title of the update log entry. - **body** (string) - Body content of the update log. - **addtime** (string) - Timestamp of when the log was added. ### Response Example ```json [ { "title": "Linux面板7.10.0", "body": "Update information", "addtime": "2024-01-01" } ] ``` ``` -------------------------------- ### Download Main Plugin File (Python) Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/api-controller.md Downloads the main Python file of a plugin, decrypted. Requires plugin name, version, and OS. Returns the Python source file content. ```php public function download_plugin_main(): \think\Response ``` ```http // Get nginx_main.py POST /down/download_plugin_main POST data: name=nginx&version=1.24.0&os=Linux ``` -------------------------------- ### get_plugin_other_filename() Source: https://github.com/flucont/btcloud/blob/main/_autodocs/api-reference/btapi-class.md Gets the file path for an auxiliary plugin file located in the plugin's 'other' directory. ```APIDOC ## GET /plugin ### Description Gets path to auxiliary plugin file. ### Method GET ### Endpoint `{BT_PANEL}/plugin?action=a&name=kaixin&s=download_plugin_other` ### Parameters #### Query Parameters - **action** (string) - Required - `a` - **name** (string) - Required - `kaixin` - **s** (string) - Required - `download_plugin_other` - **fname** (string) - Required - Filename in plugin other directory ### Response #### Success Response (200) - **(string)** - Path to the auxiliary file ### Response Example ```json "/path/to/plugin/other/aux_file.txt" ``` ```