Files
Nexus/docs/release/20260708/Nexus-API服务数据库调用链索引报告-20260707.md
T
r 9b583ccc91
Nexus CI/CD / test (push) Waiting to run
Nexus CI/CD / e2e (push) Blocked by required conditions
Nexus CI/CD / deploy (push) Blocked by required conditions
Nexus Pre-commit Checks / quick-check (push) Waiting to run
docs(release): 主与 release 分支合并功能清单 + 导入 release 文档目录
便于 Gitea 上 main ↔ release/20260708-axs 合并评审与冲突对照。
2026-07-09 01:14:32 +08:00

46 KiB
Raw Blame History

Nexus API / Service / 数据库调用链索引报告

生成时间:2026-07-07

1. 总览

项目 数量
API 路由 214
Service 方法 324
调用边 16780
数据库调用点 437
Redis 调用点 729
SSH/远程命令调用点 346
宝塔相关流 183

2. API 方法分布

HTTP 方法 数量
POST 104
GET 77
PUT 18
DELETE 13
PATCH 2

3. API 风险标签分布

风险标签 路由数
file 37
ssh 35
script 34
btpanel 28
install 18
login 11
terminal 7

4. 高优先级 API 路由(按风险标签/服务调用筛选)

方法 路径 风险标签 入口 函数 Service 调用候选
POST /script-callback script server/api/agent.py:245 script_job_callback
GET /nodes script server/api/assets.py:126 list_nodes
GET /ssh-sessions script,ssh server/api/assets.py:230 list_ssh_sessions
GET /command-logs script,ssh server/api/assets.py:282 list_command_logs
GET /login-access login server/api/auth.py:116 login_access
POST /login login server/api/auth.py:128 login service.login
POST /refresh server/api/auth.py:173 refresh_token service.refresh_token
POST /logout server/api/auth.py:214 logout service.logout_by_token
POST /totp/setup server/api/auth.py:235 setup_totp service.setup_totp
POST /totp/enable server/api/auth.py:258 enable_totp service.enable_totp
POST /totp/disable server/api/auth.py:280 disable_totp service.disable_totp
PUT /password login server/api/auth.py:303 change_password AuthService, auth_service._delete_all_refresh_tokens, AuthService._verify_totp
POST /webssh-token ssh server/api/auth.py:363 issue_webssh_token service.create_webssh_token
GET /me login server/api/auth.py:385 get_me
GET /servers btpanel server/api/btpanel.py:60 list_bt_servers
GET /servers/{server_id}/config btpanel,install,script,ssh server/api/btpanel.py:68 get_bt_config
PUT /servers/{server_id}/config btpanel server/api/btpanel.py:81 update_bt_config
GET /settings btpanel server/api/btpanel.py:103 get_bt_global_settings
PUT /settings btpanel server/api/btpanel.py:111 update_bt_global_settings
POST /servers/{server_id}/bootstrap btpanel server/api/btpanel.py:129 bootstrap_bt_server
POST /servers/batch-bootstrap btpanel server/api/btpanel.py:148 batch_bootstrap_bt_servers
POST /servers/{server_id}/login-url btpanel,login server/api/btpanel.py:166 create_bt_login_url
GET /servers/{server_id}/system/total btpanel server/api/btpanel.py:183 bt_system_total
GET /servers/{server_id}/system/disk btpanel server/api/btpanel.py:191 bt_system_disk
GET /servers/{server_id}/system/network btpanel server/api/btpanel.py:199 bt_system_network
GET /servers/{server_id}/sites btpanel server/api/btpanel.py:207 bt_list_sites
POST /servers/{server_id}/sites/start btpanel server/api/btpanel.py:215 bt_site_start
POST /servers/{server_id}/sites/stop btpanel server/api/btpanel.py:228 bt_site_stop
GET /servers/{server_id}/sites/php-versions btpanel server/api/btpanel.py:241 bt_php_versions
POST /servers/{server_id}/sites btpanel server/api/btpanel.py:249 bt_create_site
GET /servers/{server_id}/sites/{site_id}/domains btpanel server/api/btpanel.py:280 bt_list_domains
POST /servers/{server_id}/domains btpanel server/api/btpanel.py:293 bt_add_domain
POST /servers/{server_id}/domains/delete btpanel server/api/btpanel.py:306 bt_delete_domain
GET /servers/{server_id}/ssl/sites btpanel server/api/btpanel.py:319 bt_ssl_sites
POST /servers/{server_id}/ssl/set btpanel server/api/btpanel.py:327 bt_set_ssl
POST /servers/{server_id}/ssl/apply btpanel server/api/btpanel.py:345 bt_apply_ssl
GET /servers/{server_id}/databases btpanel server/api/btpanel.py:358 bt_list_databases
POST /servers/{server_id}/databases btpanel server/api/btpanel.py:366 bt_create_database
POST /servers/{server_id}/databases/password btpanel server/api/btpanel.py:384 bt_db_password
POST /servers/{server_id}/databases/backup btpanel server/api/btpanel.py:397 bt_db_backup
GET /servers/{server_id}/crontab btpanel server/api/btpanel.py:410 bt_crontab
POST /servers/{server_id}/services btpanel server/api/btpanel.py:418 bt_service_admin _svc.service_admin
GET '' script server/api/execution_records.py:20 list_records
GET /{record_id} script server/api/execution_records.py:41 get_record_detail
GET /browse file,ssh server/api/files.py:40 browse_directory_get
GET /status install server/api/install.py:972 install_status
GET /env-check install server/api/install.py:1006 env_check
POST /test-credentials install server/api/install.py:1097 test_credentials
GET /connection-check file,install server/api/install.py:1113 connection_check
POST /init-db install server/api/install.py:1153 init_db
POST /create-admin install server/api/install.py:1327 create_admin
POST /lock install server/api/install.py:1426 lock_install
GET /state file,install server/api/install.py:1469 get_install_state
GET / script server/api/scripts.py:31 list_scripts service.list_scripts
GET /exec-config script server/api/scripts.py:42 script_exec_config
GET /credentials script server/api/scripts.py:56 list_credentials service.list_credentials
POST /credentials script server/api/scripts.py:66 create_credential service.create_credential
PUT /credentials/{id} script server/api/scripts.py:90 update_credential
DELETE /credentials/{id} script server/api/scripts.py:131 delete_credential service.delete_credential
GET /executions script server/api/scripts.py:152 list_executions service.list_executions
POST /executions/{id}/stop script server/api/scripts.py:167 stop_execution service.stop_execution, service.get_execution_detail
POST /executions/{id}/mark-stuck script server/api/scripts.py:181 mark_execution_stuck service.mark_execution_stuck, service.get_execution_detail
POST /executions/{id}/retry script server/api/scripts.py:198 retry_execution service._parse_execution_meta, service.get_execution, service.get_execution_detail, service.retry_execution
GET /executions/{id} script server/api/scripts.py:238 get_execution service.get_execution_detail
GET /{id} script server/api/scripts.py:258 get_script service.get_script
POST / script server/api/scripts.py:271 create_script service.create_script
PUT /{id} script server/api/scripts.py:295 update_script service.get_script, service.update_script
DELETE /{id} script server/api/scripts.py:325 delete_script service.get_script, service.delete_script
POST /exec script server/api/scripts.py:364 execute_command service.get_execution_detail, service.execute_command
GET / script server/api/search.py:32 global_search
GET / script server/api/servers.py:94 list_servers
GET /terminal-search-history terminal server/api/servers.py:436 get_terminal_search_history
PUT /terminal-search-history terminal server/api/servers.py:454 update_terminal_search_history
GET /logs script server/api/servers.py:491 get_all_sync_logs
GET /meta/api_base_url install server/api/servers.py:561 get_api_base_url
GET /import/template file server/api/servers.py:570 download_import_template
POST /import file server/api/servers.py:589 import_servers service.create_server
POST /batch/install-agent install server/api/servers.py:832 batch_install_agent
POST /batch/detect-path ssh server/api/servers.py:850 batch_detect_path
POST /batch/uninstall-agent install server/api/servers.py:859 batch_uninstall_agent
GET /pending script,ssh server/api/servers.py:977 list_pending_servers
POST /add-by-ip login,ssh server/api/servers.py:1099 add_server_by_ip
GET /{id} server/api/servers.py:1334 get_server service.get_server
GET /{id}/metrics server/api/servers.py:1362 get_server_metrics service.get_server
GET /{id}/files-capability file,ssh server/api/servers.py:1407 get_files_capability service.get_server
POST /{id}/setup-files-sudo file,install,ssh server/api/servers.py:1422 setup_files_sudo service.get_server
POST / file,ssh server/api/servers.py:1463 create_server service.create_server
PUT /{id} file,ssh server/api/servers.py:1537 update_server service.get_server, service.update_server
DELETE /{id} server/api/servers.py:1629 delete_server service.get_server, service.delete_server
POST /{id}/agent-key server/api/servers.py:1659 generate_agent_api_key service.get_server, service.update_server
POST /{id}/install-agent install,ssh server/api/servers.py:1711 install_agent_remote service.get_server, service.update_server
POST /{id}/uninstall-agent file,install,ssh server/api/servers.py:1818 uninstall_agent_remote service.get_server
POST /{id}/agent-install-cmd install server/api/servers.py:1897 get_agent_install_cmd service.get_server
POST /{id}/upgrade-agent ssh server/api/servers.py:1965 upgrade_agent service.get_server
POST /{id}/agent-diagnose ssh server/api/servers.py:2067 agent_diagnose service.get_server
POST /check ssh server/api/servers.py:2105 check_servers
GET /ip-allowlist login,script server/api/settings.py:168 get_ip_allowlist
GET /bing-wallpaper file server/api/settings.py:307 bing_wallpaper
PUT /{id} script server/api/settings.py:476 update_schedule
GET / ssh server/api/settings.py:684 list_ssh_key_presets
POST / ssh server/api/settings.py:702 create_ssh_key_preset
PUT /{id} ssh server/api/settings.py:742 update_ssh_key_preset
POST /{id}/reveal ssh server/api/settings.py:795 reveal_ssh_key_preset
DELETE /{id} ssh server/api/settings.py:828 delete_ssh_key_preset
GET / script server/api/settings.py:856 list_alert_history
GET /ops-patrol/status install server/api/settings.py:1035 ops_patrol_status
POST /ops-patrol/sync-telegram file server/api/settings.py:1056 ops_patrol_sync_telegram
POST /ip-allowlist/parse-subscription script server/api/settings.py:1398 parse_subscription
POST /ip-allowlist login,script server/api/settings.py:1503 set_ip_allowlist
POST /ip-allowlist/toggle login server/api/settings.py:1569 toggle_ip_allowlist
POST /ip-allowlist/manual login server/api/settings.py:1596 add_manual_ips
DELETE /ip-allowlist/ip login server/api/settings.py:1632 remove_allowlist_ip
POST /files file server/api/sync_v2.py:80 sync_files
POST /preview file server/api/sync_v2.py:128 preview_sync
POST /file-ops file,ssh server/api/sync_v2.py:161 file_operation
POST /file-clipboard file,ssh server/api/sync_v2.py:228 apply_file_clipboard
POST /browse file,ssh server/api/sync_v2.py:291 browse_directory
POST /browse-local file server/api/sync_v2.py:322 browse_local_directory
POST /local-file-ops file server/api/sync_v2.py:361 local_file_operation
POST /local-file-preview file server/api/sync_v2.py:432 local_file_preview

5. 典型调用链样例

API 入口 标签 调用链候选
POST /script-callback server/api/agent.py:245 script 未匹配到 service_calls
GET /nodes server/api/assets.py:126 script 未匹配到 service_calls
GET /ssh-sessions server/api/assets.py:230 script,ssh 未匹配到 service_calls
GET /command-logs server/api/assets.py:282 script,ssh 未匹配到 service_calls
GET /login-access server/api/auth.py:116 login 未匹配到 service_calls
POST /login server/api/auth.py:128 login AuthService.login(DB×7;Redis×15;SSH×2)
PUT /password server/api/auth.py:303 login AuthService.init(DB×7;Redis×15;SSH×2) -> AuthService.refresh_token(DB×7;Redis×15;SSH×2) -> AuthService._verify_totp(DB×7;Redis×15;SSH×2)
POST /webssh-token server/api/auth.py:363 ssh AuthService.create_webssh_token(DB×7;Redis×15;SSH×2)
GET /me server/api/auth.py:385 login 未匹配到 service_calls
GET /servers server/api/btpanel.py:60 btpanel 未匹配到 service_calls
GET /servers/{server_id}/config server/api/btpanel.py:68 script,ssh,btpanel,install 未匹配到 service_calls
PUT /servers/{server_id}/config server/api/btpanel.py:81 btpanel 未匹配到 service_calls
GET /settings server/api/btpanel.py:103 btpanel 未匹配到 service_calls
PUT /settings server/api/btpanel.py:111 btpanel 未匹配到 service_calls
POST /servers/{server_id}/bootstrap server/api/btpanel.py:129 btpanel 未匹配到 service_calls
POST /servers/batch-bootstrap server/api/btpanel.py:148 btpanel 未匹配到 service_calls
POST /servers/{server_id}/login-url server/api/btpanel.py:166 login,btpanel 未匹配到 service_calls
GET /servers/{server_id}/system/total server/api/btpanel.py:183 btpanel 未匹配到 service_calls
GET /servers/{server_id}/system/disk server/api/btpanel.py:191 btpanel 未匹配到 service_calls
GET /servers/{server_id}/system/network server/api/btpanel.py:199 btpanel 未匹配到 service_calls
GET /servers/{server_id}/sites server/api/btpanel.py:207 btpanel 未匹配到 service_calls
POST /servers/{server_id}/sites/start server/api/btpanel.py:215 btpanel 未匹配到 service_calls
POST /servers/{server_id}/sites/stop server/api/btpanel.py:228 btpanel 未匹配到 service_calls
GET /servers/{server_id}/sites/php-versions server/api/btpanel.py:241 btpanel 未匹配到 service_calls
POST /servers/{server_id}/sites server/api/btpanel.py:249 btpanel 未匹配到 service_calls
GET /servers/{server_id}/sites/{site_id}/domains server/api/btpanel.py:280 btpanel 未匹配到 service_calls
POST /servers/{server_id}/domains server/api/btpanel.py:293 btpanel 未匹配到 service_calls
POST /servers/{server_id}/domains/delete server/api/btpanel.py:306 btpanel 未匹配到 service_calls
GET /servers/{server_id}/ssl/sites server/api/btpanel.py:319 btpanel 未匹配到 service_calls
POST /servers/{server_id}/ssl/set server/api/btpanel.py:327 btpanel 未匹配到 service_calls
POST /servers/{server_id}/ssl/apply server/api/btpanel.py:345 btpanel 未匹配到 service_calls
GET /servers/{server_id}/databases server/api/btpanel.py:358 btpanel 未匹配到 service_calls
POST /servers/{server_id}/databases server/api/btpanel.py:366 btpanel 未匹配到 service_calls
POST /servers/{server_id}/databases/password server/api/btpanel.py:384 btpanel 未匹配到 service_calls
POST /servers/{server_id}/databases/backup server/api/btpanel.py:397 btpanel 未匹配到 service_calls
GET /servers/{server_id}/crontab server/api/btpanel.py:410 btpanel 未匹配到 service_calls
POST /servers/{server_id}/services server/api/btpanel.py:418 btpanel BtPanelService.service_admin(DB×7;Redis×16;SSH×7)
GET '' server/api/execution_records.py:20 script 未匹配到 service_calls
GET /{record_id} server/api/execution_records.py:41 script 未匹配到 service_calls
GET /browse server/api/files.py:40 file,ssh 未匹配到 service_calls
GET /connection-check server/api/install.py:1113 file,install 未匹配到 service_calls
GET /state server/api/install.py:1469 file,install 未匹配到 service_calls
GET / server/api/scripts.py:31 script ScriptService.list_scripts(DB×9;Redis×13;SSH×9)
GET /exec-config server/api/scripts.py:42 script 未匹配到 service_calls
GET /credentials server/api/scripts.py:56 script ScriptService.list_credentials(DB×9;Redis×13;SSH×9)
POST /credentials server/api/scripts.py:66 script ScriptService.create_credential(DB×9;Redis×13;SSH×9)
PUT /credentials/{id} server/api/scripts.py:90 script 未匹配到 service_calls
DELETE /credentials/{id} server/api/scripts.py:131 script ScriptService.delete_credential(DB×9;Redis×13;SSH×9)
GET /executions server/api/scripts.py:152 script ScriptService.list_executions(DB×9;Redis×13;SSH×9)
POST /executions/{id}/stop server/api/scripts.py:167 script ScriptService.stop_execution(DB×9;Redis×13;SSH×9) -> ScriptService.get_execution(DB×9;Redis×13;SSH×9)
POST /executions/{id}/mark-stuck server/api/scripts.py:181 script ScriptService.mark_execution_stuck(DB×9;Redis×13;SSH×9) -> ScriptService.get_execution(DB×9;Redis×13;SSH×9)
POST /executions/{id}/retry server/api/scripts.py:198 script ScriptService._parse_execution_meta(DB×9;Redis×13;SSH×9) -> get_execution_record_detail(Redis×6) -> ScriptService.get_execution(DB×9;Redis×13;SSH×9) -> ScriptService.retry_executio...
GET /executions/{id} server/api/scripts.py:238 script ScriptService.get_execution(DB×9;Redis×13;SSH×9)
GET /{id} server/api/scripts.py:258 script ScriptService.get_script(DB×9;Redis×13;SSH×9)
POST / server/api/scripts.py:271 script ScriptService.create_script(DB×9;Redis×13;SSH×9)
PUT /{id} server/api/scripts.py:295 script ScriptService.get_script(DB×9;Redis×13;SSH×9) -> ScriptService.update_script(DB×9;Redis×13;SSH×9)
DELETE /{id} server/api/scripts.py:325 script ScriptService.get_script(DB×9;Redis×13;SSH×9) -> ScriptService.delete_script(DB×9;Redis×13;SSH×9)
POST /exec server/api/scripts.py:364 script ScriptService.get_execution(DB×9;Redis×13;SSH×9) -> ScriptService.execute_command(DB×9;Redis×13;SSH×9)
GET / server/api/search.py:32 script 未匹配到 service_calls
GET / server/api/servers.py:94 script 未匹配到 service_calls
GET /terminal-search-history server/api/servers.py:436 terminal 未匹配到 service_calls
PUT /terminal-search-history server/api/servers.py:454 terminal 未匹配到 service_calls
GET /logs server/api/servers.py:491 script 未匹配到 service_calls
GET /import/template server/api/servers.py:570 file 未匹配到 service_calls
POST /import server/api/servers.py:589 file ServerService.create_server(DB×2;Redis×3;SSH×2)
POST /batch/detect-path server/api/servers.py:850 ssh 未匹配到 service_calls
GET /pending server/api/servers.py:977 script,ssh 未匹配到 service_calls
POST /add-by-ip server/api/servers.py:1099 login,ssh 未匹配到 service_calls
GET /{id}/files-capability server/api/servers.py:1407 file,ssh BtPanelService.get_server(DB×7;Redis×16;SSH×7)
POST /{id}/setup-files-sudo server/api/servers.py:1422 file,ssh,install BtPanelService.get_server(DB×7;Redis×16;SSH×7)
POST / server/api/servers.py:1463 file,ssh ServerService.create_server(DB×2;Redis×3;SSH×2)
PUT /{id} server/api/servers.py:1537 file,ssh BtPanelService.get_server(DB×7;Redis×16;SSH×7) -> ServerService.update_server(DB×2;Redis×3;SSH×2)
POST /{id}/install-agent server/api/servers.py:1711 ssh,install BtPanelService.get_server(DB×7;Redis×16;SSH×7) -> ServerService.update_server(DB×2;Redis×3;SSH×2)
POST /{id}/uninstall-agent server/api/servers.py:1818 file,ssh,install BtPanelService.get_server(DB×7;Redis×16;SSH×7)
POST /{id}/upgrade-agent server/api/servers.py:1965 ssh BtPanelService.get_server(DB×7;Redis×16;SSH×7)
POST /{id}/agent-diagnose server/api/servers.py:2067 ssh BtPanelService.get_server(DB×7;Redis×16;SSH×7)
POST /check server/api/servers.py:2105 ssh 未匹配到 service_calls
GET /ip-allowlist server/api/settings.py:168 login,script 未匹配到 service_calls
GET /bing-wallpaper server/api/settings.py:307 file 未匹配到 service_calls
PUT /{id} server/api/settings.py:476 script 未匹配到 service_calls

6. 宝塔相关流

类型 位置 函数 标签/Key 摘要
api server/api/btpanel.py:60 list_bt_servers btpanel {'auth_required_inferred': True, 'calls': ['router.get', 'Depends', 'Depends', '_svc.list_server_statuses', '_svc'], 'fi
api server/api/btpanel.py:68 get_bt_config btpanel,install,script,ssh {'auth_required_inferred': True, 'calls': ['router.get', 'Query', 'Depends', 'Depends', '_svc.get_config', '_http_error'
api server/api/btpanel.py:81 update_bt_config btpanel {'auth_required_inferred': True, 'calls': ['router.put', 'Depends', 'Depends', '_svc.update_config', '_http_error', '_sv
api server/api/btpanel.py:103 get_bt_global_settings btpanel {'auth_required_inferred': True, 'calls': ['router.get', 'Depends', 'Depends', '_svc.get_global_settings', '_svc'], 'fil
api server/api/btpanel.py:111 update_bt_global_settings btpanel {'auth_required_inferred': True, 'calls': ['router.put', 'Depends', 'Depends', '_svc.update_global_settings', '_http_err
api server/api/btpanel.py:129 bootstrap_bt_server btpanel {'auth_required_inferred': True, 'calls': ['router.post', 'Depends', 'Depends', '_svc.bootstrap_server', '_http_error',
api server/api/btpanel.py:148 batch_bootstrap_bt_servers btpanel {'auth_required_inferred': True, 'calls': ['router.post', 'Depends', 'Depends', '_svc.batch_bootstrap', '_http_error', '
api server/api/btpanel.py:166 create_bt_login_url btpanel,login {'auth_required_inferred': True, 'calls': ['router.post', 'Depends', 'Depends', '_svc.create_login_url', '_http_error',
api server/api/btpanel.py:183 bt_system_total btpanel {'auth_required_inferred': True, 'calls': ['router.get', 'Depends', 'Depends', '_svc.system_total', '_http_error', '_svc
api server/api/btpanel.py:191 bt_system_disk btpanel {'auth_required_inferred': True, 'calls': ['router.get', 'Depends', 'Depends', '_svc.system_disk', '_http_error', '_svc'
api server/api/btpanel.py:199 bt_system_network btpanel {'auth_required_inferred': True, 'calls': ['router.get', 'Depends', 'Depends', '_svc.system_network', '_http_error', '_s
api server/api/btpanel.py:207 bt_list_sites btpanel {'auth_required_inferred': True, 'calls': ['router.get', 'Depends', 'Depends', '_svc.list_sites', '_http_error', '_svc']
api server/api/btpanel.py:215 bt_site_start btpanel {'auth_required_inferred': True, 'calls': ['router.post', 'Depends', 'Depends', '_svc.site_start', '_http_error', '_svc'
api server/api/btpanel.py:228 bt_site_stop btpanel {'auth_required_inferred': True, 'calls': ['router.post', 'Depends', 'Depends', '_svc.site_stop', '_http_error', '_svc']
api server/api/btpanel.py:241 bt_php_versions btpanel {'auth_required_inferred': True, 'calls': ['router.get', 'Depends', 'Depends', '_svc.php_versions', '_http_error', '_svc
api server/api/btpanel.py:249 bt_create_site btpanel {'auth_required_inferred': True, 'calls': ['router.post', 'Depends', 'Depends', 'json.dumps', '_svc.create_site', '_http
api server/api/btpanel.py:280 bt_list_domains btpanel {'auth_required_inferred': True, 'calls': ['router.get', 'Depends', 'Depends', '_svc.list_domains', '_http_error', '_svc
api server/api/btpanel.py:293 bt_add_domain btpanel {'auth_required_inferred': True, 'calls': ['router.post', 'Depends', 'Depends', '_svc.add_domain', '_http_error', 'body.
api server/api/btpanel.py:306 bt_delete_domain btpanel {'auth_required_inferred': True, 'calls': ['router.post', 'Depends', 'Depends', '_svc.delete_domain', '_http_error', 'bo
api server/api/btpanel.py:319 bt_ssl_sites btpanel {'auth_required_inferred': True, 'calls': ['router.get', 'Depends', 'Depends', '_svc.list_ssl_sites', '_http_error', '_s
api server/api/btpanel.py:327 bt_set_ssl btpanel {'auth_required_inferred': True, 'calls': ['router.post', 'Depends', 'Depends', '_svc.set_ssl', '_http_error', 'body.mod
api server/api/btpanel.py:345 bt_apply_ssl btpanel {'auth_required_inferred': True, 'calls': ['router.post', 'Depends', 'Depends', '_svc.apply_letsencrypt', '_http_error',
api server/api/btpanel.py:358 bt_list_databases btpanel {'auth_required_inferred': True, 'calls': ['router.get', 'Depends', 'Depends', '_svc.list_databases', '_http_error', '_s
api server/api/btpanel.py:366 bt_create_database btpanel {'auth_required_inferred': True, 'calls': ['router.post', 'Depends', 'Depends', '_svc.create_database', '_http_error', '
api server/api/btpanel.py:384 bt_db_password btpanel {'auth_required_inferred': True, 'calls': ['router.post', 'Depends', 'Depends', '_svc.reset_database_password', '_http_e
api server/api/btpanel.py:397 bt_db_backup btpanel {'auth_required_inferred': True, 'calls': ['router.post', 'Depends', 'Depends', '_svc.backup_database', '_http_error', '
api server/api/btpanel.py:410 bt_crontab btpanel {'auth_required_inferred': True, 'calls': ['router.get', 'Depends', 'Depends', '_svc.list_crontab', '_http_error', '_svc
api server/api/btpanel.py:418 bt_service_admin btpanel {'auth_required_inferred': True, 'calls': ['router.post', 'Depends', 'Depends', '_svc.service_admin', '_http_error', '_s
service server/application/services/btpanel_bootstrap_schedule.py:24 btpanel {'calls': ["getattr(settings, 'BT_PANEL_AUTO_BOOTSTRAP_ENABLED', None) or 'true'.strip.lower", "getattr(settings, 'BT_PA
service server/application/services/btpanel_bootstrap_schedule.py:29 btpanel {'calls': ['getattr', 'max', 'int', 'min'], 'class': None, 'end_line': 35, 'file': 'server/application/services/btpanel_
service server/application/services/btpanel_bootstrap_schedule.py:38 btpanel,session {'calls': ['int', 'AsyncSessionLocal', 'ServerRepositoryImpl', 'mark_bootstrap_pending', 'repo.get_by_id', 'bt_panel_con
service server/application/services/btpanel_bootstrap_schedule.py:54 btpanel {'calls': ['is_auto_bootstrap_enabled', 'int', 'mark_servers_bootstrap_pending', 'asyncio.create_task', '_BG_TASKS.add',
service server/application/services/btpanel_bootstrap_schedule.py:68 btpanel,session {'calls': ['AsyncSessionLocal', 'BtPanelService', 'logger.warning', 'svc.bootstrap_server'], 'class': None, 'end_line':
service server/application/services/btpanel_bootstrap_schedule.py:84 btpanel,session {'calls': ['datetime.now', 'bootstrap_batch_size', 'is_auto_bootstrap_enabled', 'AsyncSessionLocal', 'ServerRepositoryIm
service server/application/services/btpanel_service.py:54 btpanel {'calls': ['isinstance'], 'class': None, 'end_line': 55, 'file': 'server/application/services/btpanel_service.py', 'id':
service server/application/services/btpanel_service.py:59 btpanel {'calls': ['ServerRepositoryImpl', 'AuditLogRepositoryImpl'], 'class': 'BtPanelService', 'end_line': 62, 'file': 'server
service server/application/services/btpanel_service.py:64 btpanel {'calls': ['self.servers.get_by_id', 'ValueError'], 'class': 'BtPanelService', 'end_line': 68, 'file': 'server/applicati
service server/application/services/btpanel_service.py:70 btpanel {'calls': ['read_bt_panel_credentials', 'BtPanelClient', 'ValueError'], 'class': 'BtPanelService', 'end_line': 74, 'file
service server/application/services/btpanel_service.py:76 btpanel,redis {'calls': ['get_redis', 'redis.pipeline', 'zip', 'self.servers.get_all', 'pipe.hgetall', 'pipe.execute', 'agent_is_insta
service server/application/services/btpanel_service.py:112 btpanel {'calls': ['self.get_server', 'self._resolve_bt_installed', 'public_bt_panel_status'], 'class': 'BtPanelService', 'end_l
service server/application/services/btpanel_service.py:117 btpanel {'calls': ['get_bt_panel_block', 'block.get', 'block.get', 'merge_bootstrap_fields', 'bt_panel_configured', 'detect_bt_p
service server/application/services/btpanel_service.py:141 btpanel {'calls': ["getattr(settings, 'BT_PANEL_SOURCE_IP', None) or ''.strip", 'self._auto_bootstrap_enabled', 'get_bt_panel_so
service server/application/services/btpanel_service.py:150 btpanel {'calls': ['bt_panel_source_ip.strip', 'self.audit.create', 'self.get_global_settings', 'ValueError', 'self._persist_set
service server/application/services/btpanel_service.py:183 btpanel {'calls': ['SettingRepositoryImpl', 'settings.apply_db_override', 'repo.set', 'publish_setting_change'], 'class': 'BtPan
service server/application/services/btpanel_service.py:194 btpanel {'calls': ['is_auto_bootstrap_enabled'], 'class': 'BtPanelService', 'end_line': 197, 'file': 'server/application/service
service server/application/services/btpanel_service.py:199 btpanel {'calls': ['merge_bt_panel_extra', 'self.get_server', 'self.servers.update', 'self.audit.create', 'self.get_config', 'is
service server/application/services/btpanel_service.py:249 btpanel {'calls': ['bootstrap_lock', 'self._bootstrap_server_locked'], 'class': 'BtPanelService', 'end_line': 265, 'file': 'serv
service server/application/services/btpanel_service.py:267 btpanel {'calls': ['get_bt_panel_source_ip', 'str.strip', 'str.strip', 'apply_bootstrap_success', 'self.get_server', 'bt_panel_c
service server/application/services/btpanel_service.py:368 btpanel {'calls': ['ValueError', 'start_batch_job', 'self.list_server_statuses', 'int', 'int', 'ids.append', 's.get'], 'class':
service server/application/services/btpanel_service.py:398 btpanel {'calls': ['self.audit.create', 'AuditLog', 'json.dumps'], 'class': 'BtPanelService', 'end_line': 421, 'file': 'server/a
service server/application/services/btpanel_service.py:424 btpanel {'calls': ['getattr', 'getattr', 'bool', "getattr(server, 'auth_method', None) or ''.strip", 'bool', 'getattr', 'getattr
service server/application/services/btpanel_service.py:437 btpanel,session {'calls': ['get_bt_panel_block', '_parse_iso', '_utcnow() - checked_at.total_seconds', 'block.get', 'block.get', '_utcno
service server/application/services/btpanel_service.py:447 btpanel,session {'calls': ['merge_bootstrap_fields', 'self.servers.update', 'self.get_server', 'isinstance', '_iso', '_utcnow'], 'class'
service server/application/services/btpanel_service.py:457 btpanel,session {'calls': ['get_bt_panel_source_ip', 'str.strip', 'str.strip', 'apply_bootstrap_success', 'self._session_cleanup_ttl_che
service server/application/services/btpanel_service.py:502 btpanel {'calls': ['login_url_lock', 'self._create_login_url_fresh', 'self._audit_login_url_failure'], 'class': 'BtPanelService'
service server/application/services/btpanel_service.py:529 btpanel,session {'calls': ['bt_panel_configured', 'read_bt_panel_credentials', 'self.get_server', 'bt_panel_configured', 'read_bt_panel_
service server/application/services/btpanel_service.py:585 btpanel {'calls': ['self.audit.create', 'logger.warning', 'AuditLog', 'json.dumps'], 'class': 'BtPanelService', 'end_line': 607,
service server/application/services/btpanel_service.py:609 btpanel {'calls': ['self._repair_ip_whitelist', 'read_bt_panel_credentials', 'logger.warning', 'logger.warning', 'self.get_serve
service server/application/services/btpanel_service.py:642 btpanel {'calls': ['BtPanelClient', 'isinstance', 'BtPanelApiError', 'int', 'client.post', 'data.get', 'time.time', 'data.get',
service server/application/services/btpanel_service.py:674 btpanel {'calls': ['self._client', 'self.get_server', 'client.post', 'str', 'self.get_server', 'self._client.post', 'self._repai
service server/application/services/btpanel_service.py:692 btpanel {'calls': ['get_bt_panel_source_ip', 'str.strip', 'str.strip', 'logger.info', 'logger.warning', 'apply_bootstrap_success
service server/application/services/btpanel_service.py:722 btpanel {'calls': ['self.proxy'], 'class': 'BtPanelService', 'end_line': 723, 'file': 'server/application/services/btpanel_servi
service server/application/services/btpanel_service.py:725 btpanel {'calls': ['self.proxy'], 'class': 'BtPanelService', 'end_line': 726, 'file': 'server/application/services/btpanel_servi
service server/application/services/btpanel_service.py:728 btpanel {'calls': ['self.proxy'], 'class': 'BtPanelService', 'end_line': 729, 'file': 'server/application/services/btpanel_servi
service server/application/services/btpanel_service.py:732 btpanel {'calls': ['self.proxy'], 'class': 'BtPanelService', 'end_line': 738, 'file': 'server/application/services/btpanel_servi
service server/application/services/btpanel_service.py:740 btpanel {'calls': ['self.proxy'], 'class': 'BtPanelService', 'end_line': 741, 'file': 'server/application/services/btpanel_servi
service server/application/services/btpanel_service.py:743 btpanel {'calls': ['self.proxy'], 'class': 'BtPanelService', 'end_line': 744, 'file': 'server/application/services/btpanel_servi
service server/application/services/btpanel_service.py:747 btpanel {'calls': ['self.proxy'], 'class': 'BtPanelService', 'end_line': 748, 'file': 'server/application/services/btpanel_servi
service server/application/services/btpanel_service.py:750 btpanel {'calls': ['self.proxy', 'self.audit.create', 'AuditLog', 'json.dumps', 'payload.get'], 'class': 'BtPanelService', 'end_
service server/application/services/btpanel_service.py:763 btpanel {'calls': ['self.proxy', 'str'], 'class': 'BtPanelService', 'end_line': 768, 'file': 'server/application/services/btpane
service server/application/services/btpanel_service.py:770 btpanel {'calls': ['self.proxy'], 'class': 'BtPanelService', 'end_line': 771, 'file': 'server/application/services/btpanel_servi
service server/application/services/btpanel_service.py:773 btpanel {'calls': ['self.proxy'], 'class': 'BtPanelService', 'end_line': 774, 'file': 'server/application/services/btpanel_servi
service server/application/services/btpanel_service.py:777 btpanel {'calls': ['self.list_sites'], 'class': 'BtPanelService', 'end_line': 778, 'file': 'server/application/services/btpanel_
service server/application/services/btpanel_service.py:780 btpanel {'calls': ['self.proxy', 'self.audit.create', 'AuditLog', 'json.dumps', 'payload.get'], 'class': 'BtPanelService', 'end_
service server/application/services/btpanel_service.py:792 btpanel,crypto {'calls': ['self.proxy'], 'class': 'BtPanelService', 'end_line': 793, 'file': 'server/application/services/btpanel_servi
service server/application/services/btpanel_service.py:796 btpanel {'calls': ['self.proxy'], 'class': 'BtPanelService', 'end_line': 801, 'file': 'server/application/services/btpanel_servi
service server/application/services/btpanel_service.py:803 btpanel {'calls': ['self.proxy', 'self.audit.create', 'AuditLog', 'json.dumps', 'payload.get'], 'class': 'BtPanelService', 'end_
service server/application/services/btpanel_service.py:815 btpanel {'calls': ['self.proxy'], 'class': 'BtPanelService', 'end_line': 816, 'file': 'server/application/services/btpanel_servi
service server/application/services/btpanel_service.py:818 btpanel {'calls': ['self.proxy'], 'class': 'BtPanelService', 'end_line': 819, 'file': 'server/application/services/btpanel_servi
service server/application/services/btpanel_service.py:822 btpanel {'calls': ['self.proxy'], 'class': 'BtPanelService', 'end_line': 823, 'file': 'server/application/services/btpanel_servi
service server/application/services/btpanel_service.py:826 btpanel {'calls': ['self.proxy', 'self.audit.create', 'AuditLog', 'json.dumps'], 'class': 'BtPanelService', 'end_line': 836, 'fi
service server/application/services/server_batch_service.py:774 btpanel,session {'calls': ['str', 'server_map.get', '_run_with_semaphore', 'live.get', 'result_item_dict', 'result.get', 'result.get', '
service server/application/services/server_batch_service.py:779 btpanel,session {'calls': ['server_map.get', 'result_item_dict', 'result.get', 'result.get', 'result_item_dict', 'AsyncSessionLocal', 'B
service server/application/services/server_file_transfer_service.py:397 btpanel,token {'calls': ['read_bt_panel_credentials', 'signed_download_url', 'ServerTransferError', 'ServerTransferError', 'normalize_
service server/application/services/server_file_transfer_service.py:497 btpanel {'calls': ['_assert_distinct_servers', 'int', '_get_server', 'bt_panel_configured', 'read_bt_panel_credentials', 'create
redis tests/test_btpanel_client.py:39 test_merge_bt_panel_extra_encrypts_key enc:secret,enc:{s} {'file': 'tests/test_btpanel_client.py', 'function': 'test_merge_bt_panel_extra_encrypts_key', 'id': 'tests/test_btpanel
redis tests/test_btpanel_get_config.py:64 test_bootstrap_lock_serializes_same_server {'file': 'tests/test_btpanel_get_config.py', 'function': 'test_bootstrap_lock_serializes_same_server', 'id': 'tests/test
redis tests/test_btpanel_get_config.py:67 test_bootstrap_lock_serializes_same_server.worker {'file': 'tests/test_btpanel_get_config.py', 'function': 'test_bootstrap_lock_serializes_same_server.worker', 'id': 'tes
redis tests/test_btpanel_login_url.py:19 _FakeRedis.get {'file': 'tests/test_btpanel_login_url.py', 'function': '_FakeRedis.get', 'id': 'tests/test_btpanel_login_url.py::_FakeR
redis tests/test_btpanel_login_url.py:27 _noop_login_url_lock {'file': 'tests/test_btpanel_login_url.py', 'function': '_noop_login_url_lock', 'id': 'tests/test_btpanel_login_url.py::
redis tests/test_btpanel_login_url.py:32 test_create_login_url_bootstraps_when_unconfigured {'file': 'tests/test_btpanel_login_url.py', 'function': 'test_create_login_url_bootstraps_when_unconfigured', 'id': 'tes
redis tests/test_btpanel_login_url.py:78 test_create_login_url_does_not_reuse_single_use_tokens {'file': 'tests/test_btpanel_login_url.py', 'function': 'test_create_login_url_does_not_reuse_single_use_tokens', 'id':
redis tests/test_btpanel_login_url.py:119 test_create_login_url_skips_bootstrap_when_configured {'file': 'tests/test_btpanel_login_url.py', 'function': 'test_create_login_url_skips_bootstrap_when_configured', 'id': '
redis tests/test_btpanel_login_url.py:161 test_create_login_url_ensures_session_cleanup_ttl_once_for_configured_server {'file': 'tests/test_btpanel_login_url.py', 'function': 'test_create_login_url_ensures_session_cleanup_ttl_once_for_conf
redis tests/test_btpanel_login_url.py:224 test_create_login_url_repairs_stale_port_then_uses_api {'file': 'tests/test_btpanel_login_url.py', 'function': 'test_create_login_url_repairs_stale_port_then_uses_api', 'id':
redis tests/test_btpanel_login_url.py:288 test_create_login_url_falls_back_to_ssh_when_api_unreachable {'file': 'tests/test_btpanel_login_url.py', 'function': 'test_create_login_url_falls_back_to_ssh_when_api_unreachable',
redis tests/test_btpanel_server_list.py:23 test_list_server_statuses_includes_live_online_from_redis {'file': 'tests/test_btpanel_server_list.py', 'function': 'test_list_server_statuses_includes_live_online_from_redis', '
redis tests/test_btpanel_ssh_bootstrap.py:34 test_mark_bootstrap_pending_sets_now {'file': 'tests/test_btpanel_ssh_bootstrap.py', 'function': 'test_mark_bootstrap_pending_sets_now', 'id': 'tests/test_bt
redis tests/test_btpanel_ssh_bootstrap.py:42 test_apply_failure_bt_not_installed_goes_installing {'file': 'tests/test_btpanel_ssh_bootstrap.py', 'function': 'test_apply_failure_bt_not_installed_goes_installing', 'id':
redis tests/test_btpanel_ssh_bootstrap.py:50 test_apply_failure_ssh_auth_is_permanent {'file': 'tests/test_btpanel_ssh_bootstrap.py', 'function': 'test_apply_failure_ssh_auth_is_permanent', 'id': 'tests/tes
redis tests/test_btpanel_ssh_bootstrap.py:57 test_apply_success_sets_ready enc:token123,enc:{s} {'file': 'tests/test_btpanel_ssh_bootstrap.py', 'function': 'test_apply_success_sets_ready', 'id': 'tests/test_btpanel_s
redis server/api/btpanel.py:46 _http_error {'file': 'server/api/btpanel.py', 'function': '_http_error', 'id': 'server/api/btpanel.py::_http_error::redis', 'key_pat
redis server/infrastructure/btpanel/bootstrap_lock.py:13 bootstrap_lock {'file': 'server/infrastructure/btpanel/bootstrap_lock.py', 'function': 'bootstrap_lock', 'id': 'server/infrastructure/b
redis server/infrastructure/btpanel/bootstrap_state.py:43 get_bootstrap_block {'file': 'server/infrastructure/btpanel/bootstrap_state.py', 'function': 'get_bootstrap_block', 'id': 'server/infrastruc
redis server/infrastructure/btpanel/bootstrap_state.py:78 public_bootstrap_fields {'file': 'server/infrastructure/btpanel/bootstrap_state.py', 'function': 'public_bootstrap_fields', 'id': 'server/infras
redis server/infrastructure/btpanel/bootstrap_state.py:96 merge_bootstrap_fields {'file': 'server/infrastructure/btpanel/bootstrap_state.py', 'function': 'merge_bootstrap_fields', 'id': 'server/infrast
redis server/infrastructure/btpanel/bootstrap_state.py:126 bt_panel_configured_from_attrs {'file': 'server/infrastructure/btpanel/bootstrap_state.py', 'function': 'bt_panel_configured_from_attrs', 'id': 'server
redis server/infrastructure/btpanel/bootstrap_state.py:135 is_eligible_for_background_bootstrap {'file': 'server/infrastructure/btpanel/bootstrap_state.py', 'function': 'is_eligible_for_background_bootstrap', 'id': '
redis server/infrastructure/btpanel/bootstrap_state.py:155 apply_bootstrap_success {'file': 'server/infrastructure/btpanel/bootstrap_state.py', 'function': 'apply_bootstrap_success', 'id': 'server/infras
redis server/infrastructure/btpanel/bootstrap_state.py:196 apply_bootstrap_failure {'file': 'server/infrastructure/btpanel/bootstrap_state.py', 'function': 'apply_bootstrap_failure', 'id': 'server/infras
redis server/infrastructure/btpanel/bootstrap_state.py:223 get_bootstrap_block_from_attrs {'file': 'server/infrastructure/btpanel/bootstrap_state.py', 'function': 'get_bootstrap_block_from_attrs', 'id': 'server
redis server/infrastructure/btpanel/client.py:29 raise_if_panel_error {'file': 'server/infrastructure/btpanel/client.py', 'function': 'raise_if_panel_error', 'id': 'server/infrastructure/btp
redis server/infrastructure/btpanel/client.py:50 BtPanelClient._load_cookies {'file': 'server/infrastructure/btpanel/client.py', 'function': 'BtPanelClient._load_cookies', 'id': 'server/infrastruct
redis server/infrastructure/btpanel/client.py:60 BtPanelClient._save_cookies {'file': 'server/infrastructure/btpanel/client.py', 'function': 'BtPanelClient._save_cookies', 'id': 'server/infrastruct
redis server/infrastructure/btpanel/client.py:64 BtPanelClient.post {'file': 'server/infrastructure/btpanel/client.py', 'function': 'BtPanelClient.post', 'id': 'server/infrastructure/btpan
redis server/infrastructure/btpanel/credentials.py:26 get_bt_panel_block {'file': 'server/infrastructure/btpanel/credentials.py', 'function': 'get_bt_panel_block', 'id': 'server/infrastructure/
redis server/infrastructure/btpanel/credentials.py:31 bt_panel_configured {'file': 'server/infrastructure/btpanel/credentials.py', 'function': 'bt_panel_configured', 'id': 'server/infrastructure
redis server/infrastructure/btpanel/credentials.py:36 get_bt_panel_base_url {'file': 'server/infrastructure/btpanel/credentials.py', 'function': 'get_bt_panel_base_url', 'id': 'server/infrastructu
redis server/infrastructure/btpanel/credentials.py:41 read_bt_panel_credentials {'file': 'server/infrastructure/btpanel/credentials.py', 'function': 'read_bt_panel_credentials', 'id': 'server/infrastr
redis server/infrastructure/btpanel/credentials.py:54 merge_bt_panel_extra {'file': 'server/infrastructure/btpanel/credentials.py', 'function': 'merge_bt_panel_extra', 'id': 'server/infrastructur

7. 安全审查优先级建议

  1. 宝塔一键登录/session:优先审查 server/application/services/btpanel_service.pyserver/infrastructure/btpanel/*,关注 token TTL、Redis lock、并发打开 10 个面板、失败回退和审计日志。
  2. 文件管理/归档/解压:优先审查带 file 标签的 API 与 server/infrastructure/ssh/remote_archive.py、文件传输路径,关注路径穿越、tar/zip 选项注入、软链、绝对路径。
  3. SSH/远程 shell:用户确认管理员远程执行 shell 是业务能力,不作为漏洞本身;审查重点应放在鉴权、审计、超时、输出截断、日志脱敏、命令模板边界。
  4. 数据库访问:对 db_queries.jsonl 中写操作链路检查权限过滤、事务 commit/rollback、分页上限和多租户隔离。
  5. Redis 锁/缓存:对 login/session/任务类 Redis key 检查 TTL、锁释放、失败重试与缓存穿透。