惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

TaoSecurity Blog
TaoSecurity Blog
Jina AI
Jina AI
雷峰网
雷峰网
月光博客
月光博客
The GitHub Blog
The GitHub Blog
WordPress大学
WordPress大学
B
Blog RSS Feed
美团技术团队
C
CXSECURITY Database RSS Feed - CXSecurity.com
小众软件
小众软件
Security Latest
Security Latest
Microsoft Azure Blog
Microsoft Azure Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cybersecurity and Infrastructure Security Agency CISA
Last Week in AI
Last Week in AI
A
Arctic Wolf
Latest news
Latest news
Attack and Defense Labs
Attack and Defense Labs
I
Intezer
F
Fortinet All Blogs
罗磊的独立博客
MongoDB | Blog
MongoDB | Blog
Webroot Blog
Webroot Blog
S
Secure Thoughts
Help Net Security
Help Net Security
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
V
Visual Studio Blog
P
Proofpoint News Feed
博客园 - 【当耐特】
P
Privacy International News Feed
V
Vulnerabilities – Threatpost
Stack Overflow Blog
Stack Overflow Blog
Know Your Adversary
Know Your Adversary
云风的 BLOG
云风的 BLOG
Hacker News: Ask HN
Hacker News: Ask HN
L
LINUX DO - 最新话题
H
Help Net Security
爱范儿
爱范儿
酷 壳 – CoolShell
酷 壳 – CoolShell
S
SegmentFault 最新的问题
Forbes - Security
Forbes - Security
T
Tailwind CSS Blog
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Tenable Blog
Cloudbric
Cloudbric
N
News and Events Feed by Topic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Hugging Face - Blog
Hugging Face - Blog

子夜松声

初夏荷花开-2026 松声|廿六年·六月中·荷花开 松声|廿六年·五月末·麦黄收 松声|廿六年·五月行·小商桥 松声|廿六年·五月中·柳絮飞 松声|廿六年·五一行·信阳游 松声|廿六年·四月末·春日末 松声|廿六年·四月中·桐花开 松声|廿六年·三月末·花满城 松声|廿六年·三月花·海棠开 松声|廿六年·三月中·燕衔泥
Docker部署Cups-Web网页打印机
网友小宋 · 2026-04-12 · via 子夜松声

  • 很难遇到的一个不错的打印机项目,毕竟cups单用的话太丑了,配合web端完美正解。
  • 有需要可以自部署。

Docker部署Cups-Web网页打印机
Docker部署Cups-Web网页打印机

  • 项目地址:hanxi/cups-web

    功能特点:

    核心功能

  • 远程打印:随时随地通过网页上传文件进行打印
  • 多格式支持:

    • PDF 文档
    • 图片文件(JPG、PNG、GIF)
    • Office 文档(docx、xlsx、pptx 等)自动转换为 PDF(基于 LibreOffice)
    • 文本文件(txt)自动转换为 PDF

    用户管理

  • 多用户系统:支持管理员和普通用户两种角色
  • 打印记录:完整的打印历史记录

    管理后台

  • 用户管理:创建、编辑、删除用户账号
  • 打印记录查询:按用户、时间范围查询打印记录
  • 系统设置:配置数据保留天数等

    安全特性

  • Session 认证:安全的会话管理机制
  • CSRF 保护:防止跨站请求伪造攻击
  • 密码加密:使用 bcrypt 加密存储用户密码

    部署优势

  • Docker 一键部署:使用 Docker Compose 快速启动
  • 数据持久化:数据库和上传文件独立存储
  • 易于维护:简洁的配置和管理界面

Docker部署:

services:
  cups:
    image: docker.1ms.run/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: docker.1ms.run/hanxi/cups-web:latest
    user: root
    environment:
      - SESSION_HASH_KEY=${SESSION_HASH_KEY}
      - SESSION_BLOCK_KEY=${SESSION_BLOCK_KEY}
      - SESSION_SECURE=${SESSION_SECURE}
      - CUPS_HOST=cups:631
    volumes:
      - ./.data:/data
      - ./.uploads:/uploads
    ports:
      - "1180:8080"
    depends_on:
      - cups
    restart: unless-stopped

环境配置

  • CUPS 管理员账号(用于管理打印机)
    CUPSADMIN=admin
    CUPSPASSWORD=your_cups_password
  • 如果使用 HTTPS,设置为 true
    SESSION_SECURE=false

必要配置

- SESSION_HASH_KEY=your_hash_key_here
- SESSION_BLOCK_KEY=your_block_key_here
- 这里需要生成安全的密钥,可以发给AI让帮忙生成,这里必须生成密钥,否者web服务无法登录:
- 生成 SESSION_HASH_KEY
openssl rand -base64 32 | tr -d '\n'
- 生成 SESSION_BLOCK_KEY
openssl rand -base64 32 | tr -d '\n'

文章目录

    • 功能特点:
      • 核心功能
      • 用户管理
      • 管理后台
      • 安全特性
      • 部署优势
  • Docker部署:
    • 环境配置
    • 必要配置