Skip to content

Commit

Permalink
Fix Nextcloud .htaccess workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
the-djmaze committed Jan 3, 2023
1 parent 8fdd040 commit 1f9b3ec
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
7 changes: 5 additions & 2 deletions build/nextcloud.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
if (is_file($file)) {
$name = str_replace('\\', '/', $file);
$name = str_replace('integrations/nextcloud/snappymail/', '', $name);
$name = str_replace('.htaccess', '_htaccess', $name);
$hashes[$name] = hash_file('sha512', $file);
}
}
Expand All @@ -35,6 +34,11 @@
$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');
$nc_tar->addFromString('data/VERSION', $package->version);
Expand Down Expand Up @@ -62,7 +66,6 @@

spl_autoload_register(function($name){
$file = __DIR__ . '/' . str_replace('\\', '/', $name) . '.php';
echo "{$file}\n";
require $file;
});

Expand Down
17 changes: 10 additions & 7 deletions build/owncloud.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
if (is_file($file)) {
$name = str_replace('\\', '/', $file);
$name = str_replace('integrations/owncloud/snappymail/', '', $name);
$name = str_replace('.htaccess', '_htaccess', $name);
$hashes[$name] = hash_file('sha512', $file);
}
}
Expand All @@ -35,6 +34,11 @@
$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');
$nc_tar->addFromString('data/VERSION', $package->version);
Expand All @@ -60,13 +64,12 @@
$nc_tar->addFromString('snappymail/app/serviceworker.js', $data);
$hashes['app/serviceworker.js'] = hash('sha512', $data);

spl_autoload_register(function($name){
$file = __DIR__ . '/' . str_replace('\\', '/', $name) . '.php';
echo "{$file}\n";
require $file;
});

if ($cert_dir) {
spl_autoload_register(function($name){
$file = __DIR__ . '/' . str_replace('\\', '/', $name) . '.php';
require $file;
});

ksort($hashes);
$cert = file_get_contents($cert_dir.'/snappymail.crt');
$rsa = new \phpseclib\Crypt\RSA();
Expand Down

0 comments on commit 1f9b3ec

Please sign in to comment.