1
0
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:
Adam Wathan
2016-08-10 07:03:39 -04:00
parent 2c26848702
commit a54207f7cd
2 changed files with 19 additions and 1 deletions

View File

@@ -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);
}
/**