<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Eddy 的日思与夜写</title>
        <link>https://letgo.cc</link>
        <description>想要提前退休，想要环游世界</description>
        <atom:link href="https://letgo.cc/rss.html" rel="self" />
        <atom:link href="https://letgocc.superfeedr.com/" rel="hub" />
        <language>zh-CN</language>
        <lastBuildDate>Mon, 06 Apr 2026 11:14:50 +0800</lastBuildDate>
        
        <item>
            <title>Linux下多架构编译推送镜像</title>
            <link>https://letgo.cc/post/linux-multiarch-image.html</link>
            <comments>https://letgo.cc/post/linux-multiarch-image.html#comments</comments>
            <guid>https://letgo.cc/post/linux-multiarch-image.html</guid>
            <description>
                <![CDATA[
<h3 id="toc_0">安装buildx</h3>

<p>从 <code>https://github.com/docker/buildx/releases</code> 下载buildx，并重命名后放在 <code>/usr/lib/docker/cli-plugins/docker-buildx</code>，记得 <code>chmod +x</code> 赋予执行权限</p>

<h3 id="toc_1">安装 buildkit</h3>

<p>从 <code>docker.cnb.cool/an1ai/public-docker-image/buildkit:buildx-stable-1</code> 下载并重新 tag 为 <code>moby/buildkit:buildx-stable-1</code></p>

<pre><code>IMAGE_LATEST=&quot;docker.cnb.cool/an1ai/public-docker-image/smart-socket-mp:latest&quot;
IMAGE_VERSIONED=&quot;docker.cnb.cool/an1ai/public-docker-image/smart-socket-mp:0.0.1&quot;

docker login &quot;$REGISTRY&quot; -u cnb -p 1p17cf
docker buildx create --name &quot;multiarch-builder&quot; --driver docker-container --use
docker buildx use &quot;multiarch-builder&quot;

docker buildx inspect --bootstrap
docker buildx build \
    --platform linux/amd64,linux/arm64 \
    -t &quot;$IMAGE_LATEST&quot; \
    -t &quot;$IMAGE_VERSIONED&quot; \
    --push \
    .
</code></pre>
<p>本文链接：<a href="https://letgo.cc/post/linux-multiarch-image.html">https://letgo.cc/post/linux-multiarch-image.html</a>，<a href="https://letgo.cc/post/linux-multiarch-image.html#comments">参与评论 »</a></p>]]>
            </description>
            <pubDate>Fri, 16 Jan 2026 12:05:00 +0800</pubDate>
        </item>
        
        <item>
            <title>Caddy 二进制安装方式</title>
            <link>https://letgo.cc/post/caddy-bin-install.html</link>
            <comments>https://letgo.cc/post/caddy-bin-install.html#comments</comments>
            <guid>https://letgo.cc/post/caddy-bin-install.html</guid>
            <description>
                <![CDATA[
<p>下载文件：
<code>wget -O caddy &quot;https://caddyserver.com/api/download?os=linux&amp;arch=amd64&quot;</code>
<!--more-->
移动到bin目录</p>

<pre><code>sudo chmod a+x caddy
sudo mv caddy /usr/local/bin/
</code></pre>

<p>添加用户和组</p>

<pre><code>sudo groupadd --system caddy
sudo useradd --system --gid caddy --create-home --home-dir /var/lib/caddy --shell /usr/sbin/nologin --comment &quot;Caddy web server&quot; caddy
</code></pre>

<p>创建服务：<code>/etc/systemd/system/caddy.servic</code></p>

<pre><code>[Unit]
Description=Caddy web server
After=network.target
 
[Service]
User=caddy
Group=caddy
ExecStart=/usr/local/bin/caddy run --environ --config /etc/caddy/Caddyfile
ExecReload=/usr/local/bin/caddy reload --config /etc/caddy/Caddyfile
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_BIND_SERVICE
 
[Install]
WantedBy=multi-user.target

</code></pre>

<p>启动指令</p>

<pre><code>sudo systemctl daemon-reload
sudo systemctl enable caddy
sudo systemctl start caddy
sudo systemctl status caddy
</code></pre>
<p>本文链接：<a href="https://letgo.cc/post/caddy-bin-install.html">https://letgo.cc/post/caddy-bin-install.html</a>，<a href="https://letgo.cc/post/caddy-bin-install.html#comments">参与评论 »</a></p>]]>
            </description>
            <pubDate>Wed, 30 Apr 2025 11:15:00 +0800</pubDate>
        </item>
        
        <item>
            <title>离线安装雷池</title>
            <link>https://letgo.cc/post/safeline.html</link>
            <comments>https://letgo.cc/post/safeline.html#comments</comments>
            <guid>https://letgo.cc/post/safeline.html</guid>
            <description>
                <![CDATA[
<p>内网服务器离线安装雷池教程
<!--more--></p>

<h3 id="toc_0">下载</h3>

<p>下载镜像 <a href="https://demo.waf-ce.chaitin.cn/image.tar.gz" rel="nofollow">雷池镜像</a>
加载镜像</p>

<pre><code>cat image.tar.gz | gzip -d | docker load
</code></pre>

<h3 id="toc_1">安装</h3>

<p>创建安装目录</p>

<pre><code>mkdir -p &quot;/data/safeline&quot;
</code></pre>

<p>使用下方的命令进入雷池安装目录，并下载 docker compose 编排脚本</p>

<pre><code>cd &quot;/data/safeline&quot;
wget &quot;https://waf-ce.chaitin.cn/release/latest/compose.yaml&quot;
</code></pre>

<p>使用下方的命令进入雷池安装目录，并创建 .env 配置文件</p>

<pre><code>cd &quot;/data/safeline&quot;
touch &quot;.env&quot;
</code></pre>

<p>使用文本编辑器打开 .env 文件，写入下方的内容</p>

<pre><code>SAFELINE_DIR=/data/safeline
IMAGE_TAG=latest
MGT_PORT=9443
POSTGRES_PASSWORD=yourpassword
SUBNET_PREFIX=172.22.222
IMAGE_PREFIX=swr.cn-east-3.myhuaweicloud.com/chaitin-safeline
ARCH_SUFFIX=
RELEASE=
REGION=
</code></pre>

<p>如果是 ARM 服务器需要把 ARCH_SUFFIX改成 -arm</p>

<pre><code>ARCH_SUFFIX=-arm
</code></pre>

<p>如果是安装 LTS 版本需要把 RELEASE 改成 -lts</p>

<pre><code>RELEASE=-lts
</code></pre>

<p><strong>配置文件的格式说明如下</strong>：</p>

<ul>
<li>SAFELINE_DIR: 雷池安装目录，如 /data/safeline</li>
<li>IMAGE_TAG: 要安装的雷池版本，保持默认的 latest 即可</li>
<li>MGT_PORT: 雷池控制台的端口，保持默认的 9443 即可</li>
<li>POSTGRES_PASSWORD: 雷池所需数据库的初始化密码，请随机生成一个</li>
<li>SUBNET_PREFIX: 雷池内部网络的网段，保持默认的 172.22.222 即可</li>
<li>IMAGE_PREFIX: 雷池镜像源的前缀，建议根据服务器地理位置选择合适的源</li>
<li>ARCH_SUFFIX: 雷池架构的后缀，ARM 服务器需要配置为 -arm</li>
<li>RELEASE: 更新通道，LTS 版本需要配置为 -lts</li>
</ul>

<h3 id="toc_2">启动雷池</h3>

<p>现在万事具备，使用以下命令启动雷池服务</p>

<pre><code>cd &quot;/data/safeline&quot;
docker compose up -d
</code></pre>

<p>打开浏览器，访问：<code>https://&lt;safeline-ip&gt;:9443/</code>
如果没有找到账户密码，手动执行以下命令即可</p>

<pre><code>docker exec safeline-mgt resetadmin
</code></pre>
<p>本文链接：<a href="https://letgo.cc/post/safeline.html">https://letgo.cc/post/safeline.html</a>，<a href="https://letgo.cc/post/safeline.html#comments">参与评论 »</a></p>]]>
            </description>
            <pubDate>Thu, 13 Mar 2025 11:19:00 +0800</pubDate>
        </item>
        
        <item>
            <title>debian 服务器 Docker 安装</title>
            <link>https://letgo.cc/post/debian-init.html</link>
            <comments>https://letgo.cc/post/debian-init.html#comments</comments>
            <guid>https://letgo.cc/post/debian-init.html</guid>
            <description>
                <![CDATA[
<p>新购阿里云服务器（debian 12.7）如何初始化安装docker，一步一步记录下来，以后直接复制即可。</p>

<!--more-->

<h3 id="toc_0">初始化</h3>

<pre><code>sudo apt update
sudo apt upgrade
</code></pre>

<h3 id="toc_1">安装 Docker</h3>

<p>安装必要的软件包</p>

<pre><code>sudo apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common
</code></pre>

<p>添加Docker的官方GPG密钥</p>

<pre><code>curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
</code></pre>

<p>设置Docker的稳定仓库</p>

<pre><code>sudo add-apt-repository &quot;deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable&quot;
</code></pre>

<p>再次更新软件包索引</p>

<pre><code>sudo apt-get update
</code></pre>

<p>安装Docker CE（社区版）</p>

<pre><code>sudo apt-get install docker-ce docker-ce-cli containerd.io
</code></pre>

<h3 id="toc_2">修改 Docker 配置</h3>

<p>阿里云容器的网络会与阿里云内网网段冲突，例如都是 172.17 开头，所以修改默认网段为 172.20.<em>.</em>,同时把docker数据目录修改为 <code>/data/docker</code></p>

<p>修改 <code>/etc/docker/daemon.json</code></p>

<pre><code>{ 
  &quot;bip&quot;:&quot;172.20.0.1/24&quot;,
  &quot;data-root&quot;:&quot;/data/docker&quot;
}
</code></pre>

<p>重启 docker</p>

<pre><code>sudo systemctl restart docker
</code></pre>
<p>本文链接：<a href="https://letgo.cc/post/debian-init.html">https://letgo.cc/post/debian-init.html</a>，<a href="https://letgo.cc/post/debian-init.html#comments">参与评论 »</a></p>]]>
            </description>
            <pubDate>Mon, 11 Nov 2024 16:47:00 +0800</pubDate>
        </item>
        
        <item>
            <title>Markdown 项目文档工具 MkDocs 用 mkdocs-material 的 Docker容器 部署发布</title>
            <link>https://letgo.cc/post/mkdocs.html</link>
            <comments>https://letgo.cc/post/mkdocs.html#comments</comments>
            <guid>https://letgo.cc/post/mkdocs.html</guid>
            <description>
                <![CDATA[
<p>项目文档一直找不到合适的工具，今天看到MkDocs能生成静态文件，也能中文搜索，很不错，就决定用它了。</p>

<p>因为 MkDocs 需要用 pip 进行安装，我太懒了，不想装，就直接使用 docker 了</p>

<!--more-->

<h3 id="toc_0">下载镜像</h3>

<pre><code>docker pull squidfunk/mkdocs-material
</code></pre>

<p>众所周知的原因，如果你不能直接下载镜像，就到 GitHub fork 这个项目，它会告诉你如何下载。</p>

<blockquote>
<p>tech-shrimp/docker_image_pusher</p>
</blockquote>

<h3 id="toc_1">创建站点</h3>

<pre><code>sudo docker run --rm -it -v /data/mkdocs/docs:/docs squidfunk/mkdocs-material new .
</code></pre>

<h3 id="toc_2">生成站点</h3>

<pre><code>sudo docker run --rm -it -v /data/mkdocs/docs:/docs squidfunk/mkdocs-material build --site-dir public 
</code></pre>

<h3 id="toc_3">部署到 Nginx</h3>

<p>静态文件都有了，可以自行部署</p>
<p>本文链接：<a href="https://letgo.cc/post/mkdocs.html">https://letgo.cc/post/mkdocs.html</a>，<a href="https://letgo.cc/post/mkdocs.html#comments">参与评论 »</a></p>]]>
            </description>
            <pubDate>Tue, 22 Oct 2024 11:33:00 +0800</pubDate>
        </item>
        
        <item>
            <title>阿里云99元服务器特惠</title>
            <link>https://letgo.cc/post/aliyun-99-server.html</link>
            <comments>https://letgo.cc/post/aliyun-99-server.html#comments</comments>
            <guid>https://letgo.cc/post/aliyun-99-server.html</guid>
            <description>
                <![CDATA[
<p>99元，2核2G,3M带宽，40G硬盘；
199元，2核4G，5M带宽，80G硬盘。<br />
链接在此 <a href="https://www.aliyun.com/benefit/select/ecs" rel="nofollow">https://www.aliyun.com/benefit/select/ecs</a></p>
<p>本文链接：<a href="https://letgo.cc/post/aliyun-99-server.html">https://letgo.cc/post/aliyun-99-server.html</a>，<a href="https://letgo.cc/post/aliyun-99-server.html#comments">参与评论 »</a></p>]]>
            </description>
            <pubDate>Mon, 21 Oct 2024 17:01:00 +0800</pubDate>
        </item>
        
        <item>
            <title>碎碎念 - 职场之不要打我电话</title>
            <link>https://letgo.cc/post/donot-call-me.html</link>
            <comments>https://letgo.cc/post/donot-call-me.html#comments</comments>
            <guid>https://letgo.cc/post/donot-call-me.html</guid>
            <description>
                <![CDATA[
<p>以前觉得客户很难搞，微信不回，电话不接。</p>

<p>后来客户多了，才发现真的不想回。</p>

<p>接了一次电话，他就会有无数次电话。明明在微信上能一句话就讲清楚的问题，非要打个电话。</p>

<p>我不是客服欸！</p>

<p>于是就开始不接电话，有事咱微信聊！</p>

<p>除非很紧急很紧急或者文字表述不出来，再打电话,OK?</p>
<p>本文链接：<a href="https://letgo.cc/post/donot-call-me.html">https://letgo.cc/post/donot-call-me.html</a>，<a href="https://letgo.cc/post/donot-call-me.html#comments">参与评论 »</a></p>]]>
            </description>
            <pubDate>Mon, 14 Oct 2024 16:47:00 +0800</pubDate>
        </item>
        
        <item>
            <title>eiblog - 统计 remark42 评论数量</title>
            <link>https://letgo.cc/post/comments-count-with-remark42.html</link>
            <comments>https://letgo.cc/post/comments-count-with-remark42.html#comments</comments>
            <guid>https://letgo.cc/post/comments-count-with-remark42.html</guid>
            <description>
                <![CDATA[
<p>博客页面上有评论数的显示，原逻辑是调用disqus的api统计数据。remark42也有丰富的<a href="https://remark42.com/docs/contributing/api/" rel="nofollow"> API 文档</a>，其中一个也能统计评论数量：</p>

<ul>
<li>GET /api/v1/count?site=site-id&amp;url=post-url - get comment&rsquo;s count for {url}</li>
</ul>

<p>仿照 cache.go 里面的 timerDisqus 方法新建一个 timerRemark42 即可。</p>

<p>详细代码请看<a href="http://github.com/eddyyuen/eiblogv2" rel="nofollow">我的eiblog</a></p>
<p>本文链接：<a href="https://letgo.cc/post/comments-count-with-remark42.html">https://letgo.cc/post/comments-count-with-remark42.html</a>，<a href="https://letgo.cc/post/comments-count-with-remark42.html#comments">参与评论 »</a></p>]]>
            </description>
            <pubDate>Fri, 11 Oct 2024 15:44:00 +0800</pubDate>
        </item>
        
        <item>
            <title>remark42 评论组件的配置与使用</title>
            <link>https://letgo.cc/post/install-remark42.html</link>
            <comments>https://letgo.cc/post/install-remark42.html#comments</comments>
            <guid>https://letgo.cc/post/install-remark42.html</guid>
            <description>
                <![CDATA[

<p>blog 自带的 Disqus 组件不是很好配置，半天没弄成功，懒得搞了换回以前用过的 remark42。</p>

<h3 id="toc_0">准备</h3>

<p>我用的的 linux 二进制文件安装，使用 systemd 安装成服务。</p>

<h3 id="toc_1">安装</h3>

<ul>
<li>登录 remark42 的 github 地址<a href="https://github.com/umputun/remark42/releases" rel="nofollow">下载文件</a></li>
<li>解压文件放到服务器上，然后创建 /etc/systemd/system/remark42.serice，文件内容如下</li>
</ul>

<!--more-->

<pre><code>[Unit]
Description=remark42
After=syslog.target

[Service]
ExecStart= /var/service/remark42.linux-amd64 --secret=letgocc --url=https://re.letgo.cc  server   --site=letgocc  --anon-vote --votes-ip --admin-passwd=&quot;letgocc&quot; --backup=/data/app/remark42/backup --admin-edit --port=8080  --emoji --auth.anon  --auth.github.cid=xxx --auth.github.csec=xxx

[Install]
WantedBy=multi-user.target
</code></pre>

<ul>
<li>启用 remark42</li>
</ul>

<pre><code>&gt;systemctl enable remark42
&gt;systemctl start remark42
</code></pre>

<ul>
<li>前面我们启用了 Github 登录，这里要按照文档获取 GitHub 的 cid 与 csec，修改 remark42.service 对应字段 <a href="https://remark42.com/docs/configuration/authorization/" rel="nofollow">身份认证配置文档</a>
<img width="867" height="212" src="https://img.letgo.cc/blog/img/20241011113049_bf8abaa3f8724467d8b6142c41df41e.png" alt="GitHub配置" /></li>
</ul>

<h3 id="toc_2">nginx 配置</h3>

<ul>
<li>新建一个站点 re.letgo.cc</li>
</ul>

<pre><code>server {
    listen                       443 ssl;
    server_name                  re.letgo.cc;
    server_tokens                off;
    # 站点证书 + 中间证书, 私钥./etc/nginx/ssl/dhparams.pemssl_trusted_certificate
    ssl_certificate              /etc/nginx/ssl/re.letgo.cc.pem;
    ssl_certificate_key          /etc/nginx/ssl/re.letgo.cc.key;
    ssl_prefer_server_ciphers    on;
    ssl_ciphers                  EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;

    # openssl dhparam -out dhparams.pem 2048
    # https://weakdh.org/sysadmin.html
    ssl_dhparam                  /etc/nginx/ssl/dhparams.pem;

    ssl_protocols                TLSv1.1 TLSv1.2 TLSv1.3;
    ssl_session_cache            shared:SSL:50m;
    ssl_session_timeout          1d;
    ssl_session_tickets          on;

    if ($request_method !~ ^(GET|HEAD|POST|PUT|OPTIONS)$ ) {
        return                   444;
    }
   location ~ /\.git {
        deny all;
    }

    location /index.html {
         proxy_redirect          off;
         proxy_set_header        X-Real-IP $remote_addr;
         proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_set_header        Host $http_host;
         proxy_pass              http://127.0.0.1:8080/web/index.html;
     }

    location / {
         proxy_redirect          off;
         proxy_set_header        X-Real-IP $remote_addr;
         proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_set_header        Host $http_host;
         proxy_pass              http://127.0.0.1:8080/;
    }
    access_log   /var/log/nginx/remark42.log;
}
</code></pre>

<h3 id="toc_3">blog 配置</h3>

<ul>
<li>在需要评论的 HTML 页面添加以下代码</li>
</ul>

<pre><code>&lt;script&gt;var remark_config = {host: 'https://re.letgo.cc',site_id: 'letgocc',components: ['embed', 'last-comments'],page_title: 'Comments.',locale: 'zh',no_footer: true}&lt;/script&gt;

&lt;script&gt;!function(e,n){for(var o=0;o&lt;e.length;o++){var r=n.createElement(&quot;script&quot;),c=&quot;.js&quot;,d=n.head||n.body;&quot;noModule&quot;in r?(r.type=&quot;module&quot;,c=&quot;.mjs&quot;):r.async=!0,r.defer=!0,r.src=remark_config.host+&quot;/web/&quot;+e[o]+c,d.appendChild(r)}}(remark_config.components||[&quot;embed&quot;],document);&lt;/script&gt;{{end}}

</code></pre>

<ul>
<li>需要显示评论组件的地方加入代码</li>
</ul>

<pre><code>&lt;div id=&quot;remark42&quot;&gt;&lt;/div&gt;
</code></pre>

<h3 id="toc_4">效果如下</h3>

<p><img width="707" height="247" src="https://img.letgo.cc/blog/img/20241011111238_0d8c935b75f4eff59233b248529da25.png" alt="评论截图" /></p>
<p>本文链接：<a href="https://letgo.cc/post/install-remark42.html">https://letgo.cc/post/install-remark42.html</a>，<a href="https://letgo.cc/post/install-remark42.html#comments">参与评论 »</a></p>]]>
            </description>
            <pubDate>Fri, 11 Oct 2024 10:41:00 +0800</pubDate>
        </item>
        
        <item>
            <title>eiblog - 开发日志</title>
            <link>https://letgo.cc/post/eiblog-dev.html</link>
            <comments>https://letgo.cc/post/eiblog-dev.html#comments</comments>
            <guid>https://letgo.cc/post/eiblog-dev.html</guid>
            <description>
                <![CDATA[

<h3 id="toc_0">背景</h3>

<p>想要一个简单的blog，偶然看到eiblog，还不错，但是相对来说还是稍微有点复杂。<br />
例如 elasticsearch 就有点重了，例如 disqus 不能访问就有点麻烦。<br />
所以想到的就是自己修改一下使用<!--more--></p>

<h4 id="toc_1">待实现功能：</h4>

<ul>
<li>elasticsearch 换成 meilisearch</li>
<li><del>disqus 换成 remark42</del></li>
<li><del>qiniu 换成 local （这个已经有人实现了拿来就用了）</del></li>
</ul>
<p>本文链接：<a href="https://letgo.cc/post/eiblog-dev.html">https://letgo.cc/post/eiblog-dev.html</a>，<a href="https://letgo.cc/post/eiblog-dev.html#comments">参与评论 »</a></p>]]>
            </description>
            <pubDate>Thu, 10 Oct 2024 18:00:00 +0800</pubDate>
        </item>
        
    </channel>
</rss>
