This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # 限制脚本仅支持基于 Debian/Ubuntu 的系统 | |
| if ! command -v apt-get &> /dev/null; then | |
| echo -e "\033[31m此脚本仅支持基于 Debian/Ubuntu 的系统,请在支持 apt-get 的系统上运行!\033[0m" | |
| exit 1 | |
| fi | |
| # 检查并安装必要的依赖 | |
| REQUIRED_CMDS=("curl" "wget" "dpkg" "awk" "sed" "sysctl" "jq") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default { | |
| async fetch(request, env, ctx) { | |
| const url = new URL(request.url); | |
| // 处理 API 请求:支持 POST (/api/add-ssl) 和 GET (/?...) | |
| if ( | |
| (url.pathname === '/api/add-ssl' && request.method === 'POST') || | |
| (url.pathname === '/' && request.method === 'GET' && url.searchParams.has('zoneId')) | |
| ) { | |
| return handleApiRequest(request, url.searchParams); |