root / pykota / trunk / conf / pykota.conf.sample @ 2583

Revision 2583, 38.3 kB (checked in by jerome, 18 years ago)

Preliminary work on the "onbackenderror" directive.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1# PyKota sample configuration file
2#
3#
4# File format :
5#
6#   - A mandatory [global] section :
7#
8#     Contains configuration directives which apply for all printers.
9#     Some directives MUST be set in the [global] section, e.g.
10#     database related directives.
11#
12#   - Any number of optional [PrintQueueName] sections :
13#
14#     Contain directives which apply for a particular print queue only.
15#
16#     Override the values of the same directives present in [global].
17#
18#
19# Directives format :
20#
21#   - Directive's name, followed by ':' followed by the directive's value.
22#
23#   - No leading whitespace : leading whitespace tell the parser that the
24#     current directive is the continuation of the previous one. Use with
25#     care and only when you need it.
26#
27#
28# PyKota - Print Quotas for CUPS and LPRng
29#
30# (c) 2003, 2004, 2005 Jerome Alet <alet@librelogiciel.com>
31# This program is free software; you can redistribute it and/or modify
32# it under the terms of the GNU General Public License as published by
33# the Free Software Foundation; either version 2 of the License, or
34# (at your option) any later version.
35#
36# This program is distributed in the hope that it will be useful,
37# but WITHOUT ANY WARRANTY; without even the implied warranty of
38# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
39# GNU General Public License for more details.
40#
41# You should have received a copy of the GNU General Public License
42# along with this program; if not, write to the Free Software
43# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
44#
45# $Id$
46#
47
48[global]
49# Storage backend for quotas
50# only PGStorage (PostgreSQL) and LDAPStorage (OpenLDAP) are supported.
51# MySQL and BerkeleyDB are planned.
52
53# the 'postgresql' value is deprecated, use 'pgstorage' instead.
54storagebackend: pgstorage
55
56# Quota Storage Server hostname (and optional port)
57# e.g. db.example.com:5432
58storageserver: localhost
59
60#
61# name of the Quota Storage Database
62storagename: pykota
63
64#
65# Quota Storage normal user's name and password
66# These two fields contain a username and optional password
67# which may give readonly access to your print quota database.
68#
69# PLEASE ENSURE THAT THIS USER CAN'T WRITE TO YOUR PRINT QUOTA
70# DATABASE, OTHERWISE ANY USER WHO COULD READ THIS CONFIGURATION
71# FILE COULD CHANGE HIS PRINT QUOTA.
72#
73storageuser: pykotauser
74# storageuserpw: Comment out if unused, or set to Quota Storage user password
75
76# Should the database caching mechanism be enabled or not ?
77# If unset, caching is disabled. Possible values Y/N/YES/NO
78# caching mechanism works with both PostgreSQL and OpenLDAP backends
79# but may be really interesting only with OpenLDAP.
80#
81# ACTIVATING CACHE MAY CAUSE PRECISION PROBLEMS IN PRINT ACCOUNTING
82# IF AN USER PRINTS ON SEVERAL PRINTERS AT THE SAME TIME.
83# YOU MAY FIND IT INTERESTING ANYWAY, ESPECIALLY FOR LDAP.
84#
85# FYI, I ALWAYS SET IT TO YES !
86#
87storagecaching: No
88
89# Should full job history be disabled ?
90# If unset or set to No, full job history is kept in the database.
91# This will be useful in the future when the report generator
92# will be written.
93# Disabling the job history can be useful with heavily loaded
94# LDAP servers, to not make the LDAP tree grow out of control.
95# Disabling the job history with the PostgreSQL backend works too
96# but it's probably less useful than with LDAP.
97disablehistory: No
98
99# LDAP example, uncomment and adapt it to your own configuration :
100#storagebackend: ldapstorage
101#storageserver: ldap://ldap.example.com:389
102#storagename: dc=example,dc=com
103#
104# NB : the user and password below are the ones contained in
105# the sample LDIF file pykota/initscripts/ldap/pykota-sample.ldif
106# Please adapt these lines to your own needs.
107#storageuser: cn=pykotauser,dc=example,dc=com
108#storageuserpw: ls88DT5j
109#
110# TLS support for LDAP
111#
112# ldaptls can be set to either Yes or No
113# the default value when not set is No, meaning that TLS won't be used.
114#ldaptls: No
115#
116# cacert points to the CA Certificate file to use for TLS.
117# Ensure that every user who can launch PyKota commands can read this file.
118# There's NO default value for this directive.
119#cacert: /etc/pykota/mycertfile
120#
121#
122# Here we define some helpers to know where
123# to plug into an existing LDAP directory
124#userbase: ou=People,dc=example,dc=com
125#userrdn: uid
126#balancebase: ou=People,dc=example,dc=com
127#balancerdn: uid
128#groupbase: ou=Groups,dc=example,dc=com
129#grouprdn: cn
130#printerbase: ou=Printers,ou=PyKota,dc=example,dc=com
131#printerrdn: cn
132#jobbase: ou=Jobs,ou=PyKota,dc=example,dc=com
133#lastjobbase: ou=LastJobs,ou=PyKota,dc=example,dc=com
134#billingcodebase: ou=BillingCodes,ou=PyKota,dc=example,dc=com
135
136# These two fields are special, they either accept a branch
137# dn, like an ou for example, or the special keywords 'user'
138# and 'group'. If 'user' or 'group' is used, the print quota
139# entries will be created below the user or group entry itself,
140# which will then be used like a branch (you can mix and match
141# different values depending on what you want to do).
142#userquotabase: user
143#userquotabase: ou=UQuotas,ou=PyKota,dc=example,dc=com
144#groupquotabase: group
145#groupquotabase: ou=GQuotas,ou=PyKota,dc=example,dc=com
146
147#
148# How to create new accounts and groups
149# authorized values are "below" and "attach(objectclass name [, fail|warn])"
150#
151# "below" creates the new accounts/groups as standalone entries
152# below the above defined 'userbase' ou
153#
154# attach(objectclass name [, action]) tries to find some existing user/group
155# using the above defined 'userrdn' or 'grouprdn' and 'userbase'
156# 'groupbase', and attach the PyKota specific entries to it.
157# if action is "warn" and no entry exists to attach to, a new
158# entry is created, and a message is logged.
159# if action is "fail" and no entry exists to attach to, program
160# logs an error message and aborts.
161# if action is not set, the default value is "fail".
162#
163# a possible value:  newuser: attach(posixAccount, warn)
164#newuser : below
165#newgroup : below
166#
167# LDAP attribute which stores the user's email address
168#usermail : mail
169
170#
171# Choose what attribute contains the list of group members
172# common values are : memberUid, uniqueMember, member
173#groupmembers: memberUid
174
175# Activate low-level LDAP cache yes/no
176# Nothing to do with "storagecaching" which is higher level
177# and database independant.
178# This saves some search queries and may help with heavily
179# loaded LDAP servers.
180# This is EXPERIMENTAL.
181#
182# BEWARE : SETTING THIS TO 'YES' CAUSES PROBLEMS FOR NOW
183# BETTER TO LET IT SET TO 'NO'
184# ldapcache: no
185
186# Where to log ?
187# supported values : stderr, system (system means syslog, but don't use 'syslog' here)
188# if the value is not set then the default SYSTEM applies.
189logger: system
190
191# Enable debugging ? Put YES or NO there.
192# debug is set to yes in this sample
193# configuration file, so debugging is activated
194# when configuring PyKota. After all works, just
195# put NO instead to save some disk space in your
196# logs.
197debug : Yes
198
199#
200# The URL to PyKota's logo when used from the CGI scripts.
201# You can use your own logo by modifying the URL below.
202# If not defined, the default URL is the same as the
203# one defined below
204logourl : http://www.librelogiciel.com/software/PyKota/pykota.png
205
206#
207# The destination to which the web browser will be redirected
208# when you click on the logo defined above.
209# If not defined, the default URL is the same as the
210# one defined below
211logolink : http://www.librelogiciel.com/software/
212
213#
214# Mail server to use to warn users
215# If the value is not set then localhost is used.
216smtpserver: localhost
217
218# Crash messages' recipient : in addition to the log files
219# each software crash can be sent to the author of PyKota
220# or any other person of your choice. By default this
221# is disabled. The recipient pykotacrashed@librelogiciel.com
222# reaches PyKota's author.
223# The 'adminmail' (defined a bit below) is CCed.
224#
225# Privacy concerns : what is sent is only :
226#
227#        - a copy of the software's traceback
228#        - a copy of the software's command line arguments
229#        - a copy of the software's environment variables
230#
231# suggested value
232# crashrecipient: pykotacrashed@librelogiciel.com
233
234# Email domain
235# If the value is not set, and the mail attribute for the user
236# is not set in the PyKota storage, be it LDAP (see usermail directive
237# above) or PostgreSQL, then email messages are sent to
238# username@smtpserver
239#
240# If the value is set, then email messages are sent to
241# username@maildomain using the SMTP server defined above
242#
243# Set the appropriate value below, example.com set as per RFC2606.
244maildomain: example.com
245
246# Should we force usernames to be all lowercase when printing ?
247# Default is No.
248# This is a global option only.
249# Some people reported that WinXP sends mixed case usernames
250# setting 'utolower: Yes' solves the problem.
251# Of course you have to use lowercase only when adding
252# users with edpykota, because ALL database accesses are
253# still case sensitive.
254#
255# If utolower is Yes, the usernames received from the printing
256# system is converted to lowercase at the start of printing,
257# BUT ONLY when printing.
258#
259# If utolower is No, which is the default, strict case checking
260# is done, this means that users 'Jerome' and 'jerome' are
261# different. Printer and groups names are ALWAYS case sensitive.
262utolower: No
263
264# Should we split usernames on a specific separator when printing ?
265# Default is No, i.e. if the value is unset.
266# This is a global option only.
267# This option adds support for Samba's Winbind utility, which
268# prefixes usernames with domain name and separator character.
269# Of course if you set this then you have to use NO separator when
270# adding users with edpykota.
271#
272# If winbind_separator is set, the usernames received from the printing
273# system are split on the separator's value, and only the last part
274# (real username) is used.
275#
276# If winbind_separator is not set, which is the default, strict
277# username equality checking will be done (modulo the setting
278# of the 'utolower' directive), this means that users 'DOMAIN1/jerome',
279# 'Domain2/jerome' and 'jerome' are different.
280# winbind_separator: /
281
282# When creating users or groups accounts, should we reject users
283# or groups which are unknown from the system ?
284# The default if unset is NO. This means that by default, you
285# can create users or groups for which `getent passwd username`
286# or `getent group groupname` returns nothing.
287#
288# Allowed values : Yes | No
289# Default value : No
290#
291# reject_unknown: No
292
293# Do we want to hide jobs' title, filename and options for privacy
294# reasons ?
295# This may be required in some countries (Italy comes to mind).
296# Allowed values are YES and NO.
297# If unset, the default value is NO, meaning that jobs' title, filename
298# and options will be saved into the history.
299# This option can't be set on a per printer basis, only into the
300# [global] section.
301privacy : no
302
303# When the real CUPS backend fail, should we modify the
304# user's page counters and account balance or not ?
305# If you trust your users, set it to "nocharge".
306# If you think they found some mean to kill the real CUPS backend,
307# then set it to "charge".
308# If unset, the default value is "nocharge", meaning that users won't be
309# charged whenever a CUPS backend fails. This is the OPPOSITE
310# behavior compared to PyKota versions prior to 1.24alpha2.
311# This value can be set either globally or on a per printer basis
312# If both are defined, the printer option has priority.
313# onbackenderror : charge
314onbackenderror : nocharge
315
316# Should we strip off some characters from the beginning of
317# print jobs' titles ? This can be used to remove smbprn.??????
318# which sometimes appear when printing in raw mode from Windows
319# through Samba.
320# This setting only applies at printing time.
321# When not set, titles are used as received from the printing system.
322# The default is to not strip any character off of jobs' titles.
323# This value can be set either globally or on a per printer basis
324# If both are defined, the printer option has priority.
325# striptitle : smbprn.??????
326
327# Should we launch a command to overwrite the job's ticket ?
328# This allows a command to overwrite the username and/or the
329# billing code used, or to deny the job.
330# If unset no command is launched and the job's username and
331# billing code are used as they are received.
332# To overwrite the job's ticket, the command has to print
333# on its standard output one or more of the following lines,
334# without any prefix or space character :
335#
336#    USERNAME=the_username_we_want_to_overwrite_with
337#    BILLINGCODE=the_billingcode_we_want_to_overwrite_with
338#    DENY
339#
340# NB : the output is entirely read, and the latest value
341# seen is used, so you command can output several usernames
342# or billing codes and only the latest ones will be used.
343# If only USERNAME= lines are printed, the billing code,
344# if any, is used unchanged.
345# If only BILLINGCODE= lines are printed, the username is
346# used unchanged.
347# If DENY is output, but is followed by new USERNAME= or
348# BILLINGCODE= lines, the job is not denied.
349#
350# This value can be set either globally or on a per printer basis
351# If both are defined, the printer option has priority.
352#
353# overwrite_jobticket : /path/to/some/script/or/command
354
355# What should we do when we print and the billing code used is
356# not present in the database ?
357# The default value is 'create' which adds the billing code to the
358# database.
359# Other values can be :
360#       deny
361#     which silently rejects the job.
362# or :
363#       deny(your script here)
364#     if you put the path to a script or command here, it is executed, for
365#     example you can open a popup window explaining why the job was
366#     rejected.
367#
368# This value can be set either globally or on a per printer basis
369# If both are defined, the printer option has priority.
370#
371# unknown_billingcode : create
372
373# Where should we store our (temporary) files when printing ?
374# if unset, defaults to a system directory dedicated to temporary
375# files and evaluated at runtime (see Python's documentation
376# for the tempfile.gettempdir() function).
377# This value can be set either globally or on a per printer basis
378# If both are defined, the printer option has priority.
379# On my system, when not set, the /var/spool/cups/tmp directory is used.
380# directory : /tmp
381# directory : /var/spool/cups
382
383# Should we keep our work files on disk after printing ?
384# If unset, temporary files are deleted once the work is finished.
385# If set to yes, files are kept on disk in the 'directory'
386# named with the previous directive.
387# This value can be set either globally or on a per printer basis
388# If both are defined, the printer option has priority.
389# Default value is No, meaning temporary files are deleted
390# keepfiles : yes
391keepfiles : no
392
393
394# What is the accounting backend to use
395#
396# supported values :
397#
398#    - hardware : asks the printer for its lifetime page counter
399#                 via either SNMP, AppleTalk, or any external
400#                 command. This method is the recommended one
401#                 in PyKota since its beginning.
402#
403#                 In the lines below "%(printer)s" is automatically replaced
404#                 at run time with your printer's Fully Qualified Domain Name
405#                 for network printers, if PyKota can extract it from its
406#                 environment.
407#                 e.g. myprinter.example.com
408#
409#         Recommended values :
410#
411#             accounter: hardware(snmp)
412#
413#               Extracts the printer's internal page counter via SNMP.
414#
415#         Or :
416#
417#             accounter: hardware(pjl)
418#
419#               Extracts the printer's internal page counter via PJL queries over port tcp/9100.
420#
421#         Advanced uses :
422#
423#             accounter: hardware(snmp:MyCommunity)
424#
425#               To use a different SNMP community name than the default one (which is 'public')
426#
427#             accounter: hardware(pjl:9101)
428#
429#               To use a different port than the default one (which is 9100)
430#
431#
432#         Other Examples :
433#         
434#             accounter: hardware(/usr/bin/snmpget -v1 -c public -Ov %(printer)s mib-2.43.10.2.1.4.1.1 | cut -f 2,2 -d " ")
435#         
436#         Another untested example, using npadmin :
437#         
438#             accounter: hardware(/usr/bin/npadmin --pagecount %(printer)s)
439#         
440#         Another example, for AppleTalk printers which works fine :
441#         (You may need the pap CUPS backend installed, and copy the
442#         pagecount.ps file from untested/netatalk into /etc or any
443#         appropriate location)
444#         
445#             accounter: hardware(/usr/share/pykota/papwaitprinter.sh "MyPrinter:LaserWriter@*" && /usr/bin/pap -p "MyPrinter:LaserWriter@*" /usr/share/pykota/pagecount.ps  2>/dev/null | /bin/grep -v status | /bin/grep -v Connect | /usr/bin/tail -1)
446#         
447#         An example for parallel printers like the HP Laserjet 5MP :
448#         
449#             accounter: hardware(/bin/cat /usr/share/pykota/pagecount.pjl >/dev/lp0 && /usr/bin/head -2 </dev/lp0 | /usr/bin/tail -1)
450#         
451#         This value can be set either globally or per printer or both.
452#         If both are defined, the printer option has priority.
453#         
454#         Some examples and comments provided by Bob Martel from csuohio.edu
455#         
456#         For several printers I could not get the page count using snmpget.  I
457#         resorted to snmpwalk:
458#         
459#             accounter: hardware(/opt/local/net-snmp/bin/snmpwalk -v 1 -Cc -c public %(printer)s | grep mib-2.43.10.2.1.4.1.1 | cut -d " " -f4)
460#         
461#         The last example is still more ugly, some of the printers only provided
462#         their counters without names, but at least always on the same line:
463#         
464#             accounter: hardware(/opt/local/net-snmp/bin/snmpwalk -v 1 -Cc -c public -Ov %(printer)s | grep Counter32 | tail -2 | head -1 | cut -d " " -f2)
465#         
466#         An example using netcat and a preformatted PJL job which you can find
467#         in the untested/pjl directory, which is sent to a JetDirect print
468#         server on port 9100 :
469#         
470#             accounter: hardware(/bin/nc -w 2 %(printer)s 9100 </usr/share/pykota/pagecount.pjl | /usr/bin/tail -2)
471#         
472#         An example using the contributed pagecount.pl script which does
473#         the same as above, but should work on more printers :
474#         
475#             accounter: hardware(LC_ALL=C /usr/share/pykota/pagecount.pl %(printer)s 9100)
476#         
477#         NB : the LC_ALL=C is used because sometimes Perl can correctly set locale and is verbose
478#              about it, causing PyKota to miss the correct answer.
479#
480#         WARNING : In any case, when using an hardware accounter, please test the command line outside
481#                   of PyKota before. This will save you some headaches in case it doesn't work as expected.
482#         
483#         The waitprinter.sh is there to wait until the printer is idle again.
484#         This should prevent a job to be sent to the printer while another one is
485#         not yet finished (not all pages are printed, but the complete job is in
486#         the printer)
487#         
488#   YOU ABSOLUTELY HAVE TO BE SURE YOU HAVE A SCRIPT WHICH WAITS FOR THE
489#   PRINTER BEING READY BEFORE ASKING FOR ITS INTERNAL PAGE COUNTER.
490#         
491#   PYKOTA INCLUDES SUCH SCRIPTS FOR SNMP AND APPLETALK PRINTERS, MORE TO COME
492#
493#   SOME OF THE ABOVE EXAMPLES DON'T USE SUCH A SCRIPT, YOU HAVE BEEN WARNED
494#
495#
496#   WITH THE SPECIAL MAGIC hardware(snmp) AND hardware(pjl) VALUES, PYKOTA
497#   TAKES CARE OF ALL THIS FOR YOU, SO PLEASE UNDERSTAND THAT IT IS PREFERABLE
498#   TO USE THESE TWO METHODS : THEY WORK FINE, REQUIRE LITTLE TO NO CPU,
499#   AND DO ALL THE HARD WORK AUTOMATICALLY. IF YOU REALLY NEED TO YOU CAN USE
500#   YOUR OWN EXTERNAL COMMANDS AS DESCRIBED ABOVE, JUST BE CAREFUL WITH THIS.
501#         
502#
503#    - software : delegates the job's size computation to any
504#                 external command of your choice.
505#
506#                 best choice for this is probably to set it
507#                 this way :
508#
509#                   accounter: software()
510#
511#                 which uses pkpgcounter's code internally to compute
512#                 the size of the job.
513#                 NB : YOU MUST NOW INSTALL pkpgcounter FOR PyKota TO WORK.
514#
515#                 You could obtain exactly the same result with :
516#
517#                   accounter: software(/usr/bin/pkpgcounter)
518#
519#                 But in this case the job would be passed through
520#                 pkpgcounter's parser a second time.
521#
522#                 pkpgcounter is a command line tool which was
523#                 part of PyKota and which can handle several types
524#                 of documents. It is now distributed separately.
525#
526#                 while pkpgcounter is the recommended value if you want
527#                 to use an external command here, you can use whatever
528#                 command you want provided your command accepts the job's
529#                 data on its standard input and prints the job's size in
530#                 pages as a single integer on its standard output.
531#
532# This value can be set either globally or on a per printer basis
533# If both are defined, the printer option has priority.
534#
535# accounter: hardware(/usr/share/pykota/waitprinter.sh %(printer)s && /usr/bin/snmpget -v1 -c public -Ov %(printer)s mib-2.43.10.2.1.4.1.1 | cut -f 2,2 -d " ")
536# accounter: hardware(snmp)
537# accounter: hardware(pjl)
538# accounter: software(/usr/bin/pkpgcounter)
539#
540# The following, software without any argument, works since PyKota 1.21
541# and uses pkpgcounter's code internally.
542accounter: software()
543
544# What should we do if the accounter's subprocess doesn't return
545# a valid result (for example doesn't return an integer on its stdout)
546#
547# Valid values are : 'continue' and 'stop'. 'stop' is the default
548# if unset.
549#
550# 'continue' means try to process as usual, this may introduce
551# accounting errors and free jobs. This was the default behavior
552# until v1.20alpha5.
553#
554# 'stop' means fail and stop the print queue. If an accounter
555# error occurs, most of the time this is a misconfiguration, so
556# stopping the print queue is usually the better thing to do
557# until the admin has fixed the configuration.
558#
559# This value can be set either globally or on a per printer basis
560# If both are defined, the printer option has priority.
561#
562# NB : This directive shouldn't do much now because in case
563# of external accounter error, PyKota just loops.
564#
565# onaccountererror: continue
566onaccountererror: stop
567
568# Print Quota administrator
569# These values can be set either globally or per printer or both.
570# If both are defined, the printer option has priority.
571# If these values are not set, the default admin root
572# and the default adminmail root@localhost are used.
573admin: John Doe
574adminmail: root@localhost
575
576#
577# Who should we send an email to in case a quota is reached ?
578# possible values are : DevNull, User, Admin, Both, External(some command)
579# The Both value means that the User and the Admin will receive
580# an email message.
581# The DevNull value means no email message will be sent.
582# This value can be set either globally or per printer or both.
583# If both are defined, the printer option has priority.
584# If the value is not set, then the default BOTH applies.
585#
586#   Format of the external syntax :
587#
588#       mailto: external(/usr/bin/mycommand >/dev/null)
589#
590#   You can use :
591#
592#       '%(action)s'            will contain either WARN or DENY
593#       '%(username)s'          will contain the user's name
594#       '%(printername)s'       will contain the printer's name
595#       '%(email)s'             will contain the user's email address
596#       '%(message)s'           will contain the message if you want
597#                               to use it.
598#
599#   On your command line, to pass arguments to your command.
600#   Example :
601#
602#       mailto: external(/usr/bin/callpager %(username)s "Quota problem on %(printername)s" >/dev/null)
603#
604#   To automatically send a WinPopup message (this may only work with a PDC,
605#   here the same machine does Samba as PDC + CUPS) :
606#
607#       mailto: external(echo "%(message)s"  | /usr/bin/iconv --to-code utf-8 --from-code iso-8859-15 | /usr/bin/smbclient -M "%(username)s" 2>&1 >/dev/null)
608#
609#   NB : I use ISO-8859-15, but Windows expects UTF-8, so we pipe the message
610#        into iconv before sending it to the Windows user.
611#
612# or more simply :
613#
614#       mailto: external(/usr/share/pykota/mailandpopup.sh %(username)s %(printername)s "%(email)s" "%(message)s" 2>&1 >/dev/null)
615#
616#   NB : The mailandpopup.sh shell script is now included in PyKota
617#
618#   NB : in ANY case, don't forget to redirect your command's standard output
619#        somewhere (e.g. >/dev/null) so that there's no perturbation to the
620#        underlying layer (filter or backend)
621#
622mailto: both
623
624#
625# Grace delay in days
626# This value can be set either globally or per printer or both.
627# If both are defined, the printer option has priority.
628# If the value is not set then the default seven (7) days applies.
629gracedelay: 7
630
631#
632# Poor man's threshold
633# If account balance reaches below this amount,
634# a warning message is sent by email
635#
636# If unset, default poor man's threshold is 1.0.
637# This option can only appear in the global section
638poorman: 2.0
639
640# Poor man's warning message
641# The warning message that is sent if the "poorman" value is reached
642# Again this must appear in the global section
643poorwarn: Your Print Quota account balance is low.
644 Soon you'll not be allowed to print anymore.
645
646# Soft limit reached warning message
647# The warning message that is sent if the soft quota limit is reached
648# May appear either globally or on a per-printer basis
649softwarn: Your Print Quota Soft Limit is reached.
650 This means that you may still be allowed to print for some
651 time, but you must contact your administrator to purchase
652 more print quota.
653 
654# Hard limit reached error message
655# The error message that is sent if the hard quota limit is reached
656# May appear either globally or on a per-printer basis
657hardwarn: Your Print Quota Hard Limit is reached.
658 This means that you are not allowed to print anymore.
659 Please contact your administrator at root@localhost
660 as soon as possible to solve the problem.
661
662# one section per printer, or no other section at all if all options
663# are defined globally.
664# Each section's name must be the same as the printer's queue name as defined
665# in your printing system, be it CUPS or LPRng, between square brackets, for
666# example a print queue named 'hpmarketing' would appear in this file as
667# [hpmarketing]
668
669
670# Default policy to apply when either :
671#
672#       - Printer doesn't exist in PyKota's database
673#       - User doesn't exist in PyKota's database
674#       - User has no quota entry for this Printer in PyKota's database
675#
676# Value can be either allow or deny or external(some command here)
677#
678# This value can be set either globally or per printer or both.
679# If both are defined, the printer option has priority.
680# If the value is not set then the default policy DENY applies.
681# There's no policy wrt inexistant groups, they are ignored.
682#
683# external policy can be used to launch any external command of your choice,
684# for example to automatically add the user to the quota storage
685# if he is unknown. Example :
686#
687#   policy: external(/usr/bin/edpykota --add --printer %(printername)s --softlimit 50 --hardlimit 60 %(username)s >/dev/null)
688#
689# NB : If you want to limit users by their account balance value, it is preferable to
690# use the following policy to automate user account creation on first print :
691#
692#   policy: external(/usr/bin/autopykota --initbalance 25.0 >/dev/null)
693#
694#   This will automatically add the user if he doesn't already exist, and
695#   set his initial balance value to 25.0 (for example). If the user already
696#   exists then his balance value will not be modified.
697#   Please don't use autopykota if you want to limit your users by page
698#   quota, and in any case, carefully read autopykota's help or manpage
699#   and understand its goal before using it in your own configuration.
700#
701# Of course you can launch any command of your choice with this, e.g. :
702#
703#   policy: external(/usr/local/bin/myadminscript.sh %(username)s >/dev/null)
704
705# You can use :
706#
707#       '%(username)s'          will contain the user's name
708#       '%(printername)s'       will contain the printer's name
709#
710#   On your command line, to pass arguments to your command.
711#
712#   NB : Don't forget to redirect your command's standard output somewhere
713#        (e.g. >/dev/null) so that there's no perturbation to the underlying
714#        layer (filter or backend)
715#
716# If the printer, user, or user quota entry still doesn't exist after
717# external policy command was launched (the external command didn't add it),
718# or if an error occured during the execution of the external policy
719# command, then the job is rejected.
720#
721policy: deny
722
723# Pre and Post Hooks
724# These directives allow the easy plug-in of any command of your choice
725# at different phases of PyKota's execution.
726# Pre and Post Hooks can access some of PyKota's internal information
727# by reading environment variables as described below.
728# The actual phase of PyKota's execution is available in the
729# PYKOTAPHASE environment variable.
730# Pre and Post Hooks can be defined either globally, per printer,
731# or both. If both are defined, the printer specific hook has
732# priority.
733#
734# List of available environment variables :
735# NB : Most of these variables are also available during the execution
736# of external commands defined in the accounter and mailto
737# directives.
738#
739# PYKOTADIRECTORY : The directory containing cupspykota's temporary files
740# PYKOTADATAFILE : The name of the temporary file which contains the
741#                  job's datas
742# PYKOTAFILENAME : The name of the file which contains the job's datas or
743#                  empty if datas come from stdin
744# PYKOTACONTROLFILE : The name of the IPP message file
745# PYKOTAMD5SUM : Contains an hexadecimal digest of the md5 sum of the job's datas
746# PYKOTAPHASE : BEFORE or AFTER the job is sent to the printer
747# PYKOTAACTION : ALLOW or DENY or WARN for current print job
748# PYKOTAUSERNAME : user's name
749# PYKOTAPRINTERNAME : printer's name
750# PYKOTAPGROUPS : list of printers groups the current printer is a member of
751# PYKOTAJOBID : job's id
752# PYKOTATITLE : job's title
753# PYKOTACOPIES : number of copies
754# PYKOTAOPTIONS : job's options
755# PYKOTABALANCE : user's account balance
756# PYKOTALIFETIMEPAID : user's grand total paid
757# PYKOTALIMITBY : user print limiting factor, for example 'quota' or 'balance'
758# PYKOTAPAGECOUNTER : user's page counter on this printer
759# PYKOTALIFEPAGECOUNTER : user's life time page counter on this printer
760# PYKOTASOFTLIMIT : user's soft page limit on this printer
761# PYKOTAHARDLIMIT : user's hard page limit on this printer
762# PYKOTADATELIMIT : user's soft to hard limit date limit on this printer
763# PYKOTASTATUS : contains "CANCELLED" when SIGTERM was received by PyKota
764#                else is not set.
765# PYKOTAJOBSIZEBYTES : contains the job's size in bytes. Always available.
766# PYKOTAPRECOMPUTEDJOBSIZE : contains the precomputed job's size
767# PYKOTAPRECOMPUTEDJOBPRICE : contains the precomputed job's price
768# PYKOTAJOBORIGINATINGHOSTNAME : contains the client's hostname if
769#                                it is possible to retrieve it.
770# PYKOTAPRINTERHOSTNAME : the printer's hostname or IP address for network
771#                         printers, or "localhost" if not defined or not
772#                         meaningful.
773# PYKOTAWARNCOUNT : the number of times the user was forbidden to print but a banner
774#                   page was still printed on the current printer.                   
775# PYKOTAOVERCHARGE : user's overcharging factor.
776# PYKOTAJOBBILLING : Job's billing code if present (CUPS only)
777# PYKOTAREASON : if the job was denied or a warning needs to be issued, contains
778#                the message to send to the user.
779#
780
781# PreHook : gets executed after being sure the user, printer and user quota
782# entry on the printer both exist in the PyKota database, and after
783# checking if the user is allowed to print or not, but just before
784# the job is sent to the printer (if allowed)
785# prehook has access to many environment variables :
786#
787# PYKOTAACTION contains either "ALLOW", "WARN" or "DENY" and
788# represents the action which is to be done wrt the print job.
789# PYKOTAPHASE contains 'BEFORE' during execution of prehook
790#
791# uncomment the line below to see what environment variables are available
792# prehook: /usr/bin/printenv >/tmp/before
793
794# PostHook : gets executed after the job has been added to the history.
795# posthook has access to all the environment variables defined above,
796# as well as two additionnal environment variables : PYKOTAJOBPRICE
797# and PYKOTAJOBSIZE.
798# PYKOTAPHASE contains 'AFTER' during execution of posthook.
799#
800# uncomment the line below to see what environment variables are available
801# posthook: /usr/bin/printenv >/tmp/after
802
803# AccountBanner : how should banner accounting be done ?
804#
805# NB : CUPS ONLY FOR NOW !
806#
807# If enabled, banner pages printed from StartingBanner and/or EndingBanner
808# (depending on the value) will be included in the accounting for the
809# print job
810#
811# If disabled, banner pages printed from StartingBanner and EndingBanner will
812# *not* be included in the accounting for the print job
813#
814# IMPORTANT : CUPS generated banners are ALWAYS accounted for, although you
815#             can refund them by using negative prices on printers.
816#
817# Allowed values : Starting | Ending | None | Both
818#
819#       - Starting : only the starting banner will be accounted for.
820#       - Ending : only the ending banner will be accounted for.
821#       - Both : both starting and ending banners will be accounted for.
822#       - None : banners will not be accounted for.
823#
824# Default value :
825# accountbanner: Both
826
827# Maximal number of times the banner will still be printed if
828# the user is forbidden to print.
829#
830# NB : CUPS ONLY FOR NOW !
831#
832# This option can be set either globally or on a per printer basis.
833# Allowed values are 0 or any positive integer.
834# Default value is 0, which means that the banner won't be printed
835# at all if the user is forbidden to print.
836maxdenybanners: 0
837
838# StartingBanner : if defined will print a banner before the rest of the job
839# is printed. The argument can be a printable file, or an executable file.
840# If not executable, the file will be printed as is. If executable, the
841# file will be executed and its output will be printed.
842#
843# NB : CUPS ONLY FOR NOW !
844#
845# In any case, the banner content which will be sent to the printer
846# MUST be in a format your printer will accept !!!
847#
848# The pkbanner command included in PyKota can automatically generate
849# starting and ending banners in the PostScript format. You can use
850# this command in a pipe through GhostScript if your printer doesn't
851# accept PostScript as an input format.
852# NB : pkbanner's default page size is A4
853#
854# startingbanner: /home/joe/mystaticbanner.ps
855# startingbanner: /usr/bin/pkbanner --pagesize=A4 --logo="/home/joe/mylogo.jpeg" --url="http://tech.example.com"
856# startingbanner: /usr/bin/pkbanner | gs -q -dNOPAUSE -dBATCH -dPARANOIDSAFER -sOutputFile=- -sDEVICE=lj5mono -
857# startingbanner: /usr/bin/pkbanner
858
859# EndingBanner : if defined will print a banner after the job
860# has been printed. The argument can be a printable file, or an executable file.
861# If not executable, the file will be printed as is. If executable, the
862# file will be executed and its output will be printed.
863#
864# NB : CUPS ONLY FOR NOW !
865#
866# In any case, the banner content which will be sent to the printer
867# MUST be in a format your printer will accept !!!
868#
869# The pkbanner command included in PyKota can automatically generate
870# starting and ending banners in the PostScript format. You can use
871# this command in a pipe through GhostScript if your printer doesn't
872# accept PostScript as an input format.
873# NB : pkbanner's default page size is A4
874#
875# A static banner page
876# endingbanner: /home/joe/mystaticbanner.ps
877#
878# A banner with personnalized logo and url
879# endingbanner: /usr/bin/pkbanner --pagesize=A4 --logo="/home/joe/mylogo.jpeg" --url="http://tech.example.com"
880#
881# A banner in the format accepted by the printer
882# endingbanner: /usr/bin/pkbanner | gs -q -dNOPAUSE -dBATCH -dPARANOIDSAFER -sOutputFile=- -sDEVICE=lj5mono -
883#
884# A banner with more info on it, extracted from the yellow pages.
885# the string "Phone 111222333444" will be added to the banner page
886# if extractphone.sh returns 111222333444 for the current user.
887# endingbanner: /usr/bin/pkbanner Phone `extractphone.sh $PYKOTAUSERNAME`
888#
889# Default PyKota banner
890# endingbanner: /usr/bin/pkbanner
891
892# How should enforcement be done for this printer ?
893#
894# "laxist" is the default if value is not set, and allows users
895# to be over quota on their last job.
896#
897# "strict" tries to prevent users from ever being over quota.
898#
899# Enforcement can be defined either globally, per printer,
900# or both. If both are defined, the printer specific enforcement
901# setting has priority.
902#
903# valid values : "strict" or "laxist"
904#
905# default value
906# enforcement : laxist
907enforcement : strict
908
909# Should we trust the job size on this printer ?
910#
911# "trustjobsize : yes" is the default, the jobsize, either computed
912# by the hardware or by software is trusted.
913#
914# "trustjobsize : >N:precomputed" : uses the precomputed value if jobsize > N pages
915# "trustjobsize : >N:25" : uses 25 if jobsize is >N pages
916#
917# General form : ">n:m" where n is a positive integer, and m is
918# either the word 'precomputed' or a positive integer.
919# The special form "yes" is also accepted and is the default.
920#
921# This directive can be set either globally or on a per printer
922# basis. Use this directive when hardware accounting for a particular
923# printer produces some glitches due to the printer returning
924# incorrect answers.
925#
926# NB : DON'T MODIFY THIS IF YOU DON'T NEED TO. THIS IS ONLY TO BE USED
927# AS A WORKAROUND FOR SOME PRINTERS. IT'S PROBABLY BETTER TO ALWAYS
928# SET THIS DIRECTIVE TO 'yes'. THIS DIRECTIVE WILL ONLY BE HONORED
929# IF PYKOTA DETECTS A DIFFERENCE BETWEEN THE PRECOMPUTED JOB SIZE
930# AND THE JOB SIZE AS COMPUTED BY PYKOTA EITHER USING HARDWARE OR
931# SOFTWARE.
932trustjobsize : yes
933
934# Should we deny duplicate jobs ?
935#
936# A duplicate is a job sent twice (or more) in a row to the same printer
937# by the same user.
938#
939# This can be defined either globally or on a per printer basis
940# The default value is 'no', meaning that duplicate jobs are
941# allowed.
942#
943# NB : if an user prints a job, a second user prints another
944#      job, and the first user prints the first job again,
945#      this is NOT considered as a duplicate since the two
946#      identical jobs printed by the first user are not
947#      one just after the other.
948#
949# Possible values are 'yes', 'no', or any other string.
950# If the string is not recognized as a truth value,
951# it is considered to be a command to launch.
952# PyKota launches the command and parses its standard
953# output. The special keywords 'ALLOW' and 'DENY' are
954# recognized, allowing an external tool to decide if
955# the job is to be allowed or denied.
956#
957# denyduplicates : /usr/bin/myowncommand with some arguments
958# denyduplicates : yes
959denyduplicates : no
Note: See TracBrowser for help on using the browser.