<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>OKHK</title>
        <link>https://okhk.net/</link>
        <description>OKHK Personal Note,</description>
        <lastBuildDate>Wed, 14 Oct 2026 23:39:15 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en-US</language>
        <copyright>All rights reserved 2026, HK</copyright>
        <item>
            <title><![CDATA[小米 AX3000T 路由器刷入使用官方原版 OpenWrt / ImmortalWrt 固件记录]]></title>
            <link>https://okhk.net/xiaomi-ax3000t-router-install-openwrt-immortalwrt</link>
            <guid>https://okhk.net/xiaomi-ax3000t-router-install-openwrt-immortalwrt</guid>
            <pubDate>Sat, 17 Aug 2024 16:00:00 GMT</pubDate>
            <description><![CDATA[文章介绍了如何将小米 AX3000T 路由器刷入官方原版 OpenWrt 或 ImmortalWrt 固件，包括降级系统、获取 stok 值、开启 SSH、备份原始分区、刷入 initramfs system 以及最终升级固件的全过程。]]></description>
            <content:encoded><![CDATA[<main class="notion light-mode notion-page notion-block-338a6514d20944b9a1cf720aa460cf5d"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-fd43da4c7c624a12befe89563a02ec9b" data-id="fd43da4c7c624a12befe89563a02ec9b"><span><div id="fd43da4c7c624a12befe89563a02ec9b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#fd43da4c7c624a12befe89563a02ec9b" title="更新："><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">更新：</span></span></h3><div class="notion-text notion-block-13c710e0130780d2baf8ea9ae545c1c6">hanwckf 版本的 ImmortalWrt 和 U-Boot 已经支持 AN8855 版本的 AX3000T ，感谢 H 大的适配。</div><div class="notion-text notion-block-13e710e01307807890d9f0a48d0d4de6">固件及 U-Boot ：</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-13e710e01307800b9d19ca4ce6f23ff6" href="https://github.com/hkint/xiaomi-ax3000t-immortalwrt-hanwckf-firmware-build/"><div><div class="notion-bookmark-title">GitHub - hkint/xiaomi-ax3000t-immortalwrt-hanwckf-firmware-build: Build hanwckf&#x27;s ImmortalWrt firmware and u-boot for xiaomi ax3000t router</div><div class="notion-bookmark-description">Build hanwckf&#x27;s ImmortalWrt firmware and u-boot for xiaomi ax3000t router - hkint/xiaomi-ax3000t-immortalwrt-hanwckf-firmware-build</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=13e710e0-1307-800b-9d19-ca4ce6f23ff6&amp;cache=v2" alt="GitHub - hkint/xiaomi-ax3000t-immortalwrt-hanwckf-firmware-build: Build hanwckf&#x27;s ImmortalWrt firmware and u-boot for xiaomi ax3000t router" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/hkint/xiaomi-ax3000t-immortalwrt-hanwckf-firmware-build/</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2Faa73dd2d8590affc4e5b7bad5023ad179810b5a1373fd02625fd869ddf83d6db%2Fhkint%2Fxiaomi-ax3000t-immortalwrt-hanwckf-firmware-build?table=block&amp;id=13e710e0-1307-800b-9d19-ca4ce6f23ff6&amp;cache=v2" alt="GitHub - hkint/xiaomi-ax3000t-immortalwrt-hanwckf-firmware-build: Build hanwckf&#x27;s ImmortalWrt firmware and u-boot for xiaomi ax3000t router" loading="lazy" decoding="async"/></div></a></div><div class="notion-text notion-block-13e710e0130780668035cfddcc7f5605">简要说明：</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-13c710e0130780e08852c0161df17232" href="https://okhk.net/xiaomi-ax3000t-router-with-hanwckf-immortalwrt"><div><div class="notion-bookmark-title">HK&#x27;s note ✨ 小米 AX3000T 路由器使用 hanwckf 版本的 ImmortalWrt 和 U-Boot</div><div class="notion-bookmark-description">文章介绍了如何为小米 AX3000T 路由器使用 hanwckf 版本的 ImmortalWrt 和 U-Boot 固件进行刷入。此外可以通过 GitHub Action 编译固件为特定设备定制固件。</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fokhk.net%2Ffavicon.png?table=block&amp;id=13c710e0-1307-80e0-8852-c0161df17232&amp;cache=v2" alt="HK&#x27;s note ✨ 小米 AX3000T 路由器使用 hanwckf 版本的 ImmortalWrt 和 U-Boot" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://okhk.net/xiaomi-ax3000t-router-with-hanwckf-immortalwrt</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fokhk.net%2Fapi%2Fog%3Ftitle%3DHK&#x27;s%2520note%2520%25E2%259C%25A8%2520%25E5%25B0%258F%25E7%25B1%25B3%2520AX3000T%2520%25E8%25B7%25AF%25E7%2594%25B1%25E5%2599%25A8%25E4%25BD%25BF%25E7%2594%25A8%2520hanwckf%2520%25E7%2589%2588%25E6%259C%25AC%25E7%259A%2584%2520ImmortalWrt%2520%25E5%2592%258C%2520U-Boot%26description%3D%25E6%2596%2587%25E7%25AB%25A0%25E4%25BB%258B%25E7%25BB%258D%25E4%25BA%2586%25E5%25A6%2582%25E4%25BD%2595%25E4%25B8%25BA%25E5%25B0%258F%25E7%25B1%25B3%2520AX3000T%2520%25E8%25B7%25AF%25E7%2594%25B1%25E5%2599%25A8%25E4%25BD%25BF%25E7%2594%25A8%2520hanwckf%2520%25E7%2589%2588%25E6%259C%25AC%25E7%259A%2584%2520ImmortalWrt%2520%25E5%2592%258C%2520U-Boot%2520%25E5%259B%25BA%25E4%25BB%25B6%25E8%25BF%259B%25E8%25A1%258C%25E5%2588%25B7%25E5%2585%25A5%25E3%2580%2582%25E6%25AD%25A4%25E5%25A4%2596%25E5%258F%25AF%25E4%25BB%25A5%25E9%2580%259A%25E8%25BF%2587%2520GitHub%2520Action%2520%25E7%25BC%2596%25E8%25AF%2591%25E5%259B%25BA%25E4%25BB%25B6%25E4%25B8%25BA%25E7%2589%25B9%25E5%25AE%259A%25E8%25AE%25BE%25E5%25A4%2587%25E5%25AE%259A%25E5%2588%25B6%25E5%259B%25BA%25E4%25BB%25B6%25E3%2580%2582?table=block&amp;id=13c710e0-1307-80e0-8852-c0161df17232&amp;cache=v2" alt="HK&#x27;s note ✨ 小米 AX3000T 路由器使用 hanwckf 版本的 ImmortalWrt 和 U-Boot" loading="lazy" decoding="async"/></div></a></div><div class="notion-callout notion-gray_background_co notion-block-f1426825f01e47dbbef75c73ec08ceff"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="⚠️">⚠️</span></div><div class="notion-callout-text">自8月左右新版本的 AX3000T 设备（固件版本为 1.0.84 或更高版本），已换用新的硬件（AN8855 交换机），暂时与 OpenWrt 官方原版镜像不兼容，需等待适配。<div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-f682c2d3c5754aa5b5352174b4a2c848" href="https://forum.openwrt.org/t/openwrt-support-for-xiaomi-ax3000t/180490/1176"><div><div class="notion-bookmark-title">OpenWrt support for Xiaomi AX3000T</div><div class="notion-bookmark-description">New devices 1.0.84+ now with new hardware AN8855: a 5-port giga switch with 1 HSGMII port5 as the CPU port.  Here official commit:  https://git01.mediatek.com/plugins/gitiles/openwrt/feeds/mtk-openwrt-feeds/+/ac95e9fe1b014ad01c18256465f6519696858fbf  We need to build this version with  CONFIG_AN8855_GSW=y</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fforum.openwrt.org%2Fuploads%2Fdefault%2Foptimized%2F3X%2F0%2Fb%2F0be226be0af76ed16c229fa402d72b8a7f7266d5_2_32x32.png?table=block&amp;id=f682c2d3-c575-4aa5-b535-2174b4a2c848&amp;cache=v2" alt="OpenWrt support for Xiaomi AX3000T" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://forum.openwrt.org/t/openwrt-support-for-xiaomi-ax3000t/180490/1176</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fforum.openwrt.org%2Fuploads%2Fdefault%2Foriginal%2F3X%2F2%2F9%2F2965b316403db302c535cae40139e8c49bbad6e3.png?table=block&amp;id=f682c2d3-c575-4aa5-b535-2174b4a2c848&amp;cache=v2" alt="OpenWrt support for Xiaomi AX3000T" loading="lazy" decoding="async"/></div></a></div><div class="notion-text notion-block-62750f4eab2e4395b8fb80b711746a70">若在此类设备上通过小米路由器修复工具降级系统版本，后续路由器的有线网口将表现为交换机工作模式，不能通过一般 Wan 口接入宽带网络。
<s>除非只使用原厂固件，否则建议及时退换货。</s></div><hr class="notion-hr notion-block-13c710e01307803d832af408d05edd6f"/><div class="notion-blank notion-block-13c710e0130780898b3dd944c6f19577"> </div><details class="notion-toggle notion-block-13c710e0130780d6afdbf53b2120bcfd"><summary><b>已有支持 1.0.84 版本的 OpenWrt 固件了，按照本文方法，但将固件替换为如下引用帖子中的即可（展开查看</b></summary><div><blockquote class="notion-quote notion-block-06ec51afc5c6498996430e4c674fab18"><div>添加 Winbond W25N01KV 支持
添加 Foresee spinand 支持
添加 switch-an8855 驱动程序（由 @linaro 提供）</div></blockquote><div class="notion-text notion-block-13e710e0130780049be1f5ce0dea8aeb">下载:：</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-13e710e0130780f29336f793ce433b01" href="https://drive.google.com/drive/folders/1Crh7Hkv1TOlvaSw8aP5a7IJJDiU_2ULR/1ykA3U2P5NgjMMCjMQz_Swd3pKaxLTVPK/1SgnJHSIBslsRcV9n3HFYxbaaLBRkHzGT/1zlm-UoXC0YH4lT7Ph5ITnOFZHaFc79UJ"><div><div class="notion-bookmark-title">openwrt-23.05.5-xiaomi_ax3000t-2024-11-11 - Google Drive</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fssl.gstatic.com%2Fdocs%2Fdoclist%2Fimages%2Fdrive_2022q3_32dp.png?table=block&amp;id=13e710e0-1307-80f2-9336-f793ce433b01&amp;cache=v2" alt="openwrt-23.05.5-xiaomi_ax3000t-2024-11-11 - Google Drive" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://drive.google.com/drive/folders/1Crh7Hkv1TOlvaSw8aP5a7IJJDiU_2ULR/1ykA3U2P5NgjMMCjMQz_Swd3pKaxLTVPK/1SgnJHSIBslsRcV9n3HFYxbaaLBRkHzGT/1zlm-UoXC0YH4lT7Ph5ITnOFZHaFc79UJ</div></div></div></a></div><div class="notion-text notion-block-69a070508d4c4291ab6a11d295b6be2e">原帖：</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-42d5a94db87a4da8a9ba937e5102f03d" href="https://forum.openwrt.org/t/openwrt-support-for-xiaomi-ax3000t/180490/1817"><div><div class="notion-bookmark-title">OpenWrt support for Xiaomi AX3000T</div><div class="notion-bookmark-description">I builded OpenWrt 23.05.5 (241014) with many patches:   add Winbond W25N01KV support add Foresee spinand support add switch-an8855 driver (by @linaro) fix mtk_eth_soc : https://github.com/openwrt/openwrt/pull/16419  All patches: https://github.com/openwrt-xiaomi/openwrt/commits/xq-23.05.5/  Download: https://drive.google.com/drive/folders/1Crh7Hkv1TOlvaSw8aP5a7IJJDiU_2ULR</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fforum.openwrt.org%2Fuploads%2Fdefault%2Foptimized%2F3X%2F0%2Fb%2F0be226be0af76ed16c229fa402d72b8a7f7266d5_2_32x32.png?table=block&amp;id=42d5a94d-b87a-4da8-a9ba-937e5102f03d&amp;cache=v2" alt="OpenWrt support for Xiaomi AX3000T" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://forum.openwrt.org/t/openwrt-support-for-xiaomi-ax3000t/180490/1817</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fforum.openwrt.org%2Fuploads%2Fdefault%2Foriginal%2F3X%2F2%2F9%2F2965b316403db302c535cae40139e8c49bbad6e3.png?table=block&amp;id=42d5a94d-b87a-4da8-a9ba-937e5102f03d&amp;cache=v2" alt="OpenWrt support for Xiaomi AX3000T" loading="lazy" decoding="async"/></div></a></div><div class="notion-text notion-block-d71d329058a24f5d960b8c6564adc52d">恩山论坛：</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-8003110029334dc7894914f5e3146ddc" href="https://www.right.com.cn/forum/thread-8402530-1-1.html"><div><div class="notion-bookmark-title">[AX3000T] 24年8月之后的新芯片 AX3000T 也可以刷 OpenWRT 了-小米无线路由器及小米网络设备-恩山无线论坛</div><div class="notion-bookmark-description">OpenWRT 论坛里的原讨论帖指路: https://forum.openwrt.org/t/open ... ax3000t/180490/1817 remittor 大佬把 AN8855 交换机芯片的驱动加进了代码中，进而支持了新款 AX30 ...</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fwww.right.com.cn%2Ffavicon.ico?table=block&amp;id=80031100-2933-4dc7-8949-14f5e3146ddc&amp;cache=v2" alt="[AX3000T] 24年8月之后的新芯片 AX3000T 也可以刷 OpenWRT 了-小米无线路由器及小米网络设备-恩山无线论坛" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://www.right.com.cn/forum/thread-8402530-1-1.html</div></div></div></a></div></div></details><div class="notion-blank notion-block-13c710e013078022aa2ccae5d66fd37c"> </div></div></div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-9c58ae609ba54698b8ee07a8084a54d9" data-id="9c58ae609ba54698b8ee07a8084a54d9"><span><div id="9c58ae609ba54698b8ee07a8084a54d9" class="notion-header-anchor"></div><a class="notion-hash-link" href="#9c58ae609ba54698b8ee07a8084a54d9" title="前言"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">前言</span></span></h3><div class="notion-text notion-block-abd4c7e5f3db429cb99f9c775cfad1e3">小米路由器从刚开始推出时的争议吐槽不断到现在一路走过来隐隐成了性价比之选。在此前曾使用过小米路由器mini、红米AC2100、红米AX6(S)等热门型号机器，整体体验还是很不错的，<s>尤其是在刷了 OpenWrt 之后</s>（hhh 😂） 。</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-e16fa675b2b14b1db7ac12438aea7882" href="https://u.jd.com/hsF3sbt"><div><div class="notion-bookmark-title">京东网上商城</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-text">https://u.jd.com/hsF3sbt</div></div></div></a></div><div class="notion-text notion-block-ae7ad4fd88d845b4999b56caa6c01456">小米 AX3000T 路由作为一款入门级的 Wi-Fi 6 路由，使用了发哥（联发科）的方案，正是继红米 AX6S 之后的又一款热门路由。但硬件虽好，软件并不能满足我的需求，下面是将其整成 OpenWrt 固件的记录。</div><details class="notion-toggle notion-block-df73a89401d1490ab6331b755dbeb599"><summary>展开 小米 AX3000T 基础配置信息</summary><div><blockquote class="notion-quote notion-block-6f9869aeaf714a1cb9084b313678f99a"><div>CPU :  联发科 FiLogic 820系列的MT7981（12nm 双核A53架构，12nm工艺制程，1.3GHz主频）</div></blockquote><blockquote class="notion-quote notion-block-7c018b167d274ceeb1d32c63cd24b2a9"><div>ROM :  128MB </div></blockquote><blockquote class="notion-quote notion-block-13c0df060f7d405e8326b376a164e058"><div>RAM :  256MB</div></blockquote><blockquote class="notion-quote notion-block-68385afe0e574d7c8b4b88458e18f5f8"><div>网络 : 4个自适应千兆口，天线数量4根（其中一根为 5GHz 和 2.4GHz 共用）支持 Wi-Fi 6 160MHz频宽</div></blockquote></div></details><div class="notion-blank notion-block-c9fd08962fc943428f75c5a2c386c9b2"> </div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-a9e56cacdde8484f9687f320229393d5" data-id="a9e56cacdde8484f9687f320229393d5"><span><div id="a9e56cacdde8484f9687f320229393d5" class="notion-header-anchor"></div><a class="notion-hash-link" href="#a9e56cacdde8484f9687f320229393d5" title="过程记录"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">过程记录</span></span></h3><div class="notion-callout notion-gray_background_co notion-block-127710e0130780bda993ea1b70fab52f"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="ℹ️">ℹ️</span></div><div class="notion-callout-text"><div class="notion-text notion-block-f2cd43ab2a754c579447560b0c65a955">如有刷入 U-Boot 的需求，请查阅</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-127710e013078031bf88c05b0c5a29b5" href="https://okhk.net/xiaomi-ax3000t-router-with-hanwckf-immortalwrt"><div><div class="notion-bookmark-title">HK&#x27;s note ✨ 小米 AX3000T 路由器使用 hanwckf 版本的 ImmortalWrt 和 U-Boot</div><div class="notion-bookmark-description">文章介绍了如何为小米 AX3000T 路由器使用 hanwckf 版本的 ImmortalWrt 和 U-Boot 固件进行刷入。此外可以通过 GitHub Action 编译固件为特定设备定制固件。</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fokhk.net%2Ffavicon.png?table=block&amp;id=127710e0-1307-8031-bf88-c05b0c5a29b5&amp;cache=v2" alt="HK&#x27;s note ✨ 小米 AX3000T 路由器使用 hanwckf 版本的 ImmortalWrt 和 U-Boot" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://okhk.net/xiaomi-ax3000t-router-with-hanwckf-immortalwrt</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fokhk.net%2Fapi%2Fog%3Ftitle%3DHK&#x27;s%2520note%2520%25E2%259C%25A8%2520%25E5%25B0%258F%25E7%25B1%25B3%2520AX3000T%2520%25E8%25B7%25AF%25E7%2594%25B1%25E5%2599%25A8%25E4%25BD%25BF%25E7%2594%25A8%2520hanwckf%2520%25E7%2589%2588%25E6%259C%25AC%25E7%259A%2584%2520ImmortalWrt%2520%25E5%2592%258C%2520U-Boot%26description%3D%25E6%2596%2587%25E7%25AB%25A0%25E4%25BB%258B%25E7%25BB%258D%25E4%25BA%2586%25E5%25A6%2582%25E4%25BD%2595%25E4%25B8%25BA%25E5%25B0%258F%25E7%25B1%25B3%2520AX3000T%2520%25E8%25B7%25AF%25E7%2594%25B1%25E5%2599%25A8%25E4%25BD%25BF%25E7%2594%25A8%2520hanwckf%2520%25E7%2589%2588%25E6%259C%25AC%25E7%259A%2584%2520ImmortalWrt%2520%25E5%2592%258C%2520U-Boot%2520%25E5%259B%25BA%25E4%25BB%25B6%25E8%25BF%259B%25E8%25A1%258C%25E5%2588%25B7%25E5%2585%25A5%25E3%2580%2582%25E6%25AD%25A4%25E5%25A4%2596%25E5%258F%25AF%25E4%25BB%25A5%25E9%2580%259A%25E8%25BF%2587%2520GitHub%2520Action%2520%25E7%25BC%2596%25E8%25AF%2591%25E5%259B%25BA%25E4%25BB%25B6%25E4%25B8%25BA%25E7%2589%25B9%25E5%25AE%259A%25E8%25AE%25BE%25E5%25A4%2587%25E5%25AE%259A%25E5%2588%25B6%25E5%259B%25BA%25E4%25BB%25B6%25E3%2580%2582?table=block&amp;id=127710e0-1307-8031-bf88-c05b0c5a29b5&amp;cache=v2" alt="HK&#x27;s note ✨ 小米 AX3000T 路由器使用 hanwckf 版本的 ImmortalWrt 和 U-Boot" loading="lazy" decoding="async"/></div></a></div></div></div><div class="notion-text notion-block-c3e72842552c42368a56c83e39fda8ff">整个刷入过程主要分为以下几步：</div><ol start="1" class="notion-list notion-list-numbered notion-block-4b8847b72ac24d90accfc593c4db00cb" style="list-style-type:decimal"><li>降级系统至旧版本（版本号 1.0.47，该版本存在漏洞可开启 SSH）</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-bc1d9e9d25b74a06823b0af0a4851b9d" style="list-style-type:decimal"><li>获取 stok 值，执行命令请求开启 SSH 访问权限</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-3ab3c50dc49743abb1a1aeb7b39fff92" style="list-style-type:decimal"><li>登录 SSH ，<b>备份</b>原始分区</li></ol><ol start="4" class="notion-list notion-list-numbered notion-block-2fc6d448126047418bb33ebc73595eeb" style="list-style-type:decimal"><li>刷入 OpenWrt initramfs system</li></ol><ol start="5" class="notion-list notion-list-numbered notion-block-0ee85371ac3c42faa044ebce52bc7a3d" style="list-style-type:decimal"><li>进入 OpenWrt initramfs system 升级 OpenWrt 正式固件</li></ol><div class="notion-blank notion-block-cefed5a9d06e40299bd8da1bc862e077"> </div><div class="notion-callout notion-gray_background_co notion-block-fc6dcacac83a44eab5d8a1b9254e41bc"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text">开启 SSH 也可以看看这个针对小米路由器开源项目<div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-c6ba98a21645418cb45e0ca80cc2ace7" href="https://github.com/openwrt-xiaomi/xmir-patcher"><div><div class="notion-bookmark-title">GitHub - openwrt-xiaomi/xmir-patcher: Firmware patcher for Xiaomi routers</div><div class="notion-bookmark-description">Firmware patcher for Xiaomi routers. Contribute to openwrt-xiaomi/xmir-patcher development by creating an account on GitHub.</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=c6ba98a2-1645-418c-b45e-0ca80cc2ace7&amp;cache=v2" alt="GitHub - openwrt-xiaomi/xmir-patcher: Firmware patcher for Xiaomi routers" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/openwrt-xiaomi/xmir-patcher</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2F0443c29f009962fec6a78bcc43588d69f2a45ec31766e471717198d5e243135d%2Fopenwrt-xiaomi%2Fxmir-patcher?table=block&amp;id=c6ba98a2-1645-418c-b45e-0ca80cc2ace7&amp;cache=v2" alt="GitHub - openwrt-xiaomi/xmir-patcher: Firmware patcher for Xiaomi routers" loading="lazy" decoding="async"/></div></a></div></div></div><div class="notion-blank notion-block-16542b569703476dabbdb1abcfe1ae9f"> </div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-0cc24c322eae4261975171309b5d1eb6" data-id="0cc24c322eae4261975171309b5d1eb6"><span><div id="0cc24c322eae4261975171309b5d1eb6" class="notion-header-anchor"></div><a class="notion-hash-link" href="#0cc24c322eae4261975171309b5d1eb6" title="安装降级固件"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">安装降级固件</span></span></h4><details class="notion-toggle notion-block-f180d7581a2449868c305b94b2caf001"><summary>⬇️ 下载降级固件</summary><div><div class="notion-text notion-block-7e9fcb023f6d4149bfcdf73085fa2b76"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://cdn.cnbj1.fds.api.mi-img.com/xiaoqiang/rom/rd03/miwifi_rd03_firmware_ef0ee_1.0.47.bin">https://cdn.cnbj1.fds.api.mi-img.com/xiaoqiang/rom/rd03/miwifi_rd03_firmware_ef0ee_1.0.47.bin</a></div></div></details><div class="notion-text notion-block-e9013eaadaab4d1db483c38c5be19e9b">此处需要用到小米路由器修复工具，仅支持 Windows。下载地址：</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-a7cf7c35d31145c5bcbcedb84770b1ef" href="http://miwifi.com/miwifi_download.html"><div><div class="notion-bookmark-title">MiWiFi – 下载</div><div class="notion-bookmark-description">小米路由器——顶配双频AC智能路由器，内置1TB大硬盘；小米路由器mini——主流双频AC智能路由器，性价比之王；小米随身wifi——最便捷的随身上网神器</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/http%3A%2F%2Fmiwifi.com%2Ffavicon2.ico?table=block&amp;id=a7cf7c35-d311-45c5-bcbc-edb84770b1ef&amp;cache=v2" alt="MiWiFi – 下载" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">http://miwifi.com/miwifi_download.html</div></div></div></a></div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-9fc4cea79aa94bf48dddfb015bc2e04a"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2F139a11f6-5b88-4ebf-b3ba-f847270dd477%2Fimage.png%3Ftable%3Dblock%26id%3D9fc4cea7-9aa9-4bf4-8ddd-fb015bc2e04a%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3D5NQ2tnpPGmNV3K-n-bSUH2FzG7JumIIwN8bM9gvZOaY?table=block&amp;id=9fc4cea7-9aa9-4bf4-8ddd-fb015bc2e04a&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-2c98b4664a6f4559bc2d6e3e0665229f">下载并运行此修复工具，选择上面👆下载的降级固件（版本 1.0.47），然后选中要使用的网卡，此处建议将其他网卡都先关闭以避免干扰，只保留物理网口对应的以太网网卡即可。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-d059f1ee0a9647cf87b2e572dfe4a5d2"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2F69168900-461a-492f-bca0-7d3fcbf4925c%2F1000008428.jpg%3Ftable%3Dblock%26id%3Dd059f1ee-0a96-47cf-87b2-e572dfe4a5d2%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3Da5gw74bDbWqq-zTh09UNhFitvdLk85RW23Zdd_k5Goc?table=block&amp;id=d059f1ee-0a96-47cf-87b2-e572dfe4a5d2&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-a8385f6df49b44d887e6112108f6379e">按修复工具的提示逐步操作，到如下界面时：断开路由器电源，用网线将路由器网口和电脑网口连接。然后用牙签或卡针顶住路由器上的 reset 按键，保持不松开。此时再插上电源，约莫8秒左右直到路由器指示灯开始快速闪烁，即可松开 reset 键。修复工具会接收到路由器的请求开始恢复固件。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-39a2bcd5cb73453b8294be515d20327c"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2Fdae3ce2a-4b09-454d-b754-a4b630c0dbd2%2F1000008430.jpg%3Ftable%3Dblock%26id%3D39a2bcd5-cb73-453b-8294-be515d20327c%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3D1dYJR1nyUQY3BZPgWF8OBNqReJNQVEWktDRkZQ5BC3s?table=block&amp;id=39a2bcd5-cb73-453b-8294-be515d20327c&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-0abf5ef1fb6a4062b568fe0b369945c4">稍等一会儿恢复完成后，即可重新给路由器上电，进入系统后查看已经降级成功，如下图所示。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-b12871867f884cafb8a9aa5fb9166d1a"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2F82833140-d400-4f7b-9683-c020618c5d30%2Fimage.png%3Ftable%3Dblock%26id%3Db1287186-7f88-4caf-b8a9-aa5fb9166d1a%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3DP8pxlZ3hvwZ3JhkELsFgaMqoVQSNUByNhfAgHz2YRMc?table=block&amp;id=b1287186-7f88-4caf-b8a9-aa5fb9166d1a&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-cebe78e76f8e4ae18bec92387995da60" data-id="cebe78e76f8e4ae18bec92387995da60"><span><div id="cebe78e76f8e4ae18bec92387995da60" class="notion-header-anchor"></div><a class="notion-hash-link" href="#cebe78e76f8e4ae18bec92387995da60" title="获取 stok 值"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">获取 stok 值</span></span></h4><div class="notion-text notion-block-f7de0ae701f64c76b8bfcb0bdf018d25">登录路由器 Web 管理后台（默认为 <a target="_blank" rel="noopener noreferrer" class="notion-link" href="http://192.168.31.1">http://192.168.31.1</a> ），获取 <code class="notion-inline-code">stok</code> 值——下图中红框所标识的字符串。</div><div class="notion-callout notion-gray_background_co notion-block-b4822a65febb47538304285d41cbc99e"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="👉">👉</span></div><div class="notion-callout-text"><b>每次路由器重启， </b><code class="notion-inline-code"><b>stok</b></code><b> 值都会改变</b></div></div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-7c0f96b86cf64daaadfd6a1cb33dd2e9"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:159.0825043885313px"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2F0a1d23ab-5d3e-4226-862e-89e0d9d9e935%2F0cb84116-2eb2-4c7e-b128-732b826c112f.png%3Ftable%3Dblock%26id%3D7c0f96b8-6cf6-4daa-adfd-6a1cb33dd2e9%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3Dx7o4wA4eA6GZinC1NL2CEhkjbI3_dEY6QZmweCeSBbk?table=block&amp;id=7c0f96b8-6cf6-4daa-adfd-6a1cb33dd2e9&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-blank notion-block-0bdb263032484103bb0d321e873f6178"> </div><details class="notion-toggle notion-block-16f96a09541f488494b262019312540e"><summary><s>查询路由器初始密码</s>（后续命令会设置 root 密码，此处无需进行了）</summary><div><div class="notion-text notion-block-29c5890c235644f2b7dd18027e79c384"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://miwifi.dev/ssh">https://miwifi.dev/ssh</a> ，输入序列号即可获取对应密码，序列号在 Web 管理页面下方可查看，</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-235f0e727f9141ca8769c75e3099919c" href="https://miwifi.dev/ssh"><div><div class="notion-bookmark-title">Xiaomi Router Developer Guide &amp; Tools</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fmiwifi.dev%2Ffavicon.ico?table=block&amp;id=235f0e72-7f91-41ca-8769-c75e3099919c&amp;cache=v2" alt="Xiaomi Router Developer Guide &amp; Tools" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://miwifi.dev/ssh</div></div></div></a></div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-5909410738bc407695661b92cc299295"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2Fe1117334-222d-4afb-a5b2-14fde6ae136e%2Fimage.png%3Ftable%3Dblock%26id%3D59094107-38bc-4076-9566-1b92cc299295%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3DXmoRijdjJrnm2D8bdkGYIqCktCahmcWaGP-Z8o1IHGE?table=block&amp;id=59094107-38bc-4076-9566-1b92cc299295&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure></div></details><div class="notion-blank notion-block-bcf09a5211134ee5b67e19d81dfe2141"> </div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30b156a782734dd8b32db9875763260b" data-id="30b156a782734dd8b32db9875763260b"><span><div id="30b156a782734dd8b32db9875763260b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30b156a782734dd8b32db9875763260b" title="启用 SSH 权限"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">启用 SSH 权限</span></span></h4><div class="notion-text notion-block-35402396f9694f8e8061d650517c51ed">打开命令行工具（Terminal）依次执行如下 <code class="notion-inline-code">curl</code> 请求，其中需要将上文中获取到的 <code class="notion-inline-code">stok</code> 值替换。（若是路由器 IP 和我一样有变化的，也需要将其中的 192.168.31.1 进行替换）</div><ul class="notion-list notion-list-disc notion-block-c43fc395c9fa4c10a93768d8af762164"><li>开启 SSH 配置</li></ul><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">curl -X POST http://192.168.31.1/cgi-bin/luci/;stok=此处替换为上面记录的stok值/api/misystem/arn_switch -d &quot;open=1&amp;model=1&amp;level=%0Anvram%20set%20ssh_en%3D1%0A&quot;</code></pre><ul class="notion-list notion-list-disc notion-block-d77062c665de49d0a95fd92de1fbd0ee"><li>提交配置</li></ul><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">curl -X POST http://192.168.31.1/cgi-bin/luci/;stok=此处替换为上面记录的stok值/api/misystem/arn_switch -d &quot;open=1&amp;model=1&amp;level=%0Anvram%20commit%0A&quot;</code></pre><ul class="notion-list notion-list-disc notion-block-498a57f5ccb34e0495614b42e683b0f1"><li>设置 dropbear SSH 为 debug</li></ul><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">curl -X POST http://192.168.31.1/cgi-bin/luci/;stok=此处替换为上面记录的stok值/api/misystem/arn_switch -d &quot;open=1&amp;model=1&amp;level=%0Ased%20-i%20&#x27;s%2Fchannel%3D.*%2Fchannel%3D%22debug%22%2Fg&#x27;%20%2Fetc%2Finit.d%2Fdropbear%0A&quot;</code></pre><ul class="notion-list notion-list-disc notion-block-3d50041638bc4e10a423019000e354e9"><li>启动 dropbear SSH</li></ul><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">curl -X POST http://192.168.31.1/cgi-bin/luci/;stok=此处替换为上面记录的stok值/api/misystem/arn_switch -d &quot;open=1&amp;model=1&amp;level=%0A%2Fetc%2Finit.d%2Fdropbear%20start%0A&quot;</code></pre><ul class="notion-list notion-list-disc notion-block-48441487ec354153885d5f4af186ea90"><li>设置 root 密码为空</li></ul><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">curl -X POST &quot;http://192.168.31.1/cgi-bin/luci/;stok=此处替换为上面记录的stok值/api/misystem/arn_switch&quot; -d &quot;open=1&amp;model=1&amp;level=%0Apasswd%20-d%20root%0A&quot;
</code></pre><div class="notion-text notion-block-a81e89416b5d4a4c9fb56f07d7a587cc">以上命令执行成功，则会响应<code class="notion-inline-code"> {“code”: 0}</code> ，如为其他则请检查 <code class="notion-inline-code">stok</code> 或 IP 地址是否正确替换了</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-b6eab70cb621434d99ebbf5d05ed305e"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2F7c1bad32-baac-4994-b4bf-25ba3a620599%2Fimage.png%3Ftable%3Dblock%26id%3Db6eab70c-b621-434d-99eb-bf5d05ed305e%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3DCMtH0IXFHGgrvq9K_o8hvah3AbU2qOFEL9mWLzGQ2Xw?table=block&amp;id=b6eab70c-b621-434d-99eb-bf5d05ed305e&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><details class="notion-toggle notion-block-cea6eb7d453b4b008d93fa6d737b3b41"><summary>👇 整合的 shell 脚本</summary><div><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">#!/bin/bash

if [ &quot;$1&quot; = &quot;&quot; ]; then
  echo &quot;Usage: $0 [stok]&quot;
  echo &quot;e.g. $0 84f8bce46164e9e0296ad38086cd8472&quot;
  echo &quot;登录Web后台后，从浏览器地址栏复制 stok 字符串&quot;
  exit 1
fi

curl -X POST &quot;http://192.168.31.1/cgi-bin/luci/;stok=${1}/api/misystem/arn_switch&quot; -d &quot;open=1&amp;model=1&amp;level=%0Anvram%20set%20ssh_en%3D1%0A&quot;
sleep 1
curl -X POST &quot;http://192.168.31.1/cgi-bin/luci/;stok=${1}/api/misystem/arn_switch&quot; -d &quot;open=1&amp;model=1&amp;level=%0Anvram%20commit%0A&quot;
sleep 1
curl -X POST &quot;http://192.168.31.1/cgi-bin/luci/;stok=${1}/api/misystem/arn_switch&quot; -d &quot;open=1&amp;model=1&amp;level=%0Ased%20-i%20&#x27;s%2Fchannel%3D.*%2Fchannel%3D%22debug%22%2Fg&#x27;%20%2Fetc%2Finit.d%2Fdropbear%0A&quot;
sleep 1
curl -X POST &quot;http://192.168.31.1/cgi-bin/luci/;stok=${1}/api/misystem/arn_switch&quot; -d &quot;open=1&amp;model=1&amp;level=%0A%2Fetc%2Finit.d%2Fdropbear%20start%0A&quot;
sleep 1
curl -X POST &quot;http://192.168.31.1/cgi-bin/luci/;stok=${1}/api/misystem/arn_switch&quot; -d &quot;open=1&amp;model=1&amp;level=%0Apasswd%20-d%20root%0A&quot;</code></pre></div></details><div class="notion-blank notion-block-80feddcde9ac46ca8b3e626f7d5036ca"> </div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-222e5bc9ea6c4af59270de7b6f224183" data-id="222e5bc9ea6c4af59270de7b6f224183"><span><div id="222e5bc9ea6c4af59270de7b6f224183" class="notion-header-anchor"></div><a class="notion-hash-link" href="#222e5bc9ea6c4af59270de7b6f224183" title="SSH 登录"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">SSH 登录</span></span></h4><div class="notion-text notion-block-4c83c22313ee4c9cbf5f2154a56c85db">在上一步，我们已经成功开启了 SSH，下面使用 SSH 登录路由器，开始操作。</div><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">ssh root@192.168.31.1</code></pre><div class="notion-callout notion-gray_background_co notion-block-1a16d1307bec4575bdcd2eb6a90b37ed"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="👀">👀</span></div><div class="notion-callout-text">我在第一次连接时报错：<figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-47205cf180514a95bbbf228bfdbcd014"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2F8ab9566a-7742-4eb4-8501-c29501b00b10%2Fimage.png%3Ftable%3Dblock%26id%3D47205cf1-8051-4a95-bbbf-228bfdbcd014%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3Dtca-mnQLt2BZZ5YHAQmkaM1Rb6UbOIRheB58mwC6elM?table=block&amp;id=47205cf1-8051-4a95-bbbf-228bfdbcd014&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-70b01f8277d3448aba133bd0d8482294">这是加密算法不匹配导致，需要配置启用 ssh-rsa 。修改 <code class="notion-inline-code">~/.ssh/config</code> ,添加内容如下：</div><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">  Host ax3000t
  HostName 192.168.31.1
  Port 22
  User root
  HostKeyAlgorithms +ssh-rsa</code></pre><div class="notion-text notion-block-a3216d71aa2648a5a8f96b46039ce38e">然后使用命令 <code class="notion-inline-code">ssh ax3000t </code>连接即可。
或者不配置上述文件使用命令 <code class="notion-inline-code">ssh -oHostKeyAlgorithms=+ssh-rsa root@192.168.31.1</code></div></div></div><div class="notion-text notion-block-c8f6c2d4da61463a860487a6ea830b2e">此时终于看到熟悉的 “Are you OK” 了</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-9240e12c5f0b47bfaaf53377a674f863"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2Fde9a6f16-8aeb-430c-8363-e4e07010f1f6%2Fimage.png%3Ftable%3Dblock%26id%3D9240e12c-5f0b-47bf-aaf5-3377a674f863%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3D24BkWKbeuRFVlgnYO7eBmYBeRnkhoarJIMV9lG_AcRc?table=block&amp;id=9240e12c-5f0b-47bf-aaf5-3377a674f863&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-blank notion-block-9de407125c3a40a8a00ae2fbed0b86ad"> </div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-b24587ffb83d46269218635794e1976f" data-id="b24587ffb83d46269218635794e1976f"><span><div id="b24587ffb83d46269218635794e1976f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#b24587ffb83d46269218635794e1976f" title="备份"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">备份</span></span></h4><div class="notion-text notion-block-c138b817ff63477d9ddf3e9b70598173">备份原厂分区信息</div><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">mkdir /tmp/bak
nanddump -f /tmp/bak/BL2.bin /dev/mtd1
nanddump -f /tmp/bak/Nvram.bin /dev/mtd2
nanddump -f /tmp/bak/Bdata.bin /dev/mtd3
nanddump -f /tmp/bak/Factory.bin /dev/mtd4
nanddump -f /tmp/bak/FIP.bin /dev/mtd5
nanddump -f /tmp/bak/ubi.bin /dev/mtd8
nanddump -f /tmp/bak/KF.bin /dev/mtd12</code></pre><div class="notion-text notion-block-8ed899cd5e13452bb838a413fc66a8da">导出之后将其传输至其他的存储设备上。在电脑端执行</div><div class="notion-text notion-block-00f7ba4100da4cf4ace3d800de02b802"><code class="notion-inline-code">scp -O -r ax3000t:/tmp/bak/ .</code></div><div class="notion-callout notion-gray_background_co notion-block-77f66dfde24044f393425415a036f40a"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text">其中 <code class="notion-inline-code">-O</code> 参数为设置 scp 传输模式为传统方式，不然会报错。报错原因是 openssh 9.0 及之后版本，scp 命令默认传输使用的是 SFTP 协议，而路由器是不支持的。</div></div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-20cef5a36a9e404db68406fe954aa82d"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2F9d09ea8d-224d-4495-9fd3-7f5709a77f22%2Fimage.png%3Ftable%3Dblock%26id%3D20cef5a3-6a9e-404d-b684-06fe954aa82d%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3Dp04xTGXqfaQmiKt45JYaC-pnM9D9k2VSY0Kb6obvbm0?table=block&amp;id=20cef5a3-6a9e-404d-b684-06fe954aa82d&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-09bd302c11f741cb908939fdfda2e04e" data-id="09bd302c11f741cb908939fdfda2e04e"><span><div id="09bd302c11f741cb908939fdfda2e04e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#09bd302c11f741cb908939fdfda2e04e" title="OpenWrt / ImmortalWrt 固件下载"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">OpenWrt / ImmortalWrt 固件下载</span></span></h4><div class="notion-text notion-block-52ce0aa98c3c4876a3c38242863714ad">ImmortalWrt 是一个针对国人用户开发的基于 OpenWrt 的分支固件。</div><div class="notion-text notion-block-3aaf3831b0e94567b15527bde1f83f1b">根据实际需要选择相应的固件即可，后续描述以 ImmortalWrt 为例，如需刷入 OpenWrt ，替换掉相应的文件即可。</div><details class="notion-toggle notion-block-e17bd81bc4544cf99f98806269b1ffe9"><summary>OpenWrt: </summary><div><div class="notion-text notion-block-517b9df88a794ce39421299f0e59556c">固件：</div><ul class="notion-list notion-list-disc notion-block-ba925126c6cc4012be97507a23ca066e"><li><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://downloads.openwrt.org/releases/23.05.4/targets/mediatek/filogic/openwrt-23.05.4-mediatek-filogic-xiaomi_mi-router-ax3000t-initramfs-factory.ubi">https://downloads.openwrt.org/releases/23.05.4/targets/mediatek/filogic/openwrt-23.05.4-mediatek-filogic-xiaomi_mi-router-ax3000t-initramfs-factory.ubi</a></li></ul><ul class="notion-list notion-list-disc notion-block-5bce2be2a2c14c90a504b22d137f7eaf"><li><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://downloads.openwrt.org/releases/23.05.4/targets/mediatek/filogic/openwrt-23.05.4-mediatek-filogic-xiaomi_mi-router-ax3000t-squashfs-sysupgrade.bin">https://downloads.openwrt.org/releases/23.05.4/targets/mediatek/filogic/openwrt-23.05.4-mediatek-filogic-xiaomi_mi-router-ax3000t-squashfs-sysupgrade.bin</a></li></ul></div></details><div class="notion-blank notion-block-3381292eea8944feab79199673f06e87"> </div><details class="notion-toggle notion-block-df555fd0fa5349989f58cb3fc53b2842"><summary>ImmortalWrt:  </summary><div><div class="notion-text notion-block-32d6446273ff45338fb49f7545f6d13d">固件：</div><ul class="notion-list notion-list-disc notion-block-d3768a15b74c4ecd9eee07cbfcfc4777"><li><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://downloads.immortalwrt.org/releases/23.05.3/targets/mediatek/filogic/immortalwrt-23.05.3-mediatek-filogic-xiaomi_mi-router-ax3000t-initramfs-factory.ubi">https://downloads.immortalwrt.org/releases/23.05.3/targets/mediatek/filogic/immortalwrt-23.05.3-mediatek-filogic-xiaomi_mi-router-ax3000t-initramfs-factory.ubi</a></li></ul><ul class="notion-list notion-list-disc notion-block-a184a562f5804e889934bd26bc337849"><li><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://downloads.immortalwrt.org/releases/23.05.3/targets/mediatek/filogic/immortalwrt-23.05.3-mediatek-filogic-xiaomi_mi-router-ax3000t-squashfs-sysupgrade.bin">https://downloads.immortalwrt.org/releases/23.05.3/targets/mediatek/filogic/immortalwrt-23.05.3-mediatek-filogic-xiaomi_mi-router-ax3000t-squashfs-sysupgrade.bin</a></li></ul></div></details><div class="notion-blank notion-block-667799d857ca46e8acceceb8ef0e2d71"> </div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-bc83ac49b72141249be03e21c78acaea" data-id="bc83ac49b72141249be03e21c78acaea"><span><div id="bc83ac49b72141249be03e21c78acaea" class="notion-header-anchor"></div><a class="notion-hash-link" href="#bc83ac49b72141249be03e21c78acaea" title="刷入 initramfs system"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">刷入 initramfs system</span></span></h4><div class="notion-text notion-block-b1b40f75b5f04b0d90e273bc385bcb75">将文件要刷入的文件上传到路由器 /tmp 目录</div><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">scp -O immortalwrt-23.05.3-mediatek-filogic-xiaomi_mi-router-ax3000t-initramfs-factory.ubi ax3000t:/tmp/</code></pre><div class="notion-text notion-block-7a8e55e4a59e49d48679ed0651f015b4">查看硬件信息：<code class="notion-inline-code">cat /proc/cmdline</code>，视情况执行下面的命令</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-0a9b99e9f9c14a4f9695d5e3a2733d2f"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2F42104ee0-879c-46de-8c28-302da9842d74%2Fimage.png%3Ftable%3Dblock%26id%3D0a9b99e9-f9c1-4a4f-9695-d5e3a2733d2f%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3DtQ2KgcFmJAbEuoGOkPUrJP1MPUB173BF59F0c38c3lY?table=block&amp;id=0a9b99e9-f9c1-4a4f-9695-d5e3a2733d2f&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><details class="notion-toggle notion-block-20dcbd39331747d2a5ebcc58bc583427"><summary><b>firmware = 0 时（此处为我的情况）：</b></summary><div><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">ubiformat /dev/mtd9 -y -f /tmp/immortalwrt-23.05.3-mediatek-filogic-xiaomi_mi-router-ax3000t-initramfs-factory.ubi
nvram set boot_wait=on
nvram set uart_en=1
nvram set flag_boot_rootfs=1
nvram set flag_last_success=1
nvram set flag_boot_success=1
nvram set flag_try_sys1_failed=0
nvram set flag_try_sys2_failed=0
nvram commit
reboot</code></pre></div></details><details class="notion-toggle notion-block-da1f4f2e2f9f40a8843da339d714dbc1"><summary><b>firmware = 1 时：</b></summary><div><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">ubiformat /dev/mtd8 -y -f /tmp/immortalwrt-23.05.3-mediatek-filogic-xiaomi_mi-router-ax3000t-initramfs-factory.ubi
nvram set boot_wait=on
nvram set boot_wait=on
nvram set uart_en=1
nvram set flag_boot_rootfs=0
nvram set flag_last_success=0
nvram set flag_boot_success=1
nvram set flag_try_sys1_failed=0
nvram set flag_try_sys2_failed=0
nvram commit
reboot</code></pre></div></details><div class="notion-blank notion-block-55787f6bedc54507b92eff0447019c5e"> </div><div class="notion-text notion-block-3846419358b342c29b7551d1fa9389c1">执行完后路由器会重启，进入到  initramfs system 。</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-bbedfba0688e4aeb811ccbf440bad1f5" data-id="bbedfba0688e4aeb811ccbf440bad1f5"><span><div id="bbedfba0688e4aeb811ccbf440bad1f5" class="notion-header-anchor"></div><a class="notion-hash-link" href="#bbedfba0688e4aeb811ccbf440bad1f5" title="升级固件"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">升级固件</span></span></h4><div class="notion-text notion-block-8fd3c501d00042298898c48a1f503034">重启后 IP 发生变化，我这里路由器 IP 变为 192.168.1.1 ，使用此地址重新 SSH 登录。执行系统命令：</div><div class="notion-text notion-block-3e374f1dc8d14aac810e7542360e2b90">上传文件</div><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">scp -O immortalwrt-23.05.3-mediatek-filogic-xiaomi_mi-router-ax3000t-squash
fs-sysupgrade.bin ax3000t:/tmp/</code></pre><div class="notion-text notion-block-48796882dca245b5a14f1faa0a9b0d1d">执行命令</div><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">sysupgrade -n -v /tmp/immortalwrt-23.05.3-mediatek-filogic-xiaomi_mi-router-ax3000t-squash
fs-sysupgrade.bin</code></pre><div class="notion-text notion-block-23ac7d91493f448eb8f4f78b9f44d5b5">刷入后路由器会自动重启进入正式系统。</div><div class="notion-text notion-block-d4ccc3740af1435e855fddd30d7d5e27">默认网关地址 <a target="_blank" rel="noopener noreferrer" class="notion-link" href="http://192.168.1.1">http://192.168.1.1</a> ， 账号 root ，密码为空，进入后按照引导开始设置即可。（后续 SSH 登录也会用到这个密码）。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-db54b625bf7c4c159fa08560e2cadecb"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2Fe6486127-0e4d-4954-865b-647ffa4f252d%2Fimage.png%3Ftable%3Dblock%26id%3Ddb54b625-bf7c-4c15-9fa0-8560e2cadecb%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3D4dC5UgyM7jn1clYZv2QK9Hu_t0jH5KZLSjNvENv5vF0?table=block&amp;id=db54b625-bf7c-4c15-9fa0-8560e2cadecb&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-7ced048447934bcabee63f5c7d6c97d7" data-id="7ced048447934bcabee63f5c7d6c97d7"><span><div id="7ced048447934bcabee63f5c7d6c97d7" class="notion-header-anchor"></div><a class="notion-hash-link" href="#7ced048447934bcabee63f5c7d6c97d7" title="参考"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">参考</span></span></h3><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-770f452ddc584f60a59d72cbbc59eb56" href="https://openwrt.org/inbox/toh/xiaomi/ax3000t"><div><div class="notion-bookmark-title">[OpenWrt Wiki] Xiaomi AX3000T</div><div class="notion-bookmark-description">Some AX3000T devices come with a new NAND flash chip: Winbond 25n01kvzeir. This chip is incompatible with the official stable OpenWrt 23.05.4 image and uboot! Don´t try to flash it without checking your chip!</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fopenwrt.org%2Flib%2Ftpl%2Fbootstrap3%2Fimages%2Fapple-touch-icon.png?table=block&amp;id=770f452d-dc58-4f60-a59d-72cbbc59eb56&amp;cache=v2" alt="[OpenWrt Wiki] Xiaomi AX3000T" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://openwrt.org/inbox/toh/xiaomi/ax3000t</div></div></div></a></div><div class="notion-blank notion-block-80d86fe47a584ee7bccfe83d1fbab34f"> </div></main>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[K3s 配置 Envoy Gateway：结合 Cloudflare Tunnel 与 Tailscale 实现内外网服务隔离]]></title>
            <link>https://okhk.net/k3s-envoy-gateway-cloudflare-tunnel-and-tailscale</link>
            <guid>https://okhk.net/k3s-envoy-gateway-cloudflare-tunnel-and-tailscale</guid>
            <pubDate>Thu, 24 Sep 2026 16:00:00 GMT</pubDate>
            <description><![CDATA[笔记记录了在 K3s 中通过 Envoy Gateway 实现服务内外网隔离的运维配置过程，包括利用 Tailscale 接入 LoadBalancer 暴露私有服务、通过 Cloudflare Tunnel 暴露公开服务，并结合 cert-manager 自动签发 Let's Encrypt TLS 证书以及配合 external-dns 实现 Cloudflare DNS 记录的自动化管理。]]></description>
            <content:encoded><![CDATA[<link rel="preload" as="image" href="https://gateway.envoyproxy.io/favicons/android-192x192.png"/><link rel="preload" as="image" href="https://gateway.envoyproxy.io/img/envoy-gateway-feature.png" referrerPolicy="same-origin"/><main class="notion light-mode notion-page notion-block-3e7710e013078028994bdafd5dc66fdf"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-text notion-block-3e7710e0130780208736eb7a69e33f93">这几天重装迁移了一台线路较普通的服务器，正好当实验环境试试 Envoy Gateway，顺便记录下大致配置过程。</div><div class="notion-text notion-block-3e8710e01307806d829de71d26de05db">在 AI Agent 大行其道的今天，这种操作方式多少显得有点“古法运维”。AI 固然能几秒钟把服务拉起来，但如果不细致审视底层的组装细节，配置次数多了时间长了，整个就容易变成“黑盒”。<s>按需配置、理清关键组件的流量走向，这种清晰的掌控感还是不错的。</s>（<s>也可能是”登味儿/守旧派“，或者说单纯烧不起 Token </s>🤣</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-3e8710e013078030875afdfaab2ee1bb" data-id="3e8710e013078030875afdfaab2ee1bb"><span><div id="3e8710e013078030875afdfaab2ee1bb" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3e8710e013078030875afdfaab2ee1bb" title="配置概览"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">配置概览</span></span></h3><div class="notion-text notion-block-3e8710e0130780b8bdf5e60bdf18381a">目标效果：在同一个 K3s 集群内，将公开服务与私有服务从入口层进行彻底隔离：</div><ul class="notion-list notion-list-disc notion-block-3e8710e0130780f98812d2ccf2142281"><li><b>私有服务</b>：通过 Envoy Gateway 暴露为 <code class="notion-inline-code">LoadBalancer</code> 类型的 Service，配合集群内 K3s 自带的 ServiceLB（原 Klipper LoadBalancer），借助 Tailscale 节点网络进行内网访问。</li></ul><ul class="notion-list notion-list-disc notion-block-3e8710e0130780ba98f8d7936d7a1030"><li><b>公开服务</b>：通过 Envoy Gateway 暴露为 <code class="notion-inline-code">ClusterIP</code> 类型的 Service，流量仅在集群内部流转，前端由部署在集群内的 <code class="notion-inline-code">cloudflared</code> 容器以 Cloudflare Tunnel 方式反向代理出去。</li></ul><pre class="notion-code language-yaml" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-yaml">[GatewayClass: envoy-gateway] (控制面控制器)
       │
       ├──&gt; [Gateway: envoy-gateway-tailscale]  ──&gt; Service类型: LoadBalancer (Tailscale 内网接入)
       │
       └──&gt; [Gateway: envoy-gateway-cloudflare] ──&gt; Service类型: ClusterIP    (Cloudflare Tunnel 接入)
</code></pre><div class="notion-text notion-block-3e8710e013078032a176f8e9c6dff1be">此外，配合 <code class="notion-inline-code">cert-manager</code> 完成 Let&#x27;s Encrypt TLS 证书自动签发，并利用 <code class="notion-inline-code">external-dns</code> 根据网关类型自动同步 DNS 记录（Tailscale 自动建 A 记录，Cloudflare Tunnel 自动建 CNAME 记录）。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-3e7710e013078088bb4df17e7492677d" data-id="3e7710e013078088bb4df17e7492677d"><span><div id="3e7710e013078088bb4df17e7492677d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3e7710e013078088bb4df17e7492677d" title="K3s 配置安装"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">K3s 配置安装</span></span></h3><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-3e7710e01307804490dee3aa40832717" href="https://k3s.io/"><div><div class="notion-bookmark-title">K3s</div><div class="notion-bookmark-description">K3s is a highly available, certified Kubernetes distribution designed for production workloads in unattended, resource-constrained, remote locations or inside IoT appliances.</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fk3s.io%2Fimg%2Ffavicon.ico?table=block&amp;id=3e7710e0-1307-8044-90de-e3aa40832717&amp;cache=v2" alt="K3s" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://k3s.io/</div></div></div></a></div><div class="notion-text notion-block-3e7710e01307807da2a9ec310c095023">基础的系统配置和 Tailscale 安装此处略去不表。</div><details class="notion-toggle notion-block-3e7710e01307801d9615f582bc147648"><summary>配置文件<code class="notion-inline-code"> /etc/rancher/k3s/config.yaml </code></summary><div><pre class="notion-code language-yaml" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-yaml">write-kubeconfig-mode: &quot;0600&quot;
# token: &quot;&quot; # 强随机字符串 (openssl rand -hex 16)
token-file: /etc/rancher/k3s/token

bind-address: &quot;0.0.0.0&quot;
node-ip: &quot;&lt;Tailscale-IP&gt;&quot;
node-external-ip: &quot;&lt;Tailscale-IP&gt;&quot;

tls-san:
  - &quot;127.0.0.1&quot;
  - &quot;localhost&quot;
  - &quot;&lt;Tailscale-IP&gt;&quot;
  - &quot;&lt;HostName&gt;&quot;
  - &quot;&lt;Tailscale-MagicDNS&gt;&quot;
  - &quot;&lt;个人域名&gt;&quot;

disable:
  - traefik

kube-proxy-arg:
  - &quot;proxy-mode=nftables&quot;

# 基础的 kubelet 参数就放在这，官方建议是使用专门的 kubelet 配置文件
kubelet-arg:
  - &quot;max-pods=110&quot;
  - &quot;image-gc-high-threshold=80&quot;
  - &quot;image-gc-low-threshold=60&quot;
  - &quot;container-log-max-size=10Mi&quot;
  - &quot;container-log-max-files=3&quot;
  - &quot;eviction-hard=memory.available&lt;300Mi,nodefs.available&lt;2Gi&quot;
  - &quot;serialize-image-pulls=false&quot;

# 需调整内核参数
protect-kernel-defaults: true
secrets-encryption: true</code></pre></div></details><details class="notion-toggle notion-block-3e7710e0130780c2b6f9ff75c00914ae"><summary>token-file 生成</summary><div><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">mkdir -p /etc/rancher/k3s
TOKEN_FILE=&quot;/etc/rancher/k3s/token&quot;
if [[ ! -f &quot;${TOKEN_FILE}&quot; ]]; then
    if command -v openssl &gt;/dev/null 2&gt;&amp;1; then
        openssl rand -hex 16 &gt; &quot;${TOKEN_FILE}&quot;
    else
        head -c 32 /dev/urandom \
            | base64 \
            | tr -dc &#x27;a-zA-Z0-9&#x27; \
            | head -c 32 &gt; &quot;${TOKEN_FILE}&quot;
    fi
    chmod 600 &quot;${TOKEN_FILE}&quot;
else
    log &quot;检测到已有 token，跳过生成&quot;
fi</code></pre></div></details><details class="notion-toggle notion-block-3e7710e01307809c9473dba69155b19b"><summary>内核参数配置</summary><div><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">cat &gt;/etc/sysctl.d/99-k3s-kubelet.conf &lt;&lt;EOF
# Kubernetes network forwarding
net.ipv4.ip_forward = 1
net.ipv6.conf.all.forwarding = 1
# Bridge netfilter
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
# Protect kernel defaults requirements
vm.overcommit_memory = 1
kernel.panic = 10
kernel.panic_on_oops = 1
EOF

sysctl --system &gt;/dev/null</code></pre></div></details><div class="notion-text notion-block-3e7710e01307804c854bc72ddaa515f6">安装命令 <code class="notion-inline-code">curl -sfL </code><code class="notion-inline-code"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://get.k3s.io/">https://get.k3s.io</a></code><code class="notion-inline-code"> | sh -</code></div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3e7710e01307802b8b96e66186305d30"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2Fd2dd51f3-f9bb-4c56-a867-27cc63f62afb%2Fimage.png%3Ftable%3Dblock%26id%3D3e7710e0-1307-802b-8b96-e66186305d30%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3DoFQrAwgHUEGQGFq2ACvolFFZ9nbgJErSurpFrQ3Bj4Q?table=block&amp;id=3e7710e0-1307-802b-8b96-e66186305d30&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-3e7710e013078023bc0df670488efc4f">面板用的是 Radar 项目，本机启动，CLI + Web 形式，提供 MCP Server</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-3e7710e013078070b2adddc0bbd71c0a" href="https://github.com/skyhook-io/radar"><div><div class="notion-bookmark-title">GitHub - skyhook-io/radar: The missing open-source Kubernetes UI with a built-in MCP server for AI agents. See what&#x27;s broken, why, and what changed. Issues, Topology, event timeline, Helm, GitOps, live service traffic, and cluster audits - all in one Go binary.</div><div class="notion-bookmark-description">The missing open-source Kubernetes UI with a built-in MCP server for AI agents. See what&amp;amp;#39;s broken, why, and what changed. Issues, Topology, event timeline, Helm, GitOps, live service traffi...</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=3e7710e0-1307-8070-b2ad-ddc0bbd71c0a&amp;cache=v2" alt="GitHub - skyhook-io/radar: The missing open-source Kubernetes UI with a built-in MCP server for AI agents. See what&#x27;s broken, why, and what changed. Issues, Topology, event timeline, Helm, GitOps, live service traffic, and cluster audits - all in one Go binary." loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/skyhook-io/radar</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Frepository-images.githubusercontent.com%2F1137865761%2F53bf8b62-757f-4fe6-b8fb-fc6e7422eda5?table=block&amp;id=3e7710e0-1307-8070-b2ad-ddc0bbd71c0a&amp;cache=v2" alt="GitHub - skyhook-io/radar: The missing open-source Kubernetes UI with a built-in MCP server for AI agents. See what&#x27;s broken, why, and what changed. Issues, Topology, event timeline, Helm, GitOps, live service traffic, and cluster audits - all in one Go binary." loading="lazy" decoding="async"/></div></a></div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-3e7710e013078069a89be58d60b0673f" data-id="3e7710e013078069a89be58d60b0673f"><span><div id="3e7710e013078069a89be58d60b0673f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3e7710e013078069a89be58d60b0673f" title="Envoy 网关部署"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">Envoy 网关部署</span></span></h3><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-3e7710e0130780168ecfe84d1b5f5a2f" href="https://gateway.envoyproxy.io/"><div><div class="notion-bookmark-title">Gateway</div><div class="notion-bookmark-description">Envoy Gateway Manage your Application and API traffic with Envoy Gateway. Aimed at making it easy to adopt, use, and manage Envoy Proxy. Deploy as a Standalone or Kubernetes-based API Gateway, implementing and extending the Kubernetes Gateway API. Get Started GitHub Built together. Built in the open. Gateway is the result of the community coming together to make it easier than ever to leverage Envoy Proxy for your API Gateway needs.</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgateway.envoyproxy.io%2Ffavicons%2Fandroid-192x192.png?table=block&amp;id=3e7710e0-1307-8016-8ecf-e84d1b5f5a2f&amp;cache=v2" alt="Gateway" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://gateway.envoyproxy.io/</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fgateway.envoyproxy.io%2Fimg%2Fenvoy-gateway-feature.png?table=block&amp;id=3e7710e0-1307-8016-8ecf-e84d1b5f5a2f&amp;cache=v2" alt="Gateway" loading="lazy" decoding="async"/></div></a></div><details class="notion-toggle notion-block-3e7710e0130780e29a92f129b3872f49"><summary>直接用 Helm 安装 Envoy Gateway，可配置项：<span class="notion-link-mention"><a href="https://gateway.envoyproxy.io/docs/install/gateway-helm-api/" target="_blank" rel="noopener noreferrer" class="notion-link-mention-link"><img class="notion-link-mention-icon" src="https://gateway.envoyproxy.io/favicons/android-192x192.png" alt="Envoy Gateway"/><span class="notion-link-mention-provider">Envoy Gateway</span><span class="notion-link-mention-title">Gateway Helm Chart</span></a><div class="notion-link-mention-preview"><article class="notion-link-mention-card"><img class="notion-link-mention-preview-thumbnail" src="https://gateway.envoyproxy.io/img/envoy-gateway-feature.png" alt="Gateway Helm Chart" referrerPolicy="same-origin"/><div class="notion-link-mention-preview-content"><p class="notion-link-mention-preview-title">Gateway Helm Chart</p><p class="notion-link-mention-preview-description">The Helm chart for Envoy Gateway Homepage: https://gateway.envoyproxy.io/ Maintainers Name Email Url envoy-gateway-steering-committee https://github.com/envoyproxy/gateway/blob/main/GOVERNANCE.md envoy-gateway-maintainers https://github.com/envoyproxy/gateway/blob/main/CODEOWNERS Source Code https://github.com/envoyproxy/gateway Requirements Repository Name Version crds 0.0.0 Values Key Type Default Description certgen object {&quot;job&quot;:{&quot;affinity&quot;:{},&quot;annotations&quot;:{},&quot;args&quot;:[],&quot;nodeSelector&quot;:{},&quot;pod&quot;:{&quot;annotations&quot;:{},&quot;labels&quot;:{},&quot;securityContext&quot;:{&quot;fsGroup&quot;:65532,&quot;runAsGroup&quot;:65532,&quot;runAsNonRoot&quot;:true,&quot;runAsUser&quot;:65532,&quot;seccompProfile&quot;:{&quot;type&quot;:&quot;RuntimeDefault&quot;}}},&quot;resources&quot;:{},&quot;securityContext&quot;:{&quot;allowPrivilegeEscalation&quot;:false,&quot;capabilities&quot;:{&quot;drop&quot;:[&quot;ALL&quot;]},&quot;privileged&quot;:false,&quot;readOnlyRootFilesystem&quot;:true,&quot;runAsGroup&quot;:65532,&quot;runAsNonRoot&quot;:true,&quot;runAsUser&quot;:65532,&quot;seccompProfile&quot;:{&quot;type&quot;:&quot;RuntimeDefault&quot;}},&quot;tolerations&quot;:[],&quot;ttlSecondsAfterFinished&quot;:30},&quot;rbac&quot;:{&quot;annotations&quot;:{},&quot;labels&quot;:{}}} Certgen is used to generate the certificates required by EnvoyGateway. If you want to construct a custom certificate, you can generate a custom certificate through Cert-Manager before installing EnvoyGateway. Certgen will not overwrite the custom certificate. Please do not manually modify values.yaml to disable certgen, it may cause EnvoyGateway OIDC,OAuth2,etc. to not work as expected. commonLabels object {} Labels to apply to all resources config.envoyGateway object {&quot;extensionApis&quot;:{},&quot;gateway&quot;:{&quot;controllerName&quot;:&quot;gateway.envoyproxy.io/gatewayclass-controller&quot;},&quot;logging&quot;:{&quot;level&quot;:{&quot;default&quot;:&quot;info&quot;}},&quot;provider&quot;:{&quot;type&quot;:&quot;Kubernetes&quot;}} EnvoyGateway configuration. Visit https://gateway.envoyproxy.io/docs/api/extension_types/#envoygateway to view all options. crds.enabled bool true Install Envoy Gateway CRDs, Gateway API CRDs, and Gateway API safe upgrade policy resources. Set to false when these resources are managed separately. createNamespace bool false deployment.annotations object {} deployment.envoyGateway.extraEnv list [] Additional environment variables for the envoy-gateway container. deployment.envoyGateway.image.repository string &quot;&quot; deployment.envoyGateway.image.tag string &quot;&quot; deployment.envoyGateway.imagePullPolicy string &quot;&quot; deployment.envoyGateway.imagePullSecrets list [] deployment.envoyGateway.livenessProbe.httpGet.path string &quot;/healthz&quot; deployment.envoyGateway.livenessProbe.httpGet.port int 8081 deployment.envoyGateway.livenessProbe.periodSeconds int 20 deployment.envoyGateway.livenessProbe.successThreshold int 1 deployment.envoyGateway.livenessProbe.timeoutSeconds int 1 deployment.envoyGateway.readinessProbe.httpGet.path string &quot;/readyz&quot; deployment.envoyGateway.readinessProbe.httpGet.port int 8081 deployment.envoyGateway.readinessProbe.periodSeconds int 10 deployment.envoyGateway.readinessProbe.successThreshold int 1 deployment.envoyGateway.readinessProbe.timeoutSeconds int 1 deployment.envoyGateway.resources.limits.memory string &quot;1024Mi&quot; deployment.envoyGateway.resources.requests.cpu string &quot;100m&quot; deployment.envoyGateway.resources.requests.memory string &quot;256Mi&quot; deployment.envoyGateway.securityContext.allowPrivilegeEscalation bool false deployment.envoyGateway.securityContext.capabilities.drop[0] string &quot;ALL&quot; deployment.envoyGateway.securityContext.privileged bool false deployment.envoyGateway.securityContext.readOnlyRootFilesystem bool true deployment.envoyGateway.securityContext.runAsGroup int 65532 deployment.envoyGateway.securityContext.runAsNonRoot bool true deployment.envoyGateway.securityContext.runAsUser int 65532 deployment.envoyGateway.securityContext.seccompProfile.type string &quot;RuntimeDefault&quot; deployment.envoyGateway.startupProbe.failureThreshold int 30 deployment.envoyGateway.startupProbe.httpGet.path string &quot;/healthz&quot; deployment.envoyGateway.startupProbe.httpGet.port int 8081 deployment.envoyGateway.startupProbe.periodSeconds int 1 deployment.envoyGateway.startupProbe.successThreshold int 1 deployment.envoyGateway.startupProbe.timeoutSeconds int 1 deployment.envoyGateway.strategy object {} Volume source for the Wasm module cache mounted at /var/lib/eg/wasm. Defaults to an emptyDir when left empty. Example: persist the Wasm module cache across controller restarts by backing it with a PersistentVolumeClaim: wasmCacheVolume: persistentVolumeClaim: claimName: envoy-gateway-wasm-cache deployment.envoyGateway.wasmCacheVolume object {} deployment.pod.affinity object {} deployment.pod.annotations.“prometheus.io/port” string &quot;19001&quot; deployment.pod.annotations.“prometheus.io/scrape” string &quot;true&quot; deployment.pod.extraVolumeMounts list [] deployment.pod.extraVolumes list [] deployment.pod.labels object {} deployment.pod.nodeSelector object {} deployment.pod.securityContext.fsGroup int 65532 deployment.pod.securityContext.runAsGroup int 65532 deployment.pod.securityContext.runAsNonRoot bool true deployment.pod.securityContext.runAsUser int 65532 deployment.pod.securityContext.seccompProfile.type string &quot;RuntimeDefault&quot; deployment.pod.tolerations list [] deployment.pod.topologySpreadConstraints list [] deployment.ports[0].name string &quot;grpc&quot; deployment.ports[0].port int 18000 deployment.ports[0].targetPort int 18000 deployment.ports[1].name string &quot;ratelimit&quot; deployment.ports[1].port int 18001 deployment.ports[1].targetPort int 18001 deployment.ports[2].name string &quot;wasm&quot; deployment.ports[2].port int 18002 deployment.ports[2].targetPort int 18002 deployment.ports[3].name string &quot;metrics&quot; deployment.ports[3].port int 19001 deployment.ports[3].targetPort int 19001 deployment.priorityClassName string nil deployment.replicas int 1 global.imagePullSecrets list [] Global override for image pull secrets global.imageRegistry string &quot;&quot; Global override for image registry global.images.envoyGateway.image string nil Full image for the Envoy Gateway control plane Deployment installed by this chart. global.images.envoyGateway.pullPolicy string nil Image pull policy for the Envoy Gateway control plane Deployment. Default behavior: latest images will be Always else IfNotPresent. global.images.envoyGateway.pullSecrets list [] Pull secrets for the Envoy Gateway control plane Deployment. global.images.envoyProxy.image string &quot;&quot; Full image for the managed Envoy Proxy data plane. This updates the generated envoyProxy config and does not change the envoy-gateway control plane Deployment image. If not specified, the default image built into envoy-gateway is used. global.images.envoyProxy.pullPolicy string &quot;&quot; Image pull policy for the managed Envoy Proxy data plane. Default behavior: IfNotPresent. global.images.envoyProxy.pullSecrets list [] Pull secrets for the managed Envoy Proxy data plane. global.images.ratelimit.image string &quot;docker.io/envoyproxy/ratelimit:master&quot; global.images.ratelimit.pullPolicy string &quot;IfNotPresent&quot; global.images.ratelimit.pullSecrets list [] hpa.behavior object {} hpa.enabled bool false hpa.maxReplicas int 1 hpa.metrics list [] hpa.minReplicas int 1 kubernetesClusterDomain string &quot;cluster.local&quot; namespaceOverride string &quot;&quot; Override the namespace for resources deployed by the chart. Defaults to the release namespace. podDisruptionBudget.minAvailable int 0 service.annotations object {} service.trafficDistribution string &quot;&quot; service.type string &quot;ClusterIP&quot; Service type. Can be set to LoadBalancer with specific IP, e.g.: type: LoadBalancer loadBalancerIP: 10.236.90.20 topologyInjector.annotations object {} topologyInjector.enabled bool true</p><div class="notion-link-mention-preview-footer"><img class="notion-link-mention-preview-icon" src="https://gateway.envoyproxy.io/favicons/android-192x192.png" alt="Envoy Gateway" referrerPolicy="same-origin"/><span class="notion-link-mention-preview-provider">Envoy Gateway</span></div></div></article></div></span></summary><div><pre class="notion-code language-bash" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-bash"># 安装
helm install eg oci://docker.io/envoyproxy/gateway-helm --version v1.9.1 -n envoy-gateway-system --create-namespace --set config.envoyGateway.logging.format=json

# 等待 Envoy Gateway 启动就绪
kubectl wait --timeout=5m -n envoy-gateway-system deployment/envoy-gateway --for=condition=Available</code></pre><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3e7710e0130780848538cf55bb544d78"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2Fb8717e4f-e3ee-4f0a-95a3-a3d1bee955bc%2Fimage.png%3Ftable%3Dblock%26id%3D3e7710e0-1307-8084-8538-cf55bb544d78%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3DlkOss2YqNQKpHUbhQSCGWlf_rjo-SsglicwIkaDg3c4?table=block&amp;id=3e7710e0-1307-8084-8538-cf55bb544d78&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure></div></details><div class="notion-text notion-block-3e7710e0130780539cefd81f561655a0">控制面安装好了，接下来就是 <b>GatewayClass</b>、<b>Gateway</b>、<b>HTTPRoute</b> 以及<b>数据面的网络/路由发布</b>。</div><details class="notion-toggle notion-block-3e7710e0130780bb97d8eb4b1907b5b7"><summary>创建 Gateway Class</summary><div><pre class="notion-code language-yaml" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-yaml">apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
  name: eg
spec:
  controllerName: gateway.envoyproxy.io/gatewayclass-controller</code></pre></div></details><details class="notion-toggle notion-block-3e8710e0130780bf8a43f7f63434a643"><summary>创建 EnvoyProxy 配置，覆写 Envoy Gateway Controller 之后生成的 Service 名称，</summary><div><pre class="notion-code language-yaml" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-yaml">apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyProxy
metadata:
  name: cloudflare-proxy-config
  namespace: envoy-gateway-system
spec:
  provider:
    type: Kubernetes
    kubernetes:
      envoyService:
        type: ClusterIP
        name: envoy-svc-fixed</code></pre></div></details><details class="notion-toggle notion-block-3e7710e013078022ae60f85662d4a881"><summary>创建 Gateway，其中 Cloudflare Tunnel 对应引入上面的 Envoy 自定义覆写配置，Tailscale 不用</summary><div><pre class="notion-code language-yaml" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-yaml">apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: cloudflare-gateway
  namespace: envoy-gateway-system
spec:
  gatewayClassName: eg
  listeners:
    - name: http
      protocol: HTTP
      port: 80
      allowedRoutes:
        namespaces:
          from: All
	infrastructure:
    parametersRef:
      group: gateway.envoyproxy.io
      kind: EnvoyProxy
      name: cloudflare-proxy-config 
      
---
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: tailscale-gateway
  namespace: envoy-gateway-system
spec:
  gatewayClassName: eg
  listeners:
    - name: http
      protocol: HTTP
      port: 80
      allowedRoutes:
        namespaces:
          from: All</code></pre></div></details><ul class="notion-list notion-list-disc notion-block-3e8710e0130780c4bb4ac4763c247aed"><li><b>Tailscale Gateway</b>：Service 为默认的 <code class="notion-inline-code">LoadBalancer</code>。K3s 的 ServiceLB 检测到后，会在节点启动 Pod 进行端口转发与流量透传。</li></ul><ul class="notion-list notion-list-disc notion-block-3e8710e0130780b79b73c4f0989caa71"><li><b>Cloudflare Gateway</b>：引入自定义 <code class="notion-inline-code">EnvoyProxy</code> 配置，指定 Service 为 <code class="notion-inline-code">ClusterIP</code>，仅限 K3s 内网访问。</li></ul><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-3e8710e0130780db91d3e86639edcb7a" data-id="3e8710e0130780db91d3e86639edcb7a"><span><div id="3e8710e0130780db91d3e86639edcb7a" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3e8710e0130780db91d3e86639edcb7a" title="Tailscale 链路测试"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">Tailscale 链路测试</span></span></h3><div class="notion-text notion-block-3e7710e0130780fe8d9ccb280a234096">用 Kubernetes 的 httpbin 测试服务</div><details class="notion-toggle notion-block-3e7710e01307809e82acc05676242c44"><summary>Deployment + Service</summary><div><pre class="notion-code language-yaml" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-yaml">apiVersion: apps/v1
kind: Deployment
metadata:
  name: httpbin
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      app: httpbin
  template:
    metadata:
      labels:
        app: httpbin
    spec:
      containers:
      - name: httpbin
        image: kennethreitz/httpbin
        ports:
        - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: httpbin
  namespace: default
spec:
  selector:
    app: httpbin
  hostnames:
	  - httpbin.okhk.net
  ports:
  - port: 80
    targetPort: 80</code></pre></div></details><details class="notion-toggle notion-block-3e7710e0130780158ca3eb5014204581"><summary>HTTPRoute</summary><div><pre class="notion-code language-yaml" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-yaml">apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: httpbin
  namespace: default
spec:
  parentRefs:
  - name: tailscale-gateway
    namespace: envoy-gateway-system
		sectionName: http
  
  rules:
  - matches:
    - path:
        type: PathPrefix
        value: /

    backendRefs:
    - name: httpbin
      port: 80</code></pre></div></details><details class="notion-toggle notion-block-3e7710e0130780568676fa73aaa07ab2"><summary>本地可以通过修改 hosts 或在内网 DNS 中配置域名指向 Tailscale 节点 IP，即可成功访问。 </summary><div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3e7710e0130780efa21cfcd7c4c330ee"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2F17fc7d5b-dc41-44fe-8b7a-4f74411786ef%2Fimage.png%3Ftable%3Dblock%26id%3D3e7710e0-1307-80ef-a21c-fcd7c4c330ee%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3DKgIVAcouhIeobTgr5S5yHcOUNMlVh9kSxEUpOxktpMI?table=block&amp;id=3e7710e0-1307-80ef-a21c-fcd7c4c330ee&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure></div></details><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-3e7710e0130780eab32cd5be172681ad" data-id="3e7710e0130780eab32cd5be172681ad"><span><div id="3e7710e0130780eab32cd5be172681ad" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3e7710e0130780eab32cd5be172681ad" title="Cloudflare Tunnel 接入"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">Cloudflare Tunnel 接入</span></span></h3><div class="notion-text notion-block-3e7710e0130780f18439decc4e65e734">上面验证了 Tailscale 的接入，下面开始接入 Cloudflare Tunnel，将其运行在 K3s 内部，直接对接 Envoy。</div><details class="notion-toggle notion-block-3e7710e01307800b9fcec4b7ba8d8ea2"><summary>Namespace</summary><div><pre class="notion-code language-yaml" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-yaml">apiVersion: v1
kind: Namespace
metadata:
  name: cloudflare</code></pre></div></details><details class="notion-toggle notion-block-3e7710e0130780f98025c4efe3b474a2"><summary>Secret</summary><div><div class="notion-text notion-block-3e7710e0130780d589a9fdb88b926186">在 Cloudflare Zero Trust 处创建得到 Tunnel Token，或者调用 API 也行，不做赘述</div><pre class="notion-code language-yaml" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-yaml">apiVersion: v1
kind: Secret
metadata:
  name: cf-tunnel-secret
  namespace: cloudflare
type: Opaque
stringData:
  tunnel-token: &quot;&lt;Tunnel Token&gt;&quot;
</code></pre></div></details><details class="notion-toggle notion-block-3e7710e0130780b49bc3da739f6eaf01"><summary>Deployment</summary><div><pre class="notion-code language-yaml" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-yaml">apiVersion: apps/v1
kind: Deployment
metadata:
  name: cloudflared
  namespace: cloudflare
  labels:
    app.kubernetes.io/name: cloudflared
spec:
  replicas: 1
  revisionHistoryLimit: 2

  selector:
    matchLabels:
      app.kubernetes.io/name: cloudflared

  template:
    metadata:
      labels:
        app.kubernetes.io/name: cloudflared

    spec:
      containers:
        - name: cloudflared
          image: cloudflare/cloudflared:2026.9.3
          imagePullPolicy: IfNotPresent
          args:
            - tunnel
            - --output
            - json
            - --loglevel
            - debug
            - --metrics
            - 0.0.0.0:2000
            - --no-autoupdate
            - run

          env:
            - name: TUNNEL_TOKEN
              valueFrom:
                secretKeyRef:
                  name: cf-tunnel-secret
                  key: tunnel-token

          ports:
            - name: metrics
              containerPort: 2000
              protocol: TCP

          resources:
            requests:
              cpu: 10m
              memory: 32Mi
            limits:
              cpu: 100m
              memory: 128Mi
          livenessProbe:
            httpGet:
              path: /ready
              port: metrics
            initialDelaySeconds: 15
            periodSeconds: 30
            timeoutSeconds: 5
            failureThreshold: 3
          readinessProbe:
            httpGet:
              path: /ready
              port: metrics
            initialDelaySeconds: 5
            periodSeconds: 10
            timeoutSeconds: 3
            failureThreshold: 3

          securityContext:
            allowPrivilegeEscalation: false
            readOnlyRootFilesystem: true
            runAsNonRoot: true
            runAsUser: 65532
            runAsGroup: 65532
            capabilities:
              drop:
                - ALL
            seccompProfile:
              type: RuntimeDefault

          volumeMounts:
            - name: tmp
              mountPath: /tmp

      volumes:
        - name: tmp
          emptyDir: {}
</code></pre></div></details><details class="notion-toggle notion-block-3e7710e0130780b39336cf6db81e19a0"><summary>部署完成后，Cloudflare Dashboard 显示隧道连接已建立。配置一条 <b>Published application routes </b>，Service 指向 K3s 中 Envoy Gateway Service。也就是：<code class="notion-inline-code">envoy-svc-fixed.envoy-gateway-system</code>。此时公网流量经过 Cloudflare CDN 边缘节点，由 Tunnel 穿透注入集群，再传递给 Envoy Gateway 进行路由分发。</summary><div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3e7710e0130780e18562d1b1ae3032c3"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2F72c22f9e-4c47-4f33-93d2-18dde40707d7%2Fimage.png%3Ftable%3Dblock%26id%3D3e7710e0-1307-80e1-8562-d1b1ae3032c3%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3DloGrslDkz12q5HpCGtVgTDdO9jK7elTwwFP8YwruRsA?table=block&amp;id=3e7710e0-1307-80e1-8562-d1b1ae3032c3&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3e8710e01307807a9b5ddd93c2582365"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2F451898c2-0a5f-4376-abfb-7b9ed537d514%2Fimage.png%3Ftable%3Dblock%26id%3D3e8710e0-1307-807a-9b5d-dd93c2582365%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3DtgDYOCyTtszfUsy445fdxImH0n6kD9qoAJx4d05AZn0?table=block&amp;id=3e8710e0-1307-807a-9b5d-dd93c2582365&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3e7710e0130780428d17ff641c956fd9"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2F87b07e89-3f1d-4c0e-9ec9-ca97af350757%2Fimage.png%3Ftable%3Dblock%26id%3D3e7710e0-1307-8042-8d17-ff641c956fd9%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3DKCuXcv2BQkBLD_M23el3E4DnhSFNdsl1BCi83e5xFi8?table=block&amp;id=3e7710e0-1307-8042-8d17-ff641c956fd9&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure></div></details><div class="notion-text notion-block-3e7710e01307800bb0b0f86c57dfe437">至此 Tailscale 和 Cloudflare Tunnel 访问 K3s 服务的基本链路已经测试通过。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-3e7710e013078086aabac7d4b26b10b9" data-id="3e7710e013078086aabac7d4b26b10b9"><span><div id="3e7710e013078086aabac7d4b26b10b9" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3e7710e013078086aabac7d4b26b10b9" title="cert-manager 自动签发 Let&#x27;s Encrypt 证书"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">cert-manager 自动签发 Let&#x27;s Encrypt 证书</span></span></h3><details class="notion-toggle notion-block-3e8710e01307809facbdd11899c9885b"><summary>Helm 部署</summary><div><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">helm install \
  cert-manager oci://quay.io/jetstack/charts/cert-manager \
  --version v1.21.2 \
  --namespace cert-manager \
  --create-namespace \
  --set crds.enabled=true</code></pre></div></details><details class="notion-toggle notion-block-3e8710e013078079977fe09600858823"><summary>Cloudflare API Key 创建</summary><div><div class="notion-text notion-block-3e8710e0130780efa544e5001c2c0b42">登录 Cloudflare Dashboard，进入 <b>My Profile -&gt; API Tokens</b>，创建 Token：
• <b>Permissions</b>：
    ◦ <code class="notion-inline-code">Zone - DNS - Edit</code>   
    ◦ <code class="notion-inline-code">Zone - Zone - Read</code>   
• <b>Zone Resources</b>：选择包含您域名的 <code class="notion-inline-code">Zone</code>（或 <code class="notion-inline-code">Include - All zones</code>） </div></div></details><details class="notion-toggle notion-block-3e8710e0130780758368e008c14542ab"><summary>将 Token 存储为 Kubernetes Secret，后续要使用 ClusterIssuer ，必须存储在 cert-manager 相同 namespace 下</summary><div><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">kubectl create secret generic cloudflare-api-token-secret \
  --namespace cert-manager \
  --from-literal=api-token=&lt;CLOUDFLARE_API_TOKEN&gt;</code></pre></div></details><details class="notion-toggle notion-block-3e8710e0130780a693b4d73d86ed6395"><summary>配置 cert-manager ClusterIssuer 开启 DNS-01 Challenge 认证</summary><div><pre class="notion-code language-yaml" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-yaml">apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: letsencrypt-cloudflare-dns
spec:
  acme:
    # 邮箱，用于接收 LetsEncrypt 证书到期提醒
    email: your-email@example.com
    server: https://acme-v02.api.letsencrypt.org/directory
    privateKeySecretRef:
      name: letsencrypt-cloudflare-account-key
    solvers:
    - dns01:
        cloudflare:
          apiTokenSecretRef:
            name: cloudflare-api-token-secret
            key: api-token</code></pre></div></details><details class="notion-toggle notion-block-3e8710e0130780cfaf4fc077bdfd626b"><summary>申请证书（Envoy Gateway Namespace 下）</summary><div><pre class="notion-code language-yaml" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-yaml">apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: okhk-tls
  namespace: envoy-gateway-system
spec:
  secretName: okhk-tls-secret
  issuerRef:
    name: letsencrypt-cloudflare-dns
    kind: ClusterIssuer
  dnsNames:
  - &quot;*.okhk.net&quot;</code></pre></div></details><details class="notion-toggle notion-block-3e8710e0130780bca786d18c143784f8"><summary>在 Envoy Gateway 的 Listener 中引用挂载 TLS 证书</summary><div><pre class="notion-code language-yaml" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-yaml">apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: envoy-gateway
  namespace: envoy-gateway-system
spec:
  gatewayClassName: eg
  listeners:
    - name: http
      protocol: HTTP
      port: 80
      allowedRoutes:
        namespaces:
          from: All
    - name: https
      protocol: HTTPS
      port: 443
      hostname: &quot;*.okhk.net&quot;
      tls:
        mode: Terminate
        certificateRefs:
          - kind: Secret
            name: okhk-tls-secret
      allowedRoutes:
        namespaces:
          from: All
  infrastructure:
    parametersRef:
      group: gateway.envoyproxy.io
      kind: EnvoyProxy
      name: custom-proxy-config</code></pre></div></details><div class="notion-text notion-block-3e8710e0130780f58d65e803d7b3f864">至此 TLS 证书配置完成，后续域名只需要配置 Tailscale 的 A 记录或者 Cloudflare Tunnel 的 CNAME 记录即可完成私有服务和公开服务的接入。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-3e8710e0130780d79f99f7987848bee9" data-id="3e8710e0130780d79f99f7987848bee9"><span><div id="3e8710e0130780d79f99f7987848bee9" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3e8710e0130780d79f99f7987848bee9" title="external-dns 配置"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">external-dns 配置</span></span></h3><details class="notion-toggle notion-block-3e8710e01307803c8f3bda880b7024f0"><summary>为了避免手动维护 DNS 记录，通过部署 <code class="notion-inline-code">external-dns</code> 实现 HTTPRoute 与 DNS 的自动同步：</summary><div><pre class="notion-code language-yaml" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-yaml">helm repo add external-dns https://kubernetes-sigs.github.io/external-dns/
helm repo update

helm install external-dns external-dns/external-dns \
  -namespace external-dns \
  --create-namespace \
  -f external-dns-values.yaml</code></pre><pre class="notion-code language-yaml" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-yaml">domainFilters:
  - okhk.net
env:
  - name: CF_API_TOKEN
    valueFrom:
      secretKeyRef:
        key: apiKey
        name: external-dns
extraArgs:
  - --cloudflare-dns-records-per-page=5000
  - --cloudflare-record-comment=provisioned by external-dns
  - --events
  - --min-event-sync-interval=5s
  - --batch-change-size=200
  - --batch-change-interval=1s
  - --metrics-address=:7979
  - --events-emit=RecordError
interval: 1m
logFormat: json
logLevel: debug
policy: upsert
provider:
  name: cloudflare
registry: txt
secretConfiguration:
  data:
    apiKey: 
  enabled: true
  mountPath: /etc/secrets
sources:
  - gateway-httproute
txtOwnerId: edns
txtPrefix: _externaldns.</code></pre></div></details><ul class="notion-list notion-list-disc notion-block-3e8710e01307808caaeeeb9bb0fd33fb"><li><b>Tailscale 路由</b>：<code class="notion-inline-code">external-dns</code> 默认解析 Gateway 的外部 IP 并生成 A 记录，正好契合 Tailscale LoadBalancer 的 IP 地址。</li></ul><ul class="notion-list notion-list-disc notion-block-3e8710e01307805bb166e844ef3581e1"><li><b>Cloudflare Tunnel 路由</b>：在 Gateway 资源上添加注解 <code class="notion-inline-code">external-dns.kubernetes.io/target</code> 指向 Tunnel CNAME，并在 <code class="notion-inline-code">HTTPRoute</code> 上添加注解以自动开启 Cloudflare Proxied：</li></ul><details class="notion-toggle notion-block-3e8710e0130780dab419c9d94db62835"><summary><code class="notion-inline-code">Gateway</code> 中配置 CNAME 记录指向目标：<code class="notion-inline-code">external-dns.kubernetes.io/target </code></summary><div><pre class="notion-code language-yaml" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-yaml">apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  annotations:
    external-dns.kubernetes.io/target: &lt;Tunnel-ID&gt;.cfargotunnel.com
  name: cloudflare-gateway
  namespace: envoy-gateway-system
spec:
  gatewayClassName: eg
  infrastructure:
    parametersRef:
      group: gateway.envoyproxy.io
      kind: EnvoyProxy
      name: cf-proxy-config
  listeners:
    - allowedRoutes:
        namespaces:
          from: All
      name: http
      port: 80
      protocol: HTTP
    - allowedRoutes:
        namespaces:
          from: All
      hostname: &quot;*.okhk.net&quot;
      name: https
      port: 443
      protocol: HTTPS
      tls:
        certificateRefs:
          - kind: Secret
            name: okhk-tls-secret
        mode: Terminate
---
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: tailscale-gateway
  namespace: envoy-gateway-system
spec:
  gatewayClassName: eg
  listeners:
    - allowedRoutes:
        namespaces:
          from: All
      hostname: &quot;*.okhk.net&quot;
      name: https
      port: 443
      protocol: HTTPS
      tls:
        certificateRefs:
          - kind: Secret
            name: okhk-tls-secret
        mode: Terminate
</code></pre></div></details><details class="notion-toggle notion-block-3e8710e01307808283d8cd4e33ea65b2"><summary><code class="notion-inline-code">HTTPRoute</code> 中配置开启 Cloudflare 代理： <code class="notion-inline-code">external-dns.kubernetes.io/cloudflare-proxied</code></summary><div><pre class="notion-code language-yaml" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-yaml">metadata:
  annotations:
    external-dns.kubernetes.io/cloudflare-proxied: &quot;true&quot;</code></pre></div></details><div class="notion-text notion-block-3e8710e0130780efa673d04ed24b237f">下图中 RemoteAddr<code class="notion-inline-code">10.42.0.28</code> 和 <code class="notion-inline-code">10.42.0.29</code> 分别是两个 Gateway 实例的 Pod IP，可见确实是两个 Gateway 分别转发的。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3e8710e01307808182f7ce9c2cf88d43"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2F9893a942-26cf-4c15-a3f1-a6125c1a33d0%2Fimage.png%3Ftable%3Dblock%26id%3D3e8710e0-1307-8081-82f7-ce9c2cf88d43%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3D8UgiuKZ0U_tmxOvOQidCaJ-QkB0kuKhfwcnk0Cb2QP0?table=block&amp;id=3e8710e0-1307-8081-82f7-ce9c2cf88d43&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3e8710e0130780288adfe8fbb22d1a47"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2Fdacad7f2-c220-45b2-b774-e73172e381d8%2Fimage.png%3Ftable%3Dblock%26id%3D3e8710e0-1307-8028-8adf-e8fbb22d1a47%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3DfWQtSXww5gsMRKRJNd-7g8dlVDstGI8DpwGIqg16rw4?table=block&amp;id=3e8710e0-1307-8028-8adf-e8fbb22d1a47&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-3e8710e0130780c9a387f06b2050c7b9">完成上述架构配置后，日后新增服务只需编写对应的 <code class="notion-inline-code">HTTPRoute</code> 并绑定到不同的 Gateway，即可无缝完成私有服务与公开服务的隔离发布。</div><div class="notion-text notion-block-3e8710e0130780649e1ac0995f72a9ef"><s>记录的有些杂，本来想用 AI 跑一轮优化下行文结构，看了下还是算了，就先到这。</s></div><div class="notion-blank notion-block-3e8710e0130780f6ac7accbc2005e79a"> </div></main>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[docker-traefik-dns - 根据容器标签 URL 自动创建 Cloudflare DNS 记录]]></title>
            <link>https://okhk.net/docker-traefik-dns-with-cloudflare</link>
            <guid>https://okhk.net/docker-traefik-dns-with-cloudflare</guid>
            <pubDate>Tue, 08 Sep 2026 16:00:00 GMT</pubDate>
            <description><![CDATA[一个用 Go 语言编写的轻量级开源工具 docker-traefik-dns，自动化解决自建服务中的 DNS 配置繁琐问题。它能够读取 Docker 容器标签或 Traefik 规则中的域名，并自动调用 Cloudflare API 创建对应的 DNS 解析记录。]]></description>
            <content:encoded><![CDATA[<main class="notion light-mode notion-page notion-block-3d7710e0130780428d0bf7ba79f75bd9"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-text notion-block-3e1710e01307809c9527f435147fd48f">在服务器上部署服务后，还要到 Cloudflare 上配置一条 DNS 记录，有点麻烦。</div><div class="notion-text notion-block-3e6710e01307806cb196f7969c2058b4">（<s>虽然 AI Agent 能自动去干，但是 token 在这方面烧不起也没必要，而且有时候还有幻觉不确定性</s>）</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-3e1710e013078096bf66d031fe32afa9" href="https://note.okhk.net/self-hosted-service-with-traefik-and-cloudflare-tunnel"><div><div class="notion-bookmark-title">OKHK ✨ 使用 Cloudflare Tunnel 和 Traefik 访问部署的 Docker 服务</div><div class="notion-bookmark-description">文章记录了个人自建服务的“古法运维”方案：利用 Traefik 作为本地容器的反向代理和动态服务发现，结合 Cloudflare Tunnel 实现内网穿透和安全访问。</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fnote.okhk.net%2Ffavicon.png?table=block&amp;id=3e1710e0-1307-8096-bf66-d031fe32afa9&amp;cache=v2" alt="OKHK ✨ 使用 Cloudflare Tunnel 和 Traefik 访问部署的 Docker 服务" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://note.okhk.net/self-hosted-service-with-traefik-and-cloudflare-tunnel</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fokhk.net%2Fapi%2Fog%3Ftitle%3DOKHK%2520%25E2%259C%25A8%2520%25E4%25BD%25BF%25E7%2594%25A8%2520Cloudflare%2520Tunnel%2520%25E5%2592%258C%2520Traefik%2520%25E8%25AE%25BF%25E9%2597%25AE%25E9%2583%25A8%25E7%25BD%25B2%25E7%259A%2584%2520Docker%2520%25E6%259C%258D%25E5%258A%25A1%26description%3D%25E6%2596%2587%25E7%25AB%25A0%25E8%25AE%25B0%25E5%25BD%2595%25E4%25BA%2586%25E4%25B8%25AA%25E4%25BA%25BA%25E8%2587%25AA%25E5%25BB%25BA%25E6%259C%258D%25E5%258A%25A1%25E7%259A%2584%25E2%2580%259C%25E5%258F%25A4%25E6%25B3%2595%25E8%25BF%2590%25E7%25BB%25B4%25E2%2580%259D%25E6%2596%25B9%25E6%25A1%2588%25EF%25BC%259A%25E5%2588%25A9%25E7%2594%25A8%2520Traefik%2520%25E4%25BD%259C%25E4%25B8%25BA%25E6%259C%25AC%25E5%259C%25B0%25E5%25AE%25B9%25E5%2599%25A8%25E7%259A%2584%25E5%258F%258D%25E5%2590%2591%25E4%25BB%25A3%25E7%2590%2586%25E5%2592%258C%25E5%258A%25A8%25E6%2580%2581%25E6%259C%258D%25E5%258A%25A1%25E5%258F%2591%25E7%258E%25B0%25EF%25BC%258C%25E7%25BB%2593%25E5%2590%2588%2520Cloudflare%2520Tunnel%2520%25E5%25AE%259E%25E7%258E%25B0%25E5%2586%2585%25E7%25BD%2591%25E7%25A9%25BF%25E9%2580%258F%25E5%2592%258C%25E5%25AE%2589%25E5%2585%25A8%25E8%25AE%25BF%25E9%2597%25AE%25E3%2580%2582?table=block&amp;id=3e1710e0-1307-8096-bf66-d031fe32afa9&amp;cache=v2" alt="OKHK ✨ 使用 Cloudflare Tunnel 和 Traefik 访问部署的 Docker 服务" loading="lazy" decoding="async"/></div></a></div><div class="notion-text notion-block-3e1710e01307809e9bdfc5b4583d518a">既然 Traefik 通过 Lable 完成了对其他服务的反向代理，而 Lable 中也有对应的服务域名，那么再来个程序依据 Lable 中的域名自动去调用 Cloudflare 的 API 添加对应的 A 记录或者 CNAME 记录不就完成上线可以访问了。</div><div class="notion-text notion-block-3e1710e013078019ae02fdea99a0ba9a">把想法和 AI 讨论一番后，直接就得到了下面这个简单项目</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-3e1710e013078049b839f7d2751083ec" href="https://github.com/hkint/docker-traefik-dns"><div><div class="notion-bookmark-title">GitHub - hkint/docker-traefik-dns: A lightweight dynamic DNS sync service for Docker and Traefik environments.</div><div class="notion-bookmark-description">A lightweight dynamic DNS sync service for Docker and Traefik environments. - hkint/docker-traefik-dns</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=3e1710e0-1307-8049-b839-f7d2751083ec&amp;cache=v2" alt="GitHub - hkint/docker-traefik-dns: A lightweight dynamic DNS sync service for Docker and Traefik environments." loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/hkint/docker-traefik-dns</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2Fe3d492a19ad88305a086e2a928a7bd670a17fac9e563e57122a6d5541867d670%2Fhkint%2Fdocker-traefik-dns?table=block&amp;id=3e1710e0-1307-8049-b839-f7d2751083ec&amp;cache=v2" alt="GitHub - hkint/docker-traefik-dns: A lightweight dynamic DNS sync service for Docker and Traefik environments." loading="lazy" decoding="async"/></div></a></div><details class="notion-toggle notion-block-3e6710e0130780bdbb44ceaa847f407e"><summary><code class="notion-inline-code">compose.yaml</code></summary><div><pre class="notion-code language-bash" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-bash">services:
  docker-traefik-dns:
    image: ghcr.io/hkint/docker-traefik-dns
    container_name: docker-traefik-dns
    restart: unless-stopped
    environment:
      # Cloudflare Configuration，需要 DNS 编辑权限的 API Token
      - CF_API_TOKEN=${CF_API_TOKEN}
      - CF_PROXY=${CF_PROXY:-false}
      - CF_TTL=${CF_TTL:-1}
      - DOMAIN_FILTER=${DOMAIN_FILTER:-okhk.net}

      # Source configuration: &quot;both&quot; (default), &quot;docker&quot;, or &quot;traefik&quot;
      - DNS_SOURCE=both

      # Default Target IP (Your public IP or Tailscale IP / LAN IP)
      - DEFAULT_TARGET_IP=${DEFAULT_TARGET_IP}

      # Docker Socket connection (reads container labels and Traefik rules directly)
      - DOCKER_HOST=unix:///var/run/docker.sock

      # Traefik API endpoint (optional if reading directly via docker socket)
      # - TRAEFIK_API_URL=http://traefik:8080
      # - TRAEFIK_TARGET_IP=${DEFAULT_TARGET_IP}

      # Operational settings
      - SYNC_INTERVAL=60s
      - DRY_RUN=false
      - LOG_LEVEL=info
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    networks:
      - traefik-net

networks:
  traefik-net:
    driver: bridge</code></pre></div></details><div class="notion-text notion-block-3e6710e01307809eaf92f5e1d1a3bdaf">包含如下特性：</div><div class="notion-callout notion-gray_background_co notion-block-3e1710e0130780259581eac8330b5532"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text"><div class="notion-text notion-block-3e1710e0130780dba313eec078bc6f4a"><b>自动化感知与解析</b>：服务采用 Go 语言编写，可以直接读取 Docker Socket 或 Traefik API，自动解析 <code class="notion-inline-code">Host(...)</code> / <code class="notion-inline-code">HostSNI(...)</code> 路由规则中的域名，无需重复配置。</div><div class="notion-text notion-block-3e1710e01307801ba95aea12a527f46f"><b>声明式 Label 覆盖</b>：除了自动抓取 Traefik 规则外，还支持通过自定义 Docker 标签（如 <code class="notion-inline-code">docker-traefik-dns.hostname</code>、<code class="notion-inline-code">docker-traefik-dns.target</code>）甚至兼容 Kubernetes external-dns 的标签，显式指定域名、目标 IP 及是否开启 Cloudflare 代理。</div><div class="notion-text notion-block-3e1710e01307800c8ed7f50b064d8077"><b>基于 TXT 记录的安全所有权校验</b>：为了防止误删手动创建或其他服务管理的 DNS 记录，服务会在更新 DNS 时自动写入带有唯一标识符的 TXT 所有权记录。在 reconcile 同步循环中，仅处理带有该标识符的托管记录，保证了极高的安全边界。</div><div class="notion-text notion-block-3e1710e0130780828538cfa95db36dc2"><b>Dry-run 与安全回退</b>：提供 <code class="notion-inline-code">DRY_RUN</code> 模式用于上线前的变更预览，同时支持设置全局 <code class="notion-inline-code">DEFAULT_TARGET_IP</code> 与白名单 <code class="notion-inline-code">DOMAIN_FILTER</code> 过滤。</div></div></div><div class="notion-text notion-block-3e6710e0130780719461ee5efd393bd6">其中 <code class="notion-inline-code"><b>DNS_SOURCE=docker</b></code><b> </b>指的是“从 Docker Engine API 读取容器及其 labels”，并不是说域名必须来自 Docker 专用 label。它会读取容器上的如下 label：</div><pre class="notion-code language-yaml" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-yaml"># 1. 标准 Traefik labels
labels:
  - &quot;traefik.enable=true&quot;
  - &quot;traefik.http.routers.app.rule=Host(`app.okhk.net`)&quot;
  
# 2. Docker Traefik DNS 自定义 label
labels:
  - &quot;docker-traefik-dns.hostname=app.okhk.net&quot;
# 兼容 ExternalDNS 的 label：
  - &quot;external-dns.alpha.kubernetes.io/hostname=app.okhk.net&quot;</code></pre><div class="notion-text notion-block-3e6710e0130780f2b34ae50adc248ddf">而 <code class="notion-inline-code"><b>DNS_SOURCE=traefik </b></code>则是基于 Traefik API 获取已加载的 router rule，不会读取 Docker 容器上的 <code class="notion-inline-code">docker-traefik-dns.target</code> label，一般会共用一个 Target 和 Proxy 配置。</div><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">Traefik API → /api/http/routers
Traefik API → /api/tcp/routers</code></pre><div class="notion-text notion-block-3e6710e01307805fb090fc33fe8bf8c9">故而可采用如下配置：</div><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">DNS_SOURCE=docker
DEFAULT_TARGET_IP=100.64.0.10
CF_PROXY=false
# 如测试配置开启 Dry run
# DRY_RUN=true</code></pre><ul class="notion-list notion-list-disc notion-block-3e6710e01307803d870bf9e7ddd9fb87"><li>部署内网服务（基于 Tailscale）</li><ul class="notion-list notion-list-disc notion-block-3e6710e01307803d870bf9e7ddd9fb87"><div class="notion-text notion-block-3e6710e013078014b3b4fb43cec9ecbc">只需要默认的 traefik label 即可</div><pre class="notion-code language-yaml" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-yaml">labels:
  - &quot;traefik.enable=true&quot;
  - &quot;traefik.http.routers.internal.rule=Host(`internal.okhk.net`)&quot;</code></pre><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3e6710e013078020aeb0f4cf2344f4ac"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2Fe9e115ae-f932-4290-94d0-6a368cc45913%2Fimage.png%3Ftable%3Dblock%26id%3D3e6710e0-1307-8020-aeb0-f4cf2344f4ac%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3D-lbrUZ5dWRqoTiJXArwznPUa05fQR852bFtvX2SjBOY?table=block&amp;id=3e6710e0-1307-8020-aeb0-f4cf2344f4ac&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-3e6710e0130780a09d51ffe6aa457976">此处以 whoami 为例，Cloudflare 显示已添加 A 记录，并有 TXT 管理记录</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3e6710e0130780498890e05ae45ac700"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2F188447fb-55a3-4d0c-b35c-f7cfaf6d3391%2Fimage.png%3Ftable%3Dblock%26id%3D3e6710e0-1307-8049-8890-e05ae45ac700%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3DJwGweKc2Ka4FMUNZLAsyRJ_MWhozIR6FqT6oldKerkM?table=block&amp;id=3e6710e0-1307-8049-8890-e05ae45ac700&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure></ul></ul><ul class="notion-list notion-list-disc notion-block-3e1710e0130780e79b14ece62400a0ce"><li>部署公网服务（基于 Cloudflare Tunnel）</li><ul class="notion-list notion-list-disc notion-block-3e1710e0130780e79b14ece62400a0ce"><div class="notion-text notion-block-3e6710e01307805ea9ede23d825de68e">额外配置覆盖 target 和 proxy</div><pre class="notion-code language-yaml" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-yaml">labels:
  - &quot;traefik.enable=true&quot;
  - &quot;traefik.http.routers.public.rule=Host(`public.okhk.net`)&quot;
  - &quot;docker-traefik-dns.target=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.cfargotunnel.com&quot;
  - &quot;docker-traefik-dns.proxy=true&quot;</code></pre><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3e6710e0130780719de3f13fb2ca0dda"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2Ff93182c3-c9e4-46ab-9638-c8b32df61e51%2Fimage.png%3Ftable%3Dblock%26id%3D3e6710e0-1307-8071-9de3-f13fb2ca0dda%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3DD9KQbuU9Hz9e3_Dv9tHrfk2LHqnqkChXlxVya3Gysfw?table=block&amp;id=3e6710e0-1307-8071-9de3-f13fb2ca0dda&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3e6710e01307809ab22dcd00832c1f3e"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2Fe9821ba9-4b56-4dcf-80e0-a0b825c7ee7d%2Fimage.png%3Ftable%3Dblock%26id%3D3e6710e0-1307-809a-b22d-cd00832c1f3e%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3Dsz5QUEZUtkEJ9vAZyNFIG6SEMui92gtxFZVUC5U9chY?table=block&amp;id=3e6710e0-1307-809a-b22d-cd00832c1f3e&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-callout notion-gray_background_co notion-block-3e6710e0130780539a67f76aa02262e0"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text"><div class="notion-text notion-block-3e6710e013078024882cf0a8b5753d61">注意：Cloudflare Tunnel 需要在 Zero Trust 控制台配置域名通配符转发，不然会被 <code class="notion-inline-code">Catch-all: http_status:403</code> 拦截</div></div></div></ul></ul><div class="notion-blank notion-block-3e6710e01307801c883aff312849c48e"> </div></main>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Podroid 简单体验 - Android 上无需 root 运行 Alpine Linux 虚拟机容器环境]]></title>
            <link>https://okhk.net/podroid-android-simple-note</link>
            <guid>https://okhk.net/podroid-android-simple-note</guid>
            <pubDate>Sat, 29 Aug 2026 16:00:00 GMT</pubDate>
            <description><![CDATA[文章分享了使用 Podroid 在 Android 上免 Root 运行 Alpine Linux 的体验：优点是部署门槛极低且功能完整，但缺乏 pKVM 硬件加速的旧设备在纯软件模拟下性能损耗较明显。]]></description>
            <content:encoded><![CDATA[<main class="notion light-mode notion-page notion-block-3d5710e0130780eeaf71c4b3c0b0263a"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><blockquote class="notion-quote notion-block-3d5710e0130780e89974e4c1dd7ed81a"><div><b>Podroid</b> 是一款在 Android 上运行真正的 Linux 系统的应用，包含 Podman、Docker、LXC 和 Linux 桌面环境，无需 root 权限，也无需自定义 Recovery。
它在应用内通过 KVM 启动了一个 Alpine Linux 虚拟机，并搭载了定制的 Linux 7.1.5 内核。</div></blockquote><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-3d5710e013078004842dd3d49ce4ec8a" href="https://github.com/ExTV/Podroid"><div><div class="notion-bookmark-title">GitHub - ExTV/Podroid: A rootless Android app that boots Alpine Linux: run containers (Podman/Docker/LXC) and GUI desktop apps.</div><div class="notion-bookmark-description">A rootless Android app that boots Alpine Linux: run containers (Podman/Docker/LXC) and GUI desktop apps. - ExTV/Podroid</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=3d5710e0-1307-8004-842d-d3d49ce4ec8a&amp;cache=v2" alt="GitHub - ExTV/Podroid: A rootless Android app that boots Alpine Linux: run containers (Podman/Docker/LXC) and GUI desktop apps." loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/ExTV/Podroid</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2F7a9bd8cb7ee199c198d91142a1db490633c72d4a8be35b393c187ead3a0b3153%2FExTV%2FPodroid?table=block&amp;id=3d5710e0-1307-8004-842d-d3d49ce4ec8a&amp;cache=v2" alt="GitHub - ExTV/Podroid: A rootless Android app that boots Alpine Linux: run containers (Podman/Docker/LXC) and GUI desktop apps." loading="lazy" decoding="async"/></div></a></div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-3d5710e0130780b6a650e0d4cfccc259" href="https://extv.github.io/Podroid/guide/"><div><div class="notion-bookmark-title">Overview · Podroid docs</div><div class="notion-bookmark-description">Podroid documentation: run Linux containers and a Linux desktop on Android with no root, via a real Alpine VM on QEMU or AVF/pKVM.</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fextv.github.io%2FPodroid%2Flogo.png?table=block&amp;id=3d5710e0-1307-80b6-a650-e0d4cfccc259&amp;cache=v2" alt="Overview · Podroid docs" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://extv.github.io/Podroid/guide/</div></div></div></a></div><div class="notion-text notion-block-3d5710e01307808e9ba4d523e51f1eb6">之前也曾分享过：</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-3d5710e013078077b0e9e81409b450e2" href="https://tg.okhk.net/posts/9276"><div><div class="notion-bookmark-title">Podroid - Android 免 Root 运行 Linux 容器（Podman）</div><div class="notion-bookmark-description">Podroid - Android 免 Root 运行 Linux 容器（Podman）https://github.com/ExTV/Podroid使用 QEMU 启动了一个轻量级 Alpine Linux 虚拟机，从而实现完整的 Podman 容器运行环境。支持 OCI 镜像、存储持久化与端口转发#Android #Docker #Tool #GitHub</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fwsrv.nl%2F%3Fw%3D64%26h%3D64%26fit%3Dcover%26mask%3Dcircle%26url%3Dssl%3Acdn5.telesco.pe%2Ffile%2Fs5iR2F3T6CNjhE4gq90Vkeuv2pIa8_VTIdyDz8pZuD8D8U8OlaTSRD9sC5khN1N8N1luncRaLl7uYHF-LU9xhr0YP4SFpwVyuNlnukDVuhGOQ_tpb2NaHwzWHUTjwVgqdczdO5JqxQJpogxLWi0TbrnXlnYpQUDeS-L5iYRh7BEZHZ_tkV-wLbdgG0c62yuklN18F_GD0wFhAKUf4qVSqFFfuwwI_adT7EHVIfHixExKYX7ezNsiLg9TB6OlyJbcFuZZcFyS9rTtcxZ5fEFBw0UU5wW-ZP7uNwl6_MiNTZ2F7KlNWh8zuV5EkaWN6v-ycTBSrId1bBvfFzWqqhYbuA.jpg?table=block&amp;id=3d5710e0-1307-8077-b0e9-e81409b450e2&amp;cache=v2" alt="Podroid - Android 免 Root 运行 Linux 容器（Podman）" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://tg.okhk.net/posts/9276</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fwsrv.nl%2F%3Fw%3D1200%26h%3D630%26fit%3Dcover%26url%3Dssl%3Acdn5.telesco.pe%2Ffile%2Fs5iR2F3T6CNjhE4gq90Vkeuv2pIa8_VTIdyDz8pZuD8D8U8OlaTSRD9sC5khN1N8N1luncRaLl7uYHF-LU9xhr0YP4SFpwVyuNlnukDVuhGOQ_tpb2NaHwzWHUTjwVgqdczdO5JqxQJpogxLWi0TbrnXlnYpQUDeS-L5iYRh7BEZHZ_tkV-wLbdgG0c62yuklN18F_GD0wFhAKUf4qVSqFFfuwwI_adT7EHVIfHixExKYX7ezNsiLg9TB6OlyJbcFuZZcFyS9rTtcxZ5fEFBw0UU5wW-ZP7uNwl6_MiNTZ2F7KlNWh8zuV5EkaWN6v-ycTBSrId1bBvfFzWqqhYbuA.jpg?table=block&amp;id=3d5710e0-1307-8077-b0e9-e81409b450e2&amp;cache=v2" alt="Podroid - Android 免 Root 运行 Linux 容器（Podman）" loading="lazy" decoding="async"/></div></a></div><div class="notion-text notion-block-3d5710e0130780d0bd13e670a13364a4">刚好手头上有台旧手机，刚好安装体验下。下载 Release 中的 apk 安装运行，根据安装引导，完成配置启动。点击打开终端后在右上角启用服务器模式，可以让手机黑屏从而节省电量消耗。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3d5710e01307802a9958d2ce84e405f8"><div style="position:relative;display:flex;justify-content:center;align-self:start;width:432px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2F665a42eb-2b9c-4906-89ca-72d620d6a960%2FScreenshot_20260908-182545__01.jpg%3Ftable%3Dblock%26id%3D3d5710e0-1307-802a-9958-d2ce84e405f8%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3DoSXoiImtnHlZ86xuW7Klqb4N1EmzfJ4c4utjVrkFzhw?table=block&amp;id=3d5710e0-1307-802a-9958-d2ce84e405f8&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-3d5710e01307801a9c96d16b16df8759">此时得到 SSH 连接信息如下，默认的密码是 <code class="notion-inline-code">podroid</code>。</div><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">  Host podroid
  HostName 192.168.31.9
  Port 9922
  User root</code></pre><div class="notion-text notion-block-3d5710e013078048aa52fb5c7a9bb603">在其他设备上 SSH 连上 Alpine 虚拟机：</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3d5710e0130780a2ac89d5d5b8e13ecf"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2F6e80974f-9e59-49a9-bce0-647756bb0814%2Fimage.png%3Ftable%3Dblock%26id%3D3d5710e0-1307-80a2-ac89-d5d5b8e13ecf%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3DXiEmk0sDzP1xiabRZixePdOILKx-co72LFYoP-f6R2Y?table=block&amp;id=3d5710e0-1307-80a2-ac89-d5d5b8e13ecf&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3d5710e01307806bacb0d982df88b07a"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2F08406be2-1ba5-40e0-93f2-f938478d866e%2Fimage.png%3Ftable%3Dblock%26id%3D3d5710e0-1307-806b-acb0-d982df88b07a%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3DIbONxvnOpTxbYiinhZSQElMss3MwKBsAGIgCG7KusT0?table=block&amp;id=3d5710e0-1307-806b-acb0-d982df88b07a&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-3d5710e01307803a8f50ff9745ee46e4">替换镜像源</div><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">sed -i &#x27;s/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g&#x27; /etc/apk/repositories</code></pre><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3d5710e0130780f991b9d1ec5cc8fdb1"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2F190f83bd-21e3-4381-994a-ee356ab322ad%2Fimage.png%3Ftable%3Dblock%26id%3D3d5710e0-1307-80f9-91b9-d1ec5cc8fdb1%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3Db_UjIAhh5K_ZpFTCf97_oHB0JhkV-3fi0l4qcb4e_Y8?table=block&amp;id=3d5710e0-1307-80f9-91b9-d1ec5cc8fdb1&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-3d5710e01307806795abedd5d4dc8f81">配置时区</div><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">apk add tzdata
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
echo &quot;Asia/Shanghai&quot; &gt; /etc/timezone</code></pre><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3d5710e01307808a855dc907291bb0a3"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2Fb8859019-613c-4b21-a14d-e9d4ad0eae7a%2Fimage.png%3Ftable%3Dblock%26id%3D3d5710e0-1307-808a-855d-c907291bb0a3%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3DOD62FoovNCsMu1gqBSZWfzAXz0IabvHhvb_oL4fnESU?table=block&amp;id=3d5710e0-1307-808a-855d-c907291bb0a3&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><details class="notion-toggle notion-block-3d5710e01307804e932dc99a3c0a5e95"><summary><s>创建具有等效 sudo 权限的普通用户</s>（感觉没啥必要，反正是玩具环境）：</summary><div><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">adduser -G wheel app</code></pre></div></details><div class="notion-text notion-block-3d5710e01307800881bfc1e7062a5256">Alpine 虚拟机使用 OpenRC 作为其初始化系统（PID 1 为 BusyBox init；OpenRC 用于管理服务树）：</div><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell"># 列出所有服务及其运行状态
rc-status

# 启动、停止、重启或检查某个服务的状态
rc-service dropbear start
rc-service docker stop
rc-service podroid-x11 restart
rc-service podroid-x11 status

# 将已安装的服务设置为开机自启（添加至 &#x27;default&#x27; 运行级别）
rc-update add crond default

# 取消服务的开机自启（例如禁用 Docker 以节省内存）
rc-update del docker default</code></pre><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3d5710e0130780de9124e31f3ca1b030"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2Fc976002c-5cc8-4afd-b373-b4cb719e3ecc%2Fimage.png%3Ftable%3Dblock%26id%3D3d5710e0-1307-80de-9124-e31f3ca1b030%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3DCno6h4yVDZkPWyz5Xw94NEfQxZRWTQ_g1Q8EtJuBrpM?table=block&amp;id=3d5710e0-1307-80de-9124-e31f3ca1b030&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell"># 新增端口转发（Android 设备 - Alpine 虚拟机）
podroid-forward add 8888 80 tcp
# 临时端口转发
podroid-forward 8888 80
# 查看端口转发
podroid-forward list
# 移动端口转发
podroid-forward remove 8888 tcp
# 清空端口转发
podroid-forward clean</code></pre><div class="notion-text notion-block-3d7710e0130780f7a6cfdd10d8ff8d42">简单跑了几个容器体验了下，镜像解压都很慢，QEMU/KVM 模拟性能损失不小（<s>也可能手机太老了</s>），毕竟软件 CPU 模拟的 KVM，不是 Pixel 及其他搭载 pKVM 的设备。</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-3d7710e0130780408973c8105b060edf" href="https://extv.github.io/Podroid/guide/backends.html"><div><div class="notion-bookmark-title">Backends: QEMU &amp; AVF · Podroid docs</div><div class="notion-bookmark-description">How to choose between QEMU (TCG) and AVF (pKVM), how to grant AVF permissions, and what differs between the two backends.</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fextv.github.io%2FPodroid%2Flogo.png?table=block&amp;id=3d7710e0-1307-8040-8973-c8105b060edf&amp;cache=v2" alt="Backends: QEMU &amp; AVF · Podroid docs" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://extv.github.io/Podroid/guide/backends.html</div></div></div></a></div><div class="notion-text notion-block-3e1710e013078089bce9ca5f5de5e4bf">也就能挂个 <a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://github.com/zhf883680/clash-traffic-monitor">Clash Traffic Monitor</a> ，看下🪜 （<s>启动了 94 秒，感人</s></div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3e1710e0130780238afee5f52518225c"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2Fcf1407fe-8fae-4092-8f41-fa8b6c41fb0a%2Fimage.png%3Ftable%3Dblock%26id%3D3e1710e0-1307-8023-8afe-e5f52518225c%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3Doqml1WeXEQeetiJgZyGoY5U5MQV_d49qA0eKCwfXp84?table=block&amp;id=3e1710e0-1307-8023-8afe-e5f52518225c&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3e1710e0130780079769e986c7b7ceaa"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2F7bd2c54f-43fc-4e79-ae3f-647e2af656fb%2Fimage.png%3Ftable%3Dblock%26id%3D3e1710e0-1307-8007-9769-e986c7b7ceaa%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3DrbJ48ruaXgv-8oxKDnRCiCvHYS7S6Ma0QBgr7kX-3fk?table=block&amp;id=3e1710e0-1307-8007-9769-e986c7b7ceaa&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-3e1710e0130780348314d8a2b3ea33f3"> </div><div class="notion-blank notion-block-3e1710e0130780959712f1e64a8f367f"> </div></main>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[使用 Cloudflare Tunnel 和 Traefik 访问部署的 Docker 服务]]></title>
            <link>https://okhk.net/self-hosted-service-with-traefik-and-cloudflare-tunnel</link>
            <guid>https://okhk.net/self-hosted-service-with-traefik-and-cloudflare-tunnel</guid>
            <pubDate>Mon, 09 Feb 2026 16:00:00 GMT</pubDate>
            <description><![CDATA[文章记录了个人自建服务的“古法运维”方案：利用 Traefik 作为本地容器的反向代理和动态服务发现，结合 Cloudflare Tunnel 实现内网穿透和安全访问。]]></description>
            <content:encoded><![CDATA[<main class="notion light-mode notion-page notion-block-132710e0130780f38f43e83478165909"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-text notion-block-306710e01307803b87f8ca139221a5a9">自部署的 Docker 服务用起来很舒心，但数量多了后，端口映射管理，防火墙端口规则，DNS 配置等也很麻烦。</div><div class="notion-text notion-block-333710e0130780fd9bf5c5b1c96535fd"><b><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/">Cloudflare Tunnel</a></b> 服务，可以在不暴露服务器端口的情况下建立一条服务器连接到 Cloudflare 的隧道，再搭配上 <b><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://traefik.io">Traefik</a></b> 来实现各容器服务的服务发现和反向代理，从而可以在公网访问自部署的 Docker 服务。核心逻辑如下：</div><ol start="1" class="notion-list notion-list-numbered notion-block-333710e013078076949bfa422efd8f31" style="list-style-type:decimal"><li><b>流量入口</b>：用户访问域名 -&gt; Cloudflare 边缘节点 -&gt; <b>Cloudflare Tunnel</b>。</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-333710e013078054bd86f5ee493d055b" style="list-style-type:decimal"><li><b>穿透层</b>：<code class="notion-inline-code">cloudflared</code> 容器通过隧道将流量拉取到本地 Docker 网络。</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-333710e0130780b38814c994972c6193" style="list-style-type:decimal"><li><b>分发层</b>：流量到达 <b>Traefik</b>，Traefik 根据 HTTP Host 规则（Labels）识别目标容器。</li></ol><ol start="4" class="notion-list notion-list-numbered notion-block-333710e013078043a6d0d2380ee7e787" style="list-style-type:decimal"><li><b>应用层</b>：流量最终到达具体的业务容器（如 <code class="notion-inline-code">whoami</code>）。</li></ol><div class="notion-text notion-block-333710e013078094b28efc0baf44ad38"><b>优势</b>：无需公网 IP，无需在防火墙开启 80/443 端口，自带 SSL 证书管理。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-333710e0130780d68308fed54eb10a8d" data-id="333710e0130780d68308fed54eb10a8d"><span><div id="333710e0130780d68308fed54eb10a8d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#333710e0130780d68308fed54eb10a8d" title="流量路径示意"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">流量路径示意</span></span></h3><pre class="notion-code language-plain text" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-plain text">       [ 互联网 (Internet) ]
               ||
               \/
+---------------------------------------+
|        Cloudflare 全球网络             |
|    (DNS 解析 &amp; 安全防护 &amp; CDN)          |
+---------------------------------------+
               ||
      &lt;== Cloudflare Tunnel ==&gt; (加密隧道)
               ||
+--------------||------------------------+
|          宿主机 (Host)                 |
|              ||                       |
|   +----------\/----------+            |
|   |  cloudflared 容器    |            |
|   +----------||----------+            |
|              || (Docker Network: traefik)
|   +----------\/----------+            |
|   |    Traefik 容器      |            |
|   | (反向代理/服务发现)    |            |
|   +----------||----------+            |
|              || (路由分发)             |
|   +----------\/----------+            |
|   |  业务容器 (如 whoami) |            |
|   +----------------------+            |
+---------------------------------------+</code></pre><div class="notion-callout notion-gray_background_co notion-block-333710e01307804abb89ff31178c98a7"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text"><div class="notion-text notion-block-333710e0130780e59b04d37bea7df4de">这套方案用了很久了，但早前都是手动配置了就开始用了。这次服务器被迫重装顺便记录下这种“<span class="notion-inline-underscore">古法运维</span>”。</div><div class="notion-text notion-block-333710e01307807f825ac6b69a19cfdd">
现在 LLM / AI Agent 已经很强了，这些内容都能生成或者直接给你配置完成。
这里就简单贴上配置，不做详细操作说明，毕竟 AI 大概干得更好。</div></div></div><div class="notion-text notion-block-333710e0130780db8351cd4599fc60b9">Docker 环境配置略去不表。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-306710e013078040841ce2f1caf84902" data-id="306710e013078040841ce2f1caf84902"><span><div id="306710e013078040841ce2f1caf84902" class="notion-header-anchor"></div><a class="notion-hash-link" href="#306710e013078040841ce2f1caf84902" title="Traefik 配置"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">Traefik 配置</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-333710e01307803ea7bbfe3dcbdd304e" data-id="333710e01307803ea7bbfe3dcbdd304e"><span><div id="333710e01307803ea7bbfe3dcbdd304e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#333710e01307803ea7bbfe3dcbdd304e" title="traefik 容器网络配置脚本"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">traefik 容器网络配置脚本</span></span></h4><div class="notion-text notion-block-333710e01307802592cffe962528bfbd"><code class="notion-inline-code">network-setup.sh</code> </div><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">#!/bin/bash

NETWORK_NAME=traefik

if [ -z $(docker network ls --filter name=^${NETWORK_NAME}$ --format=&quot;{{ .Name }}&quot;) ] ; then
    # 创建 Docker 网络
    output=$(docker network create ${NETWORK_NAME});
    # 检查输出是否为 64 位长度的字符串
    if [[ ${#output} -eq 64 ]]; then
        echo &quot;create docker network for traefik ok&quot;
    else
        echo &quot;Network creation failed or output is not 64 characters long.&quot;
    fi
fi</code></pre><div class="notion-text notion-block-333710e013078010820ed73f4d950981">执行👆脚本创建一个名为 Traefik 的容器网络。</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-333710e013078094a173d4720e28f9ff" data-id="333710e013078094a173d4720e28f9ff"><span><div id="333710e013078094a173d4720e28f9ff" class="notion-header-anchor"></div><a class="notion-hash-link" href="#333710e013078094a173d4720e28f9ff" title="traefik 容器配置"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">traefik 容器配置</span></span></h4><div class="notion-text notion-block-333710e013078046a5e3e96237b79b5c"><code class="notion-inline-code">compose.yaml</code></div><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">services:
  traefik:
    container_name: traefik
    image: traefik
    restart: always
    command:
      - &quot;--global.sendanonymoususage=false&quot;
      - &quot;--global.checknewversion=false&quot;
      - &quot;--entrypoints.web.address=:80&quot;
      - &quot;--api=true&quot;
      - &quot;--api.dashboard=true&quot;
      - &quot;--ping=true&quot;
      - &quot;--log.level=INFO&quot;
      - &quot;--log.format=common&quot;
      - &quot;--accesslog=false&quot;
      - &quot;--providers.docker=true&quot;
      - &quot;--providers.docker.watch=true&quot;
      - &quot;--providers.docker.exposedbydefault=false&quot;
      - &quot;--providers.docker.endpoint=unix:///var/run/docker.sock&quot;
      - &quot;--providers.docker.useBindPortIP=false&quot;
      - &quot;--providers.docker.network=traefik&quot;
    ports:
      - &quot;80:80&quot; # 如本机/局域网也需要访问，则映射；仅走 Tunnel 可不映射
    environment:
      - TZ=Asia/Shanghai
    labels:
      - &quot;traefik.enable=true&quot;
      - &quot;traefik.docker.network=traefik&quot;
      - &quot;traefik.http.routers.dashboard.rule=Host(`traefik.okhk.net`) &amp;&amp; (PathPrefix(`/api`) || PathPrefix(`/dashboard`))&quot;
      - &quot;traefik.http.routers.dashboard.service=api@internal&quot;
      - &quot;traefik.http.routers.dashboard.entrypoints=web&quot;
      # Traefik 管理面板安全认证配置
      - &quot;traefik.http.routers.dashboard.middlewares=auth&quot;
      # echo $(htpasswd -nb admin 你的密码) | sed -e s/\\$/\\$\\$/g
      - &quot;traefik.http.middlewares.auth.basicauth.users=admin:$$apr1$$...&quot;
      - &quot;traefik.http.middlewares.gzip.compress=true&quot;
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    extra_hosts:
      - &quot;update.traefik.io:127.0.0.1&quot;
      - &quot;collect.traefik.io:127.0.0.1&quot;
      - &quot;stats.g.doubleclick.net:127.0.0.1&quot;
    healthcheck:
      test: [&quot;CMD-SHELL&quot;, &quot;wget -q --spider --proxy off localhost:8080/ping || exit 1&quot;]
      interval: 3s
      retries: 10
    logging:
      driver: &quot;json-file&quot;
      options:
        max-size: &quot;5m&quot;
    networks:
      - traefik

networks:
  traefik:
    external: true</code></pre><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-333710e013078094a019ffc814c4dc92" data-id="333710e013078094a019ffc814c4dc92"><span><div id="333710e013078094a019ffc814c4dc92" class="notion-header-anchor"></div><a class="notion-hash-link" href="#333710e013078094a019ffc814c4dc92" title="自部署服务配置"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">自部署服务配置</span></span></h3><div class="notion-text notion-block-333710e01307806ab212f7c3fd10aad5">以 whoami 为例</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-333710e01307807ab1b7d6c579a2f80c" data-id="333710e01307807ab1b7d6c579a2f80c"><span><div id="333710e01307807ab1b7d6c579a2f80c" class="notion-header-anchor"></div><a class="notion-hash-link" href="#333710e01307807ab1b7d6c579a2f80c" title="whoami 容器配置"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">whoami 容器配置</span></span></h4><div class="notion-text notion-block-333710e01307806bb828ff7bf828af68"><code class="notion-inline-code">compose.yaml</code></div><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">services:
  whoami:
    image: traefik/whoami
    container_name: whoami
    restart: unless-stopped
    labels:
      - &quot;traefik.enable=true&quot;
      - &quot;traefik.http.routers.whoami.rule=Host(`whoami.okhk.net`)&quot;
      - &quot;traefik.http.routers.whoami.entrypoints=web&quot;
    networks:
      - traefik

networks:
  traefik:
    external: true</code></pre><div class="notion-text notion-block-333710e01307809f94bfff797874135a">Traefik 可通过 lables 发现并代理 whoami 服务。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-306710e0130780a4a76de8d8b216545d" data-id="306710e0130780a4a76de8d8b216545d"><span><div id="306710e0130780a4a76de8d8b216545d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#306710e0130780a4a76de8d8b216545d" title="Cloudflare Tunnel 配置"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">Cloudflare Tunnel 配置</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-333710e0130780bb877cf0773455136a" data-id="333710e0130780bb877cf0773455136a"><span><div id="333710e0130780bb877cf0773455136a" class="notion-header-anchor"></div><a class="notion-hash-link" href="#333710e0130780bb877cf0773455136a" title="cloudflared 容器配置"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">cloudflared 容器配置</span></span></h4><div class="notion-text notion-block-333710e0130780ad9ef9cbf57eecc38e"><code class="notion-inline-code">compose.yaml</code></div><pre class="notion-code language-yaml" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-yaml">services:
  cloudflared:
    image: cloudflare/cloudflared:latest
    container_name: cloudflared
    restart: always
    command: tunnel --no-autoupdate run --token $TUNNEL_TOKEN
    environment:
      - TZ=Asia/Shanghai
    env_file:
      - .env
    healthcheck:
      test: [&quot;CMD&quot;, &quot;cloudflared&quot;, &quot;tunnel&quot;, &quot;--metrics&quot;, &quot;localhost:20241&quot;, &quot;ready&quot;]
      interval: 10s
      timeout: 10s
      retries: 5
      start_period: 20s
    networks:
      - traefik 
    
networks:
  traefik:
    external: true</code></pre><div class="notion-text notion-block-306710e0130780f4b80bfc79751ff0bd"><code class="notion-inline-code">.env</code></div><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">TUNNEL_TOKEN=</code></pre><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-333710e01307802e8eceef4072007d00" data-id="333710e01307802e8eceef4072007d00"><span><div id="333710e01307802e8eceef4072007d00" class="notion-header-anchor"></div><a class="notion-hash-link" href="#333710e01307802e8eceef4072007d00" title="TUNNEL_TOKEN 获取"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">TUNNEL_TOKEN 获取</span></span></h4><div class="notion-text notion-block-333710e0130780b2942fcd608e34bb63">登录 Cloudflare Zero Trust 控制台 → Networks -&gt; Tunnels，点击 Create a Tunnel。</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-333710e0130780bcb79bd05b810c5bf2" href="https://one.dash.cloudflare.com/"><div><div class="notion-bookmark-title">one.dash.cloudflare.com</div><div class="notion-bookmark-description">We&#x27;re streamlining our dashboard to keep all of your tools in one place. Please update your bookmarks to use dash.cloudflare.com.</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-text">https://one.dash.cloudflare.com/</div></div></div></a></div><div class="notion-text notion-block-333710e013078082ac98def78de1be92">可参考 Cloudflare 官网文档：</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-333710e0130780899f69e0d48a003233" href="https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/get-started/create-remote-tunnel/"><div><div class="notion-bookmark-title">Create a tunnel (dashboard)</div><div class="notion-bookmark-description">Follow this step-by-step guide to create your first remotely-managed tunnel using Cloudflare One.</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fdevelopers.cloudflare.com%2Ffavicon.png?table=block&amp;id=333710e0-1307-8089-9f69-e0d48a003233&amp;cache=v2" alt="Create a tunnel (dashboard)" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/get-started/create-remote-tunnel/</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fdevelopers.cloudflare.com%2Fzt-preview.png?table=block&amp;id=333710e0-1307-8089-9f69-e0d48a003233&amp;cache=v2" alt="Create a tunnel (dashboard)" loading="lazy" decoding="async"/></div></a></div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-333710e013078042bd04fe4465ef4340"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2F808df40b-91bb-4456-bdd6-39a0bcd1f08b%2Fimage.png%3Ftable%3Dblock%26id%3D333710e0-1307-8042-bd04-fe4465ef4340%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3D74ruDLOEokyRWoMJLKVpS8ZvjBIuxJpGd6NwbjZdlA0?table=block&amp;id=333710e0-1307-8042-bd04-fe4465ef4340&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-333710e01307808787c2cdcacaedd0d6">复制命令中的 <code class="notion-inline-code">--token</code> 后面的长字符串，将其作为环境变量填入上述文件中，启动 cloudflared 容器，建立 Cloudflare Tunnel 链接。</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-333710e0130780edb243c7f4e3382e1f" data-id="333710e0130780edb243c7f4e3382e1f"><span><div id="333710e0130780edb243c7f4e3382e1f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#333710e0130780edb243c7f4e3382e1f" title="Cloudflare Tunnel 路由配置"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">Cloudflare Tunnel 路由配置</span></span></h4><table class="notion-simple-table notion-block-333710e0130780ae99c8e8c258a4d974"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-333710e0130780ecae2cf0ecd39415b5"><td class="" style="width:120px"><div class="notion-simple-table-cell">公网域名 (Public Hostname)</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">服务协议</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">内部服务 URL (Service)</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">类型说明</div></td></tr><tr class="notion-simple-table-row notion-block-333710e0130780b99515d3cc9b694d2e"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">*.okhk.net</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">HTTP</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">http://traefik:80</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>泛域名转发</b> (推荐)</div></td></tr><tr class="notion-simple-table-row notion-block-333710e0130780a1813bdba74f6af8c9"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">whoami.okhk.net</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">HTTP</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">http://traefik:80</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">精确匹配</div></td></tr></tbody></table><div class="notion-text notion-block-333710e01307804283b8ea888fa26cc1">如果在 Cloudflare 中配置了泛域名（如 <code class="notion-inline-code">*.okhk.net</code>）指向 <code class="notion-inline-code">http://traefik:80</code>，那么之后新增 Docker 服务时，<b>只需在 Docker Labels 里写好域名</b>，无需再回 Cloudflare 页面操作。</div><div class="notion-text notion-block-333710e0130780a78a7bd31afc793534">如果使用精确域名，则后续每次新增 Docker 服务都需要手动配置域名转发到 <code class="notion-inline-code">http://traefik</code> 。</div><div class="notion-text notion-block-333710e01307806b885dc060a57ff77c">（当然也可以借用一些工具实现根据 Traefik 服务发现情况自动调用 Cloudflare API 添加对应的 tunnel 路由规则，但出于某些原因（<s>懒得整了</s>）就没再弄了</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-333710e0130780c4b241f71d3e428e18"><div style="position:relative;display:flex;justify-content:center;align-self:start;width:384px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2F18b887c4-23d5-4d9f-b75c-e8b2f5a6aff1%2Fimage.png%3Ftable%3Dblock%26id%3D333710e0-1307-80c4-b241-f71d3e428e18%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3DwNRgLFc23LXlwySGK35Kz3vT5VXUbvoQ48ZW_t_avyY?table=block&amp;id=333710e0-1307-80c4-b241-f71d3e428e18&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure></main>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[香港汇丰银行红狮子提款卡电话人工客服激活 | TERR_30004 报错]]></title>
            <link>https://okhk.net/activate-hsbc-hk-card-by-call-human-service</link>
            <guid>https://okhk.net/activate-hsbc-hk-card-by-call-human-service</guid>
            <pubDate>Sun, 21 Dec 2025 16:00:00 GMT</pubDate>
            <description><![CDATA[文章记录了激活香港汇丰银行红狮子提款卡的激活操作，分享了网友接通汇丰电话客服人工服务的方法步骤。]]></description>
            <content:encoded><![CDATA[<main class="notion light-mode notion-page notion-block-2d1710e01307803faf0cc09d30ebd9ac"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-callout notion-gray_background_co notion-block-2e2710e01307801ab8f7ff340138401a"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="🤣">🤣</span></div><div class="notion-callout-text"><div class="notion-text notion-block-2e2710e0130780b59e4bc3c68000de2d"><b>更新：</b>现在通过 港澳通行证 + 人脸识别 即可完成流动理财 App 的注册激活。
———
<b>汇丰香港现已支持以往来港澳通行证开户的内地居民使用港澳通行证注册流动理财</b></div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-2e2710e0130780d2b53bf6e04cb1c771"><div style="position:relative;display:flex;justify-content:center;align-self:start;width:288px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2F7d705192-b55a-418a-8565-84f9ecc05622%2Ftelegram-cloud-photo-size-5-6262337384913505317-w.jpg%3Ftable%3Dblock%26id%3D2e2710e0-1307-80d2-b53b-f6e04cb1c771%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3DrFOBWykfuAA4VWXmxMw_rJHT6nQT4XiG5XKE0z9b4_U?table=block&amp;id=2e2710e0-1307-80d2-b53b-f6e04cb1c771&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-2e2710e01307806d8824d1533a4537cb">长期以来，汇丰仅支持香港身份证客户和指定地区护照客户凭证件自行注册流动理财。</div><div class="notion-text notion-block-2e2710e0130780669229da08db9f3649">而非指定地区护照客户和使用港澳通行证开户的内地居民，若并非在线下分行开通账户，或遭遇线上开户申请未立即通过/立即通过但忘记注册流动理财等情况，而又无法前往线下分行请求职员协助开通，则需要使用提款卡卡号和提款卡密码才能注册流动理财。</div><div class="notion-text notion-block-2e2710e0130780fdb47af6dbe7dc4ea4">而密码信以平邮寄出（日前汇丰已取消DHL邮寄密码信）送达率极低，经常有长期无法注册流动理财的情况。</div><div class="notion-text notion-block-2e2710e013078047a2ecd81770ef1f59">更新汇丰香港APP版本至3.65.12后，现已支持使用拍摄/NFC读取港澳通行证照片+人脸的形式，激活流动理财，极大的缓解了上述尴尬局面。</div></div></div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-2d1710e0130780459cabe3512603e981" data-id="2d1710e0130780459cabe3512603e981"><span><div id="2d1710e0130780459cabe3512603e981" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2d1710e0130780459cabe3512603e981" title="背景"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">背景</span></span></h3><div class="notion-text notion-block-2d1710e01307801a9d0ec609f8d9e620">汇丰香港线上开户后，在内地收到了红狮子提款卡和密码函，需要先激活红狮子提款卡，然后才可以激活手机上汇丰流动理财 App。不然在 App 中按流程一步步操作最后输入港澳通行证号码后，页面会提示 TERR_30004 编号报错。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-2d1710e01307802ea4eed7b790339e5c"><div style="position:relative;display:flex;justify-content:center;align-self:start;width:480px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2Fbb037c95-93f8-49a8-8e8c-97b9da00339b%2Fimage.png%3Ftable%3Dblock%26id%3D2d1710e0-1307-802e-a4ee-d7b790339e5c%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3Dxso1FHfHGdCmJqWHSELBLv19hoGhZDI8kSkVwD61Mu8?table=block&amp;id=2d1710e0-1307-802e-a4ee-d7b790339e5c&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-2d1710e0130780eb82c7e790f1d53397" data-id="2d1710e0130780eb82c7e790f1d53397"><span><div id="2d1710e0130780eb82c7e790f1d53397" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2d1710e0130780eb82c7e790f1d53397" title="激活红狮子提款卡"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">激活红狮子提款卡</span></span></h3><div class="notion-text notion-block-2d1710e0130780faad78d412edba580c">根据激活的方式有以下两种</div><ol start="1" class="notion-list notion-list-numbered notion-block-2d1710e013078056bc21e2f01229d4f1" style="list-style-type:decimal"><li>拨打香港汇丰客服电话： (+852) 22333000 激活。</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-2d1710e0130780988783f9629014e7d1" style="list-style-type:decimal"><li>汇丰 ATM 插卡配合密码函上的密码激活。</li></ol><div class="notion-text notion-block-2d1710e0130780749db1e4a1e6fdc4ea">如有条件可先在内地 ATM 上尝试下，不行则还是拨打香港汇丰客服电话激活。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-2d1710e01307803fad01c15cece660ad" data-id="2d1710e01307803fad01c15cece660ad"><span><div id="2d1710e01307803fad01c15cece660ad" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2d1710e01307803fad01c15cece660ad" title="客服电话人工服务"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">客服电话人工服务</span></span></h3><div class="notion-text notion-block-2d1710e0130780bcac50d9847e039d2f">毕竟是跨境通话，拨打电话是想要尽快接通人工客服的。而客服电话的等待不可避免，这里直接参考小红书网友分享的方法。</div><blockquote class="notion-quote notion-block-2d1710e0130780bf93f5ecbe4dce0d4f"><div>拨打 (+852) 22333000</div><ol start="1" class="notion-list notion-list-numbered notion-block-2d1710e01307804192d1f5ceb0bedd8e" style="list-style-type:decimal"><li>根据语音提示选择语言，按 3 为普通话（1 为粤语，2 为英语）(有反馈说选粤语也行，最终转接的客服人员一般也会普通话</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-2d1710e013078007937de7b8aa3dd7c6" style="list-style-type:decimal"><li>按 # 选择人工服务</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-2d1710e01307805aa184d394153d9410" style="list-style-type:decimal"><li>系统语音会两次提示输入银行户口或信用卡号码，不要去按键输入，保持静默听完语音</li></ol><ol start="4" class="notion-list notion-list-numbered notion-block-2d1710e0130780f5a86fc7341a75cb6d" style="list-style-type:decimal"><li>上段语音结束后，系统语音会接着询问致电原因，还是继续保持静默等待语音结束</li></ol><ol start="5" class="notion-list notion-list-numbered notion-block-2d1710e0130780428ca6f11d52fe45b7" style="list-style-type:decimal"><li>上段语音结束后，根据系统语音提示按两次 ## 进入按键式语音目录</li></ol><ol start="6" class="notion-list notion-list-numbered notion-block-2d1710e013078014abb8fcb68c926797" style="list-style-type:decimal"><li>根据语音提示，按 2 进入有限服务目录，继续保持静默等待</li></ol><ol start="7" class="notion-list notion-list-numbered notion-block-2d1710e01307805c9364edd90fed2e02" style="list-style-type:decimal"><li>根据提示再按 1</li></ol><ol start="8" class="notion-list notion-list-numbered notion-block-2d1710e0130780c7be14d148bf04bca4" style="list-style-type:decimal"><li>根据提示再按 3 进入“自动柜员机，借记卡及相关服务”</li></ol><ol start="9" class="notion-list notion-list-numbered notion-block-2d1710e0130780e98e93f66d74d52f8f" style="list-style-type:decimal"><li>此时系统就会很快会转接人工客服，接通后告诉对方要激活红狮子提款卡，按照客服的指示回答提供相关信息即可（红狮子卡卡号、卡号右下角的数字、发到预留手机号的验证码、相关信息核验等）</li></ol><ol start="10" class="notion-list notion-list-numbered notion-block-2d1710e01307800ba635d677ef21226f" style="list-style-type:decimal"><li>信息提供正确的情况下，客服在系统提交激活请求后，会告知需要 6 个工作日左右激活，到时会有短信提示。</li></ol></blockquote><div class="notion-text notion-block-2d1710e01307800b9403d7bb6326463f">此外，汇丰客服电话是 24 小时服务，可以尝试在晚间 10 点过后拨打，以减少等待时长，提高转接率。</div><div class="notion-blank notion-block-342710e0130780fd8f3eed41d939bd77"> </div><hr class="notion-hr notion-block-342710e0130780f8bd63e9ef004f6b25"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-342710e013078094b272c40fa524b1ba" data-id="342710e013078094b272c40fa524b1ba"><span><div id="342710e013078094b272c40fa524b1ba" class="notion-header-anchor"></div><a class="notion-hash-link" href="#342710e013078094b272c40fa524b1ba" title="附：联系香港客服的资费与白嫖技巧"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">附：联系香港客服的资费与白嫖技巧</span></span></h3><blockquote class="notion-quote notion-block-342710e01307806c896bc4a401098939"><div>使用 Tello 免费分钟： </div><ul class="notion-list notion-list-disc notion-block-342710e0130780b1bdb8f9c583dfb18b"><li>在开启 Wi-Fi Calling 的状态下，直接使用 Tello 套餐内包含的免费分钟数拨打 +852 号码，无额外资费。</li></ul></blockquote><blockquote class="notion-quote notion-block-342710e01307802d96b6e160086ecc7a"><div>内地手机直拨 vs IP 前缀资费：</div><ul class="notion-list notion-list-disc notion-block-342710e0130780c48b10fdeea3e8caee"><li>常规直拨： 资费约 0.8 - 1.5 元/分钟（部分套餐高达 2.9 元）。</li></ul><ul class="notion-list notion-list-disc notion-block-342710e0130780a9a5e3cfd34b6157bb"><li>加拨 IP 前缀： 移动前加 12593 或 17951，电信加 11808，联通加 10193。加拨后拨打香港，资费大幅降至约 0.39 - 0.4 元/分钟（需提前开通国际长途）。</li></ul></blockquote><blockquote class="notion-quote notion-block-342710e0130780ea91b0f1e240379232"><div>🤖 中银香港 95566 免费代转秘籍</div><ul class="notion-list notion-list-disc notion-block-342710e013078045a293fd79cf951f95"><li>1. 用内地手机拨打国内中国银行客服 95566。</li></ul><ul class="notion-list notion-list-disc notion-block-342710e01307801e8eade5005de51f5d"><li>2. 接通后，直接对语音机器人说：“帮我转接境外服务电话”。</li></ul><ul class="notion-list notion-list-disc notion-block-342710e0130780f2834cca69c0cebcfb"><li>3. 根据语音提示输入 852#。</li></ul><ul class="notion-list notion-list-disc notion-block-342710e0130780498558e811a6952b2b"><li>4. 系统将自动、免费代转至中银香港人工客服，免除国际长途话费。</li></ul></blockquote><blockquote class="notion-quote notion-block-342710e01307804f8af7d8a746533324"><div>汇丰卓越免费拨打客服全球转接尊敬的卓越阁下可以免费拨打国内客服电话400-920-0828进行全球转接！</div></blockquote><div class="notion-blank notion-block-342710e0130780d2b8b1d6175137b67c"> </div></main>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[开源 AI/LLM API 聚合项目列表]]></title>
            <link>https://okhk.net/awesome-ai-llm-api-open-source-project</link>
            <guid>https://okhk.net/awesome-ai-llm-api-open-source-project</guid>
            <pubDate>Mon, 10 Nov 2025 16:00:00 GMT</pubDate>
            <description><![CDATA[开源的 AI/LLM API聚合项目列表，这类项目提供统一的 AI API 接口，用于调用和管理多个大型语言模型（LLM）服务。]]></description>
            <content:encoded><![CDATA[<main class="notion light-mode notion-page notion-block-2e5710e0130780699f86d6553ca1dfbd"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-text notion-block-2fc710e013078033bb67c006fcfa0afb"><s>介绍就省略了吧…</s></div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-3e1710e0130780f089b9c5713a585ee6" href="https://github.com/router-for-me/CLIProxyAPI"><div><div class="notion-bookmark-title">GitHub - router-for-me/CLIProxyAPI: Wrap Antigravity, ChatGPT Codex, Claude Code, Grok Build as an OpenAI/Gemini/Claude/Codex compatible API service, allowing you to enjoy the free Gemini 3.1 Pro, GPT 5.6 Series, Grok 4.5, Claude model through API</div><div class="notion-bookmark-description">Wrap Antigravity, ChatGPT Codex, Claude Code, Grok Build as an OpenAI/Gemini/Claude/Codex compatible API service, allowing you to enjoy the free Gemini 3.1 Pro, GPT 5.6 Series, Grok 4.5, Claude mod...</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=3e1710e0-1307-80f0-89b9-c5713a585ee6&amp;cache=v2" alt="GitHub - router-for-me/CLIProxyAPI: Wrap Antigravity, ChatGPT Codex, Claude Code, Grok Build as an OpenAI/Gemini/Claude/Codex compatible API service, allowing you to enjoy the free Gemini 3.1 Pro, GPT 5.6 Series, Grok 4.5, Claude model through API" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/router-for-me/CLIProxyAPI</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2F234b15d82657bd1f890359e2af1300198b7b6435b93e58e47f50203e54865fb8%2Frouter-for-me%2FCLIProxyAPI?table=block&amp;id=3e1710e0-1307-80f0-89b9-c5713a585ee6&amp;cache=v2" alt="GitHub - router-for-me/CLIProxyAPI: Wrap Antigravity, ChatGPT Codex, Claude Code, Grok Build as an OpenAI/Gemini/Claude/Codex compatible API service, allowing you to enjoy the free Gemini 3.1 Pro, GPT 5.6 Series, Grok 4.5, Claude model through API" loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-3e1710e01307800badeaf1dff00a0453"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-3b0710e01307806595cde204e049b269" href="https://github.com/aurorallm/aurora"><div><div class="notion-bookmark-title">GitHub - aurorallm/aurora: The Fastest enterprise AI gateway — route LLM traffic across OpenAI, Anthropic, Gemini, Groq &amp; 30+ providers via a single API. Self-hosted, no vendor lock-in. ( 55x faster than litellm )</div><div class="notion-bookmark-description">The Fastest enterprise AI gateway — route LLM traffic across OpenAI, Anthropic, Gemini, Groq &amp;amp;amp; 30+ providers via a single API. Self-hosted, no vendor lock-in. ( 55x faster than litellm ) - ...</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=3b0710e0-1307-8065-95cd-e204e049b269&amp;cache=v2" alt="GitHub - aurorallm/aurora: The Fastest enterprise AI gateway — route LLM traffic across OpenAI, Anthropic, Gemini, Groq &amp; 30+ providers via a single API. Self-hosted, no vendor lock-in. ( 55x faster than litellm )" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/aurorallm/aurora</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2Fa6e9543e21cd72bae91199d0d004cc90e1f292a56afe57d7d5258d660d0eef6f%2Faurorallm%2Faurora?table=block&amp;id=3b0710e0-1307-8065-95cd-e204e049b269&amp;cache=v2" alt="GitHub - aurorallm/aurora: The Fastest enterprise AI gateway — route LLM traffic across OpenAI, Anthropic, Gemini, Groq &amp; 30+ providers via a single API. Self-hosted, no vendor lock-in. ( 55x faster than litellm )" loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-3b0710e0130780929670dafe49197023"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-3a8710e01307804fb6dbf3ea570767cf" href="https://github.com/diegosouzapw/OmniRoute"><div><div class="notion-bookmark-title">GitHub - diegosouzapw/OmniRoute: Never stop coding. Free MIT AI gateway: one endpoint, 268+ providers (50+ free), 500+ models — Kimi, Claude, GPT, OpenAI, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline &amp; Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 500+ contributors</div><div class="notion-bookmark-description">Never stop coding. Free MIT AI gateway: one endpoint, 268+ providers (50+ free), 500+ models — Kimi, Claude, GPT, OpenAI, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, Open...</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=3a8710e0-1307-804f-b6db-f3ea570767cf&amp;cache=v2" alt="GitHub - diegosouzapw/OmniRoute: Never stop coding. Free MIT AI gateway: one endpoint, 268+ providers (50+ free), 500+ models — Kimi, Claude, GPT, OpenAI, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline &amp; Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 500+ contributors" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/diegosouzapw/OmniRoute</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2Fa2cde237f68b6ca014a37430f704508ed44ea626313a1ed86a8903553c52694c%2Fdiegosouzapw%2FOmniRoute?table=block&amp;id=3a8710e0-1307-804f-b6db-f3ea570767cf&amp;cache=v2" alt="GitHub - diegosouzapw/OmniRoute: Never stop coding. Free MIT AI gateway: one endpoint, 268+ providers (50+ free), 500+ models — Kimi, Claude, GPT, OpenAI, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline &amp; Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 500+ contributors" loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-3b0710e0130780cda9deea7589d198a1"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-3b0710e01307804cbf69c456616b8c2e" href="https://github.com/decolua/9router"><div><div class="notion-bookmark-title">GitHub - decolua/9router: Unlimited FREE AI coding. Connect Claude Code, Codex, Cursor, Cline, Copilot, Antigravity to FREE Claude/GPT/Gemini via 40+ providers. Auto-fallback, RTK -40% tokens, never hit limits.</div><div class="notion-bookmark-description">Unlimited FREE AI coding. Connect Claude Code, Codex, Cursor, Cline, Copilot, Antigravity to FREE Claude/GPT/Gemini via 40+ providers. Auto-fallback, RTK -40% tokens, never hit limits. - decolua/9r...</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=3b0710e0-1307-804c-bf69-c456616b8c2e&amp;cache=v2" alt="GitHub - decolua/9router: Unlimited FREE AI coding. Connect Claude Code, Codex, Cursor, Cline, Copilot, Antigravity to FREE Claude/GPT/Gemini via 40+ providers. Auto-fallback, RTK -40% tokens, never hit limits." loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/decolua/9router</div></div></div></a></div><div class="notion-blank notion-block-3a8710e0130780a68eaefe5240c7918c"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-334710e01307804e8f5dda4511600d9c" href="https://github.com/AprilNEA/BYOKEY"><div><div class="notion-bookmark-title">GitHub - AprilNEA/BYOKEY: Turn AI subscriptions into standard API endpoints. OpenAI &amp; Anthropic compatible gateway — for Amp Code, Cursor, Factory CLI, and more.</div><div class="notion-bookmark-description">Turn AI subscriptions into standard API endpoints. OpenAI &amp; Anthropic compatible gateway — for Amp Code, Cursor, Factory CLI, and more. - AprilNEA/BYOKEY</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=334710e0-1307-804e-8f5d-da4511600d9c&amp;cache=v2" alt="GitHub - AprilNEA/BYOKEY: Turn AI subscriptions into standard API endpoints. OpenAI &amp; Anthropic compatible gateway — for Amp Code, Cursor, Factory CLI, and more." loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/AprilNEA/BYOKEY</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2F433d5112bd06908a88497865108719e551d0c11b8476b85e04b9f1608b52ea90%2FAprilNEA%2FBYOKEY?table=block&amp;id=334710e0-1307-804e-8f5d-da4511600d9c&amp;cache=v2" alt="GitHub - AprilNEA/BYOKEY: Turn AI subscriptions into standard API endpoints. OpenAI &amp; Anthropic compatible gateway — for Amp Code, Cursor, Factory CLI, and more." loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-334710e013078092922ce5d3b476ab92"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-2f4710e01307807b9822c006a2339c5c" href="https://github.com/sgl-project/sglang/tree/main/sgl-model-gateway"><div><div class="notion-bookmark-title">sglang/sgl-model-gateway at main · sgl-project/sglang</div><div class="notion-bookmark-description">SGLang is a high-performance serving framework for large language models and multimodal models. - sgl-project/sglang</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=2f4710e0-1307-807b-9822-c006a2339c5c&amp;cache=v2" alt="sglang/sgl-model-gateway at main · sgl-project/sglang" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/sgl-project/sglang/tree/main/sgl-model-gateway</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2Fd778493b767e09a607fcef49daf44d491453876509268968500af06eff5499d3%2Fsgl-project%2Fsglang?table=block&amp;id=2f4710e0-1307-807b-9822-c006a2339c5c&amp;cache=v2" alt="sglang/sgl-model-gateway at main · sgl-project/sglang" loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-2fc710e0130780f0b69bf7d59e0f7ff4"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-2fc710e0130780aa84dee3cbdd54b1ee" href="https://github.com/nghyane/llm-mux"><div><div class="notion-bookmark-title">GitHub - nghyane/llm-mux: AI Gateway: Claude Pro, Copilot, Gemini subscriptions → OpenAI/Anthropic/Gemini APIs. No API keys needed.</div><div class="notion-bookmark-description">AI Gateway: Claude Pro, Copilot, Gemini subscriptions → OpenAI/Anthropic/Gemini APIs. No API keys needed. - nghyane/llm-mux</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=2fc710e0-1307-80aa-84de-e3cbdd54b1ee&amp;cache=v2" alt="GitHub - nghyane/llm-mux: AI Gateway: Claude Pro, Copilot, Gemini subscriptions → OpenAI/Anthropic/Gemini APIs. No API keys needed." loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/nghyane/llm-mux</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2F0c006bd0066592f388c6331ef0e5db91bf0551942fd1f0ce20c8cb8304469542%2Fnghyane%2Fllm-mux?table=block&amp;id=2fc710e0-1307-80aa-84de-e3cbdd54b1ee&amp;cache=v2" alt="GitHub - nghyane/llm-mux: AI Gateway: Claude Pro, Copilot, Gemini subscriptions → OpenAI/Anthropic/Gemini APIs. No API keys needed." loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-2f4710e0130780a28779ce3b72b694d5"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-2e5710e01307808089dbe631c8c1b3bc" href="https://github.com/BerriAI/litellm"><div><div class="notion-bookmark-title">GitHub - BerriAI/litellm: Python SDK, Proxy Server (AI Gateway) to call 100+ LLM APIs in OpenAI (or native) format, with cost tracking, guardrails, loadbalancing and logging. [Bedrock, Azure, OpenAI, VertexAI, Cohere, Anthropic, Sagemaker, HuggingFace, VLLM, NVIDIA NIM]</div><div class="notion-bookmark-description">Python SDK, Proxy Server (AI Gateway) to call 100+ LLM APIs in OpenAI (or native) format, with cost tracking, guardrails, loadbalancing and logging. [Bedrock, Azure, OpenAI, VertexAI, Cohere, Anthr...</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=2e5710e0-1307-8080-89db-e631c8c1b3bc&amp;cache=v2" alt="GitHub - BerriAI/litellm: Python SDK, Proxy Server (AI Gateway) to call 100+ LLM APIs in OpenAI (or native) format, with cost tracking, guardrails, loadbalancing and logging. [Bedrock, Azure, OpenAI, VertexAI, Cohere, Anthropic, Sagemaker, HuggingFace, VLLM, NVIDIA NIM]" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/BerriAI/litellm</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2F547378fdc33198308a6d4ff604d25ad47289d224231d4d7dcfcff31144703928%2FBerriAI%2Flitellm?table=block&amp;id=2e5710e0-1307-8080-89db-e631c8c1b3bc&amp;cache=v2" alt="GitHub - BerriAI/litellm: Python SDK, Proxy Server (AI Gateway) to call 100+ LLM APIs in OpenAI (or native) format, with cost tracking, guardrails, loadbalancing and logging. [Bedrock, Azure, OpenAI, VertexAI, Cohere, Anthropic, Sagemaker, HuggingFace, VLLM, NVIDIA NIM]" loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-32f710e0130780c58a21c73c5a789315"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-32f710e0130780a391b6e690053a4b03" href="https://github.com/maximhq/bifrost"><div><div class="notion-bookmark-title">GitHub - maximhq/bifrost: Fastest enterprise AI gateway (50x faster than LiteLLM) with adaptive load balancer, cluster mode, guardrails, 1000+ models support &amp; &lt;100 µs overhead at 5k RPS.</div><div class="notion-bookmark-description">Fastest enterprise AI gateway (50x faster than LiteLLM) with adaptive load balancer, cluster mode, guardrails, 1000+ models support &amp; &lt;100 µs overhead at 5k RPS. - maximhq/bifrost</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=32f710e0-1307-80a3-91b6-e690053a4b03&amp;cache=v2" alt="GitHub - maximhq/bifrost: Fastest enterprise AI gateway (50x faster than LiteLLM) with adaptive load balancer, cluster mode, guardrails, 1000+ models support &amp; &lt;100 µs overhead at 5k RPS." loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/maximhq/bifrost</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2F2b184c96eccae386747a18b68a21b57bd6f06df4ccc5f970bc46e0efdaf9bf4c%2Fmaximhq%2Fbifrost?table=block&amp;id=32f710e0-1307-80a3-91b6-e690053a4b03&amp;cache=v2" alt="GitHub - maximhq/bifrost: Fastest enterprise AI gateway (50x faster than LiteLLM) with adaptive load balancer, cluster mode, guardrails, 1000+ models support &amp; &lt;100 µs overhead at 5k RPS." loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-32f710e013078075b717e9bde3673015"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-2e5710e01307802fb8a9fc75e7a2d4db" href="https://github.com/QuantumNous/new-api"><div><div class="notion-bookmark-title">GitHub - QuantumNous/new-api: AI模型聚合管理中转分发系统，一个应用管理您的所有AI模型，支持将多种大模型转为统一格式调用，支持OpenAI、Claude、Gemini等格式，可供个人或者企业内部管理与分发渠道使用。🍥 A Unified AI Model Management &amp; Distribution System. Aggregate all your LLMs into one app and access them via an OpenAI-compatible API, with native support for Claude (Messages) and Gemini formats.</div><div class="notion-bookmark-description">AI模型聚合管理中转分发系统，一个应用管理您的所有AI模型，支持将多种大模型转为统一格式调用，支持OpenAI、Claude、Gemini等格式，可供个人或者企业内部管理与分发渠道使用。🍥 A Unified AI Model Management &amp;amp;amp; Distribution System. Aggregate all your LLMs into one app and ...</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=2e5710e0-1307-802f-b8a9-fc75e7a2d4db&amp;cache=v2" alt="GitHub - QuantumNous/new-api: AI模型聚合管理中转分发系统，一个应用管理您的所有AI模型，支持将多种大模型转为统一格式调用，支持OpenAI、Claude、Gemini等格式，可供个人或者企业内部管理与分发渠道使用。🍥 A Unified AI Model Management &amp; Distribution System. Aggregate all your LLMs into one app and access them via an OpenAI-compatible API, with native support for Claude (Messages) and Gemini formats." loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/QuantumNous/new-api</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2F3c686e5598e793f7fcc7a9d25c1fedd010b3ff3b7f4ba2d9459b2b9b4b0c43c6%2FQuantumNous%2Fnew-api?table=block&amp;id=2e5710e0-1307-802f-b8a9-fc75e7a2d4db&amp;cache=v2" alt="GitHub - QuantumNous/new-api: AI模型聚合管理中转分发系统，一个应用管理您的所有AI模型，支持将多种大模型转为统一格式调用，支持OpenAI、Claude、Gemini等格式，可供个人或者企业内部管理与分发渠道使用。🍥 A Unified AI Model Management &amp; Distribution System. Aggregate all your LLMs into one app and access them via an OpenAI-compatible API, with native support for Claude (Messages) and Gemini formats." loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-2e5710e0130780eba975f7b59da004d4"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-2e5710e013078019bcf7cf233cc4096b" href="https://github.com/songquanpeng/one-api"><div><div class="notion-bookmark-title">GitHub - songquanpeng/one-api: LLM API 管理 &amp; 分发系统，支持 OpenAI、Azure、Anthropic Claude、Google Gemini、DeepSeek、字节豆包、ChatGLM、文心一言、讯飞星火、通义千问、360 智脑、腾讯混元等主流模型，统一 API 适配，可用于 key 管理与二次分发。单可执行文件，提供 Docker 镜像，一键部署，开箱即用。LLM API management &amp; key redistribution system, unifying multiple providers under a single API. Single binary, Docker-ready, with an English UI.</div><div class="notion-bookmark-description">LLM API 管理 &amp;amp;amp; 分发系统，支持 OpenAI、Azure、Anthropic Claude、Google Gemini、DeepSeek、字节豆包、ChatGLM、文心一言、讯飞星火、通义千问、360 智脑、腾讯混元等主流模型，统一 API 适配，可用于 key 管理与二次分发。单可执行文件，提供 Docker 镜像，一键部署，开箱即用。LLM API manage...</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=2e5710e0-1307-8019-bcf7-cf233cc4096b&amp;cache=v2" alt="GitHub - songquanpeng/one-api: LLM API 管理 &amp; 分发系统，支持 OpenAI、Azure、Anthropic Claude、Google Gemini、DeepSeek、字节豆包、ChatGLM、文心一言、讯飞星火、通义千问、360 智脑、腾讯混元等主流模型，统一 API 适配，可用于 key 管理与二次分发。单可执行文件，提供 Docker 镜像，一键部署，开箱即用。LLM API management &amp; key redistribution system, unifying multiple providers under a single API. Single binary, Docker-ready, with an English UI." loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/songquanpeng/one-api</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2Fdab882d76c4088ce67b781567940b07f8f01eadbc22213603879cf2b52c73e90%2Fsongquanpeng%2Fone-api?table=block&amp;id=2e5710e0-1307-8019-bcf7-cf233cc4096b&amp;cache=v2" alt="GitHub - songquanpeng/one-api: LLM API 管理 &amp; 分发系统，支持 OpenAI、Azure、Anthropic Claude、Google Gemini、DeepSeek、字节豆包、ChatGLM、文心一言、讯飞星火、通义千问、360 智脑、腾讯混元等主流模型，统一 API 适配，可用于 key 管理与二次分发。单可执行文件，提供 Docker 镜像，一键部署，开箱即用。LLM API management &amp; key redistribution system, unifying multiple providers under a single API. Single binary, Docker-ready, with an English UI." loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-2ef710e0130780da81cdf6871b4cb876"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-2ef710e013078060bcfef51522623433" href="https://github.com/odahpen/claude-code-hub"><div><div class="notion-bookmark-title">GitHub - odahpen/claude-code-hub: 🚀 Unify, manage, and optimize multiple AI service APIs with Claude Code Hub for seamless integration and real-time monitoring.</div><div class="notion-bookmark-description">🚀 Unify, manage, and optimize multiple AI service APIs with Claude Code Hub for seamless integration and real-time monitoring. - odahpen/claude-code-hub</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=2ef710e0-1307-8060-bcfe-f51522623433&amp;cache=v2" alt="GitHub - odahpen/claude-code-hub: 🚀 Unify, manage, and optimize multiple AI service APIs with Claude Code Hub for seamless integration and real-time monitoring." loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/odahpen/claude-code-hub</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2F3296fe82887aef9caad823e746c3bc95770866c9941bb4a73f5cad7634e39266%2Fodahpen%2Fclaude-code-hub?table=block&amp;id=2ef710e0-1307-8060-bcfe-f51522623433&amp;cache=v2" alt="GitHub - odahpen/claude-code-hub: 🚀 Unify, manage, and optimize multiple AI service APIs with Claude Code Hub for seamless integration and real-time monitoring." loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-2e5710e013078030abe8db3409698959"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-2e5710e0130780479675ed5bdab60b3e" href="https://github.com/MartialBE/one-hub"><div><div class="notion-bookmark-title">GitHub - MartialBE/one-hub: OpenAI 接口管理 &amp; 分发系统，改自songquanpeng/one-api。支持更多模型，加入统计页面，完善非openai模型的函数调用。</div><div class="notion-bookmark-description">OpenAI 接口管理 &amp; 分发系统，改自songquanpeng/one-api。支持更多模型，加入统计页面，完善非openai模型的函数调用。 - MartialBE/one-hub</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=2e5710e0-1307-8047-9675-ed5bdab60b3e&amp;cache=v2" alt="GitHub - MartialBE/one-hub: OpenAI 接口管理 &amp; 分发系统，改自songquanpeng/one-api。支持更多模型，加入统计页面，完善非openai模型的函数调用。" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/MartialBE/one-hub</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2Fc8682be23a2cb7175c402c97da5c4d1fea50aa9c24f1667b0b15545f22d53592%2FMartialBE%2Fone-hub?table=block&amp;id=2e5710e0-1307-8047-9675-ed5bdab60b3e&amp;cache=v2" alt="GitHub - MartialBE/one-hub: OpenAI 接口管理 &amp; 分发系统，改自songquanpeng/one-api。支持更多模型，加入统计页面，完善非openai模型的函数调用。" loading="lazy" decoding="async"/></div></a></div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-2e5710e0130780f9b2d0e210327c02e3" href="https://github.com/deanxv/done-hub"><div><div class="notion-bookmark-title">GitHub - deanxv/done-hub</div><div class="notion-bookmark-description">Contribute to deanxv/done-hub development by creating an account on GitHub.</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=2e5710e0-1307-80f9-b2d0-e210327c02e3&amp;cache=v2" alt="GitHub - deanxv/done-hub" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/deanxv/done-hub</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2Ff5a7c2dee5a8c1c4a66ca7c816ddd3194009237acd135dfc92c84b706db8051b%2Fdeanxv%2Fdone-hub?table=block&amp;id=2e5710e0-1307-80f9-b2d0-e210327c02e3&amp;cache=v2" alt="GitHub - deanxv/done-hub" loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-2ec710e0130780fa892bfa7b0f8be3ca"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-2ec710e013078017ab09f8c10f2fe1f1" href="https://github.com/tbphp/gpt-load"><div><div class="notion-bookmark-title">GitHub - tbphp/gpt-load: Multi-channel AI proxy with intelligent key rotation. 智能密钥轮询的多渠道 AI 代理。</div><div class="notion-bookmark-description">Multi-channel AI proxy with intelligent key rotation. 智能密钥轮询的多渠道 AI 代理。 - tbphp/gpt-load</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=2ec710e0-1307-8017-ab09-f8c10f2fe1f1&amp;cache=v2" alt="GitHub - tbphp/gpt-load: Multi-channel AI proxy with intelligent key rotation. 智能密钥轮询的多渠道 AI 代理。" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/tbphp/gpt-load</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Frepository-images.githubusercontent.com%2F997490512%2F4a1b7303-f754-461b-a4f5-7ffd490c64a9?table=block&amp;id=2ec710e0-1307-8017-ab09-f8c10f2fe1f1&amp;cache=v2" alt="GitHub - tbphp/gpt-load: Multi-channel AI proxy with intelligent key rotation. 智能密钥轮询的多渠道 AI 代理。" loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-2e5710e0130780c38a47c9d771bb486d"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-2e5710e0130780d4baf3c7cf2fb75ce6" href="https://github.com/yym68686/uni-api"><div><div class="notion-bookmark-title">GitHub - yym68686/uni-api: This is a project that unifies the management of LLM APIs. It can call multiple backend services through a unified API interface, convert them to the OpenAI format uniformly, and support load balancing. Currently supported backend services include: OpenAI, Anthropic, DeepBricks, OpenRouter, Gemini, Vertex, etc.</div><div class="notion-bookmark-description">This is a project that unifies the management of LLM APIs. It can call multiple backend services through a unified API interface, convert them to the OpenAI format uniformly, and support load balan...</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=2e5710e0-1307-80d4-baf3-c7cf2fb75ce6&amp;cache=v2" alt="GitHub - yym68686/uni-api: This is a project that unifies the management of LLM APIs. It can call multiple backend services through a unified API interface, convert them to the OpenAI format uniformly, and support load balancing. Currently supported backend services include: OpenAI, Anthropic, DeepBricks, OpenRouter, Gemini, Vertex, etc." loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/yym68686/uni-api</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2F4f5c47590a986298efca9682d156035d23858acd0d1d9356e78101b7d9cf54a9%2Fyym68686%2Funi-api?table=block&amp;id=2e5710e0-1307-80d4-baf3-c7cf2fb75ce6&amp;cache=v2" alt="GitHub - yym68686/uni-api: This is a project that unifies the management of LLM APIs. It can call multiple backend services through a unified API interface, convert them to the OpenAI format uniformly, and support load balancing. Currently supported backend services include: OpenAI, Anthropic, DeepBricks, OpenRouter, Gemini, Vertex, etc." loading="lazy" decoding="async"/></div></a></div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-2e5710e0130780299828eac8d24a7f75" href="https://github.com/yym68686/uni-api-web"><div><div class="notion-bookmark-title">GitHub - yym68686/uni-api-web: uni-api web frontend</div><div class="notion-bookmark-description">uni-api web frontend. Contribute to yym68686/uni-api-web development by creating an account on GitHub.</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=2e5710e0-1307-8029-9828-eac8d24a7f75&amp;cache=v2" alt="GitHub - yym68686/uni-api-web: uni-api web frontend" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/yym68686/uni-api-web</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2F4987a7df61e80c8ff7abd7c02772338d506f412c9dac6e10fbc7a71444569fcf%2Fyym68686%2Funi-api-web?table=block&amp;id=2e5710e0-1307-8029-9828-eac8d24a7f75&amp;cache=v2" alt="GitHub - yym68686/uni-api-web: uni-api web frontend" loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-2e5710e0130780bf9ca5d0fa8456973b"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-2e5710e01307801c8f3be4009839b2dd" href="https://github.com/looplj/axonhub"><div><div class="notion-bookmark-title">GitHub - looplj/axonhub: AxonHub is a modern AI gateway system that provides a unified OpenAI ( Chat Completion, Responses), Anthropic, Gemini and AI SDK compatible API</div><div class="notion-bookmark-description">AxonHub is a modern AI gateway system that provides a unified OpenAI ( Chat Completion, Responses), Anthropic, Gemini and AI SDK compatible API - looplj/axonhub</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=2e5710e0-1307-801c-8f3b-e4009839b2dd&amp;cache=v2" alt="GitHub - looplj/axonhub: AxonHub is a modern AI gateway system that provides a unified OpenAI ( Chat Completion, Responses), Anthropic, Gemini and AI SDK compatible API" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/looplj/axonhub</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2F8f309c5c353d6f6dc4159c7b9b4b595235f6ccbe7f92f89b3523be21e27bf0dc%2Flooplj%2Faxonhub?table=block&amp;id=2e5710e0-1307-801c-8f3b-e4009839b2dd&amp;cache=v2" alt="GitHub - looplj/axonhub: AxonHub is a modern AI gateway system that provides a unified OpenAI ( Chat Completion, Responses), Anthropic, Gemini and AI SDK compatible API" loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-2e5710e013078015bcd2d34b083597d3"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-2e5710e0130780198902ceadee56cb00" href="https://github.com/poixeai/proxify"><div><div class="notion-bookmark-title">GitHub - poixeai/proxify: An open-source, lightweight, and self-hosted reverse proxy gateway for AI APIs</div><div class="notion-bookmark-description">An open-source, lightweight, and self-hosted reverse proxy gateway for AI APIs - poixeai/proxify</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=2e5710e0-1307-8019-8902-ceadee56cb00&amp;cache=v2" alt="GitHub - poixeai/proxify: An open-source, lightweight, and self-hosted reverse proxy gateway for AI APIs" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/poixeai/proxify</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2Ffcc55935720ea5ef480d88516b5c5ce61e52cf14a296a91f2bc28dacdeb3d7d9%2Fpoixeai%2Fproxify?table=block&amp;id=2e5710e0-1307-8019-8902-ceadee56cb00&amp;cache=v2" alt="GitHub - poixeai/proxify: An open-source, lightweight, and self-hosted reverse proxy gateway for AI APIs" loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-2e5710e0130780f58ad4ddfad29ee293"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-2e5710e0130780a9b342cdcd4213617b" href="https://github.com/bestruirui/octopus"><div><div class="notion-bookmark-title">GitHub - bestruirui/octopus: One Hub All LLMs For You | 为个人打造的 LLM API 聚合服务</div><div class="notion-bookmark-description">One Hub All LLMs For You | 为个人打造的 LLM API 聚合服务. Contribute to bestruirui/octopus development by creating an account on GitHub.</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=2e5710e0-1307-80a9-b342-cdcd4213617b&amp;cache=v2" alt="GitHub - bestruirui/octopus: One Hub All LLMs For You | 为个人打造的 LLM API 聚合服务" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/bestruirui/octopus</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2Fc657c0867889c9b19c0dbb8ac39ccf8b6f0db47ac80183fe96a64a239eda4a1b%2Fbestruirui%2Foctopus?table=block&amp;id=2e5710e0-1307-80a9-b342-cdcd4213617b&amp;cache=v2" alt="GitHub - bestruirui/octopus: One Hub All LLMs For You | 为个人打造的 LLM API 聚合服务" loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-2e5710e0130780048f7ddd9075c51179"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-2e5710e01307802eb615e58c1fb3ec10" href="https://github.com/Wei-Shaw/sub2api"><div><div class="notion-bookmark-title">GitHub - Wei-Shaw/sub2api: Sub2API-CRS2 一站式开源中转服务，让 Claude、Openai 、Gemini、Antigravity订阅统一接入，支持拼车共享，更高效分摊成本，原生工具无缝使用。</div><div class="notion-bookmark-description">Sub2API-CRS2 一站式开源中转服务，让 Claude、Openai 、Gemini、Antigravity订阅统一接入，支持拼车共享，更高效分摊成本，原生工具无缝使用。 - Wei-Shaw/sub2api</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=2e5710e0-1307-802e-b615-e58c1fb3ec10&amp;cache=v2" alt="GitHub - Wei-Shaw/sub2api: Sub2API-CRS2 一站式开源中转服务，让 Claude、Openai 、Gemini、Antigravity订阅统一接入，支持拼车共享，更高效分摊成本，原生工具无缝使用。" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/Wei-Shaw/sub2api</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2F0fd1b972300eeee549b24b0d234ab071564266849461f808903c81a432539120%2FWei-Shaw%2Fsub2api?table=block&amp;id=2e5710e0-1307-802e-b615-e58c1fb3ec10&amp;cache=v2" alt="GitHub - Wei-Shaw/sub2api: Sub2API-CRS2 一站式开源中转服务，让 Claude、Openai 、Gemini、Antigravity订阅统一接入，支持拼车共享，更高效分摊成本，原生工具无缝使用。" loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-2e5710e0130780bc9b67ef3b0d0907a9"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-2e5710e01307806ead12c45ce08c8f94" href="https://github.com/aiclientproxy/proxycast/"><div><div class="notion-bookmark-title">GitHub - aiclientproxy/proxycast: 让 AI 编辑器之间自然流动，不仅仅可以其他工具使用，也可以转换成 api 为本地开发提供动力。</div><div class="notion-bookmark-description">让 AI 编辑器之间自然流动，不仅仅可以其他工具使用，也可以转换成 api 为本地开发提供动力。. Contribute to aiclientproxy/proxycast development by creating an account on GitHub.</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=2e5710e0-1307-806e-ad12-c45ce08c8f94&amp;cache=v2" alt="GitHub - aiclientproxy/proxycast: 让 AI 编辑器之间自然流动，不仅仅可以其他工具使用，也可以转换成 api 为本地开发提供动力。" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/aiclientproxy/proxycast/</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2F36e5a13d20a66c9425778c954d38d5f070329569d9e7d2a4d75f3c8604535fef%2Faiclientproxy%2Fproxycast?table=block&amp;id=2e5710e0-1307-806e-ad12-c45ce08c8f94&amp;cache=v2" alt="GitHub - aiclientproxy/proxycast: 让 AI 编辑器之间自然流动，不仅仅可以其他工具使用，也可以转换成 api 为本地开发提供动力。" loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-2e5710e01307802a9cb3e05b0918fe3b"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-32d710e01307804d893ad31aba919753" href="https://github.com/LeenHawk/gproxy"><div><div class="notion-bookmark-title">GitHub - LeenHawk/gproxy: gproxy is a Rust-based multi-channel LLM proxy that exposes OpenAI / Claude / Gemini-style APIs through a unified gateway, with a built-in admin console, user/key management, and request/usage auditing.</div><div class="notion-bookmark-description">gproxy is a Rust-based multi-channel LLM proxy that exposes OpenAI / Claude / Gemini-style APIs through a unified gateway, with a built-in admin console, user/key management, and request/usage audi...</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=32d710e0-1307-804d-893a-d31aba919753&amp;cache=v2" alt="GitHub - LeenHawk/gproxy: gproxy is a Rust-based multi-channel LLM proxy that exposes OpenAI / Claude / Gemini-style APIs through a unified gateway, with a built-in admin console, user/key management, and request/usage auditing." loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/LeenHawk/gproxy</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2F8824d321752513a9e024766fcc7d6f51378f44d11bcf0f026858cdf54d757a1d%2FLeenHawk%2Fgproxy?table=block&amp;id=32d710e0-1307-804d-893a-d31aba919753&amp;cache=v2" alt="GitHub - LeenHawk/gproxy: gproxy is a Rust-based multi-channel LLM proxy that exposes OpenAI / Claude / Gemini-style APIs through a unified gateway, with a built-in admin console, user/key management, and request/usage auditing." loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-32d710e0130780038b84eaf24bb6111a"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-2e5710e0130780c48588efe7961c5f40" href="https://github.com/Kong/kong"><div><div class="notion-bookmark-title">GitHub - Kong/kong: 🦍 The Cloud-Native Gateway for APIs &amp; AI</div><div class="notion-bookmark-description">🦍 The Cloud-Native Gateway for APIs &amp; AI. Contribute to Kong/kong development by creating an account on GitHub.</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=2e5710e0-1307-80c4-8588-efe7961c5f40&amp;cache=v2" alt="GitHub - Kong/kong: 🦍 The Cloud-Native Gateway for APIs &amp; AI" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/Kong/kong</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2F28f321e086f09e34aed295695680144204e61d0983689d544142f0d16048bcd9%2FKong%2Fkong?table=block&amp;id=2e5710e0-1307-80c4-8588-efe7961c5f40&amp;cache=v2" alt="GitHub - Kong/kong: 🦍 The Cloud-Native Gateway for APIs &amp; AI" loading="lazy" decoding="async"/></div></a></div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-2e5710e0130780c4bb1bf1eb423d1c45" href="https://github.com/APIParkLab/APIPark"><div><div class="notion-bookmark-title">GitHub - APIParkLab/APIPark: Cloud native, ultra-high performance AI&amp;API gateway, LLM API management, distribution system, open platform, supporting all AI APIs.🦄云原生、超高性能 AI&amp;API网关，LLM API 管理、分发系统、开放平台，支持所有AI API，不限于OpenAI、Azure、Anthropic Claude、Google Gemini、DeepSeek、字节豆包、ChatGLM、文心一言、讯飞星火、通义千问、360 智脑、腾讯混元等主流模型，统一 API 请求和返回，API申请与审批，调用统计、负载均衡、多模型灾备。一键部署，开箱即用。</div><div class="notion-bookmark-description">Cloud native, ultra-high performance AI&amp;amp;amp;API gateway, LLM API management, distribution system, open platform, supporting all AI APIs.🦄云原生、超高性能 AI&amp;amp;amp;API网关，LLM API 管理、分发系统、开放平台，支持所有AI AP...</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=2e5710e0-1307-80c4-bb1b-f1eb423d1c45&amp;cache=v2" alt="GitHub - APIParkLab/APIPark: Cloud native, ultra-high performance AI&amp;API gateway, LLM API management, distribution system, open platform, supporting all AI APIs.🦄云原生、超高性能 AI&amp;API网关，LLM API 管理、分发系统、开放平台，支持所有AI API，不限于OpenAI、Azure、Anthropic Claude、Google Gemini、DeepSeek、字节豆包、ChatGLM、文心一言、讯飞星火、通义千问、360 智脑、腾讯混元等主流模型，统一 API 请求和返回，API申请与审批，调用统计、负载均衡、多模型灾备。一键部署，开箱即用。" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/APIParkLab/APIPark</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2Fedc54d45955bf692ae1dd10620f538700e6f132a360f9677543f0c19e1327273%2FAPIParkLab%2FAPIPark?table=block&amp;id=2e5710e0-1307-80c4-bb1b-f1eb423d1c45&amp;cache=v2" alt="GitHub - APIParkLab/APIPark: Cloud native, ultra-high performance AI&amp;API gateway, LLM API management, distribution system, open platform, supporting all AI APIs.🦄云原生、超高性能 AI&amp;API网关，LLM API 管理、分发系统、开放平台，支持所有AI API，不限于OpenAI、Azure、Anthropic Claude、Google Gemini、DeepSeek、字节豆包、ChatGLM、文心一言、讯飞星火、通义千问、360 智脑、腾讯混元等主流模型，统一 API 请求和返回，API申请与审批，调用统计、负载均衡、多模型灾备。一键部署，开箱即用。" loading="lazy" decoding="async"/></div></a></div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-2e5710e01307804aad2fdb546a079f1e" href="https://github.com/alibaba/higress"><div><div class="notion-bookmark-title">GitHub - alibaba/higress: 🤖 AI Gateway | AI Native API Gateway</div><div class="notion-bookmark-description">🤖 AI Gateway | AI Native API Gateway. Contribute to alibaba/higress development by creating an account on GitHub.</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=2e5710e0-1307-804a-ad2f-db546a079f1e&amp;cache=v2" alt="GitHub - alibaba/higress: 🤖 AI Gateway | AI Native API Gateway" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/alibaba/higress</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2F3f84c2bb79da39cfcccbb0f6ca1a8a199cc9a6ad84dbb998f4279afc07259d93%2Falibaba%2Fhigress?table=block&amp;id=2e5710e0-1307-804a-ad2f-db546a079f1e&amp;cache=v2" alt="GitHub - alibaba/higress: 🤖 AI Gateway | AI Native API Gateway" loading="lazy" decoding="async"/></div></a></div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-2e5710e01307808b91e5ee1260a2696e" href="https://github.com/Portkey-AI/gateway"><div><div class="notion-bookmark-title">GitHub - Portkey-AI/gateway: A blazing fast AI Gateway with integrated guardrails. Route to 200+ LLMs, 50+ AI Guardrails with 1 fast &amp; friendly API.</div><div class="notion-bookmark-description">A blazing fast AI Gateway with integrated guardrails. Route to 200+ LLMs, 50+ AI Guardrails with 1 fast &amp; friendly API. - Portkey-AI/gateway</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=2e5710e0-1307-808b-91e5-ee1260a2696e&amp;cache=v2" alt="GitHub - Portkey-AI/gateway: A blazing fast AI Gateway with integrated guardrails. Route to 200+ LLMs, 50+ AI Guardrails with 1 fast &amp; friendly API." loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/Portkey-AI/gateway</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Frepository-images.githubusercontent.com%2F682080300%2F49aed41d-0c1b-4c19-97fa-8a61e4f8ef67?table=block&amp;id=2e5710e0-1307-808b-91e5-ee1260a2696e&amp;cache=v2" alt="GitHub - Portkey-AI/gateway: A blazing fast AI Gateway with integrated guardrails. Route to 200+ LLMs, 50+ AI Guardrails with 1 fast &amp; friendly API." loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-2e5710e0130780faaccdf83b7998f8cb"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-2e5710e0130780d68bcdc53007ab124c" href="https://github.com/fruitbars/simple-one-api"><div><div class="notion-bookmark-title">GitHub - fruitbars/simple-one-api: OpenAI 接口接入适配，支持千帆大模型平台、讯飞星火大模型、腾讯混元以及MiniMax、Deep-Seek，等兼容OpenAI接口，仅单可执行文件，配置超级简单，一键部署，开箱即用.  Seamlessly integrate with OpenAI and compatible APIs using a single executable for quick setup and deployment.</div><div class="notion-bookmark-description">OpenAI 接口接入适配，支持千帆大模型平台、讯飞星火大模型、腾讯混元以及MiniMax、Deep-Seek，等兼容OpenAI接口，仅单可执行文件，配置超级简单，一键部署，开箱即用.  Seamlessly integrate with OpenAI and compatible APIs using a single executable for quick setup and dep...</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=2e5710e0-1307-80d6-8bcd-c53007ab124c&amp;cache=v2" alt="GitHub - fruitbars/simple-one-api: OpenAI 接口接入适配，支持千帆大模型平台、讯飞星火大模型、腾讯混元以及MiniMax、Deep-Seek，等兼容OpenAI接口，仅单可执行文件，配置超级简单，一键部署，开箱即用.  Seamlessly integrate with OpenAI and compatible APIs using a single executable for quick setup and deployment." loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/fruitbars/simple-one-api</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2F6f68316eaeb9b8bf11e662514376752c1c43e0258ac1a745e93db5bace9dae5d%2Ffruitbars%2Fsimple-one-api?table=block&amp;id=2e5710e0-1307-80d6-8bcd-c53007ab124c&amp;cache=v2" alt="GitHub - fruitbars/simple-one-api: OpenAI 接口接入适配，支持千帆大模型平台、讯飞星火大模型、腾讯混元以及MiniMax、Deep-Seek，等兼容OpenAI接口，仅单可执行文件，配置超级简单，一键部署，开箱即用.  Seamlessly integrate with OpenAI and compatible APIs using a single executable for quick setup and deployment." loading="lazy" decoding="async"/></div></a></div><hr class="notion-hr notion-block-2e5710e0130780098c6ad4eb60cd4329"/><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-2e5710e01307800883e6f6f4eaaecc09" href="https://github.com/qixing-jk/all-api-hub"><div><div class="notion-bookmark-title">GitHub - qixing-jk/all-api-hub: 统一管理第三方 AI 聚合中转站与自建 New API：自动识别账号、查看余额、同步模型、管理密钥，全平台与云端备份 | Unified management of third-party AI aggregation transfer stations and self-built New API: automatic account identification, balance viewing, model synchronization, key management, and full-platform and cloud backup</div><div class="notion-bookmark-description">统一管理第三方 AI 聚合中转站与自建 New API：自动识别账号、查看余额、同步模型、管理密钥，全平台与云端备份 | Unified management of third-party AI aggregation transfer stations and self-built New API: automatic account identification, balance vie...</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=2e5710e0-1307-8008-83e6-f6f4eaaecc09&amp;cache=v2" alt="GitHub - qixing-jk/all-api-hub: 统一管理第三方 AI 聚合中转站与自建 New API：自动识别账号、查看余额、同步模型、管理密钥，全平台与云端备份 | Unified management of third-party AI aggregation transfer stations and self-built New API: automatic account identification, balance viewing, model synchronization, key management, and full-platform and cloud backup" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/qixing-jk/all-api-hub</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2F14034c9fb8bc4e6f3e39540328b50736a0632954f46a0233938b9515e18ccfe5%2Fqixing-jk%2Fall-api-hub?table=block&amp;id=2e5710e0-1307-8008-83e6-f6f4eaaecc09&amp;cache=v2" alt="GitHub - qixing-jk/all-api-hub: 统一管理第三方 AI 聚合中转站与自建 New API：自动识别账号、查看余额、同步模型、管理密钥，全平台与云端备份 | Unified management of third-party AI aggregation transfer stations and self-built New API: automatic account identification, balance viewing, model synchronization, key management, and full-platform and cloud backup" loading="lazy" decoding="async"/></div></a></div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-32f710e01307802b9237fef8ce569df1" href="https://github.com/cita-777/metapi"><div><div class="notion-bookmark-title">GitHub - cita-777/metapi: 把你在各处注册的 New API / One API / OneHub / DoneHub / Veloera / AnyRouter / Sub2API 等站点， 汇聚成 一个 API Key、一个入口，自动发现模型、智能路由、成本最优</div><div class="notion-bookmark-description">把你在各处注册的 New API / One API / OneHub / DoneHub / Veloera / AnyRouter / Sub2API 等站点， 汇聚成 一个 API Key、一个入口，自动发现模型、智能路由、成本最优 - cita-777/metapi</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=32f710e0-1307-802b-9237-fef8ce569df1&amp;cache=v2" alt="GitHub - cita-777/metapi: 把你在各处注册的 New API / One API / OneHub / DoneHub / Veloera / AnyRouter / Sub2API 等站点， 汇聚成 一个 API Key、一个入口，自动发现模型、智能路由、成本最优" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/cita-777/metapi</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2Fde5ff91105130a812a1cd0afa72e2965e34b6ba2e2a21ee959431a9122709000%2Fcita-777%2Fmetapi?table=block&amp;id=32f710e0-1307-802b-9237-fef8ce569df1&amp;cache=v2" alt="GitHub - cita-777/metapi: 把你在各处注册的 New API / One API / OneHub / DoneHub / Veloera / AnyRouter / Sub2API 等站点， 汇聚成 一个 API Key、一个入口，自动发现模型、智能路由、成本最优" loading="lazy" decoding="async"/></div></a></div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-362710e01307807a9091d9b576bb456e" href="https://github.com/mcowger/plexus"><div><div class="notion-bookmark-title">GitHub - mcowger/plexus: Unified API gateway for multiple AI providers (OpenAI, Anthropic, Gemini, etc.). Switch models and providers without changing client code. Features OAuth authentication, quota tracking, embeddings, transcriptions, and OpenAI-compatible endpoints.</div><div class="notion-bookmark-description">Unified API gateway for multiple AI providers (OpenAI, Anthropic, Gemini, etc.). Switch models and providers without changing client code. Features OAuth authentication, quota tracking, embeddings,...</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=362710e0-1307-807a-9091-d9b576bb456e&amp;cache=v2" alt="GitHub - mcowger/plexus: Unified API gateway for multiple AI providers (OpenAI, Anthropic, Gemini, etc.). Switch models and providers without changing client code. Features OAuth authentication, quota tracking, embeddings, transcriptions, and OpenAI-compatible endpoints." loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/mcowger/plexus</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2F1ffe954341bce731a8df063c831da23af236a8a1817cdc5726e09ea11da48795%2Fmcowger%2Fplexus?table=block&amp;id=362710e0-1307-807a-9091-d9b576bb456e&amp;cache=v2" alt="GitHub - mcowger/plexus: Unified API gateway for multiple AI providers (OpenAI, Anthropic, Gemini, etc.). Switch models and providers without changing client code. Features OAuth authentication, quota tracking, embeddings, transcriptions, and OpenAI-compatible endpoints." loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-36b710e0130780e09c78c5c81faef604"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-36b710e01307809d85d4ed28d7834f57" href="https://github.com/tashfeenahmed/freellmapi"><div><div class="notion-bookmark-title">GitHub - tashfeenahmed/freellmapi: OpenAI-compatible proxy that aggregates free-tier keys from ~14 AI providers with automatic failover. For personal experimentation only.</div><div class="notion-bookmark-description">OpenAI-compatible proxy that aggregates free-tier keys from ~14 AI providers with automatic failover. For personal experimentation only. - tashfeenahmed/freellmapi</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=36b710e0-1307-809d-85d4-ed28d7834f57&amp;cache=v2" alt="GitHub - tashfeenahmed/freellmapi: OpenAI-compatible proxy that aggregates free-tier keys from ~14 AI providers with automatic failover. For personal experimentation only." loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/tashfeenahmed/freellmapi</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2F36793f7aaa4ec8a398403e0b21e6dad12aa9514237485c63a2dd62f2dac445ac%2Ftashfeenahmed%2Ffreellmapi?table=block&amp;id=36b710e0-1307-809d-85d4-ed28d7834f57&amp;cache=v2" alt="GitHub - tashfeenahmed/freellmapi: OpenAI-compatible proxy that aggregates free-tier keys from ~14 AI providers with automatic failover. For personal experimentation only." loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-3ac710e0130780f3a8b4f57530d20e2f"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-3ac710e0130780f9bdf1dfb95c32de8e" href="https://github.com/sh2001sh/CodeGo-Api"><div><div class="notion-bookmark-title">GitHub - sh2001sh/CodeGo-Api</div><div class="notion-bookmark-description">Contribute to sh2001sh/CodeGo-Api development by creating an account on GitHub.</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=3ac710e0-1307-80f9-bdf1-dfb95c32de8e&amp;cache=v2" alt="GitHub - sh2001sh/CodeGo-Api" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/sh2001sh/CodeGo-Api</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2Fbfe522d9bbe9445659315d8535da588e4fd416f9c255233187e5262d429810f1%2Fsh2001sh%2FCodeGo-Api?table=block&amp;id=3ac710e0-1307-80f9-bdf1-dfb95c32de8e&amp;cache=v2" alt="GitHub - sh2001sh/CodeGo-Api" loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-3be710e01307800d83a3f796a61113fc"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-3be710e013078022a4f8f95f6cf0104b" href="https://github.com/oai404iao/ai_gateway"><div><div class="notion-bookmark-title">GitHub - oai404iao/ai_gateway</div><div class="notion-bookmark-description">Contribute to oai404iao/ai_gateway development by creating an account on GitHub.</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=3be710e0-1307-8022-a4f8-f95f6cf0104b&amp;cache=v2" alt="GitHub - oai404iao/ai_gateway" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/oai404iao/ai_gateway</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2Fc60632b774d556c0acafaa4cfbda76f7c1af6edb3ea91076e5f4fa911e4657cd%2Foai404iao%2Fai_gateway?table=block&amp;id=3be710e0-1307-8022-a4f8-f95f6cf0104b&amp;cache=v2" alt="GitHub - oai404iao/ai_gateway" loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-3cb710e013078080820df2adb506ab5f"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-3cb710e013078020b97dd330e7529c69" href="https://github.com/workweave/router"><div><div class="notion-bookmark-title">GitHub - workweave/router: Model router for agentic systems. Routes every prompt to the right model in &lt;50ms. Cut costs 40-70% with just an endpoint change.</div><div class="notion-bookmark-description">Model router for agentic systems. Routes every prompt to the right model in &lt;50ms. Cut costs 40-70% with just an endpoint change. - workweave/router</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=3cb710e0-1307-8020-b97d-d330e7529c69&amp;cache=v2" alt="GitHub - workweave/router: Model router for agentic systems. Routes every prompt to the right model in &lt;50ms. Cut costs 40-70% with just an endpoint change." loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/workweave/router</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2F9baccd1dc0c7cf8a3daf98a6289b324558ea4bf27f114b3c623e3c1fe0191f37%2Fworkweave%2Frouter?table=block&amp;id=3cb710e0-1307-8020-b97d-d330e7529c69&amp;cache=v2" alt="GitHub - workweave/router: Model router for agentic systems. Routes every prompt to the right model in &lt;50ms. Cut costs 40-70% with just an endpoint change." loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-3cd710e01307806789fdf7f7c5083cdd"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-3cd710e013078088a3fcda4cab723a1e" href="https://github.com/BloretCrew/CrewRouter"><div><div class="notion-bookmark-title">GitHub - BloretCrew/CrewRouter: Your Team with AI, AI with provider.</div><div class="notion-bookmark-description">Your Team with AI, AI with provider. Contribute to BloretCrew/CrewRouter development by creating an account on GitHub.</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=3cd710e0-1307-8088-a3fc-da4cab723a1e&amp;cache=v2" alt="GitHub - BloretCrew/CrewRouter: Your Team with AI, AI with provider." loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/BloretCrew/CrewRouter</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2F884f0974e51a8105a8f36b2a2b5fa7809d0984d0f21463193197eb2303b293d9%2FBloretCrew%2FCrewRouter?table=block&amp;id=3cd710e0-1307-8088-a3fc-da4cab723a1e&amp;cache=v2" alt="GitHub - BloretCrew/CrewRouter: Your Team with AI, AI with provider." loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-3cf710e0130780eea77bec47339f717d"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-3cf710e01307808ca5feec86ab15f06d" href="https://github.com/tbphp/gpt-load"><div><div class="notion-bookmark-title">GitHub - tbphp/gpt-load: Self-hosted AI gateway for multi-channel, multi-credential setups — API keys and subscription accounts, scheduling, failover, request logs and usage. 自托管 AI 网关：多渠道多凭据统一接入，含密钥与订阅账号、调度容错、日志与用量。</div><div class="notion-bookmark-description">Self-hosted AI gateway for multi-channel, multi-credential setups — API keys and subscription accounts, scheduling, failover, request logs and usage. 自托管 AI 网关：多渠道多凭据统一接入，含密钥与订阅账号、调度容错、日志与用量。 - tbp...</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=3cf710e0-1307-808c-a5fe-ec86ab15f06d&amp;cache=v2" alt="GitHub - tbphp/gpt-load: Self-hosted AI gateway for multi-channel, multi-credential setups — API keys and subscription accounts, scheduling, failover, request logs and usage. 自托管 AI 网关：多渠道多凭据统一接入，含密钥与订阅账号、调度容错、日志与用量。" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/tbphp/gpt-load</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Frepository-images.githubusercontent.com%2F997490512%2F15c18033-ca22-44b8-ac2a-de94cad0dfde?table=block&amp;id=3cf710e0-1307-808c-a5fe-ec86ab15f06d&amp;cache=v2" alt="GitHub - tbphp/gpt-load: Self-hosted AI gateway for multi-channel, multi-credential setups — API keys and subscription accounts, scheduling, failover, request logs and usage. 自托管 AI 网关：多渠道多凭据统一接入，含密钥与订阅账号、调度容错、日志与用量。" loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-3cf710e01307803ead3afeeb2d9adff3"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-3cf710e013078072aaa8f9462c3ceec6" href="https://github.com/experientiallabs/experiential"><div><div class="notion-bookmark-title">GitHub - experientiallabs/experiential: An open source model gateway that provides one control plane across closed, open-source, local, and custom models.</div><div class="notion-bookmark-description">An open source model gateway that provides one control plane across closed, open-source, local, and custom models. - experientiallabs/experiential</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=3cf710e0-1307-8072-aaa8-f9462c3ceec6&amp;cache=v2" alt="GitHub - experientiallabs/experiential: An open source model gateway that provides one control plane across closed, open-source, local, and custom models." loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/experientiallabs/experiential</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2Fb1b768f4376e39ee57887ae8758958f003f48e9aaf4e8114cd822810292ca127%2Fexperientiallabs%2Fexperiential?table=block&amp;id=3cf710e0-1307-8072-aaa8-f9462c3ceec6&amp;cache=v2" alt="GitHub - experientiallabs/experiential: An open source model gateway that provides one control plane across closed, open-source, local, and custom models." loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-3cf710e0130780f8afa3fb82dc6eedf5"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-3cf710e01307802a9a9ded4afa8da134" href="https://github.com/TokenFlux/TokenRouter"><div><div class="notion-bookmark-title">GitHub - TokenFlux/TokenRouter: tokenrouter is the next generation llm gateway</div><div class="notion-bookmark-description">tokenrouter is the next generation llm gateway. Contribute to TokenFlux/TokenRouter development by creating an account on GitHub.</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=3cf710e0-1307-802a-9a9d-ed4afa8da134&amp;cache=v2" alt="GitHub - TokenFlux/TokenRouter: tokenrouter is the next generation llm gateway" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/TokenFlux/TokenRouter</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2Fc9354b043627326be09811f1b2bb21951009b3272a94d63e5a68b2020f5fbda7%2FTokenFlux%2FTokenRouter?table=block&amp;id=3cf710e0-1307-802a-9a9d-ed4afa8da134&amp;cache=v2" alt="GitHub - TokenFlux/TokenRouter: tokenrouter is the next generation llm gateway" loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-3cf710e0130780d4be4ed72fafa18a9b"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-3cf710e0130780c7b135e4e714cdad33" href="https://github.com/decolua/9router"><div><div class="notion-bookmark-title">GitHub - decolua/9router: Unlimited FREE AI coding. Connect Claude Code, Codex, Cursor, Cline, Copilot, Antigravity to FREE Claude/GPT/Gemini via 40+ providers. Auto-fallback, RTK -40% tokens, never hit limits.</div><div class="notion-bookmark-description">Unlimited FREE AI coding. Connect Claude Code, Codex, Cursor, Cline, Copilot, Antigravity to FREE Claude/GPT/Gemini via 40+ providers. Auto-fallback, RTK -40% tokens, never hit limits. - decolua/9r...</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=3cf710e0-1307-80c7-b135-e4e714cdad33&amp;cache=v2" alt="GitHub - decolua/9router: Unlimited FREE AI coding. Connect Claude Code, Codex, Cursor, Cline, Copilot, Antigravity to FREE Claude/GPT/Gemini via 40+ providers. Auto-fallback, RTK -40% tokens, never hit limits." loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/decolua/9router</div></div></div></a></div><div class="notion-blank notion-block-3d1710e0130780da9991ee6e461035d3"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-3d1710e0130780aab93dd680e087463a" href="https://github.com/diegosouzapw/OmniRoute"><div><div class="notion-bookmark-title">GitHub - diegosouzapw/OmniRoute: Never stop coding. Free MIT AI gateway: one endpoint, 350 providers (90+ free), 1200+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline &amp; Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 450+ contributors</div><div class="notion-bookmark-description">Never stop coding. Free MIT AI gateway: one endpoint, 350 providers (90+ free), 1200+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Clin...</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=3d1710e0-1307-80aa-b93d-d680e087463a&amp;cache=v2" alt="GitHub - diegosouzapw/OmniRoute: Never stop coding. Free MIT AI gateway: one endpoint, 350 providers (90+ free), 1200+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline &amp; Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 450+ contributors" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/diegosouzapw/OmniRoute</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2Ff7401fe8d1ca5b71877fc3624e3dff2298f8dbb5305a4bffb777ad696f248029%2Fdiegosouzapw%2FOmniRoute?table=block&amp;id=3d1710e0-1307-80aa-b93d-d680e087463a&amp;cache=v2" alt="GitHub - diegosouzapw/OmniRoute: Never stop coding. Free MIT AI gateway: one endpoint, 350 providers (90+ free), 1200+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline &amp; Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 450+ contributors" loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-3d4710e01307805c979ff763f3ef8e0d"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-3d4710e0130780de865ddce695fa2fdc" href="https://github.com/experientiallabs/experiential"><div><div class="notion-bookmark-title">GitHub - experientiallabs/experiential: Experiential is the open source, zero markup gateway for BYOK, self-hosted and 1000+ marketplace models. It learns from your traffic to cut costs, recommend better models, and train a specialized model you own.</div><div class="notion-bookmark-description">Experiential is the open source, zero markup gateway for BYOK, self-hosted and 1000+ marketplace models. It learns from your traffic to cut costs, recommend better models, and train a specialized m...</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=3d4710e0-1307-80de-865d-dce695fa2fdc&amp;cache=v2" alt="GitHub - experientiallabs/experiential: Experiential is the open source, zero markup gateway for BYOK, self-hosted and 1000+ marketplace models. It learns from your traffic to cut costs, recommend better models, and train a specialized model you own." loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/experientiallabs/experiential</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2F93b75eee8470d75d5057d67af5bae36e929338f72ec0aee2d978b5fd17148151%2Fexperientiallabs%2Fexperiential?table=block&amp;id=3d4710e0-1307-80de-865d-dce695fa2fdc&amp;cache=v2" alt="GitHub - experientiallabs/experiential: Experiential is the open source, zero markup gateway for BYOK, self-hosted and 1000+ marketplace models. It learns from your traffic to cut costs, recommend better models, and train a specialized model you own." loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-3d7710e0130780218451fceb3781f7e0"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-3d7710e013078090b02fc30f9ffa0f40" href="https://github.com/theagentrouter/agent-router"><div><div class="notion-bookmark-title">GitHub - theagentrouter/agent-router: Manages Unified Access to Generative AI Services built on Envoy Gateway</div><div class="notion-bookmark-description">Manages Unified Access to Generative AI Services built on Envoy Gateway - theagentrouter/agent-router</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=3d7710e0-1307-8090-b02f-c30f9ffa0f40&amp;cache=v2" alt="GitHub - theagentrouter/agent-router: Manages Unified Access to Generative AI Services built on Envoy Gateway" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/theagentrouter/agent-router</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Frepository-images.githubusercontent.com%2F875880554%2F15016dc6-7ff9-47dc-be4b-e026064757e3?table=block&amp;id=3d7710e0-1307-8090-b02f-c30f9ffa0f40&amp;cache=v2" alt="GitHub - theagentrouter/agent-router: Manages Unified Access to Generative AI Services built on Envoy Gateway" loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-3dd710e01307806b8849cb117441d89d"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-3dd710e013078090a6fdda75a534b0a0" href="https://github.com/fongap/ai-gateway"><div><div class="notion-bookmark-title">GitHub - fongap/ai-gateway: Resilient AI gateway that turns fragmented providers, keys and quotas into one dependable endpoint.</div><div class="notion-bookmark-description">Resilient AI gateway that turns fragmented providers, keys and quotas into one dependable endpoint. - fongap/ai-gateway</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=3dd710e0-1307-8090-a6fd-da75a534b0a0&amp;cache=v2" alt="GitHub - fongap/ai-gateway: Resilient AI gateway that turns fragmented providers, keys and quotas into one dependable endpoint." loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/fongap/ai-gateway</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2F2c9d5ae7a7148b01070c6e92b32295c1e8eeceb99e3945ff6aa2443dc522fcbc%2Ffongap%2Fai-gateway?table=block&amp;id=3dd710e0-1307-8090-a6fd-da75a534b0a0&amp;cache=v2" alt="GitHub - fongap/ai-gateway: Resilient AI gateway that turns fragmented providers, keys and quotas into one dependable endpoint." loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-3dd710e01307806aba57c52d2a675968"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-3dd710e01307800e8444e34745a938d3" href="https://github.com/api7/aisix"><div><div class="notion-bookmark-title">GitHub - api7/aisix: Open-source AI gateway for LLMs &amp; AI agents, built in Rust. One OpenAI-compatible API for OpenAI, Anthropic, Gemini, Bedrock &amp; more — routing, guardrails, caching, rate limits, observability.</div><div class="notion-bookmark-description">Open-source AI gateway for LLMs &amp;amp;amp; AI agents, built in Rust. One OpenAI-compatible API for OpenAI, Anthropic, Gemini, Bedrock &amp;amp;amp; more — routing, guardrails, caching, rate limits, obse...</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=3dd710e0-1307-800e-8444-e34745a938d3&amp;cache=v2" alt="GitHub - api7/aisix: Open-source AI gateway for LLMs &amp; AI agents, built in Rust. One OpenAI-compatible API for OpenAI, Anthropic, Gemini, Bedrock &amp; more — routing, guardrails, caching, rate limits, observability." loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/api7/aisix</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2F61d9c10defbb0957166198a9171be981f2e28d939f182a5fb10a510e88e3f122%2Fapi7%2Faisix?table=block&amp;id=3dd710e0-1307-800e-8444-e34745a938d3&amp;cache=v2" alt="GitHub - api7/aisix: Open-source AI gateway for LLMs &amp; AI agents, built in Rust. One OpenAI-compatible API for OpenAI, Anthropic, Gemini, Bedrock &amp; more — routing, guardrails, caching, rate limits, observability." loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-3e8710e0130780e3992fd6673f61a3d4"> </div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-3e8710e013078098979cf77b437d2d66" href="https://github.com/zyycn/codex-proxy-rs"><div><div class="notion-bookmark-title">GitHub - zyycn/codex-proxy-rs: 基于 Rust 的低风控、自托管 Codex 多账号透明代理网关</div><div class="notion-bookmark-description">基于 Rust 的低风控、自托管 Codex 多账号透明代理网关. Contribute to zyycn/codex-proxy-rs development by creating an account on GitHub.</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=3e8710e0-1307-8098-979c-f77b437d2d66&amp;cache=v2" alt="GitHub - zyycn/codex-proxy-rs: 基于 Rust 的低风控、自托管 Codex 多账号透明代理网关" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/zyycn/codex-proxy-rs</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fopengraph.githubassets.com%2F8c9846c024943b472e8027f6690b5bb5aa8dcc05ec56532ac12f750222d86f4a%2Fzyycn%2Fcodex-proxy-rs?table=block&amp;id=3e8710e0-1307-8098-979c-f77b437d2d66&amp;cache=v2" alt="GitHub - zyycn/codex-proxy-rs: 基于 Rust 的低风控、自托管 Codex 多账号透明代理网关" loading="lazy" decoding="async"/></div></a></div></main>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Debian 12 升级 Debian 13 简单记录]]></title>
            <link>https://okhk.net/upgrade-debian-12-to-13-note</link>
            <guid>https://okhk.net/upgrade-debian-12-to-13-note</guid>
            <pubDate>Sat, 09 Aug 2025 16:00:00 GMT</pubDate>
            <description><![CDATA[文章记录了从 Debian 12 (Bookworm) 升级到 Debian 13 (Trixie) 的步骤，升级过程包括系统更新、修改软件源（引入 deb822 新格式）、检查磁盘空间、使用 screen 防止中断，并执行 apt full-upgrade 命令。升级后，文章还指出需注意 sysctl 配置文件的变化、/tmp 目录的内存存储特性，以及可选移除 exim4 和 apparmor 软件包。]]></description>
            <content:encoded><![CDATA[<main class="notion light-mode notion-page notion-block-24b710e01307807cb52fe147e286edb7"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><blockquote class="notion-quote notion-block-24b710e013078093b33bd364e32b743d"><div><b>Debian</b> 项目发布了最新的稳定版本 Debian 13，代号为“trixie”。该版本历经两年多的开发，于 2025 年 8 月 9 日发布。</div></blockquote><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-24b710e0130780a78b19d45fb8419257" href="https://www.debian.org/releases/trixie/release-notes/index.zh_CN.html"><div><div class="notion-bookmark-title">Debian 13 (trixie) 的发行说明 — release-notes  文档</div><div class="notion-bookmark-description">本程序发布的目的是希望它对您有用，但没有任何担保，甚至不保证它有经济价值和适合特定用途。请查阅 GNU 通用公共许可证以获得更多细节。</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fwww.debian.org%2Ffavicon.ico?table=block&amp;id=24b710e0-1307-80a7-8b19-d45fb8419257&amp;cache=v2" alt="Debian 13 (trixie) 的发行说明 — release-notes  文档" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://www.debian.org/releases/trixie/release-notes/index.zh_CN.html</div></div></div></a></div><div class="notion-callout notion-gray_background_co notion-block-24b710e013078094a611e41139e0dc51"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="⚠️">⚠️</span></div><div class="notion-callout-text"><div class="notion-text notion-block-24b710e01307802289dae82e015ca18b"><b>Debian</b> 作为以稳定著称的 Linux 发行版，大版本升级可以说是其“不稳定”的时刻了，升级需谨慎。稳妥起见，一定要做好备份！</div></div></div><div class="notion-text notion-block-24b710e01307807e95c2e79f65f74c05">官方的升级注意事项说明：<a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://www.debian.org/releases/trixie/release-notes/issues.html">Debian 12 升级 Debian 13 需要注意的 Breaking Change</a><b> </b></div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-24b710e01307807f8458dc61988b68eb" data-id="24b710e01307807f8458dc61988b68eb"><span><div id="24b710e01307807f8458dc61988b68eb" class="notion-header-anchor"></div><a class="notion-hash-link" href="#24b710e01307807f8458dc61988b68eb" title="准备工作"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">准备工作</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-24b710e01307809e873ac39eb61a85b1" data-id="24b710e01307809e873ac39eb61a85b1"><span><div id="24b710e01307809e873ac39eb61a85b1" class="notion-header-anchor"></div><a class="notion-hash-link" href="#24b710e01307809e873ac39eb61a85b1" title="核对当前系统版本"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">核对当前系统版本</span></span></h4><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-24b710e0130780d2a5f0ef9221ab1051"><div style="position:relative;display:flex;justify-content:center;align-self:start;width:528px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2F4df7276c-5db1-45bd-b306-e85242c73164%2Fimage.png%3Ftable%3Dblock%26id%3D24b710e0-1307-80d2-a5f0-ef9221ab1051%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3D1KS9yzi1YLyzqdLApFOQIa9E9hQZm2lzgz808j0C4wE?table=block&amp;id=24b710e0-1307-80d2-a5f0-ef9221ab1051&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-24b710e013078052beb3d5b671279d54"><div style="position:relative;display:flex;justify-content:center;align-self:start;width:528px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2Fde11fac0-974c-412a-aa85-6b5b15c65aa8%2Fimage.png%3Ftable%3Dblock%26id%3D24b710e0-1307-8052-beb3-d5b671279d54%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3DtDfiMyXwInU-eX6XXgjPLPV7ZK93vTrJ1RPrJPd7LKE?table=block&amp;id=24b710e0-1307-8052-beb3-d5b671279d54&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-24b710e0130780169234f5d355b51739" data-id="24b710e0130780169234f5d355b51739"><span><div id="24b710e0130780169234f5d355b51739" class="notion-header-anchor"></div><a class="notion-hash-link" href="#24b710e0130780169234f5d355b51739" title="更新系统软件包"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">更新系统软件包</span></span></h4><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">sudo apt update
sudo apt upgrade -y
sudo apt autoclean
sudo apt autoremove -y</code></pre><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-24b710e0130780fba9f5f770df32ba88" data-id="24b710e0130780fba9f5f770df32ba88"><span><div id="24b710e0130780fba9f5f770df32ba88" class="notion-header-anchor"></div><a class="notion-hash-link" href="#24b710e0130780fba9f5f770df32ba88" title="软件源配置"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">软件源配置</span></span></h4><div class="notion-text notion-block-24b710e0130780749e8deb940b14d166">自 2025 年 2 月起，Debian 13（Trixie）和 APT 引入了 deb822 格式来管理 APT 源。这种新格式用更具结构化和可读性的 ⁠<code class="notion-inline-code">/etc/apt/sources.list.d/debian.sources</code> 文件取代了传统的 <code class="notion-inline-code">⁠/etc/apt/sources.list</code> 文件。</div><ul class="notion-list notion-list-disc notion-block-24b710e0130780808c4cc058fb8a11af"><li><b>单行格式</b> (<code class="notion-inline-code">.list</code>) ：传统格式，所有 APT 版本都支持，但已被弃用，预计在 2029 年后移除。</li></ul><ul class="notion-list notion-list-disc notion-block-24b710e01307800b940add8384dae2dc"><li><b>deb822 格式</b> (<code class="notion-inline-code">.sources</code>)：新版格式，可读性更佳，更易于扩展和修改，已成为推荐格式。<b>Debian 13</b> 正式版及后续版本均使用此格式。</li></ul><div class="notion-blank notion-block-24c710e01307805ebbb6c8e3b65f99c8"> </div><details class="notion-toggle notion-block-24b710e01307800e8071c570f6e188a1"><summary><b>🔍 点击展开查看两种配置格式</b></summary><div><div class="notion-text notion-block-24b710e0130780f286d0cb03ae00f284">传统单行格式：<code class="notion-inline-code">/etc/apt/sources.list</code><b> </b></div><pre class="notion-code language-plain text" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-plain text">deb [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://deb.debian.org/debian trixie main contrib non-free non-free-firmware
deb [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://deb.debian.org/debian trixie-updates main contrib non-free non-free-firmware
deb [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://deb.debian.org/debian-security trixie-security main contrib non-free non-free-firmware</code></pre><div class="notion-text notion-block-24b710e013078026b78fd52445593d18">新版 deb822 格式：<code class="notion-inline-code">/etc/apt/sources.list.d/debian.sources</code></div><pre class="notion-code language-plain text" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-plain text">Types: deb
URIs: http://deb.debian.org/debian
Suites: trixie trixie-updates
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
Types: deb
URIs: http://deb.debian.org/debian-security
Suites: trixie-security
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg</code></pre></div></details><div class="notion-blank notion-block-24c710e0130780c28b75ef8d5d50648b"> </div><div class="notion-text notion-block-24b710e01307801b91edfb2b539b2057">目前短时间内，按照”<s>祖宗之法</s>“用老格式没啥问题。
当然使用新的 deb822 格式软件源配置文件更好，毕竟大势所趋。</div><div class="notion-text notion-block-24c710e0130780658d7dc97ffbe28403">可先按照传统格式软件源修改，<a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://okhk.net/upgrade-debian-12-to-13-note#24c710e013078069904bf8a9ea20940d">升级到 Debian 13 后再转换为新的 deb822 格式</a>（参考本文末尾）。</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-24b710e0130780538b3cce432a64faf2" href="https://manpages.debian.org/testing/apt/sources.list.5.en.html"><div><div class="notion-bookmark-title">sources.list(5) — apt — Debian testing — Debian Manpages</div><div class="notion-bookmark-description">The source list /etc/apt/sources.list and the files contained in
    /etc/apt/sources.list.d/ are designed to support any number of active
    sources and a variety of source media. The files list one source per line
    (one-line style) or contain multiline stanzas defining one or more sources
    per stanza (deb822 style), with the most preferred source listed first (in
    case a single version is available from more than one source). The
    information available from the configured sources is acquired by apt-get
    update (or by an equivalent command from another APT front-end).</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fmanpages.debian.org%2Ffavicon.ico?table=block&amp;id=24b710e0-1307-8053-8b3c-ce432a64faf2&amp;cache=v2" alt="sources.list(5) — apt — Debian testing — Debian Manpages" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://manpages.debian.org/testing/apt/sources.list.5.en.html</div></div></div></a></div><div class="notion-text notion-block-24b710e0130780bda1f6ce6839623731">视自身环境实际情况执行如下命令修改 Debian 13 软件源</div><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">sudo sed -i &#x27;s/bookworm/trixie/g&#x27; /etc/apt/sources.list

# 要注意之前引入的第三方软件源是否有适配 Debian 13，如无建议不要修改或者暂时禁用
# sudo sed -i &#x27;s/bookworm/trixie/g&#x27; /etc/apt/sources.list.d/*.list
# 修改第三方软件源也可执行如下命令
# sudo find /etc/apt/sources.list.d -type f -exec sed -i &#x27;s/bookworm/trixie/g&#x27; {} \;

# 如已使用 deb822 格式软件源，则执行下面的命令
sudo sed -i &#x27;s/bookworm/trixie/g&#x27; /etc/apt/sources.list.d/*.sources</code></pre><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-24b710e013078092ba1fd1a8db6585df" data-id="24b710e013078092ba1fd1a8db6585df"><span><div id="24b710e013078092ba1fd1a8db6585df" class="notion-header-anchor"></div><a class="notion-hash-link" href="#24b710e013078092ba1fd1a8db6585df" title="磁盘空间"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">磁盘空间</span></span></h4><div class="notion-text notion-block-24b710e01307802f8c8cd3d0ae66a03b">升级需要预留一定的空闲磁盘空间。</div><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell"># 查看磁盘空间，（稳妥起见剩余空间大于 5GB 最好，如果仅仅是 Docker 服务的话，1GB 或许也够）
df -h

sudo apt update

# 通过下述命令来预估一下更新的软件包大小，执行结果类似👇的图示
sudo apt -o APT::Get::Trivial-Only=true full-upgrade</code></pre><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-24b710e0130780f5b50ed3e1550a50c5"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2Faa3b5c26-a709-429b-b4a6-bf2413e81552%2Fimage.png%3Ftable%3Dblock%26id%3D24b710e0-1307-80f5-b50e-d3e1550a50c5%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3DHYJ-0NN4dHhi3SKi1OzDxGALybiYQ1k8WEYUXLrBjc8?table=block&amp;id=24b710e0-1307-80f5-b50e-d3e1550a50c5&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-24b710e0130780e39719e1224d2e2395">如果没有足够的空间进行升级， <code class="notion-inline-code">apt</code> 将显示类似这样的消息警告：</div><div class="notion-text notion-block-24b710e0130780428c9cdaf664bc175b"><code class="notion-inline-code">E: You don&#x27;t have enough free space in /var/cache/apt/archives/.</code></div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-24b710e01307802890eee04cf589440b" data-id="24b710e01307802890eee04cf589440b"><span><div id="24b710e01307802890eee04cf589440b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#24b710e01307802890eee04cf589440b" title="更新"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">更新</span></span></h3><div class="notion-text notion-block-24c710e01307809ca7fbd93c9c71b746">为避免 SSH 连接中断而影响系统升级，可以通过 screen 来保证执行更新。</div><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">sudo apt install -y screen &amp;&amp; screen</code></pre><div class="notion-text notion-block-24b710e013078045abf6d2d7d8965ca7">完成上述准备工作后，即可执行命令升级系统</div><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">sudo apt update

# 如果磁盘空间紧张，可执行 apt upgrade --without-new-pkgs 进行最小化更新
sudo apt upgrade -y

# 版本升级命令
sudo apt full-upgrade -y

# 在上述命令升级完成没报错后执行下面的命令，也可以在 reboot 后执行
sudo apt autoclean
sudo apt autoremove -y

sudo reboot</code></pre><div class="notion-text notion-block-24b710e0130780a88001c12d33082f07">更新过程中惯例会提示一些软件的配置文件是否需要更新，可视情况保留原样还是覆盖使用，默认是使用现有的配置，一些软件提示是否需要自动重启全都 Yes 即可。</div><div class="notion-blank notion-block-24b710e0130780e1a37cd832781b5d6b"> </div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-24b710e0130780778383fdd46ac5d7c3" data-id="24b710e0130780778383fdd46ac5d7c3"><span><div id="24b710e0130780778383fdd46ac5d7c3" class="notion-header-anchor"></div><a class="notion-hash-link" href="#24b710e0130780778383fdd46ac5d7c3" title="核对版本"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">核对版本</span></span></h4><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">sudo cat /etc/debian_version
sudo cat /etc/os-release
sudo uname -a</code></pre><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-24c710e0130780f5bbc8f6e0c1aa807c"><div style="position:relative;display:flex;justify-content:center;align-self:start;width:432px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2F85cb1870-1c04-44b4-a6e9-b24266c20d83%2Fimage.png%3Ftable%3Dblock%26id%3D24c710e0-1307-80f5-bbc8-f6e0c1aa807c%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3DfJV2m2u5t_1JC7axnGnJ0Hr1CnXfduQ_OvIP_MokRfE?table=block&amp;id=24c710e0-1307-80f5-bbc8-f6e0c1aa807c&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-24c710e013078077828cc4a35f9070da">以上就完成了 Debian 系统升级。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-24c710e0130780cb88d3de8756ecb39f" data-id="24c710e0130780cb88d3de8756ecb39f"><span><div id="24c710e0130780cb88d3de8756ecb39f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#24c710e0130780cb88d3de8756ecb39f" title="P.S."><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">P.S.</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-24c710e01307802ca173eef4148d2f46" data-id="24c710e01307802ca173eef4148d2f46"><span><div id="24c710e01307802ca173eef4148d2f46" class="notion-header-anchor"></div><a class="notion-hash-link" href="#24c710e01307802ca173eef4148d2f46" title="Debian 13 升级杂项"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">Debian 13 升级杂项</span></span></h4><ul class="notion-list notion-list-disc notion-block-24c710e0130780a9a57df16fa159a892"><li>Debian 13 上 <code class="notion-inline-code">sysctl</code> 由 systemd-sysctl 控制了，原有的 <code class="notion-inline-code">/etc/sysctl.conf</code> 配置文件不再生效， 配置需要全部放在 <code class="notion-inline-code">/etc/sysctl.d/</code> 目录下</li></ul><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell"># 恢复原有 sysctl 配置到 /etc/sysctl.d/ 目录
sudo mv /etc/sysctl.conf.dpkg-bak /etc/sysctl.d/99-sysctl.conf

# 应用配置生效，代替原来的 sysctl -p 命令，交由 Systemd 控制
sudo systemctl restart systemd-sysctl.service</code></pre><ul class="notion-list notion-list-disc notion-block-24c710e0130780f7bbabcacf4895585f"><li>Debian 13 上，临时文件目录 <code class="notion-inline-code">/tmp</code> 存储在 tmpfs （存储在内存）中，默认会分配最大内存值最多 50% ， <code class="notion-inline-code">/tmp</code>和<code class="notion-inline-code">/var/tmp</code>会定期删除其中的旧文件，前者是 10 天，后者是 30 天。小内存机器可以执行如下命令修改</li></ul><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">sudo systemctl edit tmp.mount</code></pre><ul class="notion-list notion-list-disc notion-block-24c710e0130780c78e8fca528e211901"><li>系统升级到 Debian 13 后，会自动捆绑安装 <code class="notion-inline-code">exim4</code> 邮件服务器，不需要可删除</li></ul><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">sudo apt autopurge -y exim*</code></pre><ul class="notion-list notion-list-disc notion-block-24c710e01307806394a4d2be6355778d"><li>系统升级 Debian 13 后，如出现部分应用无权限或报权限异常，可移除 <code class="notion-inline-code">apparmor</code> 包</li></ul><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">sudo apt autopurge -y apparmor</code></pre><ul class="notion-list notion-list-disc notion-block-24c710e013078030aae4ce9cb9890755"><li>Debian 13 禁用默认开启的审计日志</li></ul><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">sudo systemctl disable --now systemd-journald-audit.socket</code></pre><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-24c710e013078069904bf8a9ea20940d" data-id="24c710e013078069904bf8a9ea20940d"><span><div id="24c710e013078069904bf8a9ea20940d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#24c710e013078069904bf8a9ea20940d" title="转换 APT 软件源配置为 deb822 格式"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">转换 APT 软件源配置为 deb822 格式</span></span></h4><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">sudo apt modernize-sources</code></pre><div class="notion-text notion-block-24c710e0130780fe8b51eba6e9cd9485">执行👆这条命令，它会自动将原有的 sources.list 单行格式软件源配置转换为新的 deb822 格式，并将其放入 <code class="notion-inline-code">/etc/apt/sources.list.d/debian.sources</code> 路径下。</div><div class="notion-text notion-block-24c710e013078053aa25f9ca16881b66">同时 APT 也会保留原有配置的备份：<code class="notion-inline-code">/etc/apt/sources.list.bak</code> 
方便在出现预期外的问题时恢复更改前状态。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-24c710e013078052b415fb36b70feef4"><div style="position:relative;display:flex;justify-content:center;align-self:start;width:576px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2F98f8c5e6-79ea-4784-818f-6a4634672334%2Fimage.png%3Ftable%3Dblock%26id%3D24c710e0-1307-8052-b415-fb36b70feef4%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3DhK2393DrcQy3RHl2RVEHU6XK_E0gj6Oiduwuw95vRaM?table=block&amp;id=24c710e0-1307-8052-b415-fb36b70feef4&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-24c710e013078078b94bf4f678e5d912">转换完成后：</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-24c710e013078022ac6ac1d748a33b4e"><div style="position:relative;display:flex;justify-content:center;align-self:start;width:576px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2F4a1ac059-265e-4a62-baf2-100ce4e733f6%2Fimage.png%3Ftable%3Dblock%26id%3D24c710e0-1307-8022-ac6a-c1d748a33b4e%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3DmxJFYWl_BwbsDmzwlO74vtFfdRNCkHgiV-exTEleyb4?table=block&amp;id=24c710e0-1307-8022-ac6a-c1d748a33b4e&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-24c710e0130780c999cbf22733edba33">转换后 <code class="notion-inline-code">trixie-backports</code> 在某些第三方镜像上可能没有 Signed-By。可以通过手动在 <code class="notion-inline-code">/etc/apt/sources.list.d/debian-backports.sources</code> 中设置 <code class="notion-inline-code">Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg</code> 来修复。</div><div class="notion-blank notion-block-24c710e0130780b3a7aaedbf572f1df4"> </div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-24c710e01307804ea794fc87588348fc" data-id="24c710e01307804ea794fc87588348fc"><span><div id="24c710e01307804ea794fc87588348fc" class="notion-header-anchor"></div><a class="notion-hash-link" href="#24c710e01307804ea794fc87588348fc" title="参考信息"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">参考信息</span></span></h4><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-24c710e013078033a76fcd6563b76d16" href="https://gist.github.com/Mealman1551/f75223b3cade0a218d51c06f6cb08f40"><div><div class="notion-bookmark-title">Debian deb822 documantation.md</div><div class="notion-bookmark-description">Debian deb822 documantation.md · GitHub</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgist.github.com%2Ffavicon.ico?table=block&amp;id=24c710e0-1307-8033-a76f-cd6563b76d16&amp;cache=v2" alt="Debian deb822 documantation.md" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://gist.github.com/Mealman1551/f75223b3cade0a218d51c06f6cb08f40</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fgithub.githubassets.com%2Fassets%2Fgist-og-image-54fd7dc0713e.png?table=block&amp;id=24c710e0-1307-8033-a76f-cd6563b76d16&amp;cache=v2" alt="Debian deb822 documantation.md" loading="lazy" decoding="async"/></div></a></div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-24c710e0130780f59652e6a39519cc47" href="https://gist.github.com/yorickdowne/3cecc7b424ce241b173510e36754af47"><div><div class="notion-bookmark-title">Debian 13 trixie upgrade</div><div class="notion-bookmark-description">Debian 13 trixie upgrade · GitHub</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgist.github.com%2Ffavicon.ico?table=block&amp;id=24c710e0-1307-80f5-9652-e6a39519cc47&amp;cache=v2" alt="Debian 13 trixie upgrade" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://gist.github.com/yorickdowne/3cecc7b424ce241b173510e36754af47</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fgithub.githubassets.com%2Fassets%2Fgist-og-image-54fd7dc0713e.png?table=block&amp;id=24c710e0-1307-80f5-9652-e6a39519cc47&amp;cache=v2" alt="Debian 13 trixie upgrade" loading="lazy" decoding="async"/></div></a></div></main>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[VSCode 的 Dev Container 配置 Docker 容器中运行 Claude Code]]></title>
            <link>https://okhk.net/claude-code-in-docker-by-vscode-devcontainer</link>
            <guid>https://okhk.net/claude-code-in-docker-by-vscode-devcontainer</guid>
            <pubDate>Sat, 12 Jul 2025 16:00:00 GMT</pubDate>
            <description><![CDATA[文章记录了在 Docker 容器中运行 AI Coding Agent（如 Claude Code）以提高安全性的方法。由于 AI Agent 可能存在绕过安全限制执行危险操作的风险，文章强调了沙盒（Sandbox）的重要性，并介绍了如何利用 VSCode 的 Dev Container 配置 Docker 环境来隔离 Claude Code，从而限制其对宿主机的访问和潜在破坏。]]></description>
            <content:encoded><![CDATA[<main class="notion light-mode notion-page notion-block-22f710e0130780b6ac73fc23fb087135"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-text notion-block-231710e0130780f0b5ddf0e30f1162fa">最近 AI Coding 工具使用的多，Gemini CLI 免费，Claude Code 高效，用起来体验确实不错。
并且可以两者搭配起来：让 Claude Code 来负责制定编码计划， 拆分计划，并调用 Gemini CLI 利用其超长的上下文来进行迭代处理，最后再由 Claude Code 来完成细节优化以及 Code Review 并修复 BUG。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-231710e0130780649027d2958237b131" data-id="231710e0130780649027d2958237b131"><span><div id="231710e0130780649027d2958237b131" class="notion-header-anchor"></div><a class="notion-hash-link" href="#231710e0130780649027d2958237b131" title="安全隐患"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">安全隐患</span></span></h3><div class="notion-text notion-block-231710e01307802289ffe19ca2ff0250">工具用起来一时爽，但是这样直接在设备上运行一个可以控制整个操作系统、访问完整文件系统的 AI Agent 还是有风险的。</div><div class="notion-text notion-block-231710e0130780428763c2fc71d20c92">虽然这类工具会在每次执行操作前进行询问批准确认（这种每次都审核确认的方案确实有效），但人总会有误操或者想偷懒的时候，或者是图省事直接用 <b>YOLO</b>（You Only Look Once）模式完全交给 AI Agent，这些场景下未知命令/脚本/代码的执行就带来了一些安全隐患，难免会出问题。</div><div class="notion-text notion-block-231710e0130780b59fedc03cd8b76a2f">比如下面这篇帖子中就提到了 Claude 模型能够绕过用户设置的命令黑名单，通过创建并运行脚本来执行被禁止的命令，例如 <code class="notion-inline-code">rm</code>。</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-231710e0130780679297fb6d9cfc5f69" href="https://forum.cursor.com/t/important-claude-has-learned-how-to-jailbreak-cursor/96702/2?ref=timsh.org"><div><div class="notion-bookmark-title">IMPORTANT: Claude has learned how to jailbreak Cursor!</div><div class="notion-bookmark-description">And it’s only the beginning, the models are getting very smart and may have been trained on how to work harder/make more efforts to achieve the user goals…</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fus1.discourse-cdn.com%2Fcursor1%2Foptimized%2F3X%2Fb%2F5%2Fb589d2dd6e979c0b0bb40fcd7db8fde744974896_2_32x32.png?table=block&amp;id=231710e0-1307-8067-9297-fb6d9cfc5f69&amp;cache=v2" alt="IMPORTANT: Claude has learned how to jailbreak Cursor!" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://forum.cursor.com/t/important-claude-has-learned-how-to-jailbreak-cursor/96702/2?ref=timsh.org</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fus1.discourse-cdn.com%2Fcursor1%2Foriginal%2F3X%2Fb%2F5%2Fb589d2dd6e979c0b0bb40fcd7db8fde744974896.png?table=block&amp;id=231710e0-1307-8067-9297-fb6d9cfc5f69&amp;cache=v2" alt="IMPORTANT: Claude has learned how to jailbreak Cursor!" loading="lazy" decoding="async"/></div></a></div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-231710e01307806a8b36c1092ec93848" data-id="231710e01307806a8b36c1092ec93848"><span><div id="231710e01307806a8b36c1092ec93848" class="notion-header-anchor"></div><a class="notion-hash-link" href="#231710e01307806a8b36c1092ec93848" title="Sandbox"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">Sandbox</span></span></h3><div class="notion-text notion-block-232710e0130780c391c4fb7879c2aa63">随着我们给到 AI 模型 / AI Agent 的权限越来越大，相应的所面临的像上文提及的安全风险和攻击手段也会越来越多， Sandbox 自然而然地成为 AI Agent 发展中一个重要的项目。</div><div class="notion-text notion-block-232710e01307800fa197de4d16bec236">Gemini CLI 中就有 Sandbox 相关的配置项，其中明确提到 Sandbox 功能用于隔离潜在危险操作，提升安全性和环境一致性。</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-232710e0130780a0aabfeca9bf046981" href="https://github.com/google-gemini/gemini-cli/blob/main/docs/sandbox.md"><div><div class="notion-bookmark-title">gemini-cli/docs/sandbox.md at main · google-gemini/gemini-cli</div><div class="notion-bookmark-description">An open-source AI agent that brings the power of Gemini directly into your terminal. - google-gemini/gemini-cli</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://www.notion.so/image/https%3A%2F%2Fgithub.com%2Ffluidicon.png?table=block&amp;id=232710e0-1307-80a0-aabf-eca9bf046981&amp;cache=v2" alt="gemini-cli/docs/sandbox.md at main · google-gemini/gemini-cli" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://github.com/google-gemini/gemini-cli/blob/main/docs/sandbox.md</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Frepository-images.githubusercontent.com%2F968197216%2F8522a757-5632-4fa4-8d01-fcc121390cb1?table=block&amp;id=232710e0-1307-80a0-aabf-eca9bf046981&amp;cache=v2" alt="gemini-cli/docs/sandbox.md at main · google-gemini/gemini-cli" loading="lazy" decoding="async"/></div></a></div><div class="notion-text notion-block-231710e0130780568f4ce962b23e4f82">如何创建更高效安全的适用于 AI Agent 的 Sandbox 环境此处不做展开。</div><div class="notion-text notion-block-232710e01307807ea46ecc9961e84d29">当前为了隔离限制 AI Agent，Docker 就是最直接的选择。把这些 AI Agent 全部放进容器内，使其只能访问到容器内部以及手动挂载上去的文件，而且它也无法对宿主机造成破坏，顶多就是容器异常而停止运行。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-22f710e0130780e3814fef8fe8a5b6ad" data-id="22f710e0130780e3814fef8fe8a5b6ad"><span><div id="22f710e0130780e3814fef8fe8a5b6ad" class="notion-header-anchor"></div><a class="notion-hash-link" href="#22f710e0130780e3814fef8fe8a5b6ad" title="Docker &amp; VSCode "><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">Docker &amp; VSCode </span></span></h3><div class="notion-text notion-block-22f710e01307801694c9c9c061b0f88f">下面是基于 VSCode 的 Dev Container 来配置 Docker 容器的记录，简短且简单。</div><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">mkdir -p ~/work-dir/claude-code/.devcontainer

touch devcontainer.json</code></pre><div class="notion-text notion-block-232710e0130780adb9eaf1453a1d6915">先创建一个文件夹，之后这个文件夹会被作为 Claude Code 和项目的根目录。再在此文件夹下创建一个名为 <code class="notion-inline-code">.devcontainer</code> 的文件夹，并在其中创建一个 <code class="notion-inline-code">devcontainer.json</code> 文件。</div><div class="notion-text notion-block-232710e0130780c9ad4af32129e67ead"><code class="notion-inline-code"><b>devcontainer.json</b></code><b> </b>文件内容如下（以 Golang 项目为例，采用了 go 的基础镜像）：</div><pre class="notion-code language-json" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-json">{
  &quot;name&quot;: &quot;Claude Code Dev Container&quot;,
  &quot;image&quot;: &quot;mcr.microsoft.com/devcontainers/go:1.24&quot;,
  &quot;features&quot;: {
    &quot;ghcr.io/devcontainers/features/node:1&quot;: {
      &quot;version&quot;: &quot;lts&quot;
    }
  },
  &quot;postCreateCommand&quot;: &quot;npm install -g @anthropic-ai/claude-code&quot;,
  &quot;customizations&quot;: {
    &quot;vscode&quot;: {
      &quot;extensions&quot;: [
        &quot;golang.Go&quot;
      ]
    }
  },
  &quot;remoteUser&quot;: &quot;vscode&quot;
}</code></pre><div class="notion-text notion-block-232710e0130780119c9defe1d5b830cd">在 VSCode 中打开 <code class="notion-inline-code">~/work-dir/claude-code</code> 目录，点击左下角图标，然后在上方中央弹出的选项中选择 ”<b>Reopen in Container“ </b>并等待容器启动即可。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-232710e01307808ca2fad4d43cf29556"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2F5b39e740-3184-46a4-be57-f769384cdaa0%2Fimage.png%3Ftable%3Dblock%26id%3D232710e0-1307-808c-a2fa-d4d43cf29556%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3DEU9bAzaLxR8cwvSBGtFS_1a6gem2IakCOv472PbGj3M?table=block&amp;id=232710e0-1307-808c-a2fa-d4d43cf29556&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-232710e01307805783c9e853360d557b"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2F99f62b36-3803-491d-a3d9-65d7da0981a9%2Fimage.png%3Ftable%3Dblock%26id%3D232710e0-1307-8057-83c9-e853360d557b%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3DFKMZSl99Ys-ymwqaqhCgna-vaPuFH-kG2sxhCR6byg0?table=block&amp;id=232710e0-1307-8057-83c9-e853360d557b&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-232710e01307800f83a4c5820f176c66">一切启动后，可以在终端执行 <code class="notion-inline-code">claude</code> 命令来使用 Claude Code 了。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-232710e0130780c3ac0fff180b458ec9"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:320px"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Ffile.notion.com%2Ff%2Ff%2F38eb7257-66ea-481f-b02f-6d5b3b01bb66%2F44000f91-2888-48ca-b23a-33fa4b58d7eb%2Fd9fadcb3-579e-4d97-b06f-df58e76ab681.png%3Ftable%3Dblock%26id%3D232710e0-1307-80c3-ac0f-ff180b458ec9%26spaceId%3D38eb7257-66ea-481f-b02f-6d5b3b01bb66%26expirationTimestamp%3D1792044000000%26signature%3D0q2wJFp-D2a-ZFsn1KIgGeAd2pNEK7dlYno7h_1f9NQ?table=block&amp;id=232710e0-1307-80c3-ac0f-ff180b458ec9&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-blank notion-block-232710e01307809fb468f9f2648c1e40"> </div></main>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Golang 编写简单的 AI Agent Demo]]></title>
            <link>https://okhk.net/simple-ai-agent-demo-in-golang</link>
            <guid>https://okhk.net/simple-ai-agent-demo-in-golang</guid>
            <pubDate>Tue, 24 Jun 2025 16:00:00 GMT</pubDate>
            <description><![CDATA[文章介绍了一个使用 Go 语言实现的简单 AI Agent 示例，阐述了 AI Agent 的基本结构，即“循环 + AI(LLM) + 工具(Tools)”。文章详细说明了如何通过 Go 语言连接 OpenAI 的大型语言模型（LLM），以及如何定义和整合可供 AI 调用的工具函数（Function Calling），最终形成一个完整的 AI Agent 工作闭环。]]></description>
            <content:encoded><![CDATA[<main class="notion light-mode notion-page notion-block-221710e0130780e6a2fdd17dac07d2f2"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-text notion-block-221710e0130780fcab82c8fb2b4e5a4c"><b>AI Agent 并不复杂，粗略来说就是 </b><code class="notion-inline-code"><b>循环 + AI(LLM) + 工具(Tools)</b></code><b> 。</b></div><details class="notion-toggle notion-block-221710e0130780e3a4fcc8605f2d585b"><summary>这里整理记录下之前用 Golang 写的 AI Agent Demo，可以当作一个最简的 AI Agent 示例，快速学习理解 AI Agent 的基本结构。</summary><div><div class="notion-text notion-block-221710e0130780b1b031fb4139d9808c"><s><em>AI 的发展，有时候会让人觉得这些东西没必要再写了，毕竟有啥都可以直接问 AI ，回答又快又好。但 AI 的毕竟是 AI 的，自己动手整理记录的才能算是自己的。</em></s></div></div></details><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-221710e01307807d89eceb35660bfc18" data-id="221710e01307807d89eceb35660bfc18"><span><div id="221710e01307807d89eceb35660bfc18" class="notion-header-anchor"></div><a class="notion-hash-link" href="#221710e01307807d89eceb35660bfc18" title="创建 Go 项目"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">创建 Go 项目</span></span></h3><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell">mkdir example-agent
cd example-agent
go mod init example-agent
touch main.go</code></pre><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-221710e013078020a837d1dc7d0558e5" data-id="221710e013078020a837d1dc7d0558e5"><span><div id="221710e013078020a837d1dc7d0558e5" class="notion-header-anchor"></div><a class="notion-hash-link" href="#221710e013078020a837d1dc7d0558e5" title="循环输入输出"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">循环输入输出</span></span></h3><pre class="notion-code language-go" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-go">// main.go
package main

import (
	&quot;bufio&quot;
	&quot;fmt&quot;
	&quot;os&quot;
	&quot;strings&quot;
)

func main() {
	// 创建一个读取器，用来读取用户的输入
	reader := bufio.NewReader(os.Stdin)

	for {
		fmt.Print(&quot;You: &quot;)

		// 读取用户输入，直到遇到换行符
		input, _ := reader.ReadString(&#x27;\n&#x27;)

		// 如果用户输入 &quot;exit&quot; 或 &quot;quit&quot;，就退出循环
		if strings.TrimSpace(input) == &quot;exit&quot; || strings.TrimSpace(input) == &quot;quit&quot; {
			fmt.Println(&quot;再见！&quot;)
			break
		}

		fmt.Println(&quot;Agent: 你说的是：&quot;, input)
	}
}</code></pre><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-221710e0130780eda682fd982bb8ca02" data-id="221710e0130780eda682fd982bb8ca02"><span><div id="221710e0130780eda682fd982bb8ca02" class="notion-header-anchor"></div><a class="notion-hash-link" href="#221710e0130780eda682fd982bb8ca02" title="连接 AI (LLM)"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">连接 AI (LLM)</span></span></h3><div class="notion-text notion-block-221710e013078074bb6cfbe651201d7c">这里使用 OpenAI 的 SDK 来连接 AI(LLM) 。</div><div class="notion-text notion-block-221710e01307806c9721f02f5bd8c0c3"><b>注意：</b> 需要一个 OpenAI API Key。或者使用第三方的 API 代理服务，修改 API 的 BaseURL 。</div><pre class="notion-code language-shell" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-shell"># 这个 star 多，就不用 OpenAI 官方 SDK 了
go get github.com/sashabaranov/go-openai</code></pre><pre class="notion-code language-go" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-go">// main.go
package main

import (
	&quot;bufio&quot;
	&quot;context&quot;
	&quot;fmt&quot;
	&quot;log&quot;
	&quot;os&quot;
	&quot;strings&quot;

	&quot;github.com/sashabaranov/go-openai&quot;
)

func main() {
	// --- 初始化 AI 客户端 ---
	// 实际使用时，请务必使用安全的方式管理你的 API Key
	config := openai.DefaultConfig(os.Getenv(&quot;API_KEY&quot;))
	// 使用第三方 API 代理，需设置 BaseURL
	config.BaseURL = &quot;http://localhost:8080/v1&quot;
	client := openai.NewClientWithConfig(config)

	// 创建一个列表来存储整个对话的上下文（历史消息）
	messages := []openai.ChatCompletionMessage{}

	reader := bufio.NewReader(os.Stdin)

	for {
		fmt.Print(&quot;You: &quot;)
		input, _ := reader.ReadString(&#x27;\n&#x27;)
		if strings.TrimSpace(input) == &quot;exit&quot; || strings.TrimSpace(input) == &quot;quit&quot; {
			fmt.Println(&quot;再见！&quot;)
			break
		}

		// 将用户的消息添加到对话历史中
		messages = append(messages, openai.ChatCompletionMessage{
			Role:    openai.ChatMessageRoleUser,
			Content: input,
		})

		// --- 调用 LLM API ---
		resp, err := client.CreateChatCompletion(
			context.Background(),
			openai.ChatCompletionRequest{
				Model:    openai.GPT4Turbo,
				Messages: messages,
			},
		)

		if err != nil {
			log.Printf(&quot;ChatCompletion error: %v\n&quot;, err)
			continue
		}

		aiResponse := resp.Choices[0].Message

		// 将 AI 的回复也添加到对话历史中
		messages = append(messages, aiResponse)
	}
}</code></pre><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-221710e01307809389dfca6a0d24f4ae" data-id="221710e01307809389dfca6a0d24f4ae"><span><div id="221710e01307809389dfca6a0d24f4ae" class="notion-header-anchor"></div><a class="notion-hash-link" href="#221710e01307809389dfca6a0d24f4ae" title="Agent 工具（Tools）"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">Agent 工具（Tools）</span></span></h3><div class="notion-text notion-block-221710e01307804e8580e0e62ea4582d">如下这些函数就是 AI Agent 可调用的工具（Tools），也就是 <b>Function Calling </b>。</div><pre class="notion-code language-go" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-go">// ... 其他代码 ...

/*
readFile 读取指定文件的内容
*/
func readFile(filename string) (string, error) {
	data, err := os.ReadFile(filename)
	if err != nil {
		return &quot;&quot;, err
	}
	return string(data), nil
}

/*
listFiles 列出指定目录中的所有文件和子目录
*/
func listFiles(path string) (string, error) {
	files, err := os.ReadDir(path)
	if err != nil {
		return &quot;&quot;, err
	}

	var fileNames []string
	for _, file := range files {
		fileNames = append(fileNames, file.Name())
	}

	return fmt.Sprintf(&quot;%v&quot;, fileNames), nil
}

/*
editFile 编辑文件内容，通过字符串替换的方式
*/
func editFile(filename, old, new string) error {
	data, err := os.ReadFile(filename)
	if err != nil {
		return err
	}

	newData := strings.Replace(string(data), old, new, -1)

	return os.WriteFile(filename, []byte(newData), 0644)
}

// ... main 函数 ...</code></pre><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-221710e0130780b886fbecc056f8f8ac" data-id="221710e0130780b886fbecc056f8f8ac"><span><div id="221710e0130780b886fbecc056f8f8ac" class="notion-header-anchor"></div><a class="notion-hash-link" href="#221710e0130780b886fbecc056f8f8ac" title="整合调用"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">整合调用</span></span></h3><div class="notion-text notion-block-221710e0130780169b74d4bc611a7df0">有了以上工具函数后，接下来在 <code class="notion-inline-code">client.CreateChatCompletion</code> 的请求中，将这些可用工具信息发给 AI。</div><pre class="notion-code language-go" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-go">// 在 for 循环中
resp, err := client.CreateChatCompletion(
	context.Background(),
	openai.ChatCompletionRequest{
		Model:    openai.GPT4Turbo,
		Messages: messages,

		// 定义可用工具（Function Calling）告诉 AI 它可以调用哪些函数
		Tools: []openai.Tool{
			{
				Type: openai.ToolTypeFunction,
				Function: &amp;openai.FunctionDefinition{
					Name:        &quot;read_file&quot;,
					Description: &quot;Reads the content of a file.&quot;,
					// JSON Schema 定义参数格式
					Parameters: json.RawMessage(`{
						&quot;type&quot;: &quot;object&quot;,
						&quot;properties&quot;: {
							&quot;filename&quot;: {
								&quot;type&quot;: &quot;string&quot;,
								&quot;description&quot;: &quot;The path to the file to read&quot;
							}
						},
						&quot;required&quot;: [&quot;filename&quot;]
					}`),
				},
			},
			{
				Type: openai.ToolTypeFunction,
				Function: &amp;openai.FunctionDefinition{
					Name:        &quot;list_files&quot;,
					Description: &quot;Lists files in a directory.&quot;,
					Parameters: json.RawMessage(`{
						&quot;type&quot;: &quot;object&quot;,
						&quot;properties&quot;: {
							&quot;path&quot;: {
								&quot;type&quot;: &quot;string&quot;,
								&quot;description&quot;: &quot;The directory path to list files from&quot;
							}
						},
						&quot;required&quot;: [&quot;path&quot;]
					}`),
				},
			},
			{
				Type: openai.ToolTypeFunction,
				Function: &amp;openai.FunctionDefinition{
					Name:        &quot;edit_file&quot;,
					Description: &quot;Edits a file by replacing a string.&quot;,
					Parameters: json.RawMessage(`{
						&quot;type&quot;: &quot;object&quot;,
						&quot;properties&quot;: {
							&quot;filename&quot;: {
								&quot;type&quot;: &quot;string&quot;,
								&quot;description&quot;: &quot;The path to the file to edit&quot;
							},
							&quot;old&quot;: {
								&quot;type&quot;: &quot;string&quot;,
								&quot;description&quot;: &quot;The string to be replaced&quot;
							},
							&quot;new&quot;: {
								&quot;type&quot;: &quot;string&quot;,
								&quot;description&quot;: &quot;The new string to replace with&quot;
							}
						},
						&quot;required&quot;: [&quot;filename&quot;, &quot;old&quot;, &quot;new&quot;]
					}`),
				},
			},
		},
	},
)</code></pre><div class="notion-text notion-block-221710e01307806d9524c34229535b82">这样 AI 就知道了有 <code class="notion-inline-code">read_file</code>、<code class="notion-inline-code">list_files</code>、<code class="notion-inline-code">edit_file</code> 这些工具了，当 AI 处理用户输入后决定使用这些工具时，其回复中会包含一个 <code class="notion-inline-code"><b>ToolCalls</b></code> 字段，根据 <code class="notion-inline-code"><b>ToolCalls</b></code> 中的信息来执行相应的工具函数，再将结果一起发送给 AI ，由 AI 根据工具执行结果生成最终响应。</div><pre class="notion-code language-go" tabindex="0"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-go">// ... 其他代码 ...

func main() {
  // ...

  for {
      // ...

    messages = append(messages, openai.ChatCompletionMessage{
        Role:    openai.ChatMessageRoleUser,
        Content: input,
    })

    resp, err := client.CreateChatCompletion(
        // ... (请求信息，包含 list_files 等工具) ...
    )

    // ... (错误处理) ...

    message := resp.Choices[0].Message
    messages = append(messages, message)

    // --- 检查 AI 是否要调用工具 ---
    if message.ToolCalls != nil {
      fmt.Println(&quot;Agent: 正在调用工具...&quot;)
      for _, toolCall := range message.ToolCalls {
        var result string // 存储工具执行结果
        var err error

        // 根据工具名称执行相应的函数
        switch toolCall.Function.Name {
          case &quot;read_file&quot;:
            var args struct {
              Filename string `json:&quot;filename&quot;`
            }
            json.Unmarshal([]byte(toolCall.Function.Arguments), &amp;args)

            result, err = readFile(args.Filename)

          case &quot;list_files&quot;:
            var args struct {
              Path string `json:&quot;path&quot;`
            }
            json.Unmarshal([]byte(toolCall.Function.Arguments), &amp;args)

            result, err = listFiles(args.Path)

          case &quot;edit_file&quot;:
            var args struct {
              Filename string `json:&quot;filename&quot;`
              Old      string `json:&quot;old&quot;`
              New      string `json:&quot;new&quot;`
            }
            json.Unmarshal([]byte(toolCall.Function.Arguments), &amp;args)

            err = editFile(args.Filename, args.Old, args.New)
            if err == nil {
              result = &quot;File edited successfully.&quot;
            }
        }

        if err != nil {
          result = err.Error()
        }

        // 将工具执行结果添加到历史消息
        messages = append(messages, openai.ChatCompletionMessage{
          Role:       openai.ChatMessageRoleTool,
          Content:    result,                     
          Name:       toolCall.Function.Name,     
          ToolCallID: toolCall.ID,               
        })
      }
      // 发送给 AI ，根据工具执行结果生成最终回复
      resp, err = client.CreateChatCompletion(
        context.Background(),
        openai.ChatCompletionRequest{
          Model:    openai.GPT4Turbo,
          Messages: messages, 
        },
      )

      if err != nil {
        log.Printf(&quot;Tool Result ChatCompletion error: %v\n&quot;, err)
        continue
      }

      // 显示 AI 的最终回复
      fmt.Println(&quot;Agent:&quot;, resp.Choices[0].Message.Content)

      // 将最终回复也添加到历史消息
      messages = append(messages, resp.Choices[0].Message)

    } else {
      // 如果 AI 没有调用工具，直接显示回复 
      fmt.Println(&quot;Agent:&quot;, message.Content)
    }
  }
}
</code></pre><div class="notion-text notion-block-221710e0130780b5a77fd71c0ccde9e0">以上整合后就形成了一个简单完整的 <b>AI Agent</b> 闭环：</div><div class="notion-text notion-block-221710e01307809ba34eeec31328403e"><b>用户提问 -&gt; AI 响应 -&gt; 工具调用 -&gt; 执行函数 -&gt; 将结果再发给 AI -&gt; AI 生成最终回复</b></div><div class="notion-blank notion-block-221710e0130780df96d4eb032abd6801"> </div></main>]]></content:encoded>
        </item>
    </channel>
</rss>