[1015] | 1 | # $Id$ |
---|
| 2 | |
---|
[3259] | 3 | PyKota - Print Quotas for CUPS |
---|
[1015] | 4 | |
---|
[3279] | 5 | (c) 2003, 2004, 2005, 2006, 2007, 2008 Jerome Alet <alet@librelogiciel.com> |
---|
[3259] | 6 | This program is free software: you can redistribute it and/or modify |
---|
[1015] | 7 | it under the terms of the GNU General Public License as published by |
---|
[3259] | 8 | the Free Software Foundation, either version 3 of the License, or |
---|
[1015] | 9 | (at your option) any later version. |
---|
| 10 | |
---|
| 11 | This program is distributed in the hope that it will be useful, |
---|
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 14 | GNU General Public License for more details. |
---|
| 15 | |
---|
| 16 | You should have received a copy of the GNU General Public License |
---|
[3259] | 17 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
[1015] | 18 | |
---|
| 19 | ============================================================ |
---|
| 20 | |
---|
| 21 | Documentation : |
---|
| 22 | --------------- |
---|
| 23 | |
---|
| 24 | pykota.schema : |
---|
| 25 | |
---|
| 26 | This file can be used to modify an existing LDAP directory |
---|
[1016] | 27 | to add the necessary object classes and attributes for use |
---|
| 28 | with PyKota. |
---|
| 29 | |
---|
| 30 | Include it in your LDAP server's configuration. |
---|
[2361] | 31 | For example, with OpenLDAP under Debian : |
---|
[1016] | 32 | |
---|
| 33 | $ cp pykota.schema /etc/ldap/schema |
---|
[2361] | 34 | (no need to do this if you install from PyKota's Debian package) |
---|
[3277] | 35 | |
---|
| 36 | NB: With OpenLDAP under Red Hat-based distros, where /etc/ldap is |
---|
| 37 | referenced, substitute /etc/openldap. e.g. |
---|
| 38 | |
---|
| 39 | $ cp pykota.schema /etc/openldap/schema |
---|
[1016] | 40 | |
---|
| 41 | Then edit /etc/ldap/slapd.conf and add a line to |
---|
| 42 | include the PyKota schema. You should have something |
---|
| 43 | like : |
---|
| 44 | |
---|
| 45 | # Schema and objectClass definitions |
---|
| 46 | include /etc/ldap/schema/core.schema |
---|
| 47 | include /etc/ldap/schema/cosine.schema |
---|
| 48 | include /etc/ldap/schema/nis.schema |
---|
| 49 | include /etc/ldap/schema/inetorgperson.schema |
---|
| 50 | include /etc/ldap/schema/pykota.schema |
---|
| 51 | |
---|
[1163] | 52 | While this is not mandatory, you may want to create |
---|
| 53 | some indexes to speed things up a bit : |
---|
| 54 | |
---|
| 55 | You should already have these : |
---|
| 56 | |
---|
| 57 | index objectClass eq |
---|
| 58 | index cn pres,eq,sub |
---|
| 59 | index uid pres,eq,sub |
---|
| 60 | |
---|
| 61 | But we recommend that you add these : |
---|
| 62 | |
---|
[1200] | 63 | index pykotaUserName pres,eq,sub |
---|
| 64 | index pykotaGroupName pres,eq,sub |
---|
| 65 | index pykotaPrinterName pres,eq,sub |
---|
[2361] | 66 | index pykotaBillingCode pres,eq,sub |
---|
[1163] | 67 | index pykotaLastJobIdent eq |
---|
| 68 | |
---|
[2576] | 69 | Now you must ensure that the DNs PyKota will use to bind to |
---|
[1352] | 70 | your OpenLDAP server don't have search queries size limits, |
---|
| 71 | which gives for example (OpenLDAP 2.1.x or above) : |
---|
| 72 | |
---|
[2576] | 73 | limits dn="cn=pykotaadmin,dc=example,dc=com" size.soft=-1 size.hard=soft |
---|
| 74 | limits dn="cn=pykotauser,dc=example,dc=com" size.soft=-1 size.hard=soft |
---|
[1352] | 75 | |
---|
[2576] | 76 | Where pykotaadmin and pykotauser are the usernames used to bind to your |
---|
| 77 | OpenLDAP server within PyKota, respectively in complete ReadWrite mode |
---|
[1352] | 78 | (as set in pykotadmin.conf) and in ReadOnly mode (pykota.conf). |
---|
| 79 | |
---|
[2576] | 80 | NB : YOU have to define the ACLs necessary for user pykotaadmin to |
---|
| 81 | have unlimited Read+Write access to your LDAP tree, and for user |
---|
| 82 | pykotauser to have unlimited ReadOnly access to your LDAP tree. |
---|
| 83 | In the sentence above, "unlimited" means no limit with regard to |
---|
| 84 | the number of records returned by a search operation. Of course |
---|
| 85 | you may want to restrict the access to only some attributes, but |
---|
[2911] | 86 | this is up to you to decide. An example giving full write access |
---|
| 87 | to the pykotaadmin user is : |
---|
[1016] | 88 | |
---|
[2911] | 89 | access to dn.subtree="ou=PyKota,dc=example,dc=com" |
---|
| 90 | by dn="cn=pykotaadmin,dc=example,dc=com" write |
---|
| 91 | |
---|
| 92 | access to dn.subtree="ou=People,dc=example,dc=com" |
---|
| 93 | by dn="cn=pykotaadmin,dc=example,dc=com" write |
---|
| 94 | |
---|
| 95 | access to dn.subtree="ou=Groups,dc=example,dc=com" |
---|
| 96 | by dn="cn=pykotaadmin,dc=example,dc=com" write |
---|
| 97 | |
---|
| 98 | Please adapt this to your own needs and configuration. |
---|
| 99 | |
---|
[2576] | 100 | Now, stop the OpenLDAP server : |
---|
| 101 | |
---|
| 102 | $ /etc/init.d/slapd stop |
---|
[3277] | 103 | |
---|
[2576] | 104 | Generate the index files : |
---|
| 105 | |
---|
| 106 | $ slapindex |
---|
| 107 | |
---|
| 108 | And finally restart the OpenLDAP server : |
---|
| 109 | |
---|
| 110 | $ /etc/init.d/slapd start |
---|
[1015] | 111 | |
---|
[3277] | 112 | NB: On Red Hat-based distros, use '/sbin/service ldap stop' and |
---|
| 113 | '/sbin/service ldap start' instead. |
---|
| 114 | |
---|
[1016] | 115 | pykota-sample.ldif : |
---|
[1015] | 116 | |
---|
[1200] | 117 | You can use this file to initialize an LDAP tree for PyKota, if |
---|
| 118 | you want. |
---|
[1015] | 119 | |
---|
[1200] | 120 | The structure used in this file is NOT mandatory ! |
---|
| 121 | Provided you put correct parameters into /etc/pykota/pykota.conf, |
---|
| 122 | you can structure your LDAP directory the way you want. |
---|
| 123 | |
---|
[1036] | 124 | To use an LDAP directory as the Quota Storage, just modify |
---|
[1098] | 125 | /etc/pykota/pykota.conf to make it contain lines similar to the LDAP |
---|
[1036] | 126 | related ones in conf/pykota.conf.sample, but adapted to your |
---|
| 127 | own configuration. Also de-activate the PostgreSQL-related lines. |
---|
| 128 | |
---|
[1015] | 129 | ============================================================ |
---|