1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 09:24:02 +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([ $process = new Process(array_merge([
config('tenancy.server.certbot_path'), config('tenancy.server.certbot_path'),
'-n', '-n',
'--nginx', '--webroot',
'--webroot-path', config('tenancy.server.nginx.webroot'),
'--agree-tos', '--agree-tos',
'-d', $domain, '-d', $domain,
'--preferred-challenges', 'http', '--preferred-challenges', 'http',

View file

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

View file

@ -45,6 +45,7 @@ return [
*/ */
], ],
'nginx' => [ 'nginx' => [
'webroot' => '/var/www/html',
'vhost' => " 'vhost' => "
server { server {
include includes/tenancy; include includes/tenancy;
@ -52,7 +53,10 @@ return [
}", }",
'extra_certbot_args' => [ 'extra_certbot_args' => [
'--must-staple', '--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 // '--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))); dump(fread($tmpfile, filesize($path)));
// todo // 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() public function setupCreateVhost()