kovacs_orz

Members
  • Posts

    15
  • Joined

  • Last visited

Everything posted by kovacs_orz

  1. 目前这么做是为了保证 unraid 的直接控制页面不依赖于任何外部应用, 防止在极端情况下的访问可靠性问题; 当然作为常规访问我目前直接 caddy 反向代理其他服务, 也是自动化的证书处理. 但是向这种通过外部工具 proxy, 就涉及到一个问题: 外部工具部署是否可靠? 如果部署在 unraid 自身, 那么就形成循环依赖; 如果部署在外部则需要单独的硬件设备保证可靠性.
  2. 最近发现很多时候 Docker 页面加载特别慢, 表现为刷新后出现 UnRIAD 图标 loading, 最晚可能需要 50s 才能加载出来页面. 最后综合控制台日志以及排查发现根本原因: 打开 Docker 这个页面时会发送一个 `/plugins/dynamix.docker.manager/include/DockerContainers.php` 同步请求. 该请求会返回 HTML 响应, 该请求需要后台同步下载所有 Docker Container 的 icon 图标. 所以当国内用户使用时, 如果模版中 Docker 配置了 github 图标 或者图标下载地址有问题(例如限速等), 则后台下载会非常缓慢; 一但后台下载缓慢就会阻塞前端页面请求, 表现就是打开 Docker 页面好几分钟都加载不出来. 针对这种情况目前解决方案也很简单: 将图片手动上传到国内图床, 比如微博、upyun CDN 等等; 当然一步到位下载到 NAS 本身也可以, 总之需要能拿到一个可直接访问的 http 链接地址. 接下来针对 Docker 容器或者 Docker Compse 容器进行配置即可: 应用商店(CA) 安装的 Docker 应用: 编辑 --> 添加另一个路径、端口、变量、标签或设备 添加一个标签, 名称随便写, 方便起见填 icon, 键 必须为 net.unraid.docker.icon ,值填写你期望使用的 icon 的 http(s) 地址 点击应用后替换完成. Docker Compose 应用: EDIT STACK UI LABLES 修改 icon 保存即可 其他提示: UnRAID Dcoker 相关的一些 UI 配置通过 docker label 完成: net.unraid.docker.icon: 容器的图标 net.unraid.docker.webui: 右键 “Web UI” 打开的地址, 默认可以通过模版引用当前 NAS 地址(http://[IP]:[PORT:8096]) 这些 xml 模版存储在 /boot/config/plugins/dockerMan/templates-user 目录中 Docker Compose 插件也遵循类似设置, 不同的是其 Web UI、icon 等配置存储在 /boot/config/plugins/compose.manager/projects/*/*.yml 中. 理论上 Docker Compose 中直接定义这些 label 应该也行, 不需要通过 UI 修改.
  3. I have tested it successfully, as I guessed: the '/plugins/dynamix.docker.manager/include/DockerContainers.php' request will download the icon of the docker container in the background, if the download speed of the icon address is slow, the request will be blocked; If the download fails, there will be a console log. I have manually uploaded all icons to my CDN, and it has been resolved so far. But this is still an optimization suggestion: asynchronously load external resources through WS or increase local caching solutions.
  4. In the current version, Docker page loads very slowly. I opened the debugging tool and observed that the requests were being blocked and remained in a "Pending" state. This issue greatly affects my use, as loading may take up to 50 seconds in the worst-case scenario. I looked at this request and it returned HTML directly. The only reason I can think of is that the backend process is trying to retrieve the application icon. If that is the case, I think it needs to be improved, for example, by using WebSocket to handle the process.
  5. There are currently no free PCIE slots, is there any other way to fix it?
  6. lspci output: 0a:00.0 Ethernet controller: Intel Corporation Ethernet Controller I225-LM (rev 03) Subsystem: QNAP Systems, Inc. Ethernet Controller I225-LM Control: I/O- Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr+ Stepping- SERR+ FastB2B- DisINTx- Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- Interrupt: pin A routed to IRQ 18 NUMA node: 0 IOMMU group: 1 Region 0: Memory at 80800000 (32-bit, non-prefetchable) [size=1M] Region 3: Memory at 80900000 (32-bit, non-prefetchable) [size=16K] Capabilities: [40] Power Management version 3 Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold+) Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=1 PME- Capabilities: [50] MSI: Enable- Count=1/1 Maskable+ 64bit+ Address: 0000000000000000 Data: 0000 Masking: 00000000 Pending: 00000000 Capabilities: [70] MSI-X: Enable- Count=5 Masked- Vector table: BAR=3 offset=00000000 PBA: BAR=3 offset=00002000 Capabilities: [a0] Express (v2) Endpoint, MSI 00 DevCap: MaxPayload 512 bytes, PhantFunc 0, Latency L0s <512ns, L1 <64us ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset+ SlotPowerLimit 0W DevCtl: CorrErr- NonFatalErr+ FatalErr+ UnsupReq- RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+ FLReset- MaxPayload 256 bytes, MaxReadReq 4096 bytes DevSta: CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr+ TransPend- LnkCap: Port #2, Speed 5GT/s, Width x1, ASPM L1, Exit Latency L1 <4us ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp+ LnkCtl: ASPM Disabled; RCB 64 bytes, Disabled- CommClk+ ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt- LnkSta: Speed 5GT/s, Width x1 TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt- DevCap2: Completion Timeout: Range ABCD, TimeoutDis+ NROPrPrP- LTR+ 10BitTagComp- 10BitTagReq- OBFF Not Supported, ExtFmt- EETLPPrefix- EmergencyPowerReduction Not Supported, EmergencyPowerReductionInit- FRS- TPHComp- ExtTPHComp- AtomicOpsCap: 32bit- 64bit- 128bitCAS- DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis- LTR+ 10BitTagReq- OBFF Disabled, AtomicOpsCtl: ReqEn- LnkCtl2: Target Link Speed: 5GT/s, EnterCompliance- SpeedDis- Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS- Compliance Preset/De-emphasis: -6dB de-emphasis, 0dB preshoot LnkSta2: Current De-emphasis Level: -6dB, EqualizationComplete- EqualizationPhase1- EqualizationPhase2- EqualizationPhase3- LinkEqualizationRequest- Retimer- 2Retimers- CrosslinkRes: unsupported Capabilities: [100 v2] Advanced Error Reporting UESta: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol- UEMsk: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol- UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO+ CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol- CESta: RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr+ CEMsk: RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr+ AERCap: First Error Pointer: 00, ECRCGenCap+ ECRCGenEn- ECRCChkCap+ ECRCChkEn- MultHdrRecCap- MultHdrRecEn- TLPPfxPres- HdrLogCap- HeaderLog: 00000000 00000000 00000000 00000000 Capabilities: [140 v1] Device Serial Number 24-5e-be-ff-ff-66-96-a7 Capabilities: [1c0 v1] Latency Tolerance Reporting Max snoop latency: 71680ns Max no snoop latency: 71680ns Capabilities: [1f0 v1] Precision Time Measurement PTMCap: Requester:+ Responder:- Root:- PTMClockGranularity: 4ns PTMControl: Enabled:+ RootSelected:- PTMEffectiveGranularity: Unknown Capabilities: [1e0 v1] L1 PM Substates L1SubCap: PCI-PM_L1.2- PCI-PM_L1.1+ ASPM_L1.2- ASPM_L1.1+ L1_PM_Substates+ L1SubCtl1: PCI-PM_L1.2- PCI-PM_L1.1- ASPM_L1.2- ASPM_L1.1- L1SubCtl2: Kernel modules: igc unraid-diagnostics-20230205-1843.zip
  7. My server info: - HPE MicroServer Gen10 Plus - UnRAID 6.11.5 - PCIE expansion card QNAP QM2-2P2G2T(I225-LM) I bought a QNAP QM2-2P2G2T PCIE expansion card, everything worked fine at first. Recently I started trying to copy a large number of files through the I225-LM 2.5G network interface of the expansion card, after several hours the I225-LM network card was lost from the unraid server, executing The `ip a` command also fails to see: I executed `lshw -class network` command, I225-LM NIC interface shows `UNCLAIMED`: My `lspci` command output:
  8. 一、前情摘要 目前对于 UNRAID 管理公网直接访问, 所以 HTTPS 是必须的; 默认 UNRAID 开启 HTTPS 后采用自签名证书会导致浏览器报错, 而官方提供了一个内置 ACME 方案, 就是使用 unraid.net 域名的带有 ip+hash 前缀的证书; 目前我也是刚刚使用所以尚不清楚官方是否维护了内置的 DDNS, 但是对我来说 ip+hash.unraid.net 这种长域名看着过于眼烦, 本身自己也有短域名, 所以研究了一下如何更换内置的证书为 ACME 的免费证书. 二、简明教程 想要更换内置的自签名证书步骤如下: 1、准备好自己域名的证书, 可使用第三方工具签署(acme.sh、certbot...)或者直接购买 2、证书格式需要为 PEM 格式(里面是 base64 编码的那种) 3、设置 -- 管理权限 -- 使用 SSL/TLS 选择 "是" 4、设置 -- 管理权限 -- 本地顶级域名 填写你自己域名的根域, 例如你打算使用 "abc.example.com" 访问 UNRAID, 则此处填写 "example.com" 5、将你的 “证书” 和 “证书 key” 上传到 UNRAID 系统 6、执行命令覆盖系统证书: `cat "证书绝对路径" “证书key绝对路径” > /boot/config/ssl/certs/$(uname -n)_unraid_bundle.pem` 7、执行命令重载 Nginx: `/etc/rc.d/rc.nginx reload` 三、其他说明 1、设置中的 "本地顶级域名" 必须填写为你自己域名的根域, 这是因为 `/etc/rc.d/rc.nginx` 脚本会检测证书是否匹配, 如果不匹配则还是会重新生成自签名证书 2、系统证书存放于 `/boot/config/ssl/certs/$(uname -n)_unraid_bundle.pem` 文件中, 与常规不同的是这个文件需要同时包含证书和 key; `$(uname -n)` 用于获取当前 UNRAID 名称, 每个服务器都不同. 四、自动化证书管理(我自己的方案) 由于我是采用的 ACME 证书, 所以三个月就过期, acme.sh 工具虽然能定时续期, 但是依赖于 cron 定时任务; 而 unraid 是运行在内存中, 所以很多东西不好持久化, acme.sh 装宿主机就有点难搞. 百思奇想发现 Caddy 自动化 ACME 证书续期就做的很棒, 所以自己研究了一下 Caddy 源码借助 Caddy 的 CertMagic 库挫了一个证书申请小工具: dnsacme https://github.com/mritd/dnsacme 目前这个工具定位是: 1、只支持 DNS 解析方式申请证书, 方便在内网使用(符合国情了属于是) 2、证书申请后提供 hook 脚本方式由用户自行处理 3、自动化续签时仍然能调用 hook 脚本 4、续签失败等也支持 hook 脚本(可以自己发通知啥的) 工具挫完了就很简单了, 直接 docker compose 启动 + 挂载就成 docker-compose.yml version: '3.9' services: dnsacme: image: mritd/dnsacme:unraid container_name: dnsacme restart: unless-stopped network_mode: "host" env_file: .env labels: - "net.unraid.docker.icon=https://github.com/mritd/dnsacme/raw/main/logo.png" volumes: - /mnt/user/composes/dnsacme:/data - /boot/config/ssl/certs:/host_certs - /root/.ssh:/host_ssh compose 总共三个挂载: 1、`/mnt/user/composes/dnsacme` 是我自己的 UNRAID compose 文件专用目录, 因为 certmagic 需要管理证书所以会存储一些证书状态, 这个挂载的目的就是保证重启后 dnsacme 不会无脑重新申请 2、`/boot/config/ssl/certs` 目录存放宿主机证书文件, 挂载后 dnsacme 申请完证书通过 hook 脚本覆盖写入 3、`/root/.ssh` 这个目录比较敏感, 也是无奈之举; dnsacme 写入证书后需要调用 nginx reload, 目前是通过 ssh 方式进行的, 暂时没想到啥其他的好办法. 编写好 compose 后编辑 ".env" 文件, 根据具体的 DNS 提供商自行调整, 具体请参考 https://github.com/mritd/dnsacme#dns-config ACME_OBTAINED_HOOK 已经内置了, 担心安全问题等请直接查看镜像的 Earthfile https://github.com/mritd/autobuild/tree/main/dnsacme 最后说一句, 如果有大佬弄过官方 app 的 template 之类的欢迎帮忙搞到 CA 里.
  9. 这种情况一般是你使用的目标仓库没有及时更新 Docker image hash; 换句话说一般出现在你使用了第三方 docker mirror 时出现. 直接删除 mirror 使用 docker hub 一般可以解决; 当然 docker hub 也有缓存更新不及时的问题. 顺便说一嘴, docker 从来不推荐使用 `latest` tag 的镜像, 因为它并不包含版本号信息, `latest` 的含义是 "最新版本", 但是由于其没有明确标识版本号, 所以你在 2022 年3月下载的最新版本, 同样的配置在 2023 年 1 月可能就无法工作. 因为你并不清楚也没有指定这个镜像内软件的真实版本号; unraid 的更新似乎也是进一步检测了镜像层 hash, 总而言之如果可能尽量去 docker hub 搜索这个镜像的当前特定版本号然后使用, 这样如果出现崩溃、备份、还原等问题都能按照目标软件官方文档解决, 否则的话很可能你使用的 latest 是 1.1.0, 下一次还原或者重新部署使用的 latest 实际就变成 2.3.4 了.
  10. 我有点怀疑是 IO 打满了, 你试试限制一下 aria 下载速度呢, 逐步降低测试 看看断不断
  11. 这种情况下建议试试虚拟机,然后硬件直通. Docker 本质上还是处于宿主机上, 通过 CGroup 隔离机制运行; 所以我个人的猜测是如果宿主机没有驱动, Docker 也跑在宿主机 kernel 上所以仍然无法识别.
  12. 默认行为, 一开始我也以为是啥错误情况; 其实你管理员登陆 AList 后台, 设置好默认存储就行了.
  13. The APP installation in the current CA is directly downloaded from Github, and access may be slow for some regions with poor network (such as Chinese users). At present, we can only use http proxy through some hacks; Is it possible to provide a mirror method for CA or the entire APP installation system, similar to apt and yum mirrors; In this way, we can build our own mirror service to provide app installation acceleration for users in different regions.