Files
FreshRSS/cli/prepare.php
berumuron cc6c529562 tec: Remove data/do-install.txt (#3555)
* Remove file data/do-install.txt

This file was painful during update because we had to remember to delete
it each time. It added a security issue by allowing an attacker to
reinstall FreshRSS during the update process.

The (more powerful) file data/applied_migrations.txt has been introduced
in 8619cf6fa to replace do-install.txt. We had to wait for at least one
release in order to make sure existing instances of FreshRSS created the
migration file. It should be ok now.

* Replace i18n install.not_deleted key

* Update documentation to update FreshRSS
2021-03-26 19:41:33 +01:00

43 lines
685 B
PHP
Executable File

#!/usr/bin/env php
<?php
require(__DIR__ . '/_cli.php');
$dirs = array(
'/',
'/cache',
'/extensions-data',
'/favicons',
'/fever',
'/PubSubHubbub',
'/PubSubHubbub/feeds',
'/PubSubHubbub/keys',
'/tokens',
'/users',
'/users/_',
);
$ok = true;
foreach ($dirs as $dir) {
@mkdir(DATA_PATH . $dir, 0770, true);
$ok &= touch(DATA_PATH . $dir . '/index.html');
}
file_put_contents(DATA_PATH . '/.htaccess',
"# Apache 2.2\n" .
"<IfModule !mod_authz_core.c>\n" .
" Order Allow,Deny\n" .
" Deny from all\n" .
" Satisfy all\n" .
"</IfModule>\n" .
"\n" .
"# Apache 2.4\n" .
"<IfModule mod_authz_core.c>\n" .
" Require all denied\n" .
"</IfModule>\n"
);
accessRights();
done($ok);