Not signed in (Sign In)
 
Mar 24th 2008
 
As there are a few discussions popping up with errors occuring generally because one or more files have not uploaded successfully before installation (but these files are not used as part of the installation so it works OK) I wondered about how much work it would be to do a file check as part of the installation? Clearly actually checking the files existed and were readable would not be too difficult, but what about doing a CRC (or other) check on each of the files to make sure they were correct? I'm not too sure about the implications of this and how much work/server resource it would take? Any comments?
 
Mar 26th 2008
 
When building the Vanilla, you would have to create the signature of each files. And then before the installation start, the installer would have to check the signature with md5_file() (we would have to emulate it for people with php 4.1).

Ant can create these signatures... but it will create a file with the signature for each file in the package.
http://ant.apache.org/manual/CoreTasks/checksum.html

All these files could also get corrupted when uploaded. It would be easier to create a php script that would create these signature and save them in one file.
 
Jun 5th 2008
 
I wrote some classes for that: DirectoryScanner and IntegrityChecker. I tested it on windows and php5.2 but it should work with php 4.1+.
I wrote the php cli script to create the list of md5 signatures: tools/php/md5.php. It create a csv file, appg/md5.php:

account.php,9474a96992d28764ab13f9a631831308
ajax/blockcategory.php,c3d928892a77eab2d4d523e7b5e9a2c3
ajax/getusers.php,a6c5866046272143b471cfd1bca7040e
ajax/sortcategories.php,89b6bdcd82bda772fe429b2fe5a559e9
ajax/sortroles.php,c6dcf35902accd539bd9ff0571fcc3bb
ajax/switch.php,cb65b7ae412d0a23d26e147217866fff
ajax/switchextension.php,469f9e9200036d208b711abe7c6af3c3
ajax/updatecheck.php,96dd6a68372ce1b23694de77cd3417df
appg/.htaccess,420c8aff4188125d245fa5acc4f333c6
...


It is created with the package.

The creation of signature is almost done (need some doc, exclude some some files from the list, add some error message, etc...).

It can check the installation against the md5 list but it still need to implemented in the installation script and added to the settings page.
 
Aug 17th 2008 edited
 
Can you check the installer (Vanilla r730) I only tested it on Windows+Apache+php5.
ps: you need to build vanilla to get the md5 signatures.

Update: I tested it on Linux+Apache+php5
 
Aug 18th 2008
 
For upgrade, vanilla could compare the application version with one saved in a configuration setting the last time a integrity check has occurred. If the check fails, a message is added to the discussion page, like the message that is inviting to check if a new version of vanilla is available.
 
Aug 18th 2008 edited
 
What should happen if if something is wrong? redirect to setting page that shows which file is missing or corrupted and allow to bypass the check if vanilla has been patched?

ps: I don't think i will add that to 1.1.5.
 
Aug 18th 2008 edited
 
Here what would look like the check in index.php:

// integrity check
if ($Context->Session->User->Permission('PERMISSION_CHANGE_APPLICATION_SETTINGS')
&& (empty($Configuration['LAST_INTEGRITY_CHECK'])
|| APPLICATION_VERSION !== $Configuration['LAST_INTEGRITY_CHECK'])
){
$IntegrityChecker = $Context->ObjectFactory->NewObject($Context, "IntegrityChecker");
if ($IntegrityChecker->Check($Configuration['APPLICATION_PATH'] . 'appg/md5.csv') === false) {
$NoticeCollector->AddNotice($Context->GetDefinition('SomeFilesAreCorruptedOrMissing'));
} else {
AddConfigurationSetting($Context, 'LAST_INTEGRITY_CHECK', APPLICATION_VERSION);
}
}
 
Aug 21st 2008
 
The feature is ready, it is available as patch there and in the dropbox's vanilla-stuff folder.
 
Sep 24th 2008
 
It seems the md5 signature generated on windows only works on windows. The one generated on Ubuntu work on linux and windows.
 
Sep 24th 2008
 
No, I am not sure the signature are portable like they are, they did work on my Ubuntu virtual server, on windows but not on my host.
 
Sep 24th 2008 edited
 
Maybe line-end characters got converted when the files were uploaded? We could try stripping all CRs and LFs from the file before generating the signature.

It looks like this is a "feature" of ASCII mode FTP.
 
Sep 25th 2008
 
I didn't use ftp to transfer the files on the server. Maybe there is bug, unzip on the server does something to files of fread doesn't behave the same way on all platforms.

Issue information

  • 56
  • Dinoboff

    Dinoboff

    Bug Tracker

  • Open
  • Low
  • Feature

Vanilla 1.1.5 is a product of Lussumo. More Information: Documentation, Community Support.