cups icon indicating copy to clipboard operation
cups copied to clipboard

Implement CUPS web UI template for creating printer instances

Open zdohnal opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe. Currently, we can only create printer instances via CLI, but not via Web UI. Some users do not know CLI and use CUPS Web UI only.

Describe the solution you'd like Creating printer instance via CUPS Web UI

=====================================================

@michaelrsweet @tillkamppeter thinking about it from CUPS 3.0 perspective - will printer instances functionality be in cups-local daemon as well? If they will, what would be a GUI option for using them, since Web UI will be part of cups-sharing? Do we count on 3rd GUI app to use our API to create instances?

zdohnal avatar Aug 07 '24 08:08 zdohnal

OK, so printer instances are almost always PER USER settings, so we can't configure them through the web interface. Ideally print UI should use the CUPS API for saving print options (cupsSetDests, cupsAddDest, cupsSetOption, etc.) and the instance name is just a name associated with certain print options ("Photo", "Manual-Labels", etc.) that the UI can get from the user (and show in a drop-down list near the currently selected printer...)

CUPS 3.0 doesn't change how this works...

michaelrsweet avatar Aug 07 '24 14:08 michaelrsweet

@michaelrsweet hmm, I thought printer instances could be part of CUPS Web UI since root writes into /etc/cups/lpoptions and Web UI handles server options... I recalled printer instances because one of our customers has many print queues (over 3k), and some of them are as many times pointing to the same device but with one/few option(s) different - cupsd startup takes over 4 minutes for them, because every queue has a PPD file which gets loaded, which slows the startup remarkably.

My idea was to use printer instances for some, and look whether we could run some part of printer loading in separate threads - I have a prototype for this, but it is still testing phase before I create PR for it.

Regarding printer instance, so IIUC they are not shared/accessible from remote machine - then what is the best practice for the setup when I want to share several print queues, pointing to the same device but with different option(s), and I want to save memory, since adding PPD for every print queue is redundant - printer instances looked very nice in the aspect.

zdohnal avatar Aug 09 '24 11:08 zdohnal

hmm, I thought printer instances could be part of CUPS Web UI since root writes into /etc/cups/lpoptions and Web UI handles server options...

While it is true that root writes into /etc/cups/lpoptions, the CGI programs do not run as root so they wouldn't be able to manipulate that file... Also, not all applications support printer instances so it might not offer the improvement you are looking for... :/

michaelrsweet avatar Aug 09 '24 11:08 michaelrsweet

After looking at what would be required to implement this (basically new operations) and the corresponding security issues with that approach, I'm uncomfortable adding this functionality to CUPS. Another method (one that would work with all applications) would be to create "shadow" print queues that point to the main queue but have different defaults. Essentially you just need to create another printer pointed at the local/primary printer using the IPP Everywhere driver and then set the alternate defaults accordingly.

michaelrsweet avatar Sep 20 '24 16:09 michaelrsweet