mirror of
https://github.com/laravel/valet.git
synced 2026-02-06 16:50:09 +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;
|
||||
|
||||
use Configuration as ConfigurationFacade;
|
||||
use Site as SiteFacade;
|
||||
|
||||
class Caddy
|
||||
{
|
||||
var $cli;
|
||||
@@ -61,6 +64,21 @@ function installCaddyDirectory()
|
||||
}
|
||||
|
||||
$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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user