Work on acme.sh hander

and dns providers
This commit is contained in:
Jamie Curnow
2021-08-19 22:33:01 +10:00
parent 339ee13346
commit 556f8b773b
19 changed files with 518 additions and 81 deletions

View File

@@ -41,6 +41,7 @@ func Create(certificate *Model) (int, error) {
expires_on,
status,
meta,
is_ecc,
is_deleted
) VALUES (
:created_on,
@@ -54,6 +55,7 @@ func Create(certificate *Model) (int, error) {
:expires_on,
:status,
:meta,
:is_ecc,
:is_deleted
)`, certificate)
@@ -91,6 +93,7 @@ func Update(certificate *Model) error {
expires_on = :expires_on,
status = :status,
meta = :meta,
is_ecc = :is_ecc,
is_deleted = :is_deleted
WHERE id = :id`, certificate)

View File

@@ -50,6 +50,7 @@ type Model struct {
Status string `json:"status" db:"status" filter:"status,string"`
ErrorMessage string `json:"error_message,omitempty" db:"error_message" filter:"error_message,string"`
Meta types.JSONB `json:"-" db:"meta"`
IsECC int `json:"is_ecc" db:"is_ecc" filter:"is_ecc,integer"`
IsDeleted bool `json:"is_deleted,omitempty" db:"is_deleted"`
// Expansions:
CertificateAuthority *certificateauthority.Model `json:"certificate_authority,omitempty"`
@@ -201,7 +202,8 @@ func (m *Model) Request() error {
return err
}
err = acme.RequestCert(domains, m.Type)
// TODO: fill in blank params
err = acme.RequestCert(domains, m.Type, "", "", "", nil)
if err != nil {
m.Status = StatusFailed
m.ErrorMessage = err.Error()