From dc7616a09b715dbb7bcf44d11441cccad556c4f6 Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Tue, 7 Jul 2015 19:20:07 +0200 Subject: [PATCH] Ajout de la config de partage d'imprimantes cups --- Bundler/cups-service.xml | 1 + Python/etc/cups/cups-browsed.conf | 79 +++++++++++++++++++++++ Python/etc/cups/cupsd.conf.old | 104 ------------------------------ 3 files changed, 80 insertions(+), 104 deletions(-) create mode 100644 Python/etc/cups/cups-browsed.conf delete mode 100644 Python/etc/cups/cupsd.conf.old diff --git a/Bundler/cups-service.xml b/Bundler/cups-service.xml index 65c9a0f..575f77c 100644 --- a/Bundler/cups-service.xml +++ b/Bundler/cups-service.xml @@ -1,5 +1,6 @@ + diff --git a/Python/etc/cups/cups-browsed.conf b/Python/etc/cups/cups-browsed.conf new file mode 100644 index 0000000..fb57ea5 --- /dev/null +++ b/Python/etc/cups/cups-browsed.conf @@ -0,0 +1,79 @@ +# -*- coding: utf-8 -*- + +info["owner"] = "root" +info["group"] = "lp" +info["mode"] = 0644 + +include("ldap_conn") + +comment_start = "#" + +header("Configuration de partage cups pour le serveur cups et l'intranet") + + +out("""# Which protocols will we use to discover printers on the network? +# Can use DNSSD and/or CUPS, or 'none' for neither. +BrowseRemoteProtocols dnssd cups +# Upgraded from cups: +# Defaults from 1.0.41: dnssd cups + +# Which protocols will we use to broadcast shared local printers to the network? +# Can use DNSSD and/or CUPS, or 'none' for neither. +# Only CUPS is actually supported, as DNSSD is done by CUPS itself (we ignore +# DNSSD in this directive). +# BrowseLocalProtocols none + +# Settings of this directive apply to both BrowseRemoteProtocols and +# BrowseLocalProtocols. +# Can use DNSSD and/or CUPS, or 'none' for neither. +BrowseProtocols CUPS + +# Only browse remote printers from selected servers +# BrowseAllow all +# BrowseAllow cups.example.com +# BrowseAllow 192.168.1.12 +# BrowseAllow 192.168.1.0/24 +# BrowseAllow 192.168.1.0/255.255.255.0 +BrowseAllow 10.231.136.0/24 +# Use BrowsePoll to poll a particular CUPS server +# BrowsePoll cups.example.com +# BrowsePoll cups.example.com:631 +# BrowsePoll cups.example.com:631/version=1.1""") +if has ("cups-service-client"): + out(""" +BrowsePoll cups.adm.crans.org:631""") +out(""" +# CreateIPPPrinterQueues Yes + +# The AutoShutdown directive specifies whether cups-browsed should +# automatically terminate when it has no local raw queues set up +# pointing to any discovered remote printers (auto shutdown +# mode). Setting it to "On" activates the auto-shutdown mode, setting +# it to "Off" deactiivates it (the default). The special mode "avahi" +# turns auto shutdown off while avahi-daemon is running and on when +# avahi-daemon stops. This allows running cups-browsed on-demand when +# avahi-daemon is run on-demand. + +# AutoShutdown Off +# AutoShutdown On +# AutoShutdown avahi + +# The AutoShutdownTimeout directive specifies after how many seconds +# without local raw queues set up pointing to any discovered remote +# printers cups-browsed should actually shut down in auto shutdown +# mode. Default is 30 seconds, 0 means immediate shutdown. + +# AutoShutdownTimeout 30 + +# Unknown directives are ignored, also unknown values. + +# Please check and edit the following lines, especially if you have Linux +# machines with CUPS 1.5.x and older in your network. + +# If you edit anything in this file, please remember to restart cups-browsed +# (or reboot the system) afterwards. + +# Please remove the "#" in the beginning of the following line to make the +# local printers available to clients running CUPS 1.5.x or older. +#BrowseLocalProtocols cups""") + diff --git a/Python/etc/cups/cupsd.conf.old b/Python/etc/cups/cupsd.conf.old deleted file mode 100644 index b90621e..0000000 --- a/Python/etc/cups/cupsd.conf.old +++ /dev/null @@ -1,104 +0,0 @@ -# -*- coding: utf-8 -*- - -info["owner"] = "root" -info["group"] = "lp" -info["mode"] = 0644 - -include("ldap_conn") - -comment_start = "#" - -header("Configuration pour cups entre le serveur cups et l'intranet") - -def ipv4(serveur): - return str(conn.search(u'host=%s.adm.crans.org' % serveur)[0]['ipHostNumber'][0]) - - -out("""LogLevel info -MaxLogSize 0 -# Allow remote access""") -out("""Listen """ + ipv4('o2')) -out("""Listen /var/run/cups/cups.sock -# Share local printers on the local network. -Browsing On -BrowseLocalProtocols dnssd -DefaultAuthType Basic - - # Allow shared printing... - Order allow,deny - Allow @LOCAL - - - Order allow,deny - Allow @LOCAL - - - AuthType Default - Require user @SYSTEM - Order allow,deny - - - JobPrivateAccess default - JobPrivateValues default - SubscriptionPrivateAccess default - SubscriptionPrivateValues default - - Order deny,allow - - - Require user @OWNER @SYSTEM - Order deny,allow - - - AuthType Default - Require user @SYSTEM - Order deny,allow - - - AuthType Default - Require user @SYSTEM - Order deny,allow - - - Require user @OWNER @SYSTEM - Order deny,allow - - - Order deny,allow - - - - JobPrivateAccess default - JobPrivateValues default - SubscriptionPrivateAccess default - SubscriptionPrivateValues default - - AuthType Default - Order deny,allow - - - - AuthType Default - Require user @OWNER @SYSTEM - Order deny,allow - - - AuthType Default - Require user @SYSTEM - Order deny,allow - - - AuthType Default - Require user @SYSTEM - Order deny,allow - - - AuthType Default - Require user @OWNER @SYSTEM - Order deny,allow - - - Order deny,allow - -""") -