mirror of
https://github.com/laravel/valet.git
synced 2026-02-07 09:10:03 +01:00
Generate new Caddyfiles for secure sites on install
Makes it easy for users to upgrade Valet if we change the Caddyfile structure.
This commit is contained in:
@@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
namespace Valet;
|
namespace Valet;
|
||||||
|
|
||||||
|
use Configuration as ConfigurationFacade;
|
||||||
|
use Site as SiteFacade;
|
||||||
|
|
||||||
class Caddy
|
class Caddy
|
||||||
{
|
{
|
||||||
var $cli;
|
var $cli;
|
||||||
@@ -61,6 +64,21 @@ function installCaddyDirectory()
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->files->touchAsUser($caddyDirectory.'/.keep');
|
$this->files->touchAsUser($caddyDirectory.'/.keep');
|
||||||
|
|
||||||
|
$this->rewriteSecureCaddyFiles();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate fresh Caddyfiles for existing secure sites.
|
||||||
|
*
|
||||||
|
* This simplifies upgrading when the Caddyfile structure changes.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function rewriteSecureCaddyFiles()
|
||||||
|
{
|
||||||
|
$domain = ConfigurationFacade::read()['domain'];
|
||||||
|
SiteFacade::resecureForNewDomain($domain, $domain);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
Container::setInstance(new Container);
|
Container::setInstance(new Container);
|
||||||
|
|
||||||
$version = '1.1.19';
|
$version = '1.1.20';
|
||||||
|
|
||||||
$app = new Application('Laravel Valet', $version);
|
$app = new Application('Laravel Valet', $version);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user