' . htmlspecialchars($newFileName); } else { echo '文件重命名失败!'; } } else { echo '文件重命名失败,文件不存在或新文件名已存在。'; } } if (isset($_POST['saveContent'], $_POST['fileName'], $_POST['fileType'])) { $fileToSave = ($_POST['fileType'] === 'proxy') ? $uploadDir . basename($_POST['fileName']) : $configDir . basename($_POST['fileName']); $contentToSave = $_POST['saveContent']; file_put_contents($fileToSave, $contentToSave); echo '

文件内容已更新:' . htmlspecialchars(basename($fileToSave)) . '

'; } } function formatFileModificationTime($filePath) { if (file_exists($filePath)) { $fileModTime = filemtime($filePath); return date('Y-m-d H:i:s', $fileModTime); } else { return '文件不存在'; } } $proxyFiles = scandir($uploadDir); $configFiles = scandir($configDir); if ($proxyFiles !== false) { $proxyFiles = array_diff($proxyFiles, array('.', '..')); } else { $proxyFiles = []; } if ($configFiles !== false) { $configFiles = array_diff($configFiles, array('.', '..')); } else { $configFiles = []; } function formatSize($size) { $units = array('B', 'KB', 'MB', 'GB', 'TB'); $unit = 0; while ($size >= 1024 && $unit < count($units) - 1) { $size /= 1024; $unit++; } return round($size, 2) . ' ' . $units[$unit]; } if ($_SERVER['REQUEST_METHOD'] === 'GET' && isset($_GET['editFile'], $_GET['fileType'])) { $filePath = ($_GET['fileType'] === 'proxy') ? $uploadDir. basename($_GET['editFile']) : $configDir . basename($_GET['editFile']); if (file_exists($filePath)) { header('Content-Type: text/plain'); echo file_get_contents($filePath); exit; } else { echo '文件不存在'; exit; } } ?> '', 'file_name' => "subscription_" . ($i + 1) . ".yaml", ]; } } if (isset($_POST['update'])) { $index = intval($_POST['index']); $url = $_POST['subscription_url'] ?? ''; $customFileName = $_POST['custom_file_name'] ?? "subscription_" . ($index + 1) . ".yaml"; $subscriptions[$index]['url'] = $url; $subscriptions[$index]['file_name'] = $customFileName; if (!empty($url)) { $finalPath = $subscriptionPath . $customFileName; $command = "wget -q --show-progress -O {$finalPath} {$url}"; exec($command . ' 2>&1', $output, $return_var); if ($return_var !== 0) { $command = "curl -s -o {$finalPath} {$url}"; exec($command . ' 2>&1', $output, $return_var); } if ($return_var === 0) { $_SESSION['update_messages'] = array(); $_SESSION['update_messages'][] = '
⚠️ 使用说明:
'; $fileContent = file_get_contents($finalPath); $decodedContent = base64_decode($fileContent); if ($decodedContent === false) { $_SESSION['update_messages'][] = "Base64 解码失败,请检查下载的文件内容是否有效!"; $message = "Base64 解码失败"; } else { $clashFile = $subscriptionPath . $customFileName; file_put_contents($clashFile, "# Clash Meta Config\n\n" . $decodedContent); $_SESSION['update_messages'][] = "订阅链接 {$url} 更新成功,并解码内容保存到: {$clashFile}"; $message = '更新成功'; $updateCompleted = true; } } else { $_SESSION['update_messages'][] = "配置更新失败!错误信息: " . implode("\n", $output); $message = '更新失败'; } } else { $_SESSION['update_messages'][] = "第" . ($index + 1) . "个订阅链接为空!"; $message = '更新失败'; } file_put_contents($subscriptionFile, json_encode($subscriptions)); } ?> Mihomo - NekoBox
🏠 首页 📂 文件管理 🗂️ Mihomo 💹 Sing-box

文件管理

代理文件管理
文件名 大小 修改时间 执行操作
配置文件管理
文件名 大小 修改时间 执行操作

Mihomo订阅管理

订阅链接

未找到订阅信息。

1. 对于首次使用 Sing-box 的用户,必须将核心更新至版本 v1.10.0 或更高版本。确保将出站和入站/转发防火墙规则都设置为“接受”并启用它们。
2. 注意:puernya订阅已合并至Mihomo订阅,并确保使用 puernya 内核。