PVD Update Manager v1.0
The program is used for renewing of directories/files and structure of MySQL on the server of the client. Configuration of server and client and delivery of information for renewing is made by XML.
Server side.
Files:
0644 .htaccess - for users authorization
<DIR> 0644 .htaction - server modules
0644 401.pl
0644 user_get_file.pl
0644 user_get_xml.pl
<DIR> 0644 .htsql - repository of SQL schemas
0755 update_server.pl - server script
0644 update_server.xml - server config
Configuration file.
<conf>
Admin info.
<!-- common path to files -->
<repository>/path/to/files/repository</repository>
<!-- admin access -->
<admin>
<login>admin</login>
<passw>admin</passw>
<mysql>
<!-- file of MySQL schema -->
<scheme>./.htsql/scheme.xml</scheme>
<!-- OR info for db access -->
<login></login>
<passw></passw>
<base>ns</base>
</mysql>
</admin>
<!-- not accessible files -->
<protect>^.ht</protect>
<protect>^index.cfg$</protect>
<!-- clients info -->
<client>
<!-- URL to client script (info only) -->
<url>http://clienturl/cgi-bin/client/update_client.pl</url>
<!-- client login (mandatory) -->
<login>client1</login>
<!-- client password (mandatory) -->
<passw>client1</passw>
<!-- access expiry (info only) -->
<expire></expire>
<!-- access to MySQL scheme or database
(getting from conf->admin if not defined) -->
<mysql>
<!-- file of MySQL schema -->
<scheme>./.htsql/scheme.xml</scheme>
<!-- OR info for db access -->
<login></login>
<passw></passw>
<base>ns</base>
</mysql>
</client>
<client>
...
</client>
...
</conf>
Client side.
Files:
<DIR> 0777 logs - folder for logs files
0755 update_client.pl
0644 update_client.xml
Configuration file.
<conf>
<repository>/path/for/compare/and/update</repository>
<url>http://updater/cgi-bin/server/update_server.pl</url>
<login>client1</login>
<passw>client1</passw>
<mysql>
<login></login>
<passw></passw>
<base>client</base>
</mysql>
<logs>./logs</logs>
</conf>
Work scheme.
Script of the client addresses server (script) URL of renewing. It gets XML plan list of files/directories and base scheme. It checks directories, compares files on their size and in case they are of different size, it downloads from the server; if there is no any - also downloads; the same way makes directories and defines resolutions if it differs.
Then checking of MySQL base is carried our, if there is access to it; otherwise it lets it so and completes. In case there is access to base, it connects, get the base and compare with the received server scheme. Then all necessary tables are made; if there are tables already, it checks information in the fields, add necessary ones and renew not similar.
Then comparison of table's keys takes place the same way; checking/adding/deleting/changing depends on difference.
Client's settings.
On server for each client there could be specified:
path to files for comparison
access to base or path to base scheme for comparison
login and password for server access for renewing All these parameters has also parameters by default for all, if you do not specify them for any client, common parameters are used.
|