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

Revision 2803, 42.0 kB (checked in by jerome, 18 years ago)

Changed the behavior of the overwrite_jobticket directive : it's now
impossible to overwrite the username when the job has to be denied
or cancelled (although for cancelled I'm not sure if this is a good
or a bad idea).

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