Skip to content

Protospace/protoprint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CUPS Print Management Gateway

This is a CUPS backend script that acts as a gateway for print jobs. Before releasing a job to a printer, it sends a POST request with job metadata to Spaceport. The job is only printed if the API returns a 200 OK response.

This allows for billing prints in Protocoin.

Theory

  • Intercepts print jobs from CUPS.
  • Notifies Spaceport about new print jobs (user, job title, etc.).
  • Releases jobs to the physical printer only upon successful API confirmation.
  • Works with any real CUPS backend (e.g., socket, ipp, lpd).

Setup

Needs:

  • A Debian Linux VM
  • Python 3.6+

CUPS

Set up CUPS:

$ sudo apt install cups
$ sudo usermod -aG lpadmin $USER
$ sudo cp cupsd.conf /etc/cups/cupsd.conf
$ sudo systemctl restart cups

Details:

  • Name: EpsonStylusPro3880
  • Description: Epson Stylus Pro 3880
  • Location: Classroom
  • Driver: Local Raw Printer (grayscale, 2-sided printing)
  • Connection: printmanager:socket://172.17.18.23
  • Sharing: Yes

Setup:

  • CUPS admin
  • add Printer
  • select "EpsonStylusPro3880"
  • set name to "EpsonStylusPro3880"
  • enable sharing
  • run:
$ sudo lpadmin -p EpsonStylusPro3880 -v "printmanager:socket://172.17.18.23"

Script

Clone the repo and install:

$ cd
$ git clone https://github.com/Protospace/protoprint.git
$ sudo cp main.py /usr/lib/cups/backend/printmanager
$ sudo chown root:root /usr/lib/cups/backend/printmanager
$ sudo chmod 755 /usr/lib/cups/backend/printmanager
$ sudo touch /var/log/protoprint.log
$ sudo chown lp:lp /var/log/protoprint.log
$ sudo systemctl restart cups

Windows

Printer settings:

  • add printer (manually)
  • select a printer by name
  • "http://172.17.17.181:631/printers/EpsonStylusPro3880"
  • select "Epson Stylus Pro 3880" from driver list (could be at bottom)
  • open printer > Additional printer settings > Rename > "Epson Stylus Pro 3880 Protocoin"

Printer

Restrict printing:

  • open web interface http://172.17.18.23/
  • Configuration > Printing Control
    • Printing Control: Enable
    • Printer Access Control: Allow
    • add server running Protoprint to list, ie. 172.17.17.181 - 172.17.17.181
  • hit Submit

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages