Nextcloud prevent serving precompressed files due to too many setups that fail

This commit is contained in:
the-djmaze 2023-02-01 10:22:46 +01:00
parent cc383f6b0e
commit d68843e4ec
2 changed files with 5 additions and 9 deletions

View file

@ -29,15 +29,11 @@ $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator('snappymai
foreach ($files as $file) {
if (is_file($file)) {
$newFile = str_replace('\\', '/', $file);
// $newFile = str_replace("'snappymail/v/'.", '', $newFile);
$nc_tar->addFile($file, "snappymail/app/{$newFile}");
$newName = str_replace('/.htaccess', '/_htaccess', $newFile);
$nc_tar->addFile($file, "snappymail/app/{$newName}");
$hashes["app/{$newFile}"] = hash_file('sha512', $file);
}
}
$nc_tar->delete("snappymail/app/snappymail/v/{$package->version}/app/.htaccess");
$nc_tar->addFile("snappymail/v/{$package->version}/app/.htaccess", "snappymail/app/snappymail/v/{$package->version}/app/_htaccess");
$nc_tar->delete("snappymail/app/snappymail/v/{$package->version}/static/.htaccess");
$nc_tar->addFile("snappymail/v/{$package->version}/static/.htaccess", "snappymail/app/snappymail/v/{$package->version}/static/_htaccess");
/*
$nc_tar->addFile('data/.htaccess');

View file

@ -35,9 +35,9 @@ class InstallStep implements IRepairStep
if (!\file_exists(APP_VERSION_ROOT_PATH . 'app/.htaccess') && \file_exists(APP_VERSION_ROOT_PATH . 'app/_htaccess')) {
\rename(APP_VERSION_ROOT_PATH . 'app/_htaccess', APP_VERSION_ROOT_PATH . 'app/.htaccess');
}
if (!\file_exists(APP_VERSION_ROOT_PATH . 'static/.htaccess') && \file_exists(APP_VERSION_ROOT_PATH . 'static/_htaccess')) {
\rename(APP_VERSION_ROOT_PATH . 'static/_htaccess', APP_VERSION_ROOT_PATH . 'static/.htaccess');
}
// if (!\file_exists(APP_VERSION_ROOT_PATH . 'static/.htaccess') && \file_exists(APP_VERSION_ROOT_PATH . 'static/_htaccess')) {
// \rename(APP_VERSION_ROOT_PATH . 'static/_htaccess', APP_VERSION_ROOT_PATH . 'static/.htaccess');
// }
$oConfig = \RainLoop\Api::Config();
$bSave = false;