1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-04 14:44:05 +00:00

Use webroot instead of --nginx

This commit is contained in:
Samuel Štancl 2019-02-02 23:46:27 +01:00
parent 178eb375f6
commit 9629129772
4 changed files with 8 additions and 5 deletions

View file

@ -25,7 +25,8 @@ class NginxConfigManager implements ServerConfigManager
$process = new Process(array_merge([
config('tenancy.server.certbot_path'),
'-n',
'--nginx',
'--webroot',
'--webroot-path', config('tenancy.server.nginx.webroot'),
'--agree-tos',
'-d', $domain,
'--preferred-challenges', 'http',

View file

@ -23,6 +23,7 @@ class ServerManager
public function createVhost(string $domain)
{
// todo symlink
$this->serverConfigManager->addVhost($domain, $this->getConfigFilePath());
$this->serverConfigManager->deployCertificate($domain);
if (method_exists($this->serverConfigManager, 'postCertDeploymentChanges')) {

View file

@ -45,6 +45,7 @@ return [
*/
],
'nginx' => [
'webroot' => '/var/www/html',
'vhost' => "
server {
include includes/tenancy;
@ -52,7 +53,10 @@ return [
}",
'extra_certbot_args' => [
'--must-staple',
// '--staging', // obtains a fake cert intended for testing certbot
'--config-dir', '/etc/letsencrypt_tenancy',
'--work-dir', '/var/lib/letsencrypt_tenancy',
'--logs-dir', '/var/log/letsencrypt_tenancy',
'--staging', // obtains a fake cert intended for testing certbot
// '--email', 'your@email', // if you haven't created an account in certbot yet
],
],

View file

@ -61,9 +61,6 @@ class ServerManagerTest extends TestCase
dump(fread($tmpfile, filesize($path)));
// todo
// The following error was encountered:\n
// [Errno 13] Permission denied: '/var/log/letsencrypt/.certbot.lock'\n
// Either run as root, or set --config-dir, --work-dir, and --logs-dir to writeable paths.\n
}
public function setupCreateVhost()