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

Revision 2837, 40.2 kB (checked in by jerome, 18 years ago)

Clarified the sample configuration files.

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