diff options
Diffstat (limited to 'cli')
| -rw-r--r-- | cli/README.md | 3 | ||||
| -rwxr-xr-x | cli/prepare.php | 37 |
2 files changed, 40 insertions, 0 deletions
diff --git a/cli/README.md b/cli/README.md index a496aab58..d531b8c3d 100644 --- a/cli/README.md +++ b/cli/README.md @@ -32,6 +32,9 @@ Options in parenthesis are optional. ```sh cd /usr/share/FreshRSS +./cli/prepare.php +# Ensure the needed directories in ./data/ + ./cli/do-install.php --default_user admin ( --auth_type form --environment production --base_url https://rss.example.net/ --language en --title FreshRSS --allow_anonymous --api_enabled --db-type mysql --db-host localhost:3306 --db-user freshrss --db-password dbPassword123 --db-base freshrss --db-prefix freshrss ) # --auth_type can be: 'form' (default), 'http_auth' (using the Web server access control), 'none' (dangerous) # --db-type can be: 'sqlite' (default), 'mysql' (MySQL or MariaDB), 'pgsql' (PostgreSQL) diff --git a/cli/prepare.php b/cli/prepare.php new file mode 100755 index 000000000..2db2da555 --- /dev/null +++ b/cli/prepare.php @@ -0,0 +1,37 @@ +#!/usr/bin/php +<?php +require(__DIR__ . '/_cli.php'); + +$dirs = array( + '/', + '/cache', + '/extensions-data', + '/favicons', + '/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'); +} + +if (!is_file(DATA_PATH . '/config.php')) { + $ok &= touch(DATA_PATH . '/do-install.txt'); +} + +file_put_contents(DATA_PATH . '/.htaccess', +"Order Allow,Deny\n" . +"Deny from all\n" . +"Satisfy all\n" +); + +accessRights(); + +done($ok); |
