From 5edee95105601c34e49bec487f4e2d85630889fb Mon Sep 17 00:00:00 2001 From: Midhun Monachan <70493664+midhunmonachan@users.noreply.github.com> Date: Tue, 21 May 2024 04:23:09 -0400 Subject: [PATCH] Hotfix/v7.4.0: Fixes caddyfile and realpath errors in provision:website (#3837) * Hotfix: Fixed file read error in website.php Moved the directory creation and ownership setting code before the file read operation to prevent the file read error. * Hotfix: Adjusted Caddyfile path and ensured its inclusion in build * Regenerate docs using php bin/docgen --- bin/build | 7 +++++-- docs/recipe/provision/website.md | 10 +++++----- recipe/provision/website.php | 11 ++++++----- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/bin/build b/bin/build index 9e159f7fc..621eb21e6 100755 --- a/bin/build +++ b/bin/build @@ -70,7 +70,9 @@ foreach ($iterator as $fileInfo) { // Add schema.json echo "Add file: /src/schema.json\n"; $phar->addFile(realpath(__DIR__ . '/../src/schema.json'), '/src/schema.json'); - +// Add Caddyfile +echo "Add file: /Caddyfile\n"; +$phar->addFile(realpath(__DIR__ . '/../recipe/provision/Caddyfile'), '/recipe/provision/Caddyfile'); // Add bin/dep file echo "Add file: /bin/dep\n"; $depContent = file_get_contents(__ROOT__ . '/bin/dep'); @@ -78,7 +80,8 @@ $depContent = str_replace("#!/usr/bin/env php\n", '', $depContent); $depContent = str_replace('__FILE__', 'str_replace("phar://", "", Phar::running())', $depContent); $depContent = preg_replace("/run\('.+?'/", "run('$version'", $depContent); $phar->addFromString('bin/dep', $depContent); -$phar->setStub(<<setStub( + << Caddyfile.new"); @@ -59,4 +61,3 @@ task('logs:caddy:syslog', function () { run('sudo journalctl -u caddy -f'); })->verbose(); -