Don't force Letsencrypt support on primary domain

tags/smeserver-letsencrypt-client-0.2.4-1
Daniel Berteaud 9 years ago
parent 8a58ddb102
commit 2417beb270
  1. 11
      root/etc/e-smith/templates/etc/letsencrypt.sh/domains.txt/10domains

@ -7,12 +7,17 @@ use List::MoreUtils qw(uniq);
my $d = esmith::DomainsDB->open_ro || die "Couldn't open DomainsDB\n"; my $d = esmith::DomainsDB->open_ro || die "Couldn't open DomainsDB\n";
my $h = esmith::HostsDB->open_ro || die "Couldn't open HostsDB\n"; my $h = esmith::HostsDB->open_ro || die "Couldn't open HostsDB\n";
my @names = ( "$DomainName" ); my @names = ();
foreach my $domain ($d->domains, $d->get_all_by_prop(type => 'vhost')){ foreach my $domain ($d->domains, $d->get_all_by_prop(type => 'vhost')){
next if ($domain->key eq $DomainName);
my $le = $domain->prop('Letsencrypt') || 'enabled'; my $le = $domain->prop('Letsencrypt') || 'enabled';
push @names, $domain->key unless $le ne 'enabled'; next if ($le ne 'enabled');
if ($domain->key eq $DomainName){
unshift @names, $DomainName;
}
else{
push @names, $domain->key;
}
} }
foreach my $host ($h->hosts){ foreach my $host ($h->hosts){

Loading…
Cancel
Save