
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
https://img.shields.io/github/v/release/hanxi/cups-web?style=flat-square&logo=github&color=blue](https://github.com/hanxi/cups-web/releases) https://img.shields.io/docker/pulls/hanxi/cups-web?style=flat-square&logo=docker](https://hub.docker.com/r/hanxi/cups-web) https://img.shields.io/docker/image-size/hanxi/cups-web/latest?style=flat-square&logo=docker&color=066da5](https://hub.docker.com/r/hanxi/cups-web) https://img.shields.io/github/stars/hanxi/cups-web?style=flat-square&logo=github](https://github.com/hanxi/cups-web/stargazers) https://img.shields.io/github/forks/hanxi/cups-web?style=flat-square&logo=github](https://github.com/hanxi/cups-web/network/members) https://img.shields.io/github/issues/hanxi/cups-web?style=flat-square&logo=github](https://github.com/hanxi/cups-web/issues) https://img.shields.io/github/last-commit/hanxi/cups-web?style=flat-square&logo=github](https://github.com/hanxi/cups-web/commits) https://img.shields.io/github/downloads/hanxi/cups-web/total?style=flat-square&logo=github&color=success](https://github.com/hanxi/cups-web/releases) https://img.shields.io/github/license/hanxi/cups-web?style=flat-square&color=blue](LICENSE)
https://img.shields.io/github/go-mod/go-version/hanxi/cups-web?style=flat-square&logo=go]([] https://img.shields.io/badge/Vue-3.5-4FC08D?style=flat-square&logo=vue.js]([] https://img.shields.io/badge/Vite-7-646CFF?style=flat-square&logo=vite]([] https://img.shields.io/badge/Nuxt%20UI-v4-00DC82?style=flat-square&logo=nuxt.js]([] https://img.shields.io/badge/Tailwind-v4-38B2AC?style=flat-square&logo=tailwind-css]([] https://img.shields.io/badge/CUPS-IPP-orange?style=flat-square]([] https://img.shields.io/badge/SQLite-WAL-003B57?style=flat-square&logo=sqlite]([***]
🏠 https://github.com/hanxi/cups-web • 🐳 https://hub.docker.com/r/hanxi/cups-web • 📖 开发文档 • 💬 https://github.com/hanxi/cups-web/issues/36 • 💰 赞赏支持
基于 CUPS 的网页版打印管理工具。通过浏览器上传文件、远程提交打印任务,支持多用户管理与打印记录追踪,适合家庭和小型办公室使用。
文件上传 | 打印机选择 |
实时预览 | 管理后台 |
hanxi/cups 镜像出厂即预装了一批常见品牌的打印机驱动,免去用户在容器里手动 apt install 或翻官网下载 .deb 的麻烦。除非另行说明,下面列出的驱动都同时覆盖 linux/amd64 + linux/arm64 + linux/arm/v7(少数厂商无 ARM 二进制的会标注)。
通用驱动包(apt 安装):
printer-driver-all:Debian 维护的驱动 meta 包,包含 splix、c2050、m2300w、ptouch 等数十种小众驱动printer-driver-cups-pdf:虚拟 PDF 打印机,无实体打印机也可调试printer-driver-escpr:Epson ESC/P-R 标准款(覆盖大部分 Epson 喷墨老机型)printer-driver-foo2zjs:ZjStream / Hiperc / OAKT 协议机型(部分 HP / Konica / Minolta 老款激光机)printer-driver-brlaser:Brother 老款激光机(HL-L2300D、HL-1110、DCP-7055 等,https://github.com/hanxi/cups-web/issues/32%EF%BC%89printer-driver-gutenprint:覆盖 Epson / Canon / HP / Lexmark 等大量老机型;仅 amd64 / arm64(trixie armhf 上游未提供 ***ary)foomatic-db-compressed-ppds + openprinting-ppds:Foomatic / OpenPrinting 海量 PPD 库hplip + hpijs-ppds + hp-ppd:HP 全系打印/扫描套件(LaserJet、OfficeJet、DeskJet、Envy 等)ipp-usb + CUPS 内置 driverless 模型:把 USB 直连的 IPP Everywhere / AirPrint / Mopria 打印机自动识别为网络打印机(新款 Brother DCP-T425W、HP Tango、Canon PIXMA TS 系列等大多走这条路)厂商专有驱动(脚本另行下载/编译):
| 驱动 | 版本 | 架构覆盖 | 适用机型 |
|---|---|---|---|
| Epson ESC/P-R 2(源码编译) | 1.2.39 | amd64 / arm64 / armv7 | 新款 Epson 喷墨:ET-***、L8050、L8160、WF-7840 等(含无边距打印,https://github.com/hanxi/cups-web/issues/30%EF%BC%89 |
Epson 国行专有驱动(epson-inkjet-printer-201601w + epson-printer-utility) | 1.0.1 / 1.2.2 | 仅 amd64 | Epson 中国区早期机型 L380、L455 等(原厂墨水检测/尺寸预设更完整) |
Canon UFR II / UFRII LT 官方驱动(cnrdrvcups-ufr2-uk) | 6.30-1.07 | amd64 / arm64 | i-SENSYS LBP/MF、imageCLASS、imageRUNNER (iR)、imagePRESS (iPR) 等所有走 UFR II / UFRII LT 协议的 Canon 激光机(https://github.com/hanxi/cups-web/issues/34%EF%BC%89 |
柯尼卡美能达 bizhub 3000MF 黑白激光驱动(bizhub3000mfpdrvchn) | 1.0.0-1 | amd64 / arm64 | Konica Minolta bizhub 3000MF 多功能一体机(https://github.com/hanxi/cups-web/issues/35%EF%BC%89 |
| HP LaserJet 1020 / 1020 Plus 固件 + A4-default PPD | sihp1020.dl | 全架构 | HP 1020 系列 host-based 打印机:自动下载固件 sihp1020.dl 到 foo2zjs 路径,并派生一份默认 A4 纸张的 PPD(https://github.com/hanxi/cups-web/issues/40%E3%80%81https://github.com/hanxi/cups-web/issues/48%EF%BC%89 |
💡 表中标注为「仅 amd64」或「amd64 / arm64」的驱动,在未覆盖的架构(如树莓派 armv7)上会被脚本静默
skip,不影响其他驱动的使用。如果你的打印机不在以上列表中,仍可访问 CUPS 管理界面(http://localhost:631)通过自带的 PPD 库或上传自定义 PPD 添加。📱 苹果 AirPrint 选不到 A4 纸(issue #48):foo2zjs 上游 HP 1020 PPD 的默认纸张是 Letter,iPhone 通过 AirPrint 连接时按
media-default渲染首屏,A4 会被折叠/隐藏。容器启动时entrypoint.sh会自动把已添加的 HP 1020 打印机 PPD 默认纸张从 Letter 切到 A4(备份保留为*.bak-cupsweb-issue48);新加打印机时也可以直接选 CUPS 列表里的HP LaserJet 1020 Foomatic/foo2zjs-z1 A4 (cups-web)变体。
admin / user 两种角色admin/admin,admin 账号受保护无法被删除或重命名securecookie(加密 + 签名),密钥自动生成并持久化到数据库X-CSRF-Tokenmodernc.org/sqlite,纯 Go 实现,无需 CGO)提供两种部署方式:
docker-compose.ymlyamlservices: cups: image: hanxi/cups:latest user: root environment: - CUPSADMIN=${CUPSADMIN} - CUPSPASSWORD=${CUPSPASSWORD} ports: - "631:631" devices: - /dev/bus/usb:/dev/bus/usb volumes: - ./.etc:/etc/cups restart: unless-stopped web: image: hanxi/cups-web:latest user: root environment: - CUPS_HOST=cups:631 volumes: - ./.data:/data - ./.uploads:/uploads ports: - "1180:8080" depends_on: - cups restart: unless-stopped
也可直接下载仓库内的 docker-compose.yml:
bashwget https://raw.githubusercontent.com/hanxi/cups-web/master/docker-compose.yml
在同目录创建 .env:
bashCUPSADMIN=admin CUPSPASSWORD=your_cups_password
bashdocker-compose up -d
访问 CUPS 管理界面:http://localhost:631,使用 .env 中的账号登录并添加打印机。
⚠️ 重要:添加打印机后,必须在 CUPS 管理后台将其设为 Shared(共享) 状态,否则 Web 端无法发现该打印机。
浏览器打开 http://localhost:1180,使用默认账号登录:
adminadmin⚠️ 首次登录请立即修改默认密码。
适合已有 CUPS 服务的场景。
从 https://github.com/hanxi/cups-web/releases 下载对应平台的二进制:
| 平台 | 架构 | 文件名 |
|---|---|---|
| Linux | amd64 | cups-web-linux-amd64 |
| Linux | arm64 | cups-web-linux-arm64 |
| Linux | armv7 | cups-web-linux-armv7 |
| Linux | loong64 | cups-web-linux-loong64 |
| macOS | amd64 | cups-web-darwin-amd64 |
| macOS | arm64 | cups-web-darwin-arm64 |
| Windows | amd64 | cups-web-windows-amd64.exe |
bashwget https://github.com/hanxi/cups-web/releases/latest/download/cups-web-linux-amd64 chmod +x cups-web-linux-amd64
bashexport CUPS_HOST=localhost:631 export DB_PATH=./data/cups-web.db export UPLOAD_DIR=./uploads export LISTEN_ADDR=:8080 ./cups-web-linux-amd64
或使用命令行参数(优先级高于环境变量):
bash./cups-web-linux-amd64 -addr :8080
⚠️ OFD 打印仅在 Docker 镜像中开箱即用。二进制部署若需支持 OFD,需要另行安装 Java 17 并把
ofd-converter.jar放到/ofd-converter.jar(或手动改源码中的路径)。
浏览器打开 http://localhost:8080,使用 admin/admin 登录。
| 变量名 | 说明 | 默认值 |
|---|---|---|
LISTEN_ADDR | Web 服务监听地址 | :8080 |
DB_PATH | SQLite 数据库路径 | data/cups-web.db |
UPLOAD_DIR | 上传文件目录 | uploads |
CUPS_HOST | CUPS 服务地址(host 或 host:port) | localhost |
| 参数 | 说明 |
|---|---|
-addr | 监听地址,优先级高于 LISTEN_ADDR |
| 变量名 | 说明 |
|---|---|
CUPSADMIN | CUPS 管理员用户名(必填) |
CUPSPASSWORD | CUPS 管理员密码(必填) |
6318080,docker-compose.yml 默认映射到宿主机 1180Docker 默认卷映射:
./.data → 数据库./.uploads → 上传的原始文件与转换后 PDF./.etc → CUPS 配置| 类型 | 扩展名 | 处理方式 |
|---|---|---|
.pdf | 直接打印 | |
| 图片 | .jpg .jpeg .png .gif .heic | 转换为 PDF(支持多张合并) |
| Office | .doc .docx .xls .xlsx .ppt .pptx | 通过 LibreOffice 转换 |
| OFD | .ofd | 通过 ofdrw 转换 |
| 文本 | .txt .md .html | 服务端渲染为 PDF |
admin 账号不可删除、不可改名、角色固定0 表示永久保留)通过反向代理(例如 Nginx)提供 HTTPS:
nginxserver { listen 443 ssl; server_name example.com; ssl_certificate /path/to/cert.pem; ssl_certificate_key /path/to/key.pem; location / { proxy_pass http://localhost:1180; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } }
编辑 docker-compose.yml:
yamlservices: web: ports: - "你的端口:8080"
bashcp ./.data/cups-web.db /backup/location/ tar -czf uploads-backup.tar.gz ./.uploads/ tar -czf cups-config-backup.tar.gz ./.etc/
删除数据库文件后重启即可重置为默认 admin/admin(会丢失全部数据):
bashdocker-compose down rm ./.data/cups-web.db docker-compose up -d
CUPS_HOST 指向正确的 CUPS 服务地址docker-compose restart cupsdocker-compose logs -f web在「管理后台 → 系统设置」中设置「数据保留天数」为大于 0 的值,维护任务每小时巡检一次,自动清理过期记录与文件。
bashdocker-compose logs -f web docker-compose logs -f cups
欢迎提 Issue 和 Pull Request。开发者文档请参阅 AGENTS.md。
![Star History Chart]([***]
如果这个项目对你有帮助,欢迎点击右上角的 ⭐ Star 让更多人发现它!
如果这个项目对你有帮助,欢迎通过以下方式支持:
点击右上角的 ⭐ Star 按钮,让更多人发现这个项目。
感谢你的支持!❤️
本项目采用 MIT 许可证,详见 LICENSE。
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务