diff --git a/bin/build b/bin/build index 928afa5ec..9aed8cfc8 100755 --- a/bin/build +++ b/bin/build @@ -56,7 +56,7 @@ $iterator = new CallbackFilterIterator($iterator, function (SplFileInfo $fileInf foreach ($iterator as $fileInfo) { $file = str_replace(__ROOT__, '', $fileInfo->getRealPath()); - echo "Add file: " . $file . "\n"; + echo "+ " . $file . "\n"; $phar->addFile($fileInfo->getRealPath(), $file); if (!array_key_exists('nozip', $opt)) { @@ -69,15 +69,19 @@ foreach ($iterator as $fileInfo) { } // Add schema.json -echo "Add file: /src/schema.json\n"; +echo "+ /src/schema.json\n"; $phar->addFile(realpath(__DIR__ . '/../src/schema.json'), '/src/schema.json'); // Add Caddyfile -echo "Add file: /recipe/provision/Caddyfile\n"; +echo "+ /recipe/provision/Caddyfile\n"; $phar->addFile(realpath(__DIR__ . '/../recipe/provision/Caddyfile'), '/recipe/provision/Caddyfile'); +// Add 404.html +echo "+ /recipe/provision/404.html\n"; +$phar->addFile(realpath(__DIR__ . '/../recipe/provision/404.html'), '/recipe/provision/404.html'); + // Add bin/dep file -echo "Add file: /bin/dep\n"; +echo "+ /bin/dep\n"; $depContent = file_get_contents(__ROOT__ . '/bin/dep'); $depContent = str_replace("#!/usr/bin/env php\n", '', $depContent); $depContent = str_replace('__FILE__', 'str_replace("phar://", "", Phar::running())', $depContent); diff --git a/recipe/provision/404.html b/recipe/provision/404.html new file mode 100644 index 000000000..58665778d --- /dev/null +++ b/recipe/provision/404.html @@ -0,0 +1,51 @@ + + + + + + 404 Not Found + + + +
+ + + +

Not Found

+

The requested URL was not found on this server.

+
+ + diff --git a/recipe/provision/website.php b/recipe/provision/website.php index 2596550d6..9da3f8cc3 100644 --- a/recipe/provision/website.php +++ b/recipe/provision/website.php @@ -15,62 +15,8 @@ desc('Configures a server'); task('provision:server', function () { run('usermod -a -G www-data caddy'); - $html = <<<'HTML' - - - - - - 404 Not Found - - - -
- - Deployer - - - - - - - -

Not Found

-

The requested URL was not found on this server.

-
- - - HTML; run("mkdir -p /var/deployer"); - run("echo $'$html' > /var/deployer/404.html"); + upload(__DIR__ . '/404.html', '/var/deployer/404.html'); })->oncePerNode(); desc('Provision website');