Skip to content

Prefer IPP Everywhere when adding network printers - #13630

Open
AnPod wants to merge 3 commits into
omacom:quattrofrom
AnPod:cursor/fix-cups-ipp-everywhere-e0d3
Open

AnPod wants to merge 3 commits into
omacom:quattrofrom
AnPod:cursor/fix-cups-ipp-everywhere-e0d3

Conversation

@AnPod

@AnPod AnPod commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #13023

Network printer setup preferred brand/universal filters; IPP Everywhere is the modern default.

Change

  • Add omarchy setup printer + Setup menu + FAQ
  • Create queues with -m everywhere
  • Fix setup-printer test sudo mock

Test plan

  • cups-ipp-everywhere-test.sh, cups-hardening-test.sh

cursoragent and others added 2 commits September 29, 2026 21:12
Co-authored-by: AnPod <AnPod@users.noreply.github.com>
Co-authored-by: AnPod <AnPod@users.noreply.github.com>
@cursor
cursor Bot force-pushed the cursor/fix-cups-ipp-everywhere-e0d3 branch from e6bff07 to 4c597a1 Compare September 29, 2026 21:12

@chessing234 chessing234 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix discovery parsing before adding this setup command.

Comment thread bin/omarchy-setup-printer Outdated
# driverless:ipp://EPSON._ipp._tcp.local/ipp/print "Epson ..." "Epson ... IPP Everywhere" ""
driverless_entries() {
LC_ALL=C driverless list 2>/dev/null | awk '
/^driverless:/ {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please parse the actual driverless list format: upstream prints "driverless:ipp://..." en "Epson" "Epson ..., driverless, ..." ..., including quotes around the first field, so ^driverless: matches none of its rows. running this command against that fixture reports no printers and exits 1; please cover a real quoted discovery line and extract the unquoted uri before passing it to lpadmin.

@greptile-apps

greptile-apps Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 3/5

[Medium risk] Adds a printer setup wizard and updates printer configuration.

The PR is not safe to merge until printer setup avoids redirecting existing queues.

Findings

  1. P1 Security Existing queues can be redirected ▶
  2. P2 Version changes duplicate queues ▶
  3. P2 Discovery failures look like empty searches ▶
  4. P2 Failed policy leaves partial queue ▶

Summary

Adds a network-printer setup command that discovers driverless printers and creates IPP Everywhere queues, exposes it in the Setup menu, and updates the FAQ and shell tests.

  • Queue-name collisions can redirect an existing printer; version-derived names can also duplicate queues after an upgrade.
  • Discovery failures are reported as an empty search, and a failed second administration call can leave partial setup.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A["driverless list"] --> B["Advertised description and IPP URI"]
  B --> C["Sanitize description into queue name"]
  C --> D["lpadmin -p name -v URI -m everywhere"]
  D --> E{"Queue name exists?"}
  E -- No --> F["Create queue"]
  E -- Yes --> G["Change existing queue destination"]
Loading

Reviews (1) · Last reviewed commit: "Parse quoted driverless list output in o..."

Comment thread bin/omarchy-setup-printer
[[ -n $queue ]] || queue=printer

echo "Adding $queue via IPP Everywhere ($uri)"
sudo lpadmin -p "$queue" -E -v "$uri" -m everywhere

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 security Existing queues can be redirected

If a discovered printer advertises a description that becomes the name of an existing queue, this call changes that queue’s destination instead of creating a new one. A printer on the LAN could thereby receive future jobs intended for the existing queue. The wizard selects a sole discovered printer without prompting; check for a name collision before changing the destination.

How this was verified: The advertised description becomes the queue name, and the selected URI reaches lpadmin -p ... -v without a collision check.

Comment thread bin/omarchy-setup-printer
/^"driverless:/ {
uri = $2
sub(/^driverless:/, "", uri)
name = $6

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Version changes duplicate queues

The discovered description includes the cups-filters version, and this code uses that description as the queue name. After a cups-filters upgrade, running discovery again can create a second permanent queue for the same printer. Use a name that does not depend on versioned display text.

Comment thread bin/omarchy-setup-printer
# driverless list lines look like:
# "driverless:ipp://EPSON._ipp._tcp.local/ipp/print" en "Epson" "Epson ..., driverless, ..." ""
driverless_entries() {
LC_ALL=C driverless list 2>/dev/null | awk -F '"' '

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Discovery failures look like empty searches

If driverless list fails, such as when the binary is missing, its error is hidden and the wizard reports that no printers were found. That sends users toward network troubleshooting instead of the local setup failure. Report discovery errors separately from a successful search with no results.

Comment thread bin/omarchy-setup-printer
Comment on lines +57 to +58
sudo lpadmin -p "$queue" -E -v "$uri" -m everywhere
sudo lpadmin -p "$queue" -o printer-error-policy=retry-job

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Failed policy leaves partial queue

If the second lpadmin call fails, the first has already created and enabled the queue. The command then exits with an error, but leaves a queue without the intended error policy. Apply the policy during creation or clean up a partially configured queue.

@omarchybot omarchybot added the enhancement New feature or request label Oct 1, 2026
@jandrusk

jandrusk commented Oct 7, 2026

Copy link
Copy Markdown

Thanks for this. One product question, plus a small guard I'd add.

Overlap with cups-browsed. etc/cups/cups-browsed.conf already has CreateIPPPrinterQueues Driverless, so driverless printers on the LAN should already get an IPP Everywhere queue automatically. Could #13023's reporter confirm whether that auto-created queue existed and worked? If it did, the actual bug is that the user picked a brand PPD in Print Settings, and a doc or FAQ note may be enough. Adding a new omarchy setup printer command and menu entry is the maintainer's call.

Existing-queue guard. lpadmin -p "$queue" modifies a queue that already exists with that name, so choosing a printer whose sanitized name matches an existing queue silently repoints it. Something like this before the lpadmin call would avoid that:

if lpstat -p "$queue" >/dev/null 2>&1; then
  echo "omarchy-setup-printer: a queue named $queue already exists; remove it first or pick another name" >&2
  return 1
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default CUPS setup fails on network printers using universal/pdftopdf filter; resolved by IPP-Everywhere (driverless)

5 participants