{"slug":"n100-pve","title":"N100 - PVE（fnOS+Debian）基建记录","description":"在N100小主机上安装PVE，然后在其中安装飞牛NAS和Debian，实现追番建站分离，并且易扩展，易迁移","coverImage":"https://b.acofork.com/img/n100-pve-N100-PVE_cover.webp","coverWidth":429,"coverHeight":300,"date":"2024-10-27","tags":["服务器"],"pinned":false,"wordCount":2444,"html":"<h2 id=\"配置-需求\">配置&amp;需求</h2><ul>\n<li><p>N100 CPU 频率：最小 700 Mhz, 最大 3400 Mhz | TDP：6 W</p>\n</li>\n<li><p>8G RAM</p>\n</li>\n<li><p>128G M.2 NVme SSD</p>\n</li>\n<li><p>512G SATA HDD</p>\n</li>\n<li><p>Realtek R8168 有线网卡</p>\n</li>\n<li><p>USB有线网卡</p>\n</li>\n<li><p>U盘（作PVE引导盘）</p>\n</li>\n</ul>\n<h2 id=\"目标\">目标</h2><ol>\n<li><p>所有系统通过PVE管理</p>\n</li>\n<li><p>PVE下安装fnOS，作NAS并配置自动追番（直通：<code>N100核显</code> <code>512G SATA HDD</code> ）</p>\n</li>\n<li><p>PVE下安装Debian，搭建QQBot、博客、AList</p>\n</li>\n</ol>\n<hr />\n<h2 id=\"1-pve\">1. PVE</h2><h3 id=\"安装\">安装</h3><ul>\n<li><p>下载Ventoy最新版可执行文件：</p>\n<p><a href=\"https://www.ventoy.net/cn/download.html\" target=\"_blank\" rel=\"noopener noreferrer\">https://www.ventoy.net/cn/download.html</a></p>\n<ul>\n<li>使用GPT分区表，NTFS格式将Ventoy写入U盘</li>\n</ul>\n</li>\n<li><p>下载PVE最新版ISO（使用USTC镜像源）：</p>\n<p><a href=\"https://mirrors.ustc.edu.cn/help/proxmox.html\" target=\"_blank\" rel=\"noopener noreferrer\">https://mirrors.ustc.edu.cn/help/proxmox.html</a></p>\n<ul>\n<li>将PVE的ISO文件放入U盘根目录</li>\n</ul>\n</li>\n<li><p>插入USB网卡，U盘连接到到N100，开机从U盘启动，进入PVE安装界面，安装PVE。网络配置选择USB网卡</p>\n</li>\n<li><p>重启，进入PVE，通过IP+8006端口进入WebUI，登录进去</p>\n</li>\n</ul>\n<h3 id=\"配置\">配置</h3><h4 id=\"安装pve快捷管理脚本\">安装PVE快捷管理脚本</h4><ul>\n<li><p>安装PVE快捷管理脚本：<a href=\"https://alist.onani.cn/pve_source.tar.gz\" target=\"_blank\" rel=\"noopener noreferrer\">pve_source.tar.gz | AcoFork-AList</a> 或 <a href=\"https://wwp.lanzoul.com/ivHta1ngmo6d\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>https://wwp.lanzoul.com/ivHta1ngmo6d</strong></a> （密码:i1ws）（来自：在下莫老师）</p>\n<ul>\n<li><p>解压：<code>tar zxvf pve_source.tar.gz</code></p>\n</li>\n<li><p>运行：<code>./pve_source</code></p>\n</li>\n<li><p>同意许可协议</p>\n</li>\n<li><p>依次执行白框操作<img src=\"https://b.acofork.com/img/n100-pve-ea205e1a00e7029dfa4bd7850c5a6a68d6d4c0d9.webp\" alt=\"\" width=\"561\" height=\"629\" loading=\"eager\" decoding=\"async\" /></p>\n</li>\n<li><p>扩容local：<code>lvextend -rl +100%FREE /dev/pve/root</code></p>\n</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"配置realtek-r8168网卡\">配置Realtek R8168网卡</h4><blockquote>\n<p>由于Debian系默认安装R8169驱动，我们需要手动安装R8168驱动，否则无法使用N100小主机自带的有线网口上网</p>\n</blockquote>\n<ul>\n<li><p>下载驱动：</p>\n<p><a href=\"https://www.realtek.com/Download/List?cate_id=584\" target=\"_blank\" rel=\"noopener noreferrer\">https://www.realtek.com/Download/List?cate_id=584</a><img src=\"https://b.acofork.com/img/n100-pve-0d8457c7fb0d497e12e2c8b544f07c3c37cf96cd.webp\" alt=\"\" width=\"1920\" height=\"926\" loading=\"lazy\" decoding=\"async\" /></p>\n</li>\n<li><p>解压，安装：<code>sh autorun.sh</code></p>\n</li>\n<li><p>查看是否有新的网络接口：<code>ip a</code></p>\n</li>\n<li><div class=\"markdown-code\" data-language=\"shell\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12 19h8\"></path><path d=\"m4 17 6-6-6-6\"></path></svg><span>shell</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-shell\">root@n100-pve:~# ip a\n...\n2: enp3s0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc mq master vmbr1 state UP group default qlen 1000\n    <span class=\"hljs-built_in\">link</span>/ether 00:e0:4c:08:91:a6 brd ff:ff:ff:ff:ff:ff\n...</code></pre></div></li>\n<li><p>配置网络配置文件：<code>nano /etc/network/interfaces</code></p>\n<div class=\"markdown-code\" data-language=\"text\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path></svg><span>text</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-text\"># network interface settings; autogenerated\n# Please do NOT modify this file directly, unless you know what\n# you're doing.\n#\n# If you want to manage parts of the network configuration manually,\n# please utilize the 'source' or 'source-directory' directives to do\n# so.\n# PVE will preserve these directives, but will NOT read its network\n# configuration from sourced files, so do not attempt to move any of\n# the PVE managed interfaces into external files!\n\nauto lo\niface lo inet loopback\n\niface wlp1s0 inet manual\n\niface enp3s0 inet manual\n\nauto vmbr1\niface vmbr1 inet static\n        address 192.168.124.25/24\n        gateway 192.168.124.1\n        bridge-ports enp3s0\n        bridge-stp off\n        bridge-fd 0\n\niface vmbr1 inet6 auto\n        dhcp 1\n        accept_ra 2\n        request_prefix 1\n\nsource /etc/network/interfaces.d/*</code></pre></div></li>\n<li><p>重启网络服务：<code>systemctl restart networking</code></p>\n</li>\n<li><p>查看ip：<code>ip a</code></p>\n<div class=\"markdown-code\" data-language=\"shell\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12 19h8\"></path><path d=\"m4 17 6-6-6-6\"></path></svg><span>shell</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-shell\">root@n100-pve:~# ip a\n...\n2: enp3s0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc mq master vmbr1 state UP group default qlen 1000\n    <span class=\"hljs-built_in\">link</span>/ether 00:e0:4c:08:91:a6 brd ff:ff:ff:ff:ff:ff\n...\n4: vmbr1: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc noqueue state UP group default qlen 1000\n    <span class=\"hljs-built_in\">link</span>/ether 00:e0:4c:08:91:a6 brd ff:ff:ff:ff:ff:ff\n    inet 192.168.124.25/24 scope global vmbr1\n       valid_lft forever preferred_lft forever\n    inet6 2409:8a30:320:7fc0:2e0:4cff:fe08:91a6/64 scope global dynamic mngtmpaddr\n       valid_lft 2763sec preferred_lft 2762sec\n    inet6 fe80::2e0:4cff:fe08:91a6/64 scope <span class=\"hljs-built_in\">link</span>\n       valid_lft forever preferred_lft forever</code></pre></div></li>\n<li><p>卸除USB网卡</p>\n</li>\n</ul>\n<h3 id=\"配置stun穿透\">配置STUN穿透</h3><h4 id=\"路由器设置dmz主机为pveip\">路由器设置DMZ主机为PVEIP</h4><ul>\n<li><img src=\"https://b.acofork.com/img/n100-pve-dbeb7980e5fc699c696ffa6f2fda4a17c05ee821.webp\" alt=\"\" width=\"764\" height=\"125\" loading=\"lazy\" decoding=\"async\" /></li>\n</ul>\n<h4 id=\"安装lucky\">安装Lucky</h4><ul>\n<li><p>执行：<code>curl -o /tmp/install.sh http://6.666666.host:6/files/golucky.sh &amp;&amp; sh /tmp/install.sh http://6.666666.host:6/files 2.13.4</code></p>\n</li>\n<li><p>通过<code>host:16601</code> 进入Lucky后台，设置STUN穿透</p>\n</li>\n<li><p><img src=\"https://b.acofork.com/img/n100-pve-2175839424184aee880b91382bd1fbf3c578d258.webp\" alt=\"\" width=\"512\" height=\"284\" loading=\"lazy\" decoding=\"async\" /></p>\n</li>\n</ul>\n<h2 id=\"2-fnos\">2. fnOS</h2><h2 id=\"安装-2\">安装</h2><ul>\n<li><p>前往官网下载最新版ISO：</p>\n<p><a href=\"https://www.fnnas.com/\" target=\"_blank\" rel=\"noopener noreferrer\">https://www.fnnas.com/</a></p>\n</li>\n<li><p>上传至PVE：<img src=\"https://b.acofork.com/img/n100-pve-073808516d357e099a866c30b4a77954c5b9b458.webp\" alt=\"\" width=\"1920\" height=\"926\" loading=\"lazy\" decoding=\"async\" /></p>\n</li>\n<li><p>创建fnOS虚拟机，CPU类型选择host，步骤略</p>\n</li>\n<li><p>直通核显和硬盘：<img src=\"https://b.acofork.com/img/n100-pve-08e4f7a3b87ae86334011e1d4c3a384a36ad9866.webp\" alt=\"\" width=\"1912\" height=\"920\" loading=\"lazy\" decoding=\"async\" /></p>\n</li>\n<li><p>如果你不知道你的核显和SATA控制器的PCI ID：<code>lspci</code></p>\n<ul>\n<li><p>可见核显为<code>00:02.0</code>，SATA控制器为<code>00:17.0</code></p>\n<div class=\"markdown-code\" data-language=\"shell\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12 19h8\"></path><path d=\"m4 17 6-6-6-6\"></path></svg><span>shell</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-shell\">root@n100-pve:~# lspci\n00:00.0 Host bridge: Intel Corporation Device 461c\n00:02.0 VGA compatible controller: Intel Corporation Alder Lake-N [UHD Graphics]\n00:0a.0 Signal processing controller: Intel Corporation Platform Monitoring Technology (rev 01)\n00:14.0 USB controller: Intel Corporation Alder Lake-N PCH USB 3.2 xHCI Host Controller\n00:14.2 RAM memory: Intel Corporation Alder Lake-N PCH Shared SRAM\n00:16.0 Communication controller: Intel Corporation Alder Lake-N PCH HECI Controller\n00:17.0 SATA controller: Intel Corporation Alder Lake-N SATA AHCI Controller\n00:1a.0 SD Host controller: Intel Corporation Device 54c4\n00:1c.0 PCI bridge: Intel Corporation Device 54be\n00:1d.0 PCI bridge: Intel Corporation Alder Lake-N PCI Express Root Port\n00:1d.1 PCI bridge: Intel Corporation Alder Lake-N PCI Express Root Port\n00:1e.0 Communication controller: Intel Corporation Alder Lake-N Serial IO UART Host Controller\n00:1e.3 Serial bus controller: Intel Corporation Device 54ab\n00:1f.0 ISA bridge: Intel Corporation Alder Lake-N PCH eSPI Controller\n00:1f.3 Audio device: Intel Corporation Alder Lake-N PCH High Definition Audio Controller\n00:1f.4 SMBus: Intel Corporation Alder Lake-N SMBus\n00:1f.5 Serial bus controller: Intel Corporation Alder Lake-N SPI (flash) Controller\n01:00.0 Network controller: Intel Corporation Wireless 3160 (rev 83)\n02:00.0 Non-Volatile memory controller: Realtek Semiconductor Co., Ltd. RTS5765DL NVMe SSD Controller (DRAM-less) (rev 01)\n03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 2b)</code></pre></div></li>\n</ul>\n</li>\n<li><p>启动虚拟机，安装fnOS</p>\n</li>\n</ul>\n<h2 id=\"配置-2\">配置</h2><ul>\n<li><p>前往飞牛设置，创建储存空间，Linear模式，选择刚才直通的硬盘<img src=\"https://b.acofork.com/img/n100-pve-581cf01462df545a8662acbb5e20e1676bd17744.webp\" alt=\"\" width=\"1100\" height=\"640\" loading=\"lazy\" decoding=\"async\" /></p>\n</li>\n<li><p>前往飞牛应用中心安装qBittorrent、影视，并且在设置给予目录读取权限<img src=\"https://b.acofork.com/img/n100-pve-92a2e0bf25d630db4858775fdbb6c907f419c25d.webp\" alt=\"\" width=\"1100\" height=\"640\" loading=\"lazy\" decoding=\"async\" /></p>\n</li>\n<li><p>配置qBittorrent的用户名和密码</p>\n</li>\n<li><p>打开飞牛Docker，初始化</p>\n</li>\n<li><p>拉取并运行AutoBangumi Docker镜像：</p>\n<div class=\"markdown-code\" data-language=\"shell\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12 19h8\"></path><path d=\"m4 17 6-6-6-6\"></path></svg><span>shell</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-shell\">docker run -d \\\n--name=AutoBangumi \\\n-v /vol1/1000/AutoBangumi/config:/app/config \\\n-v /vol1/1000/AutoBangumi/data:/app/data \\\n-p 7892:7892 \\\n-e TZ=Asia/Shanghai \\\n-e PUID=$(<span class=\"hljs-built_in\">id</span> -u) \\\n-e PGID=$(<span class=\"hljs-built_in\">id</span> -g) \\\n-e UMASK=022 \\\n--network=bridge \\\n--dns=8.8.8.8 \\\n--restart unless-stopped \\\nghcr.onani.cn/estrellaxd/auto_bangumi:latest</code></pre></div></li>\n<li><p>进入<code>host:7892</code> 让AutoBangumi连接qBittorrent并配置下载地址<img src=\"https://b.acofork.com/img/n100-pve-82c4a003d2399f82a7ccf5849cd1d5858d5f1f61.webp\" alt=\"\" width=\"881\" height=\"326\" loading=\"lazy\" decoding=\"async\" /></p>\n</li>\n<li><p>添加RSS。可前往<a href=\"https://mikanime.tv/\" target=\"_blank\" rel=\"noopener noreferrer\">蜜柑计划 - Mikan Project</a>获得各个字幕组的RSS</p>\n<p><img src=\"https://b.acofork.com/img/n100-pve-f36daae968d8043bbcd1e4a2bbb9b9cd2d707cee.webp\" alt=\"\" width=\"1912\" height=\"920\" loading=\"lazy\" decoding=\"async\" /></p>\n<p>注意：使用<a href=\"https://mikanime.tv/\" target=\"_blank\" rel=\"noopener noreferrer\">蜜柑计划 - Mikan Project</a>时，请订阅单个字幕组的RSS，不要使用个人的RSS，会导致<strong>只能获取到你所有追番的最新一集而不是单个番的全部剧集</strong></p>\n</li>\n<li><p>打开飞牛影视，初始化并设置媒体库<img src=\"https://b.acofork.com/img/n100-pve-269b78c3b7dffe7f8cdb861098f44147552b5eb4.webp\" alt=\"\" width=\"1920\" height=\"926\" loading=\"lazy\" decoding=\"async\" /></p>\n<ul>\n<li><p>注意：如果要刮削旧集旧番，请规范重命名，可以使用自动化工具：<a href=\"https://alist.onani.cn/Episode-ReName.zip\" target=\"_blank\" rel=\"noopener noreferrer\">Episode-ReName.zip | AcoFork-AList</a></p>\n<ul>\n<li><p>一级目录：即qb下载目录，无需重命名</p>\n</li>\n<li><p>二级目录：番剧名称</p>\n</li>\n<li><p>三级目录：季，如<code>Season 1</code></p>\n</li>\n<li><p>四级目录：集和字幕，如<code>S01E01.mp4</code> <code>S01E01.chs.ass</code></p>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n<h2 id=\"3-debian\">3. Debian</h2><h2 id=\"安装-3\">安装</h2><ul>\n<li><p>下载Debian12 ISO（USTC镜像源）（建议选择DVD镜像，包更全，安装更快）</p>\n<p><a href=\"https://mirrors.ustc.edu.cn/help/debian-cd.html\" target=\"_blank\" rel=\"noopener noreferrer\">https://mirrors.ustc.edu.cn/help/debian-cd.html</a></p>\n</li>\n<li><p>上传至PVE，创建Debian虚拟机，CPU类型选择host，步骤略</p>\n</li>\n</ul>\n<h3 id=\"安装1panel\">安装1Panel：</h3><p><a href=\"https://1panel.cn/docs/installation/online_installation/\" target=\"_blank\" rel=\"noopener noreferrer\">https://1panel.cn/docs/installation/online_installation/</a></p>\n<ul>\n<li>在1Panel中安装<code>Openresty</code> <code>MySQL</code> <code>Halo</code> <code>AList</code> <code>Cloudflared</code> 配置步骤略</li>\n</ul>\n<h3 id=\"搭建qqbot\">搭建QQBot</h3><h4 id=\"安装onebotv11协议实现-lagrange-onebot\">安装OneBotv11协议实现：Lagrange.OneBot</h4><ul>\n<li><p>Docker Run：<code>docker run -td -p 8081:8081 -v /root/qqbot/lo:/app/data -e UID=$UID -e GID=$(id -g) ghcr.onani.cn/lagrangedev/lagrange.onebot:edge</code></p>\n</li>\n<li><p>修改配置文件：<code>appsettings.json</code></p>\n<div class=\"markdown-code\" data-language=\"json\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1\"></path><path d=\"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 0-2-2V5a2 2 0 0 0-2-2h-1\"></path></svg><span>json</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-json\"><span class=\"hljs-punctuation\">{</span>\n    <span class=\"hljs-attr\">\"Logging\"</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-punctuation\">{</span>\n        <span class=\"hljs-attr\">\"LogLevel\"</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-punctuation\">{</span>\n            <span class=\"hljs-attr\">\"Default\"</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">\"Information\"</span><span class=\"hljs-punctuation\">,</span>\n            <span class=\"hljs-attr\">\"Microsoft\"</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">\"Warning\"</span><span class=\"hljs-punctuation\">,</span>\n            <span class=\"hljs-attr\">\"Microsoft.Hosting.Lifetime\"</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">\"Information\"</span>\n        <span class=\"hljs-punctuation\">}</span>\n    <span class=\"hljs-punctuation\">}</span><span class=\"hljs-punctuation\">,</span>\n    <span class=\"hljs-attr\">\"SignServerUrl\"</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">\"\"</span><span class=\"hljs-punctuation\">,</span>\n    <span class=\"hljs-attr\">\"SignProxyUrl\"</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">\"\"</span><span class=\"hljs-punctuation\">,</span>\n    <span class=\"hljs-attr\">\"MusicSignServerUrl\"</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">\"\"</span><span class=\"hljs-punctuation\">,</span>\n    <span class=\"hljs-attr\">\"Account\"</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-punctuation\">{</span>\n        <span class=\"hljs-attr\">\"Uin\"</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-number\">0</span><span class=\"hljs-punctuation\">,</span>\n        <span class=\"hljs-attr\">\"Password\"</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">\"\"</span><span class=\"hljs-punctuation\">,</span>\n        <span class=\"hljs-attr\">\"Protocol\"</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">\"Linux\"</span><span class=\"hljs-punctuation\">,</span>\n        <span class=\"hljs-attr\">\"AutoReconnect\"</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-literal\"><span class=\"hljs-keyword\">true</span></span><span class=\"hljs-punctuation\">,</span>\n        <span class=\"hljs-attr\">\"GetOptimumServer\"</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-literal\"><span class=\"hljs-keyword\">true</span></span>\n    <span class=\"hljs-punctuation\">}</span><span class=\"hljs-punctuation\">,</span>\n    <span class=\"hljs-attr\">\"Message\"</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-punctuation\">{</span>\n        <span class=\"hljs-attr\">\"IgnoreSelf\"</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-literal\"><span class=\"hljs-keyword\">true</span></span><span class=\"hljs-punctuation\">,</span>\n        <span class=\"hljs-attr\">\"StringPost\"</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-literal\"><span class=\"hljs-keyword\">false</span></span>\n    <span class=\"hljs-punctuation\">}</span><span class=\"hljs-punctuation\">,</span>\n    <span class=\"hljs-attr\">\"QrCode\"</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-punctuation\">{</span>\n        <span class=\"hljs-attr\">\"ConsoleCompatibilityMode\"</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-literal\"><span class=\"hljs-keyword\">false</span></span>\n    <span class=\"hljs-punctuation\">}</span><span class=\"hljs-punctuation\">,</span>\n    <span class=\"hljs-attr\">\"Implementations\"</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-punctuation\">[</span>\n        <span class=\"hljs-punctuation\">{</span>\n            <span class=\"hljs-attr\">\"Type\"</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">\"ReverseWebSocket\"</span><span class=\"hljs-punctuation\">,</span>\n            <span class=\"hljs-attr\">\"Host\"</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">\"192.168.124.34\"</span><span class=\"hljs-punctuation\">,</span>\n            <span class=\"hljs-attr\">\"Port\"</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-number\">9090</span><span class=\"hljs-punctuation\">,</span>\n            <span class=\"hljs-attr\">\"Suffix\"</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">\"/onebot/v11/ws\"</span><span class=\"hljs-punctuation\">,</span>\n            <span class=\"hljs-attr\">\"ReconnectInterval\"</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-number\">5000</span><span class=\"hljs-punctuation\">,</span>\n            <span class=\"hljs-attr\">\"HeartBeatInterval\"</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-number\">5000</span><span class=\"hljs-punctuation\">,</span>\n            <span class=\"hljs-attr\">\"AccessToken\"</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">\"\"</span>\n        <span class=\"hljs-punctuation\">}</span>\n    <span class=\"hljs-punctuation\">]</span>\n<span class=\"hljs-punctuation\">}</span></code></pre></div></li>\n<li><p>重启容器，扫码登录</p>\n</li>\n</ul>\n<h4 id=\"安装nonebot2\">安装NoneBot2</h4><ul>\n<li><p>安装pip：<code>apt install python3-pip</code></p>\n</li>\n<li><p>配置pip USTC源：<code>pip config set global.index-url https://mirrors.ustc.edu.cn/pypi/simple</code></p>\n</li>\n<li><p>安装pipx：<code>apt install pipx</code></p>\n</li>\n<li><p>安装nb-cli：<code>pipx install nb-cli</code></p>\n</li>\n<li><p>设置pipx变量：<code>pipx ensurepath</code></p>\n</li>\n<li><p>安装nb bootstrap：<code>nb self install nb-cli-plugin-bootstrap</code></p>\n</li>\n<li><p>创建新NoneBot2项目：<code>nb bs</code></p>\n</li>\n<li><div class=\"markdown-code\" data-language=\"text\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path></svg><span>text</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-text\">root@n100-debian:~# nb bs\n加载适配器列表中……\n请输入项目名称\n[?] 请输入 &gt; onani\n[?] 请选择你想要使用的适配器 OneBot V11 (OneBot V11 协议)\n请输入 Bot 超级用户，超级用户拥有对 Bot 的最高权限（如对接 QQ 填 QQ 号即可）（留空回车结束输入）\n[?] 第 1 项 &gt; 666\n[?] 第 2 项 &gt;\n请输入 Bot 昵称，消息以 Bot 昵称开头可以代替艾特（留空回车结束输入）\n[?] 第 1 项 &gt;\n请输入 Bot 命令起始字符，消息以起始符开头将被识别为命令，\n如果有一个指令为 查询，当该配置项中有 \"/\" 时使用 \"/查询\" 才能够触发，\n留空将使用默认值 ['', '/', '#']（留空回车结束输入）\n[?] 第 1 项 &gt;\n请输入 Bot 命令分隔符，一般用于二级指令，\n留空将使用默认值 ['.', ' ']（留空回车结束输入）\n[?] 第 1 项 &gt;\n请输入 NoneBot2 监听地址，如果要对公网开放，改为 0.0.0.0 即可\n[?] 请输入 &gt; 0.0.0.0\n请输入 NoneBot2 监听端口，范围 1 ~ 65535，请保证该端口号与连接端配置相同，或与端口映射配置相关\n[?] 请输入 &gt; 9090\n[?] 是否在项目目录中释出快捷启动脚本？ Yes\n[?] 是否将 localstore 插件的存储路径重定向到项目路径下以便于后续迁移 Bot？ Yes\n[?] 是否使用超级用户 Ping 指令回复插件？ Yes\n[?] 是否安装 logpile 插件提供日志记录到文件功能？ Yes\n[?] 是否在启动脚本中使用 webui 插件启动项目以使用网页管理 NoneBot？（该插件仍在开发中，不推荐用于生产环境） No\n成功新建项目 onani\n[?] 是否新建虚拟环境？ Yes\n正在 /root/onani/.venv 中创建虚拟环境\n创建虚拟环境成功\n[?] 是否需要修改或清除 pip 的 PyPI 镜像源配置？ No\n[?] 是否立即安装项目依赖？ Yes\n正在安装项目依赖\n依赖安装成功\n[?] 请选择需要启用的内置插件\n项目配置完毕，开始使用吧！</code></pre></div></li>\n</ul>\n<h2 id=\"成果展示-域名已弃用\">成果展示（域名已弃用）</h2><p><img src=\"https://b.acofork.com/img/n100-pve-4b4680cc548e0c59ec18cef537c9b1f5412fbbcd.webp\" alt=\"\" width=\"1920\" height=\"926\" loading=\"lazy\" decoding=\"async\" /></p>\n<p><a href=\"https://blog.onani.cn\" target=\"_blank\" rel=\"noopener noreferrer\">https://blog.onani.cn</a></p>\n<p><a href=\"https://alist.onani.cn\" target=\"_blank\" rel=\"noopener noreferrer\">https://alist.onani.cn</a></p>\n<p><img src=\"https://b.acofork.com/img/n100-pve-7c24ff7d54b2e0ccaecce4b2ef79155c54124fa4.webp\" alt=\"\" width=\"630\" height=\"476\" loading=\"lazy\" decoding=\"async\" /></p>\n","toc":[{"id":"配置-需求","text":"配置&需求","depth":2},{"id":"目标","text":"目标","depth":2},{"id":"1-pve","text":"1. PVE","depth":2},{"id":"安装","text":"安装","depth":3},{"id":"配置","text":"配置","depth":3},{"id":"安装pve快捷管理脚本","text":"安装PVE快捷管理脚本","depth":4},{"id":"配置realtek-r8168网卡","text":"配置Realtek R8168网卡","depth":4},{"id":"配置stun穿透","text":"配置STUN穿透","depth":3},{"id":"路由器设置dmz主机为pveip","text":"路由器设置DMZ主机为PVEIP","depth":4},{"id":"安装lucky","text":"安装Lucky","depth":4},{"id":"2-fnos","text":"2. fnOS","depth":2},{"id":"安装-2","text":"安装","depth":2},{"id":"配置-2","text":"配置","depth":2},{"id":"3-debian","text":"3. Debian","depth":2},{"id":"安装-3","text":"安装","depth":2},{"id":"安装1panel","text":"安装1Panel：","depth":3},{"id":"搭建qqbot","text":"搭建QQBot","depth":3},{"id":"安装onebotv11协议实现-lagrange-onebot","text":"安装OneBotv11协议实现：Lagrange.OneBot","depth":4},{"id":"安装nonebot2","text":"安装NoneBot2","depth":4},{"id":"成果展示-域名已弃用","text":"成果展示（域名已弃用）","depth":2}]}