Skip to main content

PrintBox

把一台**已经装好精简 Linux(Debian / Ubuntu 等 systemd 发行版)**的主机,变成一台无头打印服务器。

产品形态:这是一个 pip 分发的 Python 应用,不再包含整个操作系统。 网络参数、主机名、系统账号等由底层 Linux 自行管理(与系统一致); PrintBox 只负责把打印服务栈跑起来并提供管理界面。

功能

  • 一键启动:sudo printbox init 后所有服务开机自启;printbox start/stop/restart/status 随时管理。
  • 全协议无线/有线打印:CUPS + IPP Everywhere + AirPrint(iOS/macOS) + Mopria(Android/HarmonyOS) + WS-Discovery(Windows) + LPD。
  • Web 管理界面:状态 / 打印机 / 打印设置 / 系统 / 关于 / 归档 / 打印历史 / 设置 / 日志,局域网 http://<主机名>.local 直接访问。打印设置可改纸张/双面/色彩等可选项并设默认打印机;系统页展示硬件用量、网络/WiFi 与系统升级;关于页展示版本与更新日志。
  • 自动安装驱动:探测到打印机后按厂商自动 apt 安装对应驱动包(HP / Brother / Samsung / Canon / Epson …)。
  • 打印文件归档:每次打印的原始文件自动保存,按磁盘容量自动算配额,装满轮替删除最旧文件。
  • 打印历史:可预览(PDF)、可一键再次打印。
  • 断电不丢参:配置落盘 /etc/printbox,日志落盘 /var/log/printbox。

安装

一行命令从 PyPI 安装:

pip install printbox

安装后初始化(需 root,会自动装系统依赖、写服务、探测打印机):

sudo printbox init

或全自动一键(GitHub 安装脚本,自动建 venv + 安装 + 初始化):

curl -sSL https://raw.githubusercontent.com/PaulLiszt/printbox/main/install.sh | sudo bash

或在本仓库目录内离线安装:

sudo ./install.sh --local

安装脚本会:创建独立虚拟环境 /opt/printbox/venv → 安装 printbox → 建立 /usr/local/bin/printbox → 运行 printbox init(装系统依赖、写服务、探测打印机)。

可靠性:脚本可重复运行(重跑自动重建 venv 与服务);逐包安装依赖,个别在源中已更名的包会自动跳过,不影响核心服务;Web 管理界面始终会启动(不依赖 CUPS 是否装好),打印功能待 CUPS 就绪后自动可用。

使用

sudo printbox status     # 查看服务状态
sudo printbox detect     # 重新探测/添加打印机(自动装驱动)
sudo printbox restart    # 重启全部服务
printbox version         # 显示版本

浏览器打开安装结束时显示的 本机 IP(如 http://192.168.1.100),或 <主机名>.local(如 http://<box>.local), 即可在 Web 界面管理打印机、查看打印历史与归档。

手动从 PyPI 安装(等价)

python3 -m venv /opt/printbox/venv
/opt/printbox/venv/bin/pip install printbox
ln -s /opt/printbox/venv/bin/printbox /usr/local/bin/printbox
sudo printbox init

目录约定(FHS)

用途 路径
配置 /etc/printbox/config.json
状态/归档 /var/lib/printbox(含 archive/)
日志 /var/log/printbox/*.log
命令 /usr/local/bin/printbox

许可证

MIT

Metadata

Release files for printbox 0.2.51

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for printbox 0.2.51
File Size Uploaded Provenance Actions
printbox-0.2.51.tar.gz 161.8 kB Without provenance Details for printbox-0.2.51.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for printbox 0.2.51
File Interpreter ABI Platform Actions
printbox-0.2.51-py3-none-any.whl Python 3 none any Details for printbox-0.2.51-py3-none-any.whl

Total release size: 319.8 kB

Release files / printbox-0.2.51.tar.gz

Download URL printbox-0.2.51.tar.gz
Size 161.8 kB
Tags Source
SHA-256 checksum
How to use checksums
19271b0829368d0fd9f076071361aafc692dadb9ce5f9ce13fdc3612db850077
BLAKE2b-256 checksum
How to use checksums
d7b581daba4957c5fa1294560f2e484fc5fb3a942bce7e432d5da19291d63440
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / printbox-0.2.51-py3-none-any.whl

Download URL printbox-0.2.51-py3-none-any.whl
Size 158.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
61462e287763f654cd89b1c8842b17729cecac1a88cf45afa4d958889331275e
BLAKE2b-256 checksum
How to use checksums
af9e59bde32c0d90407288c4276fc0c7e1fa014b18889cb04aa934e16cdd4d4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for printbox 0.2.51

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page