<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Yawata Yahaha</title>
    <description>The latest articles on DEV Community by Yawata Yahaha (@yawatasensei).</description>
    <link>https://dev.to/yawatasensei</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2908578%2Fdb16eeef-7f9e-451b-9078-088ff77936ce.jpg</url>
      <title>DEV Community: Yawata Yahaha</title>
      <link>https://dev.to/yawatasensei</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yawatasensei"/>
    <language>en</language>
    <item>
      <title>Alma Plugin: Alma Telegram Bridge</title>
      <dc:creator>Yawata Yahaha</dc:creator>
      <pubDate>Mon, 12 Jan 2026 00:00:00 +0000</pubDate>
      <link>https://dev.to/yawatasensei/alma-plugin-alma-telegram-bridge-56kb</link>
      <guid>https://dev.to/yawatasensei/alma-plugin-alma-telegram-bridge-56kb</guid>
      <description>&lt;p&gt;今天不想写简介了。&lt;/p&gt;

&lt;h2&gt;&lt;span&gt;
&lt;span&gt;&lt;b&gt;Alma Telegram Bridge&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.notion.so%2Fimage%2Fattachment%253A2c0b24fb-cdf6-4422-a9ec-091feb319402%253Alogo.png%3Ftable%3Dblock%26id%3D2e797571-0fee-8025-9f8f-d493b8d07dbd%26t%3D2e797571-0fee-8025-9f8f-d493b8d07dbd" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.notion.so%2Fimage%2Fattachment%253A2c0b24fb-cdf6-4422-a9ec-091feb319402%253Alogo.png%3Ftable%3Dblock%26id%3D2e797571-0fee-8025-9f8f-d493b8d07dbd%26t%3D2e797571-0fee-8025-9f8f-d493b8d07dbd" alt="notion image" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;随时随地，掌控你的 AI 对话&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;一款将 Alma 与 Telegram 无缝连接的插件。&lt;/p&gt;

&lt;p&gt;无论身在何处，都能通过 Telegram 实时接收回复、查看对话线程。&lt;/p&gt;




&lt;h2&gt;&lt;span&gt;
&lt;span&gt;&lt;b&gt;✨ 核心特性&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;功能&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;说明&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;🔄 双向同步&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;Alma 的回复实时推送到 Telegram，手机端即时响应&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;📑 线程管理&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;在 Telegram 中轻松浏览、切换和管理 Alma 对话列表&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;📜 历史回溯&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;支持分页查看历史消息，上下文一目了然&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;🎮 便捷交互&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;全面支持 Inline Keyboard 按钮，告别繁琐的命令输入&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;🔔 实时通知&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;即使不在电脑前，也能通过通知第一时间获取 AI 响应&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;&lt;span&gt;
&lt;span&gt;&lt;b&gt;📱 界面预览&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;h4&gt;&lt;span&gt;
&lt;span&gt;&lt;b&gt;主菜单&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;

&lt;h4&gt;&lt;span&gt;
&lt;span&gt;&lt;b&gt;线程列表&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;

&lt;h4&gt;&lt;span&gt;
&lt;span&gt;&lt;b&gt;消息浏览&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;

&lt;h2&gt;&lt;span&gt;
&lt;span&gt;&lt;b&gt;🚀 安装方法&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.notion.so%2Fimage%2Fattachment%253A969dab9b-e89e-4c19-8286-473bff64bc31%253Aimage.png%3Ftable%3Dblock%26id%3D2e797571-0fee-801d-893b-fd2e61dc46a4%26t%3D2e797571-0fee-801d-893b-fd2e61dc46a4" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.notion.so%2Fimage%2Fattachment%253A969dab9b-e89e-4c19-8286-473bff64bc31%253Aimage.png%3Ftable%3Dblock%26id%3D2e797571-0fee-801d-893b-fd2e61dc46a4%26t%3D2e797571-0fee-801d-893b-fd2e61dc46a4" alt="notion image" width="980" height="740"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;打开 Alma 的设置页面，选择&lt;code&gt;Plugins&lt;/code&gt;，点击&lt;code&gt;+Install&lt;/code&gt;，输入Githu地址：&lt;code&gt;&lt;a href="https://github.com/moreoronce/alma-telegram-bridge" rel="noopener noreferrer"&gt;https://github.com/moreoronce/alma-telegram-bridge&lt;/a&gt;&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;&lt;span&gt;
&lt;span&gt;&lt;b&gt;🚀 快速开始&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;p&gt;只需简单几步，即可开启你的移动 AI 之旅。&lt;/p&gt;

&lt;h3&gt;&lt;span&gt;
&lt;span&gt;&lt;b&gt;1. 获取 Telegram Bot Token&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;ol start="1"&gt;&lt;li&gt;在 Telegram 中搜索并联系 &lt;a rel="noopener noreferrer" href="https://t.me/BotFather"&gt;@BotFather&lt;/a&gt;。&lt;/li&gt;&lt;/ol&gt;

&lt;ol start="2"&gt;&lt;li&gt;发送 &lt;code&gt;/newbot&lt;/code&gt; 创建一个新的机器人。&lt;/li&gt;&lt;/ol&gt;

&lt;ol start="3"&gt;&lt;li&gt;按照提示设置名称，最终你将获得一个 &lt;b&gt;Bot Token&lt;/b&gt;。&lt;/li&gt;&lt;/ol&gt;

&lt;h3&gt;&lt;span&gt;
&lt;span&gt;&lt;b&gt;2. 获取你的 Chat ID&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;ol start="1"&gt;&lt;li&gt;在 Telegram 中搜索 &lt;a rel="noopener noreferrer" href="https://t.me/userinfobot"&gt;@userinfobot&lt;/a&gt;。&lt;/li&gt;&lt;/ol&gt;

&lt;ol start="2"&gt;&lt;li&gt;发送任意消息，机器人会立即回复你的 &lt;b&gt;Chat ID&lt;/b&gt;。&lt;/li&gt;&lt;/ol&gt;

&lt;h3&gt;&lt;span&gt;
&lt;span&gt;&lt;b&gt;3. 配置插件&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;p&gt;在 Alma 的设置文件中添加以下配置：&lt;/p&gt;

&lt;h3&gt;&lt;span&gt;
&lt;span&gt;&lt;b&gt;4. 启动体验&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;ol start="1"&gt;&lt;li&gt;重启 Alma 以加载配置。&lt;/li&gt;&lt;/ol&gt;

&lt;ol start="2"&gt;&lt;li&gt;在 Telegram 中向你的 Bot 发送 &lt;code&gt;/start&lt;/code&gt;。&lt;/li&gt;&lt;/ol&gt;

&lt;ol start="3"&gt;&lt;li&gt;如果看到欢迎菜单，说明连接成功！🎉&lt;/li&gt;&lt;/ol&gt;

&lt;h2&gt;&lt;span&gt;
&lt;span&gt;&lt;b&gt;⚙️ 配置详解&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;设置项&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;类型&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;默认值&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;说明&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;telegram-bridge.botToken&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;string&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;td&gt;
&lt;b&gt;必填&lt;/b&gt;，你的 Telegram Bot Token&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;telegram-bridge.chatId&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;string&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;td&gt;
&lt;b&gt;必填&lt;/b&gt;，你的个人 Chat ID&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;telegram-bridge.pollingInterval&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;number&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;2000&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;消息轮询间隔（毫秒），越小越即时&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;telegram-bridge.threadId&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;string&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;td&gt;指定默认绑定的 Alma 线程 ID（可选）&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;&lt;span&gt;
&lt;span&gt;&lt;b&gt;📖 常用命令&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;p&gt;虽然我们推荐使用&lt;b&gt;按钮交互&lt;/b&gt;，但也支持以下命令：&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;命令&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;作用&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/start&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;启动机器人并显示主菜单&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/menu&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;重新呼出主菜单&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/ping&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;测试与服务器的连接延迟&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;&lt;span&gt;
&lt;span&gt;&lt;b&gt;🎯 适用场景&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;ul&gt;&lt;li&gt;🚌 &lt;b&gt;通勤路上&lt;/b&gt;：利用碎片时间回顾或继续对话。&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;🛌 &lt;b&gt;离开电脑&lt;/b&gt;：躺在沙发上也能轻松控制 Alma。&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;🔔 &lt;b&gt;任务监控&lt;/b&gt;：让 Alma 在后台运行任务，完成后通过 Telegram 通知你。&lt;/li&gt;&lt;/ul&gt;

&lt;h2&gt;&lt;span&gt;
&lt;span&gt;&lt;b&gt;🔧 技术细节&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;ul&gt;&lt;li&gt;基于 &lt;b&gt;Telegram Bot API&lt;/b&gt; (Long Polling) 实现，无需公网 IP。&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;智能解析 Alma 复杂消息结构（支持 Parts 数组）。&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;自动处理长消息截断，完美适配 Telegram 消息长度限制。&lt;/li&gt;&lt;/ul&gt;

&lt;h2&gt;&lt;span&gt;
&lt;span&gt;🤗 总结归纳&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;p&gt;做这个插件的需求是，我每天早上起来会让Alma整理一下过去24小时发生的新闻，以及美股的盘面表现等，然后给出A股的一些可能交易策略和分析，根据这些在下午3点前进行调整。但是，我2点-3点一般是在健身房，所以需要这个插件来查询。&lt;/p&gt;

&lt;h2&gt;&lt;span&gt;
&lt;span&gt;📎 参考文章&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;ul&gt;&lt;li&gt;&lt;a rel="noopener noreferrer" href="https://alma.now/docs/plugins/"&gt;https://alma.now/docs/plugins/&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;&lt;a rel="noopener noreferrer" href="https://github.com/moreoronce/alma-telegram-bridge"&gt;https://github.com/moreoronce/alma-telegram-bridge&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;有关Alma安装或者使用上的问题，欢迎您在底部评论区留言，一起交流~&lt;br&gt;
版权声明：本博客所有文章除特别声明外，均采用 CC BY-NC-SA 4.0 许可协议。转载请注明出处！&lt;/p&gt;

 

</description>
      <category>api</category>
      <category>automation</category>
      <category>opensource</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Antigravity反向代理指南</title>
      <dc:creator>Yawata Yahaha</dc:creator>
      <pubDate>Sat, 10 Jan 2026 00:00:00 +0000</pubDate>
      <link>https://dev.to/yawatasensei/antigravityfan-xiang-dai-li-zhi-nan-2gjb</link>
      <guid>https://dev.to/yawatasensei/antigravityfan-xiang-dai-li-zhi-nan-2gjb</guid>
      <description>&lt;p&gt;&lt;span&gt;😀&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;随着Google One AI Premium订阅和学生优惠的年末大促，&lt;b&gt;Antigravity的性价比愈发凸显&lt;/b&gt;——不仅坐拥「量大管饱」的Gemini 3 Pro与Claude 4.5(Sonnet和Opus)全家桶，还支持家庭组共享订阅（成员独立额度）。这让 Antigravity迅速跻身Vibe Coding 开发者的「必备订阅」行列。&lt;br&gt;
但问题来了：&lt;b&gt;如果想在Antigravity之外的客户端&lt;/b&gt;（如Cherry Studio、Alma等Agent）&lt;b&gt;中调用这些模型，该怎么办？&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;本文将介绍&lt;b&gt;两种反向代理方案&lt;/b&gt;，教你把 Antigravity 内置的Gemini / Claude能力「导出」为标准API，供第三方应用自由调用。&lt;/p&gt;


&lt;br&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.notion.so%2Fimage%2Fattachment%253Aefc9e7e0-4b57-4444-aa57-3ef3a4891c10%253AGoogle-Unveils-Antigravity-The-AI-Coding-Tool-That-Builds-and-Tests-Code-Itself.webp%3Ftable%3Dblock%26id%3D2e497571-0fee-80cc-825d-ed04853229ba%26t%3D2e497571-0fee-80cc-825d-ed04853229ba" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.notion.so%2Fimage%2Fattachment%253Aefc9e7e0-4b57-4444-aa57-3ef3a4891c10%253AGoogle-Unveils-Antigravity-The-AI-Coding-Tool-That-Builds-and-Tests-Code-Itself.webp%3Ftable%3Dblock%26id%3D2e497571-0fee-80cc-825d-ed04853229ba%26t%3D2e497571-0fee-80cc-825d-ed04853229ba" alt="antigravity " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;&lt;span&gt;
&lt;span&gt;📝 方案一：Antigravity Manager&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;h3&gt;&lt;span&gt;
&lt;span&gt;项目介绍&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;p&gt;Antigravity Manager，又名Antigravity Tools（下面基本用Antigravity Tools进行替代），是专业的Antigravity账号管理与协议反代系统，支持多账号智能请求调度。支持通过OAuth 2.0方式登录授权，不需要手动黏贴Cookie等。&lt;/p&gt;

&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/lbjlaq/Antigravity-Manager"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Antigravity-Manager&lt;/p&gt;

&lt;p&gt;lbjlaq&lt;span&gt; • &lt;/span&gt;Updated Jan 10, 2026&lt;/p&gt;


&lt;h3&gt;&lt;span&gt;&lt;br&gt;
&lt;span&gt;使用方法&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;

使用方法基于第三方客户端为Alma，如果你是Cherry Studio或者其他第三方客户端，以下流程仅供参考。

&lt;h4&gt;&lt;span&gt;
&lt;span&gt;Antigravity账号授权&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;

&lt;ol start="1"&gt;&lt;li&gt;根据你的系统下载最新版本的Antigravity Manager：&lt;a rel="noopener noreferrer" href="https://github.com/lbjlaq/Antigravity-Manager/releases/tag/v3.3.20"&gt;https://github.com/lbjlaq/Antigravity-Manager/releases/tag/v3.3.20&lt;/a&gt;，，如果你是Windows，就下载Antigravity.Tools_3.3.20_x64-setup.exe。&lt;/li&gt;&lt;/ol&gt;

&lt;ol start="2"&gt;&lt;li&gt;打开安装，随便安装到哪里都可以。&lt;/li&gt;&lt;/ol&gt;

&lt;ol start="3"&gt;&lt;li&gt;打开Antigravity Manager，点击添加账号&lt;/li&gt;&lt;/ol&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.notion.so%2Fimage%2Fattachment%253A34f260d7-9b25-424d-9fbf-ac6e9ac7c965%253Aimage.png%3Ftable%3Dblock%26id%3D2e497571-0fee-80c9-b87e-c0bb67f2e0e8%26t%3D2e497571-0fee-80c9-b87e-c0bb67f2e0e8" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.notion.so%2Fimage%2Fattachment%253A34f260d7-9b25-424d-9fbf-ac6e9ac7c965%253Aimage.png%3Ftable%3Dblock%26id%3D2e497571-0fee-80c9-b87e-c0bb67f2e0e8%26t%3D2e497571-0fee-80c9-b87e-c0bb67f2e0e8" alt="antigravity tools dashboard" width="1024" height="700"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol start="4"&gt;&lt;li&gt;点击开始OAuth授权&lt;/li&gt;&lt;/ol&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.notion.so%2Fimage%2Fattachment%253Ae15bb05a-d7f1-4062-82a5-0d5d571263c4%253Aimage.png%3Ftable%3Dblock%26id%3D2e497571-0fee-8045-9a44-f2cb6efa7501%26t%3D2e497571-0fee-8045-9a44-f2cb6efa7501" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.notion.so%2Fimage%2Fattachment%253Ae15bb05a-d7f1-4062-82a5-0d5d571263c4%253Aimage.png%3Ftable%3Dblock%26id%3D2e497571-0fee-8045-9a44-f2cb6efa7501%26t%3D2e497571-0fee-8045-9a44-f2cb6efa7501" alt="antigravity tools add new account" width="485" height="581"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol start="5"&gt;&lt;li&gt;浏览器会自动打开&lt;code&gt;http://accounts.google.com/o/oauth2/v2/auth?client_id=&lt;/code&gt; 的账号授权页面，选择你的账号，如果你有多个账号，请选择你订阅了Pro版本的账号。如果你开启了两步验证，那么在OAuth授权过程中还会进行两部验证。授权完成之后，在仪表盘和账号管理中均可看到当前已授权的账号及对应的额度。&lt;/li&gt;&lt;/ol&gt;

&lt;h4&gt;&lt;span&gt;
&lt;span&gt;Antigravity Tools配置反代&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;

&lt;ol start="1"&gt;&lt;li&gt;在API反代的标签页内可以进行Antigravity Tools的反向代理配置。默认情况下是处于&lt;code&gt;停止服务&lt;/code&gt;状态。&lt;/li&gt;&lt;/ol&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.notion.so%2Fimage%2Fattachment%253A0a834a5a-5c65-4403-b60f-32a27d073a3c%253Aimage.png%3Ftable%3Dblock%26id%3D2e497571-0fee-8097-ac89-d9af27baff8d%26t%3D2e497571-0fee-8097-ac89-d9af27baff8d" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.notion.so%2Fimage%2Fattachment%253A0a834a5a-5c65-4403-b60f-32a27d073a3c%253Aimage.png%3Ftable%3Dblock%26id%3D2e497571-0fee-8097-ac89-d9af27baff8d%26t%3D2e497571-0fee-8097-ac89-d9af27baff8d" alt="antigravity tools reverse proxy config" width="1024" height="700"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol start="2"&gt;
&lt;li&gt;以Alma为例，进行配置，新建一个Provider，填写以下信息：&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;Provider Name: 随便填写，自己能够记清楚就可以&lt;/li&gt;
&lt;li&gt;Base URL： 如果是本机，那么就填写&lt;code&gt;http://127.0.0.1:8045/v1&lt;/code&gt;，如果是局域网内其他机器，则替换&lt;code&gt;127.0.0.1&lt;/code&gt;为局域网那台机器的IP，并同时开启Antigravity Tools中的&lt;code&gt;允许局域网访问&lt;/code&gt; 选项。&lt;/li&gt;
&lt;li&gt;API Key：复制Antigravity Tools中提供的API密钥&lt;/li&gt;
&lt;li&gt;API Format：选择&lt;code&gt;Anthropic Messages(/v1/messages)&lt;/code&gt;模式，即Claude模式&lt;/li&gt;
&lt;li&gt;点击Add Provider即可完成添加。完成添加之后记得去Fetch拉取一下模型，并开启自己所需的模型。&lt;/li&gt;
&lt;/ol&gt;




&lt;/ol&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.notion.so%2Fimage%2Fattachment%253A229ac165-76a3-4142-8207-1121c9473b29%253Aimage.png%3Ftable%3Dblock%26id%3D2e497571-0fee-809e-bac0-ead4d8e076fd%26t%3D2e497571-0fee-809e-bac0-ead4d8e076fd" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.notion.so%2Fimage%2Fattachment%253A229ac165-76a3-4142-8207-1121c9473b29%253Aimage.png%3Ftable%3Dblock%26id%3D2e497571-0fee-809e-bac0-ead4d8e076fd%26t%3D2e497571-0fee-809e-bac0-ead4d8e076fd" alt="add new provider in alma" width="409" height="526"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;&lt;span&gt;
&lt;span&gt;Antigravity Tools反代开机自动启动配置&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;

&lt;ol start="1"&gt;&lt;li&gt;在Antigravity Tools的设置页面中，&lt;code&gt;开机自动启动&lt;/code&gt;选择&lt;code&gt;启用&lt;/code&gt; ，并保存配置。&lt;/li&gt;&lt;/ol&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.notion.so%2Fimage%2Fattachment%253A5d0dcd82-9567-43a4-9e9f-e85fcb969388%253Aimage.png%3Ftable%3Dblock%26id%3D2e497571-0fee-80a4-9868-db1d3a62b142%26t%3D2e497571-0fee-80a4-9868-db1d3a62b142" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.notion.so%2Fimage%2Fattachment%253A5d0dcd82-9567-43a4-9e9f-e85fcb969388%253Aimage.png%3Ftable%3Dblock%26id%3D2e497571-0fee-80a4-9868-db1d3a62b142%26t%3D2e497571-0fee-80a4-9868-db1d3a62b142" alt="antigravity tools auto start" width="1024" height="700"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol start="2"&gt;&lt;li&gt;API反代页面中，选择&lt;code&gt;跟随应用自动启动&lt;/code&gt; &lt;/li&gt;&lt;/ol&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.notion.so%2Fimage%2Fattachment%253Aeba7ee37-cf7e-4d4b-b4b6-93ae19152f45%253Aimage.png%3Ftable%3Dblock%26id%3D2e497571-0fee-80d4-9c4b-d1e7dadcdfa9%26t%3D2e497571-0fee-80d4-9c4b-d1e7dadcdfa9" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.notion.so%2Fimage%2Fattachment%253Aeba7ee37-cf7e-4d4b-b4b6-93ae19152f45%253Aimage.png%3Ftable%3Dblock%26id%3D2e497571-0fee-80d4-9c4b-d1e7dadcdfa9%26t%3D2e497571-0fee-80d4-9c4b-d1e7dadcdfa9" alt="antigravity tools autostart" width="1024" height="700"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;&lt;span&gt;
&lt;span&gt;为什么要使用&lt;code&gt;Anthropic&lt;/code&gt;协议模式？&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;

&lt;ol start="1"&gt;&lt;li&gt;避免繁琐的映射。如果使用OpenAI协议模式，即&lt;code&gt;/v1/chat/completions&lt;/code&gt; 类似的Base URL，无法拉取到Antigravity正确的模型，只能拉取到GPT-4、o1-mini等并不存在的模型，且需要进行映射，即便配置了模型映射和路由，也无法使用Claude-4.5模型。&lt;/li&gt;&lt;/ol&gt;

&lt;ol start="2"&gt;&lt;li&gt;大部分第三方客户端没有提供兼容Gemini Base URL，所以唯一的选择就是使用Anthropic协议的Base URL格式。&lt;/li&gt;&lt;/ol&gt;

&lt;h2&gt;&lt;span&gt;
&lt;span&gt;📝 方案二：&lt;b&gt;CLIProxyAPI&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;h3&gt;&lt;span&gt;
&lt;span&gt;项目介绍&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;p&gt;相比上面提到的Antigravity Tools，CliProxyAPI的账号兼容更多，包括：Wrap Gemini CLI, Antigravity, ChatGPT Codex, Claude Code, Qwen Code, iFlow等。但是另一方面而言，相比Antigravity Tools，上手难度要高一些，因为没有GUI界面进行配置，所有的配置项需要通过配置文件编写。&lt;/p&gt;

&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/router-for-me/CLIProxyAPI"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;CLIProxyAPI&lt;/p&gt;

&lt;p&gt;router-for-me&lt;span&gt; • &lt;/span&gt;Updated Jan 10, 2026&lt;/p&gt;


&lt;h3&gt;&lt;span&gt;&lt;br&gt;
&lt;span&gt;使用方法&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;ol start="1"&gt;&lt;li&gt;去Github下载最新版：&lt;a rel="noopener noreferrer" href="https://github.com/router-for-me/CLIProxyAPI/releases"&gt;https://github.com/router-for-me/CLIProxyAPI/releases&lt;/a&gt;，Windows就&lt;code&gt;CLIProxyAPI_*.*.**_windows_amd64.zip&lt;/code&gt; 这个，解压到一个你自己记得住的地方。&lt;/li&gt;&lt;/ol&gt;

&lt;ol start="2"&gt;&lt;li&gt;将&lt;code&gt;config.example.yaml&lt;/code&gt; 重命名为&lt;code&gt;config.yaml&lt;/code&gt; ，并使用你喜欢的编辑器打开&lt;/li&gt;&lt;/ol&gt;

&lt;ol start="3"&gt;&lt;li&gt;找到&lt;code&gt;api-keys&lt;/code&gt; 选项，将里面的内容替换成你想设置的&lt;code&gt;API KEY&lt;/code&gt;，如果不想修改，直接复制一个默认&lt;code&gt;your-api-key-1&lt;/code&gt;
&lt;/li&gt;&lt;/ol&gt;
&lt;ol start="4"&gt;&lt;li&gt;（可选）如果想禁止局域网其他机器使用这个反代，需要设置&lt;code&gt;host&lt;/code&gt; ，默认情况下是绑定全部地址，休要修改为&lt;code&gt;host: "127.0.0.1”&lt;/code&gt; &lt;/li&gt;&lt;/ol&gt;
&lt;ol start="5"&gt;&lt;li&gt;在下载的CLIProxyAPI程序的文件夹里打开终端&lt;/li&gt;&lt;/ol&gt;
&lt;ol start="6"&gt;&lt;li&gt;输入&lt;code&gt;./cli-proxy-api --antigravity-login&lt;/code&gt; 即可进行OAuth2.0认证，浏览器会自动打开Google的账号认证页面，认证完成后会显示&lt;code&gt;Success&lt;/code&gt; ，同时认证完成后&lt;code&gt;cli-proxy-api&lt;/code&gt;会关闭。&lt;/li&gt;&lt;/ol&gt;
&lt;ol start="7"&gt;&lt;li&gt;输入&lt;code&gt;./cli-proxy-api&lt;/code&gt; 启动反向代理。&lt;/li&gt;&lt;/ol&gt;
&lt;ol start="8"&gt;
&lt;li&gt;配置信息：&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;Base URL： 如果是本机，那么就填写&lt;code&gt;http://127.0.0.1:8045/v1&lt;/code&gt;，如果是局域网内其他机器，则替换&lt;code&gt;127.0.0.1&lt;/code&gt;为局域网那台机器的IP&lt;/li&gt;
&lt;li&gt;API Key：默认&lt;code&gt;your-api-key-1&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;API Format：选择&lt;code&gt;Anthropic Messages(/v1/messages)&lt;/code&gt;模式，即Claude模式&lt;/li&gt;
&lt;/ol&gt;




&lt;/ol&gt;

&lt;h3&gt;&lt;span&gt;
&lt;span&gt;开机自动启动&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;p&gt;建议使用&lt;a rel="noopener noreferrer" href="https://github.com/kirillkovalenko/nssm"&gt;Nssm&lt;/a&gt;配置开机自启。&lt;/p&gt;

&lt;h2&gt;&lt;span&gt;
&lt;span&gt;🤗 总结归纳&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;p&gt;我个人目前在使用的是Antigravity Tools的方案，有图形界面，且不用自己配置自启动，而且我只有Google One Pro一个订阅服务，还不需要添加其他订阅服务。如果你有其他的订阅，那么可以使用CLIProxyAPI。对于这两个工具，官方的文档内容都很详细，更高级的用法需要自行发掘。&lt;/p&gt;

&lt;p&gt;另外对于Google One Pro，Google已经削减Gemini 3 Pro和Claude-4.5的配额两次，昨天看最新的消息，可能会设置一个周的请求上限。没办法，家庭组共享太适合羊毛党了，5个账号轮换使用而且配额独立，且用且珍惜。&lt;/p&gt;

&lt;h2&gt;&lt;span&gt;
&lt;span&gt;📎 参考文章&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;ul&gt;&lt;li&gt;&lt;a rel="noopener noreferrer" href="https://help.router-for.me/cn/configuration/provider/antigravity.html"&gt;https://help.router-for.me/cn/configuration/provider/antigravity.html&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;&lt;span&gt;💡&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;有关Antigravity安装或者使用上的问题，欢迎您在底部评论区留言，一起交流~&lt;br&gt;
版权声明：本博客所有文章除特别声明外，均采用 CC BY-NC-SA 4.0 许可协议。转载请注明出处！&lt;/p&gt;



</description>
      <category>api</category>
      <category>llm</category>
      <category>networking</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>AdGuard Home Configuration for LAN-Only Access</title>
      <dc:creator>Yawata Yahaha</dc:creator>
      <pubDate>Wed, 12 Mar 2025 11:48:51 +0000</pubDate>
      <link>https://dev.to/yawatasensei/adguard-home-configuration-for-lan-only-access-3lae</link>
      <guid>https://dev.to/yawatasensei/adguard-home-configuration-for-lan-only-access-3lae</guid>
      <description>&lt;p&gt;This article firt post at &lt;a href="https://en.deeprouter.org/article/adguard-home-lan-only-access-configuration" rel="noopener noreferrer"&gt;🛡️AdGuard Home Configuration for LAN-Only Access&lt;/a&gt;. Sync it to Dev.to now.&lt;/p&gt;

&lt;p&gt;😀 My AdGuard Home has been running stably for a while now. Recently, while checking the configuration file, I noticed that the default configuration listens on all addresses, which means if someone knew my side router's IPv6 address, it would be possible for them to directly use my AdGuard Home DNS service, especially since my ADG is listening on the default port 53. This is not very secure, and even if it's not attacked or misused, it could easily be flagged by the ISP.&lt;/p&gt;

&lt;h1&gt;
  
  
  📝 AdGuard Home &lt;strong&gt;Configuration Notes&lt;/strong&gt;
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Modifying AdGuard Home Listening Address
&lt;/h3&gt;

&lt;p&gt;The configuration file is located at &lt;code&gt;/etc/AdGuardHome.yaml&lt;/code&gt;. The configuration item for the listening address is under the &lt;code&gt;dns&lt;/code&gt; main configuration item, &lt;code&gt;bind_host&lt;/code&gt;. The default configuration is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;dns&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;bind_hosts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;0.0.0.0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This listens to all addresses of the current machine, including local addresses, LAN addresses, IPv6 public network addresses, etc., which poses a significant security risk, and we don't need AdGuard Home to listen on so many addresses.&lt;/p&gt;

&lt;p&gt;Since I use WireGuard to get home, with a configured subnet of 10.1.X.X, I've added this subnet to the configuration file for listening. The reason for also adding the 127.0.0.1 localhost address is to allow the local machine to use this DNS service. Additionally, some services running on the side router itself have DNS addresses configured as 127.0.0.1, and it's troublesome to find and change them, so I've included it here.&lt;/p&gt;

&lt;p&gt;After the modification:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;dns&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;bind_hosts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;127.0.0.1&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;10.X.X.X&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;10.1.X.X&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;fe80::abcd&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This includes the localhost address, home LAN address, WireGuard virtual LAN address (or Zerotier virtual LAN address), as well as the local IPv6 address. Here, it's important to note the IPv6 address should be filled in with your DNS server's local IPv6 address, starting with &lt;code&gt;fe80::&lt;/code&gt;. Do not simplify it to &lt;code&gt;fe80::1&lt;/code&gt;. It's recommended to check your local IPv6 address using the &lt;code&gt;ifconfig&lt;/code&gt; command to avoid any issues with AdGuard Home not starting due to listening failure.&lt;/p&gt;

&lt;p&gt;Restart AdGuard Home for the changes to take effect.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/etc/init.d/AdGuardHome restart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Configuring Firewall Rules
&lt;/h3&gt;

&lt;h3&gt;
  
  
  Adding via Luci Interface
&lt;/h3&gt;

&lt;p&gt;If your main router's default firewall wan rules are set to deny inbound and forwarding, there is no need to configure firewall rules separately, as access and forwarding requests on port 53 already follow the default rules and are denied.&lt;/p&gt;

&lt;p&gt;However, if your default wan rules allow inbound and forwarding, it is recommended to set communication rules, especially for the IPv6 configuration, which can be directly added in the OpenWRT firewall settings:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Source Zone&lt;/strong&gt;: wan and wan6&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Source Address&lt;/strong&gt;: Do not select&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Source Port&lt;/strong&gt;: Do not fill in&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Destination Zone&lt;/strong&gt;: lan, if your AdGuard Home is configured on the main router, then for this device.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Destination Address&lt;/strong&gt;: &lt;code&gt;::&amp;lt;last four digits of the mac address&amp;gt;/::ffff:ffff:ffff:ffff&lt;/code&gt; for address matching., filling in the local IPv4 address of the AdGuard Home.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Destination Port&lt;/strong&gt;: 53, if your AdGuard Home does not use port 53, fill in the port that your AdGuard Home is listening on.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Action&lt;/strong&gt;: Deny&lt;/p&gt;

&lt;p&gt;Save to apply.&lt;/p&gt;

&lt;h3&gt;
  
  
  Adding via nftables
&lt;/h3&gt;

&lt;p&gt;The approach for adding nftables is the opposite of the Luci part, which is to allow only the corresponding subnet to access port 53 via the nft firewall. Any subnet not within the configured rules that tries to access port 53 will be dropped.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;IPv4 Part&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nft add rule inet filter input ip saddr 10.0.0.0/24 tcp dport 53 accept
nft add rule inet filter input ip saddr 10.0.0.0/24 udp dport 53 accept
nft add rule inet filter input tcp dport 53 drop
nft add rule inet filter input udp dport 53 drop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;IPv6 Part&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nft add rule inet filter input ip6 saddr fe80::/10 tcp dport 53 accept
nft add rule inet filter input ip6 saddr fe80::/10 udp dport 53 accept
nft add rule inet filter input tcp dport 53 drop
nft add rule inet filter input udp dport 53 drop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  🤗 &lt;strong&gt;Summary&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;No summary provided.&lt;/p&gt;

&lt;h1&gt;
  
  
  📎 &lt;strong&gt;Reference&lt;/strong&gt;
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Configuration · AdguardTeam/AdGuardHome Wiki&lt;/li&gt;
&lt;li&gt;&lt;a href="https://deeprouter.org/article/adguard-home-lan-only-access-configuration" rel="noopener noreferrer"&gt;adguard-home-lan-only-access-configuration&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;💡 For any questions about OpenWRT or router installation or usage, feel free to leave a comment at the bottom, and let's exchange ideas together~&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>tutorial</category>
      <category>security</category>
    </item>
    <item>
      <title>Recommendation of Public RPC Nodes for Polygon.</title>
      <dc:creator>Yawata Yahaha</dc:creator>
      <pubDate>Mon, 10 Mar 2025 02:21:50 +0000</pubDate>
      <link>https://dev.to/yawatasensei/recommendation-of-public-rpc-nodes-for-polygon-39km</link>
      <guid>https://dev.to/yawatasensei/recommendation-of-public-rpc-nodes-for-polygon-39km</guid>
      <description>&lt;p&gt;Polygon is a scalable Layer 2 solution based on Ethereum, which enhances the performance of the Ethereum network by increasing network throughput and reducing transaction fees. Today, we recommend some common Polygon public RPC addresses:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://rpc-mainnet.maticvigil.com/" rel="noopener noreferrer"&gt;https://rpc-mainnet.maticvigil.com&lt;/a&gt; - Polygon mainnet RPC node provided by MaticVigil.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://polygon-rpc.com/" rel="noopener noreferrer"&gt;https://polygon-rpc.com&lt;/a&gt; - Polygon mainnet RPC node provided by Polygon official.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://rpc-mainnet.matic.network/" rel="noopener noreferrer"&gt;https://rpc-mainnet.matic.network&lt;/a&gt; - Polygon mainnet RPC node provided by Matic Network.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://matic-mainnet.chainstacklabs.com/" rel="noopener noreferrer"&gt;https://matic-mainnet.chainstacklabs.com&lt;/a&gt; - Polygon mainnet RPC node provided by Chainstack Labs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://rpc-mainnet.moonbeam.network/" rel="noopener noreferrer"&gt;https://rpc-mainnet.moonbeam.network&lt;/a&gt; - Polygon mainnet RPC node provided by Moonbeam Network.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://polygon-mainnet.public.blastapi.io-" rel="noopener noreferrer"&gt;https://polygon-mainnet.public.blastapi.io-&lt;/a&gt; Polygon mainnet RPC node provided by BwareLabs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://rpc-mainnet.matic.quiknode.pro/" rel="noopener noreferrer"&gt;https://rpc-mainnet.matic.quiknode.pro&lt;/a&gt; - Polygon mainnet RPC node provided by QuikNode.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://rpc-mainnet.maticvigil.com/v1/%7Byour-api-key%7D" rel="noopener noreferrer"&gt;https://rpc-mainnet.maticvigil.com/v1/{your-api-key}&lt;/a&gt; - Polygon mainnet RPC node provided by MaticVigil, requires application for private api key.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://rpc-mainnet.matic.network/v1/%7Byour-api-key%7D" rel="noopener noreferrer"&gt;https://rpc-mainnet.matic.network/v1/{your-api-key}&lt;/a&gt; - Polygon mainnet RPC node provided by Matic Network, requires application for private api key.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://bwarelabs.com/" rel="noopener noreferrer"&gt;https://matic-mainnet-archive-rpc.bwarelabs.com&lt;/a&gt; - Polygon mainnet archive RPC node provided by BwareLabs.&lt;/p&gt;

&lt;p&gt;These public RPC addresses can be used to interact with the Polygon network, such as obtaining blockchain data and broadcasting transactions. When using public RPC addresses, it is important to pay attention to the source of requests and data security. We recommend that developers use their own nodes or trusted third-party node services in production environments.&lt;/p&gt;

</description>
      <category>ethereum</category>
      <category>rpc</category>
    </item>
    <item>
      <title>Using Neovim on OpenWRT</title>
      <dc:creator>Yawata Yahaha</dc:creator>
      <pubDate>Sat, 08 Mar 2025 00:12:58 +0000</pubDate>
      <link>https://dev.to/yawatasensei/using-neovim-on-openwrt-158k</link>
      <guid>https://dev.to/yawatasensei/using-neovim-on-openwrt-158k</guid>
      <description>&lt;p&gt;😀 Because I often need to debug my home network via SSH, including the configuration of the main router, the configuration of the side router (side gateway), OpenClash, Adguard Home, MosDNS, etc., I frequently need a comfortable editor to modify &lt;code&gt;json&lt;/code&gt;, &lt;code&gt;yaml&lt;/code&gt;, and &lt;code&gt;xml&lt;/code&gt; configuration files or structured data files. In my local environment, I use NeoVim more often, and I have previously shared articles about LazyVim. Currently, there is no ipk for this software in the OpenWRT system software repository, so today I will organize the process of compiling and installing NeoVim on OpenWRT and the pitfalls I encountered.&lt;/p&gt;

&lt;h1&gt;
  
  
  📝 Compile Neovim On OpenWRT
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Before You Begin Before You Begin
&lt;/h3&gt;

&lt;p&gt;To avoid uncontrollable problems during the compilation and installation process, I use a brand new virtual machine environment for this tutorial. The firmware is from ImmortalWrt Firmware, Generic &lt;code&gt;x86/64&lt;/code&gt; architecture, version number &lt;code&gt;23.05.3&lt;/code&gt;, kernel version &lt;code&gt;5.15.162&lt;/code&gt;, without any additional pre-installed software packages, consistent with the default provided software packages, and the available space is as large as possible. The actual space I used for this operation is about 1.2G, but it can be removed after the installation is completed.&lt;/p&gt;

&lt;p&gt;Also, before starting the following operations, if you are using an OpenWRT system, it is recommended to make a backup. If it is a virtual machine system, it is recommended to add a checkpoint or backup point.&lt;/p&gt;

&lt;h3&gt;
  
  
  Compilation and Installation Process Begins Compilation and Installation Process Begins
&lt;/h3&gt;

&lt;p&gt;If you don't want to see the process, you can directly look at the summary.&lt;/p&gt;

&lt;p&gt;First, update the software repository source through OPKG package manager.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;opkg update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result returned is &lt;code&gt;Signature check passed.&lt;/code&gt; and there are no errors, continue to the next step.&lt;/p&gt;

&lt;p&gt;Since we need to clone the Neovim repository on GitHub via git, we need these two software packages, where git-http is used for using git in SSL situations.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;opkg install git git-http
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;During this period, including dependencies, a total of &lt;code&gt;git, git-http, zlib, libcurl4, libnghttp2-14&lt;/code&gt; software packages were installed.&lt;/p&gt;

&lt;p&gt;Clone the Neovim repository via git clone and try to execute make.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/neovim/neovim
&lt;span class="nb"&gt;cd &lt;/span&gt;neovim &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; make &lt;span class="nv"&gt;CMAKE_BUILD_TYPE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;RelWithDebInfo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The error result returned is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;make not found
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The reason is that we do not have the make software package. Install it through OPKG and try make again.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;opkg &lt;span class="nb"&gt;install &lt;/span&gt;make
make &lt;span class="nv"&gt;CMAKE_BUILD_TYPE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;RelWithDebInfo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The error result returned is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;make: cmake: No such file or directory
make: &lt;span class="k"&gt;***&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;Makefile:94: build/.ran-deps-cmake] Error 127
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It indicates that &lt;code&gt;cmake&lt;/code&gt; does not exist. OpenWrt does not provide an installation file for cmake, but we can install it indirectly through &lt;code&gt;python-pip&lt;/code&gt;, and the mainstream Python version is currently Python3.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;opkg &lt;span class="nb"&gt;install &lt;/span&gt;python3 python3-pip
pip &lt;span class="nb"&gt;install &lt;/span&gt;cmake
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After trying &lt;code&gt;make&lt;/code&gt; again, the error message changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- The C compiler identification is unknown
CMake Error at CMakeLists.txt:3 (project):
No CMAKE_C_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
- Configuring incomplete, errors occurred!
make: *** [Makefile:94: build/.ran-deps-cmake] Error 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It means that the C compiler was not found. We can install &lt;code&gt;gcc&lt;/code&gt; to solve this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;opkg &lt;span class="nb"&gt;install &lt;/span&gt;gcc
make &lt;span class="nv"&gt;CMAKE_BUILD_TYPE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;RelWithDebInfo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This compilation took a long time, until an error occurred during the installation of &lt;code&gt;luajit&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;compilation terminated.
make[5]: *** [Makefile:709: lj_parse.o] Error 1
make[4]: *** [Makefile:126: src/luajit] Error 2
make[3]: *** [CMakeFiles/luajit.dir/build.make:106: build/src/luajit-stamp/luajit-install] Error 2
make[2]: *** [CMakeFiles/Makefile2:161: CMakeFiles/luajit.dir/all] Error 2
make[1]: *** [Makefile:91: all] Error 2
make[1]: Leaving directory '/root/neovim/.deps'
make: *** [Makefile:87: deps] Error 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can directly install it through &lt;code&gt;opkg&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;opkg &lt;span class="nb"&gt;install &lt;/span&gt;luajit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then continue to try executing &lt;code&gt;make&lt;/code&gt;, and this time the error changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/usr/bin/ld: cannot find -ldl: No such file or directory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It indicates that the &lt;code&gt;ld&lt;/code&gt; command does not have the &lt;code&gt;ldl&lt;/code&gt; option. By checking the OpenWrt documentation, it can be found that the functions in these libraries are actually directly included in the musl libc. However, since some tools try to explicitly link these libraries, you may encounter a "No Such file or directory" error. To solve this problem, just create stub libraries for them.&lt;/p&gt;

&lt;p&gt;Use Vi to create a sh file &lt;code&gt;vi run.sh&lt;/code&gt;, and enter the following content in the file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt; &amp;gt; /usr/lib/libdl.a
!&amp;lt;arch&amp;gt;
&lt;/span&gt;&lt;span class="no"&gt;EOF
&lt;/span&gt;&lt;span class="nb"&gt;cp&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt; /usr/lib/libdl.a /usr/lib/librt.a
&lt;span class="nb"&gt;cp&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt; /usr/lib/libdl.a /usr/lib/libpthread.a
&lt;span class="nb"&gt;cp&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt; /usr/lib/libdl.a /usr/lib/libresolv.a
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;chmod&lt;/span&gt; +x run.sh
./run.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then continue to try &lt;code&gt;make CMAKE_BUILD_TYPE=RelWithDebInfo&lt;/code&gt;, and this time the error content changes to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/bin/sh: install: not found
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It indicates that the install command is not found. The solution to this is install the full package of install command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;opkg &lt;span class="nb"&gt;install &lt;/span&gt;coreutils-install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The error content changes to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CMake Error at /usr/lib/python3.11/site-packages/cmake/data/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
Could NOT find Gettext (missing: GETTEXT_MSGMERGE_EXECUTABLE
GETTEXT_MSGFMT_EXECUTABLE)
Call Stack (most recent call first):
/usr/lib/python3.11/site-packages/cmake/data/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
/usr/lib/python3.11/site-packages/cmake/data/share/cmake-3.30/Modules/FindGettext.cmake:81 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
src/nvim/po/CMakeLists.txt:1 (find_package)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It indicates that Gettext was not found. There is currently no quick installation method for Gettext packages, and we need to install it by compiling.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wget &lt;span class="nt"&gt;-c&lt;/span&gt; https://ftp.gnu.org/pub/gnu/gettext/gettext-0.22.5.tar.gz
&lt;span class="nb"&gt;tar &lt;/span&gt;zxvf gettext-0.22.5.tar.gz
&lt;span class="nb"&gt;cd &lt;/span&gt;gettext-0.22.5
./configure
make &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; make &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then continue to try compiling neovim, and the error returned is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/usr/bin/ld: cannot find -lutil: No such file or directory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can bypass it by creating stub libraries:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"int main() { return 0; }"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; dummy.c
gcc &lt;span class="nt"&gt;-shared&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; /usr/lib/libutil.so dummy.c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At this point, the compilation is basically complete, and we can proceed with the installation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;make &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The binary executable file is located in &lt;code&gt;/usr/local/bin&lt;/code&gt;, and we can directly move it to &lt;code&gt;/usr/bin&lt;/code&gt; or create a soft link there. After that, if you want to install Astrovim or Lazyvim, you can directly execute it.&lt;/p&gt;

&lt;h1&gt;
  
  
  🤗 &lt;strong&gt;Summary and Conclusion&lt;/strong&gt;
&lt;/h1&gt;

&lt;h3&gt;
  
  
  OPKG Install Dependencies OPKG Install Dependencies
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;opkg update
opkg &lt;span class="nb"&gt;install &lt;/span&gt;git git-http python3 python3-pip make luajit gcc coreutils-install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  PIP Install Dependencies PIP Install Dependencies
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;cmake 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Compile and Install Gettext Compile and Install Gettext
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wget &lt;span class="nt"&gt;-c&lt;/span&gt; https://ftp.gnu.org/pub/gnu/gettext/gettext-0.22.5.tar.gz
&lt;span class="nb"&gt;tar &lt;/span&gt;zxvf gettext-0.22.5.tar.gz
&lt;span class="nb"&gt;cd &lt;/span&gt;gettext-0.22.5
./configure
make &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; make &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Create Stub Libraries Create Stub Libraries
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vi run.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt; &amp;gt; /usr/lib/libdl.a
!&amp;lt;arch&amp;gt;
&lt;/span&gt;&lt;span class="no"&gt;EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cp&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt; /usr/lib/libdl.a /usr/lib/librt.a
&lt;span class="nb"&gt;cp&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt; /usr/lib/libdl.a /usr/lib/libpthread.a
&lt;span class="nb"&gt;cp&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt; /usr/lib/libdl.a /usr/lib/libresolv.a
&lt;span class="nb"&gt;chmod&lt;/span&gt; +x run.sh
./run.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"int main() { return 0; }"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; dummy.c
gcc &lt;span class="nt"&gt;-shared&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; /usr/lib/libutil.so dummy.c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Clone Neovim Repository and Compile and Install Clone Neovim Repository and Compile and Install
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/neovim/neovim
&lt;span class="nb"&gt;cd &lt;/span&gt;neovim &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; make &lt;span class="nv"&gt;CMAKE_BUILD_TYPE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;RelWithDebInfo
make &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After completion, the &lt;code&gt;nvim&lt;/code&gt; binary file is located in &lt;code&gt;/usr/local/bin&lt;/code&gt;.If you need the stable version of Neovim, modify &lt;code&gt;CMAKE_BUILD_TYPE=Release&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Directly Download Binary File Directly Download Binary File
&lt;/h3&gt;

&lt;p&gt;If you do not want to compile it yourself, and you happen to have an X86_64 architecture OpenWRT, you can also directly download the binary file I compiled for use.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/moreoronce/init.vim/blob/main/neovim.7z" rel="noopener noreferrer"&gt;init.vim/neovim.7z at main · moreoronce/init.vim&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  📎 Reference
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/neovim/neovim/blob/master/INSTALL.md#install-from-source" rel="noopener noreferrer"&gt;Neovim/INSTALL.md&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://openwrt.org/docs/guide-developer/toolchain/building_openwrt_on_openwrt" rel="noopener noreferrer"&gt;Building OpenWrt ON OpenWrt&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://deeprouter.org/article/build-neovim-on-openwrt" rel="noopener noreferrer"&gt;⌨️在OpenWRT上使用Neovim&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;💡 If you have any questions about the installation or use of OpenWrt, please feel free to leave a comment at the bottom, and let's communicate together~&lt;/p&gt;

</description>
      <category>neovim</category>
      <category>openwrt</category>
    </item>
    <item>
      <title>Custom OpenWRT Software Sources</title>
      <dc:creator>Yawata Yahaha</dc:creator>
      <pubDate>Fri, 07 Mar 2025 04:08:48 +0000</pubDate>
      <link>https://dev.to/yawatasensei/custom-openwrt-software-sources-3o55</link>
      <guid>https://dev.to/yawatasensei/custom-openwrt-software-sources-3o55</guid>
      <description>&lt;p&gt;😀 This article is mainly for personal documentation, as I need to manually replace software sources after each OpenWRT reinstallation to speed up software list updates and installations. I've organized this information for others to use. As of October 15, 2024, all content is accessible and usable.&lt;/p&gt;

&lt;h1&gt;
  
  
  📝 Custom OpenWRT Software Sources
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Official Mirror Sites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;OpenWRT Official Download Site&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;URL: &lt;a href="https://downloads.openwrt.org/" rel="noopener noreferrer"&gt;https://downloads.openwrt.org/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the main site for OpenWRT, providing all official firmware and packages. It is the primary source for obtaining the latest stable versions, development snapshots, and historical versions.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;OpenWRT Official GitHub Repository&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;URL: &lt;a href="https://github.com/openwrt/openwrt" rel="noopener noreferrer"&gt;https://github.com/openwrt/openwrt&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Primarily used for code storage and development, but also provides some resources and documentation links.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Domestic Mirror Sites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Tsinghua University Open Source Software Mirror Site&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;URL: &lt;a href="https://mirrors.tuna.tsinghua.edu.cn/openwrt" rel="noopener noreferrer"&gt;https://mirrors.tuna.tsinghua.edu.cn/openwrt&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Provides mirrors of various OpenWRT versions, very stable and fast.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;University of Science and Technology of China Open Source Mirror Site&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;URL: &lt;a href="https://mirrors.ustc.edu.cn/openwrt" rel="noopener noreferrer"&gt;https://mirrors.ustc.edu.cn/openwrt&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another reliable mirror source offering various OpenWRT versions.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Alibaba Cloud Open Source Mirror Site&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;URL: &lt;a href="https://mirrors.aliyun.com/openwrt" rel="noopener noreferrer"&gt;https://mirrors.aliyun.com/openwrt&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Provides stable OpenWRT mirror download services.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Chongqing University Open Source Mirror Site&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;URL: &lt;a href="https://mirrors.cqu.edu.cn/openwrt/" rel="noopener noreferrer"&gt;https://mirrors.cqu.edu.cn/openwrt/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another domestic mirror option.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Nanjing University Open Source Mirror Site&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;URL: &lt;a href="https://mirror.nju.edu.cn/openwrt/" rel="noopener noreferrer"&gt;https://mirror.nju.edu.cn/openwrt/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Offers multi-version support for OpenWRT.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Shanghai Jiao Tong University Open Source Mirror Site&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;URL: &lt;a href="https://mirror.sjtu.edu.cn/openwrt/" rel="noopener noreferrer"&gt;https://mirror.sjtu.edu.cn/openwrt/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Provides stable open source software mirror services.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Lanzhou University Open Source Mirror Site&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;URL: &lt;a href="https://mirror.lzu.edu.cn/openwrt/" rel="noopener noreferrer"&gt;https://mirror.lzu.edu.cn/openwrt/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Offers mirrors for multiple open source projects with an interesting interface.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Zhejiang University Open Source Mirror Site&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;URL: &lt;a href="https://mirrors.zju.edu.cn/openwrt/" rel="noopener noreferrer"&gt;https://mirrors.zju.edu.cn/openwrt/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Provides mirrors for various open source software projects.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Personal Mirror Site
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;OpenWRT.AI Software Repository&lt;/strong&gt;:URL: &lt;a href="https://dl.openwrt.ai/Kiddin9's" rel="noopener noreferrer"&gt;https://dl.openwrt.ai/Kiddin9's&lt;/a&gt; self-built software repository, currently supporting only OpenWRT 23.05 version.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How to Choose and Use Mirror Sites
&lt;/h3&gt;

&lt;p&gt;Configuring official software sources on an OpenWRT router usually requires no additional operations, as OpenWRT is configured with official sources by default. Simply run the &lt;code&gt;opkg update&lt;/code&gt; command to ensure the package list is up-to-date. It's also not recommended to frequently update the system's default software unless there are noticeable performance issues.&lt;/p&gt;

&lt;p&gt;To use these mirror sources, you need to modify the OPKG software sources on the OpenWRT router. Check the &lt;code&gt;/etc/opkg/customfeeds.conf&lt;/code&gt; file to ensure it's configured correctly for your OpenWRT version and device architecture.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configuration Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;src/gz openwrt_core https://mirror.bjtu.edu.cn/openwrt/releases/&amp;lt;version&amp;gt;/targets/&amp;lt;target&amp;gt;/packages
src/gz openwrt_base https://mirror.bjtu.edu.cn/openwrt/releases/&amp;lt;version&amp;gt;/packages/&amp;lt;architecture&amp;gt;/base
src/gz openwrt_luci https://mirror.bjtu.edu.cn/openwrt/releases/&amp;lt;version&amp;gt;/packages/&amp;lt;architecture&amp;gt;/luci
src/gz openwrt_packages https://mirror.bjtu.edu.cn/openwrt/releases/&amp;lt;version&amp;gt;/packages/&amp;lt;architecture&amp;gt;/packages
src/gz openwrt_routing https://mirror.bjtu.edu.cn/openwrt/releases/&amp;lt;version&amp;gt;/packages/&amp;lt;architecture&amp;gt;/routing
src/gz openwrt_telephony https://mirror.bjtu.edu.cn/openwrt/releases/&amp;lt;version&amp;gt;/packages/&amp;lt;architecture&amp;gt;/telephony
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;https://mirror.bjtu.edu.cn/openwrt/&lt;/code&gt; in the above content with the OpenWRT software source address you want to use. Note that &lt;code&gt;&amp;lt;version&amp;gt;&lt;/code&gt; needs to be replaced with your OpenWRT version number, and &lt;code&gt;&amp;lt;architecture&amp;gt;&lt;/code&gt; with your system architecture, such as X86_64.&lt;/p&gt;

&lt;h3&gt;
  
  
  Common Architectures
&lt;/h3&gt;

&lt;p&gt;You can check the system architecture with the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# View current CPU architecture&lt;/span&gt;
&lt;span class="nb"&gt;uname&lt;/span&gt; &lt;span class="nt"&gt;-m&lt;/span&gt;

&lt;span class="c"&gt;# View system acceptable CPU architectures&lt;/span&gt;
opkg print-architecture
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Instruction Set&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Architecture / Sub-architecture&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;OpenWrt Package Structure&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;ㅤ&lt;/td&gt;
&lt;td&gt;arm64/genericlayerscape/64b&lt;/td&gt;
&lt;td&gt;aarch64_armv8-a&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ㅤ&lt;/td&gt;
&lt;td&gt;arc770/generic&lt;/td&gt;
&lt;td&gt;arc_arc700&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ㅤ&lt;/td&gt;
&lt;td&gt;archs38/generic&lt;/td&gt;
&lt;td&gt;arc_archs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ARM&lt;/td&gt;
&lt;td&gt;brcm2708/bcm2708&lt;/td&gt;
&lt;td&gt;arm_arm1176jzf-s_vfp&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ARM&lt;/td&gt;
&lt;td&gt;at91/legacymcs814x/genericmxs/generic&lt;/td&gt;
&lt;td&gt;arm_arm926ej-s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ARM&lt;/td&gt;
&lt;td&gt;ipq806x/generic&lt;/td&gt;
&lt;td&gt;arm_cortex-a15_neon-vfpv4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ARM&lt;/td&gt;
&lt;td&gt;at91/sama5d3&lt;/td&gt;
&lt;td&gt;arm_cortex-a5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ARM&lt;/td&gt;
&lt;td&gt;brcm2708/bcm2710&lt;/td&gt;
&lt;td&gt;arm_cortex-a53_neon-vfpv4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ARM&lt;/td&gt;
&lt;td&gt;mediatek/generic&lt;/td&gt;
&lt;td&gt;arm_cortex-a7&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ARM&lt;/td&gt;
&lt;td&gt;brcm2708/bcm2709&lt;/td&gt;
&lt;td&gt;arm_cortex-a7_neon-vfpv4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ARM&lt;/td&gt;
&lt;td&gt;sunxi/generic&lt;/td&gt;
&lt;td&gt;arm_cortex-a8_vfpv3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ARM&lt;/td&gt;
&lt;td&gt;bcm53xx/genericlayerscape/32b&lt;/td&gt;
&lt;td&gt;arm_cortex-a9&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ARM&lt;/td&gt;
&lt;td&gt;imx6/genericzynq/generic&lt;/td&gt;
&lt;td&gt;arm_cortex-a9_neon&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ARM&lt;/td&gt;
&lt;td&gt;mvebu/genericomap/generic&lt;/td&gt;
&lt;td&gt;arm_cortex-a9_vfpv3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ARM&lt;/td&gt;
&lt;td&gt;gemini/raidsonicgemini/wiligear&lt;/td&gt;
&lt;td&gt;arm_fa526&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ARM&lt;/td&gt;
&lt;td&gt;oxnas/generic&lt;/td&gt;
&lt;td&gt;arm_mpcore&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ARM&lt;/td&gt;
&lt;td&gt;cns3xxx/generic&lt;/td&gt;
&lt;td&gt;arm_mpcore_vfp&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ARM&lt;/td&gt;
&lt;td&gt;kirkwood/generic&lt;/td&gt;
&lt;td&gt;arm_xscale&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ARM&lt;/td&gt;
&lt;td&gt;ixp4xx/genericixp4xx/harddisk&lt;/td&gt;
&lt;td&gt;armeb_xscale&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MIPS64&lt;/td&gt;
&lt;td&gt;malta/be64&lt;/td&gt;
&lt;td&gt;mips64_mips64&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MIPS64&lt;/td&gt;
&lt;td&gt;octeon/generic&lt;/td&gt;
&lt;td&gt;mips64_octeon&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MIPS64&lt;/td&gt;
&lt;td&gt;malta/le64&lt;/td&gt;
&lt;td&gt;mips64el_mips64&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MIPS&lt;/td&gt;
&lt;td&gt;ar71xx/genericar71xx/nandar71xx/mikrotiklantiq/xrx200lantiq/xwaylantiq/xway_legacymalta/be&lt;/td&gt;
&lt;td&gt;mips_24kc&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MIPS&lt;/td&gt;
&lt;td&gt;adm5120/router_beath25/genericbrcm63xx/genericbrcm63xx/smp&lt;/td&gt;
&lt;td&gt;mips_mips32&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MIPS&lt;/td&gt;
&lt;td&gt;malta/leramips/rt305xramips/mt7620ramips/mt7621ramips/mt7628ramips/mt7688&lt;/td&gt;
&lt;td&gt;mipsel_24kc&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MIPS&lt;/td&gt;
&lt;td&gt;brcm47xx/mips74kramips/rt3883&lt;/td&gt;
&lt;td&gt;mipsel_74kc&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MIPS&lt;/td&gt;
&lt;td&gt;adm5120/router_leadm5120/rb1xxadm8668/genericar7/genericar7/ac49xau1000/au1500au1000/au1550brcm47xx/genericbrcm47xx/legacyrb532/genericxburst/qi_lb60&lt;/td&gt;
&lt;td&gt;mipsel_mips32&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MIPS&lt;/td&gt;
&lt;td&gt;ramips/rt288x&lt;/td&gt;
&lt;td&gt;mipsel_mips32r2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PPC&lt;/td&gt;
&lt;td&gt;ppc44x/generic&lt;/td&gt;
&lt;td&gt;powerpc_440&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PPC&lt;/td&gt;
&lt;td&gt;apm821xx/nandapm821xx/sata&lt;/td&gt;
&lt;td&gt;powerpc_464fp&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PPC&lt;/td&gt;
&lt;td&gt;mpc85xx/generic, mpc85xx/p1020&lt;/td&gt;
&lt;td&gt;powerpc_8540&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;x86&lt;/td&gt;
&lt;td&gt;x86/geode&lt;/td&gt;
&lt;td&gt;i386_geode&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;x86&lt;/td&gt;
&lt;td&gt;x86/legacy&lt;/td&gt;
&lt;td&gt;i386_i486&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;x86&lt;/td&gt;
&lt;td&gt;x86/generic&lt;/td&gt;
&lt;td&gt;i386_pentium4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;x86_64&lt;/td&gt;
&lt;td&gt;x86/64&lt;/td&gt;
&lt;td&gt;x86_64&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Command Line Replacement Method
&lt;/h3&gt;

&lt;p&gt;Or modify it via command line with the format &lt;code&gt;s,[original source address],[replacement source address],g&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s1"&gt;'s,https://downloads.openwrt.org,https://mirror.bjtu.edu.cn/openwrt,g'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s1"&gt;'s,https://downloads.openwrt.org,https://mirror.bjtu.edu.cn/openwrt,g'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;-i&lt;/span&gt;.bak /etc/opkg/customfeeds.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After replacing, run &lt;code&gt;opkg update&lt;/code&gt; to update.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Notes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The official OpenWRT software sources may not fully match third-party customized firmware, such as those from esir or Leon, which might have incomplete libraries or compatibility issues. Additionally, the k-mod-*.ipk packages provided by official sources might not install directly.&lt;/p&gt;

&lt;p&gt;If you're a beginner or just want to set up OpenWRT for long-term use, it is recommended to use &lt;a href="https://downloads.immortalwrt.org/" rel="noopener noreferrer"&gt;ImmortalWRT&lt;/a&gt;, which might offer better support for software sources and also allows for custom configuration of domestic software sources with &lt;code&gt;immoralwrt-opkg-replace-edu-mirror&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In the latest snapshot versions, OpenWRT has replaced opkg with apk package manager. Be mindful of the version when changing software sources. It is not recommended for beginners or novices to use snapshot (SNAPSHOT) or RC versions, nor is it advised to use non-open-source third-party firmware.&lt;/p&gt;

&lt;h1&gt;
  
  
  📎 &lt;strong&gt;Reference&lt;/strong&gt;
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://openwrt.org/docs/guide-user/additional-software/opkg" rel="noopener noreferrer"&gt;https://openwrt.org/docs/guide-user/additional-software/opkg&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://deeprouter.org/article/Compilation-of-OpenWRT-Software-Sources" rel="noopener noreferrer"&gt;Chinese Version&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>openwrt</category>
    </item>
    <item>
      <title>⛏️How to Compile and Install Neovim on Debian</title>
      <dc:creator>Yawata Yahaha</dc:creator>
      <pubDate>Thu, 06 Mar 2025 04:57:32 +0000</pubDate>
      <link>https://dev.to/yawatasensei/how-to-compile-and-install-neovim-on-debian-134g</link>
      <guid>https://dev.to/yawatasensei/how-to-compile-and-install-neovim-on-debian-134g</guid>
      <description>&lt;p&gt;😀 This Article is fork from &lt;a href="https://en.deeprouter.org/article/How-to-Compile-and-Install-Neovim-on-Debian" rel="noopener noreferrer"&gt;⛏️How to Compile and Install Neovim on Debian&lt;br&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Neovim is an open-source Vim alternative that offers many enhanced features such as asynchronous operations, an embedded scripting language, and a built-in compiler. Compiling and installing Neovim on the Debian operating system requires some command-line skills. This article will detail how to compile and install Neovim on Debian.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  📝 What is Neovim
&lt;/h2&gt;

&lt;p&gt;Neovim is a highly customizable Vim-like editor that has several advantages over the original Vim editor:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Asynchronous Operations: Neovim allows you to perform asynchronous operations while editing files, such as code completion and syntax checking, thereby improving editing efficiency.&lt;/li&gt;
&lt;li&gt;Built-in Scripting Language: Neovim has Lua embedded as a scripting language, offering more customization options and plugins.&lt;/li&gt;
&lt;li&gt;User Interface Improvements: Neovim provides a more intuitive user interface, along with better keyboard shortcuts and operational experiences.&lt;/li&gt;
&lt;li&gt;Compatibility: Neovim is compatible with most Vim plugins, allowing you to easily port existing Vim configurations.&lt;/li&gt;
&lt;li&gt;Better Multi-tab Support: Neovim offers better multi-tab support, allowing you to quickly switch between multiple files.&lt;/li&gt;
&lt;li&gt;Better LSP Support.
However, the Neovim stable version in the Debian software repository is currently stuck at the 0.4X version, and the testing version is at 0.7.X, which is far behind in many feature optimizations, and many plugins no longer support it. Therefore, we adopt the method of compilation for installation.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Preparation Work Preparation Work
&lt;/h2&gt;

&lt;p&gt;First, you need to ensure that your Debian system has the necessary compilation tools, such as GCC and make. If you haven't installed these tools, you can use the following command to install them:&lt;br&gt;
&lt;code&gt;sudo apt update&lt;br&gt;
sudo apt install build-essential&lt;/code&gt;&lt;br&gt;
In addition, you will need to install some Neovim dependencies, such as Python, Lua, etc. Use the following command to install these dependencies:&lt;br&gt;
&lt;code&gt;sudo apt install libtool libtool-bin autoconf automake cmake g++ pkg-config unzip&lt;br&gt;
sudo apt install libncurses5-dev libncursesw5-dev libtinfo-dev libacl1-dev libgpm-dev gettext&lt;br&gt;
sudo apt install libjemalloc-dev libpython3-dev libpython3-dev libpython-dev luajit libluajit-5.1-dev&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Download Source Code
&lt;/h2&gt;

&lt;p&gt;Now, you can download the source code of Neovim from GitHub. You can use the following command to download the latest version of the source code from GitHub:&lt;br&gt;
&lt;code&gt;git clone https://github.com/neovim/neovim.git&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Compile and Install Compile and Install
&lt;/h2&gt;

&lt;p&gt;Now that you are ready to compile and install Neovim, run the following command in the source code directory to compile and install:&lt;br&gt;
&lt;code&gt;cd neovim&lt;br&gt;
make CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_INSTALL_PREFIX=/usr/local/&lt;br&gt;
sudo make install&lt;/code&gt;&lt;br&gt;
After compilation, Neovim is installed in the &lt;code&gt;/usr/local&lt;/code&gt; folder, without the need for soft links or cp operations. You can also modify &lt;code&gt;CMAKE_INSTALL_PREFIX&lt;/code&gt; to the directory where you want to install it, and remember to add the directory to the environment variable PATH.&lt;/p&gt;

&lt;h2&gt;
  
  
  Compatibility Note
&lt;/h2&gt;

&lt;p&gt;In addition to the Debian system, common Linux systems such as Ubuntu, Centos, Redhat, Kali, and even OpenWRT can also be compiled and installed through the method described in this article.&lt;/p&gt;

&lt;h2&gt;
  
  
  Binary File Installation
&lt;/h2&gt;

&lt;p&gt;In addition to installing Neovim through compilation, you can also directly download the Neovim binary files from the Github Release Page for use. All major release versions are supported by this method.&lt;br&gt;
&lt;code&gt;curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz&lt;br&gt;
tar xzvf nvim-linux64.tar.gz&lt;br&gt;
cd nvim&lt;br&gt;
cp bin/nvim /usr/bin/nvim&lt;br&gt;
cp -rf lib/* /usr/lib/&lt;br&gt;
cp -rf share/* /usr/share/&lt;/code&gt;&lt;/p&gt;

</description>
      <category>neovim</category>
      <category>debian</category>
    </item>
    <item>
      <title>Migrating OpenWrt from Hyper-V to Proxmox VE: A Step-by-Step Guide with Performance Benchmarking</title>
      <dc:creator>Yawata Yahaha</dc:creator>
      <pubDate>Wed, 05 Mar 2025 05:02:16 +0000</pubDate>
      <link>https://dev.to/yawatasensei/migrating-openwrt-from-hyper-v-to-proxmox-ve-a-step-by-step-guide-with-performance-benchmarking-3fjf</link>
      <guid>https://dev.to/yawatasensei/migrating-openwrt-from-hyper-v-to-proxmox-ve-a-step-by-step-guide-with-performance-benchmarking-3fjf</guid>
      <description>&lt;p&gt;📝 Motivation for Migration&lt;br&gt;
The reason for the migration is that my bypass gateway, which used OpenWRT, was originally deployed in the Hyper-V of my daily-use PC. Since I’ve purchased a new N4100 industrial PC with four 2.5G Ethernet ports, this setup now allows me to achieve a full-house 2.5G network, significantly improving internal network transmission speeds. Additionally, it enables me to separate the software router (along with associated bypass gateways, secondary routers, DNS servers, and other components) from my daily-use PC, reducing network fluctuations caused by issues with my computer. This allows my daily-use PC to focus on work and using Moonlight + Sunshine for streaming Steam games. Moreover, after the migration, my daily-use PC can be put into sleep mode or shut down to save on electricity costs (well, not really). Another advantage is the separation of software router data and system data, allowing me to store backup data for PVE on an SMB-mounted disk, minimizing the workload and losses in case of an "All in Boom" scenario.&lt;br&gt;
▌ Key Benefits Observed:&lt;br&gt;
Network Separation: Dedicated N4100 mini-PC replaces gaming PC hosting OpenWRT&lt;br&gt;
2.5Gbps LAN Upgrade: 4×2.5G ports enable full-home high-speed transfers&lt;br&gt;
Energy Efficiency: Reduce idle power consumption by 62W (24×7 operation)&lt;br&gt;
Disaster Recovery: Store PVE backups on SMB shares (non-host storage)&lt;br&gt;
📝 Migration Procedure&lt;br&gt;
Export Hyper-V Virtual Machine&lt;/p&gt;

&lt;p&gt;notion image&lt;br&gt;
In Hyper-V Manager:&lt;br&gt;
In Hyper-V Manager, select the virtual machine you wish to export—let's take OpenWRT as an example. Right-click on it, choose Export, and then select the destination location to save the exported files.&lt;br&gt;
Store in accessible location (minimum 2× disk space required)&lt;br&gt;
Locate VHDX disk:&lt;br&gt;
After exporting, the folder will include the following subfolders: Snapshots, Virtual Hard Disks, and Virtual Machines. The VHDX disk file for the OpenWRT virtual machine is located within the Virtual Hard Disks folder. For example, my ImmortalWrt VHDX file is named immortalwrt-23.05.3-x86-64-generic-squashfs-combined-efi.vhdx. To simplify future conversion and import operations, you can rename the file to something shorter, such as openwrt.vhdx. This will reduce the amount of typing required when entering commands and minimize the risk of import errors due to incorrect file names.&lt;br&gt;
Exported Folder Structure:&lt;br&gt;
├── Snapshots&lt;br&gt;
├── Virtual Hard Disks&lt;br&gt;
│   └── immortalwrt-23.05.3-x86-64-generic-squashfs-combined-efi.vhdx (rename to openwrt.vhdx)&lt;br&gt;
└── Virtual Machines&lt;br&gt;
Plain text&lt;br&gt;
Pro Tip: Shorten filename to avoid path errors in CLI commands&lt;/p&gt;

&lt;p&gt;More：&lt;a href="https://en.deeprouter.org/article/migrate-openwrt-hyperv-to-proxmox-guide" rel="noopener noreferrer"&gt;https://en.deeprouter.org/article/migrate-openwrt-hyperv-to-proxmox-guide&lt;/a&gt;&lt;/p&gt;

</description>
      <category>openwrt</category>
      <category>proxmox</category>
    </item>
    <item>
      <title>Fixing Path of Exile 2 Loading Screen Freezes on Windows 11 24H2</title>
      <dc:creator>Yawata Yahaha</dc:creator>
      <pubDate>Tue, 04 Mar 2025 01:43:45 +0000</pubDate>
      <link>https://dev.to/yawatasensei/fixing-path-of-exile-2-loading-screen-freezes-on-windows-11-24h2-24ep</link>
      <guid>https://dev.to/yawatasensei/fixing-path-of-exile-2-loading-screen-freezes-on-windows-11-24h2-24ep</guid>
      <description>&lt;p&gt;Path of Exile 2 Early Access has been out for a week now. The game is great, but it has its fair share of bugs. One of the most troublesome issues is the system freeze caused by 100% CPU usage during loading screens on Windows 11 version 24H2. This problem prevents you from terminating the process, forcing you to manually restart your computer. There are currently some solutions, such as using BES to limit the CPU usage of the PoE2 process or reducing the number of CPU cores used by PoE through the Windows Task Manager. However, these methods are not perfect; they reduce game performance and prevent your hardware from being fully utilized, especially when entering later stages with many monsters on the screen. Additionally, these settings need to be manually configured every time you launch the game, which is inconvenient. I have found an open-source software called PoEUncrasher, which can temporarily solve this problem perfectly until GGG releases a fix. This means you can play and stream without worrying about the system crashing and needing a restart.&lt;/p&gt;

&lt;h2&gt;
  
  
  📝 PoEUncrasher
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Software Introduction
&lt;/h3&gt;

&lt;p&gt;This is a simple, lightweight tool (only 3.6MB in size, with a memory usage of 26MB when running) designed to fix Path of Exile 2 causing Windows to freeze completely during loading screens, which ultimately forces a system restart. The program is written in C# and packaged as an executable (.exe).&lt;br&gt;
The author notes that this bug seems to only affect AMD X3D CPUs (such as 5700X3D, 5800X3D, 7800X3D), but from my testing, non-X3D AMD CPUs also experience this issue (like my Ryzen 5600). This might be related to several updates for AMD CPUs in Windows 11 24H2, and unless you roll back to Windows 23H2, there is currently no good solution.&lt;/p&gt;

&lt;h3&gt;
  
  
  How It Works
&lt;/h3&gt;

&lt;p&gt;The tool automatically detects the Path of Exile 2 process (PathOfExile.exe) and monitors loading by reading client.txt. When it detects that you're entering a loading screen in PoE2, it changes the process affinity to avoid using CPU0/CPU1, preventing the system freeze caused by full CPU utilization. Once the loading screen is complete (detected by reading client.txt), it updates the affinity to allow all CPU cores to be used again. This minimizes the impact on game performance by reducing CPU core usage only during map loading and restoring full core usage after loading.&lt;/p&gt;

&lt;h4&gt;
  
  
  Usage Instructions
&lt;/h4&gt;

&lt;p&gt;Download the latest version of PoEUncrasher.-.Non.NET.zip from &lt;a href="https://github.com/Kapps/PoEUncrasher/releases" rel="noopener noreferrer"&gt;https://github.com/Kapps/PoEUncrasher/releases&lt;/a&gt;. The latest version is 1.3.0. Unzip the file. The author provides two versions:&lt;br&gt;
PoE.Uncrasher.zip: Requires .NET 9 dependencies installed beforehand, otherwise it won’t run. It won’t trigger a firewall warning for unknown sources.&lt;br&gt;
PoEUncrasher.-.Non.NET.zip: Does not require .NET 9 dependencies, but might trigger a firewall warning for unknown software.&lt;br&gt;
If you have trouble accessing GitHub from within China, you can download it from my shared Quark Cloud link. The shared version is PoEUncrasher.-.Non.NET.zip:&lt;br&gt;
💡&lt;br&gt;
I shared "PoEUncrasher.zip" on Quark Cloud&lt;br&gt;
&lt;a href="https://pan.quark.cn/s/bcf90cb4d15a" rel="noopener noreferrer"&gt;https://pan.quark.cn/s/bcf90cb4d15a&lt;/a&gt;&lt;br&gt;
Extraction code: ATe5&lt;br&gt;
Right-click and run PoEUncrasher.exe in administrator mode. If Windows Firewall warns about unknown software, choose to run it anyway. This warning is not due to a virus or malware, so you can use it safely. Running in non-administrator mode might result in a "Detected loading screen, but could not find any process to park" message.&lt;br&gt;
You can run the software either before or after launching Path of Exile 2. It doesn't matter. The first launch looks like this:&lt;br&gt;
When the game starts, it will detect the game process:&lt;br&gt;
During map loading, it will indicate that CPU0 and CPU1 usage is disabled (shown as two 00s); once loading is complete, it will indicate full CPU core usage is restored. Since my system has 6 cores and 12 threads, it shows 1111111111111111:&lt;br&gt;
I occasionally use Moonlight streaming in the living room, so I keep this small program running constantly. It automatically detects the process after starting the game through Moonlight, requiring minimal interaction, making it quite convenient overall.&lt;/p&gt;

&lt;h2&gt;
  
  
  🤗 About Backdoors
&lt;/h2&gt;

&lt;p&gt;The source code is available at: &lt;a href="https://github.com/Kapps/PoEUncrasher/blob/master/PoEUncrasher/Program.cs" rel="noopener noreferrer"&gt;https://github.com/Kapps/PoEUncrasher/blob/master/PoEUncrasher/Program.cs&lt;/a&gt;. I had Claude analyze it and found no backdoors. If you’re concerned about the pre-compiled version, you can download the source code and compile it yourself.&lt;br&gt;
So far, I haven't encountered any more system freezes during loading since using this tool. With the Christmas holidays approaching, GGG released the last version before the break, 0.1.0e, and they haven’t fixed the loading freeze issue yet. It seems it might not be addressed until 2025.&lt;br&gt;
Lately, I've been deeply engrossed in this game. The End Game content is well-designed, making it hard to stop playing. I haven't been writing my blog much; it's been neglected again.&lt;/p&gt;

&lt;h2&gt;
  
  
  📎 Reference
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://deeprouter.org" rel="noopener noreferrer"&gt;Chinese Version&lt;br&gt;
&lt;/a&gt;&lt;br&gt;
POE 2 Complete PC Freeze while loading screen&lt;/p&gt;

</description>
    </item>
    <item>
      <title>使用Caddy反向代理加速NotionNext博客图片访问</title>
      <dc:creator>Yawata Yahaha</dc:creator>
      <pubDate>Thu, 02 Jan 2025 00:00:00 +0000</pubDate>
      <link>https://dev.to/yawatasensei/shi-yong-caddyfan-xiang-dai-li-jia-su-notionnextbo-ke-tu-pian-fang-wen-de9</link>
      <guid>https://dev.to/yawatasensei/shi-yong-caddyfan-xiang-dai-li-jia-su-notionnextbo-ke-tu-pian-fang-wen-de9</guid>
      <description>&lt;p&gt;&lt;span&gt;📌&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://docs.tangly1024.com/about"&gt;NotionNext&lt;/a&gt;默认使用的是Notion图床。Notion在国内没有服务器，所以通过&lt;code&gt;Notion.so&lt;/code&gt;域名请求的图片资源文件在国内的访问速度不是很好，我们可以通过使用Caddy反向代理的方式加快&lt;code&gt;Notion.so&lt;/code&gt;的图片访问，降低加载图片所需时间，从而提高使用NotionNext的博客在国内（大陆地区）的访问速度与用户体验。&lt;/p&gt;

&lt;p&gt;我这个使用NotionNext，部署在Vercel上的博客页面加载时间太长的问题，也是由于昨天突然博客的国内用户的访问量增加，我在Cloudlfare Web Analytics里面进行日常数据查看时发现的，涉及到的文章页面主要是《&lt;a rel="noopener noreferrer" href="https://deeprouter.org/article/xiaomi-15-close-recommended-ads-tutorial"&gt;小米15手机（澎湃OS2）：如何关闭推荐广告 | Deep Router&lt;/a&gt;》这篇文章，原因在于这篇文章我放了很多的手机截屏图片，这些图片需要进行加载，即使我已经使用了图片的延迟加载功能，但是依旧会因为首屏需要加载3-4张图片，而造成整体页面的加载时间过长，影响用户体验。因为Notion在国内没有服务器，访问速度不算很好，所以大部分图片的LCP（Largest Contentful Paint）延迟都在5秒左右，FCP也因为我未使用&lt;code&gt;webp&lt;/code&gt;格式的图片造成访问延迟上升。在一篇包含很多张图片的文章里，整体的加载速度更堪称灾难级，可能需要30秒以上才能完成首屏加载，这一点在移动端设备上，因为性能差异进一步被放大。为了优化博客国内的访问体验，所以我尝试寻找解决方案，让NotionNext的图片加载不再那么灾难。在《&lt;b&gt;Nginx设置Notion反代加速NotionNext图片资源访问&lt;/b&gt;》这篇文章中（原文章似乎被作者删除，目前处于404状态），文章作者提到可以通过使用&lt;a rel="noopener noreferrer" href="https://nginx.org/"&gt;Nginx&lt;/a&gt;反向代理（反代）方式进行解决，通过Nginx将用户对图片素材的访问请求反向代理至&lt;code&gt;notion.so&lt;/code&gt;，这样只要部署Nginx的机器在国内的访问速度够快，那么托管的Notion上的图片资源也能够很快的进行加载，降低LCP延迟。但是我没有使用Nginx作为Web服务器，而是使用的Caddy这个更轻量化的解决方案，所以就在这篇文章的基础上，提供一份基于&lt;a rel="noopener noreferrer" href="https://caddyserver.com/"&gt;Caddy&lt;/a&gt;的反向代理解决方案。&lt;/p&gt;

&lt;p&gt;在开始之前，我们先查看一下目前&lt;code&gt;Notion.so&lt;/code&gt;在国内的访问情况，大部分浅绿，平均加载时间在3s左右，且在部分地区无法直接进行访问：&lt;/p&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fprod-files-secure.s3.us-west-2.amazonaws.com%252F6d3fda40-6b03-4bf3-842b-4c9bb68a90f1%252F1b8e04b3-94d2-43e6-94dc-4d871c75f10b%252Fimage.png%3Ftable%3Dblock%26id%3D16f97571-0fee-80aa-8f37-cb670c6ecb67%26t%3D16f97571-0fee-80aa-8f37-cb670c6ecb67%26width%3D768%26cache%3Dv2" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fprod-files-secure.s3.us-west-2.amazonaws.com%252F6d3fda40-6b03-4bf3-842b-4c9bb68a90f1%252F1b8e04b3-94d2-43e6-94dc-4d871c75f10b%252Fimage.png%3Ftable%3Dblock%26id%3D16f97571-0fee-80aa-8f37-cb670c6ecb67%26t%3D16f97571-0fee-80aa-8f37-cb670c6ecb67%26width%3D768%26cache%3Dv2" alt="notion.so in China" width="1024" height="461"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;&lt;span&gt;
&lt;span&gt;📝 Caddy反向代理配置前提&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;p&gt;你需要一台云服务器，境内境外均可，我所使用的小鸡（云服务器）是在香港，购自CoalCloud（碳云），国内访问速度在ITDOG上查询还不错。平常只作为RSS推送服务和&lt;a rel="noopener noreferrer" href="https://deeprouter.org/article/Docker-accelerated-mirror"&gt;Docker加速镜像&lt;/a&gt;使用。如果不使用Cloudflare的话，需要自行在云服务器为用于反向代理的域名申请证书，例如使用&lt;a rel="noopener noreferrer" href="https://letsencrypt.org/"&gt;letsencrypt&lt;/a&gt;或者&lt;a rel="noopener noreferrer" href="https://wiki.acme.sh"&gt;acme&lt;/a&gt;，但是如果你也和我一样使用Caddy的话，那么Caddy会自动帮你通过acme申请好所配置的域名的证书。&lt;/p&gt;

&lt;p&gt;也有一些解决方案是通过Cloudflare Worker实现，我没有使用Cloudflare Worker进行反向代理的原因是担心会被认为在滥用，从而导致Cloudflare账号被封禁（Ban）或限制服务。&lt;/p&gt;

&lt;h2&gt;&lt;span&gt;
&lt;span&gt;📝 什么是Caddy&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;p&gt;Caddy是一个开源的Web服务器和反向代理工具，专注于简化HTTP服务器的配置流程和提升安全性。它以&lt;b&gt;自动化HTTPS部署&lt;/b&gt;为核心特性，无需手动操作即可为站点申请并更新SSL/TLS证书。支持HTTP/3、静态文件托管、负载均衡、反向代理等功能，通过简洁的配置文件（或直接通过 API）即可快速部署HTTP服务。Caddy凭借原生Go语言编写的高效性和跨平台兼容性，常被用于轻量化场景，适合Web开发者和运维人员快速构建安全的网络服务，作为Nginx的替代服务。&lt;/p&gt;

&lt;p&gt;Caddy的最新版本是Caddy2，目前主流版本也是Caddy2。需要注意的是，Caddy和Caddy2的配置文件语法并不完全一样，当你无法确认自己编写的配置文件是否符合Caddy2语法时，可通过以下命令进行测试：&lt;/p&gt;

&lt;h2&gt;&lt;span&gt;
&lt;span&gt;📝 安装Caddy&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;p&gt;Caddy的安装很简单，由于不使用其他第三方插件，所以可以直接通过系统的包管理器进行安装，例如我使用的是Debian系统：&lt;/p&gt;

&lt;p&gt;如果你需要使用缓存，或者使用其他Caddy的插件，你也可以通过&lt;a rel="noopener noreferrer" href="https://caddyserver.com/download"&gt;Download Caddy&lt;/a&gt;增加所需插件，例如缓存插件&lt;b&gt;&lt;a rel="noopener noreferrer" href="https://github.com/darkweak/souin"&gt;darkweak/souin/plugins/caddy&lt;/a&gt;&lt;/b&gt;，并进行二进制可执行文件的下载。Caddy的插件是通过Go的编译时插件系统实现，即需要在Caddy编译时绑定并集成插件，与Nginx和Apache有所区别。增加插件后的Caddy可支持特定语法。目前虽然Caddy也支持通过&lt;code&gt;caddy install&lt;/code&gt; 命令增加插件，但还处于实验性阶段，可能存在潜在的稳定性风险。&lt;/p&gt;

&lt;p&gt;在Bash中，可通过以下命令查看Caddy已安装的插件：&lt;/p&gt;

&lt;h2&gt;&lt;span&gt;
&lt;span&gt;📝 修改Caddy配置文件&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;p&gt;这里我所使用的域名是&lt;code&gt;notion.dolingou.com&lt;/code&gt; ,即通过&lt;code&gt;notion.dolingou.com&lt;/code&gt;域名替代&lt;code&gt;notion.so&lt;/code&gt;域名从而实现反向代理加载位于Notion上的图片。安装完Caddy之后，默认的Caddy配置文件位于&lt;code&gt;/etc/caddy/Caddyfile&lt;/code&gt; ，你可以使用你喜欢的编辑器进行编辑，例如我使用的是&lt;code&gt;Neovim&lt;/code&gt; ，在配置文件中添加如下内容，通过&lt;code&gt;{}&lt;/code&gt;进行片段的包裹：&lt;/p&gt;

&lt;h3&gt;&lt;span&gt;
&lt;span&gt;Caddy2配置要点&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;p&gt;配置要点部分对上述配置文件进行分片段讲解。&lt;/p&gt;

&lt;h4&gt;&lt;span&gt;
&lt;span&gt;压缩模式&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;

&lt;p&gt;涉及代码段：&lt;/p&gt;

&lt;p&gt;采用&lt;code&gt;gzip&lt;/code&gt;压缩，降低带宽利用。&lt;/p&gt;

&lt;h4&gt;&lt;span&gt;
&lt;span&gt;拒绝所有非来自博客域名请求&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;

&lt;p&gt;涉及代码段：&lt;/p&gt;

&lt;p&gt;这部分代码主要是定义非来自博客的域名请求host，避免这个反向代理被恶意使用，造成反向代理服务器的负载过高出现问题，或者盗刷大量流量。所有非博客域名的请求均会返回&lt;code&gt;403&lt;/code&gt;错误。你可以将&lt;code&gt;*.dolingou.com&lt;/code&gt; 替换为你的域名。&lt;/p&gt;

&lt;h4&gt;&lt;span&gt;
&lt;span&gt;处理Caddy反向代理域名根目录请求&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;

&lt;p&gt;根目录请求处理涉及代码段：&lt;/p&gt;

&lt;p&gt;这部分代码主要用于定义域名所绑定的根目录位置，以及当用户直接访问根目录及根目录下&lt;code&gt;/image&lt;/code&gt;时，返回&lt;code&gt;200&lt;/code&gt; 请求，并设置响应头的&lt;code&gt;Content-Type&lt;/code&gt;为&lt;code&gt;text/plain&lt;/code&gt; ；一方面为特定路径提供简单的占位符响应，另一方面可以快速测试服务器的响应，便于Debug。&lt;/p&gt;

&lt;h4&gt;&lt;span&gt;
&lt;span&gt;Caddy反向代理转发配置&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;

&lt;p&gt;反向代理转发配置部分涉及代码段：&lt;/p&gt;

&lt;p&gt;这段代码用于定义NotionNext图片的请求路径，将匹配特定路径的请求代理转发到目标服务器&lt;code&gt;&lt;a href="https://www.notion.so" rel="noopener noreferrer"&gt;https://www.notion.so&lt;/a&gt;&lt;/code&gt;，并在转发过程中设置一些请求头、Host、Referer、User-Agent和SSL/TLS配置。&lt;/p&gt;

&lt;p&gt;具体如下：&lt;/p&gt;

&lt;ol start="1"&gt;
&lt;li&gt;
&lt;b&gt;定义匹配器 &lt;/b&gt;&lt;code&gt;&lt;b&gt;@imagePath&lt;/b&gt;&lt;/code&gt;&lt;b&gt;：&lt;/b&gt;
&lt;/li&gt;
&lt;ol&gt;
&lt;ul&gt;&lt;li&gt;
&lt;code&gt;@imagePath&lt;/code&gt; 是一个匹配器（matcher），用于匹配特定的请求路径。&lt;/li&gt;&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;path_regexp image ^/image.*$&lt;/code&gt;：使用正则表达式匹配路径。&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;
&lt;code&gt;^/image.*$&lt;/code&gt;：匹配以 &lt;code&gt;/image&lt;/code&gt; 开头的所有路径，例如 &lt;code&gt;/image&lt;/code&gt;、&lt;code&gt;/image/123&lt;/code&gt;、&lt;code&gt;/image/test.jpg&lt;/code&gt; 等。&lt;/li&gt;&lt;/ul&gt;
&lt;/ul&gt;
&lt;ul&gt;&lt;li&gt;这个匹配器会捕获所有路径符合正则表达式 &lt;code&gt;^/image.*$&lt;/code&gt; 的请求。&lt;/li&gt;&lt;/ul&gt;
&lt;/ol&gt;




&lt;/ol&gt;

&lt;ol start="2"&gt;
&lt;li&gt;&lt;b&gt;反向代理配置：&lt;/b&gt;&lt;/li&gt;
&lt;ol&gt;
&lt;ul&gt;&lt;li&gt;
&lt;code&gt;reverse_proxy&lt;/code&gt; 是一个指令，用于将请求代理转发到指定的后端服务器。在Caddy 1版本中，反向代理是&lt;code&gt;proxy&lt;/code&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;ul&gt;&lt;li&gt;
&lt;code&gt;@imagePath&lt;/code&gt;：指定匹配器，表示仅对匹配 &lt;code&gt;@imagePath&lt;/code&gt; 的请求生效。&lt;/li&gt;&lt;/ul&gt;
&lt;ul&gt;&lt;li&gt;
&lt;code&gt;https://www.notion.so&lt;/code&gt;：目标服务器的地址，所有匹配的请求都会被转发到这里。根据NotionNext的默认配置文件&lt;code&gt;NEXT_PUBLIC_NOTION_HOST&lt;/code&gt; 的默认值提示，填写&lt;code&gt;notion.so&lt;/code&gt;域名。&lt;/li&gt;&lt;/ul&gt;
&lt;/ol&gt;




&lt;/ol&gt;

&lt;ol start="3"&gt;
&lt;li&gt;&lt;b&gt;设置请求头：&lt;/b&gt;&lt;/li&gt;
&lt;ol&gt;
&lt;ul&gt;&lt;li&gt;
&lt;code&gt;header_up&lt;/code&gt; 是一个指令，用于设置转发到后端服务器的请求头。&lt;/li&gt;&lt;/ul&gt;
&lt;ul&gt;&lt;li&gt;
&lt;code&gt;Host www.notion.so&lt;/code&gt;：将 &lt;code&gt;Host&lt;/code&gt; 头设置为 &lt;code&gt;www.notion.so&lt;/code&gt;，确保后端服务器知道请求的目标主机。&lt;/li&gt;&lt;/ul&gt;
&lt;ul&gt;&lt;li&gt;
&lt;code&gt;Referer https://www.notion.so&lt;/code&gt;：将 &lt;code&gt;Referer&lt;/code&gt; 头设置为 &lt;code&gt;https://www.notion.so&lt;/code&gt;，模拟请求来源。&lt;/li&gt;&lt;/ul&gt;
&lt;ul&gt;&lt;li&gt;
&lt;code&gt;User-Agent {http.request.header.User-Agent}&lt;/code&gt;：将 &lt;code&gt;User-Agent&lt;/code&gt; 头设置为客户端原始请求的 &lt;code&gt;User-Agent&lt;/code&gt;，确保后端服务器能够识别客户端类型。&lt;/li&gt;&lt;/ul&gt;
&lt;ul&gt;&lt;li&gt;
&lt;code&gt;X-Real-IP {http.request.remote.host}&lt;/code&gt;：将 &lt;code&gt;X-Real-IP&lt;/code&gt; 头设置为客户端的真实IP地址，用于后端服务器记录或处理。&lt;/li&gt;&lt;/ul&gt;
&lt;ul&gt;&lt;li&gt;
&lt;code&gt;Accept-Encoding ""&lt;/code&gt;：清空 &lt;code&gt;Accept-Encoding&lt;/code&gt; 头，防止后端服务器返回压缩内容（如果需要）。&lt;/li&gt;&lt;/ul&gt;
&lt;ul&gt;&lt;li&gt;
&lt;code&gt;Accept-Language {http.request.header.Accept-Language}&lt;/code&gt;：将 &lt;code&gt;Accept-Language&lt;/code&gt; 头设置为客户端原始请求的 &lt;code&gt;Accept-Language&lt;/code&gt;，确保后端服务器返回正确的语言内容。&lt;/li&gt;&lt;/ul&gt;
&lt;ul&gt;&lt;li&gt;
&lt;code&gt;X-Cache {http.reverse_proxy.header.X-Cache-Status}&lt;/code&gt;：将 &lt;code&gt;X-Cache&lt;/code&gt; 头设置为反向代理的缓存状态（如果有）。&lt;/li&gt;&lt;/ul&gt;
&lt;/ol&gt;




&lt;/ol&gt;

&lt;ol start="4"&gt;
&lt;li&gt;&lt;b&gt;SSL/TLS配置：&lt;/b&gt;&lt;/li&gt;
&lt;ol&gt;
&lt;ul&gt;&lt;li&gt;
&lt;code&gt;transport http&lt;/code&gt;：定义HTTP传输配置。&lt;/li&gt;&lt;/ul&gt;
&lt;ul&gt;&lt;li&gt;
&lt;code&gt;tls&lt;/code&gt;：启用TLS（HTTPS）加密，确保与后端服务器的通信是安全的。&lt;/li&gt;&lt;/ul&gt;
&lt;ul&gt;&lt;li&gt;
&lt;code&gt;tls_server_name www.notion.so&lt;/code&gt;：设置TLS的服务器名称为&lt;code&gt;www.notion.so&lt;/code&gt;，用于SNI（Server Name Indication）验证。&lt;/li&gt;&lt;/ul&gt;
&lt;/ol&gt;




&lt;/ol&gt;

&lt;p&gt;完成以上配置后，直接访问反代域名，这时候浏览器应该会显示一个&lt;code&gt;200 OK！&lt;/code&gt; ，即表示配置成功。&lt;/p&gt;

&lt;ol start="5"&gt;&lt;li&gt;&lt;b&gt;Caddy缓存配置：&lt;/b&gt;&lt;/li&gt;&lt;/ol&gt;

&lt;p&gt;我没有像上面Nginx样例中一样为反向代理添加缓存。原因在于目前Caddy2自身没有提供缓存功能，需要通过插件实现。而插件在命中率和缓存污染等方面的实现情况并不是很好。我的博客本身流量也不是很大，而且又有Cloudflare的CDN作为缓存，所以也就没有继续研究Caddy的这部分缓存功能。&lt;/p&gt;

&lt;ol start="6"&gt;&lt;li&gt;&lt;b&gt;重启Caddy&lt;/b&gt;&lt;/li&gt;&lt;/ol&gt;

&lt;p&gt;在完成上述Caddyfile配置文件修改后，需要对Caddy进行重启：&lt;/p&gt;

&lt;h2&gt;&lt;span&gt;
&lt;span&gt;📝 配置Vercel环境变量&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;p&gt;完成以上在云服务器的Caddy配置后，在Vercel中的NotionNext项目下添加环境变量&lt;code&gt;NEXT_PUBLIC_NOTION_HOST&lt;/code&gt;，用于替换默认的Notion Host变量（&lt;code&gt;&lt;a href="https://notion.so" rel="noopener noreferrer"&gt;https://notion.so&lt;/a&gt;&lt;/code&gt;）。&lt;/p&gt;

&lt;p&gt;Vercel环境变量配置的位置位于&lt;code&gt;Settings&lt;/code&gt; → &lt;code&gt;Environment Variables&lt;/code&gt; 中，在Key中输入变量名称，Value中输入变量值，点击Save即可新增环境变量：&lt;/p&gt;

&lt;p&gt;注意需要携带https，否则该Notion Host无法正常使用，Vercel无法识别是否为https链接。添加上述环境变量完成后，需要在Vercel中对NotionNext进行重新部署（Redeploy）即可生效。&lt;/p&gt;

&lt;p&gt;这时候打开博客的图片，查看图片地址，应该类似于&lt;code&gt;&lt;a href="https://notion.dolingou.pro/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F6d3fda40-6b03-4bf3-842b-4c9bb68a90f1%2F5a7f71fc-218f-4ac0-b76f-e471232cd7647%2Fandroid-chrome-512x512-min.webp?table=collection&amp;amp;id=f87dcb58-ba2a-40bb-a156-53d7877975e9&amp;amp;t=f87dcb58-ba2a-40bb-a156-53d7877975e9&amp;amp;width=800&amp;amp;cache=v2" rel="noopener noreferrer"&gt;https://notion.dolingou.pro/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F6d3fda40-6b03-4bf3-842b-4c9bb68a90f1%2F5a7f71fc-218f-4ac0-b76f-e471232cd7647%2Fandroid-chrome-512x512-min.webp?table=collection&amp;amp;amp;id=f87dcb58-ba2a-40bb-a156-53d7877975e9&amp;amp;amp;t=f87dcb58-ba2a-40bb-a156-53d7877975e9&amp;amp;amp;width=800&amp;amp;amp;cache=v2&lt;/a&gt;"&lt;/code&gt; 这种。如果直接访问这个地址，会通过&lt;code&gt;302&lt;/code&gt;重定向的方式，经由&lt;code&gt;s3.us-west-2.amazonaws.com&lt;/code&gt; ，最终到&lt;code&gt;&lt;a href="https://img.notionusercontent.com/s3/prod-files-secure%2F6d3fda40-6b03-4bf3-842b-4c9bb68a90f1%2F5a7f71fc-218f-4ac0-b76f-e47602cd7647%2Fandroid-chrome-512x512-min.webp/size/w=800?exp=1741086188&amp;amp;sig=klZmCOx0XSjO_rQwnGGeMEyR_Kuz1dct7Y5cyf3Fdv4" rel="noopener noreferrer"&gt;https://img.notionusercontent.com/s3/prod-files-secure%2F6d3fda40-6b03-4bf3-842b-4c9bb68a90f1%2F5a7f71fc-218f-4ac0-b76f-e47602cd7647%2Fandroid-chrome-512x512-min.webp/size/w=800?exp=1741086188&amp;amp;amp;sig=klZmCOx0XSjO_rQwnGGeMEyR_Kuz1dct7Y5cyf3Fdv4&lt;/a&gt;&lt;/code&gt; 。&lt;/p&gt;

&lt;h2&gt;&lt;span&gt;
&lt;span&gt;🤗 Caddy反向代理配置总结归纳&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;p&gt;因为我最终还是将反向代理域名使用Cloudflare CDN服务，也就是开启小黄云，所以为反向代理域名配置了SaaS回源使用Cloudflare域名优选（没错，CNAME到了&lt;a rel="noopener noreferrer" href="https://linux.do/u/yawatasensei/summary"&gt;Linux.do&lt;/a&gt;），优化国内的访问速度。同时由Cloudflare提供缓存，故未在反向代理服务器的Caddy配置中添加缓存配置。目前的国内访问情况如下，相比使用默认的&lt;code&gt;Notion.so&lt;/code&gt; ，在全国范围内速度提升了不少，响应延迟基本都控制在1.5s ~ 2s左右，同时在访问可达性上来说，全国范围应该都可以正常访问。&lt;/p&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fprod-files-secure.s3.us-west-2.amazonaws.com%252F6d3fda40-6b03-4bf3-842b-4c9bb68a90f1%252Faae16503-1a09-433b-9821-a40a81e2ef66%252Fimage.png%3Ftable%3Dblock%26id%3D16f97571-0fee-80ac-8f68-f7cf40af997c%26t%3D16f97571-0fee-80ac-8f68-f7cf40af997c%26width%3D816%26cache%3Dv2" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fprod-files-secure.s3.us-west-2.amazonaws.com%252F6d3fda40-6b03-4bf3-842b-4c9bb68a90f1%252Faae16503-1a09-433b-9821-a40a81e2ef66%252Fimage.png%3Ftable%3Dblock%26id%3D16f97571-0fee-80ac-8f68-f7cf40af997c%26t%3D16f97571-0fee-80ac-8f68-f7cf40af997c%26width%3D816%26cache%3Dv2" alt="notion.so via proxy" width="1024" height="462"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;由于最近更换了博客域名，所以图床的反向代理链接也进行了更新，现在是notion.deeprouter.org，在上面教程中的域名，也都已经替换为这个新的域名。&lt;/p&gt;

&lt;h2&gt;&lt;span&gt;
&lt;span&gt;📎 参考文章&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;ul&gt;&lt;li&gt;《&lt;a rel="noopener noreferrer" href="https://astralor.com/article/nginx-setup-reverse-proxy-to-accelerate-notionnext-image-access"&gt;Nginx设置Notion反代加速NotionNext图片资源访问&lt;/a&gt;》&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;&lt;a rel="noopener noreferrer" href="https://github.com/tangly1024/NotionNext"&gt;https://github.com/tangly1024/NotionNext&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;&lt;a rel="noopener noreferrer" href="https://caddyserver.com/docs/quick-starts/reverse-proxy#reverse-proxy-quick-start"&gt;Reverse proxy quick-start — Caddy Documentation&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;&lt;span&gt;💡&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;有关Caddy安装或者使用上的问题，欢迎您在底部评论区留言，一起交流~&lt;/p&gt;



</description>
      <category>devops</category>
      <category>networking</category>
      <category>performance</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Dae安装及配置指南</title>
      <dc:creator>Yawata Yahaha</dc:creator>
      <pubDate>Sun, 01 Dec 2024 00:00:00 +0000</pubDate>
      <link>https://dev.to/yawatasensei/daean-zhuang-ji-pei-zhi-zhi-nan-2l1l</link>
      <guid>https://dev.to/yawatasensei/daean-zhuang-ji-pei-zhi-zhi-nan-2l1l</guid>
      <description>&lt;p&gt;&lt;span&gt;😀&lt;/span&gt;&lt;br&gt;
我使用Dae替代OpenClash进行科学上网已经有一段时间，目前整体系统的运行情况也已经稳定，该踩的坑也都已经踩过。之前也零零散散写过几篇关于Dae的文章，主要是一些进阶的用法，例如搭配AdGuard Home和MosDNS等其他DNS解析程序，进行广告过滤、国内与国外域名分流等等使用方法，但这些文章没有更多的涉及到Dae本身的安装以及配置和使用指南，所以这篇文章就来填这个坑。&lt;/p&gt;

&lt;h2&gt;&lt;span&gt;
&lt;span&gt;📝 什么是Dae&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/daeuniverse/dae"&gt;Dae&lt;/a&gt;（大鹅）是一个高性能的透明代理解决方案（科学上网解决方案），在作用上与&lt;a rel="noopener noreferrer" href="https://github.com/MetaCubeX/mihomo"&gt;Mihomo&lt;/a&gt;、&lt;a rel="noopener noreferrer" href="https://sing-box.sagernet.org/"&gt;Singbox&lt;/a&gt;等基本相同，均是通过域名、IP、端口、来源地址、目标地址以及规则集等等不同方式，对流量进行分流以及使用代理，从而达到科学上网的目的。但在核心原理上，Dae通过在Linux内核中使用&lt;a rel="noopener noreferrer" href="https://cloudnative.to/blog/bpf-intro/"&gt;eBPF&lt;/a&gt;实现流量分流拆分与透明代理，允许在网络驱动程序的最早阶段处理数据包。这样可以在将数据包传递给内核协议栈之前进行快速处理，比如丢弃、转发或修改数据包，所以相比其他软件，Dae的直连性能更好，同时也更方便实现国内外流量分流，在效率上更优。&lt;/p&gt;

&lt;h3&gt;&lt;span&gt;
&lt;span&gt;Dae支持功能&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;ul&gt;&lt;li&gt;支持通过本地主机的进程名称进行流量分流。&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;支持通过局域网中的MAC地址进行流量分流。&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;支持使用反向匹配规则进行流量分流。&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;支持根据策略自动切换节点。&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;支持 Shadowsocks、Trojan(-go) 和Socks5的全锥NAT（Full Cone）&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;支持高级DNS解析策略及域名分流&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;天然支持IPv6，无需额外设置&lt;/li&gt;&lt;/ul&gt;

&lt;h3&gt;&lt;span&gt;
&lt;span&gt;Dae支持协议&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;ul&gt;&lt;li&gt;HTTP(S), naiveproxy&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;Socks&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;
&lt;a rel="noopener noreferrer" href="https://www.v2ray.com/"&gt;VMess&lt;/a&gt;(AEAD, alterID=0) / VLESS&lt;/li&gt;&lt;/ul&gt;
&lt;ul&gt;&lt;li&gt;&lt;a rel="noopener noreferrer" href="https://shadowsocks.org/"&gt;Shadowsocks&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;ul&gt;&lt;li&gt;ShadowsocksR&lt;/li&gt;&lt;/ul&gt;
&lt;ul&gt;&lt;li&gt;&lt;a rel="noopener noreferrer" href="https://trojan-gfw.github.io/trojan/protocol"&gt;Trojan&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;ul&gt;&lt;li&gt;
&lt;a rel="noopener noreferrer" href="https://github.com/tuic-protocol/tuic"&gt;Tuic &lt;/a&gt;(v5)&lt;/li&gt;&lt;/ul&gt;
&lt;ul&gt;&lt;li&gt;&lt;a rel="noopener noreferrer" href="https://github.com/juicity/juicity"&gt;Juicity&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;ul&gt;&lt;li&gt;&lt;a rel="noopener noreferrer" href="https://v2.hysteria.network/"&gt;Hysteria2&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;ul&gt;&lt;li&gt;Proxy chain (flexible protocol)链式代理&lt;/li&gt;&lt;/ul&gt;
&lt;h3&gt;&lt;span&gt;
&lt;span&gt;Dae支持系统&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
由于Dae软件自身特性（使用eBPF），只支持Linux核心的操作系统（Only Support By Linux Kernel），并且内核版本不低于&lt;code&gt;5.17&lt;/code&gt; ，如果使用&lt;code&gt;0.9.0-rc&lt;/code&gt;以上，内核版本不低于&lt;code&gt;6.1.0&lt;/code&gt;。Dae需要Linux Kernel内核开启如下选项，一般来说，完整的Linux系统都是已经处于开启状态：
可以通过如下命令查看Linux内核是否开启了这些选项：
所以Dae这个软件更适合部署于X86架构的路由器或者旁路由（旁路网关）上作为代理网关进行科学上网来使用，嵌入式设备或者硬路由由于Linux核心版本问题，大部分无法正常使用。常规的Linux发行版均可满足Dae的要求，例如Debian（我目前在使用的）、 Ubuntu、 Arch Linux、Fedora等等。Dae也支持在OpenWRT上进行使用，但需要自行进行固件编译，使用较新的Linux Kernel版本，并开启对应内核选项，默认版本大部分内核暂时不满足Dae的需求。
我个人建议作为科学上网的旁路网关（或者说是旁路由，但是其实并没有使用到路由的功能），还是尽量使用完整版的Linux发行版，现在Youtube上不少UP主也开始推荐主路由器 + Linux发行版作为旁路网关的家庭网络科学上网方案，一方面因为在旁路网关中，OpenWRT提供的很多功能用不到，另外一方面，在Linux Kernel的更新以及完整性上，OpenWRT也阉割了很多，Kernel特性支持较为落后，目前OpenWRT的主力版本还在使用5.15的Kernel，这也是为了兼容各种嵌入式设备与多平台架构的结果。
&lt;h2&gt;&lt;span&gt;
&lt;span&gt;📝 Dae安装&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
本篇内容是以我个人网络环境和拓扑为操作前提进行编写，所以在特殊场景下，可能并不适用于你的网络环境。我所使用的整体系统环境如下：
&lt;ul&gt;&lt;li&gt;Proxmox VE（&lt;a rel="noopener noreferrer" href="https://deeprouter.org/tag/PVE"&gt;PVE&lt;/a&gt;）环境，未进行网卡直通&lt;/li&gt;&lt;/ul&gt;
&lt;ul&gt;&lt;li&gt;Debian 12 （核心版本：6.1.0-26-amd64）&lt;/li&gt;&lt;/ul&gt;
&lt;ul&gt;&lt;li&gt;作为旁路由（旁路网关）使用，只有一个网口ens18&lt;/li&gt;&lt;/ul&gt;
&lt;h3&gt;&lt;span&gt;
&lt;span&gt;Dae安装脚本&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;h4&gt;&lt;span&gt;
&lt;span&gt;Linux衍生版本安装Dae&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
衍生版本包括Debian、Ubuntu、Kali、Fedora、Arch等等。
Dae提供了脚本直接进行安装，可通过如下命令进行：
当前Release版本为0.8&lt;span&gt;&lt;b&gt;0.9&lt;/b&gt;&lt;/span&gt;，最新RC版本为0.9.0 1.0rc2，如果希望使用rc版本，可使用如下命令：
如果需要卸载Dae，可使用如下命令：
安装完成后，二进制执行文件位于&lt;code&gt;/usr/local/bin/dae&lt;/code&gt; ，同时会自动添加systemctl执行脚本；
配置文件位于&lt;code&gt;/usr/local/etc/dae/config.dae&lt;/code&gt;


这个方法不适用与OpenWRT用户。如果你是OpenWRT用户，请参考下面部分。

&lt;h4&gt;&lt;span&gt;
&lt;span&gt;OpenWRT通过OPKG安装Dae&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;

如果你是ImmortalWRT &lt;code&gt;24.10&lt;/code&gt;版本用户（Linux内核版本&lt;code&gt;6.6.73&lt;/code&gt;），通过ImmortalWRT的官方软件源通过opkg即可安装，同时需要安装的kmod依赖也在下面的命令里面。目前提供的版本为&lt;code&gt;0.9.0-r2&lt;/code&gt;：

以上方法也同样适用于Daed。

&lt;h4&gt;&lt;span&gt;
&lt;span&gt;OpenWRT编译安装Dae&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;

如果使用的是官方版本的OpenWRT（官方版本可能无法直接安装kmod的ipk文件），在编译时没有选择所需的kmod依赖，而是使用的默认packages，那么可能需要重新编译安装，推荐直接使用ImmortalWRT，具体流程如下：

&lt;ol start="1"&gt;&lt;li&gt;打开&lt;a rel="noopener noreferrer" href="https://firmware-selector.immortalwrt.org/"&gt;ImmortalWrt Firmware Selector&lt;/a&gt;并选择你的机器架构，软路由一般为&lt;code&gt;Generic x86/64&lt;/code&gt;
&lt;/li&gt;&lt;/ol&gt;



&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.notion.so%2Fimage%2Fattachment%253A37e3adf7-0879-4176-90ba-20bc5eda2b9d%253Aimage.png%3Ftable%3Dblock%26id%3D1ac97571-0fee-80c1-b0e5-c551e69f31b5%26t%3D1ac97571-0fee-80c1-b0e5-c551e69f31b5" alt="notion image" width="1158" height="784"&gt;

 

&lt;ol start="2"&gt;&lt;li&gt;点击&lt;code&gt;Customize installed packages and/or first boot script&lt;/code&gt;进行定制ImmortalWRT，并在&lt;code&gt;Installed Packages&lt;/code&gt;中复制粘贴如下内容：&lt;/li&gt;&lt;/ol&gt;

&lt;ol start="3"&gt;&lt;li&gt;点击&lt;code&gt;Request Build&lt;/code&gt;，进行定制版ImmortalWRT定制版编译请求，然后等待编译完成并生成下载链接,这个过程大概5-10分钟。&lt;/li&gt;&lt;/ol&gt;

&lt;ol start="2"&gt;&lt;li&gt;编译完成后&lt;code&gt;Custom Download&lt;/code&gt;里会显示不同版本的下载按钮，一般选择&lt;code&gt;COMBINED-EFI (EXT4)&lt;/code&gt; ，下载后的镜像为&lt;code&gt;*.img&lt;/code&gt; 格式，根据自己的虚拟化系统不同，进行格式转换。之后的流程与其他在软路由上安装OpenWRT的流程相同。&lt;/li&gt;&lt;/ol&gt;

&lt;ol start="3"&gt;&lt;li&gt;单独的Dae安装文件（&lt;code&gt;dae_0.9.0-r2_x86_64.ipk&lt;/code&gt;）下载地址为：&lt;a rel="noopener noreferrer" href="https://downloads.immortalwrt.org/releases/24.10.0/packages/x86_64/packages/dae_1.0.0-r1_x86_64.ipk"&gt;dae_1.0.0-r1_x86_64.ipk&lt;/a&gt;
&lt;/li&gt;&lt;/ol&gt;

以上方法也同样适用于Daed。

&lt;h3&gt;&lt;span&gt;
&lt;span&gt;更新GeoIP与GeoSite数据库&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;

如果需要更新&lt;a rel="noopener noreferrer" href="https://github.com/Loyalsoldier/geoip"&gt;GeoIP&lt;/a&gt;与&lt;a rel="noopener noreferrer" href="https://github.com/Loyalsoldier/v2ray-rules-dat"&gt;Geosite&lt;/a&gt;数据库，那么可以使用如下命令：

&lt;b&gt;更新GEOIP&lt;/b&gt;

&lt;b&gt;更新GEOSITE&lt;/b&gt;

更新后的GeoIP与GeoSite文件位于&lt;code&gt;/usr/local/share/dae&lt;/code&gt; 文件夹内，Dae会自动使用该位置的GeoIP与GeoSite数据库文件，无需进行移动或复制至新的位置。

&lt;h2&gt;&lt;span&gt;
&lt;span&gt;📝 Dae配置文件&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;

Dae的配置文件很简单，而且可读性也很高，不必考虑乱七八糟的防火墙劫持与DNS劫持，在我的网络环境下，对付ISP的劫持反诈的劫持也有很好的效果。

以我个人网络环境为例，提供Dae配置文件如下，需要修改的部分为&lt;code&gt;global&lt;/code&gt;部分&lt;code&gt;lan_interface&lt;/code&gt;的网卡名称、&lt;code&gt;subscription&lt;/code&gt; 内的订阅地址，&lt;code&gt;group&lt;/code&gt;部分的节点过滤规则。这套配置目前使用于旁路网关上，支持IPv6，同时&lt;a rel="noopener noreferrer" href="https://ipleak.net/"&gt;ipleak&lt;/a&gt;超过300次检测未发现DNS泄露情况。

&lt;b&gt;12月27日更新：&lt;/b&gt;

&lt;ul&gt;&lt;li&gt;增加了小米部分设备域名。部分反应&lt;code&gt;miwifi.com&lt;/code&gt; 域名请求次数太多可能是导致内存泄露的原因。&lt;/li&gt;&lt;/ul&gt;

&lt;b&gt;需要注意部分：&lt;/b&gt;

&lt;ul&gt;&lt;li&gt;
&lt;code&gt;Group&lt;/code&gt; 内节点组名称需要与 &lt;code&gt;Routing&lt;/code&gt; 中规则名称对应，例如修改了节点组 &lt;code&gt;Proxy&lt;/code&gt; 的名称，那么在 &lt;code&gt;Routing&lt;/code&gt; 中也需要修改 &lt;code&gt;proxy&lt;/code&gt; 为新的名称&lt;/li&gt;&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;如果使用RC版本，DNS可以使用DOH或DOT，支持H3协议的DOH，以阿里巴巴的阿里云DNS举例：&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;DOH：&lt;code&gt;h3://dns.alidns.com:443&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;DOT：&lt;code&gt;tls://dns.alidns.com:853&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;DOQ：&lt;code&gt;quic://dns.alidns.com:853&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;节点过滤规则：如果使用固定节点，&lt;code&gt;policy: fixed(0)&lt;/code&gt; 并且&lt;code&gt;filter: name(节点名称)&lt;/code&gt; ，如果节点名称中包括emoji符号，可能无法正常选择提示报错，此时建议使用&lt;code&gt;filter: name(keyword: ‘节点关键字’)&lt;/code&gt; 方式进行过滤选择。&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;
&lt;code&gt;Routing&lt;/code&gt; 中的规则为顺序匹配，从上至下，所以建议将特定规则放在最上方，将例如&lt;code&gt;Geosite:CN&lt;/code&gt; 等较大的规则集放在下方，避免规则冲突无法正常匹配。例如，你可以将自定义规则放置于最上方。&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;在DNS服务商的选择上，可以参考&lt;a rel="noopener noreferrer" href="https://deeprouter.org/article/dns-servers-guide"&gt;《🗒️国内外DNS推荐列表》&lt;/a&gt;
&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;如果你的机场对节点入口域名使用了国内和国外不同的结果（例如目前的TagSS，为了避免来自国外流量的DDoS），或者无法获取到节点正确的IP地址，那么建议修改&lt;code&gt;udp_check_dns&lt;/code&gt; 为国内的DNS，例如阿里云的&lt;code&gt;223.5.5.5&lt;/code&gt; 可能会解决这个问题。&lt;/li&gt;&lt;/ul&gt;

&lt;h3&gt;&lt;span&gt;
&lt;span&gt;启动Dae&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;p&gt;使用如下命令可以启动Dae。&lt;/p&gt;

&lt;p&gt;在OpenWRT软路由中，启动命令为：&lt;/p&gt;

&lt;p&gt;如果需要在前台使用Dae，便于查看Dae运行情况，可以使用：&lt;/p&gt;

&lt;p&gt;在OpenWRT系统中则为如下命令：&lt;/p&gt;

&lt;p&gt;当修改配置文件后，需要重载Dae配置文件时，可以使用：&lt;/p&gt;

&lt;p&gt;在OpenWRT中则为如下命令&lt;/p&gt;

&lt;h3&gt;&lt;span&gt;
&lt;span&gt;Dae自动更新并存储订阅&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;p&gt;由于Dae每次启动时均需要重新读取订阅信息，本身并不存取订阅信息，当订阅链接被墙或者无法访问时，就无法正常获取到订阅信息及分组信息，造成访问异常。以下方法可以实现订阅信息存储和自动订阅更新。&lt;/p&gt;

&lt;h4&gt;&lt;span&gt;
&lt;span&gt;&lt;a rel="noopener noreferrer" href="https://www.freedesktop.org/software/systemd/man/latest/systemd.timer.html"&gt;systemd.timer&lt;/a&gt;方法&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;

&lt;p&gt;假设你的dae配置文件存储于&lt;code&gt;/usr/local/etc/dae/&lt;/code&gt; ，这也是通过自动安装脚本默认的存储位置。那么新建一个&lt;code&gt;/usr/local/bin/update-dae-subs.sh&lt;/code&gt;文件:&lt;/p&gt;

&lt;p&gt;赋予这个文件可执行权限：&lt;/p&gt;

&lt;p&gt;配置&lt;code&gt;&lt;b&gt;systemd.timer&lt;/b&gt;&lt;/code&gt;和&lt;code&gt;&lt;b&gt;systemd.service&lt;/b&gt;&lt;/code&gt;进行自动更新&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;

&lt;code&gt;/etc/systemd/system/update-subs.timer&lt;/code&gt;: 以下代码是每12小时，或者每次系统启动后15分钟更新&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;
&lt;code&gt;/etc/systemd/system/update-subs.service&lt;/code&gt;:&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;新建订阅链接文件：&lt;code&gt;/usr/local/etc/dae/sublist&lt;/code&gt; ，并安装以下模板填写订阅链接，如果只有一个订阅，则保留并填写一个即可。当通过&lt;code&gt;update-subs.timer&lt;/code&gt; 拉取订阅信息时，会自动建立&lt;code&gt;sub1&lt;/code&gt;、&lt;code&gt;sub2&lt;/code&gt;、&lt;code&gt;sub3&lt;/code&gt; 的订阅文件。&lt;/p&gt;

&lt;p&gt;赋予订阅链接文件&lt;code&gt;600&lt;/code&gt;权限&lt;/p&gt;

&lt;p&gt;修改&lt;code&gt;config.dae&lt;/code&gt; 中&lt;code&gt;subscription&lt;/code&gt; 部分内容为订阅文件&lt;/p&gt;

&lt;p&gt;启动Timer&lt;/p&gt;

&lt;h4&gt;&lt;span&gt;
&lt;span&gt;Crontab方法&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;

&lt;p&gt;如果你的系统没有&lt;code&gt;system.timer&lt;/code&gt; ，也可以使用crontab进行替代。区别在于无法实现系统启动后自定义时间进行更新，只能定时更新。&lt;/p&gt;

&lt;p&gt;编写&lt;code&gt;/usr/local/bin/update-dae-subs.sh&lt;/code&gt; 文件&lt;/p&gt;

&lt;p&gt;通过crontab实现定时更新，以下例子为12小时执行一次。你可以使用&lt;a rel="noopener noreferrer" href="https://crontab.online/zh/"&gt;crontab计算器&lt;/a&gt;查询定时规则。&lt;/p&gt;

&lt;p&gt;剩余步骤与上面&lt;code&gt;system.timer&lt;/code&gt;部分相同。&lt;/p&gt;

&lt;h2&gt;&lt;span&gt;
&lt;span&gt;🤗 Dae的其他用法&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;p&gt;如果需要图形界面进行配置，可以选择&lt;a rel="noopener noreferrer" href="https://github.com/daeuniverse/daed"&gt;Daed&lt;/a&gt;，配置文件内容大同小异，主要就是DNS和Routing部分，对应截取之后粘贴到控制台里面就好。 &lt;/p&gt;

&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://deeprouter.org/article/dae-adguard-home-guide"&gt;🦢Dae搭配AdGuard Home使用指南&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://deeprouter.org/article/daed-with-mosdns"&gt;🦢DAE搭配MosDNS使用配置&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;&lt;span&gt;
&lt;span&gt;OpenAI相关规则&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;geosite:openai&lt;/code&gt; 规则并不全面，如果遇到无法使用的情况或者降智情况，可以添加以下部分规则，替换&lt;code&gt;ai&lt;/code&gt; 代理组为你的代理组名称：&lt;/p&gt;

&lt;p&gt;以上规则包括&lt;b&gt;Gemini，Openai，Copilot，Apple Intelligence, Claude&lt;/b&gt;这些AI服务提供商。&lt;/p&gt;

&lt;h3&gt;&lt;span&gt;
&lt;span&gt;更新一版Daed Routing规则&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;p&gt;这版规则合并了大多数的重复项，避免规则过于混乱。同时针对使用海外手机号的Wechat进行优化，减少图片和视频因CDN错配导致的加载时间过长。&lt;/p&gt;

&lt;h3&gt;&lt;span&gt;
&lt;span&gt;关于Dae的CPU占用率高及内存泄露&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;p&gt;建议添加如下规则禁止Quic。Daed也建议添加该规则。Quic实测并不会导致内存泄漏或者高内存占用，主要是CPU使用会稍高。&lt;/p&gt;

&lt;h3&gt;&lt;span&gt;
&lt;span&gt;关于Dae及Daed内存泄露&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;p&gt;一方面，建议添加机场节点域名至Direct规则内，避免回环产生的内存泄露。另外一方面，个人实测内存泄漏的一个场景是：Dae所在局域网内，存在移动设备开启使用同样节点的代理，造成类似回环的情况。在移动端设备开启根据SSID使用DIRECT（直连）规则后，没有再产生Dae内存泄漏的情况。&lt;/p&gt;

&lt;h2&gt;&lt;span&gt;
&lt;span&gt;📎 参考文章&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;ul&gt;&lt;li&gt;&lt;a rel="noopener noreferrer" href="https://github.com/daeuniverse/dae"&gt;https://github.com/daeuniverse/dae&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;&lt;span&gt;💡&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;有关Dae安装或者使用上的问题，欢迎您在底部评论区留言，一起交流~&lt;/p&gt;



</description>
      <category>beginners</category>
      <category>networking</category>
      <category>tooling</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>DAE搭配MosDNS使用配置</title>
      <dc:creator>Yawata Yahaha</dc:creator>
      <pubDate>Sat, 12 Oct 2024 00:00:00 +0000</pubDate>
      <link>https://dev.to/yawatasensei/daeda-pei-mosdnsshi-yong-pei-zhi-1hp3</link>
      <guid>https://dev.to/yawatasensei/daeda-pei-mosdnsshi-yong-pei-zhi-1hp3</guid>
      <description>&lt;p&gt;本篇文章并非DAE及DAED的安装配置入门文章。关于DAE与DAED的安装方法之后会单独编写。本篇文章主要内容为在使用DAE或DAED的情况下，如何搭配MosDNS使用，提供一个高兼容性、高可用性的配置方案。以下内容基于Debian 12系统。&lt;/p&gt;

&lt;h2&gt;&lt;span&gt;
&lt;span&gt;📝 DAE（大鹅）的DNS原理&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;h3&gt;&lt;span&gt;
&lt;span&gt;DAE的分流原理&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;blockquote&gt;

&lt;b&gt;域名&lt;/b&gt;通过劫持 DNS 请求，将 DNS 请求的域名与所查 IP 进行关联来得到。尽管这种方式有一些问题：
&lt;ol start="1"&gt;&lt;li&gt;可能会出现误判。例如需要分流到国内和国外的两个网站拥有同一个 IP，且在短时间内同时被访问，或浏览器有 DNS 缓存。&lt;/li&gt;&lt;/ol&gt;
&lt;ol start="2"&gt;&lt;li&gt;用户的 DNS 请求必须通过 dae。例如将 dae 设为 DNS，或在 dae 作为网关的情况下使用公共 DNS。&lt;/li&gt;&lt;/ol&gt;
———
&lt;/blockquote&gt;

&lt;p&gt;DAE对程序所在网关进行全部流量的处理，且与其他代理程序不同，并不提供DNS的转发端口，而是采用对只有经过该网关的全部DNS请求才会分流，所以无法直接使用原有代理程序那些套娃的DNS行为。&lt;/p&gt;

&lt;p&gt;&lt;b&gt;更新：&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;需要注意的是，如果上游MosDNS采用并发策略，一段时间后，可能会存在造成Dae内存泄露的情况，内存占用由原来的500M左右，增加至1G左右。目前原因还在排查。&lt;/p&gt;

&lt;p&gt;和&lt;a rel="noopener noreferrer" href="https://github.com/IrineSistiana/mosdns"&gt;MosDNS&lt;/a&gt;关系不大，如果手机使用相同订阅代理并连接同网WIFI，在内网会产生环回请求造成内存泄露。&lt;/p&gt;

&lt;h3&gt;&lt;span&gt;
&lt;span&gt;常规代理程序DNS请求及解析&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fprod-files-secure.s3.us-west-2.amazonaws.com%252F6d3fda40-6b03-4bf3-842b-4c9bb68a90f1%252F8b02a04a-4bd9-4357-9ba8-a74c57766d40%252FUntitled_diagram-2024-10-12-044451.png%3Ftable%3Dblock%26id%3D11d97571-0fee-809b-817b-e29881554105%26t%3D11d97571-0fee-809b-817b-e29881554105%26width%3D3840%26cache%3Dv2" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fprod-files-secure.s3.us-west-2.amazonaws.com%252F6d3fda40-6b03-4bf3-842b-4c9bb68a90f1%252F8b02a04a-4bd9-4357-9ba8-a74c57766d40%252FUntitled_diagram-2024-10-12-044451.png%3Ftable%3Dblock%26id%3D11d97571-0fee-809b-817b-e29881554105%26t%3D11d97571-0fee-809b-817b-e29881554105%26width%3D3840%26cache%3Dv2" alt="clash dns " width="2048" height="572"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;在未通过公共DNS或者代理远端DNS请求解析的情况下，常规代理软件是可以进行DNS的无限套娃的，并不会返回给客户端解析的结果。在套娃的过程中可以不断针对不同的DNS请求进行过滤和分流，在日常使用中能够极大的提供便利，例如AdGuard Home的广告过滤与可视化控制面板、MosDNS的并发DNS请求、ECS请求等等。&lt;/p&gt;

&lt;h3&gt;&lt;span&gt;
&lt;span&gt;DAE的DNS请求与解析&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fprod-files-secure.s3.us-west-2.amazonaws.com%252F6d3fda40-6b03-4bf3-842b-4c9bb68a90f1%252F328d3fc1-c193-4349-a86b-e899155403bf%252FUntitled_diagram_-_Copy-2024-10-12-050340.png%3Ftable%3Dblock%26id%3D11d97571-0fee-80a5-9a2b-e7b5b5b66f26%26t%3D11d97571-0fee-80a5-9a2b-e7b5b5b66f26%26width%3D3840%26cache%3Dv2" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fprod-files-secure.s3.us-west-2.amazonaws.com%252F6d3fda40-6b03-4bf3-842b-4c9bb68a90f1%252F328d3fc1-c193-4349-a86b-e899155403bf%252FUntitled_diagram_-_Copy-2024-10-12-050340.png%3Ftable%3Dblock%26id%3D11d97571-0fee-80a5-9a2b-e7b5b5b66f26%26t%3D11d97571-0fee-80a5-9a2b-e7b5b5b66f26%26width%3D3840%26cache%3Dv2" alt="dae dns" width="2048" height="431"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;DAE的不同点在于，在流量进入网关开始即进行分流，且基于Domain的分流模式必须将DAE作为唯一的DNS入口，在顺序上相当于将将代理程序前置作为入口，且由于DAE并不提供DNS转发的监听端口，所以无法后置于其他DNS程序。&lt;/p&gt;

&lt;h2&gt;&lt;span&gt;
&lt;span&gt;📝 DAE与MosDNS的配合&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;p&gt;DAE提供了一份使用外置DNS程序的指南：&lt;/p&gt;

&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/daeuniverse/dae/blob/main/docs/en/configuration/external-dns.md"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;external-dns.md&lt;br&gt;
daeuniverse&lt;br&gt;
根据这份指南我们可以对整体家庭局域网内的DNS请求链路进行梳理如下：&lt;/p&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fprod-files-secure.s3.us-west-2.amazonaws.com%252F6d3fda40-6b03-4bf3-842b-4c9bb68a90f1%252F8c66b6f9-60e6-4153-b09b-28c627368375%252FUntitled_diagram_-_Copy-2024-10-12-051323.png%3Ftable%3Dblock%26id%3D11d97571-0fee-80db-b13a-deed3fe74d91%26t%3D11d97571-0fee-80db-b13a-deed3fe74d91%26width%3D1000.9375%26cache%3Dv2" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fprod-files-secure.s3.us-west-2.amazonaws.com%252F6d3fda40-6b03-4bf3-842b-4c9bb68a90f1%252F8c66b6f9-60e6-4153-b09b-28c627368375%252FUntitled_diagram_-_Copy-2024-10-12-051323.png%3Ftable%3Dblock%26id%3D11d97571-0fee-80db-b13a-deed3fe74d91%26t%3D11d97571-0fee-80db-b13a-deed3fe74d91%26width%3D1000.9375%26cache%3Dv2" alt="dae dns with mosdns" width="1024" height="214"&gt;&lt;/a&gt;&lt;br&gt;
例如我在使用MosDNS的情况下，将&lt;code&gt;GeoSite:CN&lt;/code&gt;的域名通过MosDNS并发请求阿里的公共DNS服务器，取得结果。同时对&lt;code&gt;GeoSite:GFW&lt;/code&gt;以及&lt;code&gt;Graylist&lt;/code&gt;（自定义灰名单）的域名使用Google的公共DNS进行请求，使其回到DAE的分流规则之内，这样既满足使用MosDNS并发请求加快DNS解析速度、ECS提供就近CDN节点的同时，也不会扰乱DAE基于domain的分流配置。&lt;/p&gt;

&lt;h3&gt;&lt;span&gt;
&lt;span&gt;DAE Dial Mode配置&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;p&gt;建议使用&lt;code&gt;Domain++&lt;/code&gt;，原因在于使用MosDNS情况下，即便Dae监听53端口，但由于&lt;code&gt;direct(must)&lt;/code&gt;规则的存在，对后续DNS不进行监听，会造成部分域名解析结果未经过Dae，所以需要使用&lt;code&gt;Domain++&lt;/code&gt; 来重新进行基于域名的嗅探与分流。&lt;/p&gt;

&lt;h4&gt;&lt;span&gt;
&lt;span&gt;&lt;b&gt;1. Domain 模式&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;

&lt;p&gt;&lt;b&gt;工作原理&lt;/b&gt;：使用嗅探（sniffing）得到的域名发送给代理服务器。&lt;/p&gt;

&lt;p&gt;&lt;b&gt;特点&lt;/b&gt;：&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;会检查嗅探到的域名的&lt;b&gt;真实性&lt;/b&gt;
&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;若 DNS 环境不纯净，可以很大程度上&lt;b&gt;缓解 DNS 污染问题。&lt;/b&gt;适用于 DNS 请求经过Dae，并没有使用外部 DNS 解析程序的情况（例如使用AdGuard Home 或者 MosDNS）。&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;通常会带来&lt;b&gt;更快的代理响应&lt;/b&gt;，因为代理会在远端重新解析域名，获得更优的 IP 连接结果。&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;域名重写在路由的流量分割&lt;b&gt;之后&lt;/b&gt;进行，dae 不会重新路由。&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;&lt;b&gt;适用场景&lt;/b&gt;：&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;DNS 请求经过 dae 处理的标准配置。&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;需要基于域名进行流量分流的用户。&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;希望获得较快代理响应的用户。&lt;/li&gt;&lt;/ul&gt;

&lt;h4&gt;&lt;span&gt;
&lt;span&gt;&lt;b&gt;2. Domain+ 模式&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;

&lt;p&gt;&lt;b&gt;工作原理&lt;/b&gt;：基于 domain 模式，但&lt;b&gt;不会检查嗅探得到域名的真实性&lt;/b&gt;。&lt;/p&gt;

&lt;p&gt;&lt;b&gt;特点&lt;/b&gt;：&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;比 domain 模式更宽松，不验证域名真实性。&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;适合 DNS 请求&lt;b&gt;不经过 dae&lt;/b&gt; 但仍想要更快代理响应的用户。&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;
&lt;b&gt;重要限制&lt;/b&gt;：若 DNS 请求不经过 dae，&lt;b&gt;基于域名的流量分割将失效。&lt;/b&gt;
&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;&lt;b&gt;适用场景&lt;/b&gt;：&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;使用外部 DNS 服务（如 AdGuard Home、MosDNS）处理 DNS 请求。&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;DNS 不经过 dae，但仍希望代理时使用域名而非 IP。&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;不适合需要精确域名分流的场景。&lt;/li&gt;&lt;/ul&gt;

&lt;h4&gt;&lt;span&gt;
&lt;span&gt;&lt;b&gt;3. Domain++ 模式&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;

&lt;p&gt;&lt;b&gt;工作原理&lt;/b&gt;：基于 domain+ 模式，但会&lt;b&gt;根据嗅探到的域名重新进行流量路由&lt;/b&gt;。&lt;/p&gt;

&lt;p&gt;&lt;b&gt;特点&lt;/b&gt;：&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;可以&lt;b&gt;部分恢复基于域名的流量分割能力。&lt;/b&gt;
&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;对&lt;b&gt;直连流量无效。&lt;/b&gt;
&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;会&lt;b&gt;占用更多的 CPU 资源。&lt;/b&gt;
&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;是一种折中方案，在 DNS 不经过 dae 时仍想要域名分流。&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;&lt;b&gt;适用场景&lt;/b&gt;：&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;DNS 请求不经过 dae，但仍需要部分域名分流能力。例如设置了 Dae 的 DNS 上游服务器为 MosDNS 或者其他 DNS 解析服务程序。&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;适用于使用主路由进行了国内外 IP 分流，dae 作为辅助。&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;不适合对 CPU 资源敏感的低性能设备。&lt;/li&gt;&lt;/ul&gt;

&lt;h4&gt;&lt;span&gt;
&lt;span&gt;4. IP模式&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;

&lt;p&gt;仅作IP分流，DNS无需经过Dae，但同时如果存在DNS污染情况，那Dae也无法解决。&lt;/p&gt;

&lt;h3&gt;&lt;span&gt;
&lt;span&gt;DAE DNS规则配置&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;p&gt;主要配置为红色字体部分，DAE的DNS部分仅作为流量的监听，所有DNS的解析均发往MosDNS进行解析，无论是否被污染，由MosDNS中的规则进行DNS分流。&lt;/p&gt;

&lt;h3&gt;&lt;span&gt;
&lt;span&gt;DAE Routing路由规则配置&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;p&gt;主要部分为红色部分，将MosDNS进程放在&lt;code&gt;must_direct&lt;/code&gt;策略内，不将DNS流量重定向到dae并继续匹配，避免产生回环。同时因为可继续匹配，所以MosDNS中使用Google Public DNS规则流量还可以继续进入DAE执行远端请求。&lt;br&gt;
本次更新去掉了&lt;span&gt;&lt;code&gt;&amp;amp;&amp;amp; l4proto(udp) &amp;amp;&amp;amp; dport(Mosdns监听的端口号)&lt;/code&gt;&lt;/span&gt;&lt;span&gt; ，&lt;/span&gt;&lt;span&gt;原因在于仅通过进程已经能够完全匹配，如果加上端口号和UDP协议，反而会造成部分DNS无法正常解析。这也仅是猜测，目前无法进一步验证。 &lt;/span&gt;&lt;/p&gt;

&lt;h3&gt;&lt;span&gt;
&lt;span&gt;MosDNS配置&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;h4&gt;&lt;span&gt;
&lt;span&gt;定义Tag&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;

&lt;h4&gt;&lt;span&gt;
&lt;span&gt;主序列配置&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;

&lt;h4&gt;&lt;span&gt;
&lt;span&gt;query_nocn配置&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;

&lt;p&gt;主DNS服务由Google Public DNS提供，副DNS服务由NextDNS服务提供，在使用Google Public DNS时流量会重新进入DAE，完成解析，获得无污染结果。&lt;/p&gt;

&lt;h2&gt;&lt;span&gt;
&lt;span&gt;🤗 总结归纳&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;p&gt;目前这套方法是我用下来最为舒服的，在解析速度和识别被污染域名方面均可以满足我的需要，同时对劫持到反诈页面也有很好的规避效果，例如Linux.do等网站打开也不会被劫持了。唯一不太方便的地方在于对于污染域名的配置上，在添加DNS的自定义规则时，需要在MosDNS的自定义文件内添加，例如我的是&lt;code&gt;graylist&lt;/code&gt;。&lt;/p&gt;

&lt;p&gt;理论上，在此基础上还可以进行套娃，例如使用AdGuard Home等，但由于DAE作为入口劫持所有的流量，所以AdGuard Home的客户端会仅显示为DAE客户端。所以建议如果使用AdGuard Home，可将AdGuard Home放置于另外的容器或主机上作为DNS入口，同时上游配置DAE所在主机IP。&lt;/p&gt;

&lt;p&gt;如果你的机场对节点入口域名使用了国内和国外不同的结果（例如目前的TagSS，为了避免来自国外流量的DDoS），或者无法获取到节点正确的IP地址，那么建议修改&lt;code&gt;Config&lt;/code&gt;部分内的&lt;code&gt;udp_check_dns&lt;/code&gt; 为国内的DNS，例如阿里云的&lt;code&gt;223.5.5.5&lt;/code&gt; 可能会解决这个问题。&lt;/p&gt;

&lt;h2&gt;&lt;span&gt;
&lt;span&gt;📎 参考文章&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;ul&gt;&lt;li&gt;&lt;a rel="noopener noreferrer" href="https://github.com/daeuniverse"&gt;daeuniverse (github.com)&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;&lt;a rel="noopener noreferrer" href="https://irine-sistiana.gitbook.io/mosdns-wiki/mosdns-v5"&gt;mosdns v5 | mosdns-wiki-zh&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;&lt;a rel="noopener noreferrer" href="https://dev.to/yawatasensei/daean-zhuang-ji-pei-zhi-zhi-nan-2l1l"&gt;https://deeprouter.org/article/dae-installation-configuration-guide&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;有关Dae以及MosDNS安装或者使用上的问题，欢迎您在底部评论区留言，一起交流~&lt;/p&gt;

 

</description>
      <category>linux</category>
      <category>networking</category>
      <category>opensource</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
