Code Monkey home page Code Monkey logo

cups-avahi-airprint's Introduction

chuckcharlie/cups-avahi-airprint

Fork from quadportnick/docker-cups-airprint

Now supports ARM64 and AMD64!

Use the latest or version# tags to auto choose the right architecture.

This Alpine-based Docker image runs a CUPS instance that is meant as an AirPrint relay for printers that are already on the network but not AirPrint capable. The other images out there never seemed to work right. I forked the original to use Alpine instead of Ubuntu and work on more host OS's.

Configuration

Volumes:

  • /config: where the persistent printer configs will be stored
  • /services: where the Avahi service files will be generated

Variables:

  • CUPSADMIN: the CUPS admin user you want created - default is CUPSADMIN if unspecified
  • CUPSPASSWORD: the password for the CUPS admin user - default is the same value as CUPSADMIN if unspecified

Ports/Network:

  • Must be run on host network. This is required to support multicasting which is needed for Airprint.

Example run command:

docker run --name cups --restart unless-stopped  --net host\
  -v <your services dir>:/services \
  -v <your config dir>:/config \
  -e CUPSADMIN="<username>" \
  -e CUPSPASSWORD="<password>" \
  chuckcharlie/cups-avahi-airprint:latest

Example docker compose config:

version: '3.5'
services:
  cups:
    image: chuckcharlie/cups-avahi-airprint:latest
    container_name: cups
    network_mode: host
    volumes:
      - </your/services/dir>:/services
      - </your/config/dir>:/config
    environment:
      CUPSADMIN: "<YourAdminUsername>"
      CUPSPASSWORD: "<YourPassword>"
    restart: unless-stopped

Add and set up printer:

  • CUPS will be configurable at http://[host ip]:631 using the CUPSADMIN/CUPSPASSWORD.
  • Make sure you select Share This Printer when configuring the printer in CUPS.
  • After configuring your printer, you need to close the web browser for at least 60 seconds. CUPS will not write the config files until it detects the connection is closed for as long as a minute.

cups-avahi-airprint's People

Contributors

aav7fl avatar callumgare avatar chuckcharlie avatar mowee avatar n1zzo avatar quadportnick avatar thoschworks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cups-avahi-airprint's Issues

Pycups issue with python 3.11

Py-cups is not showing up for me for Python 3.11/ Pip. Is there a reason why you are installing it via pip instead with apk? I simply added pycups to the list of packages (py3-pycups) and it works as well.

splix package addition request

Any chance we can add the splix package to support Samsung and Dell OEM branded printers using SPL (Samsung Printer Language). It's a native package for Alpine and could be added to the apk install list "apk add ... splix \ ... "

USB printer not detected (Brother HL-L2300D)

I have a vanilla Ubuntu 22 server with Docker on it, and am using this image to try and connect my printer. CUPS works fine (admin interface, etc) and I'm using pretty much exactly the docker-compose.yaml from this repo. However, CUPS doesn't detect my Brother HL-L2300D printer. The USB device is available within the container, but no dice.

image

Inside the container:

/ # lsusb
Bus 001 Device 001: ID 1d6b:0002
Bus 002 Device 001: ID 1d6b:0003
Bus 001 Device 002: ID 04f9:0061

On the host:

$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 04f9:0061 Brother Industries, Ltd HL-L2300D series
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

When I try to run lpinfo I am denied:

$ docker exec -it cups sh
/ # lpinfo -v
lpinfo: Forbidden

I also installed the brlaser package on the host machine in hopes that that would solve things, but got no dice. Any ideas or info on how I can enable logging to see what's happening? I'm new to CUPS so it's possible I'm missing something very basic when trying to add the printer.

Cups not starting due to ulimit issue on arm64

Hi!

It seems that on certain configurations cups fails to start with no output because of ulimit setting. Found mentions of that issue here

Adding --ulimit nofile=1024:1024 to the docker run command seems to resolve it.

I submit this issue just to inform you but it would be nice of you to add it to readme file.

A4 format not showing up on iPhone

Pagesize A4 is not showing up on iPhone but it does show on PC.
Also when I try to print from iPhone it doesn't send the print to Cups so it never prints.

Unable to print to Samsung ML-3312ND

I'm trying to add my Samsung ML-3312ND printer to this, but I can't get it to print. The jobs just stop with an error. I've tried adding the universal print drivers for Samsung printers to the install, but it hasn't helped. Here's some error log output from when I print a test page:


E [11/Sep/2023:17:50:03 +0000] [CGI] ippfind (PID 164) stopped with status 2!
E [11/Sep/2023:17:50:57 +0000] [Job 5] Unable to open raster stream - : Broken pipe
E [11/Sep/2023:17:50:57 +0000] [Job 5] Job stopped due to filter errors; please consult the /var/log/cups/error_log file for details.
D [11/Sep/2023:17:50:57 +0000] [Job 5] The following messages were recorded from 17:50:57 to 17:50:57
D [11/Sep/2023:17:50:57 +0000] [Job 5] Applying default options...
D [11/Sep/2023:17:50:57 +0000] [Job 5] Adding start banner page "none".
D [11/Sep/2023:17:50:57 +0000] [Job 5] Adding end banner page "none".
D [11/Sep/2023:17:50:57 +0000] [Job 5] File of type application/vnd.cups-pdf-banner queued by "canadrian".
D [11/Sep/2023:17:50:57 +0000] [Job 5] hold_until=0
D [11/Sep/2023:17:50:57 +0000] [Job 5] Queued on "Samsung_ML-3312ND" by "canadrian".
D [11/Sep/2023:17:50:57 +0000] [Job 5] time-at-processing=1694454657
D [11/Sep/2023:17:50:57 +0000] [Job 5] 4 filters for job:
D [11/Sep/2023:17:50:57 +0000] [Job 5] bannertopdf (application/vnd.cups-pdf-banner to application/pdf, cost 32)
D [11/Sep/2023:17:50:57 +0000] [Job 5] pdftopdf (application/pdf to application/vnd.cups-pdf, cost 66)
D [11/Sep/2023:17:50:57 +0000] [Job 5] gstoraster (application/vnd.cups-pdf to application/vnd.cups-raster, cost 99)
D [11/Sep/2023:17:50:57 +0000] [Job 5] rastertospl (application/vnd.cups-raster to printer/Samsung_ML-3312ND, cost 0)
D [11/Sep/2023:17:50:57 +0000] [Job 5] job-sheets=none,none
D [11/Sep/2023:17:50:57 +0000] [Job 5] argv[0]="Samsung_ML-3312ND"
D [11/Sep/2023:17:50:57 +0000] [Job 5] argv[1]="5"
D [11/Sep/2023:17:50:57 +0000] [Job 5] argv[2]="canadrian"
D [11/Sep/2023:17:50:57 +0000] [Job 5] argv[3]="Test Page"
D [11/Sep/2023:17:50:57 +0000] [Job 5] argv[4]="1"
D [11/Sep/2023:17:50:57 +0000] [Job 5] argv[5]="job-uuid=urn:uuid:aa3339a5-3276-328f-5b71-5bd27a27e665 job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1694454657 time-at-processing=1694454657"
D [11/Sep/2023:17:50:57 +0000] [Job 5] argv[6]="/var/spool/cups/d00005-001"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[0]="CUPS_CACHEDIR=/var/cache/cups"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[1]="CUPS_DATADIR=/usr/share/cups"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[2]="CUPS_DOCROOT=/usr/share/cups"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[3]="CUPS_REQUESTROOT=/var/spool/cups"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[4]="CUPS_SERVERBIN=/usr/lib/cups"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[5]="CUPS_SERVERROOT=/etc/cups"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[6]="CUPS_STATEDIR=/run/cups"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[7]="HOME=/var/spool/cups/tmp"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[8]="PATH=/usr/lib/cups/filter:/usr/bin:/usr/sbin:/bin:/usr/bin"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[9]="SERVER_ADMIN=root@Torchwood"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[10]="SOFTWARE=CUPS/2.4.2"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[11]="TMPDIR=/var/spool/cups/tmp"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[12]="TZ=America/Denver"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[13]="USER=root"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[14]="CUPS_MAX_MESSAGE=2047"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[15]="CUPS_SERVER=/run/cups/cups.sock"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[16]="CUPS_ENCRYPTION=IfRequested"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[17]="IPP_PORT=631"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[18]="CHARSET=utf-8"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[19]="LANG=en_CA.UTF-8"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[20]="PPD=/etc/cups/ppd/Samsung_ML-3312ND.ppd"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[21]="CONTENT_TYPE=application/vnd.cups-pdf-banner"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[22]="DEVICE_URI=http://192.168.4.227:631"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[23]="PRINTER_INFO=Samsung ML-3312ND"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[24]="PRINTER_LOCATION=Downstairs"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[25]="PRINTER=Samsung_ML-3312ND"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[26]="PRINTER_STATE_REASONS=none"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[27]="CUPS_FILETYPE=document"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[28]="FINAL_CONTENT_TYPE=application/vnd.cups-raster"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[29]="AUTH_I****"
D [11/Sep/2023:17:50:57 +0000] [Job 5] Started filter /usr/lib/cups/filter/bannertopdf (PID 174)
D [11/Sep/2023:17:50:57 +0000] [Job 5] Started filter /usr/lib/cups/filter/pdftopdf (PID 175)
D [11/Sep/2023:17:50:57 +0000] [Job 5] Started filter /usr/lib/cups/filter/gstoraster (PID 176)
D [11/Sep/2023:17:50:57 +0000] [Job 5] Started filter /usr/lib/cups/filter/rastertospl (PID 177)
D [11/Sep/2023:17:50:57 +0000] [Job 5] Started backend /usr/lib/cups/backend/http (PID 178)
D [11/Sep/2023:17:50:57 +0000] [Job 5] PID 177 (/usr/lib/cups/filter/rastertospl) stopped with status 102 (No such file or directory)
D [11/Sep/2023:17:50:57 +0000] [Job 5] Hint: Try setting the LogLevel to "debug" to find out more.
D [11/Sep/2023:17:50:57 +0000] [Job 5] execv failed: No such file or directory
D [11/Sep/2023:17:50:57 +0000] [Job 5] Sending stdin for job...
D [11/Sep/2023:17:50:57 +0000] [Job 5] STATE: +connecting-to-device
D [11/Sep/2023:17:50:57 +0000] [Job 5] Looking up \"192.168.4.227\"...
D [11/Sep/2023:17:50:57 +0000] [Job 5] STATE: -connecting-to-device
D [11/Sep/2023:17:50:57 +0000] [Job 5] 192.168.4.227=192.168.4.227
D [11/Sep/2023:17:50:57 +0000] [Job 5] OUTFORMAT=\"<none>\", so output format will be CUPS/PWG Raster
D [11/Sep/2023:17:50:57 +0000] [Job 5] PDF template file doesn\'t have form. It\'s okay.
D [11/Sep/2023:17:50:57 +0000] [Job 5] hrDeviceDesc=\"Samsung ML-331x Series\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] PID 174 (/usr/lib/cups/filter/bannertopdf) exited with no errors.
D [11/Sep/2023:17:50:57 +0000] [Job 5] prtMarkerColorantValue.1.1 = \"Black\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] ATTR: marker-colors=#000000,none,none,none
D [11/Sep/2023:17:50:57 +0000] [Job 5] ATTR: marker-names=\'\"Black Toner Cartridge S/N:CRUM-21032332505\"\',\'\"Fuser \"\',\'\"Tray 1 Roller \"\',\'\"Tray 1 Torque Limiter \"\'
D [11/Sep/2023:17:50:57 +0000] [Job 5] ATTR: marker-types=toner,fuser,other,other
D [11/Sep/2023:17:50:57 +0000] [Job 5] ATTR: marker-levels=72,91,91,86
D [11/Sep/2023:17:50:57 +0000] [Job 5] new_supply_state=0, change_state=ffff
D [11/Sep/2023:17:50:57 +0000] [Job 5] STATE: -developer-low-report
D [11/Sep/2023:17:50:57 +0000] [Job 5] STATE: -developer-empty-warning
D [11/Sep/2023:17:50:57 +0000] [Job 5] STATE: -marker-supply-low-report
D [11/Sep/2023:17:50:57 +0000] [Job 5] STATE: -marker-supply-empty-warning
D [11/Sep/2023:17:50:57 +0000] [Job 5] STATE: -opc-near-eol-report
D [11/Sep/2023:17:50:57 +0000] [Job 5] STATE: -opc-life-over-warning
D [11/Sep/2023:17:50:57 +0000] [Job 5] STATE: -toner-low-report
D [11/Sep/2023:17:50:57 +0000] [Job 5] STATE: -toner-empty-warning
D [11/Sep/2023:17:50:57 +0000] [Job 5] STATE: -waste-receptacle-almost-full-report
D [11/Sep/2023:17:50:57 +0000] [Job 5] STATE: -waste-receptacle-full-warning
D [11/Sep/2023:17:50:57 +0000] [Job 5] STATE: -cleaner-life-almost-over-report
D [11/Sep/2023:17:50:57 +0000] [Job 5] STATE: -cleaner-life-over-warning
D [11/Sep/2023:17:50:57 +0000] [Job 5] new_state=0, change_state=ffff
D [11/Sep/2023:17:50:57 +0000] [Job 5] STATE: -media-empty-warning
D [11/Sep/2023:17:50:57 +0000] [Job 5] STATE: -door-open-report
D [11/Sep/2023:17:50:57 +0000] [Job 5] STATE: -media-jam-warning
D [11/Sep/2023:17:50:57 +0000] [Job 5] STATE: -input-tray-missing-warning
D [11/Sep/2023:17:50:57 +0000] [Job 5] STATE: -output-tray-missing-warning
D [11/Sep/2023:17:50:57 +0000] [Job 5] STATE: -marker-supply-missing-warning
D [11/Sep/2023:17:50:57 +0000] [Job 5] STATE: -output-area-almost-full-report
D [11/Sep/2023:17:50:57 +0000] [Job 5] STATE: -output-area-full-warning
D [11/Sep/2023:17:50:57 +0000] [Job 5] backendWaitLoop(snmp_fd=5, addr=0x1543e6822828, side_cb=0x55cbf509ce82)
D [11/Sep/2023:17:50:57 +0000] [Job 5] PID 178 (/usr/lib/cups/backend/http) exited with no errors.
D [11/Sep/2023:17:50:57 +0000] [Job 5] pdftopdf: Last filter determined by the PPD: rastertospl; FINAL_CONTENT_TYPE: application/vnd.cups-raster => pdftopdf will not log pages in page_log.
D [11/Sep/2023:17:50:57 +0000] [Job 5] PDF interactive form and annotation flattening done via QPDF
D [11/Sep/2023:17:50:57 +0000] [Job 5] pdftopdf: \"print-scaling\" IPP attribute: auto
D [11/Sep/2023:17:50:57 +0000] [Job 5] pdftopdf: Print scaling mode: Do not scale, center, crop if needed
D [11/Sep/2023:17:50:57 +0000] [Job 5] After Cropping: 612.000000 792.000000 612.000000 792.000000
D [11/Sep/2023:17:50:57 +0000] [Job 5] PID 175 (/usr/lib/cups/filter/pdftopdf) exited with no errors.
D [11/Sep/2023:17:50:57 +0000] [Job 5] Color Manager: Calibration Mode/Off
D [11/Sep/2023:17:50:57 +0000] [Job 5] Failed to connect to system bus
D [11/Sep/2023:17:50:57 +0000] [Job 5] Color Manager: no profiles specified in PPD
D [11/Sep/2023:17:50:57 +0000] [Job 5] Color Manager: ICC Profile: None
D [11/Sep/2023:17:50:57 +0000] [Job 5] Ghostscript using Any-Part-of-Pixel method to fill paths.
D [11/Sep/2023:17:50:57 +0000] [Job 5] Ghostscript command line: gs -dQUIET -dSAFER -dNOPAUSE -dBATCH -dNOINTERPOLATE -dNOMEDIAATTRS -dShowAcroForm -sstdout=%stderr -sOutputFile=%stdout -sDEVICE=cups -r600x600 -dDEVICEWIDTHPOINTS=612 -dDEVICEHEIGHTPOINTS=792 -dcupsBitsPerColor=8 -dcupsColorOrder=0 -dcupsColorSpace=0 -scupsPageSizeName=Letter -I/usr/share/cups/fonts -c \'<</.HWMargins[12.500000 12.500000 12.500000 12.500000] /Margins[0 0]>>setpagedevice\' -f -_
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[0]=\"CUPS_CACHEDIR=/var/cache/cups\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[1]=\"CUPS_DATADIR=/usr/share/cups\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[2]=\"CUPS_DOCROOT=/usr/share/cups\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[3]=\"CUPS_REQUESTROOT=/var/spool/cups\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[4]=\"CUPS_SERVERBIN=/usr/lib/cups\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[5]=\"CUPS_SERVERROOT=/etc/cups\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[6]=\"CUPS_STATEDIR=/run/cups\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[7]=\"HOME=/var/spool/cups/tmp\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[8]=\"PATH=/usr/lib/cups/filter:/usr/bin:/usr/sbin:/bin:/usr/bin\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[9]=\"SERVER_ADMIN=root@Torchwood\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[10]=\"SOFTWARE=CUPS/2.4.2\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[11]=\"TMPDIR=/var/spool/cups/tmp\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[12]=\"TZ=America/Denver\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[13]=\"USER=root\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[14]=\"CUPS_MAX_MESSAGE=2047\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[15]=\"CUPS_SERVER=/run/cups/cups.sock\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[16]=\"CUPS_ENCRYPTION=IfRequested\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[17]=\"IPP_PORT=631\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[18]=\"CHARSET=utf-8\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[19]=\"LANG=en_CA.UTF-8\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[20]=\"PPD=/etc/cups/ppd/Samsung_ML-3312ND.ppd\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[21]=\"CONTENT_TYPE=application/vnd.cups-pdf-banner\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[22]=\"DEVICE_URI=http://192.168.4.227:631\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[23]=\"PRINTER_INFO=Samsung ML-3312ND\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[24]=\"PRINTER_LOCATION=Downstairs\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[25]=\"PRINTER=Samsung_ML-3312ND\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[26]=\"PRINTER_STATE_REASONS=none\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[27]=\"CUPS_FILETYPE=document\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[28]=\"FINAL_CONTENT_TYPE=application/vnd.cups-raster\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] envp[29]=\"AUTH_INFO_REQUIRED=none\"
D [11/Sep/2023:17:50:57 +0000] [Job 5] Start rendering...
D [11/Sep/2023:17:50:57 +0000] [Job 5] Processing page 1...
D [11/Sep/2023:17:50:57 +0000] [Job 5] **** Error: Page drawing error occurred.
D [11/Sep/2023:17:50:57 +0000] [Job 5] Could not draw this page at all, page will be missing in the output.
D [11/Sep/2023:17:50:57 +0000] [Job 5] Rendering completed
D [11/Sep/2023:17:50:57 +0000] [Job 5] PID 176 (/usr/lib/cups/filter/gstoraster) exited with no errors.
D [11/Sep/2023:17:50:57 +0000] [Job 5] End of messages
D [11/Sep/2023:17:50:57 +0000] [Job 5] printer-state=3(idle)
D [11/Sep/2023:17:50:57 +0000] [Job 5] printer-state-message="Rendering completed"
D [11/Sep/2023:17:50:57 +0000] [Job 5] printer-state-reasons=none

Any help would be greatly appreciated.

Not showed in AirPrint

When trying to print in an iPhone, not printer is showed up, even though the printer added is accessible in Windows and other devices.

hp-setup

Hi, I am trying to set up my HP Laserjet CP1025 and when I run hp-setup in the terminal I get not found? I thought this image had hplib installed?

Incorrect paper size (CUPS assumes A4, etc when printer us US-sized)

I have my printer working just fine from Mac OS, where the printer defaults to letter size (the only thing the printer can really do).

However when I try to use Airprint, the sheet size options I get are only A4, A5, A6, and envelope. When I print with A4, iOS seems to think everything is fine. But CUPS has no record of the job, even as a failed one.

Any ideas or a way to turn on more verbose logging?

image

image

Container won't start on Fedora 39 Server

I'm trying to run this excellent solution on a server (Fedora 39 Server). It's a fresh and clean fedora installation. This image and portainer are the only containers installed. I've been using your image for at least 3 years without problems, on my Unraid server. But for some reason it just won't start on my new Fedora server. All the information I have is the log, which I'll include below. I'm by no means a docker expert, all though I'm comfortable with it and eager to learn. Can you point me in the right direction? Is this a bug, or my mistake? The configuration for the container is identical to the one on my Unraid server. I've also tried using macvlan instead of host, but that didn't change anything.

I've also manually added the ppd driver and AirPrint-Phaser-6280DN.service from my unraid server, to see if that would fix the problem. Clearly not. That's why these are shown in the log.

Can you please help me out?

+ '[' -z ******* ]
+ '[' -z ******* ]
+ grep -ci ******* /etc/shadow
+ '[' 1 -eq 0 ]
+ echo *******:*******
+ chpasswd
chpasswd: password for '*******' changed
+ mkdir -p /config/ppd
+ mkdir -p /services
+ rm -rf /etc/avahi/services/AirPrint-Phaser-6280DN.service
+ rm -rf /etc/cups/ppd
+ ln -s /config/ppd /etc/cups
+ ls -l /services/AirPrint-Phaser-6280DN.service
+ wc -l
+ '[' 1 -gt 0 ]
+ cp -f /services/AirPrint-Phaser-6280DN.service /etc/avahi/services/
+ ls -l /config/printers.conf
+ wc -l
+ '[' 1 -eq 0 ]
+ cp /config/printers.conf /etc/cups/printers.conf
+ ls -l /config/cupsd.conf
+ wc -l
+ '[' 0 -ne 0 ]
+ /usr/sbin/avahi-daemon --daemonize
Process 30 died: No such process; trying to remove PID file. (/run/avahi-daemon//pid)
+ exec /usr/sbin/cupsd -f
+ /root/printer-update.sh
Setting up watches.
Watches established.

Printer visible in AirPrint list, but printing does nothing

My Brother DCP-7065DN printer gets configured fine in CUPS and printing test pages works. It also shows up as an AirPrint target on my iOS devices as expected. But when I click print on iOS after selecting it as the AirPrint target, nothing happens. Nothing prints, ever, from any iOS device. I don't see anything obvious in the logs. Any ideas?

Note: when I set up a fresh Ubuntu VM and set up CUPS/Avahi manually, AirPrint from iOS works. But when I shut down that VM and instead spin up this docker container with the same CUPS config, AirPrint from iOS does nothing.

Unable to save PPD file: Permission denied

I'm unable to add a new USB printer using this container. I got it to detect the printer and selected a driver but it fails with an error "Unable to save PPD file: Permission denied". In the cups logs, I get:
Unable to create "/etc/cups/ppd/Brother_DCP-1510_series.ppd.N": Permission denied

My docker-compose file has:

services:
  cups:
    image: chuckcharlie/cups-avahi-airprint:latest
    container_name: cups
    network_mode: host
    volumes:
      - ./services:/services
      - ./config:/config
      - /run/dbus:/run/dbus
      - /dev/bus/usb:/dev/bus/usb
    privileged: true
    environment:
      CUPSADMIN: "xx"
      CUPSPASSWORD: "xx"
    restart: unless-stopped

If I get a shell inside the container, I can touch a file in that directory:

/ # ls -l /etc/cups/ppd/
total 0
-rw-r--r--    1 root     root             0 Jan 20 08:31 Brother_DCP-1510_series.ppd.N

and it shows up on the host:

~/docker/cups$ ls -l config/ppd/
total 0
-rw-r--r-- 1 root root 0 Jan 20 19:31 Brother_DCP-1510_series.ppd.N

This is running on a fresh install of Ubuntu server 22.04.3 LTS using the distro installed docker.io and docker-compose packages. I did originally have the snap version of docker installed but I removed that to try and eliminate it as a cause.

Duplex option AirPrint

I have installed a docker container on my qnap nas.
After installation I added a Brother HL-4570CDW laser printer via usb connection.
The .ppd file I have found on the brother drivers site by extracting the macos installer. Link

After configuring shares and copy service file to /etc/avahi/services i find the printer via AirPrint on iOS.

I cant see a Duplex option via AirPrint.
The .ppd file works fine on my old setup with a rapsberrypi.
macos_template.zip

Maybe anyone have an idea?

I always have to restart the container

Every time I want to print something I gotta restart the container, otherwise it won’t print anything.

Could someone points me in the direction to fix it?

Adding drivers on alpine not that easy

Hi @chuckcharlie !

great job with your repo. The auto discovery (mDNS, avahi) of printers finally works with your image. Thanks! However, because this is based on alpine, it is very hard, (or it takes too much time), to add vendor specific drivers for printers. Most of the vendors offer drivers for debian or rhel based linuxes, but not for alpine.

My printer, for instance, has its driver available as .rpm or .deb and an helper install.sh script (which chooses automatically what fits best the os, and makes sure, that the dependencies are met), but neither installing over the script nor the deb package worked. When trying to install the deb package (after installing the dpkg) I got following error:

dpkg -i *.deb
dpkg: error processing archive cnrdrvcups-ufr2-uk_5.70-1.18_amd64.deb (--install):
 package architecture (amd64) does not match system (musl-linux-amd64)
Errors were encountered while processing:
 cnrdrvcups-ufr2-uk_5.70-1.18_amd64.deb

I tried to circumvent this by changing the architecture with "dpkg --add-architecture amd64" and had only a small success. Because then a whole list dependency issues appeared:

ERROR: unable to select packages:
  libcups2 (no such package):
    required by: world[libcups2]
/extras/linux-UFRII-drv-v570-m17n/x64/Debian # apk add libcupsys2
ERROR: unable to select packages:
  libcupsys2 (no such package):
    required by: world[libcupsys2]
/extras/linux-UFRII-drv-v570-m17n/x64/Debian # apk add cups-bsd.
ERROR: unable to select packages:
  cups-bsd. (no such package):
    required by: world[cups-bsd.]
/extras/linux-UFRII-drv-v570-m17n/x64/Debian # apk add cups-bsd*
ERROR: unable to select packages:
  cups-bsd* (no such package):
    required by: world[cups-bsd*]

and it makes sense, because the package was build for debian, and on alpine, even if the deps, are met, they have other names.

Do you have an alternative solution to that? Or should I look for another image in the www?

BR

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.