id: cefe6f05c2fe4b0ab390568a772dedc8
parent_id: 
item_type: 1
item_id: 67d425345e604598b2683c5309ea6594
item_updated_time: 1764345513895
title_diff: "[{\"diffs\":[[1,\"从闲置到实用：如何把 Mac mini 变成个人开发和家庭服务器\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":32}]"
body_diff: "[{\"diffs\":[[1,\"<html>\\\r\\\n<head>\\\r\\\n  <title>从闲置到实用：如何把 Mac mini 变成个人开发和家庭服务器</title>\\\r\\\n  <basefont face=\\\"微软雅黑\\\" size=\\\"2\\\" />\\\r\\\n  <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html;charset=utf-8\\\" />\\\r\\\n  <meta name=\\\"exporter-version\\\" content=\\\"YXBJ Windows/608924 (zh-CN, DDL); Windows/10.0.0 (Win64); EDAMVersion=V2;\\\"/>\\\r\\\n  <meta name=\\\"content-class\\\" content=\\\"yinxiang.peso.superNote\\\"/>\\\r\\\n  <meta name=\\\"application-data:yinxiang.noteLayout\\\" content=\\\"{\\\"lineSpace\\\":\\\"recommend\\\",\\\"paragraphSpace\\\":\\\"recommend\\\"}\\\"/>\\\r\\\n  <style>\\\r\\\n\\tbody, td {\\\r\\\n\\t  font-family: 微软雅黑;\\\r\\\n\\t  font-size: 12pt;\\\r\\\n\\t}\\\r\\\n  </style>\\\r\\\n</head>\\\r\\\n<body>\\\r\\\n<a name=\\\"46721\\\"></a>\\\r\\\n<h1>从闲置到实用：如何把 Mac mini 变成个人开发和家庭服务器</h1>\\\r\\\n\\\r\\\n<div><span><div><br/></div><p><br/></p><div style=\\\"--en-blockquote:true;box-sizing: border-box; padding-left: 19px; padding-top: 6px; padding-bottom: 6px; border-left: 3px solid #b4c0cc; background-position: initial initial; background-repeat: initial initial; margin-top: 6px\\\"><div>原文链接: <a href=\\\"https://mp.weixin.qq.com/s?__biz=MzI5NDExOTk5MA==&amp;mid=2247484124&amp;idx=1&amp;sn=bc73b12367d459af1d27714b6ab9ac84&amp;chksm=ed3d9ec066d4d1ad43a9cea4f382e158e1e78cc739424bf0e32346914930b705f54a515f403c&amp;mpshare=1&amp;scene=1&amp;srcid=0903CeYyT1czuwsOuYmigHdZ&amp;sharer_shareinfo=e42399950942b14abd11650f96d0330b&amp;sharer_shareinfo_first=e42399950942b14abd11650f96d0330b#rd\\\" rev=\\\"en_rl_none\\\">https://mp.weixin.qq.com/s?__biz=MzI5NDExOTk5MA==&amp;mid=224748...</a></div></div><p><br/></p><div><br/></div><h1 style=\\\"other-props:eyJibG9ja0lkIjoiYThnQlFLT2VBMGcifQ==;\\\"> 从闲置到实用：如何把 Mac mini 变成个人开发和家庭服务器</h1><div>原创 Ailln  通用智能体 </div><h2 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiMEx5SlRPUWlnUU0ifQ==;\\\"><span style=\\\"font-size: 22px;\\\"><span style=\\\"font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">一、引言</span></span></span></span></h2><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">你是否有一台闲置的 Mac mini 正在吃灰？或者正在考虑购买一台轻量级的设备来搭建家庭服务器？Mac mini 以其紧凑的体积、优秀的性能功耗比和静音运行的特点，是搭建家庭服务器的理想选择。</span></span></p><h3 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiN0JCdlNhaGhnZlUifQ==;\\\"><span style=\\\"font-size: 20px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">为什么要利用闲置的 Mac mini</span></span></span></h3><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">相比传统的服务器硬件，Mac mini 有以下优势：</span></span></p><ul><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">低功耗</span></b></span>：24小时运行电费成本极低</div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">静音</span></b></span>：几乎无噪音，适合放在家中任何位置</div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">性能出色</span></b></span>：Apple Silicon 芯片提供强劲的计算能力</div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">体积小巧</span></b></span>：不占用太多空间</div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">稳定可靠</span></b></span>：macOS 系统稳定性很好</div></li></ul><h3 style=\\\"color:black;other-props:eyJibG9ja0lkIjoid3QySVNXcy1DMXcifQ==;\\\"><span style=\\\"font-size: 20px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">家庭/个人场景下的常见需求</span></span></span></h3><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">通过改造 Mac mini，我们可以实现：</span></span></p><ul><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">私人 Git 服务器</span></b></span>：托管个人代码，保护隐私</div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">家庭 NAS / 多媒体服务器</span></b></span>：集中存储和共享文件、照片、视频</div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">远程开发机</span></b></span>：随时随地连接到熟悉的开发环境</div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">轻量级网站或应用托管</span></b></span>：运行个人博客、小型应用等</div></li></ul><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">然而，家庭网络通常没有公网 IP，这意味着我们无法从外网直接访问家中的 Mac mini。这就是我们需要解决的核心问题。</span></span></p><h2 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiWlZYY1JtTVo0UkMifQ==;\\\"><span style=\\\"font-size: 22px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">二、整体方案概述</span></span></span></h2><h3 style=\\\"color:black;other-props:eyJibG9ja0lkIjoidGZBSlIta1cxTkoifQ==;\\\"><span style=\\\"font-size: 20px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">问题分析</span></span></span></h3><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">家庭网络环境的主要挑战：</span></span></p><ol><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">没有公网 IP</span></b></span>：大多数家庭宽带都是通过运营商的 NAT 网络接入，无法从外网直接访问</div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">动态 IP</span></b></span>：即使有公网 IP，通常也是动态分配的，IP 地址会变化</div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">防火墙限制</span></b></span>：运营商和路由器的防火墙会阻止外网的主动连接</div></li></ol><h3 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiTV8zbFFHZXhkVjcifQ==;\\\"><span style=\\\"font-size: 20px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">解决方案：frp + 云服务器</span></span></span></h3><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">frp（Fast Reverse Proxy）是一个专注于内网穿透的反向代理应用，支持 TCP、UDP、HTTP、HTTPS 等多种协议。通过 frp，我们可以：</span></span></p><ul><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">将内网服务安全地暴露到公网</span></span></div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">实现内网穿透，无需公网 IP</span></span></div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">支持多种协议和端口转发</span></span></div></li></ul><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">核心架构：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:IP44S214k_3;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">远程访问者 ←→ HTTPS/SSH ←→ 云服务器（公网）←→ frps ←→ frpc ←→ Mac mini（内网） ←→ 本地服务</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">这种架构的优势：</span></span></p><ul><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">成本低</span></b></span>：只需要一台便宜的云服务器</div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">安全性高</span></b></span>：通过加密隧道传输数据</div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">稳定可靠</span></b></span>：frp 经过大量生产环境验证</div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">配置简单</span></b></span>：配置文件清晰，易于维护</div></li></ul><h2 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiQ05xX1NTNHdPLXgifQ==;\\\"><span style=\\\"font-size: 22px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">三、准备工作</span></span></span></h2><h3 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiZ0ZQU1EtWjhiT2UifQ==;\\\"><span style=\\\"font-size: 20px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">硬件要求</span></span></span></h3><ul><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">Mac mini</span></b></span>：任何型号都可以，建议 8GB 内存以上</div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">存储空间</span></b></span>：根据需求准备足够的存储，可以外接硬盘扩展</div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">网络连接</span></b></span>：稳定的家庭宽带，建议上行带宽 &gt; 10Mbps</div></li></ul><h3 style=\\\"color:black;other-props:eyJibG9ja0lkIjoidHR4QlMyblNVa28ifQ==;\\\"><span style=\\\"font-size: 20px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">软件环境</span></span></span></h3><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">Mac mini 端：</span></b></span></span></p><ul><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">macOS</span></b></span>：任何支持的版本（建议 macOS 12+）</div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">Homebrew</span></b></span>：用于安装软件包</div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">Xcode Command Line Tools</span></b></span>：提供基础开发工具</div></li></ul><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">安装 Homebrew：</span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:KPgwSWtx_ZE;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">/bin/bash -c &quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)&quot;</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">安装 Command Line Tools：</span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:xfpbQu_lP2-;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">xcode-select --install</div><h3 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiVHR0LVJ1QTF3aVIifQ==;\\\"><span style=\\\"font-size: 20px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">云服务器选择</span></span></span></h3><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">选择一台具有公网 IP 的云服务器，推荐配置：</span></span></p><ul><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">CPU</span></b></span>：1核心即可</div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">内存</span></b></span>：1-2GB</div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">带宽</span></b></span>：根据使用需求，1-5Mbps 通常够用</div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">系统</span></b></span>：Ubuntu 20.04+ 或 CentOS 7+</div></li></ul><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">推荐服务商：</span></b></span></span></p><ul><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">国内</span></b></span>：阿里云轻量应用服务器、腾讯云轻量应用服务器</div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">国外</span></b></span>：Vultr、DigitalOcean、AWS EC2（按使用付费）</div></li></ul><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">💡 <b><span style=\\\"font-weight: bold;\\\">成本参考</span></b></span>：国内轻量服务器约 24-60 元/月，国外 VPS 约 3.5-10 美元/月</span></p><h3 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiSmR5c1JxUmNySjgifQ==;\\\"><span style=\\\"font-size: 20px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">基础环境配置</span></span></span></h3><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">在云服务器上安装必要软件：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:UrlnSSh9IpU;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># Ubuntu/Debiansudo apt updatesudo apt install -y wget curl unzip\\\n# CentOS/RHELsudo yum update -ysudo yum install -y wget curl unzip</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">配置防火墙（重要）：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:bM4pRqVuNw5;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># Ubuntu（使用 ufw）sudo ufw allow 22      # SSHsudo ufw allow 7000    # frp 服务端口sudo ufw allow 6000    # frp 管理端口sudo ufw enable\\\n# CentOS（使用 firewalld）sudo firewall-cmd --permanent --add-port=22/tcpsudo firewall-cmd --permanent --add-port=7000/tcpsudo firewall-cmd --permanent --add-port=6000/tcpsudo firewall-cmd --reload</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">在 Mac mini 上启用必要服务：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:26gpTWIe48e;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 启用 SSH（远程登录）sudo systemsetup -setremotelogin on\\\n# 启用屏幕共享（可选）sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.screensharing.plist</div><h2 style=\\\"color:black;other-props:eyJibG9ja0lkIjoibkxuTVM2UlU5Q0kifQ==;\\\"><span style=\\\"font-size: 22px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">四、frp 配置与部署</span></span></span></h2><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">⚠️ <b><span style=\\\"font-weight: bold;\\\">重要说明</span></b></span>：本文已更新为 frp 0.64.0 版本，使用最新的 TOML 配置格式。如果你使用的是旧版本的 frp（&lt; 0.52.0），建议升级到最新版本以获得更好的性能和安全性。INI 配置格式已被弃用，未来版本将移除对 INI 的支持。</span></p><h3 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiNl8yWlNlUXFOZmIifQ==;\\\"><span style=\\\"font-size: 20px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">4.1 在云服务器上部署 frps（服务端）</span></span></span></h3><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiWXB5UFFhTjhoODEifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">下载与安装</span></span></span></h4><div style=\\\"--en-codeblock:true;--en-blockId:3nG4QabKaJM;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 登录云服务器ssh root@your-server-ip\\\n# 下载 frp（以 0.64.0 版本为例）cd /optsudo wget https://github.com/fatedier/frp/releases/download/v0.64.0/frp_0.64.0_linux_amd64.tar.gz\\\n# 解压sudo tar -xzf frp_0.64.0_linux_amd64.tar.gzsudo mv frp_0.64.0_linux_amd64 frpcd frp\\\n# 查看文件ls -la# 输出应该包含：frps（服务端）、frpc（客户端）、配置文件等</div><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoicWk2blNXczZLOEgifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">编写 frps.toml 配置</span></span></span></h4><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">💡 <b><span style=\\\"font-weight: bold;\\\">注意</span></b></span>：从 frp 0.52.0 版本开始，配置文件格式已从 INI 更改为 TOML、YAML 和 JSON。INI 格式已被弃用，建议使用新的 TOML 格式。</span></p><div style=\\\"--en-codeblock:true;--en-blockId:aNwRSSpU9kk;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">sudo vim /opt/frp/frps.toml</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">配置内容：</span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:xN8yTuWWKSw;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># frps 监听的端口，用于接收 frpc 的连接bindPort = 7000\\\n# 认证配置auth.method = &quot;token&quot;auth.token = &quot;your_secret_token_here&quot;\\\n# 默认为 127.0.0.1，如果需要公网访问，需要修改为 0.0.0.0。webServer.addr = &quot;0.0.0.0&quot;webServer.port = 7500# dashboard 用户名密码，可选，默认为空webServer.user = &quot;admin&quot;webServer.password = &quot;your_password_here&quot;</div><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiRVRXMFNtQmE3czgifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">启动服务并设置开机自启</span></span></span></h4><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">创建 systemd 服务文件：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:ShpXQyHUwat;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">sudo vim /etc/systemd/system/frps.service</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">服务配置内容：</span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:VCBeSSPBILp;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">[Unit]Description=Frp Server ServiceAfter=network.target\\\n[Service]Type=simpleUser=nobodyRestart=on-failureRestartSec=5sExecStart=/opt/frp/frps -c /opt/frp/frps.tomlExecReload=/bin/kill -s HUP $MAINPIDLimitNOFILE=1048576\\\n[Install]WantedBy=multi-user.target</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">启动并启用服务：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:1Vw7RO33qRc;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 重新加载 systemd 配置sudo systemctl daemon-reload\\\n# 启动 frps 服务sudo systemctl start frps\\\n# 设置开机自启sudo systemctl enable frps\\\n# 查看服务状态sudo systemctl status frps\\\n# 查看服务日志sudo journalctl -u frps -f</div><h3 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiNU5TX1RhdjBkZWkifQ==;\\\"><span style=\\\"font-size: 20px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">4.2 在 Mac mini 上部署 frpc（客户端）</span></span></span></h3><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiak91V1JHb0VoWVEifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">安装 frp</span></span></span></h4><div style=\\\"--en-codeblock:true;--en-blockId:7lFTTOgDD-5;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 使用 Homebrew 安装（推荐）brew install frp\\\n# 或者手动下载安装cd ~/Downloadswget https://github.com/fatedier/frp/releases/download/v0.64.0/frp_0.64.0_darwin_arm64.tar.gztar -xzf frp_0.64.0_darwin_arm64.tar.gzsudo mv frp_0.64.0_darwin_arm64 /usr/local/frp</div><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiZlNpNlNXNFpZSzIifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">编写 frpc.toml 配置文件</span></span></span></h4><div style=\\\"--en-codeblock:true;--en-blockId:KuCGRe45cUK;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 创建配置目录sudo mkdir -p /usr/local/etc/frp\\\n# 创建配置文件sudo vim /usr/local/etc/frp/frpc.toml</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">配置内容：</span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:phEsSmkjEGx;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 服务端地址和端口serverAddr = &quot;your-server-ip&quot;serverPort = 7000\\\n# 认证配置（与服务端保持一致）auth.method = &quot;token&quot;auth.token = &quot;your_secret_token_here&quot;\\\n# 管理面板配置，可选，默认为空webServer.addr = &quot;127.0.0.1&quot;webServer.port = 7400webServer.user = &quot;admin&quot;webServer.password = &quot;your_password_here&quot;\\\n# 代理配置 - SSH[[proxies]]name = &quot;ssh&quot;type = &quot;tcp&quot;localIP = &quot;127.0.0.1&quot;localPort = 22remotePort = 2222\\\n# 代理配置 - Web 服务（示例）[[proxies]]name = &quot;web&quot;type = &quot;tcp&quot;localIP = &quot;127.0.0.1&quot;localPort = 8080remotePort = 8080\\\n# 代理配置 - VNC（屏幕共享）[[proxies]]name = &quot;vnc&quot;type = &quot;tcp&quot;localIP = &quot;127.0.0.1&quot;localPort = 5900remotePort = 5900</div><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiY25Ca1RDTUNYTkMifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">启动与后台运行</span></span></span></h4><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">方法一：使用 launchctl（推荐）</span></b></span></span></p><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">创建 LaunchDaemon 配置：</span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:uBVVRqu_ipB;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">sudo vim /Library/LaunchDaemons/com.frp.frpc.plist</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">配置内容：</span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:69hDReznGuT;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;&lt;plist version=&quot;1.0&quot;&gt;&lt;dict&gt;    &lt;key&gt;Label&lt;/key&gt;    &lt;string&gt;com.frp.frpc&lt;/string&gt;\\\n    &lt;key&gt;ProgramArguments&lt;/key&gt;    &lt;array&gt;        &lt;string&gt;/usr/local/bin/frpc&lt;/string&gt;        &lt;string&gt;-c&lt;/string&gt;        &lt;string&gt;/usr/local/etc/frp/frpc.toml&lt;/string&gt;    &lt;/array&gt;\\\n    &lt;key&gt;RunAtLoad&lt;/key&gt;    &lt;true/&gt;\\\n    &lt;key&gt;KeepAlive&lt;/key&gt;    &lt;true/&gt;\\\n    &lt;key&gt;StandardErrorPath&lt;/key&gt;    &lt;string&gt;/var/log/frpc.error.log&lt;/string&gt;\\\n    &lt;key&gt;StandardOutPath&lt;/key&gt;    &lt;string&gt;/var/log/frpc.out.log&lt;/string&gt;&lt;/dict&gt;&lt;/plist&gt;</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">加载并启动服务：</span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:L4-oRypIK7H;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 加载服务sudo launchctl load /Library/LaunchDaemons/com.frp.frpc.plist\\\n# 启动服务sudo launchctl start com.frp.frpc\\\n# 查看服务状态sudo launchctl list | grep frpc</div><h3 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiYTRpVVFPX3BZS28ifQ==;\\\"><span style=\\\"font-size: 20px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">4.3 测试连接与远程访问</span></span></span></h3><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiTk12ZlRHd1dxalEifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">验证 frp 连接状态</span></span></span></h4><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">查看服务端状态：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:xjipS6RTxiv;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 访问仪表板# 在浏览器中打开：http://your-server-ip:7500# 使用 admin/your_password_here 登录</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">查看客户端状态：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:N2HRQiu5HNG;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 访问本地管理界面# 浏览器打开：http://127.0.0.1:7400# 使用 admin/your_password_here 登录</div><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiNTVQSVI2Rk92VVkifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">测试 SSH 远程连接</span></span></span></h4><div style=\\\"--en-codeblock:true;--en-blockId:iy8NQWpZ04d;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 从任意外网位置连接到 Mac minissh username@your-server-ip -p 2222\\\n# 如果配置正确，应该能够成功连接到 Mac mini</div><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiT0dYY1JPYzNvQkYifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">常见问题排查</span></span></span></h4><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">连接失败的可能原因：</span></b></span></span></p><ol><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">防火墙设置</span></b></span>：确保云服务器开放了相应端口</div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">token 不匹配</span></b></span>：检查客户端和服务端的 token 是否一致</div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">网络问题</span></b></span>：测试云服务器和 Mac mini 的网络连通性</div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">端口冲突</span></b></span>：确保配置的端口没有被其他服务占用</div></li></ol><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">调试命令：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:uBxLRyf6lU_;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 测试服务端端口开放telnet your-server-ip 7000\\\n# 查看端口占用lsof -i :7000\\\n# 测试网络连通性ping your-server-ip</div><h2 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiSDBEX1JTOHF2czgifQ==;\\\"><span style=\\\"font-size: 22px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">五、常见应用场景实践</span></span></span></h2><h3 style=\\\"color:black;other-props:eyJibG9ja0lkIjoidHJfNlJXSjREeHAifQ==;\\\"><span style=\\\"font-size: 20px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">5.1 远程 SSH：随时远程连接 Mac mini</span></span></span></h3><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">SSH 是最基础也是最重要的远程访问方式，通过 SSH 你可以：</span></span></p><ul><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">远程执行命令和脚本</span></span></div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">传输文件（scp、rsync）</span></span></div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">端口转发（本地/远程端口转发）</span></span></div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">搭建安全隧道</span></span></div></li></ul><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">SSH 配置优化：</span></b></span></span></p><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">在 Mac mini 上编辑 SSH 配置：</span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:d5OXR2c_wFs;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">sudo vim /etc/ssh/sshd_config</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">推荐配置：</span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:IxyWSmgr3zG;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 基础配置Port 22Protocol 2PermitRootLogin no\\\n# 安全配置PasswordAuthentication yes  # 初期可以用密码，后期建议改为 noPubkeyAuthentication yesAuthorizedKeysFile .ssh/authorized_keys\\\n# 性能配置ClientAliveInterval 60ClientAliveCountMax 3MaxAuthTries 3MaxSessions 10\\\n# 禁用一些不必要的功能X11Forwarding noAllowAgentForwarding noPermitTunnel no</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">重启 SSH 服务：</span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:FunWTaR_wct;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">sudo launchctl unload /System/Library/LaunchDaemons/ssh.plistsudo launchctl load /System/Library/LaunchDaemons/ssh.plist</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">客户端连接示例：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:uIS7S6Eis49;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 基础连接ssh username@your-server-ip -p 2222\\\n# 使用密钥连接ssh -i ~/.ssh/id_rsa username@your-server-ip -p 2222\\\n# 端口转发（将远程的 8080 端口转发到本地 8080）ssh -L 8080:localhost:8080 username@your-server-ip -p 2222\\\n# 后台运行保持连接ssh -fN -L 8080:localhost:8080 username@your-server-ip -p 2222</div><h3 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiNzBwQlEtU0xyMWsifQ==;\\\"><span style=\\\"font-size: 20px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">5.2 文件访问 / NAS：多种文件共享方案</span></span></span></h3><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiZVVvRVI2R045VWsifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">方案一：SMB/AFP 文件共享</span></span></span></h4><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">启用 macOS 文件共享：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:D0TNTaEnVsA;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 启用 SMB 文件共享sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.smbd.plist\\\n# 或通过系统设置启用# 系统设置 &gt; 通用 &gt; 共享 &gt; 文件共享</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">在 frpc.toml 中添加 SMB 代理：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:2ntYSyUW_TU;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 在现有的 frpc.toml 文件中添加[[proxies]]name = &quot;smb&quot;type = &quot;tcp&quot;localIP = &quot;127.0.0.1&quot;localPort = 445remotePort = 4445</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">客户端访问：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:I2_0SyJ7c9v;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># Windows\\\\\\\\your-server-ip:4445\\\n# macOSsmb://your-server-ip:4445\\\n# Linuxsudo mount -t cifs //your-server-ip:4445/share /mnt/macmini -o username=your_username</div><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoidVVXbVFtbks2VkQifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">方案二：使用 Nextcloud 搭建私人云盘</span></span></span></h4><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">使用 Docker 安装 Nextcloud：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:EDMEQS7WPwn;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 安装 Dockerbrew install docker\\\n# 启动 Docker Desktop\\\n# 运行 Nextclouddocker run -d \\\\  --name nextcloud \\\\  -p 8080:80 \\\\  -v nextcloud_data:/var/www/html \\\\  nextcloud:latest</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">在 frpc.toml 中添加 Nextcloud 代理：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:JVbHR-yJ-Nd;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 在现有的 frpc.toml 文件中添加[[proxies]]name = &quot;nextcloud&quot;type = &quot;tcp&quot;localIP = &quot;127.0.0.1&quot;localPort = 8080remotePort = 8080</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">现在你可以通过 </span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: #1e6bb8;\\\">http://your-server-ip:8080</span></span></code></span> 访问你的私人云盘。</p><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiRksyRlN5OEhEZEEifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">方案三：使用 FTP/SFTP</span></span></span></h4><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">启用内置 FTP：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:-okoQCGBT_p;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># macOS 内置 FTP 已被弃用，建议使用 SFTP# SFTP 基于 SSH，无需额外配置</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">客户端连接：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:5RTITCZ_mMT;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 使用 SFTPsftp -P 2222 username@your-server-ip\\\n# 使用图形化工具：FileZilla、Cyberduck 等# 主机：your-server-ip# 端口：2222# 协议：SFTP</div><h3 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiSUw2SFFLMmJBVWoifQ==;\\\"><span style=\\\"font-size: 20px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">5.3 私人 Git 服务：托管代码仓库</span></span></span></h3><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoibzlqV1FDaEpnVzkifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">方案一：使用 Gitea（推荐）</span></span></span></h4><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">安装 Gitea：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:qXoLR-7zMXg;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 下载 Gitea（M 系列芯片）cd ~/Downloadswget -O gitea https://dl.gitea.io/gitea/1.21.0/gitea-1.21.0-darwin-arm64chmod +x giteasudo mv gitea /usr/local/bin/\\\n# 创建 git 用户sudo dscl . -create /Users/gitsudo dscl . -create /Users/git UserShell /bin/bashsudo dscl . -create /Users/git RealName &quot;Git Version Control&quot;sudo dscl . -create /Users/git UniqueID 1001sudo dscl . -create /Users/git PrimaryGroupID 20sudo dscl . -create /Users/git NFSHomeDirectory /Users/gitsudo mkdir /Users/gitsudo chown git:staff /Users/git</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">创建配置文件：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:7PoqTCSLIdt;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">sudo mkdir -p /etc/giteasudo vim /etc/gitea/app.ini</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">配置内容：</span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:SdaaTK_c4wb;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">[server]HTTP_PORT = 3000DOMAIN = your-server-ipROOT_URL = http://your-server-ip:3000/\\\n[database]DB_TYPE = sqlite3PATH = /Users/git/gitea/data/gitea.db\\\n[repository]ROOT = /Users/git/gitea-repositories\\\n[security]INSTALL_LOCK = falseSECRET_KEY = your-secret-key-here</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">创建启动脚本：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:Ueo0SepG_oS;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">sudo vim /Library/LaunchDaemons/com.gitea.gitea.plist</div><div style=\\\"--en-codeblock:true;--en-blockId:HFN_QamhkCB;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;&lt;plist version=&quot;1.0&quot;&gt;&lt;dict&gt;    &lt;key&gt;Label&lt;/key&gt;    &lt;string&gt;com.gitea.gitea&lt;/string&gt;\\\n    &lt;key&gt;ProgramArguments&lt;/key&gt;    &lt;array&gt;        &lt;string&gt;/usr/local/bin/gitea&lt;/string&gt;        &lt;string&gt;web&lt;/string&gt;        &lt;string&gt;--config&lt;/string&gt;        &lt;string&gt;/etc/gitea/app.ini&lt;/string&gt;    &lt;/array&gt;\\\n    &lt;key&gt;RunAtLoad&lt;/key&gt;    &lt;true/&gt;\\\n    &lt;key&gt;KeepAlive&lt;/key&gt;    &lt;true/&gt;\\\n    &lt;key&gt;UserName&lt;/key&gt;    &lt;string&gt;git&lt;/string&gt;\\\n    &lt;key&gt;StandardErrorPath&lt;/key&gt;    &lt;string&gt;/var/log/gitea.error.log&lt;/string&gt;\\\n    &lt;key&gt;StandardOutPath&lt;/key&gt;    &lt;string&gt;/var/log/gitea.out.log&lt;/string&gt;&lt;/dict&gt;&lt;/plist&gt;</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">在 frpc.toml 中添加 Gitea 代理：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:pd_JTWOw3iR;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 在现有的 frpc.toml 文件中添加[[proxies]]name = &quot;gitea&quot;type = &quot;tcp&quot;localIP = &quot;127.0.0.1&quot;localPort = 3000remotePort = 3000</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">现在你可以通过 </span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: #1e6bb8;\\\">http://your-server-ip:3000</span></span></code></span> 访问你的私人 Git 服务。</p><h3 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiQUdVS1JLVVRoY20ifQ==;\\\"><span style=\\\"font-size: 20px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">5.4 媒体中心：搭建 Plex、Jellyfin</span></span></span></h3><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiLVg4LVNPYkZSeXQifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">使用 Plex 搭建媒体中心</span></span></span></h4><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">安装 Plex Media Server：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:eTUxQ62cxP7;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 下载 Plex# 从官网下载：https://www.plex.tv/media-server-downloads/\\\n# 安装后，Plex 会自动启动并监听 32400 端口</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">在 frpc.toml 中添加 Plex 代理：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:Sqf7SiDII-2;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 在现有的 frpc.toml 文件中添加[[proxies]]name = &quot;plex&quot;type = &quot;tcp&quot;localIP = &quot;127.0.0.1&quot;localPort = 32400remotePort = 32400</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">配置媒体库：</span></b></span></span></p><ol><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">访问 </span></span><span style=\\\"font-size: 14px;\\\"><code style=\\\"-en-code: true\\\"><span style=\\\"font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;\\\"><span style=\\\"color: #1e6bb8;\\\"><span style=\\\"font-weight: 500;\\\">http://your-server-ip:32400/web</span></span></span></code></span></div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">创建媒体库，指向你的视频文件目录</span></span></div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">Plex 会自动扫描并整理媒体文件</span></span></div></li></ol><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiaUJxNFF5RjlXRTIifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">使用 Jellyfin（开源替代方案）</span></span></span></h4><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">使用 Docker 安装 Jellyfin：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:1qXRSGXDNEw;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">docker run -d \\\\  --name jellyfin \\\\  -p 8096:8096 \\\\  -v jellyfin_config:/config \\\\  -v jellyfin_cache:/cache \\\\  -v /path/to/media:/media \\\\  jellyfin/jellyfin:latest</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">在 frpc.toml 中添加代理：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:6zYTRmRF-jf;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 在现有的 frpc.toml 文件中添加[[proxies]]name = &quot;jellyfin&quot;type = &quot;tcp&quot;localIP = &quot;127.0.0.1&quot;localPort = 8096remotePort = 8096</div><h3 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiNkFTb1NDNFRPNGgifQ==;\\\"><span style=\\\"font-size: 20px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">5.5 轻量应用托管：Node.js、FastAPI、小型网站</span></span></span></h3><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiN0V6d1M2SGlydGwifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">托管 Node.js 应用</span></span></span></h4><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">示例：简单的 Express 应用</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:Ay_JTeFb9PQ;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">// app.jsconst express = require('express');const app = express();const port = 3001;\\\napp.get('/', (req, res) =&gt; {  res.send('Hello from Mac mini Server!');});\\\napp.listen(port, () =&gt; {  console.log(`Server running at http://localhost:${port}`);});</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">使用 PM2 管理 Node.js 应用：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:Zd0qQyYTBX2;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 安装 PM2npm install -g pm2\\\n# 启动应用pm2 start app.js --name &quot;my-app&quot;\\\n# 设置开机自启pm2 startuppm2 save</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">在 frpc.toml 中添加代理：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:iArGQ2NvlnE;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 在现有的 frpc.toml 文件中添加[[proxies]]name = &quot;nodejs-app&quot;type = &quot;tcp&quot;localIP = &quot;127.0.0.1&quot;localPort = 3001remotePort = 3001</div><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiUlNkMVFXSDE5MzkifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">托管 Python FastAPI 应用</span></span></span></h4><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">示例应用：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:eliFS6_Wsi8;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># main.pyfrom fastapi import FastAPIimport uvicorn\\\napp = FastAPI()\\\n@app.get(&quot;/&quot;)async def read_root():    return {&quot;message&quot;: &quot;Hello from Mac mini FastAPI!&quot;}\\\nif __name__ == &quot;__main__&quot;:    uvicorn.run(app, host=&quot;0.0.0.0&quot;, port=8000)</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">使用 systemd 管理（通过 Docker）：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:CgJ4S27gmsU;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># DockerfileFROM python:3.9-slim\\\nWORKDIR /appCOPY requirements.txt .RUN pip install -r requirements.txt\\\nCOPY . .EXPOSE 8000\\\nCMD [&quot;uvicorn&quot;, &quot;main:app&quot;, &quot;--host&quot;, &quot;0.0.0.0&quot;, &quot;--port&quot;, &quot;8000&quot;]\\\n# 构建并运行docker build -t my-fastapi .docker run -d --name my-fastapi -p 8000:8000 my-fastapi</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">在 frpc.toml 中添加代理：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:dix0T-O7PhD;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 在现有的 frpc.toml 文件中添加[[proxies]]name = &quot;fastapi&quot;type = &quot;tcp&quot;localIP = &quot;127.0.0.1&quot;localPort = 8000remotePort = 8000</div><h2 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiWVUwelFXNEJGWWcifQ==;\\\"><span style=\\\"font-size: 22px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">六、安全与优化</span></span></span></h2><h3 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiSk5tY1F5R3lRdFAifQ==;\\\"><span style=\\\"font-size: 20px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">6.1 使用 frp 的 token/鉴权</span></span></span></h3><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">强化 token 安全：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:4ClaT-w1etb;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 生成一个强密码作为 tokenopenssl rand -base64 32# 输出类似：abc123def456ghi789jkl012mno345pqr678stu901vwx234yz=</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">在服务端和客户端配置文件中使用相同的强 token：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:u6xkSaYfImg;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># frps.toml 和 frpc.toml 中都要设置auth.method = &quot;token&quot;auth.token = &quot;abc123def456ghi789jkl012mno345pqr678stu901vwx234yz=&quot;</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">启用 TLS 加密：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:MTknSGTvfig;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># frps.tomlbindPort = 7000transport.tls.force = true\\\n# frpc.tomlserverAddr = &quot;your-server-ip&quot;serverPort = 7000transport.tls.enable = true</div><h3 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiY1hyeVIybjhkZVUifQ==;\\\"><span style=\\\"font-size: 20px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">6.2 配置云服务器的防火墙和安全组</span></span></span></h3><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoidjJfTlJDck5NdUEifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">使用 iptables 配置防火墙</span></span></span></h4><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">基础防火墙规则：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:DQtrTKqBM7e;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 清空现有规则sudo iptables -Fsudo iptables -Xsudo iptables -t nat -Fsudo iptables -t nat -X\\\n# 设置默认策略sudo iptables -P INPUT DROPsudo iptables -P FORWARD DROPsudo iptables -P OUTPUT ACCEPT\\\n# 允许本地回环sudo iptables -A INPUT -i lo -j ACCEPT\\\n# 允许已建立的连接sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT\\\n# 允许 SSH（22 端口）sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT\\\n# 允许 frp 端口sudo iptables -A INPUT -p tcp --dport 7000 -j ACCEPT  # frp 服务端口sudo iptables -A INPUT -p tcp --dport 6000 -j ACCEPT  # frp 仪表板\\\n# 允许代理端口（根据需要添加）sudo iptables -A INPUT -p tcp --dport 2222 -j ACCEPT  # SSH 代理sudo iptables -A INPUT -p tcp --dport 3000 -j ACCEPT  # Giteasudo iptables -A INPUT -p tcp --dport 8080 -j ACCEPT  # Web 应用\\\n# 保存规则sudo iptables-save &gt; /etc/iptables/rules.v4</div><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoibGh1Y1JlOVFtT1YifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">云服务商安全组配置</span></span></span></h4><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">阿里云安全组规则示例：</span></b></span></span></p><table style=\\\"--en-fitwindow:false;border-left:1px solid #d9d9d9;border-top:1px solid #d9d9d9;border-collapse:collapse;width:760px;\\\" width=\\\"760px\\\"><colgroup><col style=\\\"width: 190px;\\\"></col><col style=\\\"width: 190px;\\\"></col><col style=\\\"width: 190px;\\\"></col><col style=\\\"width: 190px;\\\"></col></colgroup><tbody><tr style=\\\"border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-right-style:initial; border-bottom-style:initial; border-left-style:initial; border-right-color:initial; border-bottom-color:initial; border-left-color:initial; border-image-source:initial; border-image-slice:initial; border-image-width:initial; border-image-outset:initial; border-image-repeat:initial; border-top-width:initial; border-top-style:initial; border-top-color:rgb(204, 204, 204);\\\"><th style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};background-color:rgb(240, 240, 240);border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div><span style=\\\"font-size: 16px;\\\"><span style=\\\"font-weight: bold;\\\">协议</span></span></div></th><th style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};background-color:rgb(240, 240, 240);border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div><span style=\\\"font-size: 16px;\\\"><span style=\\\"font-weight: bold;\\\">端口范围</span></span></div></th><th style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};background-color:rgb(240, 240, 240);border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div><span style=\\\"font-size: 16px;\\\"><span style=\\\"font-weight: bold;\\\">授权对象</span></span></div></th><th style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};background-color:rgb(240, 240, 240);border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div><span style=\\\"font-size: 16px;\\\"><span style=\\\"font-weight: bold;\\\">描述</span></span></div></th></tr><tr style=\\\"border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-right-style:initial; border-bottom-style:initial; border-left-style:initial; border-right-color:initial; border-bottom-color:initial; border-left-color:initial; border-image-source:initial; border-image-slice:initial; border-image-width:initial; border-image-outset:initial; border-image-repeat:initial; border-top-width:initial; border-top-style:initial; border-top-color:rgb(204, 204, 204);\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div><span style=\\\"font-size: 16px;\\\">TCP</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div><span style=\\\"font-size: 16px;\\\">22</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div><span style=\\\"font-size: 16px;\\\">0.0.0.0/0</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div><span style=\\\"font-size: 16px;\\\">SSH 登录</span></div></td></tr><tr style=\\\"border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-right-style:initial; border-bottom-style:initial; border-left-style:initial; border-right-color:initial; border-bottom-color:initial; border-left-color:initial; border-image-source:initial; border-image-slice:initial; border-image-width:initial; border-image-outset:initial; border-image-repeat:initial; border-top-width:initial; border-top-style:initial; border-top-color:rgb(204, 204, 204);\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div><span style=\\\"font-size: 16px;\\\">TCP</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div><span style=\\\"font-size: 16px;\\\">7000</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div><span style=\\\"font-size: 16px;\\\">0.0.0.0/0</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div><span style=\\\"font-size: 16px;\\\">frp 服务端口</span></div></td></tr><tr style=\\\"border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-right-style:initial; border-bottom-style:initial; border-left-style:initial; border-right-color:initial; border-bottom-color:initial; border-left-color:initial; border-image-source:initial; border-image-slice:initial; border-image-width:initial; border-image-outset:initial; border-image-repeat:initial; border-top-width:initial; border-top-style:initial; border-top-color:rgb(204, 204, 204);\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div><span style=\\\"font-size: 16px;\\\">TCP</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div><span style=\\\"font-size: 16px;\\\">6000</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div><span style=\\\"font-size: 16px;\\\">你的IP/32</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div><span style=\\\"font-size: 16px;\\\">frp 仪表板（限制访问）</span></div></td></tr><tr style=\\\"border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-right-style:initial; border-bottom-style:initial; border-left-style:initial; border-right-color:initial; border-bottom-color:initial; border-left-color:initial; border-image-source:initial; border-image-slice:initial; border-image-width:initial; border-image-outset:initial; border-image-repeat:initial; border-top-width:initial; border-top-style:initial; border-top-color:rgb(204, 204, 204);\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div><span style=\\\"font-size: 16px;\\\">TCP</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div><span style=\\\"font-size: 16px;\\\">2222</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div><span style=\\\"font-size: 16px;\\\">0.0.0.0/0</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div><span style=\\\"font-size: 16px;\\\">SSH 代理端口</span></div></td></tr><tr style=\\\"border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-right-style:initial; border-bottom-style:initial; border-left-style:initial; border-right-color:initial; border-bottom-color:initial; border-left-color:initial; border-image-source:initial; border-image-slice:initial; border-image-width:initial; border-image-outset:initial; border-image-repeat:initial; border-top-width:initial; border-top-style:initial; border-top-color:rgb(204, 204, 204);\\\"><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div><span style=\\\"font-size: 16px;\\\">TCP</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div><span style=\\\"font-size: 16px;\\\">3000-8999</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div><span style=\\\"font-size: 16px;\\\">0.0.0.0/0</span></div></td><td style=\\\"--en-typeInfo:{&quot;type&quot;:&quot;text&quot;,&quot;data&quot;:{}};border-right:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9;padding:10px;text-align:left;\\\"><div><span style=\\\"font-size: 16px;\\\">应用端口范围</span></div></td></tr></tbody></table><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">腾讯云防火墙规则类似配置。</span></b></span></span></p><h3 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiR0t0SlJtY1FIRGcifQ==;\\\"><span style=\\\"font-size: 20px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">6.3 为 Mac mini 启用 SSH Key 登录，关闭密码登录</span></span></span></h3><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiSkh0VlFHellINXQifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">生成和配置 SSH 密钥</span></span></span></h4><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">在客户端生成密钥对：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:uaK0R-KYBsG;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 生成 RSA 密钥（推荐 4096 位）ssh-keygen -t rsa -b 4096 -C &quot;your-email@example.com&quot;\\\n# 或生成 Ed25519 密钥（更安全）ssh-keygen -t ed25519 -C &quot;your-email@example.com&quot;\\\n# 密钥默认保存在 ~/.ssh/id_rsa（或 id_ed25519）</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">将公钥复制到 Mac mini：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:aQ8vSakRdKp;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 方法一：使用 ssh-copy-idssh-copy-id -p 2222 username@your-server-ip\\\n# 方法二：手动复制cat ~/.ssh/id_rsa.pub | ssh -p 2222 username@your-server-ip 'mkdir -p ~/.ssh &amp;&amp; cat &gt;&gt; ~/.ssh/authorized_keys'\\\n# 方法三：直接在 Mac mini 上操作# 在 Mac mini 上：mkdir -p ~/.sshchmod 700 ~/.sshvim ~/.ssh/authorized_keys# 粘贴公钥内容chmod 600 ~/.ssh/authorized_keys</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">修改 SSH 配置禁用密码登录：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:hlOETOaiDD7;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 在 Mac mini 上编辑 SSH 配置sudo vim /etc/ssh/sshd_config</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">关键配置修改：</span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:cnDEQusnJgh;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 禁用密码登录PasswordAuthentication noChallengeResponseAuthentication no\\\n# 启用密钥登录PubkeyAuthentication yesAuthorizedKeysFile .ssh/authorized_keys\\\n# 禁用空密码PermitEmptyPasswords no\\\n# 禁用 root 登录PermitRootLogin no\\\n# 限制登录尝试MaxAuthTries 3\\\n# 指定允许登录的用户（可选）AllowUsers your_username</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">重启 SSH 服务：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:PcQTT-ZKM-b;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">sudo launchctl unload /System/Library/LaunchDaemons/ssh.plistsudo launchctl load /System/Library/LaunchDaemons/ssh.plist</div><h3 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiaE41RVFLWF9XZ1IifQ==;\\\"><span style=\\\"font-size: 20px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">6.4 frp 流量加密压缩参数</span></span></span></h3><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoibXhJdlJldFcwaTAifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">启用数据压缩</span></span></span></h4><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">在 frpc.toml 中启用压缩：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:zwhlRieIgXI;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">serverAddr = &quot;your-server-ip&quot;serverPort = 7000auth.method = &quot;token&quot;auth.token = &quot;your-secret-token&quot;\\\n# 启用数据压缩transport.useCompression = true\\\n# 为特定代理启用压缩[[proxies]]name = &quot;ssh&quot;type = &quot;tcp&quot;localIP = &quot;127.0.0.1&quot;localPort = 22remotePort = 2222transport.useCompression = true</div><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiNG5HdVQtSTdGM1UifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">配置带宽限制</span></span></span></h4><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">限制带宽使用：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:VIgHQGKpLTv;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># frps.toml 中限制总带宽bindPort = 7000transport.bandwidthLimit = &quot;100MB&quot;  # 限制总带宽为 100MB/s\\\n# frpc.toml 中为特定代理限制带宽[[proxies]]name = &quot;ssh&quot;type = &quot;tcp&quot;localIP = &quot;127.0.0.1&quot;localPort = 22remotePort = 2222transport.bandwidthLimit = &quot;1MB&quot;  # 限制此代理带宽为 1MB/s</div><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiN0Fqa1RlMjRjRG8ifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">启用端口复用优化</span></span></span></h4><div style=\\\"--en-codeblock:true;--en-blockId:n7QqQuDn_OI;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># frps.toml 和 frpc.toml 中都启用transport.tcpMux = truetransport.tcpMuxKeepaliveInterval = 60</div><h3 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiX3JHM1RPNl9uOWsifQ==;\\\"><span style=\\\"font-size: 20px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">6.5 资源监控与日志查看</span></span></span></h3><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiNWFaWVFtaDBiMnMifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">设置日志轮转</span></span></span></h4><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">配置 logrotate：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:0XlxRO8_j3V;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 在云服务器上创建 logrotate 配置sudo vim /etc/logrotate.d/frp</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">配置内容：</span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:OzdZTCnM9EZ;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">/var/log/frps.log {    daily    missingok    rotate 7    compress    delaycompress    notifempty    create 644 nobody nobody    postrotate        systemctl reload frps &gt; /dev/null 2&gt;&amp;1 || true    endscript}</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">在 Mac mini 上设置日志管理：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:vQCwQGPVxPF;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 使用 newsyslog 管理日志sudo vim /etc/newsyslog.conf</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">添加行：</span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:0PzwSSEtE7G;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\">/var/log/frpc.log    644  5     1000  *     Z</div><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiZ3B3Z1JhM1FLTHQifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">监控系统资源</span></span></span></h4><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">创建简单的监控脚本：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:2ZvSQGvT8Tb;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># monitor.sh#!/bin/bash\\\n# 检查 frp 进程状态if ! pgrep -f &quot;frpc&quot; &gt; /dev/null; then    echo &quot;$(date): frpc is not running, restarting...&quot; &gt;&gt; /var/log/frp_monitor.log    sudo launchctl start com.frp.frpcfi\\\n# 检查磁盘使用率DISK_USAGE=$(df / | awk 'NR==2 {print $5}' | sed 's/%//')if [ $DISK_USAGE -gt 80 ]; then    echo &quot;$(date): Disk usage is ${DISK_USAGE}%&quot; &gt;&gt; /var/log/frp_monitor.logfi\\\n# 检查内存使用率MEMORY_USAGE=$(vm_stat | grep &quot;Pages free&quot; | awk '{print $3}' | sed 's/\\\\.//')echo &quot;$(date): System status check completed&quot; &gt;&gt; /var/log/frp_monitor.log</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">设置定时任务：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:dft3QOkesRk;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 编辑 crontabcrontab -e\\\n# 添加监控任务（每 5 分钟检查一次）*/5 * * * * /path/to/monitor.sh</div><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiLUlwVVRxNzJkbEMifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">查看连接状态和性能</span></span></span></h4><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">查看 frp 连接状态：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:3Qj8TWuFGrd;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 访问 frps 仪表板curl -u admin:password http://your-server-ip:6000/api/status\\\n# 查看当前连接curl -u admin:password http://your-server-ip:6000/api/proxy/tcp</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">监控网络流量：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:mKULQyfQWIz;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 使用 nettop 监控网络使用sudo nettop -m tcp\\\n# 使用 iftop 监控流量（需安装）brew install iftopsudo iftop -i en0</div><h2 style=\\\"color:black;other-props:eyJibG9ja0lkIjoicXZiZ1RxcV9ESkYifQ==;\\\"><span style=\\\"font-size: 22px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">七、总结与展望</span></span></span></h2><h3 style=\\\"color:black;other-props:eyJibG9ja0lkIjoianlfN1RhcGdqU2gifQ==;\\\"><span style=\\\"font-size: 20px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">闲置设备的价值再利用</span></span></span></h3><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">通过这篇文章的实践，我们成功将一台闲置的 Mac mini 改造成了功能强大的个人服务器。这种改造的价值体现在：</span></span></p><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">经济效益：</span></b></span></span></p><ul><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">避免了购买专业服务器的高昂成本</span></span></div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">充分利用现有硬件资源，降低设备闲置浪费</span></span></div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">云服务器成本相对较低（月费用 20-60 元）</span></span></div></li></ul><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">功能完整性：</span></b></span></span></p><ul><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">实现了多种实用功能：远程开发、文件存储、代码托管、媒体中心</span></span></div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">满足个人和小团队的大部分需求</span></span></div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">性能足以支撑中等规模的应用负载</span></span></div></li></ul><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">技术成长：</span></b></span></span></p><ul><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">学习了 frp 内网穿透技术</span></span></div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">掌握了 macOS 服务器配置和管理</span></span></div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">提升了网络安全和系统运维能力</span></span></div></li></ul><h3 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiWk1CSFRHTHpYSWEifQ==;\\\"><span style=\\\"font-size: 20px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">frp 的更多玩法</span></span></span></h3><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">除了本文介绍的基础应用场景，frp 还有更多高级用法：</span></span></p><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiVlhLLVN1U3hRS0oifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">多端口代理和负载均衡</span></span></span></h4><div style=\\\"--en-codeblock:true;--en-blockId:3xwyQmmYW8u;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 负载均衡配置示例[[proxies]]name = &quot;web1&quot;type = &quot;tcp&quot;localIP = &quot;127.0.0.1&quot;localPort = 8001remotePort = 8080loadBalancer.group = &quot;web&quot;loadBalancer.groupKey = &quot;123456&quot;\\\n[[proxies]]name = &quot;web2&quot;type = &quot;tcp&quot;localIP = &quot;127.0.0.1&quot;localPort = 8002remotePort = 8080loadBalancer.group = &quot;web&quot;loadBalancer.groupKey = &quot;123456&quot;</div><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiOEVGcFNxWE9zMHYifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">HTTP/HTTPS 代理和自定义域名</span></span></span></h4><div style=\\\"--en-codeblock:true;--en-blockId:1dnjSuMzuSy;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># HTTP 代理配置[[proxies]]name = &quot;web-http&quot;type = &quot;http&quot;localPort = 8080customDomains = [&quot;your-domain.com&quot;]\\\n[[proxies]]name = &quot;web-https&quot;type = &quot;https&quot;localPort = 8080customDomains = [&quot;secure.your-domain.com&quot;]</div><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoia0JGelFPYy1VNW8ifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">UDP 代理和 P2P 连接</span></span></span></h4><div style=\\\"--en-codeblock:true;--en-blockId:zFpSSOIwChv;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># UDP 代理（适用于游戏服务器等）[[proxies]]name = &quot;game-server&quot;type = &quot;udp&quot;localIP = &quot;127.0.0.1&quot;localPort = 7777remotePort = 7777\\\n# P2P 连接[[proxies]]name = &quot;p2p-ssh&quot;type = &quot;xtcp&quot;secretKey = &quot;your-secret-key&quot;localIP = &quot;127.0.0.1&quot;localPort = 22</div><h3 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiY3ZuMlJhMXNRNnoifQ==;\\\"><span style=\\\"font-size: 20px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">后续可扩展方案</span></span></span></h3><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiWkdtcFNDTUstYjcifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">结合 Docker 容器化部署</span></span></span></h4><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">创建 Docker Compose 配置：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:ddFqSWr4797;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># docker-compose.ymlversion: '3.8'services:  gitea:    image: gitea/gitea:latest    ports:      - &quot;3000:3000&quot;    volumes:      - gitea_data:/data    restart: always\\\n  nextcloud:    image: nextcloud:latest    ports:      - &quot;8080:80&quot;    volumes:      - nextcloud_data:/var/www/html    restart: always\\\n  jellyfin:    image: jellyfin/jellyfin:latest    ports:      - &quot;8096:8096&quot;    volumes:      - jellyfin_config:/config      - /Users/Shared/Media:/media    restart: always\\\nvolumes:  gitea_data:  nextcloud_data:  jellyfin_config:</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">这样可以更容易地管理多个服务，并且具有更好的隔离性和可移植性。</span></span></p><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiUjFtbVRDa1JQV1UifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">集成 Kubernetes（k8s）</span></span></span></h4><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">对于更复杂的场景，可以在 Mac mini 上搭建单节点 k8s 集群：</span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:bfgASK3PLMY;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 安装 k3s（轻量级 k8s）curl -sfL https://get.k3s.io | sh -\\\n# 部署应用kubectl apply -f your-app-deployment.yaml</div><h4 style=\\\"color:black;other-props:eyJibG9ja0lkIjoibHo5X1FDOG9ESEEifQ==;\\\"><span style=\\\"font-size: 18px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">家庭自动化集成（Home Assistant）</span></span></span></h4><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">安装 Home Assistant：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:y7obTC546zi;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 使用 Docker 安装docker run -d \\\\  --name homeassistant \\\\  --privileged \\\\  --restart=unless-stopped \\\\  -e TZ=Asia/Shanghai \\\\  -v homeassistant_config:/config \\\\  -p 8123:8123 \\\\  ghcr.io/home-assistant/home-assistant:stable</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">在 frpc.toml 中添加代理：</span></b></span></span></p><div style=\\\"--en-codeblock:true;--en-blockId:ZtmYS28JSVW;--en-meta:{&quot;title&quot;:&quot;&quot;,&quot;lang&quot;:&quot;Plain Text&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;showLine&quot;:true,&quot;lineWrap&quot;:true};box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial; margin-top: 6px;\\\"># 在现有的 frpc.toml 文件中添加[[proxies]]name = &quot;homeassistant&quot;type = &quot;tcp&quot;localIP = &quot;127.0.0.1&quot;localPort = 8123remotePort = 8123</div><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">这样你就可以远程控制家中的智能设备了。</span></span></p><h3 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiWlFjWlJXX2cwWlEifQ==;\\\"><span style=\\\"font-size: 20px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">性能优化建议</span></span></span></h3><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">硬件优化：</span></b></span></span></p><ul><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">升级到 SSD 存储以提升 I/O 性能</span></span></div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">增加内存支持更多并发服务</span></span></div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">考虑外接网络存储（NAS）扩展容量</span></span></div></li></ul><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">软件优化：</span></b></span></span></p><ul><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">定期清理日志和临时文件</span></span></div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">使用 SSD 优化的文件系统设置</span></span></div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">配置合理的服务启动顺序</span></span></div></li></ul><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\"><b><span style=\\\"font-weight: bold;\\\">网络优化：</span></b></span></span></p><ul><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">升级家庭宽带带宽</span></span></div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">使用有线连接而非 Wi-Fi</span></span></div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">优化 frp 参数和压缩设置</span></span></div></li></ul><h3 style=\\\"color:black;other-props:eyJibG9ja0lkIjoiUF9CblJlcUYzLXEifQ==;\\\"><span style=\\\"font-size: 20px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">结语</span></span></span></h3><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">将闲置的 Mac mini 改造成个人服务器是一个非常有价值的项目。它不仅能够满足我们的实际需求，还能让我们学习到很多有用的技术知识。</span></span></p><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">随着云原生技术的发展，个人服务器的可能性越来越大。无论是作为学习平台、开发环境，还是家庭数据中心，Mac mini 都能够胜任。</span></span></p><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">希望这篇文章能够帮助你成功搭建自己的个人服务器，让闲置的设备重新焕发生机！</span></span></p><hr/><h2 style=\\\"color:black;other-props:eyJibG9ja0lkIjoidk1VT1RHMnJtVzIifQ==;\\\"><span style=\\\"font-size: 22px;\\\"><span style=\\\"color: black;\\\"><span style=\\\"font-weight: bold;\\\">参考资源</span></span></span></h2><ul><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">frp 官方文档</span></span></div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">frp GitHub 仓库</span></span></div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">Gitea 官方网站</span></span></div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">Nextcloud 官方网站</span></span></div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">Plex 媒体服务器</span></span></div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">Home Assistant 官方文档</span></span></div></li><li><div style=\\\"color:rgb(1, 1, 1);\\\"><span style=\\\"color: rgb(1,1,1);\\\"><span style=\\\"font-weight: 500;\\\">Docker 官方文档</span></span></div></li></ul><p style=\\\"color:black;\\\"><span style=\\\"font-size: 16px;\\\"><span style=\\\"color: black;\\\">💡 <b><span style=\\\"font-weight: bold;\\\">提示</span></b></span>：在实际部署过程中，请根据自己的具体情况调整配置参数，并注意数据备份和安全防护。</span></p><div>阅读原文</div></span>\\\n</div></body></html>\\u0000\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":118750}]"
metadata_diff: {"new":{"id":"67d425345e604598b2683c5309ea6594","parent_id":"061de1401cfc4cfaadf6e74e015970e9","latitude":"0.00000000","longitude":"0.00000000","altitude":"0.0000","author":"","source_url":"","is_todo":0,"todo_due":0,"todo_completed":0,"source":"joplin-desktop","source_application":"net.cozic.joplin-desktop","application_data":"","order":1764345823814,"markup_language":2,"is_shared":0,"share_id":"","conflict_original_id":"","master_key_id":"","user_data":"","deleted_time":0},"deleted":[]}
encryption_cipher_text: 
encryption_applied: 0
updated_time: 2025-11-28T16:20:18.602Z
created_time: 2025-11-28T16:20:18.602Z
type_: 13