<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[心妤の屋]]></title><description><![CDATA[哈喽~欢迎光临]]></description><link>https://jerry.kolex.com.cn</link><image><url>https://jerry.kolex.com.cn/og</url><title>心妤の屋</title><link>https://jerry.kolex.com.cn</link></image><generator>Shiro (https://github.com/Innei/Shiro)</generator><lastBuildDate>Tue, 21 Apr 2026 21:30:56 GMT</lastBuildDate><atom:link href="https://jerry.kolex.com.cn/feed" rel="self" type="application/rss+xml"/><pubDate>Tue, 21 Apr 2026 21:30:56 GMT</pubDate><language><![CDATA[zh-CN]]></language><item><title><![CDATA[解决虚拟机部署Harbor出现证书错误的问题]]></title><description><![CDATA[<div><blockquote>该渲染由 Shiro API 生成，可能存在排版问题，最佳体验请前往：<a href="https://jerry.kolex.com.cn/posts/cloudnative/harbor-cert">$<!-- -->https://jerry.kolex.com.cn/posts/cloudnative/harbor-cert</a></blockquote><div><p>​    其实这个问题已经不是第一次遇到了，而且每次也能预见到以后还会遇到相同的问题，但是就是懒得记下，这次吸取了教训记录下来。</p><p>​    Harbor在部署的时候开启TLS需要指定证书的路径，配置文件需要填写 <code>certificate</code> 和 <code>private_key</code>。我是使用的 <code>acme.sh</code> 用于生成证书：</p><pre><code class="lang-shell">acme.sh --issue -d &lt;domain&gt; --standalone --force</code></pre><p>执行成功之后会在对应目录生成 <code>domain.cer</code> 和 <code>domain.key</code> 等多个文件，只需要将文件路径替换到配置里面即可。</p><p>在通过浏览器访问地址时是没有问题的，但是我们在使用 <code>docker</code> 命令行登陆时会提示证书错误：</p><pre><code class="lang-shell">Login did not succeed, error: Error response from daemon: Get &quot;https://&lt;domain&gt;/v2/&quot;: tls: failed to verify certificate: x509: certificate signed by unknown authority</code></pre><p>这是由于 <code>acme.sh</code> 生成的 <code>domain.cer</code> 文件并没有包含证书链，我们需要将证书链加进去，操作如下：</p><p>将 <code>acme.sh</code> 生成的 <code>fullchain.cer</code> 内容复制粘贴到 <code>domain.cer</code>里面，重启 Harbor服务即可</p></div><p style="text-align:right"><a href="https://jerry.kolex.com.cn/posts/cloudnative/harbor-cert#comments">看完了？说点什么呢</a></p></div>]]></description><link>https://jerry.kolex.com.cn/posts/cloudnative/harbor-cert</link><guid isPermaLink="true">https://jerry.kolex.com.cn/posts/cloudnative/harbor-cert</guid><dc:creator><![CDATA[Jerry]]></dc:creator><pubDate>Tue, 13 Aug 2024 06:06:04 GMT</pubDate></item><item><title><![CDATA[解决经由frp穿透后服务端无法获取客户端ip的办法]]></title><description><![CDATA[<div><blockquote>该渲染由 Shiro API 生成，可能存在排版问题，最佳体验请前往：<a href="https://jerry.kolex.com.cn/posts/network/frpip">$<!-- -->https://jerry.kolex.com.cn/posts/network/frpip</a></blockquote><div><p>博主服务运行环境为k3s，流量经由阿里云的服务器的80，443端口通过frp穿透到家庭服务器k3s环境的30871和30166端口。由于搭建了safeline防火墙，当防火墙拦截到违规请求的时候会记录客户端的ip，但是显示的全部都是服务器内网ip。解决办法如下：</p><pre><code class="lang-toml">serverAddr = &quot;&lt;your server ip&gt;&quot;
serverPort = 7000
auth.token = &quot;&lt;your token&gt;&quot;

[[proxies]]
name = &quot;ssh&quot;
type = &quot;tcp&quot;
localIP = &quot;127.0.0.1&quot;
localPort = 22
remotePort = 8000


[[proxies]]
name = &quot;80&quot;
type = &quot;tcp&quot;
localIP = &quot;127.0.0.1&quot;
localPort = 30871
remotePort = 80
transport.proxyProtocolVersion = &quot;v2&quot;

[[proxies]]
name = &quot;443&quot;
type = &quot;tcp&quot;
localIP = &quot;127.0.0.1&quot;
localPort = 30166
remotePort = 443
transport.proxyProtocolVersion = &quot;v2&quot;

[[proxies]]
name = &quot;6443&quot;
type = &quot;tcp&quot;
localIP = &quot;127.0.0.1&quot;
localPort = 6443
remotePort = 6443</code></pre><p>在相关 proxies 的配置下方增加 <code>transport.proxyProtocolVersion = &quot;v2&quot;</code></p><p>另外，对应的Nginx需要增加如下配置，以nginx-ingress为例：</p><pre><code class="lang-yaml">allow-snippet-annotations: &#x27;false&#x27;
compute-full-forwarded-for: &#x27;true&#x27;
forwarded-for-header: X-Forwarded-For
plugins: safeline
use-forwarded-headers: &#x27;true&#x27;
use-proxy-protocol: &#x27;true&#x27;</code></pre><p>该配置是 <code>ingress-nginx-controller</code> 的 <code>configmap</code></p><p>至此，waf记录的ip为客户端的真实公网ip</p></div><p style="text-align:right"><a href="https://jerry.kolex.com.cn/posts/network/frpip#comments">看完了？说点什么呢</a></p></div>]]></description><link>https://jerry.kolex.com.cn/posts/network/frpip</link><guid isPermaLink="true">https://jerry.kolex.com.cn/posts/network/frpip</guid><dc:creator><![CDATA[Jerry]]></dc:creator><pubDate>Fri, 02 Aug 2024 02:31:09 GMT</pubDate></item><item><title><![CDATA[利用公有云穿透至家庭服务器并对外提供服务]]></title><description><![CDATA[<div><blockquote>该渲染由 Shiro API 生成，可能存在排版问题，最佳体验请前往：<a href="https://jerry.kolex.com.cn/posts/network/frp-proxy">$<!-- -->https://jerry.kolex.com.cn/posts/network/frp-proxy</a></blockquote><div><h4 id="">利用公有云穿透至家庭服务器并对外提供服务</h4><p>​    我是一个喜欢折腾的人，但是也仅限于享受折腾的过程，很多时候折腾完了就扔在了一边，也没有记录的习惯。这导致下次再遇到相同问题的时候还需要再次翻资料，所以在发现了shiro之后便有了记录解决问题的习惯。</p><p>​    言归正传，我们都知道公有云的服务器价格都不低，但是配置却一般，不过最吸引人的在于它拥有固定IP以及80和443端口（前提需要备案）。于是乎我们是否可以借助公有云的资源将流量穿透到家庭服务器，答案是可以的。</p><p>​    这次借助的工具是<a href="https://github.com/fatedier/frp">frp</a>.frp分为客户端和服务端，服务端部署在公有云的服务器上，客户端部署在自己的服务器上。我们首选在公有云服务器安装frp，安装过程见官方文档，建议加入systemd，方便启动，我这边只展示相关配置，我在服务端定义配置文件为 <code>frps.toml</code>：</p><pre><code class="lang-toml">bindPort = 7000
auth.token = &quot;&lt;your token&gt;&quot;</code></pre><p>服务端配置很简单，启动之后会占用7000端口。接下来在自己的服务器上同样下载frp，配置文件名称设置为 <code>frpc.toml</code>：</p><pre><code class="lang-toml">serverAddr = &quot;&lt;your server ip&gt;&quot;
serverPort = 7000
auth.token = &quot;&lt;your token&gt;&quot;

[[proxies]]
name = &quot;ssh&quot;
type = &quot;tcp&quot;
localIP = &quot;127.0.0.1&quot;
localPort = 22
remotePort = 8000


[[proxies]]
name = &quot;80&quot;
type = &quot;tcp&quot;
localIP = &quot;127.0.0.1&quot;
localPort = 30871
remotePort = 80
transport.proxyProtocolVersion = &quot;v2&quot;

[[proxies]]
name = &quot;443&quot;
type = &quot;tcp&quot;
localIP = &quot;127.0.0.1&quot;
localPort = 30166
remotePort = 443
transport.proxyProtocolVersion = &quot;v2&quot;

[[proxies]]
name = &quot;6443&quot;
type = &quot;tcp&quot;
localIP = &quot;127.0.0.1&quot;
localPort = 6443
remotePort = 6443</code></pre><p>简单解释下配置文件含义，第一个<code>proxies</code>协议为四层网络协议TCP类型，代表本地服务器和云厂商服务器通过8000端口穿透，即访问远端服务器的8000端口时，会代理到本地服务器的22端口，所以在使用ssh命令连接远端服务器的8000端口时，会自动连接到家庭服务器的ssh。以下三个<code>proxies</code>配置同理。</p><p>我在80和443的proxies上增加了一行<code>transport.proxyProtocolVersion = &quot;v2&quot;</code>，这个目的是为了让经过穿透后的请求到达后端时，依旧能识别出remote ip。因为我我的本地服务是个k3s集群，由ingress-nginx作为网关，safeline作为防火墙，加上这行配置可以让safeline识别到远端的真实ip。后面有机会单独写一篇文章描述下相关配置。</p></div><p style="text-align:right"><a href="https://jerry.kolex.com.cn/posts/network/frp-proxy#comments">看完了？说点什么呢</a></p></div>]]></description><link>https://jerry.kolex.com.cn/posts/network/frp-proxy</link><guid isPermaLink="true">https://jerry.kolex.com.cn/posts/network/frp-proxy</guid><dc:creator><![CDATA[Jerry]]></dc:creator><pubDate>Fri, 12 Jul 2024 01:52:52 GMT</pubDate></item><item><title><![CDATA[解决argocd在Kubernetes环境中的常见问题]]></title><description><![CDATA[<div><blockquote>该渲染由 Shiro API 生成，可能存在排版问题，最佳体验请前往：<a href="https://jerry.kolex.com.cn/posts/cloudnative/resolve-argocd-issues-in-kubernetes-environment">$<!-- -->https://jerry.kolex.com.cn/posts/cloudnative/resolve-argocd-issues-in-kubernetes-environment</a></blockquote><div><p>​    我比较喜欢也习惯在k8s环境下搭建一些长期使用的系统，即使是本人的私有服务器也是建立在k3s基座之上的。通过argocd管理和发布一些应用，非常方便，但是得做很多的前置工作，比如镜像构建和helm封装等。我在使用argocd的时候遇到了一些问题，一个是通过ingress访问argocd-server的时候会有报错，还有一个是argocd对ingress的health check有一些问题。</p><h4 id="1ingressargocd-server">1.解决ingress访问argocd-server报错</h4><p>我们只需要修改argocd-server的delpoyment的启动参数，增加一行 <code>--insecure</code>，重新启动即可</p><pre><code class="">args:
  - /usr/local/bin/argocd-server
  - &#x27;--insecure&#x27;
  - &#x27;--port=8080&#x27;
  - &#x27;--metrics-port=8083&#x27;</code></pre><h4 id="2ingress">2.解决ingress建行检查</h4><p>修改 <code>argocd-cm</code> 配置，增加一行配置：</p><pre><code class="">resource.customizations: |
  networking.k8s.io/Ingress:
      health.lua: |
        hs = {}
        hs.status = &quot;Healthy&quot;
        return hs</code></pre><p>以上，即可解决argocd安装问题</p></div><p style="text-align:right"><a href="https://jerry.kolex.com.cn/posts/cloudnative/resolve-argocd-issues-in-kubernetes-environment#comments">看完了？说点什么呢</a></p></div>]]></description><link>https://jerry.kolex.com.cn/posts/cloudnative/resolve-argocd-issues-in-kubernetes-environment</link><guid isPermaLink="true">https://jerry.kolex.com.cn/posts/cloudnative/resolve-argocd-issues-in-kubernetes-environment</guid><dc:creator><![CDATA[Jerry]]></dc:creator><pubDate>Mon, 08 Jul 2024 08:09:59 GMT</pubDate></item><item><title><![CDATA[k8s环境下搭建mx-server和shiro]]></title><description><![CDATA[<div><blockquote>该渲染由 Shiro API 生成，可能存在排版问题，最佳体验请前往：<a href="https://jerry.kolex.com.cn/posts/cloudnative/k8smx">$<!-- -->https://jerry.kolex.com.cn/posts/cloudnative/k8smx</a></blockquote><div><h4 id="1">1.背景</h4><p>​    偶然看到了某位开发者的博客网站，一眼看去非常清爽且交互非常友好，经过查找发现是 shiro。在大多数博文类型的网站采用纯前端方式的今天，前后端分离的方式倒是让我觉得挺新奇。其实很多次都有锅建设一个博客之类的网站，用于记录平时开发中的一些困难，亦或者一些小技巧什么的，但很多时候问题解决之后就会丢在一边，以至于后面再次遇到了又得重新查找相关资料，而且还不止一次，相信很多人都有相同的经历吧，哈哈。
     初见shiro花了点时间了解了它的架构和部署方式，目前官方的部署方式是基于docker compose，奈何我个人习惯于在k8s下部署，于是花了点时间进行了一些改造，并创建了helm便于部署</p><h4 id="2mx-server">2.部署mx-server</h4><pre><code class="lang-shell">helm repo add nisainan https://nisainan.github.io/helm-charts

helm install mx-server nisainan/mx-server -n shiro --create-namespace</code></pre><blockquote><p>注：mx-server依赖mongodb和redis，请自行提前安装，或者参考如下命令行安装</p></blockquote><pre><code class="lang-shell">helm repo add bitnami https://charts.bitnami.com/bitnami

helm install mongodb --set useStatefulSet=true --set auth.enbaled=false bitnami/mongodb -n mongodb --create-namespace

helm install redis --set auth.enabled=false --set replica.replicaCount=0 bitnami/redis -n redis --create-namespace</code></pre><p>那么，env的设置如下：</p><pre><code class="lang-shell">...
DB_HOST : mongodb.mongodb
NODE_ENV : production
REDIS_HOST : redis-master.redis
...</code></pre><p>至于ingress的配置不做赘述，helm结构完全依照于<code>helm create</code>命令所生成的配置文件，示例如下：</p><pre><code class="lang-yaml">ingress:
  enabled: true
  ingressClassName: nginx
  annotations:
    cert-manager.io/cluster-issuer: nginx-cert
    kubernetes.io/tls-acme: &#x27;true&#x27;
  hosts:
    - mixapi.kolex.com.cn
  tls:
    - hosts:
        - mixapi.kolex.com.cn
      secretName: mixapi.kolex.com.cn-tls</code></pre><p>至此，mx-server安装成功</p><h4 id="3shiro">3.部署shiro</h4><p>我将shiro也封装了helm，安装命令如下：</p><pre><code class="">helm repo add nisainan https://nisainan.github.io/helm-charts

helm install shiro nisainan/shiro -n shiro --create-namespace</code></pre><blockquote><p>注：请自行修改values的值以适配自身服务</p></blockquote>
<p>至此，前后端全部安装完成</p></div><p style="text-align:right"><a href="https://jerry.kolex.com.cn/posts/cloudnative/k8smx#comments">看完了？说点什么呢</a></p></div>]]></description><link>https://jerry.kolex.com.cn/posts/cloudnative/k8smx</link><guid isPermaLink="true">https://jerry.kolex.com.cn/posts/cloudnative/k8smx</guid><dc:creator><![CDATA[Jerry]]></dc:creator><pubDate>Tue, 02 Jul 2024 05:48:40 GMT</pubDate></item></channel></rss>