<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
    <channel>
        
            <title>探索</title>
        
        
          <link>https://www.itansuo.info</link>
        
        
         
        
     <generator>Sonic v1.1.7</generator>
        <lastBuildDate>Mon, 11 Aug 2025 07:27:28 GMT</lastBuildDate>
        
            
              <item>
            <title><![CDATA[绕过Cloudflare SSL 边缘证书签发问题]]></title>
               <link>https://www.itansuo.info/archives/rao-guo-cloudflaressl-bian-yuan-zheng-shu-qian-fa-wen-ti</link>
                    <description><![CDATA[<h1 id="%E7%8E%B0%E7%8A%B6" tabindex="-1">现状</h1>
<p>博主前几年合作伙伴方式将域名添加到 Cloudflare ，与将域名NS托管到 Cloudflare 相比，这种方式允许将域名托管到其他 NS 解析，将需要的子域名通过 CNAME 方式使用 Cloudflare 云服务，之前用着好好的，最近1年有3个域名可以添加解析，但无法申请SSL证书，只能使用 SaaS 方式暂时解决，前几天无意中看到一篇博客，自己实践下，可以解决无法申请SSL证书问题。</p>
<h2 id="%E6%8E%A2%E7%B4%A2" tabindex="-1">探索</h2>
<p>用 Dnsflare 管理 DNS 解析，进行SSL证书申请测试，结果如下：</p>
<p><img src="https://cf-image.676232.xyz/sonic/Cloudflare-yuming.png" alt="Cloudflare-yuming" /></p>
<table>
<thead>
<tr>
<th>接入商</th>
<th>是否要将域名托管在 Cloudflare</th>
<th>申请SSL证书是否正常</th>
</tr>
</thead>
<tbody>
<tr>
<td>Cloudflare</td>
<td>是</td>
<td>正常</td>
</tr>
<tr>
<td>your Plesk server</td>
<td>否</td>
<td>正常</td>
</tr>
<tr>
<td>Shanghai CloudRaft Co., Ltd.</td>
<td>否</td>
<td>正常</td>
</tr>
<tr>
<td>Wzfou Co.</td>
<td>否</td>
<td>无法申请证书，DNS解析正常</td>
</tr>
</tbody>
</table>
<p>接入商是<code>Wzfou Co.</code>时可以正常添加DNS解析，查询DNS解析也是正常，但在 Cloudflare 中的<code>SSL/TLS</code>-<code>边缘证书</code>却是空的，无论怎么操作都无法申请SSL证书。以下是博主解决这个问题的步骤：</p>
<h2 id="%E6%96%B9%E6%B3%95" tabindex="-1">方法</h2>
<ol>
<li>创建 Cloudflare Pages，上传一些内容，并确保可以正常访问。</li>
<li>在创建的 Cloudflare Pages 的<code>自定义域</code>中将无法申请SSL证书的域名添加进去，将域名解析到 Cloudflare Pages ，确保可以通过自定义域名访问  Cloudflare Pages 。</li>
<li>此时，通过 Dnsflare 或  Cloudflare 将指向 Cloudflare Pages 的记录修改为自己需要的实际记录，相当绕过了<code>边缘证书</code>里的证书申请。</li>
<li>不要删除 Cloudflare Pages 的<code>自定义域</code>中添加的域名，否则SSL证书会同步删除，SSL证书能否续签待验证。</li>
</ol>
<h1 id="%E5%8F%82%E8%80%83%E9%93%BE%E6%8E%A5%EF%BC%9A" tabindex="-1">参考链接：</h1>
<ol>
<li><a href="https://blog.hank.ltd/weird_problem_cloudflare_ssl_edge_certificate_issuance_problem/" target="_blank">奇怪的问题 | Cloudflare SSL 边缘证书签发问题</a></li>
</ol>
]]></description>
           <pubDate>Mon, 11 Aug 2025 07:27:28 GMT</pubDate>
                </item>
         
              <item>
            <title><![CDATA[使用 GitHub Actions 更新阿里云 ESA 站点证书]]></title>
               <link>https://www.itansuo.info/archives/GitHubActionsESA</link>
                    <description><![CDATA[<h1 id="%E5%89%8D%E8%A8%80" tabindex="-1">前言</h1>
<p>阿里云的 ESA 可以在域名备案的情况下使用国内节点，在这之前我一般是国外使用 Cloudflare ，国内使用 Amazon CloudFront ，尝试使用阿里云 ESA 后，发现需要将域名解析到 ESA 上，博主需要国外节点 Cloudflare ，国内节点 ESA ，这样 ESA 使用 HTTP 申请证书就会遇到问题，阿里云可以手动上传证书，就萌生了制作一个用 GitHub Actions 续签证书并上传到阿里云的想法，博主查找一些资料并在 AI 的帮助下创建一个项目 <a href="https://aaz.ee/p3rf5e" target="_blank">lego-esa-renew</a> 以下是详细说明。</p>
<h1 id="%E8%BF%90%E8%A1%8C" tabindex="-1">运行</h1>
<h2 id="%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AF%B4%E6%98%8E" tabindex="-1">环境变量说明</h2>
<h3 id="lego%E8%BF%90%E8%A1%8C%E6%89%80%E9%9C%80%E8%A6%81%E7%9A%84%E5%8F%98%E9%87%8F" tabindex="-1">Lego运行所需要的变量</h3>
<table>
<thead>
<tr>
<th>变量名称</th>
<th>默认值</th>
<th>是否必须</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>ALICLOUD_ACCESS_KEY</td>
<td></td>
<td>是</td>
<td>阿里云的访问密钥，用于 API 调用，需要阿里云的<code>AliyunDNSFullAccess</code>权限</td>
</tr>
<tr>
<td>ALICLOUD_SECRET_KEY</td>
<td></td>
<td>是</td>
<td>阿里云的安全密钥，与访问密钥配对使用，需要阿里云的<code>AliyunDNSFullAccess</code>权限</td>
</tr>
<tr>
<td>EMAIL</td>
<td></td>
<td>是</td>
<td>用于 Let’s Encrypt 证书续签的电子邮件地址</td>
</tr>
<tr>
<td>DOMAIN</td>
<td></td>
<td>是</td>
<td>需要续签的 SSL 证书的域名</td>
</tr>
<tr>
<td>CERT_PATH</td>
<td><code>certs</code></td>
<td>否</td>
<td>存储证书的路径，默认值为 <code>certs</code></td>
</tr>
<tr>
<td>RENEW_OPTION</td>
<td><code>renew</code></td>
<td>否</td>
<td>Lego是续签证书或申请证书，值有<code>renew</code>或<code>run</code></td>
</tr>
</tbody>
</table>
<p><em>注意：<code>CERT_PATH</code>是证书保存位置，只能是字符或字符+数字，尽可能不要加<strong>特殊字符</strong>。<code> RENEW_OPTION</code>变量是指明lego运行方式，默认为 <code>renew</code>续签，当为 <code>run</code>时，需要特殊处理，这个会之后说明。</em></p>
<h3 id="%E9%98%BF%E9%87%8C%E4%BA%91cli%E8%BF%90%E8%A1%8C%E6%89%80%E9%9C%80%E5%8F%98%E9%87%8F" tabindex="-1">阿里云CLI运行所需变量</h3>
<table>
<thead>
<tr>
<th>变量名称</th>
<th>默认值</th>
<th>是否必须</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>ALICLOUD_ACCESS_KEY_ID</td>
<td></td>
<td>是</td>
<td>阿里云的访问密钥，用于 API 调用 ，需要阿里云的<code>AliyunYundunCertFullAccess</code> 和<code>AliyunESAFullAccess</code> 权限</td>
</tr>
<tr>
<td>ALICLOUD_ACCESS_KEY_SECRET</td>
<td></td>
<td>是</td>
<td>阿里云的安全密钥，与访问密钥配对使用，需要阿里云的<code>AliyunYundunCertFullAccess</code> 和<code>AliyunESAFullAccess</code> 权限</td>
</tr>
<tr>
<td>ALIYUN_REGION</td>
<td><code>ap-southeast-1</code></td>
<td>否</td>
<td>阿里云证书管理所在区域</td>
</tr>
<tr>
<td>NAME</td>
<td><code>lego-ssl</code></td>
<td>否</td>
<td>上传到阿里云证书管理和ESA绑定证书的名称，实际上是<code>NAME</code>变量 +运行时的日期</td>
</tr>
<tr>
<td>SITE_ID</td>
<td></td>
<td>是</td>
<td>要更新证书的ESA站点，ESA站点绑定的证书必须与域名相匹配。</td>
</tr>
</tbody>
</table>
<h3 id="%E6%B5%81%E7%A8%8B%E5%9B%BE" tabindex="-1">流程图</h3>
<h3 id="%E4%BB%93%E5%BA%93%E6%A0%91%E5%BD%A2%E5%9B%BE" tabindex="-1">仓库树形图</h3>
<pre><code class="language-">lego-esa-renew
├─ site-id   # ESA站点 ID ，解决更改SITE_ID变量时没有原始记录问题
├─ Dockerfile   # 用于制作Docker镜像的 Dockerfile
├─ time   # GitHub Actions 运行时间，用于解决仓库未长时间变动导致GitHub Actions被封禁问题
├─ docker-compose.yml  # 运行Docker镜像
├─ ssl-certid  # 上传到阿里云的证书返回的信息。
├─ domain   # 要用Lego申请证书时用到的域名，这是备份，方便修改
└─ .github
   └─ workflows
      └─ lego-esa-renew.yml  # GitHub Actions 运行文件
</code></pre>
<h2 id="%E6%93%8D%E4%BD%9C%E6%B5%81%E7%A8%8B" tabindex="-1">操作流程</h2>
<ol>
<li>创建<a href="https://github.com/new" target="_blank"><strong>私有仓库</strong></a>，并导入项目 <a href="https://aaz.ee/p3rf5e" target="_blank">lego-esa-renew</a>。</li>
</ol>
<p><img src="https://cf-image.676232.xyz/sonic/1-chuang-jian-si-you-cang-ku.png" alt="1-chuang-jian-si-you-cang-ku" /></p>
<p><img src="https://cf-image.676232.xyz/sonic/2-dao-ru-mu-ban.png" alt="2-dao-ru-mu-ban" /></p>
<p><img src="https://cf-image.676232.xyz/sonic/3-chuang-jian-si-you-cang-ku-wan-cheng.png" alt="3-chuang-jian-si-you-cang-ku-wan-cheng" /></p>
<ol start="2">
<li>再次检测是否是<strong>私有仓库</strong>，进行一些必要的 Github 仓库配置，比如：允许 GitHub Actions 读写Github仓库，配置环境变量等。</li>
</ol>
<p><img src="https://cf-image.676232.xyz/sonic/19-yun-xu-github-xiu-gai-cang-ku.png" alt="19-yun-xu-github-xiu-gai-cang-ku" /></p>
<p><img src="https://cf-image.676232.xyz/sonic/21-wan-zheng-huan-jing-bian-liang.PNG" alt="21-wan-zheng-huan-jing-bian-liang" /></p>
<p>首次运行时必须配置  GitHub Actions 环境变量 <code>RENEW_OPTION</code> 为 <code>run</code>， <code>RENEW_OPTION</code> 为 <code>run</code>时是申请证书。</p>
<p><img src="https://cf-image.676232.xyz/sonic/22-chong-xin-shen-qing-zheng-shu.PNG" alt="22-chong-xin-shen-qing-zheng-shu" /></p>
<p><img src="https://cf-image.676232.xyz/sonic/23-chong-xin-shen-qing-zheng-shu.PNG" alt="23-chong-xin-shen-qing-zheng-shu" /></p>
<p>申请证书后必须删除 <code>RENEW_OPTION</code> 变量，否则 GitHub Actions 每 7 天运行一次，每次都会申请证书，再加上其他服务申请的证书，可能会触发 Let’s Encrypt 滥用。</p>
<p><img src="https://cf-image.676232.xyz/sonic/27-shan-chu-huan-jing-bian-liang.PNG" alt="27-shan-chu-huan-jing-bian-liang" /></p>
<h2 id="%E9%98%BF%E9%87%8C%E4%BA%91%E8%B4%A6%E5%8F%B7-accesskey-%E7%94%B3%E8%AF%B7" tabindex="-1">阿里云账号 AccessKey 申请</h2>
<p>GitHub Actions 环境变量中有两组有关阿里云 AccessKey ，分别是<code>ALICLOUD_ACCESS_KEY</code>、<code>ALICLOUD_SECRET_KEY</code>和<code>ALICLOUD_ACCESS_KEY_ID</code>、<code>ALICLOUD_ACCESS_KEY_SECRET</code>，其中<code>ALICLOUD_ACCESS_KEY</code>、<code>ALICLOUD_SECRET_KEY</code>是 Lego 申请  Let’s Encrypt 证书再 DNS 中添加 TXT 验证所需要的，<code>ALICLOUD_ACCESS_KEY_ID</code>、<code>ALICLOUD_ACCESS_KEY_SECRET</code>是向阿里云上传申请的  Let’s Encrypt 证书，并与ESA站点绑定所需要的，两者可以相同，也可以使用不同的阿里云账户使用不同阿里云 AccessKey，博主就是使用DNS使用一个阿里云，ESA 在另一个阿里云账户，在演示中 DNS 账户和 ESA 账户是同一个账户并且是阿里云国际版。</p>
<ol>
<li>打开<a href="https://ram.console.alibabacloud.com/users" target="_blank">阿里云 RAM 访问控制</a>并创建新用户。</li>
</ol>
<p><img src="https://cf-image.676232.xyz/sonic/4-zhun-bei-chuang-jian-yong-hu.png" alt="4-zhun-bei-chuang-jian-yong-hu" /></p>
<p><img src="https://cf-image.676232.xyz/sonic/5-zhun-bei-chuang-jian-yong-hu-1.png" alt="5-zhun-bei-chuang-jian-yong-hu-1" /></p>
<p><img src="https://cf-image.676232.xyz/sonic/6-chuang-jian-yong-hu-wan-cheng.png" alt="6-chuang-jian-yong-hu-wan-cheng" /></p>
<ol start="2">
<li>为创建的新用户添加权限</li>
</ol>
<p><img src="https://cf-image.676232.xyz/sonic/7-tian-jia-quan-xian.png" alt="7-tian-jia-quan-xian" /></p>
<p><img src="https://cf-image.676232.xyz/sonic/8-quan-xian-tian-jia-wan-cheng.png" alt="8-quan-xian-tian-jia-wan-cheng" /></p>
<p><strong>注意：博主创建的用户权限是<code>PowerUserAccess</code>，权限大，安全要求高的请自行查询搜索权限如何设置。</strong></p>
<ol start="3">
<li>将域名添加到阿里云的<a href="https://dnsnext.console.alibabacloud.com/authoritative" target="_blank">云解析 DNS</a>中，在<a href="https://esa.console.aliyun.com/siteManage/list" target="_blank"> ESA </a>中添加自己的站点。</li>
</ol>
<p><img src="https://cf-image.676232.xyz/sonic/9-tian-jia-yu-ming.png" alt="9-tian-jia-yu-ming" /></p>
<h2 id="%E7%94%B3%E8%AF%B7%E8%AF%81%E4%B9%A6" tabindex="-1">申请证书</h2>
<p>在 Github 仓库确认环境变量 <code>RENEW_OPTION</code> 为 <code>run</code>，编辑<code>time</code>文件，触发 GitHub Actions 运行，首次运行如下：</p>
<p><img src="https://cf-image.676232.xyz/sonic/24-chong-xin-shen-qing-zheng-shu-de-yun-xing-fang-shi.PNG" alt="24-chong-xin-shen-qing-zheng-shu-de-yun-xing-fang-shi" /></p>
<p>续签运行如下：</p>
<p><img src="https://cf-image.676232.xyz/sonic/20-zheng-chang-yun-xing.PNG" alt="20-zheng-chang-yun-xing" /></p>
<p>如果正常，可以到阿里云的<strong>数字证书管理服务</strong>查看上传的证书，在ESA中查看绑定的证书。</p>
<p><img src="https://cf-image.676232.xyz/sonic/18-wang-ye-que-ren-zheng-shu-shang-chuan-cheng-gong.png" alt="18-wang-ye-que-ren-zheng-shu-shang-chuan-cheng-gong" /></p>
<p><img src="https://cf-image.676232.xyz/sonic/26-cha-kan-zheng-shu-bang-ding--1.png" alt="26-cha-kan-zheng-shu-bang-ding--1" /></p>
<h2 id="%E4%BD%BF%E7%94%A8docker%E6%89%8B%E5%8A%A8%E8%BF%90%E8%A1%8C%EF%BC%88-github-actions%E8%BF%90%E8%A1%8C%E5%89%8D%E6%8E%A8%E8%8D%90%EF%BC%89" tabindex="-1">使用Docker手动运行（ GitHub Actions运行前推荐）</h2>
<p>可以先在 Docker 运行，防止出错。</p>
<ol>
<li>克隆私有仓库，将 <a href="https://aaz.ee/p3rf5e" target="_blank">lego-esa-renew</a>导入私有仓库，并通过SSH同步到本地，以<code>aaro-n/ys1</code>私有仓库为例：</li>
</ol>
<pre><code class="language-">www@debian:~$ git clone git@github.com:aaro-n/ys1.git
正克隆到 &#39;ys1&#39;...
remote: Enumerating objects: 16, done.
remote: Counting objects: 100% (16/16), done.
remote: Compressing objects: 100% (6/6), done.
接收对象中: 100% (16/16), 5.93 KiB | 5.93 MiB/s, 完成.
处理 delta 中: 100% (5/5), 完成.
remote: Total 16 (delta 5), reused 16 (delta 5), pack-reused 0 (from 0)
</code></pre>
<ol start="2">
<li>进入 ys1 仓库，并根据自己的需求修改<code>docker-compose.yml</code> 文件</li>
</ol>
<pre><code class="language-">www@debian:~$ cd ys1/
www@debian:~/ys1$ cat docker-compose.yml 
services:
  lego-esa-renew:
    build:
      context: .
    image: lego-esa-renew
    container_name: lego-esa-renew
    environment:
      # 以下是Lego运行所需要的变量，请根据自己的需求进行调整
      # 设置申请的证书存储在 certs 文件夹
      - CERT_PATH=certs
      # 设置 Lego 用阿里云DNS申请通配符证书，具体请参考 Lego文档
      - ALICLOUD_ACCESS_KEY=LTAaxzzc
      - ALICLOUD_SECRET_KEY=asdsdff
      # 用 Lego 申请证书所使用的邮件地址
      - EMAIL=example@example.com
      # 用 Lego 为那些域名申请证书
      - DOMAIN=domain1.com,*.domain1.com,domain2.com,*.domain2.com,domain3.com,*.domain3.com,domain4.com,*.domain4.com,domain5.com,*.domain5.com,domain6.com,*.domain6.com,domain7.com,*.domain7.com,domain8.com,*.domain8.com,domain9.com,*.domain9.com,domain10.com,*.domain10.com,actions.github.domain10.com
      # Lego 运行方式，是申请证书（run）还是续签证书
      # 参数： run 或 renew
      # 首次申请证书使用 run
      - RENEW_OPTION=run
      # 以下变量是上传到阿里云所需要的变量
      # 阿里云上传并更新 ESA 所需要的参数
      - ALICLOUD_ACCESS_KEY_ID=werrt
      - ALICLOUD_ACCESS_KEY_SECRET=ssdsdfffg
      # 阿里云上传证书到哪里，中国大陆（cn-hangzhou）或海外（ap-southeast-1）
      # 参数： cn-hangzhou 或 ap-southeast-1
      # 阿里云国际版ESA账户一般用 ap-southeast-1
      - ALIYUN_REGION=ap-southeast-1
      # 上传到阿里云证书的文件名
      # 实际上传的文件名是文件名+日期
      # 例子：NAME变量为lego-ssl，时间是20250801，则上传到阿里云的证书名为lego-ssl-20250801
      - NAME=lego-ssl
    volumes:
      # /home/www/certs 的certs文件夹名要根据 CERT_PATH 变量来
      # ./CERT_PATH:/home/www/CERT_PATH
      - ./certs:/home/www/certs
 www@debian:~/ys1$ vim docker-compose.yml 
 www@debian:~/ys1$ cat docker-compose.yml 
services:
  lego-esa-renew:
    build:
      context: .
    image: lego-esa-renew
    container_name: lego-esa-renew
    environment:
      # 以下是Lego运行所需要的变量，请根据自己的需求进行调整
      # 设置申请的证书存储在 certs 文件夹
      - CERT_PATH=certs
      # 设置 Lego 用阿里云DNS申请通配符证书，具体请参考 Lego文档
      - ALICLOUD_ACCESS_KEY=LTAI5tFLZzjNdcmgn7wwHqcS
      - ALICLOUD_SECRET_KEY=4vEJIzyqgtPc6Z4YHAHrTdTM5WYbNW
      # 用 Lego 申请证书所使用的邮件地址
      - EMAIL=admin@itansuo.info
      # 用 Lego 为那些域名申请证书
      - DOMAIN=yanshi.aaz.ee,*.yanshi.aaz.ee,yanshi.8w.ee,*.yanshi.8w.ee,yanshi.ip94.cn,*.yanshi.ip94.cn,yanshi.211987.xyz,*.yanshi.211987.xyz,yanshi.itansuo.info,*.yanshi.itansuo.info,ssl.itansuo.info,*.ssl.itansuo.info
      # Lego 运行方式，是申请证书（run）还是续签证书
      # 参数： run 或 renew
      # 首次申请证书使用 run
      - RENEW_OPTION=run
      # 以下变量是上传到阿里云所需要的变量
      # 阿里云上传并更新 ESA 所需要的参数
      - ALICLOUD_ACCESS_KEY_ID=LTAI5tFLZzjNdcmgn7wwHqcS
      - ALICLOUD_ACCESS_KEY_SECRET=4vEJIzyqgtPc6Z4YHAHrTdTM5WYbNW
      # 阿里云上传证书到哪里，中国大陆（cn-hangzhou）或海外（ap-southeast-1）
      # 参数： cn-hangzhou 或 ap-southeast-1
      # 阿里云国际版ESA账户一般用 ap-southeast-1
      - ALIYUN_REGION=ap-southeast-1
      # 上传到阿里云证书的文件名
      # 实际上传的文件名是文件名+日期
      # 例子：NAME变量为lego-ssl，时间是20250801，则上传到阿里云的证书名为lego-ssl-20250801
      - NAME=lego-ssl
    volumes:
      # /home/www/certs 的certs文件夹名要根据 CERT_PATH 变量来
      # ./CERT_PATH:/home/www/CERT_PATH
      - ./certs:/home/www/certs
</code></pre>
<p>3, 制作Docker镜像并运行</p>
<pre><code class="language-">www@debian:~/ys1$ ls
docker-compose.yml  Dockerfile  domain  site-id  ssl-certid  time
www@debian:~/ys1$ mkdir certs
www@debian:~/ys1$ ls
certs  docker-compose.yml  Dockerfile  domain  site-id  ssl-certid  time
www@debian:~/ys1$ docker-compose build
Building lego-esa-renew
Sending build context to Docker daemon  84.99kB
Step 1/4 : FROM alpine:latest
 ---&gt; 9234e8fb04c4
Step 2/4 : WORKDIR /home/www
 ---&gt; Using cache
 ---&gt; 3fbff363cd04
Step 3/4 : RUN apk update &amp;&amp;     apk add --no-cache curl &amp;&amp;     curl -L https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-amd64.tgz -o aliyun-cli.tgz &amp;&amp;     tar -xzf aliyun-cli.tgz &amp;&amp;     mv aliyun /usr/local/bin/ &amp;&amp;     chmod +x /usr/local/bin/aliyun &amp;&amp;     latest_version=$(curl -s https://api.github.com/repos/go-acme/lego/releases/latest | grep &#39;&quot;tag_name&quot;&#39; | sed -E &#39;s/.*&quot;([^&quot;]+)&quot;.*/\1/&#39;) &amp;&amp;     download_url=&quot;https://github.com/go-acme/lego/releases/download/${latest_version}/lego_${latest_version}_linux_amd64.tar.gz&quot; &amp;&amp;     wget -O lego_linux_amd64.tar.gz &quot;$download_url&quot; &amp;&amp;     tar -xzf lego_linux_amd64.tar.gz &amp;&amp;     mv lego /usr/local/bin/ &amp;&amp;     chmod +x /usr/local/bin/lego &amp;&amp;     rm -rf /var/cache/apk/*
 ---&gt; Using cache
 ---&gt; 5aa22c8af6eb
Step 4/4 : CMD [&quot;tail&quot;, &quot;-f&quot;, &quot;/dev/null&quot;]
 ---&gt; Using cache
 ---&gt; 027b74ba9fc9
Successfully built 027b74ba9fc9
Successfully tagged lego-esa-renew:latest
www@debian:~/ys1$ docker-compose up -d
Creating lego-esa-renew ... done
</code></pre>
<p>4, 进入容器，申请证书。</p>
<pre><code class="language-">www@debian:~/ys1$ docker exec -it lego-esa-renew /bin/sh
/home/www # ls
CHANGELOG.md             LICENSE                  aliyun-cli.tgz           certs                    lego_linux_amd64.tar.gz
/home/www # lego --email=&quot;$EMAIL&quot; --domains=&quot;$DOMAIN&quot; --path=&quot;$CERT_PATH&quot; --dns alidns --accept-tos $RENEW_OPTION
2025/08/11 17:31:45 No key found for account admin@itansuo.info. Generating a P256 key.
2025/08/11 17:31:45 Saved key to certs/accounts/acme-v02.api.letsencrypt.org/admin@itansuo.info/keys/admin@itansuo.info.key
2025/08/11 17:31:45 [INFO] acme: Registering account for admin@itansuo.info
!!!! HEADS UP !!!!

Your account credentials have been saved in your
configuration directory at &quot;certs/accounts&quot;.

You should make a secure backup of this folder now. This
configuration directory will also contain certificates and
private keys obtained from the ACME server so making regular
backups of this folder is ideal.
2025/08/11 17:31:46 [INFO] [yanshi.aaz.ee, *.yanshi.aaz.ee, yanshi.8w.ee, *.yanshi.8w.ee, yanshi.ip94.cn, *.yanshi.ip94.cn, yanshi.211987.xyz, *.yanshi.211987.xyz, yanshi.itansuo.info, *.yanshi.itansuo.info, ssl.itansuo.info, *.ssl.itansuo.info] acme: Obtaining bundled SAN certificate
2025/08/11 17:31:47 [INFO] [*.ssl.itansuo.info] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:31:47 [INFO] [*.yanshi.211987.xyz] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:31:47 [INFO] [*.yanshi.8w.ee] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:31:47 [INFO] [*.yanshi.aaz.ee] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:31:47 [INFO] [*.yanshi.ip94.cn] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:31:47 [INFO] [*.yanshi.itansuo.info] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:31:47 [INFO] [ssl.itansuo.info] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:31:47 [INFO] [yanshi.211987.xyz] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:31:47 [INFO] [yanshi.8w.ee] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:31:47 [INFO] [yanshi.aaz.ee] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:31:47 [INFO] [yanshi.ip94.cn] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:31:47 [INFO] [yanshi.itansuo.info] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:31:47 [INFO] [*.ssl.itansuo.info] acme: use dns-01 solver
2025/08/11 17:31:47 [INFO] [*.yanshi.211987.xyz] acme: use dns-01 solver
2025/08/11 17:31:47 [INFO] [*.yanshi.8w.ee] acme: use dns-01 solver
2025/08/11 17:31:47 [INFO] [*.yanshi.aaz.ee] acme: use dns-01 solver
2025/08/11 17:31:47 [INFO] [*.yanshi.ip94.cn] acme: use dns-01 solver
2025/08/11 17:31:47 [INFO] [*.yanshi.itansuo.info] acme: use dns-01 solver
2025/08/11 17:31:47 [INFO] [ssl.itansuo.info] acme: Could not find solver for: tls-alpn-01
2025/08/11 17:31:47 [INFO] [ssl.itansuo.info] acme: Could not find solver for: http-01
2025/08/11 17:31:47 [INFO] [ssl.itansuo.info] acme: use dns-01 solver
2025/08/11 17:31:47 [INFO] [yanshi.211987.xyz] acme: Could not find solver for: tls-alpn-01
2025/08/11 17:31:47 [INFO] [yanshi.211987.xyz] acme: Could not find solver for: http-01
2025/08/11 17:31:47 [INFO] [yanshi.211987.xyz] acme: use dns-01 solver
2025/08/11 17:31:47 [INFO] [yanshi.8w.ee] acme: Could not find solver for: tls-alpn-01
2025/08/11 17:31:47 [INFO] [yanshi.8w.ee] acme: Could not find solver for: http-01
2025/08/11 17:31:47 [INFO] [yanshi.8w.ee] acme: use dns-01 solver
2025/08/11 17:31:47 [INFO] [yanshi.aaz.ee] acme: Could not find solver for: tls-alpn-01
2025/08/11 17:31:47 [INFO] [yanshi.aaz.ee] acme: Could not find solver for: http-01
2025/08/11 17:31:47 [INFO] [yanshi.aaz.ee] acme: use dns-01 solver
2025/08/11 17:31:47 [INFO] [yanshi.ip94.cn] acme: Could not find solver for: tls-alpn-01
2025/08/11 17:31:47 [INFO] [yanshi.ip94.cn] acme: Could not find solver for: http-01
2025/08/11 17:31:47 [INFO] [yanshi.ip94.cn] acme: use dns-01 solver
2025/08/11 17:31:47 [INFO] [yanshi.itansuo.info] acme: Could not find solver for: tls-alpn-01
2025/08/11 17:31:47 [INFO] [yanshi.itansuo.info] acme: Could not find solver for: http-01
2025/08/11 17:31:47 [INFO] [yanshi.itansuo.info] acme: use dns-01 solver
2025/08/11 17:31:47 [INFO] [*.ssl.itansuo.info] acme: Preparing to solve DNS-01
2025/08/11 17:31:51 [INFO] [*.yanshi.211987.xyz] acme: Preparing to solve DNS-01
2025/08/11 17:31:55 [INFO] [*.yanshi.8w.ee] acme: Preparing to solve DNS-01
2025/08/11 17:31:59 [INFO] [*.yanshi.aaz.ee] acme: Preparing to solve DNS-01
2025/08/11 17:32:02 [INFO] [*.yanshi.ip94.cn] acme: Preparing to solve DNS-01
2025/08/11 17:32:06 [INFO] [*.yanshi.itansuo.info] acme: Preparing to solve DNS-01
2025/08/11 17:32:09 [INFO] [ssl.itansuo.info] acme: Preparing to solve DNS-01
2025/08/11 17:32:12 [INFO] [yanshi.211987.xyz] acme: Preparing to solve DNS-01
2025/08/11 17:32:14 [INFO] [yanshi.8w.ee] acme: Preparing to solve DNS-01
2025/08/11 17:32:17 [INFO] [yanshi.aaz.ee] acme: Preparing to solve DNS-01
2025/08/11 17:32:19 [INFO] [yanshi.ip94.cn] acme: Preparing to solve DNS-01
2025/08/11 17:32:22 [INFO] [yanshi.itansuo.info] acme: Preparing to solve DNS-01
2025/08/11 17:32:24 [INFO] [*.ssl.itansuo.info] acme: Trying to solve DNS-01
2025/08/11 17:32:24 [INFO] [*.ssl.itansuo.info] acme: Checking DNS record propagation. [nameservers=127.0.0.11:53]
2025/08/11 17:32:26 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s]
2025/08/11 17:33:10 [INFO] [*.ssl.itansuo.info] The server validated our request
2025/08/11 17:33:10 [INFO] [*.yanshi.211987.xyz] acme: Trying to solve DNS-01
2025/08/11 17:33:10 [INFO] [*.yanshi.211987.xyz] acme: Checking DNS record propagation. [nameservers=127.0.0.11:53]
2025/08/11 17:33:12 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s]
2025/08/11 17:33:18 [INFO] [*.yanshi.8w.ee] acme: Trying to solve DNS-01
2025/08/11 17:33:18 [INFO] [*.yanshi.8w.ee] acme: Checking DNS record propagation. [nameservers=127.0.0.11:53]
2025/08/11 17:33:20 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s]
2025/08/11 17:33:34 [INFO] [*.yanshi.8w.ee] The server validated our request
2025/08/11 17:33:34 [INFO] [*.yanshi.aaz.ee] acme: Trying to solve DNS-01
2025/08/11 17:33:34 [INFO] [*.yanshi.aaz.ee] acme: Checking DNS record propagation. [nameservers=127.0.0.11:53]
2025/08/11 17:33:36 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s]
2025/08/11 17:33:51 [INFO] [*.yanshi.aaz.ee] The server validated our request
2025/08/11 17:33:51 [INFO] [*.yanshi.ip94.cn] acme: Trying to solve DNS-01
2025/08/11 17:33:51 [INFO] [*.yanshi.ip94.cn] acme: Checking DNS record propagation. [nameservers=127.0.0.11:53]
2025/08/11 17:33:53 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s]
2025/08/11 17:33:59 [INFO] [*.yanshi.ip94.cn] The server validated our request
2025/08/11 17:33:59 [INFO] [*.yanshi.itansuo.info] acme: Trying to solve DNS-01
2025/08/11 17:33:59 [INFO] [*.yanshi.itansuo.info] acme: Checking DNS record propagation. [nameservers=127.0.0.11:53]
2025/08/11 17:34:01 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s]
2025/08/11 17:34:07 [INFO] [*.yanshi.itansuo.info] The server validated our request
2025/08/11 17:34:07 [INFO] [ssl.itansuo.info] acme: Trying to solve DNS-01
2025/08/11 17:34:07 [INFO] [ssl.itansuo.info] acme: Checking DNS record propagation. [nameservers=127.0.0.11:53]
2025/08/11 17:34:09 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s]
2025/08/11 17:34:21 [INFO] [ssl.itansuo.info] The server validated our request
2025/08/11 17:34:21 [INFO] [yanshi.211987.xyz] acme: Trying to solve DNS-01
2025/08/11 17:34:21 [INFO] [yanshi.211987.xyz] acme: Checking DNS record propagation. [nameservers=127.0.0.11:53]
2025/08/11 17:34:23 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s]
2025/08/11 17:34:51 [INFO] [yanshi.211987.xyz] The server validated our request
2025/08/11 17:34:51 [INFO] [yanshi.8w.ee] acme: Trying to solve DNS-01
2025/08/11 17:34:51 [INFO] [yanshi.8w.ee] acme: Checking DNS record propagation. [nameservers=127.0.0.11:53]
2025/08/11 17:34:53 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s]
2025/08/11 17:34:59 [INFO] [yanshi.8w.ee] The server validated our request
2025/08/11 17:34:59 [INFO] [yanshi.aaz.ee] acme: Trying to solve DNS-01
2025/08/11 17:34:59 [INFO] [yanshi.aaz.ee] acme: Checking DNS record propagation. [nameservers=127.0.0.11:53]
2025/08/11 17:35:01 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s]
2025/08/11 17:35:25 [INFO] [yanshi.aaz.ee] The server validated our request
2025/08/11 17:35:25 [INFO] [yanshi.ip94.cn] acme: Trying to solve DNS-01
2025/08/11 17:35:25 [INFO] [yanshi.ip94.cn] acme: Checking DNS record propagation. [nameservers=127.0.0.11:53]
2025/08/11 17:35:27 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s]
2025/08/11 17:35:30 [INFO] [yanshi.ip94.cn] The server validated our request
2025/08/11 17:35:30 [INFO] [yanshi.itansuo.info] acme: Trying to solve DNS-01
2025/08/11 17:35:30 [INFO] [yanshi.itansuo.info] acme: Checking DNS record propagation. [nameservers=127.0.0.11:53]
2025/08/11 17:35:32 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s]
2025/08/11 17:35:40 [INFO] [yanshi.itansuo.info] The server validated our request
2025/08/11 17:35:40 [INFO] [*.ssl.itansuo.info] acme: Cleaning DNS-01 challenge
2025/08/11 17:35:46 [INFO] [*.yanshi.211987.xyz] acme: Cleaning DNS-01 challenge
2025/08/11 17:35:50 [INFO] [*.yanshi.8w.ee] acme: Cleaning DNS-01 challenge
2025/08/11 17:35:55 [INFO] [*.yanshi.aaz.ee] acme: Cleaning DNS-01 challenge
2025/08/11 17:35:59 [INFO] [*.yanshi.ip94.cn] acme: Cleaning DNS-01 challenge
2025/08/11 17:36:03 [INFO] [*.yanshi.itansuo.info] acme: Cleaning DNS-01 challenge
2025/08/11 17:36:08 [INFO] [ssl.itansuo.info] acme: Cleaning DNS-01 challenge
2025/08/11 17:36:10 [INFO] [yanshi.211987.xyz] acme: Cleaning DNS-01 challenge
2025/08/11 17:36:11 [INFO] [yanshi.8w.ee] acme: Cleaning DNS-01 challenge
2025/08/11 17:36:13 [INFO] [yanshi.aaz.ee] acme: Cleaning DNS-01 challenge
2025/08/11 17:36:15 [INFO] [yanshi.ip94.cn] acme: Cleaning DNS-01 challenge
2025/08/11 17:36:17 [INFO] [yanshi.itansuo.info] acme: Cleaning DNS-01 challenge
2025/08/11 17:36:19 [INFO] Skipping deactivating of valid auth: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:36:19 [INFO] Deactivating auth: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:36:19 [INFO] Skipping deactivating of valid auth: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:36:19 [INFO] Skipping deactivating of valid auth: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:36:19 [INFO] Skipping deactivating of valid auth: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:36:19 [INFO] Skipping deactivating of valid auth: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:36:19 [INFO] Skipping deactivating of valid auth: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:36:19 [INFO] Skipping deactivating of valid auth: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:36:19 [INFO] Skipping deactivating of valid auth: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:36:19 [INFO] Skipping deactivating of valid auth: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:36:19 [INFO] Skipping deactivating of valid auth: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:36:19 [INFO] Skipping deactivating of valid auth: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:36:19 Could not obtain certificates:
        error: one or more domains had a problem:
[*.yanshi.211987.xyz] invalid authorization: acme: error: 0 :: urn:ietf:params:acme:error:dns :: While processing CAA for *.yanshi.211987.xyz: DNS problem: SERVFAIL looking up CAA for yanshi.211987.xyz - the domain&#39;s nameservers may be malfunctioning
/home/www # lego --email=&quot;$EMAIL&quot; --domains=&quot;$DOMAIN&quot; --path=&quot;$CERT_PATH&quot; --dns alidns --accept-tos $RENEW_OPTION
2025/08/11 17:36:45 [INFO] [yanshi.aaz.ee, *.yanshi.aaz.ee, yanshi.8w.ee, *.yanshi.8w.ee, yanshi.ip94.cn, *.yanshi.ip94.cn, yanshi.211987.xyz, *.yanshi.211987.xyz, yanshi.itansuo.info, *.yanshi.itansuo.info, ssl.itansuo.info, *.ssl.itansuo.info] acme: Obtaining bundled SAN certificate
2025/08/11 17:36:46 [INFO] [*.ssl.itansuo.info] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:36:46 [INFO] [*.yanshi.211987.xyz] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:36:46 [INFO] [*.yanshi.8w.ee] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:36:46 [INFO] [*.yanshi.aaz.ee] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:36:46 [INFO] [*.yanshi.ip94.cn] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:36:46 [INFO] [*.yanshi.itansuo.info] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:36:46 [INFO] [ssl.itansuo.info] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:36:46 [INFO] [yanshi.211987.xyz] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:36:46 [INFO] [yanshi.8w.ee] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:36:46 [INFO] [yanshi.aaz.ee] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:36:46 [INFO] [yanshi.ip94.cn] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:36:46 [INFO] [yanshi.itansuo.info] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz/REDACTED
2025/08/11 17:36:46 [INFO] [*.ssl.itansuo.info] acme: authorization already valid; skipping challenge
2025/08/11 17:36:46 [INFO] [*.yanshi.8w.ee] acme: authorization already valid; skipping challenge
2025/08/11 17:36:46 [INFO] [*.yanshi.aaz.ee] acme: authorization already valid; skipping challenge
2025/08/11 17:36:46 [INFO] [*.yanshi.ip94.cn] acme: authorization already valid; skipping challenge
2025/08/11 17:36:46 [INFO] [*.yanshi.itansuo.info] acme: authorization already valid; skipping challenge
2025/08/11 17:36:46 [INFO] [ssl.itansuo.info] acme: authorization already valid; skipping challenge
2025/08/11 17:36:46 [INFO] [yanshi.211987.xyz] acme: authorization already valid; skipping challenge
2025/08/11 17:36:46 [INFO] [yanshi.8w.ee] acme: authorization already valid; skipping challenge
2025/08/11 17:36:46 [INFO] [yanshi.aaz.ee] acme: authorization already valid; skipping challenge
2025/08/11 17:36:46 [INFO] [yanshi.ip94.cn] acme: authorization already valid; skipping challenge
2025/08/11 17:36:46 [INFO] [yanshi.itansuo.info] acme: authorization already valid; skipping challenge
2025/08/11 17:36:46 [INFO] [*.yanshi.211987.xyz] acme: use dns-01 solver
2025/08/11 17:36:46 [INFO] [*.yanshi.211987.xyz] acme: Preparing to solve DNS-01
2025/08/11 17:36:49 [INFO] [*.yanshi.211987.xyz] acme: Trying to solve DNS-01
2025/08/11 17:36:49 [INFO] [*.yanshi.211987.xyz] acme: Checking DNS record propagation. [nameservers=127.0.0.11:53]
2025/08/11 17:36:51 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s]
2025/08/11 17:36:57 [INFO] [*.yanshi.211987.xyz] The server validated our request
2025/08/11 17:36:57 [INFO] [*.yanshi.211987.xyz] acme: Cleaning DNS-01 challenge
2025/08/11 17:37:00 [INFO] [yanshi.aaz.ee, *.yanshi.aaz.ee, yanshi.8w.ee, *.yanshi.8w.ee, yanshi.ip94.cn, *.yanshi.ip94.cn, yanshi.211987.xyz, *.yanshi.211987.xyz, yanshi.itansuo.info, *.yanshi.itansuo.info, ssl.itansuo.info, *.ssl.itansuo.info] acme: Validations succeeded; requesting certificates
2025/08/11 17:37:03 [INFO] [yanshi.aaz.ee] Server responded with a certificate.
</code></pre>
<ol start="5">
<li>将证书上传到阿里云</li>
</ol>
<pre><code class="language-">/home/www # ls -al certs/certificates/
total 24
drwx------    2 root     root          4096 Aug 11 17:37 .
drwxr-xr-x    4 1000     1000          4096 Aug 11 17:31 ..
-rw-------    1 root     root          3129 Aug 11 17:37 yanshi.aaz.ee.crt
-rw-------    1 root     root          1567 Aug 11 17:37 yanshi.aaz.ee.issuer.crt
-rw-------    1 root     root           234 Aug 11 17:37 yanshi.aaz.ee.json
-rw-------    1 root     root           227 Aug 11 17:37 yanshi.aaz.ee.key
/home/www # aliyun configure set --access-key-id &quot;$ALICLOUD_ACCESS_KEY_ID&quot; --access-key-secret &quot;$ALICLOUD_ACCESS_KEY_SECRET&quot; --region &quot;$ALIYUN_REGION&quot;
/home/www #           aliyun cas UploadUserCertificate \
&gt;             --Cert &quot;$(cat ./$CERT_PATH/certificates/yanshi.aaz.ee.crt)&quot; \
&gt;             --Key &quot;$(cat ./$CERT_PATH/certificates/yanshi.aaz.ee.key)&quot; \
&gt;             --Name &quot;$NAME&quot; 
{
        &quot;CertId&quot;: 237257,
        &quot;RequestId&quot;: &quot;EE7108AB-70D6-36DD-A97A-0CC7260E1CB1&quot;,
        &quot;ResourceId&quot;: &quot;cas-upload-68j5ur&quot;
}
</code></pre>
<ol start="6">
<li>接下来可以去阿里云<strong>数字证书管理服务</strong>和<strong>ESA</strong>中查看和绑定证书，同时可以验证Lego和阿里云都可以正常运行。</li>
</ol>
]]></description>
           <pubDate>Sat, 02 Aug 2025 19:18:51 GMT</pubDate>
                </item>
         
              <item>
            <title><![CDATA[微软Azure DD Windows 7专业版]]></title>
               <link>https://www.itansuo.info/archives/azureddwindows7-zhuan-ye-ban</link>
                    <description><![CDATA[<h1 id="%E8%AF%B4%E6%98%8E" tabindex="-1">说明</h1>
<p>最近用教育邮箱进行微软Azure 学生认证，可以各创建一台Linux和Windows服务器，可创建的Windows系统都有很高的资源需求，萌生了DD Windows 7的想法。</p>
<h1 id="%E5%87%86%E5%A4%87" tabindex="-1">准备</h1>
<p>脚本：<a href="https://github.com/bin456789/reinstall" target="_blank">bin456789/reinstall</a><br />
镜像下载：<a href="https://massgrave.dev/genuine-installation-media" target="_blank">Download Windows / Office</a>，因为MAS下载的镜像需要进行认证，可以先在浏览找到对应的镜像链接，在浏览器点击下载镜像，此时浏览器会弹出保存镜像对话框，点击“保存”，在“下载”管理界面，暂停下载，复制下载链接，因为认证有6小时有效期，将获取的镜像链接填入DD代码即可DD Windows。<br />
Azure 创建后缀为Gen1的系统镜像，唯有Gen1后缀的系统才可DD Windows 7</p>
<h1 id="dd-%E4%BB%A3%E7%90%86" tabindex="-1">DD 代理</h1>
<h2 id="linux" tabindex="-1">Linux</h2>
<pre><code class="language-">curl -O https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh || wget -O reinstall.sh $_
</code></pre>
<pre><code class="language-">bash reinstall.sh windows \
     --image-name &#39;Windows 7 Professional&#39; \
     --iso &#39;镜像下载地址&#39;  \
     --lang zh-cn \
     --web-port 80 \
     --password 密码
</code></pre>
<h2 id="windows" tabindex="-1">Windows</h2>
<pre><code class="language-">certutil -urlcache -f -split https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.bat
</code></pre>
<p>执行以下命令会在Windows服务器中创建Linux运行环境</p>
<pre><code class="language-">.\reinstall.bat windows \
     --image-name &#39;Windows 7 Professional&#39; \
     --iso &#39;镜像下载地址&#39;  \
     --lang zh-cn \
     --web-port 80 \
     --password 密码
</code></pre>
<p>在桌面的新建的快捷方式中输入Linux下的DD代理。</p>
<h1 id="%E6%95%88%E6%9E%9C" tabindex="-1">效果</h1>
<p><img src="https://cf-image.676232.xyz/sonic/DD-Windows-7.png" alt="DD-Windows-7" /></p>
]]></description>
           <pubDate>Fri, 28 Feb 2025 20:14:20 GMT</pubDate>
                </item>
         
              <item>
            <title><![CDATA[RackNerd DD Debian]]></title>
               <link>https://www.itansuo.info/archives/racknerddddebian</link>
                    <description><![CDATA[<h1 id="%E6%B2%A1%E6%9C%89%E7%94%B3%E8%AF%B7ipv6" tabindex="-1">没有申请IPV6</h1>
<pre><code class="language-">wget --no-check-certificate -qO InstallNET.sh &#39;https://raw.githubusercontent.com/leitbogioro/Tools/master/Linux_reinstall/InstallNET.sh&#39; &amp;&amp; chmod a+x InstallNET.sh &amp;&amp; bash InstallNET.sh -debian 12 -pwd &#39;密码&#39; --setipv6 &quot;0&quot;
</code></pre>
<p>建议申请IPV6再DD Debian</p>
<h1 id="%E5%B7%B2%E7%BB%8F%E7%94%B3%E8%AF%B7%E5%B9%B6%E5%88%86%E9%85%8Dipv6" tabindex="-1">已经申请并分配IPV6</h1>
<ol>
<li>申请IPV6，在RackNerd的管理界面<strong>重置网络</strong></li>
<li>其次要确保原VPS可以正常使用IPV6访问外部网址。</li>
<li>DD Debian脚本</li>
</ol>
<pre><code class="language-">wget --no-check-certificate -qO InstallNET.sh &#39;https://raw.githubusercontent.com/leitbogioro/Tools/master/Linux_reinstall/InstallNET.sh&#39; &amp;&amp; chmod a+x InstallNET.sh &amp;&amp; bash InstallNET.sh -debian 12 -pwd &#39;密码&#39;
</code></pre>
]]></description>
           <pubDate>Wed, 04 Dec 2024 09:31:20 GMT</pubDate>
                </item>
         
              <item>
            <title><![CDATA[Word转PDF时页面格式设置]]></title>
               <link>https://www.itansuo.info/archives/word-zhuan-pdf-shi-ye-mian-ge-shi-she-zhi</link>
                    <description><![CDATA[<h1 id="%E9%97%AE%E9%A2%98" tabindex="-1">问题</h1>
<p>有时候博主需要将Word文档转为PDF文档，方便阅读，但默认的排版字体过小，太密集，不方便阅读，这是我根据calibre转的PDF文档找到的适合博主的排版格式。</p>
<h1 id="%E8%AE%BE%E7%BD%AE" tabindex="-1">设置</h1>
<ol>
<li>设置“段落”<br />
<img src="https://cf-image.676232.xyz/sonic/duan-luo.png" alt="duan-luo" /></li>
<li>进行“页面设置”<br />
2.1 页边距<br />
<img src="https://cf-image.676232.xyz/sonic/ye-bian-ju.png" alt="页边距" /><br />
2.2 纸张<br />
<img src="https://cf-image.676232.xyz/sonic/zhi-zhang.png" alt="纸张" /><br />
2.3 布局<br />
<img src="https://cf-image.676232.xyz/sonic/bu-ju.png" alt="布局" /><br />
2.4 文档网格<br />
<img src="https://cf-image.676232.xyz/sonic/wen-dang-wang-ge.png" alt="wen-dang-wang-ge" /></li>
</ol>
]]></description>
           <pubDate>Sat, 19 Oct 2024 21:46:05 GMT</pubDate>
                </item>
         
              <item>
            <title><![CDATA[Whoogle配置代理]]></title>
               <link>https://www.itansuo.info/archives/whoogle-pei-zhi-dai-li</link>
                    <description><![CDATA[<h2 id="%E5%8E%9F%E5%9B%A0" tabindex="-1">原因</h2>
<p>之前搭建在fly.io上Whoogle最接近提示被限速，通过火狐镜像访问Google搜索，一直提示要人机验证，验证好多次都不行，后来研究了下，应该是Google搜索将fly.io的所有IP都拉黑了。要继续使用Whoogle需要使用代理访问Google搜索。</p>
<h2 id="%E8%A7%A3%E5%86%B3" tabindex="-1">解决</h2>
<h3 id="%E5%87%86%E5%A4%87" tabindex="-1">准备</h3>
<p>我正好有甲骨文东京的VPS，可以搭建socks代理，fly.io支持分配免费IPV6，甲骨文VPS也可以分配IPV6，这样可以通过甲骨文VPS的防火墙限制对socks代理的访问。</p>
<h3 id="%E8%8E%B7%E5%8F%96fly.io%E7%9A%84%E5%85%AC%E7%BD%91ipv6" tabindex="-1">获取fly.io的公网IPV6</h3>
<p>甲骨文VPS配置IPV6请自行查找网上的教程，fly.io的公网IPV6无法通过在网页查找，需要使用<code>flyctl ssh console</code>连接到Whoogle内部，执行<code>echo $FLY_PUBLIC_IP</code>获取公网出口IP，例如<code>2605:4c40:92:520a:0:8c93:3d8a:1</code>，CIDR 写法为<code>2605:4c40:92:5200::/56</code>，CIDR是设置甲骨文防火墙所需要的。</p>
<h3 id="%E9%85%8D%E7%BD%AEsocks%E4%BB%A3%E7%90%86" tabindex="-1">配置socks代理</h3>
<p>使用V2Fly搭建socks代理，配置如下：<br />
<code>docker-compose.yml </code></p>
<pre><code class="language-">version: &quot;3&quot;
services:
  v2ray:
    image: v2fly/v2fly-core:latest
    container_name: v2ray
    restart: always
    #command: run -c  /etc/v2fly/config.json
    command: run -confdir  /etc/v2fly/config
    ports:
      # SOCKS
      - &quot;45222:44222&quot;
    volumes:
      - ./log:/var/log/v2fly/
      - ./config/socks.json:/etc/v2fly/config/socks.json:ro
</code></pre>
<p><code>./config/socks.json</code></p>
<pre><code class="language-">{
  &quot;inbounds&quot;: [
    {
      &quot;port&quot;: 44222,
      &quot;protocol&quot;: &quot;socks&quot;,
      &quot;settings&quot;: {
        &quot;auth&quot;: &quot;password&quot;,
        &quot;accounts&quot;: [
          {
            &quot;user&quot;: &quot;admin&quot;,
            &quot;pass&quot;: &quot;123&quot;
          }
        ]
      }
    }
  ],
  &quot;outbounds&quot;: [
    {
      &quot;protocol&quot;: &quot;freedom&quot;
    }
  ]
}
</code></pre>
<p>运行V2Fly容器，并配置甲骨文VPS防火墙允许特定IP和开放特定端口。</p>
<h3 id="whoogle%E9%85%8D%E7%BD%AE%E4%BB%A3%E7%90%86" tabindex="-1">Whoogle配置代理</h3>
<p>在Whoogle配置里添加一下内容</p>
<pre><code class="language-">  WHOOGLE_PROXY_TYPE = &quot;socks5h&quot;
  WHOOGLE_PROXY_LOC = &quot;[2605:4c40:92:520a:0:8c93:3d8a:1]:45222&quot;
  WHOOGLE_PROXY_USER = &quot;admin&quot;
  WHOOGLE_PROXY_PASS = &quot;123&quot;
</code></pre>
<p>重新运行Whoogle容器。</p>
<h2 id="%E5%8F%82%E8%80%83%E6%96%87%E6%A1%A3" tabindex="-1">参考文档</h2>
<ol>
<li><a href="https://fly.io/docs/networking/services/#find-your-machines-outbound-ip" target="_blank">Public Network Services</a></li>
<li><a href="https://github.com/benbusby/whoogle-search/issues/1138#issuecomment-2063267073" target="_blank">[BUG] socks5 proxy config gives Internal server error 500</a></li>
</ol>
]]></description>
           <pubDate>Fri, 26 Jul 2024 13:21:11 GMT</pubDate>
                </item>
         
              <item>
            <title><![CDATA[Nginx缓存Sonic网页]]></title>
               <link>https://www.itansuo.info/archives/nginx-huan-cun-sonic-wang-ye</link>
                    <description><![CDATA[<h1 id="%E4%B8%BA%E4%BB%80%E4%B9%88%EF%BC%9F" tabindex="-1">为什么？</h1>
<p>自从将博客平台更换为Sonic后，访问速度快了很多，但我想要更快，对后端压力更小，因此我想到了使用Nginx缓存对外展示的内容。以下是本网站的一些配置仅供参考。</p>
<h1 id="ngxin%E9%85%8D%E7%BD%AE" tabindex="-1">Ngxin配置</h1>
<p>首先在Nginx配置文件（/etc/nginx/nginx.conf）中的<code>http { }</code>中添加以下内容</p>
<pre><code class="language-">  # 设置缓存文件位置，并配置缓存文件最大值
  proxy_cache_path /tmp/cache levels=1:2 keys_zone=cache_one:100m inactive=1d max_size=10g;
  # 关闭显示Nginx版本
  server_tokens off;
  # 开启ETAG功能
  etag on;
</code></pre>
<p>修改sonic.conf内容如下</p>
<pre><code class="language-">server {
     listen 80
     listen [::]:80

     server_name www.itansuo.info;

     client_max_body_size 5m;
     client_body_timeout 60;

     access_log  /tmp/logs/sonic.log;

     gzip on;
     gzip_types application/xml application/json text/css text/javascript application/javascript;
     gzip_vary on;
     gzip_comp_level 6;
     gzip_min_length 500;

     location / {
         proxy_pass https://源站;
         proxy_redirect off;
         proxy_set_header Host $host;
         proxy_set_header X-Real-IP $remote_addr;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_set_header X-Forwarded-Proto $scheme;

         proxy_ssl_name $host;
         proxy_ssl_server_name on;

     }
     # 缓存静态文件，有效期90天
    location ~ .*\.(gif|jpg|png|woff2|ico|svg|css|js)(.*) {
         proxy_pass https://源站;
         proxy_redirect off;
         proxy_set_header Host $host;
         proxy_cache cache_one;
         proxy_cache_valid 200 302 24h;
         proxy_cache_valid 301 30d;
         proxy_cache_valid any 5m;
         proxy_cache_key &quot;$host$request_uri$args&quot;;

         proxy_buffer_size 16k;
         proxy_buffers 4 32k;
         proxy_busy_buffers_size 96k;
         proxy_temp_file_write_size 96k;

         expires 90d;
         add_header wall  &quot;Tokyo-Oracle-Cloud&quot;;
         add_header Cache-Control &quot;public&quot;;

         proxy_ssl_name $host;
         proxy_ssl_server_name on;

         proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
    }

    # 缓存RSS源，有效期24小时
    location ~ /feed {
         proxy_pass https://源站;

         proxy_redirect off;
         proxy_set_header Host $host;
         proxy_cache cache_one;
         proxy_cache_valid 200 302 24h;
         proxy_cache_valid 301 30d;
         proxy_cache_valid any 5m;
         proxy_cache_key &quot;$host$request_uri$args&quot;;

         proxy_buffer_size 16k;
         proxy_buffers 4 32k;
         proxy_busy_buffers_size 96k;
         proxy_temp_file_write_size 96k;

         expires 24h;
         add_header wall  &quot;Tokyo-Oracle-Cloud&quot;;
         add_header Cache-Control &quot;public&quot;;
         add_header Last-Modified $date_gmt;

         proxy_ssl_name $host;
         proxy_ssl_server_name on;

         proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
    }  
 
    # 缓存/archives/网页，有效期24小时
    location ~ ^/archives/(?!.*/$) {
         proxy_pass https://sonic-nrt.fly.dev;

         proxy_redirect off;
         proxy_set_header Host $host;
         proxy_cache cache_one;
         proxy_cache_valid 200 302 24h;
         proxy_cache_valid 301 30d;
         proxy_cache_valid any 5m;
         proxy_cache_key &quot;$host$request_uri$args&quot;;

         proxy_buffer_size 16k;
         proxy_buffers 4 32k;
         proxy_busy_buffers_size 96k;
         proxy_temp_file_write_size 96k;

         expires 24h;
         add_header wall  &quot;Tokyo-Oracle-Cloud&quot;;
         add_header Cache-Control &quot;public&quot;;
         add_header Last-Modified $date_gmt;

         proxy_ssl_name $host;
         proxy_ssl_server_name on;

         proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
    }
    # 缓存首页，有效期24小时
    location = / {
         proxy_pass https://源站;

         proxy_redirect off;
         proxy_set_header Host $host;
         proxy_cache cache_one;
         proxy_cache_valid 200 302 24h;
         proxy_cache_valid 301 30d;
         proxy_cache_valid any 5m;
         proxy_cache_key &quot;$host$request_uri$args&quot;;

         proxy_buffer_size 16k;
         proxy_buffers 4 32k;
         proxy_busy_buffers_size 96k;
         proxy_temp_file_write_size 96k;

         expires 24h;
         add_header wall  &quot;Tokyo-Oracle-Cloud&quot;;
         add_header Cache-Control &quot;public&quot;;
         add_header Last-Modified $date_gmt;

         proxy_ssl_name $host;
         proxy_ssl_server_name on;

         proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
    }
    # 缓存URL有/archives/的网页，不包括/archives/，有效期24小时
    location ~ ^/archives(/page/\d+)?/?$ {
         proxy_pass https://源站;

         proxy_redirect off;
         proxy_set_header Host $host;
         proxy_cache cache_one;
         proxy_cache_valid 200 302 24h;
         proxy_cache_valid 301 30d;
         proxy_cache_valid any 5m;
         proxy_cache_key &quot;$host$request_uri$args&quot;;

         proxy_buffer_size 16k;
         proxy_buffers 4 32k;
         proxy_busy_buffers_size 96k;
         proxy_temp_file_write_size 96k;

         expires 24h;
         add_header wall  &quot;Tokyo-Oracle-Cloud&quot;;
         add_header Cache-Control &quot;public&quot;;
         add_header Last-Modified $date_gmt;

         proxy_ssl_name $host;
         proxy_ssl_server_name on;

         proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
    }

    # 缓存 /page/页面，有效期24小时
    location ^~ /page/ {
         proxy_pass https://源站;

         proxy_redirect off;
         proxy_set_header Host $host;
         proxy_cache cache_one;
         proxy_cache_valid 200 302 24h;
         proxy_cache_valid 301 30d;
         proxy_cache_valid any 5m;
         proxy_cache_key &quot;$host$request_uri$args&quot;;

         proxy_buffer_size 16k;
         proxy_buffers 4 32k;
         proxy_busy_buffers_size 96k;
         proxy_temp_file_write_size 96k;

         expires 24h;
         add_header wall  &quot;Tokyo-Oracle-Cloud&quot;;
         add_header Cache-Control &quot;public&quot;;
         add_header Last-Modified $date_gmt;

         proxy_ssl_name $host;
         proxy_ssl_server_name on;

         proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
    }
</code></pre>
]]></description>
           <pubDate>Sun, 26 May 2024 22:38:02 GMT</pubDate>
                </item>
         
              <item>
            <title><![CDATA[Sonic的PaperMod主题启用Artalk评论]]></title>
               <link>https://www.itansuo.info/archives/sonic-de-papermod-zhu-ti-qi-yong-artalk-ping-lun</link>
                    <description><![CDATA[<h1 id="%E5%8E%9F%E5%9B%A0" tabindex="-1">原因</h1>
<p>自从博客平台由WordPress切换到Sonic后，博客加载速度有了明显提升。尝试Sonic的几个博客主题后，PaperMod主题最符合我的要求，但PaperMod无评论系统，无法和Artalk一起使用，前几天正好有时间，自己研究下，成功启用Artalk评论，这里记录下，希望能帮到有需要的人。</p>
<h1 id="%E5%90%AF%E7%94%A8artalk%E8%AF%84%E8%AE%BA%E7%B3%BB%E7%BB%9F" tabindex="-1">启用Artalk评论系统</h1>
<ol>
<li>首先，安装<a href="https://github.com/jakezhu9/sonic-theme-papermod" target="_blank">PaperMod</a>主题，并启用PaperMod主题。</li>
<li>接着进入Sonic后台，选择<code>外观</code>下的<code>主题编辑</code>选项，再次检查下编辑的主题是PaperMod，点击<code>post.tmpl</code>，在<a href="https://github.com/jakezhu9/sonic-theme-papermod/blob/main/post.tmpl#L50C1-L50C11" target="_blank"><code>&lt;/article&gt;</code></a>后另起一行添加如下内容：</li>
</ol>
<pre><code class="language-">&lt;link href=&quot;//cdn.staticfile.org/artalk/2.8.3/ArtalkLite.css&quot; rel=&quot;stylesheet&quot; /&gt;
&lt;script src=&quot;//cdn.staticfile.org/artalk/2.8.3/ArtalkLite.js&quot;&gt;&lt;/script&gt;

&lt;!-- Artalk --&gt;
&lt;div id=&quot;Comments&quot;&gt;&lt;/div&gt;

&lt;script&gt;
  Artalk.init({
    el: &#39;#Comments&#39;,
    pageKey: &#39;{{ .post.FullPath }}&#39;,
    pageTitle: &#39;{{ .post.Title }}&#39;,
    server: &#39;https://Artalk地址&#39;,
    site: &#39;{{ .settings.header_title }}&#39;,
   })
&lt;/script&gt;
</code></pre>
<ol start="3">
<li>保存，进入博客内容页，即可看到Artalk评论框。</li>
</ol>
<h1 id="%E9%81%87%E5%88%B0%E9%97%AE%E9%A2%98" tabindex="-1">遇到问题</h1>
<ol>
<li>评论框与内容靠的太近，视觉上有有些拥挤<br />
在<code>&lt;/nav&gt;</code>和<code>&lt;/footer&gt;</code>之间另起一行添加<code>&lt;br&gt;</code>，完整的例子如何：</li>
</ol>
<pre><code class="language-">&lt;/nav&gt;

&lt;br&gt;

&lt;/footer&gt;
</code></pre>
<ol start="2">
<li>Artalk有以前的内容，在Sonic启用<br />
首先，确保 Artalk站点设置的网址是Sonic网址。<br />
接着，进入 Artalk数据库后台，修改<code>comments</code>中的<code>page_key</code>项的地址，例子如下：</li>
</ol>
<table>
<thead>
<tr>
<th>项目</th>
<th>Wordpress</th>
<th>Sonic</th>
</tr>
</thead>
<tbody>
<tr>
<td>URL</td>
<td><code>https://www.itansuo.info/685</code></td>
<td><code>https://www.itansuo.info/archives/awscloudfront-qiang-zhi-tian-jia-cname</code></td>
</tr>
<tr>
<td>page_key</td>
<td><code>https://www.itansuo.info/685</code></td>
<td><code>/archives/awscloudfront-qiang-zhi-tian-jia-cname</code></td>
</tr>
</tbody>
</table>
<ol start="3">
<li>不同<code>pageKey</code>配置获取的URL，根据自己的需求选择。</li>
</ol>
<table>
<thead>
<tr>
<th>变量</th>
<th>Artalk前端获取的URL</th>
<th>Artalk后端保存的URL</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>pageKey: '{{ .post.FullPath }}',</code></td>
<td><code>\/archives\/sonic-de-papermod-zhu-ti-qi-yong-artalk-ping-lun</code></td>
<td><code>archives/sonic-de-papermod-zhu-ti-qi-yong-artalk-ping-lun</code></td>
</tr>
<tr>
<td><code>pageKey: '{{ .blog_url }}{{ .post.FullPath }}',</code></td>
<td><code>https:\/\/www.itansuo.info\/archives\/sonic-de-papermod-zhu-ti-qi-yong-artalk-ping-lun</code></td>
<td><code>https://www.itansuo.info/archives/sonic-de-papermod-zhu-ti-qi-yong-artalk-ping-lun</code></td>
</tr>
</tbody>
</table>
<h1 id="%E9%99%84%E5%BD%95" tabindex="-1">附录</h1>
<p><code>post.tmpl</code>完整修改如下</p>
<pre><code class="language-">{{- define &quot;sonic_theme_paper_mod/post&quot; -}}
&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;zh&quot; dir=&quot;auto&quot;&gt;

&lt;head&gt;
&lt;title&gt;{{ .post.Title }} - {{ .blog_title }}&lt;/title&gt;
{{ template &quot;sonic_theme_paper_mod/module/head&quot; .}}
&lt;/head&gt;

&lt;body id=&quot;top&quot;&gt;

{{template &quot;sonic_theme_paper_mod/module/header&quot; .}}

&lt;main class=&quot;main&quot;&gt;

&lt;article class=&quot;post-single&quot;&gt;
&lt;h1 class=&quot;post-title&quot;&gt;&lt;a href=&quot;{{ .post.FullPath }}&quot;&gt;{{ .post.Title }}&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;post-meta&quot;&gt;
    &lt;div class=&quot;post-info&quot;&gt;
        Create Time: {{ unix_milli_time_format &quot;2006-01-02 15:04:05&quot; .post.CreateTime }}  Words: {{ .post.WordCount }}
    &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;post-content&quot;&gt;
    &lt;hr&gt;
    {{noescape .post.Content}}
    &lt;hr&gt;
&lt;/div&gt;

&lt;footer class=&quot;post-footer&quot;&gt;
&lt;nav class=&quot;paginav&quot;&gt;
    {{if .prevPost}}
    &lt;a class=&quot;prev&quot; href=&quot;{{.prevPost.FullPath}}&quot;&gt;
        &lt;span class=&quot;title&quot;&gt;« Prev&lt;/span&gt;
        &lt;br&gt;
        &lt;span&gt;{{.prevPost.Title}}&lt;/span&gt;
    &lt;/a&gt;
    {{end}}
    {{if .nextPost}}
    &lt;a class=&quot;next&quot; href=&quot;{{.nextPost.FullPath}}&quot;&gt;
        &lt;span class=&quot;title&quot;&gt;Next »&lt;/span&gt;
        &lt;br&gt;
        &lt;span&gt;{{.nextPost.Title}}&lt;/span&gt;
    &lt;/a&gt;
    {{end}}
&lt;/nav&gt;

&lt;br&gt;

&lt;/footer&gt;

&lt;/article&gt;

&lt;link href=&quot;//cdn.staticfile.org/artalk/2.8.3/ArtalkLite.css&quot; rel=&quot;stylesheet&quot; /&gt;
&lt;script src=&quot;//cdn.staticfile.org/artalk/2.8.3/ArtalkLite.js&quot;&gt;&lt;/script&gt;

&lt;!-- Artalk --&gt;
&lt;div id=&quot;Comments&quot;&gt;&lt;/div&gt;

&lt;script&gt;
  Artalk.init({
    el: &#39;#Comments&#39;,
    pageKey: &#39;{{ .post.FullPath }}&#39;,
    pageTitle: &#39;{{ .post.Title }}&#39;,
    server: &#39;https://Artalk地址&#39;,
    site: &#39;{{ .settings.header_title }}&#39;,
   })
&lt;/script&gt;

&lt;/main&gt;

{{template &quot;sonic_theme_paper_mod/module/footer&quot; .}}

&lt;/body&gt;
&lt;/html&gt;
{{end}}
</code></pre>
]]></description>
           <pubDate>Tue, 07 May 2024 19:53:43 GMT</pubDate>
                </item>
         
              <item>
            <title><![CDATA[Alist使用自建PDF和EPUB js源]]></title>
               <link>https://www.itansuo.info/archives/alist-shi-yong-zi-jian-pdf-he-epubjs-yuan</link>
                    <description><![CDATA[<h1 id="%E4%B8%BA%E4%BB%80%E4%B9%88%E4%BD%BF%E7%94%A8alist%EF%BC%9F" tabindex="-1">为什么使用Alist？</h1>
<p>博主的OneDrive可以开启API，这个OneDrive账户中存储了一些文件，博主想要将账户里的文件方便分享出来，因此一直都使用OneDrive列表程序，之前使用的OneDrive程序不是有严重的Bug就是运行缓慢还有可能作者弃坑，一直都无妨稳定使用，直至一周前更换为Alist，在试用一段时间后，Alist非常符合我的要求，博主的OneDrive存储库中有些PDF文档，在使用Alist预览时经常提示“连接重置”，研究后发现是因为“<a href="http://alist-org.github.io" target="_blank">alist-org.github.io</a>”域名被污染了，因此需要自建PDF和EPUB js源。</p>
<h1 id="%E8%87%AA%E5%BB%BA%E6%AD%A5%E9%AA%A4" tabindex="-1">自建步骤</h1>
<ol>
<li>PDF和EPUB js源文件地址：<a href="https://github.com/mozilla/pdf.js/releases" target="_blank">pdf.js</a>，<a href="https://github.com/alist-org/web-dist/tree/main/dist/static" target="_blank">epub.js</a>。</li>
<li>创建一个公开的GitHub仓库，并将上述两个文件上传的仓库里。</li>
<li>将所使用的域名填入pdf.js所下载的<code>web/viewer.mjs</code>中的<code>HOSTED_VIEWER_ORIGINS</code>所在位置，例子<a href="https://github.com/alist-org/pdf.js/blob/main/web/viewer.js#L3405" target="_blank">如下</a>。</li>
<li>通过GitHub设置里的<a href="https://github.com/settings/pages" target="_blank"><code>Pages</code></a>验证域名，再在GitHub仓库里的<code>GitHub Pages</code>添加域名，当生效后即可通过域名访问pdf.js和epub.js了，最后将的域名路径填入Alist的3预览设置里。</li>
<li>（可选）nginx反代 GitHub Pages，代码如下：</li>
</ol>
<pre><code class="language-">location /
    {
        proxy_pass https://GitHub Pages域名;
        proxy_set_header Host GitHub Pages域名;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header REMOTE-HOST $remote_addr;
        proxy_set_header Range $http_range;

        proxy_ssl_name GitHub Pages域名;
        proxy_ssl_server_name on;
    }
</code></pre>
]]></description>
           <pubDate>Fri, 26 Apr 2024 23:04:36 GMT</pubDate>
                </item>
         
              <item>
            <title><![CDATA[使用Next Terminal管理VPS]]></title>
               <link>https://www.itansuo.info/archives/shi-yong-nextterminal-guan-li-vps</link>
                    <description><![CDATA[<p>博主自从有了收入后，在全球主机交流论坛找到很多价格便宜VPS，截止到现在大概有十几台了，如何管理这些VPS就成了问题。</p>
<h2 id="%E9%97%AE%E9%A2%98" tabindex="-1">问题</h2>
<p>之前刚接触VPS，开始使用密码通过SSH登录Ubuntu，经过一段时间的学习，又启用密钥登录VPS，但是运行一段时间后，我又发现一些问题：<br />
1.迁移不方便。因为都是使用电脑本地软件了连接到VPS，在其他电脑上要重新配置，花费时间要很久。<br />
2.要配置网络代理。因VPS在全球各地，而博主本地的网络又不好，经常出现断连，上传文件也非常麻烦。<br />
3.同时要尽可能占用更少的资源。<br />
因为博主需要的这些需求就有了通过浏览器管理VPS的想法。</p>
<h2 id="%E4%B8%BA%E4%BB%80%E4%B9%88%E6%98%AFnext-terminal%EF%BC%9F" tabindex="-1">为什么是Next Terminal？</h2>
<p>博主在网上一番查找，找到了一下几个项目：Sshwifty，Spug和Next Terminal。博主实际体验下这个三个项目，都有各自的优缺点。</p>
<p>Sshwifty：使用Golang开发，占用资源少，优点是运行简单，可以快速访问VPS，缺点也是简单，无法满足博主对WebSSH的要求。</p>
<p>Spug：使用Python开发，功能强大。但也有博主无法忍受的缺点：</p>
<ul>
<li>启用两步验证需要关注微信公众号，这对我来说是不可接受的，</li>
<li>官方的Docker镜像将运行环境、Mysql数据库和Redis服务打包在一个镜像，造成镜像包过大，即使博主使用外部Mysql数据库和Redis服务，</li>
<li>使用的语言Python，可能是博主的偏见，Python运行效率低，博主又要将其部署到公有云上，不可能提供太多资源。</li>
</ul>
<p>Next Terminal：使用Golang开发，资源占用适中，和Sshwifty比，功能强大，能满足博主的需求，和Spug比，因为是使用Golang开发，占用资源少，运行速度快，并且两步验证不需要联网。但也有缺点，运行镜像需要两个，有些只能部署一个镜像的云平台无法使用，这个博主自己创建一个项目，将Next Terminal两个镜像合并成一个。</p>
<h2 id="%E5%8F%82%E8%80%83" tabindex="-1">参考</h2>
<ul>
<li><a href="https://github.com/aaro-n/docker-next-terminal" target="_blank">为Next Terminal制作二合一镜像</a></li>
</ul>
]]></description>
           <pubDate>Sun, 10 Mar 2024 18:27:39 GMT</pubDate>
                </item>
         
              <item>
            <title><![CDATA[使用Screen保持VPS终端运行]]></title>
               <link>https://www.itansuo.info/archives/shi-yong-screen-bao-chi-vps-zhong-duan-yun-xing</link>
                    <description><![CDATA[<h1 id="%E5%8E%9F%E5%9B%A0" tabindex="-1">原因</h1>
<p>我使用Next Terminal管理VPS，Next Terminal可以通过浏览器访问VPS，但也会因网络问题导致链接断开，如何在断开后快速恢复成了问题，对比各种方案Screen符合我的要求，以下具体做法：</p>
<h1 id="%E5%AE%89%E8%A3%85%E5%8F%8A%E9%85%8D%E7%BD%AE" tabindex="-1">安装及配置</h1>
<p>Debian可以通过命令<code>sudo apt install screen</code>安装Screen，安装完后如何实现登录VPS创建并恢复Screen会话就成了问题，这是我的做法，仅供参考。<br />
在用户根目录下执行以下命令，创建脚本，命令如下：</p>
<pre><code class="language-">cat &gt; ~/.web-ssh.sh &lt;&lt;EOF
#!/bin/bash
# 检查是否有现有的 screen 会话
if screen -ls | grep -q &quot;There is a screen on&quot;; then
  # 如果有，切换到该会话
  # screen -r
  screen -xRR
else
  # 如果没有，创建名为next-terminal新会话并进入
  screen -S next-terminal
fi
EOF
</code></pre>
<p>执行<code>chmod +x ~/.web-ssh.sh</code>，赋予执行权限，接着修改<code> ~/.bashrc</code>文件，追加</p>
<pre><code class="language-">cat &gt;&gt; ~/.bashrc &lt;&lt;EOF
if [ -f ~/.web-ssh.sh ]; then
  source ~/.web-ssh.sh
fi
EOF
</code></pre>
<p>保存，这样每次SSH进入VPS都会进入之前创建的Screen会话。</p>
<h1 id="screen%E5%A2%9E%E5%BC%BA" tabindex="-1">Screen增强</h1>
<p>Screen会话默认无法通过鼠标滚轮上下翻页，可以在用户根目录执行<code>echo 'termcapinfo xterm* ti@:te@' &gt;&gt; ~/.screenrc</code>，重启VPS，再次进入后即可上下翻页。</p>
<h1 id="%E4%BD%BF%E7%94%A8%E9%97%AE%E9%A2%98" tabindex="-1">使用问题</h1>
<p><s>当在Screen中使用<code>sudo su</code>切换到root用户，再切换到原来的用户，此时SSH终端会闪烁，因此需要在执行<code>sudo su</code>前，先按组合键<code>Ctrl + a</code>保存Screen会话，接着按<code>d</code>退出Screen。</s><br />
现在可以通过<code>sudo su</code>切换为Root账户，再执行<code>exit</code>退出Root账户回到普通账户，不要用<code>su 用户名</code>要用<code>exit</code>。</p>
<h1 id="%E5%8F%82%E8%80%83" tabindex="-1">参考</h1>
<p><a href="https://hzbk.net/archives/121076.html" target="_blank">让 Linux screen 提供的 “终端” 支持鼠标滚动</a></p>
]]></description>
           <pubDate>Sun, 03 Mar 2024 15:34:22 GMT</pubDate>
                </item>
         
              <item>
            <title><![CDATA[在容器中运行flyctl]]></title>
               <link>https://www.itansuo.info/archives/zai-rong-qi-zhong-yun-xing-flyctl</link>
                    <description><![CDATA[<p>自Heroku不在免费后，我一直在寻找其他免费的Pass，直至找到<code>Fly.io</code>。<code> Fly.io</code>的免费套餐足够我使用。要使用<code>Fly.io</code>就要安装flyctl，flyctl安装脚本官网有，但我不想在我的VPS上安装，因为这样迁移不方便，我一直都在将使用服务全部替换为Docker运行，因此打起了在容器中安装flyctl的想法。我在GitHub创建了制作flyctl镜像的仓库，通过这种方式极大方便了我在不同VPS之间的迁移。</p>
<h2 id="%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E" tabindex="-1">使用说明</h2>
<p>GitHub仓库地址：<a href="https://github.com/aaro-n/docker-flyctl" target="_blank">docker-flyctl</a><br />
Docker Hub：<a href="https://hub.docker.com/r/aaronlee/flyctl" target="_blank">aaronlee/flyctl</a></p>
<h3 id="%E8%BF%90%E8%A1%8C%E6%96%B9%E5%BC%8F" tabindex="-1">运行方式</h3>
<p>推荐使用Docker Compose运行flyctl镜像，因为这涉及到文件映射，使用Docker Compose比较方便。<br />
具体方法：在同<code>fly.toml</code>文件夹下，创建<code>docker-compose.yml</code>文件，文件内容如下（方法1）：</p>
<pre><code class="language-">version: &#39;3&#39;
services:
  flyctl:
    image: aaronlee/flyctl:latest
    container_name: flyctl
    restart: always
    volumes:
      - ./config.toml:/root/.fly/config.yml
      # 注意是一个点
      - ./:/home/www
</code></pre>
<p>在本文件夹下运行<code>docker-compose run --rm flyctl flyctl命令</code>，例如<code>docker-compose run --rm flyctl flyctl auth login</code>登录，<code>docker-compose run --rm flyctl flyctl launch</code>创建应用，<code>docker-compose run --rm flyctl flyctl deploy</code>部署应用，总之，是<code>docker-compose run --rm flyctl</code>+<code>flyctl 命令</code>。</p>
<h3 id="%E6%96%87%E4%BB%B6%E7%A4%BA%E4%BE%8B" tabindex="-1">文件示例</h3>
<pre><code class="language-">RSSHub
├─ Dockerfile
├─ fly.toml
├─ docker-compose.yml
└─ config.toml
</code></pre>
<h2 id="%E5%8F%96%E4%BB%A3%E7%B3%BB%E7%BB%9F-flyctl%E5%91%BD%E4%BB%A4%EF%BC%88%E6%8E%A8%E8%8D%90%EF%BC%89" tabindex="-1">取代系统 flyctl命令（推荐）</h2>
<p>尽管<code>docker-compose run --rm flyctl</code>+<code>flyctl 命令</code>已经可以在容器中运行flyctl，但命令长并且难记，有无更简单的方法？有。<br />
在同<code>fly.toml</code>文件夹下，通过<code>mkdir .flyctl</code>创建隐藏文件夹<code>.flyctl</code>，<code>cd .flyctl</code>进入隐藏文件，创建<code>docker-compose.yml</code>文件，内容如下（方法2）：</p>
<pre><code class="language-">version: &#39;3&#39;
services:
  flyctl:
    image: aaronlee/flyctl:latest
    container_name: flyctl
    restart: always
    volumes:
      - ./config.toml:/root/.fly/config.yml
      #注意是两个点
      - ../:/home/www
</code></pre>
<p>在用户根目录执行<code>vim .bashrc</code>，在<code>.bashrc</code>添加<code> alias dk='docker-compose -f $(pwd)/.flyctl/docker-compose.yml run --rm flyctl'</code>退出编辑并保存，重启VPS，如果配置正常，就可在同<code>fly.toml</code>文件夹下通过<code>dk</code>调用容器里的<code>flyctl</code>,例如<code>dk flyctl auth login</code>登录，<code>dk flyctl launch</code>创建应用，<code>dk flyctl deploy</code>部署应用，总之，是<code>dk</code>+<code>flyctl 命令</code></p>
<h3 id="%E6%96%87%E4%BB%B6%E7%A4%BA%E4%BE%8B-1" tabindex="-1">文件示例</h3>
<pre><code class="language-">RSSHub
├─ Dockerfile
├─ fly.toml
└─ .flyctl
   ├─ docker-compose.yml
   └─ config.toml
</code></pre>
<h2 id="%E5%91%BD%E5%90%8D%E6%AF%94%E8%BE%83" tabindex="-1">命名比较</h2>
<table>
<thead>
<tr>
<th>原始命令</th>
<th>方法1</th>
<th>方法2</th>
</tr>
</thead>
<tbody>
<tr>
<td>flyctl launch</td>
<td>docker-compose run --rm flyctl flyctl launch</td>
<td>dk flyctl launch</td>
</tr>
<tr>
<td>flyctl deploy</td>
<td>docker-compose run --rm flyctl flyctl deploy</td>
<td>dk flyctl deploy</td>
</tr>
</tbody>
</table>
]]></description>
           <pubDate>Sat, 02 Mar 2024 17:27:36 GMT</pubDate>
                </item>
         
              <item>
            <title><![CDATA[Cloudflare关闭IPV6]]></title>
               <link>https://www.itansuo.info/archives/cloudflare-guan-bi-ipv6</link>
                    <description><![CDATA[<h1 id="%E5%89%8D%E6%8F%90%E6%9D%A1%E4%BB%B6" tabindex="-1">前提条件</h1>
<p>Cloudflare 域名区域 ID，可以在<code>域名</code>-<code>概况</code>下获取。<br />
Cloudflare 邮箱<br />
Cloudflare Global API Key，在<code>我的个人资料</code>-<code>API令牌</code>中获得。</p>
<h1 id="%E6%89%A7%E8%A1%8C%E4%BB%A3%E7%A0%81" tabindex="-1">执行代码</h1>
<pre><code class="language-">curl --request PATCH \
  --url https://api.cloudflare.com/client/v4/zones/区域 ID/settings/ipv6 \
  --header &#39;X-Auth-Email: Cloudflare邮箱&#39; \
  --header &#39;X-Auth-Key: Cloudflare Global API Key&#39; \
  --header &#39;Content-Type: application/json&#39; \
  --data &#39;{
  &quot;value&quot;: &quot;off&quot;
}&#39;
</code></pre>
<h1 id="%E5%8F%82%E8%80%83" tabindex="-1">参考</h1>
<p><a href="https://0x.pub/a/3856.html" target="_blank">关闭 Cloudflare 的 IPv6 自动解析</a><br />
<a href="https://developers.cloudflare.com/api/operations/zone-settings-change-i-pv6-setting" target="_blank">Change IPv6 setting</a></p>
]]></description>
           <pubDate>Wed, 28 Feb 2024 17:23:04 GMT</pubDate>
                </item>
         
              <item>
            <title><![CDATA[将博客平台切换到Sonic]]></title>
               <link>https://www.itansuo.info/archives/jiang-bo-ke-ping-tai-qie-huan-dao-sonic</link>
                    <description><![CDATA[<h1 id="%E4%BB%8B%E7%BB%8D" tabindex="-1">介绍</h1>
<p>我大概在17开始写博客，当时使用的是Wordpress，之后换过Hexo，短暂用过Typecho和Gost，又换为ClassicPress，最后换为Sonic。</p>
<h1 id="%E6%88%91%E5%AF%B9%E5%8D%9A%E5%AE%A2%E5%B9%B3%E5%8F%B0%E7%9A%84%E8%A6%81%E6%B1%82" tabindex="-1">我对博客平台的要求</h1>
<p>1.尽可能对硬件要求低，这样使用saas的免费套餐就可运行起来。<br />
2.运行速度快，网页加载快。<br />
3.迁移方便。<br />
希望Sonic是我最后的CMS平台。</p>
]]></description>
           <pubDate>Wed, 28 Feb 2024 07:30:19 GMT</pubDate>
                </item>
         
              <item>
            <title><![CDATA[扫描局域网所有可 Ping IP]]></title>
               <link>https://www.itansuo.info/archives/sao-miao-ju-yu-wang-suo-you-ke-pingip</link>
                    <description><![CDATA[<h1 id="%E4%B8%BA%E4%BB%80%E4%B9%88%EF%BC%9F" tabindex="-1">为什么？</h1>
<p>最近半年购买了 TL-WDA6332RE 和TL-WDR7632两个WI-FI扩展器，管理界面都是连上WI-FI后访问<code>http://tplogin.cn/</code>，这个网址在简单网络环境下还可用，在复杂环境下，就无法访问管理界面，需要通过分配IP访问，可是在不同网络环境，分配的IP是不同的，就需要手动查找管理IP地址。</p>
<!--more-->
<h1 id="%E5%BF%AB%E9%80%9F%E6%9F%A5%E6%89%BE%E5%B1%80%E5%9F%9F%E7%BD%91%E5%B7%B2%E5%88%86%E9%85%8D%E7%9A%84ip" tabindex="-1">快速查找局域网已分配的IP</h1>
<p>手动Ping局域网所有IP太麻烦，通过GPT创建批量Ping脚本，检查局域网里所有IP，查找哪些IP是可以Ping通的，并单独列出。将单独列出的IP一个一个在浏览器打开就行。<br />
已经在GitHub将脚本上传到仓库里，脚本链接：<a href="https://raw.githubusercontent.com/aaro-n/script/main/ping-sweep/windows.bat" target="_blank">Windows</a>，<a href="https://raw.githubusercontent.com/aaro-n/script/main/ping-sweep/linux.sh" target="_blank">Linux</a>，<a href="https://raw.githubusercontent.com/aaro-n/script/main/ping-sweep/macos.sh" target="_blank">macOS</a>。浏览器打开连接，选择<code>另存为</code>，保存到本地。<br />
Windows 打开CMD，将脚本拖入到CMD中，回车执行，按照文字说明，输入本机IP，回车，就会扫描局域网所有可Ping IP。<br />
Linux和macOS需要先赋予脚本执行权限，再运行脚本，先打开终端，先输入<code>chmod +x </code>，接着将脚本拖入终端，回车，这是赋予脚本执行权限，再次将将脚本拖入终端执行，按照说明输入本机IP，接着就可以扫描局域网IP。</p>
<h1 id="%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9" tabindex="-1">注意事项</h1>
<p>1.如果你的网络类型是<code>源WI-FI（192.168.0.1）-&gt;WI-FI扩展器-&gt;主WI-FI（192.168.50.1）-&gt;本地IP（192.168.50.11）</code>，你输入的IP地址应该是主Wi-Fi获取的IP地址即<code>192.168.0.X</code>，而不是<code>192.168.50.11</code><br />
2.Windows脚本一定要下载或另存为，如果是复制保存，可能因为换行符不同，导致无法执行。</p>
]]></description>
           <pubDate>Tue, 13 Feb 2024 11:30:46 GMT</pubDate>
                </item>
         
              <item>
            <title><![CDATA[甲骨文VPS DD Debian及为VPS添加IPV6]]></title>
               <link>https://www.itansuo.info/archives/jia-gu-wen-vpsdddebian-ji-wei-vps-tian-jia-ipv6</link>
                    <description><![CDATA[<p>免责声明：阅读本文并操作自己的甲骨文VPS请做好备份，并做无法连接甲骨文VPS的准备。</p>
<h1 id="ubuntu-dd-debian" tabindex="-1">Ubuntu DD Debian</h1>
<p>参考文档：<a href="https://www.idonglei.com/post/49.html" target="_blank">甲骨文DD重装系统，甲骨文DD Debian 9/10/11或Windows详细教程汇总</a>，<a href="https://web.archive.org/web/20240120031022/https://www.idonglei.com/post/49.html" target="_blank">存档</a><br />
1.首先创建甲骨文VPS并连接，系统镜像选择 <strong>Canonical Ubuntu 22.04 Minimal</strong> 。<br />
2.进行DD前的系统环境准备，<code>sudo apt-get update &amp;&amp; sudo apt-get install -y xz-utils openssl gawk file wget curl</code></p>
<!--more-->
<p>3.切换到Root用户 <code>sudo su</code>，下载DD脚本并进行DD，<code>bash (wget --no-check-certificate -qO 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh') -d 11 -v 64 -a -firmware</code><br />
4.步骤3 DD的是Debian 11，SSH用户名为:<code>root</code>，SSH登录密码为:<code>MoeClub.org</code>，默认SSH端口为22。<br />
5.打开<code>https://tcp.ping.pe/</code>，输入<code>IP:22</code>，测试DD情况，当DD正常后，测试会显示绿色。<br />
6.同过SSH登录DD的Debian 11，执行<code>cat /etc/network/interfaces</code>，获取网络接口信息。例如</p>
<pre><code class="language-">www@debian:~$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug ens3
iface ens3 inet static
address 10.0.0.243/24
gateway 10.0.0.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 8.8.8.8
dns-search debian
</code></pre>
<p>其中<code>allow-hotplug ens3</code>的<code>ens3</code>就是这个VPS的网络接口，甲骨文VPS的是不相同的，这个要留意。<br />
7.将Debian 11升级Debian12，教程：<a href="https://u.sb/debian-upgrade-12/" target="_blank">Debian 11 Bullseye 升级 Debian 12 Bookworm</a>，甲骨文VPS现阶段不可直接DD Debian12，需要先DD Debian11接着升级成Debian12 。整体流程如下：<br />
<strong>Ubuntu 22/Debian 12/Debian 11–&gt;DD Debian 11–&gt;系统升级成Debian12</strong></p>
<h1 id="vps%E8%8E%B7%E5%8F%96ipv6" tabindex="-1">VPS获取IPV6</h1>
<p>1.先按照教程在甲骨文网页上为VPS分配IPV6，教程：<a href="https://blog.misaka.rest/2023/02/10/oci-ipv6/" target="_blank">Oracle Cloud （甲骨文云）为实例启用IPv6网络</a>，按照教程可能无法分配IPV6，可以看下方的评论。<br />
2.通过“Ubuntu DD Debian”步骤6获取网络接口信息，按照教程：<a href="https://20122012.xyz/index.php/archives/168/" target="_blank">甲骨文vps dd 的纯净 debian11 系统如何开启 ipv6</a>，根据自己的实际情况修改脚本信息，例如步骤6获取的接口信息为<code>ens3</code>，而脚本中为<code>enp0s3</code>，修改脚本如下：修改前<code>Name=enp0s3</code>修改后<code>Name=ens3</code><br />
3.执行命令重启网络，将会自动获取IPV6，即使VPS重启也可以获取IPV6，<code>sudo systemctl enable systemd-networkd &amp;&amp; sudo systemctl restart systemd-networkd &amp;&amp; sudo systemctl status systemd-networkd</code><br />
4.<code>curl -4 ip.p3terx.com</code>，测试IPV4，<code>curl -6 ip.p3terx.com</code>，测试IPV6.<br />
5.所有链接都已在Internet Archive存档</p>
]]></description>
           <pubDate>Sat, 20 Jan 2024 12:09:07 GMT</pubDate>
                </item>
         
              <item>
            <title><![CDATA[PandoraNext Pool Token自动更新]]></title>
               <link>https://www.itansuo.info/archives/pandoranextpooltoken-zi-dong-geng-xin</link>
                    <description><![CDATA[<p>因<strong>PandoraNext</strong>被项目放弃，本文作废。</p>
<p>最近半年经常通过API方式使用ChatGPT，ChatGPT好用是好用，但这是以我干瘪的钱包为代价。前几天，不良林大佬介绍了PandoraNext项目，很符合我免费使用ChatGPT的要求，只是在更新PandoraNext Pool Token时要在VPS上进行，但我想用GitHub Actions进行PandoraNext Pool Token更新。这是我倒腾的成果，希望不会是滥用GitHub Actions。</p>
<!--more-->
<h1 id="%E6%95%99%E7%A8%8B" tabindex="-1">教程</h1>
<p>前期准备，不良林大佬的<a href="https://www.youtube.com/watch?v=IXA6IJY6ZW8" target="_blank">视频</a>、<a href="https://bulianglin.com/archives/pandora.html" target="_blank">文档</a>、<a href="https://github.com/pandora-next/deploy" target="_blank">PandoraNext 项目</a>，请详细多次观看阅读这三项，接下来的内容都是假设已经理解不良林大佬的视频和文档，并且成功运行Proxy模式。</p>
<h2 id="%E5%87%86%E5%A4%87" tabindex="-1">准备</h2>
<p>1.赋予GitHub Actions读写项目权限。在GitHub上创建私人项目，在刚刚创建的私人项目中点击<code>Settings</code>–&gt;点击<code>Actions</code>下的<code>General</code>–&gt;找到<code>Workflow permissions</code>，选中<code>Read and write permissions</code>并保存。<br />
2.修改运行脚本pandora-get-token.py如下：</p>
<pre><code class="language-auto">import sys
import requests
import os
import json
import time

# 使用环境变量中的POOL_TOKEN和API_ENDPOINT
pool_token = os.environ.get(&quot;POOL_TOKEN&quot;)
api_endpoint = os.environ.get(&quot;API_ENDPOINT&quot;)

users_file = &quot;users.txt&quot;
session_tokens_file = &quot;session_tokens.txt&quot;
tokens_file = &quot;tokens.txt&quot;
... ...
 
</code></pre>
<p>3.设置环境变量。环境变量有两个，分别是<code>API_ENDPOINT</code>（必须设置）和<code>POOL_TOKEN</code>。<br />
4.创建<code>session\_tokens.txt</code>文件并写入内容。<br />
5.创建GitHub Actions脚本。文件位置为<code>.github/workflows/get-token.yml</code></p>
<pre><code class="language-auto">name: 获取 Pandora 令牌

on:
  push:
    branches:
      - main  # 根据你的实际分支设置
  schedule:
    - cron: &quot;20 1 */8 * *&quot; #根据自己的实际需求调整

jobs:
  get_token:
    runs-on: ubuntu-latest

    env:
      API_ENDPOINT: ${{ secrets.API_ENDPOINT }}
      POOL_TOKEN: ${{ secrets.POOL_TOKEN }}

    steps:
    - name: 检出仓库
      uses: actions/checkout@v2

    - name: 配置 Python 环境
      uses: actions/setup-python@v2
      with:
        python-version: 3.9  # 选择你的 Python 版本

    - name: 安装依赖
      run: |
        python3 -m pip install --upgrade pip
        pip install requests

    - name: 从GitHub中获取所需要的环境变量
      run: |
        echo &quot;API_ENDPOINT=${{ secrets.API_ENDPOINT }}&quot; &gt;&gt; $GITHUB_ENV
        echo &quot;POOL_TOKEN=${{ secrets.POOL_TOKEN }}&quot; &gt;&gt; $GITHUB_ENV

    - name: 运行10秒 pandora-get-token.py
      run: |
        timeout 10 python3 pandora-get-token.py || echo &quot;运行 pandora-get-token.py 时间到。退出码: $?&quot; 

    - name: 提交并推送更改，包含北京时间
      run: |
        git config --global user.email &quot;actions@github.com&quot;
        git config --global user.name &quot;GitHub Actions&quot;

        current_time=$(TZ=&#39;Asia/Shanghai&#39; date &quot;+%Y-%m-%d %H:%M:%S&quot;)
        git add .
        git commit -m &quot;更新令牌 - 北京时间: $current_time&quot;
        git push -u origin main
 
</code></pre>
<h2 id="%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9" tabindex="-1">注意事项</h2>
<p><code>API_ENDPOINT</code>链接在GitHub Actions时不要用CF代理，因为CF会拦截GitHub Actions。</p>
]]></description>
           <pubDate>Sat, 16 Dec 2023 20:47:18 GMT</pubDate>
                </item>
         
              <item>
            <title><![CDATA[MIUI EU进行版本更新]]></title>
               <link>https://www.itansuo.info/archives/miuieu-jin-xing-ban-ben-geng-xin</link>
                    <description><![CDATA[<p>我7月份购买一台小米12S Pro并且刷了MIUI EU，前几天看到MIUI EU论坛上已经有新版本，下载新版本并成功更新手机系统，以下是记录。</p>
<h1 id="%E9%97%AE%E9%A2%98" tabindex="-1">问题</h1>
<p>因为MIUI EU是以国内系统为基础上修改的，无法进行OTA更新，同时现阶段并没有小米12S PRO可用的TWRP，并且我通过Magisk获取手机Root权限，以上这些决定了正常使用没问题，但一旦升级系统可能造成手机变砖，手机资料全部丢失。 自己又研究了下，同时看了其他人的刷机升级记录，最终进行升级系统。 这个系统升级出问题的概率不大，但还是推荐备份手机里的重要文件，特别是微信聊天记录。</p>
<!--more-->
<h1 id="%E5%8D%87%E7%BA%A7%E7%B3%BB%E7%BB%9F" tabindex="-1">升级系统</h1>
<p><strong>升级MIUI EU系统会丢失Root权限，要在系统升级后重新获取。</strong><br />
1.进行系统重要资料备份。<br />
2.通过MIUI EU下载适合自己手机的系统更新包，现阶段要通过电脑进行更新系统。<br />
3.手机进入Fatsboot模式，同时通过连接线连接电脑，运行系统更新脚本。<br />
4.刷机成功，开机进入系统，打开Magisk，进行boot.img文件修补，重新传回电脑。<br />
5.再次进入Fatsboot模式，向手机刷入修补的boot.img。</p>
<h1 id="%E7%BB%93%E6%9D%9F%E8%AF%AD" tabindex="-1">结束语</h1>
<p>经过这次实践，进行系统升级很顺畅，我今后因该会紧跟版本更新。</p>
<h1 id="%E5%8F%82%E8%80%83" tabindex="-1">参考</h1>
<ul>
<li><a href="https://magiskcn.com/?ref=adb-fastboot" target="_blank">小米手机安装面具教程（Xiaomi手机获取root权限）</a></li>
</ul>
]]></description>
           <pubDate>Sun, 29 Oct 2023 06:07:59 GMT</pubDate>
                </item>
         
              <item>
            <title><![CDATA[拯救nPlayer]]></title>
               <link>https://www.itansuo.info/archives/zheng-jiu-nplayer</link>
                    <description><![CDATA[<h1 id="%E8%B5%B7%E5%9B%A0" tabindex="-1">起因</h1>
<p>博主使用多个OneDrive账户存储一些视频，使用Cloudreve管理OneDrive上的视频，并且在Cloudreve上开启Webdav作为播放源，博主寻找很多Webdav播放器找到nPlayer最符合博主的要求，所以博主购买了iOS、Android、macOS三个平台上的nPlayer，一直用着好好的直到最近nPlayer更新，发现nPlayer最新版的Webdav无法播放Cloudreve上的视频，需要切换旧版。</p>
<!--more-->
<h1 id="%E8%A7%A3%E5%86%B3" tabindex="-1">解决</h1>
<h2 id="%E8%A6%81%E6%B1%82" tabindex="-1">要求</h2>
<p>因为博主每个平台都有nPlayer备份，将备份nPlayer重新安装，可以正常使用Webdav，但应用商店会提示要进行更新，博主不想更新，并且不想要应用商店检测新版本。</p>
<h2 id="%E8%A7%A3%E5%86%B3-1" tabindex="-1">解决</h2>
<p>博主研究后，进行以下操作可以避免应用商店检测更新：</p>
<table>
<thead>
<tr>
<th>平台​</th>
<th>应用商店</th>
<th>阻止更新检测方式</th>
</tr>
</thead>
<tbody>
<tr>
<td>Android</td>
<td>Google Play</td>
<td>修改应用签名</td>
</tr>
<tr>
<td>iOS</td>
<td>iOS App Store</td>
<td>删除应用中的文件</td>
</tr>
<tr>
<td>macOS</td>
<td>macOS App Store</td>
<td>删除应用中的文件</td>
</tr>
</tbody>
</table>
]]></description>
           <pubDate>Tue, 03 Oct 2023 20:49:04 GMT</pubDate>
                </item>
         
              <item>
            <title><![CDATA[排查反代OneDrive问题]]></title>
               <link>https://www.itansuo.info/archives/pai-cha-fan-dai-onedrive-wen-ti</link>
                    <description><![CDATA[<h1 id="%E4%BB%8B%E7%BB%8D" tabindex="-1">介绍</h1>
<p>博主使用Cloudreve创建Webdav账户，后端使用OneDrive作为文件存储源，因为OneDrive国际版国内访问速度慢，所以购买香港腾讯云轻量使用Nginx进行反向代理。在使用过程中发现严重问题：在Cloudreve下载OneDrive里的文件，头一两次浏览器还能弹出下载对话框，之后要等10~20秒才能再次弹出下载对话框；使用Webdav访问OneDrive里的文件，经常出现打开超时，无法播放，严重影响使用体验。</p>
<!--more-->
<h1 id="%E6%8E%92%E6%9F%A5" tabindex="-1">排查</h1>
<ul>
<li>Cloudreve所处的机器性能太差，造成下载或Webdav访问缓慢。 Cloudreve部署在Fly.io上，将Cloudreve重新部署在甲骨文VPS上，同时使用香港腾讯云轻量作为OneDrive访问代理，在导入文件后，下载测试。还是出现多次下载后，下载缓慢现象。</li>
<li>OneDrive API访问受到限制。 Cloudreve使用OneDrive API访问OneDrive里的文件，OneDrive API受到限制也有可能造成这种现象。关闭香港腾讯云轻量代理，重新下载OneDrive文件，神奇的事情发生了，无论怎么测试，Cloudreve都可以快速打开浏览器下载界面，并且部署在Fly.io的Cloudreve关闭OneDrive代理后，也可以做到选择下载文件浏览器及时弹出界面。是香港腾讯云轻量的问题，虽然找到问题，但OneDrive直接访问速度非常缓慢。</li>
<li>使用搬瓦工CN2（DC3）作为OneDrive代理 手头正好有台搬瓦工CN2 VPS，安装Nginx并配置后，再在Cloudreve设置代理，在Cloudreve里下载OneDrive文件可以非常容易弹出下载界面。</li>
</ul>
<h1 id="%E7%BB%93%E8%AE%BA" tabindex="-1">结论</h1>
<p>在网上查找香港腾讯云轻量线路变化情况，结合自己的使用体验，香港腾讯云轻量应该是做了网络限制，当访流量达到一定程度，直接限制访问。</p>
]]></description>
           <pubDate>Mon, 24 Jul 2023 10:00:45 GMT</pubDate>
                </item>
         
        
    </channel>
</rss>
