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