Skip to content

Commit

Permalink
Adding RenewBeforeExpiry option (#381)
Browse files Browse the repository at this point in the history
  • Loading branch information
shibayan authored Jan 28, 2022
1 parent 574ff16 commit 405a0ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion AppService.Acmebot/Functions/SharedActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public async Task<IReadOnlyList<Certificate>> GetExpiringCertificates([ActivityT
var certificates = await _webSiteManagementClient.Certificates.ListAllAsync();

return certificates.Where(x => x.TagsFilter(IssuerName, _options.Endpoint))
.Where(x => (x.ExpirationDate.Value - currentDateTime).TotalDays <= 30)
.Where(x => (x.ExpirationDate.Value - currentDateTime).TotalDays <= _options.RenewBeforeExpiry)
.ToArray();
}

Expand Down
4 changes: 4 additions & 0 deletions AppService.Acmebot/Options/AcmebotOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace AppService.Acmebot.Options
public class AcmebotOptions
{
[Required]
[Url]
public string Endpoint { get; set; } = "https://acme-v02.api.letsencrypt.org/";

[Required]
Expand All @@ -21,6 +22,9 @@ public class AcmebotOptions

public string PreferredChain { get; set; }

[Range(0, 365)]
public int RenewBeforeExpiry { get; set; } = 30;

public ExternalAccountBindingOptions ExternalAccountBinding { get; set; }
}
}

0 comments on commit 405a0ae

Please sign in to comment.