# HFS插件 **Repository Path**: landde/hfs-plugin ## Basic Information - **Project Name**: HFS插件 - **Description**: HFS-CHM,使HTTP File Server能在线浏览CHM/doc.excel.ppt文档 - **Primary Language**: JavaScript - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-11-06 - **Last Updated**: 2026-11-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # HFS 3 插件集合 面向 [HFS 3](https://github.com/rejetto/hfs)(rejetto HFS 3,Node.js 版 HTTP File Server)的插件集合:让分享目录里的 **CHM 帮助文件**和 **Office 文档**可以直接在浏览器里阅读 / 预览,不必先下载。 - 目标版本:**HFS 3.3.4(插件 API `13.5`)** - 运行时依赖:插件所需库均已随包内置,不访问 CDN ## 插件列表 | 插件 | 目录 | 一句话功能 | 支持的扩展名 | 详细说明 | | --- | --- | --- | --- | --- | | `chm-reader` | [`CHM插件/plugins/chm-reader`](CHM插件/plugins/chm-reader) | 在线阅读 `.chm` 帮助文件:左侧 `.hhc` 目录树与 `.hhk` 索引,右侧正文,图片 / CSS / 内部链接自动重写 | `.chm` | [CHM插件/README.md](CHM插件/README.md) | | `office-viewer` | [`OFFICE插件/plugins/office-viewer`](OFFICE插件/plugins/office-viewer) | 在线预览 Word / Excel / PowerPoint,浏览器端解析;检测到 LibreOffice 时把旧版 `.doc` / `.ppt` 服务端转 PDF 后预览,否则回退为下载提示 | `.docx`、`.docm`、`.xlsx`、`.xls`、`.xlsm`、`.xlsb`、`.pptx`、`.pptm`、`.csv`;`.doc`、`.ppt`(需 LibreOffice) | [OFFICE插件/README.md](OFFICE插件/README.md)、[office-viewer 详细说明](OFFICE插件/plugins/office-viewer/README.md) | 补充说明: - `chm-reader`:纯 Node.js 解析,不依赖 Windows 的 `hh.exe`;含宏/加密等异常文件会给出中文提示并保留原文件下载。 - `office-viewer`:`.docm` / `.xlsm` / `.pptm` 等含宏容器按 OOXML 渲染,**宏一律不执行**;大文件、加密文件走错误提示 + 下载兜底。 - 两个插件彼此独立,可以只装其中一个。 ## 安装通则 1. 把**插件目录本身**(`chm-reader` 或 `office-viewer`)复制进 HFS 的 `plugins` 目录。该目录与 `config.yaml` 同级(即 HFS 启动日志中 `App` 所指向目录下的 `plugins`): ``` / ├── config.yaml └── plugins/ ├── chm-reader/ └── office-viewer/ ``` 注意:不要复制外层的 `plugins/` 文件夹,也不要复制整个仓库。 2. 重启 HFS,或在管理后台 **Plugins** 页面启用;也可以直接写进 `config.yaml`: ```yaml enable_plugins: - chm-reader - office-viewer ``` 3. 确认启动日志出现对应插件的 `Loading plugin ...`;并确保分享目录对目标访问者具有 `can_read` 权限(插件沿用 HFS 的权限判断,不额外放行)。 4. `libreoffice/` 是**可选**的本机 LibreOffice(含 `program/soffice.exe`),仅供 `office-viewer` 转换旧版 `.doc` / `.ppt`。不需要预览旧格式时可以不部署;插件会自动探测,探测不到就按“不支持预览 + 下载”处理。它**不是** HFS 插件,不要放进 `plugins`。 ## 仓库结构 ``` HFS插件/ ├── CHM插件/ # CHM 阅读插件(独立仓库,含自己的 README / LICENSE / package.json) │ ├── plugins/chm-reader/ │ └── ... ├── OFFICE插件/ # Office 预览插件 │ ├── plugins/office-viewer/ │ ├── README.md │ └── LICENSE ├── libreoffice/ # 可选:LibreOffice 便携版,供旧版 .doc/.ppt 转 PDF ├── LICENSE # 本仓库总许可(MIT + 第三方声明) └── README.md # 本文件 ``` ## 许可与第三方组件 本仓库**自有代码**使用 **MIT** 许可,全文见根目录 [LICENSE](LICENSE)。各子目录另有许可证文件,内容一致方向(MIT): - [CHM插件/LICENSE](CHM插件/LICENSE):MIT + `chmlib-ts` 的 LGPL-2.1 声明 - [OFFICE插件/LICENSE](OFFICE插件/LICENSE)、[OFFICE插件/plugins/office-viewer/LICENSE](OFFICE插件/plugins/office-viewer/LICENSE):MIT 第三方组件均按原许可分发,**许可全文见对应文件**(本文不重复粘贴): | 插件 | 第三方组件 | 许可证 | 许可文件 | | --- | --- | --- | --- | | `chm-reader` | [chmlib-ts](https://www.npmjs.com/package/chmlib-ts)(CHM 容器 / LZX 解压) | LGPL-2.1 | [`CHM插件/plugins/chm-reader/lib/licenses/chmlib-ts-COPYING`](CHM插件/plugins/chm-reader/lib/licenses/chmlib-ts-COPYING) | | `office-viewer` | JSZip 3.10.2 | MIT 或 GPLv3(本项目按 MIT) | [`public/vendor/licenses/jszip-MIT.md`](OFFICE插件/plugins/office-viewer/public/vendor/licenses/jszip-MIT.md) | | `office-viewer` | docx-preview 0.3.5 | Apache-2.0 | [`docx-preview-APACHE-2.0.txt`](OFFICE插件/plugins/office-viewer/public/vendor/licenses/docx-preview-APACHE-2.0.txt) | | `office-viewer` | SheetJS CE (`xlsx`) 0.18.5 | Apache-2.0 | [`xlsx-APACHE-2.0.txt`](OFFICE插件/plugins/office-viewer/public/vendor/licenses/xlsx-APACHE-2.0.txt) | | `office-viewer` | pptx-preview 1.0.7(内含 lodash / tslib / uuid / echarts / JSZip) | ISC(内含依赖按其上游) | [`pptx-preview-README.md`](OFFICE插件/plugins/office-viewer/public/vendor/licenses/pptx-preview-README.md) | | `office-viewer` | pdf.js(旧版 `.doc/.ppt` 转 PDF 后的预览) | Apache-2.0 | [`pdfjs-APACHE-2.0.txt`](OFFICE插件/plugins/office-viewer/public/vendor/licenses/pdfjs-APACHE-2.0.txt) | 汇总说明见 [`OFFICE插件/plugins/office-viewer/public/vendor/licenses/NOTICE.md`](OFFICE插件/plugins/office-viewer/public/vendor/licenses/NOTICE.md)。 合规要点:第三方库以**独立文件、未修改地打包**形式随插件分发;重新分发时请保留上述许可文件与版权声明。根 `LICENSE` 与各子目录 `LICENSE` 如有表述差异,以子目录文件对其所属插件的说明为准,两者不构成冲突。 ## 致谢 - [rejetto/hfs](https://github.com/rejetto/hfs):HFS 3 及插件机制 - [chmlib-ts](https://www.npmjs.com/package/chmlib-ts)、docx-preview、SheetJS、pptx-preview、JSZip、pdf.js 及其贡献者 版本1.0(2026年11月6日 星期五)