[1015] | 1 | # $Id$ |
---|
| 2 | |
---|
[3259] | 3 | PyKota - Print Quotas for CUPS |
---|
[1015] | 4 | |
---|
[3561] | 5 | (c) 2003-2013 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 for the pykota-postgresql.sql script : |
---|
| 22 | ---------------------------------------------------- |
---|
| 23 | |
---|
| 24 | This script is to be used to create an empty Quota Storage |
---|
| 25 | DataBase using PostgreSQL as a backend. |
---|
| 26 | |
---|
| 27 | If you have already installed PyKota, and have datas in your |
---|
| 28 | Quota Storage DataBase, you may prefer to skip this section |
---|
| 29 | and read the next one. |
---|
| 30 | |
---|
[2817] | 31 | - edit the pykota-postgresql.sql file and modify the passwords on |
---|
| 32 | the 'CREATE USER' lines. |
---|
[3413] | 33 | |
---|
[1015] | 34 | - Launch the psql frontend and connect to the |
---|
| 35 | database template1 as a PostgreSQL administrator |
---|
| 36 | (i.e. the postgres user) : |
---|
[3413] | 37 | |
---|
[2564] | 38 | as user 'root' : |
---|
[3413] | 39 | |
---|
[2817] | 40 | # su - postgres |
---|
[3413] | 41 | |
---|
| 42 | you're now user 'postgres', then continue with : |
---|
| 43 | |
---|
[2955] | 44 | $ psql -f pykota-postgresql.sql template1 |
---|
[3413] | 45 | |
---|
| 46 | or depending on your settings you may prefer : |
---|
| 47 | |
---|
[2817] | 48 | $ psql -h localhost -U postgres -f pykota-postgresql.sql template1 |
---|
[3413] | 49 | |
---|
| 50 | - If no error message appears, your PostgreSQL PyKota storage |
---|
[2817] | 51 | is now ready for use. NB : a lot of NOTICE messages might appear, |
---|
| 52 | this is perfectly normal. |
---|
[3413] | 53 | |
---|
[2817] | 54 | - In ~pykota/pykota.conf, ensure that the following lines |
---|
| 55 | are present and unique inside the [global] section : |
---|
[3413] | 56 | |
---|
[2817] | 57 | storagebackend : pgstorage |
---|
| 58 | storageserver : localhost |
---|
| 59 | storagename : pykota |
---|
| 60 | storageuser : pykotauser |
---|
| 61 | storageuserpw : readonlypw |
---|
[3413] | 62 | |
---|
[2817] | 63 | NB : replace 'readonlypw' with the password you chose |
---|
| 64 | for user 'pykotauser' when you modified pykota-postgresql.sql |
---|
[3413] | 65 | |
---|
[2817] | 66 | - In ~pykota/pykotadmin.conf ensure that the following lines |
---|
| 67 | are present and unique inside the [global] section : |
---|
[3413] | 68 | |
---|
[2817] | 69 | storageadmin : pykotaadmin |
---|
| 70 | storageadminpw : readwritepw |
---|
[3413] | 71 | |
---|
[2817] | 72 | NB : replace 'readwritepw' with the password you chose |
---|
| 73 | for user 'pykotaadmin' when you modified pykota-postgresql.sql |
---|
[3413] | 74 | |
---|
| 75 | - IMPORTANT : if your database is not located on the print server, |
---|
| 76 | replace 'localhost' in the lines above with your database server's |
---|
[2817] | 77 | hostname or IP address. If your database server doesn't listen on |
---|
| 78 | its standard port, add the port number at the end of the hostname |
---|
| 79 | with a colon to separate the hostname from the port. |
---|
| 80 | See pykota/conf/pykota.conf.sample for examples. |
---|
[3413] | 81 | |
---|
[1015] | 82 | ============================================================ |
---|
| 83 | |
---|
| 84 | Upgrade scripts : |
---|
| 85 | |
---|
[1200] | 86 | DON'T DO ANYTHING IF THIS IS YOUR FIRST INSTALLATION |
---|
| 87 | OF PYKOTA. |
---|
| 88 | |
---|
[1015] | 89 | Some scripts to upgrade old PyKota databases to the new |
---|
| 90 | database schema are included. You may have to run all |
---|
[3413] | 91 | of them or only some of them, depending on your |
---|
[2452] | 92 | version of PyKota. Usually running them several times, for |
---|
| 93 | example if you used several different development versions |
---|
| 94 | of PyKota, won't do any harm. |
---|
[3413] | 95 | |
---|
[2564] | 96 | If you're connected as user 'root', you have to be user 'postgres' |
---|
| 97 | instead : |
---|
[3413] | 98 | |
---|
[2817] | 99 | # su - postgres |
---|
[3413] | 100 | |
---|
[2564] | 101 | You're now user 'postgres', then continue the upgrade by following |
---|
| 102 | the instructions below, depending on the version you actually use : |
---|
[3413] | 103 | |
---|
[2452] | 104 | * An SQL script to upgrade a 1.22 PyKota Storage DataBase to |
---|
| 105 | 1.23 is included. Launch it this way on the Quota Storage Server : |
---|
[3413] | 106 | |
---|
[2452] | 107 | $ psql -U postgres pykota |
---|
| 108 | pykota=# \i upgrade-to-1.23.sql |
---|
| 109 | pykota=# \q |
---|
| 110 | $ |
---|
[3413] | 111 | |
---|
[2452] | 112 | This script adds many fields to existing tables, and a table to |
---|
| 113 | manage billing codes. |
---|
[3413] | 114 | |
---|
[2054] | 115 | * An SQL script to upgrade a 1.20 PyKota Storage DataBase to |
---|
| 116 | 1.21 is included. Launch it this way on the Quota Storage Server : |
---|
[3413] | 117 | |
---|
[2054] | 118 | $ psql -U postgres pykota |
---|
| 119 | pykota=# \i upgrade-to-1.21.sql |
---|
| 120 | pykota=# \q |
---|
| 121 | $ |
---|
[3413] | 122 | |
---|
[2054] | 123 | This script adds many fields to existing tables, and also adds |
---|
| 124 | some tables in indexes. |
---|
[3413] | 125 | |
---|
[1473] | 126 | * An SQL script to upgrade a 1.18 PyKota Storage DataBase to |
---|
| 127 | 1.19 is included. Launch it this way on the Quota Storage Server : |
---|
[3413] | 128 | |
---|
[1473] | 129 | $ psql -U postgres pykota |
---|
| 130 | pykota=# \i upgrade-to-1.19.sql |
---|
| 131 | pykota=# \q |
---|
| 132 | $ |
---|
[3413] | 133 | |
---|
[1473] | 134 | This script adds a field to the print job history. The field that |
---|
| 135 | is added is : hostname |
---|
[3413] | 136 | |
---|
[1200] | 137 | * An SQL script to upgrade a pre-1.16 PyKota Storage DataBase to |
---|
| 138 | 1.16 is included. Launch it this way on the Quota Storage Server : |
---|
[3413] | 139 | |
---|
[1200] | 140 | $ psql -U postgres pykota |
---|
| 141 | pykota=# \i upgrade-to-1.16.sql |
---|
| 142 | pykota=# \q |
---|
| 143 | $ |
---|
[3413] | 144 | |
---|
[1200] | 145 | This script adds some fields to the print job history, so that |
---|
| 146 | more complete information will be known. The fields that |
---|
[3413] | 147 | are added are : jobprice, filename, title, copies and print |
---|
[1203] | 148 | command options. Also some indexes are created to speed things up. |
---|
[3413] | 149 | |
---|
| 150 | What is below is for historical reasons only, real people don't use |
---|
[1200] | 151 | such old beasts, and YOU SHOULDN'T EITHER ! |
---|
| 152 | |
---|
[1079] | 153 | * An SQL script to upgrade a pre-1.14 PyKota Storage DataBase to |
---|
| 154 | 1.14 is included. Launch it this way on the Quota Storage Server : |
---|
[3413] | 155 | |
---|
[1079] | 156 | $ psql -U postgres pykota |
---|
| 157 | pykota=# \i upgrade-to-1.14.sql |
---|
| 158 | pykota=# \q |
---|
| 159 | $ |
---|
[3413] | 160 | |
---|
| 161 | This script adds an "email" field for each user. This field, if not |
---|
[1079] | 162 | NULL, is used as the email address of the user when sending warning |
---|
| 163 | messages in case he is over quota. |
---|
[3413] | 164 | |
---|
| 165 | * An sql script to upgrade a pre-1.01 PyKota Quota Storage DataBase to |
---|
| 166 | 1.01 is still included for historical reasons. PLEASE DON'T USE IT ! |
---|
| 167 | |
---|
| 168 | * If you are already running an old version of PyKota (<1.03) and |
---|
| 169 | want to upgrade to 1.03, YOU HAVE TO RUN the |
---|
| 170 | upgrade-from-before-1.03.py shell script. NOT LAUNCHING THIS SCRIPT |
---|
| 171 | WILL CAUSE PYKOTA TO STOP WORKING ! PLEASE NEVER RUN THIS SCRIPT IF |
---|
| 172 | YOUR EXISTING VERSION OF PYKOTA IS ALREADY 1.03 OR HIGHER. |
---|