<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://purl.org/rss/1.0/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel rdf:about="https://xmix.one/feed/rss/category/default/">
<title>Hello World - 默认分类</title>
<link>https://xmix.one/category/default/</link>
<description>只是一个默认分类</description>
<items>
<rdf:Seq>
<rdf:li resource="https://xmix.one/archives/135/"/>
<rdf:li resource="https://xmix.one/archives/134/"/>
<rdf:li resource="https://xmix.one/archives/132/"/>
<rdf:li resource="https://xmix.one/archives/131/"/>
<rdf:li resource="https://xmix.one/archives/130/"/>
<rdf:li resource="https://xmix.one/archives/129/"/>
<rdf:li resource="https://xmix.one/archives/128/"/>
<rdf:li resource="https://xmix.one/archives/127/"/>
</rdf:Seq>
</items>
</channel>
<item rdf:about="https://xmix.one/archives/135/">
<title>Debian系统开机一条龙</title>
<link>https://xmix.one/archives/135/</link>
<dc:date>2026-04-07T14:08:09+00:00</dc:date>
<description>1、DD系统curl -O https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh &amp;&amp; bash reinstall.sh debian 12 --password 密码 --ssh-port 端口2、执行脚本：apt update &amp;&amp; apt install -y curl &amp;&amp; bash &lt;(curl -fsSL https://raw.githubusercontent.com/LucaLin233/Linux/refs/heads/main/debian_setup.sh)代码审查：https://github.com/LucaLin233/Linux/blob/main/debian_setup.sh可选项1、禁用密码登录：sudo sed -i &#039;s/^#*PasswordAuthentication yes/PasswordAuthentication no/&#039; /etc/ssh/sshd_config &amp;&amp; sudo systemctl restart sshd如果是bin456789 DD的debian系统，请先运行：rm -rf /etc/ssh/sshd_config.d/01-permitrootlogin.conf2、更换内核：curl -fsSL &quot;https://keyserver.ubuntu.com/pks/lookup?op=get&amp;search=0xD38D7D1DA1349567ADED882D86F7D09EE734E623&quot; \
  | sudo gpg --dearmor -o /usr/share/keyrings/xanmod-archive-keyring.gpgecho &#039;deb [signed-by=/usr/share/keyrings/xanmod-archive-keyring.gpg] http://deb.xanmod.org releases main&#039; | sudo tee /etc/apt/sources.list.d/xanmod-release.listsudo apt update &amp;&amp; sudo apt install -y linux-xanmod-x64v33、开启Swap：sudo fallocate -l 1G /swapfile &amp;&amp; sudo chmod 600 /swapfile &amp;&amp; sudo mkswap /swapfile &amp;&amp; sudo swapon /swapfile &amp;&amp; echo &#039;/swapfile none swap sw 0 0&#039; | sudo tee -a /etc/fstab移除swap：sudo swapoff /swapfile &amp;&amp; sudo sed -i &#039;\#^/swapfile none swap sw 0 0#d&#039; /etc/fstab &amp;&amp; sudo rm /swapfile4、内核调优：查看状态:curl -fsSL https://raw.githubusercontent.com/LucaLin233/Linux/refs/heads/main/tools/kernel.sh | bash -s status恢复配置:curl -fsSL https://raw.githubusercontent.com/LucaLin233/Linux/refs/heads/main/tools/kernel.sh | bash -s restore优化无国内优化服务时:curl -fsSL https://raw.githubusercontent.com/LucaLin233/Linux/refs/heads/main/tools/kernel.sh | bash -s install -i优化国内优化服务器时:curl -fsSL https://raw.githubusercontent.com/LucaLin233/Linux/refs/heads/main/tools/kernel.sh | bash -s install -c交互版:curl -fsSL https://raw.githubusercontent.com/LucaLin233/Linux/refs/heads/main/tools/kernel.sh | bash -s install5、安装syncthingsudo mkdir -p /etc/apt/keyrings &amp;&amp; \
sudo curl -L -o /etc/apt/keyrings/syncthing-archive-keyring.gpg https://syncthing.net/release-key.gpg &amp;&amp; \
echo &quot;deb [signed-by=/etc/apt/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing stable-v2&quot; | sudo tee /etc/apt/sources.list.d/syncthing.list &amp;&amp; \
sudo apt update &amp;&amp; \
sudo apt install syncthing &amp;&amp; \
sudo systemctl enable syncthing@root.service &amp;&amp; \
sudo systemctl start syncthing@root.service6、路由追踪（可从一键部署脚本中选择安装）：curl -sL nxtrace.org/nt | bash7、修改系统dns：bash &lt;(curl -L -s https://raw.githubusercontent.com/1-stream/1stream-public-utils/main/dns-change.sh) 127.0.0.1 1.1.1.18、安装Cloudflare Tunnelsudo bash -c &quot;$(curl -fsSL https://raw.githubusercontent.com/LucaLin233/Linux/refs/heads/main/tools/cloudflare_tunnel.sh)&quot; -- install卸载：sudo bash -c &quot;$(curl -fsSL https://raw.githubusercontent.com/LucaLin233/Linux/refs/heads/main/tools/cloudflare_tunnel.sh)&quot; -- uninstall9、多功能脚本：wget -P /root -N --no-check-certificate &quot;https://raw.githubusercontent.com/jklolixxs/jms/main/jms.sh&quot; &amp;&amp; chmod 700 /root/jms.sh &amp;&amp; /root/jms.sh Bash10、流媒体解锁检测：bash &lt;(curl -L -s https://github.com/1-stream/RegionRestrictionCheck/raw/main/check.sh)11、修改语言为中文：apt update &amp;&amp; \
apt install -y locales &amp;&amp; \
sed -i &#039;s/^# *zh_CN.UTF-8 UTF-8/zh_CN.UTF-8 UTF-8/&#039; /etc/locale.gen &amp;&amp; \
locale-gen &amp;&amp; \
update-locale LANG=zh_CN.UTF-8 LANGUAGE=zh_CN:zh LC_ALL=zh_CN.UTF-812、IP质量检测：bash &lt;(curl -sL IP.Check.Place)</description>
</item>
<item rdf:about="https://xmix.one/archives/134/">
<title>优秀的CF项目汇总</title>
<link>https://xmix.one/archives/134/</link>
<dc:date>2026-03-19T12:47:27+00:00</dc:date>
<description>1、CloudMail https://github.com/maillab/cloud-mail2、NodeWarden https://github.com/shuaiplus/nodewarden3、CloudFlare图床 https://github.com/hleov/CloudFlare-ImgBed4、Discord图床 https://github.com/katelya77/K-Vault5、Antigravity-TG-Big-Bro https://github.com/sunyuchentrx/Antigravity-TG-Big-Bro6、AddressGenerator https://github.com/jiangnan1224/AddressGenerator7、XUGOU https://github.com/zaunist/xugou8、cf-drop https://github.com/lyonbot/cf-drop9、剩余价值计算器 https://github.com/realnovicedev/vps_calculator_docker10、另一款剩余价值计算器https://github.com/verkyer/vps-jsq11、畅聊 https://github.com/Shannon-x/chitchatter12、CF-M365-Admin https://github.com/wang4386/CF-M365-Admin13、NodeCrypt https://github.com/shuaiplus/NodeCrypt14、Flare Stack Blog https://github.com/du2333/flare-stack-blog15、CF-Warden https://github.com/qaz741wsd856/warden-worker16、OSSshelf https://github.com/Zoroaaa/OSSshelf</description>
</item>
<item rdf:about="https://xmix.one/archives/132/">
<title>CF优选IP</title>
<link>https://xmix.one/archives/132/</link>
<dc:date>2026-02-23T11:23:00+00:00</dc:date>
<description>最前面优选IP网站https://ip.v2too.top/https://ip.v2too.top/api/nodeshttps://ipdb.030101.xyz/bestcfv4/https://ip.164746.xyz/https://stock.hostmonit.com/CloudFlareYeshttps://www.cnae.top/https://saas.sin.fan/cf.468123.xyzcf.090227.xyzcf.3666888.xyzcloudflare.182682.xyzcdn.31514926.xyz备注：这些优选的都是CF的边缘ip，其实还是CF的，不一定是优化的线路一、WIN普通版一键测试优选，并且把最快的IP解析到域名1.下载CloudflareSpeedTesthttps://github.com/XIU2/CloudflareSpeedTest2.创建脚本解压刚刚GitHub下载的文件，在解压的文件目录创建两个文件run_all.bat跟update_cf_dns.ps1run_all.bat的代码如下@echo off
:: 设置脚本输出的字符集为 UTF-8，以支持中文等字符
chcp 65001

:: 切换到当前批处理脚本所在的目录
cd /d &quot;%~dp0&quot;

:: 输出信息，提示正在删除 result.csv 文件
echo 正在删除 result.csv...
del /f /q &quot;result.csv&quot;

:: 启用延迟变量扩展（用于在同一行中使用变量）
setlocal enabledelayedexpansion

:: ================================
:: 获取当前小时数并判断是否为晚高峰时段
:: ================================
:: 1. 提取当前小时数（取第0到第2位）
set &quot;current_hour=%time:~0,2%&quot;

:: 2. 去除小时数前面的空格（防止 0-9 点时出现 &quot; 8&quot; 导致判断报错）
set &quot;current_hour=%current_hour: =%&quot;

:: 3. 设置晚高峰判断变量（默认设为 false）
set &quot;IS_PEAK=false&quot;

:: 4. 判断逻辑：如果是 20点 到 23点 (20, 21, 22, 23)
if %current_hour% geq 20 if %current_hour% lss 24 (
    set &quot;IS_PEAK=true&quot;
)

:: ================================
:: 根据是否是晚高峰时段，启动不同的 cfst.exe 测速命令
:: ================================
if &quot;%IS_PEAK%&quot;==&quot;true&quot; (
     :: 如果是晚高峰时段，执行更高频率、更高负载的测速任务
     start &quot;&quot; /b &quot;%~dp0cfst.exe&quot; -n 600 -t 8 -dn 10 -dt 15 -tp 443 -url https://speed.cloudflare.com/__down?bytes=200000000 -tl 200 -tll 40 -tlr 1 -p 10 -sl 1 -o &quot;%~dp0result.csv&quot;
) else (
     :: 如果不是晚高峰时段，执行较低频率的测速任务
     start &quot;&quot; /b &quot;%~dp0cfst.exe&quot; -n 600 -t 4 -dn 10 -dt 15 -tp 443 -url https://speed.cloudflare.com/__down?bytes=200000000 -tl 120 -tll 30 -tlr 0.5 -p 10 -sl 2 -o &quot;%~dp0result.csv&quot;
)

:: ================================
:: 启动 PowerShell 脚本（用于更新 Cloudflare DNS）
:: ================================
start powershell -NoProfile -ExecutionPolicy Bypass -File &quot;%~dp0update_cf_dns.ps1&quot;


REM 主窗口自动关闭
update_cf_dns.ps1代码如下，只需要修改配置里面的三个项# 循环监听 result.csv 文件
$csvFile = &quot;result.csv&quot;
Write-Host &quot;正在监听 result.csv 文件...&quot;

# 等待 cfst.exe 生成 result.csv 文件
while (-not (Test-Path $csvFile)) {
    Write-Host &quot;等待 result.csv 文件生成...&quot;
    Start-Sleep -Seconds 5
}

Write-Host &quot;检测到 result.csv，等待 10 秒后开始进行 DNS 更新...&quot;

# 等待 10 秒钟后再执行 DNS 更新
Start-Sleep -Seconds 10

Write-Host &quot;开始进行 DNS 更新...&quot;

# 在新的 CMD 窗口中启动 DNS 更新逻辑（例如 Cloudflare API 或任何 DNS 更新方法）
Start-Process cmd.exe -ArgumentList &quot;/K echo 正在开始 DNS 更新... &amp;&amp; REM 在这里添加你的 DNS 更新逻辑 &amp;&amp; pause&quot;

Write-Host &quot;DNS 更新已在新的 CMD 窗口中启动。&quot;


# ---------- 配置 ----------
$CF_API_TOKEN     = &quot;&quot;      # Cloudflare API Token，必须有 Zone.DNS:Edit 权限
$ZONE_ID      = &quot;&quot;           # Cloudflare Zone ID
$DNS_NAME     = &quot;&quot;           # 要更新的域名
$FILE_PATH    = Join-Path $PSScriptRoot &quot;result.csv&quot;
# --------------------------

Write-Host &quot;🚀 脚本开始执行...&quot;

# 读取 CSV 第一行真实 IP 和 下载速度
$csvLine = (Get-Content $FILE_PATH -Encoding UTF8 | Select-Object -Skip 1 | Select-Object -First 1)
$fields = $csvLine.Split(&quot;,&quot;)
$IP = $fields[0].Trim()
$DownloadSpeed = [float]$fields[5].Trim()

# 检查下载速度是否为 0
if ($DownloadSpeed -eq 0) {
    Write-Host &quot;❌ 下载速度为 0，跳过 DNS 更新&quot;
    exit 0
}

Write-Host &quot;📌 获取到 IP: $IP&quot;
Write-Host &quot;📌 下载速度: $DownloadSpeed MB/s&quot;

# 设置请求头
$Headers = @{
    Authorization = &quot;Bearer $CF_API_TOKEN&quot;
    &quot;Content-Type&quot; = &quot;application/json&quot;
}

# 获取 DNS 记录 ID
$Resp = Invoke-RestMethod -Uri &quot;https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records?type=A&amp;name=$DNS_NAME&quot; -Method GET -Headers $Headers
if ($Resp.success -and $Resp.result.Count -gt 0) {
    $DNS_RECORD_ID = $Resp.result[0].id
    Write-Host &quot;📌 DNS记录ID: $DNS_RECORD_ID&quot;
} else {
    Write-Host &quot;❌ 获取 DNS 记录 ID 失败&quot;
    exit 1
}

# 构建 JSON Body（proxied = false，关闭小橙云）
$Body = @{
    type = &quot;A&quot;
    name = $DNS_NAME
    content = $IP
    ttl = 1
    proxied = $false
} | ConvertTo-Json -Compress

# 更新 DNS
$UpdateResp = Invoke-RestMethod -Uri &quot;https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records/$DNS_RECORD_ID&quot; -Method PATCH -Headers $Headers -Body $Body

Write-Host &quot;📌 Cloudflare 返回: $UpdateResp&quot;

if ($UpdateResp.success) {
    Write-Host &quot;✅ DNS记录更新成功: $DNS_NAME -&gt; $IP&quot;
} else {
    Write-Host &quot;❌ DNS更新失败&quot;
}二、WIN优化版优化功能：电脑上测试优选IP，解析最快的IP到cf域名，tg通知结果，上传结果到网页win的脚本代码# ========================== 全局参数配置 ==========================
# 程序相关
$cfstPath = &quot;.\cfst.exe&quot;  # cfst.exe 文件路径
$csvFile = &quot;.\result.csv&quot;  # CSV 文件路径

# api相关
$uploadUrl = &quot;https://xxx/api/upload&quot;  # 上传接口 URL
$authKey = &quot;&quot;  # 授权密钥

# 域名更新相关
$zoneId = &quot;&quot;  # Cloudflare Zone ID
$apiToken = &quot;&quot;  # Cloudflare API Token
$recordName = &quot;&quot;  # 要更新的 DNS 记录名称

# 测速相关
$url = &quot;&quot;  # 测速用的文件地址

# ========================== 删除旧的 CSV 文件 ==========================
Write-Host &quot;[INFO] 删除旧的 result.csv 文件...&quot;
if (Test-Path $csvFile) {
    Remove-Item $csvFile
}

# ========================== 开始测速 ==========================
Write-Host &quot;[INFO] 开始测速...&quot;

# 设置 cfst.exe 参数
$currentHour = (Get-Date).Hour

if ($currentHour -ge 19 -and $currentHour -lt 24) {
    # 晚高峰时段的参数
    $cfstArgs = &quot;-n 800 -t 8 -dn 10 -dt 10 -tp 443 -tl 300 -tlr 0.5 -sl 0.01 -p 10 -url $url -o result.csv&quot;
} else {
    # 平时的参数
    $cfstArgs = &quot;-n 800 -t 4 -dn 10 -dt 10 -tp 443 -tl 300 -tlr 0.5 -sl 0.01 -p 10 -url $url -o result.csv&quot;
}

# 在新的 PowerShell 窗口运行 cfst.exe
Start-Process powershell -ArgumentList &quot;-NoExit&quot;, &quot;-Command&quot;, &quot;&amp; &#039;$cfstPath&#039; $cfstArgs&quot;

# 等待 result.csv 文件生成
$timeout = 900  # 设置最大等待时间 15 分钟
$startTime = Get-Date
while (-not (Test-Path $csvFile)) {
    $elapsedTime = (Get-Date) - $startTime
    if ($elapsedTime.TotalSeconds -gt $timeout) {
        Write-Host &quot;[ERROR] 等待时间超过 15 分钟，未生成 result.csv 文件&quot;
        exit
    }
    Write-Host &quot;[INFO] 等待 result.csv 文件生成...&quot;
    Start-Sleep -Seconds 10
}

# ========================== 读取 CSV 文件 ==========================
Write-Host &quot;[INFO] 读取 result.csv 文件...&quot;
$csvContent = Import-Csv -Path $csvFile

# 选择最快的 IP
$bestIp = $csvContent | Sort-Object { [double]$_.&#039;下载速度(MB/s)&#039; } -Descending | Select-Object -First 1

if ($bestIp) {
    Write-Host &quot;[INFO] 选择的 IP: $($bestIp.&#039;IP 地址&#039;) SPEED: $($bestIp.&#039;下载速度(MB/s)&#039;)&quot;
} else {
    Write-Host &quot;[ERROR] 找不到有效的 IP 地址&quot;
    exit
}

# ========================== 更新 DNS 记录 ==========================
Write-Host &quot;[INFO] 准备更新 DNS，IP 地址: $($bestIp.&#039;IP 地址&#039;)&quot;
$recordUrl = &quot;https://api.cloudflare.com/client/v4/zones/$zoneId/dns_records?name=$recordName&quot;
$headers = @{
    &quot;Authorization&quot; = &quot;Bearer $apiToken&quot;
    &quot;Content-Type&quot;  = &quot;application/json&quot;
}

$response = Invoke-RestMethod -Uri $recordUrl -Headers $headers -Method Get

if ($response.success -and $response.result.Count -gt 0) {
    $recordId = $response.result[0].id

    # 更新 DNS 记录
    $updateUrl = &quot;https://api.cloudflare.com/client/v4/zones/$zoneId/dns_records/$recordId&quot;
    $body = @{
        &quot;type&quot;    = &quot;A&quot;
        &quot;name&quot;    = $recordName
        &quot;content&quot; = $bestIp.&#039;IP 地址&#039;
        &quot;ttl&quot;     = 60
        &quot;proxied&quot; = $false
    } | ConvertTo-Json

    $updateResponse = Invoke-RestMethod -Uri $updateUrl -Headers $headers -Method Put -Body $body

    if ($updateResponse.success) {
        Write-Host &quot;[INFO] DNS 更新成功&quot;
    } else {
        Write-Host &quot;[ERROR] 更新 DNS 失败: $($updateResponse.errors)&quot;
    }
} else {
    Write-Host &quot;[ERROR] 获取 DNS 记录失败&quot;
    exit
}

# ========================== 上传结果到 Worker ==========================
Write-Host &quot;[INFO] 上传数据到 Worker...&quot;

$jsonArray = @()
foreach ($row in $csvContent) {
    $jsonArray += @{
        &quot;ip&quot;          = $row.&#039;IP 地址&#039;
        &quot;speed&quot;       = $row.&#039;下载速度(MB/s)&#039;
        &quot;latency&quot;     = $row.&#039;平均延迟&#039;
        &quot;packetLoss&quot;  = $row.&#039;丢包率&#039;
        &quot;region&quot;      = $row.&#039;地区码&#039;
        &quot;sent&quot;        = $row.&#039;已发送&#039;
        &quot;received&quot;    = $row.&#039;已接收&#039;
        &quot;time&quot;        = (Get-Date).ToString(&quot;yyyy-MM-dd HH:mm:ss&quot;)
    }
}

# 转换为 JSON 格式
$jsonBody = $jsonArray | ConvertTo-Json -Depth 4

try {
    $uploadResponse = Invoke-RestMethod -Uri $uploadUrl -Method Post -Headers @{
        &quot;Authorization&quot; = $authKey
        &quot;Content-Type&quot;  = &quot;application/json&quot;
    } -Body $jsonBody

    if ($uploadResponse.success) {
        Write-Host &quot;[INFO] 数据上传成功&quot;
    } else {
        Write-Host &quot;[ERROR] 数据上传失败: $($uploadResponse.errors)&quot;
    }
} catch {
    Write-Host &quot;[ERROR] 上传失败: $_&quot;
}

# 防止脚本结束，保持当前窗口打开
Write-Host &quot;[INFO] 脚本执行完成&quot;
Read-Host &quot;按任意键退出&quot;
后端是部署在cloudfalre的worker，需要绑定一个kv，kv命名是IP_KVtg通知的话，也还需要在变量里面添加变量名，TG_BOT_TOKEN tg机器人api，TG_CHAT_ID tg用户idAUTH_KEY 可选，用户上传接口验证的密钥CF的woker代码// ================= 配置 =================
const CONFIG = {
  // 节点地区映射
  REGION_MAP: {
    HKG: &quot;香港&quot;, KHH: &quot;高雄&quot;, NRT: &quot;东京&quot;, LAX: &quot;洛杉矶&quot;,
    SEA: &quot;西雅图&quot;, SJC: &quot;圣何塞&quot;, FRA: &quot;法兰克福&quot;,
    MAD: &quot;马德里&quot;, SIN: &quot;新加坡&quot;, CAN: &quot;广州&quot;, SHA: &quot;上海&quot;
  },
  MAX_NODES_DISPLAY: 10,             // Telegram 最多显示节点数量
  DATA_RETENTION_MS: 24 * 60 * 60 * 1000, // 节点数据保留 24 小时
  BAR_MAX_LEN: 5,                    // Telegram 条形图长度
  NODE_ACCESS_INTERVAL: 30 * 1000    // 节点接口访问最小间隔 30 秒
};

// ================= 获取北京时间 =================
const getBJTime = () =&gt; new Date(Date.now() + 8 * 3600 * 1000);

// ================= Telegram 消息生成函数（等宽条形图） =================
function generateTGMessageText(data) {
  if (!data || data.length === 0)
    return &quot;❌ Cloudflare 优选 IP\n\n暂无有效数据&quot;;

  // 1. 排序并取前 MAX_NODES_DISPLAY 条
  const sortedData = [...data]
    .map(i =&gt; ({ ip: String(i.ip), speed: parseFloat(i.speed) || 0 }))
    .sort((a, b) =&gt; b.speed - a.speed)
    .slice(0, CONFIG.MAX_NODES_DISPLAY);

  const maxSpeed = sortedData[0].speed;
  const barLen = CONFIG.BAR_MAX_LEN;

  // 2. 构建条形图行
  const nodeLines = sortedData.map(i =&gt; {
    const ratio = maxSpeed &gt; 0 ? i.speed / maxSpeed : 0;
    let fill = Math.round(ratio * barLen);
    if (fill &lt; 1) fill = 1;

    let block;
    if (ratio &gt; 0.7) block = &quot;█&quot;;       // 高速
    else if (ratio &gt; 0.3) block = &quot;▓&quot;;  // 中速
    else block = &quot;▒&quot;;                    // 低速

    const bar = block.repeat(fill).padEnd(barLen, &quot; &quot;);
    const ip = i.ip.padEnd(16, &quot; &quot;);
    const speed = i.speed.toFixed(2).padStart(6, &quot; &quot;);
    return `${ip}${bar} ${speed} MB/s`;
  }).join(&quot;\n&quot;);

  const fastest = sortedData[0];
  const slowest = sortedData[sortedData.length - 1];
  const timeStr = getBJTime().toISOString().replace(&quot;T&quot;, &quot; &quot;).substring(0, 16);

  // 3. 返回 Telegram 消息
  return `✅ Cloudflare 优选 IP 更新通知

⚡️ 最快： ${fastest.ip} - ${fastest.speed.toFixed(2)} MB/s
☁️ 最慢： ${slowest.ip} - ${slowest.speed.toFixed(2)} MB/s

🕙 更新时间： ${timeStr}
&lt;code&gt;
${nodeLines}
&lt;/code&gt;`;
}

// ================= HTML 页面渲染 =================
function renderHTML(list) {
  const updateTime = list.length &gt; 0 ? list[0].time : &quot;-&quot;;

  // 计算最大速度，用于条形图比例
  const maxSpeed = list.length &gt; 0 ? Math.max(...list.map(i =&gt; i.speed)) : 0;

  // 生成每个节点卡片 HTML
  const cards = list.sort((a, b) =&gt; b.speed - a.speed)
    .map((i, idx) =&gt; {
      const widthPct = maxSpeed &gt; 0 ? Math.round((i.speed / maxSpeed) * 100) : 0;
      return `
      &lt;div class=&quot;card&quot; onclick=&quot;copyToClipboard(&#039;${i.ip}&#039;)&quot;&gt;
        &lt;div class=&quot;card-header&quot;&gt;
          &lt;span class=&quot;rank&quot;&gt;#${idx + 1}&lt;/span&gt;
          &lt;span class=&quot;region&quot;&gt;${CONFIG.REGION_MAP[i.region] || i.region || &quot;Any&quot;}&lt;/span&gt;
        &lt;/div&gt;
        &lt;div class=&quot;ip&quot;&gt;${i.ip}&lt;/div&gt;
        &lt;div class=&quot;speed&quot;&gt;${i.speed} MB/s&lt;/div&gt;
        &lt;div class=&quot;latency&quot;&gt;${i.latency} ms&lt;/div&gt;
        &lt;div class=&quot;card-footer&quot;&gt;点击复制 IP&lt;/div&gt;
      &lt;/div&gt;`;
    }).join(&quot;&quot;);

  return `&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;zh-CN&quot;&gt;
&lt;head&gt;
&lt;meta charset=&quot;utf-8&quot;&gt;
&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;
&lt;title&gt;Cloudflare 优选 IP&lt;/title&gt;
&lt;style&gt;
  :root {
    --primary-color: #4caf50;
    --secondary-color: #f3f6f9;
    --card-bg: #ffffff;
    --text-color: #333;
    --muted-color: #888;
    --highlight-color: #f3f8fb;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  }

  * { box-sizing: border-box; }
  body {
    margin: 0;
    padding: 20px;
    font-family: &#039;Segoe UI&#039;, Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(145deg, #e0f7fa, #ffffff);
    color: var(--text-color);
  }
  .container { max-width: 1200px; margin: 0 auto; }
  .header { text-align: center; margin-bottom: 40px; }
  .header h1 { font-size: 2rem; color: var(--primary-color); }
  .header p { font-size: 0.9rem; color: var(--muted-color); }

  .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }

  /* 卡片样式 */
  .card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  .card:hover { transform: translateY(-5px); box-shadow: var(--hover-shadow); }

  .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
  }
  .rank {
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--primary-color);
    background: var(--highlight-color);
    padding: 6px 12px;
    border-radius: 20px;
  }
  .region {
    font-size: 0.8rem;
    color: #1e40af;
    background: #e0e7ff;
    padding: 6px 12px;
    border-radius: 12px;
  }

  .ip {
    font-family: &#039;Courier New&#039;, Courier, monospace;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 14px;
  }

  .speed {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
    margin: 12px 0;
  }

  .latency {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--muted-color);
    text-align: center;
  }

  .card-footer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--muted-color);
    margin-top: 14px;
  }

  #toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 12px 20px;
    border-radius: 20px;
    font-size: 0.85rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  #toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-6px);
  }
&lt;/style&gt;
&lt;script&gt;
  // 复制 IP 并显示 Toast 提示
  function copyToClipboard(text) {
    navigator.clipboard.writeText(text).then(() =&gt; {
      const toast = document.getElementById(&quot;toast&quot;);
      toast.classList.add(&quot;show&quot;);
      setTimeout(() =&gt; toast.classList.remove(&quot;show&quot;), 1800);
    });
  }
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;container&quot;&gt;
  &lt;div class=&quot;header&quot;&gt;
    &lt;h1&gt;Cloudflare 优选 IP&lt;/h1&gt;
    &lt;p&gt;最后更新 · ${updateTime}&lt;/p&gt;
  &lt;/div&gt;
  &lt;div class=&quot;grid&quot;&gt;
    ${cards || &#039;&lt;div style=&quot;grid-column: 1/-1; text-align:center; color:#9ca3af; padding:60px;&quot;&gt;暂无数据&lt;/div&gt;&#039;}
  &lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;toast&quot;&gt;IP 已复制&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;`;
}

// ================= Worker 主逻辑 =================
export default {
  async fetch(request, env) {
    const { pathname } = new URL(request.url);

    // ---------- 上传测速数据接口 ---------- 
    if (pathname === &quot;/api/upload&quot; &amp;&amp; request.method === &quot;POST&quot;) {
      try {
        const auth = request.headers.get(&quot;Authorization&quot;);
        if (env.AUTH_KEY &amp;&amp; auth !== env.AUTH_KEY)
          return new Response(&quot;Unauthorized&quot;, { status: 401 });

        const rawData = await request.json();
        if (!Array.isArray(rawData)) throw new Error(&quot;Invalid format&quot;);

        const now = getBJTime().toISOString();
        const cleanData = rawData.map(i =&gt; ({
          ip: i.ip, speed: i.speed, latency: i.latency, region: i.region, time: now.replace(&quot;T&quot;, &quot; &quot;).substring(0, 16)
        }));

        // 每次上传的数据都完全覆盖之前的数据
        await env.SPEED_TEST_KV.put(&quot;speed_test_data&quot;, JSON.stringify(cleanData));

        // 发送 Telegram 消息
        await Promise.allSettled([
          fetch(`https://api.telegram.org/bot${env.TG_BOT_TOKEN}/sendMessage`, {
            method: &quot;POST&quot;,
            headers: { &quot;Content-Type&quot;: &quot;application/json&quot; },
            body: JSON.stringify({
              chat_id: env.TG_CHAT_ID,
              text: generateTGMessageText(cleanData),
              parse_mode: &quot;HTML&quot;,
              disable_notification: true
            })
          }),
        ]);

        return new Response(JSON.stringify({ success: true }), {
          headers: { &quot;Content-Type&quot;: &quot;application/json; charset=utf-8&quot; }
        });

      } catch (e) {
        return new Response(JSON.stringify({ error: e.message }), {
          status: 400,
          headers: { &quot;Content-Type&quot;: &quot;application/json; charset=utf-8&quot; }
        });
      }
    }

    // ---------- 获取节点数据接口 ---------- 
    if (pathname === &quot;/api/nodes&quot;) {
      const nowTs = Date.now();
      const clientIP = request.headers.get(&quot;CF-Connecting-IP&quot;) || &quot;unknown&quot;;

      const rawAccess = await env.SPEED_TEST_KV.get(&quot;nodes_access_map&quot;);
      let accessMap = rawAccess ? JSON.parse(rawAccess) : {};

      // 删除过期访问记录
      for (let ip in accessMap)
        if (nowTs - accessMap[ip] &gt; CONFIG.NODE_ACCESS_INTERVAL) delete accessMap[ip];

      // 检查访问频率
      if (accessMap[clientIP])
        return new Response(JSON.stringify({ success: false, message: &quot;请30秒后再请求&quot; }), {
          headers: { &quot;Content-Type&quot;: &quot;application/json; charset=utf-8&quot; }
        });

      // 更新访问时间
      accessMap[clientIP] = nowTs;
      await env.SPEED_TEST_KV.put(&quot;nodes_access_map&quot;, JSON.stringify(accessMap));

      // 获取 24 小时内有效节点数据
      const raw = await env.SPEED_TEST_KV.get(&quot;speed_test_data&quot;);
      let list = raw ? JSON.parse(raw) : [];
      list = list.filter(i =&gt; nowTs - new Date(i.time).getTime() &lt; CONFIG.DATA_RETENTION_MS);

      return new Response(JSON.stringify({ success: true, data: list }), {
        headers: { &quot;Content-Type&quot;: &quot;application/json; charset=utf-8&quot; }
      });
    }

    // ---------- 网页端展示 ---------- 
    if (pathname === &quot;/&quot;) {
      const raw = await env.SPEED_TEST_KV.get(&quot;speed_test_data&quot;) || &quot;[]&quot;;
      return new Response(renderHTML(JSON.parse(raw)), {
        headers: { &quot;Content-Type&quot;: &quot;text/html; charset=UTF-8&quot; }
      });
    }

    // ---------- 404 ---------- 
    return new Response(&quot;Not Found&quot;, { status: 404 });
  }
};
三、Linux版1.官方安装说明# 如果是第一次使用，则建议创建新文件夹（后续更新时，跳过该步骤）
mkdir cfst

# 进入文件夹（后续更新，只需要从这里重复下面的下载、解压命令即可）
cd cfst

# 下载 CFST 压缩包（自行根据需求替换 URL 中 [版本号] 和 [文件名]）
wget -N https://github.com/XIU2/CloudflareSpeedTest/releases/download/v2.3.4/cfst_linux_amd64.tar.gz
# 如果你是在国内网络环境中下载，那么请使用下面这几个镜像加速之一：
# wget -N https://ghfast.top/https://github.com/XIU2/CloudflareSpeedTest/releases/download/v2.3.4/cfst_linux_arm64.tar.gz
# wget -N https://wget.la/https://github.com/XIU2/CloudflareSpeedTest/releases/download/v2.3.4/cfst_linux_arm64.tar.gz
# wget -N https://ghproxy.net/https://github.com/XIU2/CloudflareSpeedTest/releases/download/v2.3.4/cfst_linux_arm64.tar.gz
# wget -N https://gh-proxy.com/https://github.com/XIU2/CloudflareSpeedTest/releases/download/v2.3.4/cfst_linux_arm64.tar.gz
# wget -N https://hk.gh-proxy.com/https://github.com/XIU2/CloudflareSpeedTest/releases/download/v2.3.4/cfst_linux_arm64.tar.gz
# 如果下载失败的话，尝试删除 -N 参数（如果是为了更新，则记得提前删除旧压缩包 rm cfst_linux_amd64.tar.gz ）

# 解压（不需要删除旧文件，会直接覆盖，自行根据需求替换 文件名）
tar -zxf cfst_linux_amd64.tar.gz

# 赋予执行权限
chmod +x cfst

# 运行（不带参数）
./cfst

# 运行（带参数示例）
./cfst -tl 200 -dn 20在解压的文件里面，新建一个sh文件run_cf_ddns.sh需要修改的内容都在配置信息里面API_TOKEN # Cloudflare API Token，必须有 Zone.DNS:Edit 权限
ZONE_ID # Cloudflare Zone ID
RECORD_NAME # 要更新的域名记得给文件添加可执行权限，chmod 777 run_cf_ddns.sh，然后运行看看效果./run_cf_ddns.sh#!/bin/bash

# ================= 配置信息 =================
# Cloudflare API Token，必须有 Zone.DNS:Edit 权限
API_TOKEN=&quot;&quot;
# Cloudflare Zone ID
ZONE_ID=&quot;&quot;
# 要更新的域名
RECORD_NAME=&quot;&quot;
# 测速url
SPEED_URL=&quot;&quot;

# ================= cfst 参数 =================
# 定义平时参数
CFST_PARAMS_DAY=&quot;-n 600 -t 4 -dn 10 -dt 15 -tp 443 -url $SPEED_URL -tl 120 -tll 40 -tlr 0.5 -p 10 -sl 1 -o result.csv&quot;
# 定义晚高峰参数
CFST_PARAMS_PEAK=&quot;-n 600 -t 6 -dn 10 -dt 15 -tp 443 -url $SPEED_URL -tl 200 -tll 40 -tlr 1 -p 10 -sl 1 -o result.csv&quot;

# 根据当前时间判断使用哪一套参数
current_hour=$(date +%H)
if [ &quot;$current_hour&quot; -ge 20 ] &amp;&amp; [ &quot;$current_hour&quot; -lt 24 ]; then
    CFST_PARAMS=&quot;$CFST_PARAMS_PEAK&quot;  # 晚高峰使用晚高峰参数
else
    CFST_PARAMS=&quot;$CFST_PARAMS_DAY&quot;   # 非高峰期使用平时参数
fi

echo &quot;使用 cfst 参数: $CFST_PARAMS&quot;
# ============================================

# ================= 防止重复运行逻辑 =================
LOCK_FILE=&quot;/tmp/cfst_ddns_update.lock&quot;
LOCK_TIMEOUT=900  # 15分钟超时

# 使用文件描述符 200 绑定锁文件
exec 200&gt;&quot;$LOCK_FILE&quot;

# 尝试获取排他锁 (-n 表示非阻塞，如果失败立即返回)
if ! flock -n 200; then
    echo &quot;--- [$(date &#039;+%Y-%m-%d %H:%M:%S&#039;)] 错误: 另一个脚本实例正在运行，本次任务跳过 ---&quot;
    exit 0
fi

# 设置超时控制：超过15分钟自动解除锁并停止脚本
{
    sleep &quot;$LOCK_TIMEOUT&quot; &amp;&amp; echo &quot;--- [$(date &#039;+%Y-%m-%d %H:%M:%S&#039;)] 错误: 超过 15 分钟未完成任务，自动解锁并退出 ---&quot; &amp;&amp; flock -u 200 &amp;&amp; exit 1
} &amp;

# 脚本的主要任务处理
echo &quot;--- [$(date &#039;+%Y-%m-%d %H:%M:%S&#039;)] 正在执行任务 ---&quot;
# 任务代码...

# 脚本任务完成后解除锁
flock -u 200
echo &quot;--- [$(date &#039;+%Y-%m-%d %H:%M:%S&#039;)] 任务完成，已释放锁 ---&quot;
# ===================================================

# 获取脚本所在绝对路径
BASE_DIR=$(cd &quot;$(dirname &quot;$0&quot;)&quot;; pwd)
cd &quot;$BASE_DIR&quot; || exit 1
RESULT_FILE=&quot;$BASE_DIR/result.csv&quot;

echo &quot;--- 任务开始: $(date &#039;+%Y-%m-%d %H:%M:%S&#039;) ---&quot;

# 1. 环境清理
[ -f &quot;$RESULT_FILE&quot; ] &amp;&amp; rm -f &quot;$RESULT_FILE&quot;

# 2. 执行测速
if [ -f &quot;./cfst&quot; ]; then
    echo &quot;[步骤1/4] 正在运行 cfst 测速...&quot;
    chmod +x ./cfst
    ./cfst $CFST_PARAMS
else
    echo &quot;错误: 目录下未找到 cfst 执行文件&quot;
    exit 1
fi

# 3. 结果校验与提取
if [ ! -s &quot;$RESULT_FILE&quot; ]; then
    echo &quot;错误: 测速失败，未生成有效的 result.csv&quot;
    exit 1
fi

READ_DATA=$(awk -F, &#039;NR==2 {print $1,$6}&#039; &quot;$RESULT_FILE&quot;)
read -r IP SPEED &lt;&lt;&lt; &quot;$READ_DATA&quot;

CHECK_RESULT=$(echo &quot;$SPEED&quot; | awk &#039;{if($1 &lt;= 0.01) print &quot;stop&quot;; else print &quot;go&quot;}&#039;)

if [ &quot;$CHECK_RESULT&quot; == &quot;stop&quot; ] || [ -z &quot;$IP&quot; ]; then
    echo &quot;停止更新: 速度过低 ($SPEED MB/s) 或未获取到 IP。&quot;
    exit 0
fi

echo &quot;[步骤2/4] 测速通过！最优 IP: $IP, 速度: $SPEED MB/s&quot;

# 4. 更新 Cloudflare
echo &quot;[步骤3/4] 正在获取 Record ID...&quot;
RECORD_INFO=$(curl -s -X GET &quot;https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records?name=$RECORD_NAME&quot; \
     -H &quot;Authorization: Bearer $API_TOKEN&quot; \
     -H &quot;Content-Type: application/json&quot;)

RECORD_ID=$(echo &quot;$RECORD_INFO&quot; | sed -n &#039;s/.*&quot;id&quot;:&quot;\([^&quot;]*\)&quot;.*/\1/p&#039; | head -n 1)

if [ -z &quot;$RECORD_ID&quot; ] || [ ${#RECORD_ID} -lt 10 ]; then
    echo &quot;错误: 无法获取 Record ID。&quot;
    exit 1
fi

echo &quot;[步骤4/4] 正在同步 DNS 记录...&quot;
UPDATE_RES=$(curl -s -X PUT &quot;https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records/$RECORD_ID&quot; \
     -H &quot;Authorization: Bearer $API_TOKEN&quot; \
     -H &quot;Content-Type: application/json&quot; \
     --data &quot;{\&quot;type\&quot;:\&quot;A\&quot;,\&quot;name\&quot;:\&quot;$RECORD_NAME\&quot;,\&quot;content\&quot;:\&quot;$IP\&quot;,\&quot;ttl\&quot;:60,\&quot;proxied\&quot;:false}&quot;)

if [[ &quot;$UPDATE_RES&quot; == *&quot;\&quot;success\&quot;:true&quot;* ]]; then
    echo &quot;==========================================&quot;
    echo &quot;  更新成功！ IP: $IP&quot;
    echo &quot;==========================================&quot;
else
    echo &quot;更新失败！&quot;
    echo &quot;$UPDATE_RES&quot;
    exit 1
fi

echo &quot;--- 任务结束: $(date &#039;+%Y-%m-%d %H:%M:%S&#039;) ---&quot;
</description>
</item>
<item rdf:about="https://xmix.one/archives/131/">
<title>Linux部署yt-dtl，下载Youtube</title>
<link>https://xmix.one/archives/131/</link>
<dc:date>2026-02-19T07:57:00+00:00</dc:date>
<description>一、安装 yt-dlp（推荐官方二进制方式）下载最新版sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp赋予执行权限sudo chmod a+rx /usr/local/bin/yt-dlp测试yt-dlp --version如果能显示版本号，说明安装成功。二、安装 ffmpeg（必须）用于合并视频音频：sudo apt update
sudo apt install ffmpeg -y测试：ffmpeg -version三、下载命令yt-dlp -f &quot;bestvideo+bestaudio/best&quot; \
--merge-output-format mp4 \
URL
</description>
</item>
<item rdf:about="https://xmix.one/archives/130/">
<title>部署 WireGuard 实现NAS安全组网</title>
<link>https://xmix.one/archives/130/</link>
<dc:date>2026-02-08T08:27:00+00:00</dc:date>
<description>1. 前期准备DDNS 解析：解析一个域名到你的公网 IP。客户端准备：手机/PC 端下载安装 WireGuard。密码处理（关键）：准备好你的明文密码。访问 bcrypt.online 生成 Hash 串。转义处理：在 Docker Compose 中 $ 是变量符，必须将 Hash 串中所有的 $ 替换为 $$。2. Docker 部署在NAS中新建目录 /vol1/1000/app/wireguard，创建 docker-compose.yml。配置要点：替换 WG_HOST 为你的域名。替换 PASSWORD_HASH 为刚才生成的 Hash。WG_DEFAULT_ADDRESS 建议修改为非家庭常用网段（如 10.8.0.x），避免路由冲突。services:
  wg-easy:
    image: ghcr.io/wg-easy/wg-easy
    container_name: wg-easy
    environment:
      - WG_HOST=你的公网域名或公网IP
      - PASSWORD_HASH=管理后台密码 (Bcrypt Hash)，注意 Docker Compose 中 $ 需写成 $$
      
      # 网络配置
      - WG_PORT=51820
      - WG_DEFAULT_ADDRESS=10.8.0.x
      - WG_DEFAULT_DNS=223.5.5.5, 223.6.6.6
      - WG_ALLOWED_IPS=0.0.0.0/0, ::/0
      - WG_MTU=1420
      
    volumes:
      - ./config:/etc/wireguard
    ports:
      - &quot;51820:51820/udp&quot; # 隧道通信
      - &quot;51821:51821/tcp&quot; # Web 管理面板
    restart: unless-stopped
    cap_add:
      - NET_ADMIN
      - SYS_MODULE
    sysctls:
      - net.ipv4.ip_forward=1
      - net.ipv4.conf.all.src_valid_mark=1启动容器后，访问 http://NAS_IP:51821/ 进入后台（密码为 Hash 前的明文）。3. 端口转发进入主路由后台，添加端口映射：外部端口：51820内部端口：51820协议：UDP (注意：WireGuard 仅使用 UDP)4. 客户端连接在 Web 后台点击 New Client，命名（如 iPhone）。打开手机 WireGuard App，扫描屏幕上的二维码。断开手机 WiFi，使用 5G 流量测试。开启连接，尝试访问 NAS 内网 IP。5. 为什么选择 WireGuard？安全性：隐形防御端口映射 (5666)：像家门临街，虽然有锁，但小偷知道门在哪，随时能尝试撬锁或利用漏洞（如 fnOS 事件）。WireGuard (51820)：在攻击者眼中是“丢包”的黑洞。没有正确的私钥，服务器对任何扫描都不予回应。坏人连门都找不到，无从下手。功能性：全屋互联端口映射：要在墙上凿无数个洞。想用 NAS 凿一个，想看监控又凿一个。想用局域网打印机？没映射就无法访问。WireGuard：直接把你要到了客厅。连上 VPN 等同于设备物理接入了家庭 WiFi。NAS、路由器后台、PC 远程桌面、打印机，想连谁连谁。维护性：收敛入口传统方式：维护多个端口，需确保每个服务的 Auth 都足够强壮。WireGuard：只需守住这唯一的入口。只要隧道安全，内网所有弱密码设备皆安全。</description>
</item>
<item rdf:about="https://xmix.one/archives/129/">
<title>Typecho整文件夹迁移后的权限调整</title>
<link>https://xmix.one/archives/129/</link>
<dc:date>2026-02-07T16:31:27+00:00</dc:date>
<description>对于采用SQLITE的Typecho，在对整个文件夹先压缩再上传的迁移，迁移后会出现访问500错误。其主要原因是*.db 的属主是 root:root，而 PHP-FPM 是 www-data 在跑，因此需要重新调整权限。1. 把 usr 目录和数据库交给 www-datachown -R www-data:www-data /www/wwwroot/xxx.xxx/usr2. 给 usr 目录写权限（SQLite 需要）chmod 775 /www/wwwroot/xxx.xxx/usr3. 确保数据库文件可写chmod 664 /www/wwwroot/xxx.xxx/usr/xmix.db</description>
</item>
<item rdf:about="https://xmix.one/archives/128/">
<title>Linux迁移Docker到数据盘</title>
<link>https://xmix.one/archives/128/</link>
<dc:date>2026-02-03T11:53:00+00:00</dc:date>
<description>1、 确认 Docker 完全没在运行sudo systemctl stop docker.socket
sudo systemctl stop docker
sudo systemctl stop containerd2、 创建 Docker 数据目录mkdir -p /data/docker给权限（推荐）：chown -R root:root /data/docker
chmod 711 /data/docker3、 指定 Docker 使用 /data/docker创建或编辑配置文件：nano /etc/docker/daemon.json写入 完整内容（如果文件原来不存在，直接粘贴即可）：{
  &quot;data-root&quot;: &quot;/data/docker&quot;
}保存退出。4、将 containerd 数据迁移到 /data/docker/containerd：sudo mv /var/lib/containerd /data/docker/containerd5、修改 containerd 配置（通常 /etc/containerd/config.toml）：root = &quot;/data/docker/containerd&quot;
state = &quot;/data/docker/containerd/state&quot;6、启动 Dockersystemctl daemon-reexec
systemctl start containerd
systemctl start docker7、验证是否生效（关键一步）docker info | grep &quot;Docker Root Dir&quot;
ls /data/docker_new/containerd/io.containerd.content.v1.content
ls /data/docker_new/containerd/io.containerd.snapshotter.v1.overlayfs</description>
</item>
<item rdf:about="https://xmix.one/archives/127/">
<title>使用CF Workers 优选反代 EMBY</title>
<link>https://xmix.one/archives/127/</link>
<dc:date>2026-01-19T13:03:00+00:00</dc:date>
<description>前期准备:CloudFLare账号托管在Cloudflare上面的域名注意事项:同一个反代建议不要给很多人用，否则流量过大可能违反CF的政策导致被封号。建议小范围自用。第一步: 部署代码首先打开Cloudflare面板，在左侧菜单找到 Workers 和 Pages，点击 创建应用程序，模板选Hello word 开始新建一个Worker。点击 编辑代码，将原有的代码全部删除，粘贴以下代码。注意：粘贴后，请务必修改代码顶部的 target 这一行，填入你自己想要反代的Emby服务器地址和端口。const myConfig = {
 target: &#039;https://你的emby地址:端口号&#039;,
 enableCors: true
};

export default {
 async fetch(req, env, ctx) {
  const u = new URL(req.url);
  const t = new URL(myConfig.target);
  u.protocol = t.protocol;
  u.hostname = t.hostname;
  u.port = t.port;
  const h = new Headers(req.headers);
  h.set(&#039;Host&#039;, t.hostname);
  if (h.has(&#039;Referer&#039;)) h.set(&#039;Referer&#039;, myConfig.target);
  if (h.has(&#039;Origin&#039;)) h.set(&#039;Origin&#039;, myConfig.target);
  const r = new Request(u.toString(), {
   method: req.method,
   headers: h,
   body: req.body,
   redirect: &#039;follow&#039;
  });
  try {
   const res = await fetch(r);
   const rh = new Headers(res.headers);
   if (myConfig.enableCors) {
    rh.set(&#039;Access-Control-Allow-Origin&#039;, &#039;*&#039;);
    rh.set(&#039;Access-Control-Allow-Methods&#039;, &#039;GET,POST,PUT,PATCH,DELETE,OPTIONS&#039;);
    rh.set(&#039;Access-Control-Allow-Headers&#039;, &#039;*&#039;);
   }
   return new Response(res.body, {
    status: res.status,
    statusText: res.statusText,
    headers: rh
   });
  } catch (err) {
   return new Response(err.message, { status: 502 });
  }
 }
};点击右上角的 部署 (Deploy) 按钮保存。第二步: 域名CNAME优选打开你托管在Cloudflare的域名管理页面，进入 DNS 记录。添加一条 CNAME 记录:名称: 填写你想要的前缀(例如 emby)目标: 填写一个优选域名。务必关闭 "小黄云"优选域名可以在这里选:https://cf.090227.xyz/第三步: 配置路由在你的域名管理页面左侧菜单栏，点击 Workers 路由 (Workers Routes)。点击 添加路由。路由一栏输入: 添加记录的名称.你的域名/*例如: emby.你的域名.com/*注意!!!  一定要带上/*Worker 一栏选择你第一步创建的那个Worker。点击保存。本教程的优选域名方式也可以用于其它功能的workers,反代代码也可以用于emby服务器以外的网站,想要个性化的功能可以让AI帮你写代码结束:现在打开你在DNS设置的那个域名(例如 https://emby.你的域名.com)，应该就可以直接访问你的Emby了，并且走的是优选线路。补充:反代需要使用国内dns解析,否则可能连不上,如果你有同时使用代理软件,请自行添加规则,把你自己的域名走直连,并且DNS要用国内的补充:在播放器上,服务器端口可以不填(默认443),也可以填443、2053、2083、2087、2096、8443使用其它端口也许可以在晚高峰提升速度(我不确定). 本方式搭建的反代,使用hills的可以直接在它的服务器线路中添加进阶:如果你有多个Emby服务器，想要通过同一个优选域名访问（例如用 /server1 访问第一台，/server2 访问第二台），懒得每个服务器都开一个workers, 可以使用下面的代码。操作方法:将Worker中的代码全部替换为以下内容，并修改顶部的配置区域。const mapCfg = {
 paths: {
  &quot;/server1&quot;: &quot;https://你的第一台emby地址:端口&quot;,
  &quot;/server2&quot;: &quot;https://你的第二台emby地址:端口&quot;
 },
 main: &quot;https://你的默认emby地址:端口&quot;,
 cors: true
};

export default {
 async fetch(req, env, ctx) {
  const rawUrl = new URL(req.url);
  let target = mapCfg.main;
  let prefix = &quot;&quot;;
   
  for (const key in mapCfg.paths) {
   if (rawUrl.pathname.startsWith(key)) {
    target = mapCfg.paths[key];
    prefix = key;
    break;
   }
  }

  let cleanPath = rawUrl.pathname;
  if (prefix) {
   cleanPath = cleanPath.replace(prefix, &#039;&#039;);
   if (cleanPath === &#039;&#039; || !cleanPath.startsWith(&#039;/&#039;)) {
    cleanPath = &#039;/&#039; + cleanPath;
   }
  }

  const tUrl = new URL(target);
  const finalUrl = new URL(cleanPath + rawUrl.search, tUrl);
   
  const h = new Headers(req.headers);
  h.set(&#039;Host&#039;, tUrl.host);
   
  if (h.has(&#039;Referer&#039;)) h.set(&#039;Referer&#039;, target);
  if (h.has(&#039;Origin&#039;)) h.set(&#039;Origin&#039;, target);

  const newReq = new Request(finalUrl.toString(), {
   method: req.method,
   headers: h,
   body: req.body,
   redirect: &#039;follow&#039;
  });

  try {
   const res = await fetch(newReq);
   const resH = new Headers(res.headers);
    
   if (mapCfg.cors) {
    resH.set(&#039;Access-Control-Allow-Origin&#039;, &#039;*&#039;);
    resH.set(&#039;Access-Control-Allow-Methods&#039;, &#039;GET, POST, PUT, PATCH, DELETE, OPTIONS&#039;);
    resH.set(&#039;Access-Control-Allow-Headers&#039;, &#039;*&#039;);
   }

   return new Response(res.body, {
    status: res.status,
    statusText: res.statusText,
    headers: resH
   });
  } catch (err) {
   return new Response(err.message, { status: 502 });
  }
 }
};使用说明:修改 paths 中的内容，左边是路径前缀，右边是对应的服务器地址。修改 main 中的地址，这是直接访问域名（不带前缀）时连接的默认服务器。在Emby客户端填入地址时：访问默认服务器填: https://emby.你的域名.com访问其他服务器填: https://emby.你的域名.com/server1 (对应代码里设置的前缀)</description>
</item>
</rdf:RDF>