Skip to content
This repository has been archived by the owner on Nov 19, 2023. It is now read-only.

Commit

Permalink
Add Lets Encrypt report
Browse files Browse the repository at this point in the history
  • Loading branch information
indygriffiths committed Jun 27, 2018
1 parent 62f22b9 commit d4c031c
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions mysite/code/Report/LetsEncryptReport.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

/**
* Report for listing domains who are using Let's Encrypt
*/
class LetsEncryptReport extends SS_Report
{
public function title()
{
return 'Domains using Let\'s Encrypt';
}

public function description()
{
return 'Lists domains that are using Let\'s Encrypt for their certificates';
}

public function sourceRecords($params = null)
{
return Domain::get()
->filter(['Certificates.Issuer:PartialMatch' => 'Let\'s Encrypt'])
->sort('Domain');
}

public function columns()
{
return [
'Domain' => 'Domain',
'CurrentCertificate.Name' => 'Certificate Name',
'CurrentCertificate.Issuer' => 'Issuer',
'CurrentCertificate.ValidFrom' => 'Valid From',
'CurrentCertificate.ValidTo' => 'Valid Until',
'ErrorCode' => 'Error Code',
'ErrorMessage' => 'Error Message',
];
}
}

0 comments on commit d4c031c

Please sign in to comment.