-
Notifications
You must be signed in to change notification settings - Fork 464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow cupsEnumDests() to filter/not show discovered printers via config file #5011
Comments
System-wide filtering by the admin of what printing destinations In company or corporate internal network environments For example the admin may not want that users print Or the admin may not want that users print directly on I wrote "even (to some extent) for security reasons" |
@jsmeix DNS-SD does not offer filtering based on user/privilege - it is a public service discovery protocol. You want LDAP (which is something that we plan on supporting in the future). @tillkamppeter The kinds of filtering you are asking for was tried and discarded 15 years ago. The CUPS printer attributes and Bonjour TXT record fields were added specifically for this but have never been used enough to justify their existence. Moreover, Bonjour is typically limited by subnet and/or subdomain, which will keep the printer list to a more manageable size (and if you don't split things up then you will have serious performance issues outside of CUPS from Bonjour alone...) So as well-intentioned as this feature request is, I do not see us implementing primitive client-side filters. The real solution is to support enterprise discovery protocols (e.g. LDAP) and point people at network management/design guides that show how to best architect networks for performance and usability. |
But could we not at least put a simple boolean switch into a config file in /etc/cups/ which allows turning off the listing of network-discovered printers in cupsEnumDests()? |
@michaelrsweet I suggest that this topic should be well documented @tillkamppeter As far as I understand it DNS-SD is an "all or nothing" Therefore - as far as I understand it - in my above example @michaelrsweet |
@tillkamppeter @jsmeix |
Hello from the future, What is the current process by which we can ensure that:
? This is how CUPS used to work. What I am currently seeing is:
I completely understand what @tillkamppeter @jsmeix expressed above. |
@ghomem If you want only print servers to communicate with printers, you can either put the printers on a separate subnet and/or disable DNS-SD on the printers themselves. |
Thank you for your answer @michaelrsweet . The admins of Linux desktops are not always the network admins and are not always the printer admins. Sometimes the network team is separate. Sometimes the printers are shared across operating systems. Sometimes some of the printers are managed by an external company that leases them. So, changing the network or the printer configuration to benefit a certain OS might not be possible. Furthermore, disabling DNS-SD on the printers, when possible, scales in effort proportionally to the number of printers. What I am trying to understand is why CUPS lost one of its best selling points, which was driverless structured printing achieved by means of a central print server. If I understand correctly, the suggestion by @tillkamppeter
would re-enable such a possibility, a situation which would be very welcome. Please let me know if I misunderstood something. Thanks again. |
@ghomem It would be better if we could move this discussion over to OpenPrinting CUPS... Right now the way the code should be working is that setting |
@michaelrsweet thanks for the answer. I can file a bug report at OpenPrinting CUPS if there is a bug, but let me confirm first if there is a bug or just lack of clarity on how to acheive a certain goal with the current CUPS. By creating a /etc/cups/client.conf file do you mean to not have a local CUPS, like described here: https://wiki.debian.org/CUPSPrintQueues#Printing_Without_a_Local_CUPS_Server So, I should stop avahi-daemon and cups-browsed and the client space (lpq, lpstat, kde print dialogue, gtk print dialog) would find the queues anyway? (sorry if it is a silly question, I always used a local CUPS daemon that would find the printers on the CUPS print server). |
@ghomem You might need avahi-daemon for other services, but yes cupsd and cups-browsed don't need to run in this configuration. |
Thanks for the answer @michaelrsweet . We will try to that and report how it goes. |
@ghomem The problem with the duplicate appearing of printers (temporary CUPS queue and cups-browsed-generated queue I have fixed already in the GIT of cups-filters). |
We have tried this but unfortunately Firefox crashes every second time we print. Libreoffice, oKular and Chrome do print correctly. Firefox prints without crashing in the traditional setup with local CUPS. |
Hi @tillkamppeter , nice to read from you. Thanks sharing this :-) |
This is what we needed to do, in order to achieve centralized management of print queues. Tested on Kubuntu 20.04. Configuration of structured CUPS clients Currently CUPS uses the DNS-SD protocol to advertise its printers to the LAN. Because we don't want multiplication of printer queues we need to ensure that we only accept DNS-SD traffic from the CUPS server. In order to achieve that, the firewall must only allow DNS-SD traffic between the CUPS client and the CUPS server. The firewall can be configured with a one time execution of a script on a local computer console:
In order to further control the configuration of the client computer we must execute the following:
and insert the following content:
We must ensure that both cups and cups-browsed are enabled:
Once these changes are done, the computer must be rebooted. With this setup, the desktop computer should list exactly the printers from our CUPS server without any duplications. One limitation of this setup is that we can't prevent that the queue names we configured in the server are extended by the DNS-SD protocol (ex: BROTHER-BW becoming BROTHER_BW_printserver_01) becoming longer queues on the desktop computer. |
(Firefox developer here -- just dropping in to leave a quick note & close the loop on this^, after chatting briefly with @ghomem: I suspect the crash that ghomem referenced here was an instance of https://bugzilla.mozilla.org/show_bug.cgi?id=1750768 , which is really Firefox suffering from this upstream GTK bug: https://gitlab.gnome.org/GNOME/gtk/-/issues/4672 ) |
Print dialogs are supposed to show all printers listed by cupsEnumDests(). These are all CUPS queues of the local CUPS daemon and in addition IPP printers discovered via DNS-SD (IPP network printers, IPP-over-USB printers, remote CUPS queues). For the discovered printers CUPS generates a temporary queue if one accesses them.
In small networks this works well, but imagine a network with 10000s of printers. The user does not easily find the printers relevant for him. Now my idea is to allow a possibility to let cupsEnumDests() show only the CUPS queues of the local daemon or apply filters to decide whether to show or not show a discovered printer.
This configuration (filters, no discovered printers at all) should be definable in config files, a system-wide one for the administrator (in /etc/cups/) and a by-user one (in ~/.cups/).
The text was updated successfully, but these errors were encountered: