aboutsummaryrefslogtreecommitdiff
path: root/cli/prepare.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2018-03-04 01:02:02 +0100
committerGravatar GitHub <noreply@github.com> 2018-03-04 01:02:02 +0100
commit71918dbc5a240dfa391491b27cdb482d55b8794a (patch)
tree8ef6f68f35134d93cba6495728983ae37c69e127 /cli/prepare.php
parent9dbed072b32f70db98c24e164ca6ee5487ceb97e (diff)
New Docker (#1813)
* Draft of new Docker Based on Alpine Linux. Size ~78MB. https://github.com/FreshRSS/docker-freshrss/issues/4 https://github.com/FreshRSS/FreshRSS/issues/520 https://github.com/FreshRSS/docker-freshrss https://github.com/FreshRSS/docker-freshrss-production * Docker readme * +x execution rights prepare * Docker readme links to hub.docker.com https://hub.docker.com/r/freshrss/freshrss/
Diffstat (limited to 'cli/prepare.php')
-rwxr-xr-xcli/prepare.php37
1 files changed, 37 insertions, 0 deletions
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);