From 1503b1942bc17411626094ab746fe1de3231c2ef Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Tue, 14 Jul 2020 16:40:47 +0300 Subject: Fixes in the "apache" source mechanism. * lib/App/Acmeman/Source/Apache.pm (examine_http_config): Provide default apache configuration only if the files.apache section was not provided by the user. Remove eventual scheme prefix from the server name. --- lib/App/Acmeman/Source/Apache.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/App/Acmeman/Source/Apache.pm b/lib/App/Acmeman/Source/Apache.pm index a9a6195..8497e00 100644 --- a/lib/App/Acmeman/Source/Apache.pm +++ b/lib/App/Acmeman/Source/Apache.pm @@ -66,7 +66,8 @@ sub examine_http_config { foreach my $sect ($app->section(-name => "macro")) { if ($sect->value =~ m{^(?ix)letsencryptssl \s+ - (.+)}) { + (.+)} + && ! $self->is_set(qw(files apache))) { $self->set(qw(files apache argument), $1); map { if ($_->name =~ m{^(?ix) @@ -93,8 +94,10 @@ sub examine_http_config { } foreach my $sect ($app->section(-name => "virtualhost")) { - my ($server_name) = (map { $self->dequote($_->value) } - $sect->directive('servername')); + my ($server_name) = (map { + (my $s = $self->dequote($_->value)) =~ s{^https?://}{}; + $s + } $sect->directive('servername')); my @server_aliases = map { quotewords('\s+', 0, $self->dequote($_->value)) } $sect->directive('serveralias'); -- cgit v1.2.1