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

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

Set default passwords for MySQL and PostgreSQL backends
in the sample configuration files.

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