{"slug":"you-is-me-huh","title":"你是我吗？","description":"博客开源了就会有很多小笨蛋Fork完改也改不全，导致评论也评论到我这来了，浏览量统计也来我这来了😅","coverImage":"https://b.acofork.com/img/you-is-me-huh-historical-cover.webp","coverWidth":523,"coverHeight":491,"date":"2025-08-12","tags":["杂谈"],"pinned":false,"wordCount":340,"html":"<h2 id=\"前情提要\">前情提要</h2><p>今天收到一封小邮件</p>\n<p><img src=\"https://b.acofork.com/img/you-is-me-huh-2025-08-12-15-45-18-image.webp\" alt=\"\" width=\"1174\" height=\"407\" loading=\"eager\" decoding=\"async\" /></p>\n<p>我一眼就看出来了</p>\n<p>有人Fork完我的仓库但是Giscus评论区没改成自己的。</p>\n<h2 id=\"giscus仅允许自己\">Giscus仅允许自己</h2><p>在启用了Giscus的仓库放一个文件</p>\n<div class=\"markdown-code\" data-language=\"json\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1\"></path><path d=\"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 0-2-2V5a2 2 0 0 0-2-2h-1\"></path></svg><span>json</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-json\">&lt;!-- giscus.json --&gt;\n<span class=\"hljs-punctuation\">{</span>\n  <span class=\"hljs-attr\">\"origins\"</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-punctuation\">[</span><span class=\"hljs-string\">\"https://2x.nz\"</span><span class=\"hljs-punctuation\">]</span>\n<span class=\"hljs-punctuation\">}</span></code></pre></div><p>这样设置后，即使有人在它的网站上引入了<strong>你的评论区</strong>，也会被拒绝显示</p>\n<p><img src=\"https://b.acofork.com/img/you-is-me-huh-2025-08-12-15-48-23-image.webp\" alt=\"\" width=\"799\" height=\"147\" loading=\"lazy\" decoding=\"async\" /></p>\n<h2 id=\"umami仅允许自己\">Umami仅允许自己</h2><p>我博客有一个浏览量统计，基于Umami，之前是没鉴权的，如果你啥也不改，访问你的网站也会记到我网站上😅</p>\n<p>Umami并没有给配置来更改CORS（毕竟这个访问量统计是我逆向出来的）</p>\n<p>但是我的Umami套了EO，我可以直接写一套CORS规则仅允许自己调用</p>\n<p><img src=\"https://b.acofork.com/img/you-is-me-huh-2025-08-12-15-50-25-image.webp\" alt=\"\" width=\"692\" height=\"333\" loading=\"lazy\" decoding=\"async\" /></p>\n<p>这样的话，即使你啥也不改，也不会把错误的统计信息发到我这，会报错CORS头不允许</p>\n<p><img src=\"https://b.acofork.com/img/you-is-me-huh-2025-08-12-15-51-04-image.webp\" alt=\"\" width=\"416\" height=\"194\" loading=\"lazy\" decoding=\"async\" /></p>\n<h2 id=\"最后\">最后</h2><p>开源是为了让大家更好的学习我的博客框架，不是让你照搬，请确认将所有内容、API端点、私有服务全部改为自己的后再上线！</p>\n<p>你要是懒可以Fork<a href=\"https://github.com/saicaca/fuwari\" target=\"_blank\" rel=\"noopener noreferrer\">上游原仓库</a>从白纸开始<a href=\"/posts/fuwari/\">改</a></p>\n","toc":[{"id":"前情提要","text":"前情提要","depth":2},{"id":"giscus仅允许自己","text":"Giscus仅允许自己","depth":2},{"id":"umami仅允许自己","text":"Umami仅允许自己","depth":2},{"id":"最后","text":"最后","depth":2}]}