[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 | |
---|
| 48 | [global] |
---|
| 49 | # Storage backend for quotas |
---|
[2593] | 50 | # only PGStorage (PostgreSQL), LDAPStorage (OpenLDAP or else), |
---|
[2638] | 51 | # MySQLStorage (MySQL) and SQLiteStorage (SQLite 3) are supported. |
---|
[2593] | 52 | # |
---|
[2638] | 53 | # BerkeleyDB is planned. |
---|
[859] | 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 | |
---|
[2638] | 62 | ############################################################################ |
---|
| 63 | # PostgreSQL or MySQL: comment this section out if you use another backend # |
---|
| 64 | ############################################################################ |
---|
[1021] | 65 | storagebackend: pgstorage |
---|
[2638] | 66 | # storagebackend: mysqlstorage |
---|
[1021] | 67 | |
---|
[952] | 68 | # Quota Storage Server hostname (and optional port) |
---|
[1353] | 69 | # e.g. db.example.com:5432 |
---|
[695] | 70 | storageserver: localhost |
---|
[859] | 71 | |
---|
| 72 | # |
---|
| 73 | # name of the Quota Storage Database |
---|
[695] | 74 | storagename: pykota |
---|
[859] | 75 | |
---|
[1087] | 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 | # |
---|
[2819] | 85 | storageuser : pykotauser |
---|
| 86 | # In the line below change the password's value if needed. |
---|
| 87 | storageuserpw : readonlypw |
---|
[695] | 88 | |
---|
[2593] | 89 | #################################################################### |
---|
| 90 | # LDAP : comment this section out if you use another backend # |
---|
| 91 | #################################################################### |
---|
[1038] | 92 | # LDAP example, uncomment and adapt it to your own configuration : |
---|
[1016] | 93 | #storagebackend: ldapstorage |
---|
[2355] | 94 | #storageserver: ldap://ldap.example.com:389 |
---|
| 95 | #storagename: dc=example,dc=com |
---|
[2576] | 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 |
---|
[1025] | 102 | # |
---|
[1968] | 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. |
---|
[2442] | 112 | #cacert: /etc/pykota/mycertfile |
---|
[1968] | 113 | # |
---|
| 114 | # |
---|
[1025] | 115 | # Here we define some helpers to know where |
---|
| 116 | # to plug into an existing LDAP directory |
---|
[2355] | 117 | #userbase: ou=People,dc=example,dc=com |
---|
[1025] | 118 | #userrdn: uid |
---|
[2355] | 119 | #balancebase: ou=People,dc=example,dc=com |
---|
[1038] | 120 | #balancerdn: uid |
---|
[2355] | 121 | #groupbase: ou=Groups,dc=example,dc=com |
---|
[1025] | 122 | #grouprdn: cn |
---|
[2355] | 123 | #printerbase: ou=Printers,ou=PyKota,dc=example,dc=com |
---|
[1025] | 124 | #printerrdn: cn |
---|
[2355] | 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 |
---|
[1969] | 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 |
---|
[2355] | 136 | #userquotabase: ou=UQuotas,ou=PyKota,dc=example,dc=com |
---|
[1969] | 137 | #groupquotabase: group |
---|
[2355] | 138 | #groupquotabase: ou=GQuotas,ou=PyKota,dc=example,dc=com |
---|
[1969] | 139 | |
---|
[1105] | 140 | # |
---|
| 141 | # How to create new accounts and groups |
---|
[1510] | 142 | # authorized values are "below" and "attach(objectclass name [, fail|warn])" |
---|
[1105] | 143 | # |
---|
| 144 | # "below" creates the new accounts/groups as standalone entries |
---|
| 145 | # below the above defined 'userbase' ou |
---|
[1029] | 146 | # |
---|
[1510] | 147 | # attach(objectclass name [, action]) tries to find some existing user/group |
---|
[1105] | 148 | # using the above defined 'userrdn' or 'grouprdn' and 'userbase' |
---|
| 149 | # 'groupbase', and attach the PyKota specific entries to it. |
---|
[1510] | 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". |
---|
[1105] | 155 | # |
---|
[1510] | 156 | # a possible value: newuser: attach(posixAccount, warn) |
---|
[1114] | 157 | #newuser : below |
---|
| 158 | #newgroup : below |
---|
[1111] | 159 | # |
---|
| 160 | # LDAP attribute which stores the user's email address |
---|
[1114] | 161 | #usermail : mail |
---|
[1105] | 162 | |
---|
| 163 | # |
---|
[1029] | 164 | # Choose what attribute contains the list of group members |
---|
| 165 | # common values are : memberUid, uniqueMember, member |
---|
| 166 | #groupmembers: memberUid |
---|
[1016] | 167 | |
---|
[1356] | 168 | # Activate low-level LDAP cache yes/no |
---|
| 169 | # Nothing to do with "storagecaching" which is higher level |
---|
| 170 | # and database independant. |
---|
[1357] | 171 | # This saves some search queries and may help with heavily |
---|
| 172 | # loaded LDAP servers. |
---|
| 173 | # This is EXPERIMENTAL. |
---|
[1368] | 174 | # |
---|
| 175 | # BEWARE : SETTING THIS TO 'YES' CAUSES PROBLEMS FOR NOW |
---|
| 176 | # BETTER TO LET IT SET TO 'NO' |
---|
[1604] | 177 | # ldapcache: no |
---|
[1356] | 178 | |
---|
[2593] | 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 |
---|
[2777] | 185 | # caching mechanism works with both relationnal and OpenLDAP backends |
---|
[2593] | 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 | # |
---|
[2777] | 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 | # |
---|
[2593] | 196 | # FYI, I ALWAYS SET IT TO YES ! |
---|
| 197 | # |
---|
| 198 | storagecaching: 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. |
---|
[2777] | 204 | # Disabling the job history with a relationnal backend works too |
---|
[2593] | 205 | # but it's probably less useful than with LDAP. |
---|
| 206 | disablehistory: No |
---|
| 207 | |
---|
[695] | 208 | # Where to log ? |
---|
[707] | 209 | # supported values : stderr, system (system means syslog, but don't use 'syslog' here) |
---|
[853] | 210 | # if the value is not set then the default SYSTEM applies. |
---|
[782] | 211 | logger: system |
---|
[695] | 212 | |
---|
[1186] | 213 | # Enable debugging ? Put YES or NO there. |
---|
[2681] | 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. |
---|
[1240] | 223 | debug : Yes |
---|
[1021] | 224 | |
---|
[2262] | 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 |
---|
| 230 | logourl : http://www.librelogiciel.com/software/PyKota/pykota.png |
---|
| 231 | |
---|
[2265] | 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 |
---|
| 237 | logolink : http://www.librelogiciel.com/software/ |
---|
| 238 | |
---|
| 239 | # |
---|
[695] | 240 | # Mail server to use to warn users |
---|
[853] | 241 | # If the value is not set then localhost is used. |
---|
[695] | 242 | smtpserver: localhost |
---|
[806] | 243 | |
---|
[1517] | 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 | |
---|
[1353] | 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 |
---|
[2777] | 263 | # above) or a relationnal one, then email messages are sent to |
---|
[1353] | 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. |
---|
| 270 | maildomain: example.com |
---|
| 271 | |
---|
[1227] | 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. |
---|
[1757] | 277 | # Of course you have to use lowercase only when adding |
---|
[1227] | 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 |
---|
[2476] | 282 | # system is converted to lowercase at the start of printing, |
---|
| 283 | # BUT ONLY when printing. |
---|
[1227] | 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. |
---|
| 288 | utolower: No |
---|
| 289 | |
---|
[1757] | 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 | |
---|
[1956] | 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 | |
---|
[1875] | 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. |
---|
| 327 | privacy : no |
---|
| 328 | |
---|
[2583] | 329 | # When the real CUPS backend fail, should we modify the |
---|
| 330 | # user's page counters and account balance or not ? |
---|
[2759] | 331 | # Also should we retry and if yes then how often and how many times ? |
---|
[2583] | 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". |
---|
[2759] | 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. |
---|
[2764] | 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). |
---|
[2759] | 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. |
---|
[2583] | 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. |
---|
[2759] | 353 | # onbackenderror : charge,retry:5:60 |
---|
| 354 | # onbackenderror : retry:0:300 |
---|
| 355 | # onbackenderror : retry:3:300,nocharge |
---|
[2583] | 356 | # onbackenderror : charge |
---|
| 357 | onbackenderror : nocharge |
---|
| 358 | |
---|
[2307] | 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 | |
---|
[2385] | 370 | # Should we launch a command to overwrite the job's ticket ? |
---|
| 371 | # This allows a command to overwrite the username and/or the |
---|
[2631] | 372 | # billing code used, or to deny or cancel the job. |
---|
[2385] | 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 |
---|
[2803] | 381 | # AUTH=NO (equivalent to DENY below) |
---|
[2392] | 382 | # DENY |
---|
[2631] | 383 | # CANCEL |
---|
[2385] | 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. |
---|
[2803] | 392 | # If DENY or CANCEL is output, the username can't be overwritten. |
---|
[2385] | 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 | # |
---|
[2631] | 415 | # unknown_billingcode : deny |
---|
| 416 | # unknown_billingcode : deny(/path/to/some/script) |
---|
[2385] | 417 | # unknown_billingcode : create |
---|
| 418 | |
---|
[2405] | 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. |
---|
[2406] | 425 | # On my system, when not set, the /var/spool/cups/tmp directory is used. |
---|
[2405] | 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 |
---|
| 437 | keepfiles : no |
---|
| 438 | |
---|
| 439 | |
---|
[974] | 440 | # What is the accounting backend to use |
---|
| 441 | # |
---|
| 442 | # supported values : |
---|
| 443 | # |
---|
[1475] | 444 | # - hardware : asks the printer for its lifetime page counter |
---|
[976] | 445 | # via either SNMP, AppleTalk, or any external |
---|
[1826] | 446 | # command. This method is the recommended one |
---|
| 447 | # in PyKota since its beginning. |
---|
[976] | 448 | # |
---|
[1483] | 449 | # In the lines below "%(printer)s" is automatically replaced |
---|
| 450 | # at run time with your printer's Fully Qualified Domain Name |
---|
[1826] | 451 | # for network printers, if PyKota can extract it from its |
---|
| 452 | # environment. |
---|
[1483] | 453 | # e.g. myprinter.example.com |
---|
| 454 | # |
---|
[1746] | 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 | # |
---|
[2425] | 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 | # |
---|
[1746] | 478 | # Other Examples : |
---|
[1483] | 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 | # |
---|
[1587] | 521 | # accounter: hardware(LC_ALL=C /usr/share/pykota/pagecount.pl %(printer)s 9100) |
---|
[1483] | 522 | # |
---|
[1587] | 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 | # |
---|
[1483] | 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 | # |
---|
[1746] | 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. |
---|
[1483] | 536 | # |
---|
[1746] | 537 | # PYKOTA INCLUDES SUCH SCRIPTS FOR SNMP AND APPLETALK PRINTERS, MORE TO COME |
---|
[1483] | 538 | # |
---|
[1746] | 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. |
---|
[1483] | 547 | # |
---|
| 548 | # |
---|
[1475] | 549 | # - software : delegates the job's size computation to any |
---|
| 550 | # external command of your choice. |
---|
[980] | 551 | # |
---|
[1475] | 552 | # best choice for this is probably to set it |
---|
| 553 | # this way : |
---|
[1000] | 554 | # |
---|
[2074] | 555 | # accounter: software() |
---|
| 556 | # |
---|
[2345] | 557 | # which uses pkpgcounter's code internally to compute |
---|
[2074] | 558 | # the size of the job. |
---|
[2345] | 559 | # NB : YOU MUST NOW INSTALL pkpgcounter FOR PyKota TO WORK. |
---|
[2074] | 560 | # |
---|
| 561 | # You could obtain exactly the same result with : |
---|
| 562 | # |
---|
[1475] | 563 | # accounter: software(/usr/bin/pkpgcounter) |
---|
[1000] | 564 | # |
---|
[2074] | 565 | # But in this case the job would be passed through |
---|
[2345] | 566 | # pkpgcounter's parser a second time. |
---|
[2074] | 567 | # |
---|
[2345] | 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. |
---|
[1430] | 571 | # |
---|
[2074] | 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. |
---|
[980] | 577 | # |
---|
[974] | 578 | # This value can be set either globally or on a per printer basis |
---|
[976] | 579 | # If both are defined, the printer option has priority. |
---|
[994] | 580 | # |
---|
[1604] | 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 " ") |
---|
[1781] | 582 | # accounter: hardware(snmp) |
---|
| 583 | # accounter: hardware(pjl) |
---|
[2074] | 584 | # accounter: software(/usr/bin/pkpgcounter) |
---|
| 585 | # |
---|
[2252] | 586 | # The following, software without any argument, works since PyKota 1.21 |
---|
[2345] | 587 | # and uses pkpgcounter's code internally. |
---|
[2074] | 588 | accounter: software() |
---|
[806] | 589 | |
---|
[2635] | 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 | # |
---|
| 604 | preaccounter: software() |
---|
| 605 | |
---|
| 606 | |
---|
[1687] | 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 | # |
---|
[1826] | 625 | # NB : This directive shouldn't do much now because in case |
---|
| 626 | # of external accounter error, PyKota just loops. |
---|
| 627 | # |
---|
[1687] | 628 | # onaccountererror: continue |
---|
| 629 | onaccountererror: stop |
---|
| 630 | |
---|
[806] | 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. |
---|
[853] | 634 | # If these values are not set, the default admin root |
---|
| 635 | # and the default adminmail root@localhost are used. |
---|
[1186] | 636 | admin: John Doe |
---|
| 637 | adminmail: root@localhost |
---|
[806] | 638 | |
---|
[695] | 639 | # |
---|
[852] | 640 | # Who should we send an email to in case a quota is reached ? |
---|
[1192] | 641 | # possible values are : DevNull, User, Admin, Both, External(some command) |
---|
[852] | 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. |
---|
[853] | 647 | # If the value is not set, then the default BOTH applies. |
---|
[1192] | 648 | # |
---|
[1231] | 649 | # Format of the external syntax : |
---|
[1192] | 650 | # |
---|
[1231] | 651 | # mailto: external(/usr/bin/mycommand >/dev/null) |
---|
| 652 | # |
---|
[1192] | 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 |
---|
[1230] | 660 | # to use it. |
---|
[1192] | 661 | # |
---|
| 662 | # On your command line, to pass arguments to your command. |
---|
| 663 | # Example : |
---|
| 664 | # |
---|
[1193] | 665 | # mailto: external(/usr/bin/callpager %(username)s "Quota problem on %(printername)s" >/dev/null) |
---|
[1192] | 666 | # |
---|
[1233] | 667 | # To automatically send a WinPopup message (this may only work with a PDC, |
---|
| 668 | # here the same machine does Samba as PDC + CUPS) : |
---|
[1231] | 669 | # |
---|
[1232] | 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) |
---|
[1231] | 671 | # |
---|
[1233] | 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. |
---|
[1193] | 674 | # |
---|
[1240] | 675 | # or more simply : |
---|
| 676 | # |
---|
[1345] | 677 | # mailto: external(/usr/share/pykota/mailandpopup.sh %(username)s %(printername)s "%(email)s" "%(message)s" 2>&1 >/dev/null) |
---|
[1240] | 678 | # |
---|
| 679 | # NB : The mailandpopup.sh shell script is now included in PyKota |
---|
| 680 | # |
---|
[1233] | 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 | # |
---|
[852] | 685 | mailto: both |
---|
| 686 | |
---|
| 687 | # |
---|
[695] | 688 | # Grace delay in days |
---|
[806] | 689 | # This value can be set either globally or per printer or both. |
---|
| 690 | # If both are defined, the printer option has priority. |
---|
[853] | 691 | # If the value is not set then the default seven (7) days applies. |
---|
[695] | 692 | gracedelay: 7 |
---|
| 693 | |
---|
[1077] | 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 |
---|
| 701 | poorman: 2.0 |
---|
| 702 | |
---|
[2692] | 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 |
---|
| 711 | balancezero: 0.0 |
---|
| 712 | |
---|
[1077] | 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 |
---|
| 716 | poorwarn: 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 |
---|
| 722 | softwarn: 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 |
---|
| 730 | hardwarn: 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 | |
---|
[853] | 735 | # one section per printer, or no other section at all if all options |
---|
[1025] | 736 | # are defined globally. |
---|
[1047] | 737 | # Each section's name must be the same as the printer's queue name as defined |
---|
[1604] | 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] |
---|
[806] | 741 | |
---|
| 742 | |
---|
[1594] | 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 | # |
---|
[806] | 751 | # This value can be set either globally or per printer or both. |
---|
| 752 | # If both are defined, the printer option has priority. |
---|
[956] | 753 | # If the value is not set then the default policy DENY applies. |
---|
[1038] | 754 | # There's no policy wrt inexistant groups, they are ignored. |
---|
[1152] | 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 | # |
---|
[1594] | 760 | # policy: external(/usr/bin/edpykota --add --printer %(printername)s --softlimit 50 --hardlimit 60 %(username)s >/dev/null) |
---|
[1152] | 761 | # |
---|
[1759] | 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 | # |
---|
[1152] | 774 | # Of course you can launch any command of your choice with this, e.g. : |
---|
| 775 | # |
---|
[1594] | 776 | # policy: external(/usr/local/bin/myadminscript.sh %(username)s >/dev/null) |
---|
[1196] | 777 | |
---|
| 778 | # You can use : |
---|
[1152] | 779 | # |
---|
[1196] | 780 | # '%(username)s' will contain the user's name |
---|
| 781 | # '%(printername)s' will contain the printer's name |
---|
| 782 | # |
---|
[1781] | 783 | # On your command line, to pass arguments to your command. |
---|
[1196] | 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 | # |
---|
[1594] | 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. |
---|
[1196] | 793 | # |
---|
[956] | 794 | policy: deny |
---|
[695] | 795 | |
---|
[1372] | 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, |
---|
[1495] | 804 | # or both. If both are defined, the printer specific hook has |
---|
[1372] | 805 | # priority. |
---|
| 806 | # |
---|
| 807 | # List of available environment variables : |
---|
| 808 | # NB : Most of these variables are also available during the execution |
---|
[1483] | 809 | # of external commands defined in the accounter and mailto |
---|
[1372] | 810 | # directives. |
---|
| 811 | # |
---|
[2303] | 812 | # PYKOTADIRECTORY : The directory containing cupspykota's temporary files |
---|
| 813 | # PYKOTADATAFILE : The name of the temporary file which contains the |
---|
| 814 | # job's datas |
---|
[2445] | 815 | # PYKOTAFILENAME : The name of the file which contains the job's datas or |
---|
| 816 | # empty if datas come from stdin |
---|
[2303] | 817 | # PYKOTACONTROLFILE : The name of the IPP message file |
---|
[1767] | 818 | # PYKOTAMD5SUM : Contains an hexadecimal digest of the md5 sum of the job's datas |
---|
[1372] | 819 | # PYKOTAPHASE : BEFORE or AFTER the job is sent to the printer |
---|
[1422] | 820 | # PYKOTAACTION : ALLOW or DENY or WARN for current print job |
---|
[1372] | 821 | # PYKOTAUSERNAME : user's name |
---|
| 822 | # PYKOTAPRINTERNAME : printer's name |
---|
[1439] | 823 | # PYKOTAPGROUPS : list of printers groups the current printer is a member of |
---|
[1372] | 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 |
---|
[1421] | 830 | # PYKOTALIMITBY : user print limiting factor, for example 'quota' or 'balance' |
---|
[1372] | 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 |
---|
[1442] | 836 | # PYKOTASTATUS : contains "CANCELLED" when SIGTERM was received by PyKota |
---|
| 837 | # else is not set. |
---|
[1517] | 838 | # PYKOTAJOBSIZEBYTES : contains the job's size in bytes. Always available. |
---|
[2062] | 839 | # PYKOTAPRECOMPUTEDJOBSIZE : contains the precomputed job's size |
---|
| 840 | # PYKOTAPRECOMPUTEDJOBPRICE : contains the precomputed job's price |
---|
[1502] | 841 | # PYKOTAJOBORIGINATINGHOSTNAME : contains the client's hostname if |
---|
| 842 | # it is possible to retrieve it. |
---|
[1694] | 843 | # PYKOTAPRINTERHOSTNAME : the printer's hostname or IP address for network |
---|
| 844 | # printers, or "localhost" if not defined or not |
---|
| 845 | # meaningful. |
---|
[2054] | 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. |
---|
[2217] | 849 | # PYKOTAJOBBILLING : Job's billing code if present (CUPS only) |
---|
[2474] | 850 | # PYKOTAREASON : if the job was denied or a warning needs to be issued, contains |
---|
| 851 | # the message to send to the user. |
---|
[2054] | 852 | # |
---|
[1372] | 853 | |
---|
| 854 | # PreHook : gets executed after being sure the user, printer and user quota |
---|
[1373] | 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) |
---|
[1372] | 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 |
---|
[1781] | 874 | # posthook: /usr/bin/printenv >/tmp/after |
---|
[1372] | 875 | |
---|
[1914] | 876 | # AccountBanner : how should banner accounting be done ? |
---|
[1915] | 877 | # |
---|
| 878 | # NB : CUPS ONLY FOR NOW ! |
---|
[1914] | 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 | |
---|
[2054] | 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. |
---|
| 909 | maxdenybanners: 0 |
---|
| 910 | |
---|
[1914] | 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. |
---|
[1915] | 915 | # |
---|
| 916 | # NB : CUPS ONLY FOR NOW ! |
---|
[1914] | 917 | # |
---|
| 918 | # In any case, the banner content which will be sent to the printer |
---|
[1931] | 919 | # MUST be in a format your printer will accept !!! |
---|
[1914] | 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. |
---|
[1923] | 925 | # NB : pkbanner's default page size is A4 |
---|
[1914] | 926 | # |
---|
[1930] | 927 | # startingbanner: /home/joe/mystaticbanner.ps |
---|
[1923] | 928 | # startingbanner: /usr/bin/pkbanner --pagesize=A4 --logo="/home/joe/mylogo.jpeg" --url="http://tech.example.com" |
---|
[1931] | 929 | # startingbanner: /usr/bin/pkbanner | gs -q -dNOPAUSE -dBATCH -dPARANOIDSAFER -sOutputFile=- -sDEVICE=lj5mono - |
---|
[1923] | 930 | # startingbanner: /usr/bin/pkbanner |
---|
[1914] | 931 | |
---|
[2326] | 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. |
---|
[1914] | 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 | # |
---|
[1915] | 937 | # NB : CUPS ONLY FOR NOW ! |
---|
| 938 | # |
---|
[1914] | 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. |
---|
[1923] | 946 | # NB : pkbanner's default page size is A4 |
---|
[1914] | 947 | # |
---|
[2193] | 948 | # A static banner page |
---|
[1930] | 949 | # endingbanner: /home/joe/mystaticbanner.ps |
---|
[2193] | 950 | # |
---|
| 951 | # A banner with personnalized logo and url |
---|
[1923] | 952 | # endingbanner: /usr/bin/pkbanner --pagesize=A4 --logo="/home/joe/mylogo.jpeg" --url="http://tech.example.com" |
---|
[2193] | 953 | # |
---|
| 954 | # A banner in the format accepted by the printer |
---|
[1931] | 955 | # endingbanner: /usr/bin/pkbanner | gs -q -dNOPAUSE -dBATCH -dPARANOIDSAFER -sOutputFile=- -sDEVICE=lj5mono - |
---|
[2193] | 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 |
---|
[1914] | 964 | |
---|
[1495] | 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 |
---|
| 980 | enforcement : strict |
---|
[2062] | 981 | |
---|
| 982 | # Should we trust the job size on this printer ? |
---|
| 983 | # |
---|
[2111] | 984 | # "trustjobsize : yes" is the default, the jobsize, either computed |
---|
[2062] | 985 | # by the hardware or by software is trusted. |
---|
| 986 | # |
---|
[2111] | 987 | # "trustjobsize : >N:precomputed" : uses the precomputed value if jobsize > N pages |
---|
| 988 | # "trustjobsize : >N:25" : uses 25 if jobsize is >N pages |
---|
[2062] | 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. |
---|
| 1005 | trustjobsize : yes |
---|
[2066] | 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 | # |
---|
[2308] | 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. |
---|
[2066] | 1029 | # |
---|
[2308] | 1030 | # denyduplicates : /usr/bin/myowncommand with some arguments |
---|
| 1031 | # denyduplicates : yes |
---|
[2066] | 1032 | denyduplicates : no |
---|
| 1033 | |
---|
[2692] | 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 |
---|
| 1040 | duplicatesdelay : 0 |
---|