autocert

package
v0.10.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2025 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CertFileDefault    = certBasePath + "cert.crt"
	KeyFileDefault     = certBasePath + "priv.key"
	ACMEKeyFileDefault = certBasePath + "acme.key"
)
View Source
const (
	ProviderLocal      = "local"
	ProviderCloudflare = "cloudflare"
	ProviderClouddns   = "clouddns"
	ProviderDuckdns    = "duckdns"
	ProviderOVH        = "ovh"
	ProviderPseudo     = "pseudo" // for testing
	ProviderPorkbun    = "porkbun"
)

Variables

View Source
var (
	ErrMissingDomain   = gperr.New("missing field 'domains'")
	ErrMissingEmail    = gperr.New("missing field 'email'")
	ErrMissingProvider = gperr.New("missing field 'provider'")
	ErrInvalidDomain   = gperr.New("invalid domain")
	ErrUnknownProvider = gperr.New("unknown provider")
)
View Source
var ErrGetCertFailure = errors.New("get certificate failed")

Functions

This section is empty.

Types

type AutocertConfig

type AutocertConfig struct {
	Email       string      `json:"email,omitempty"`
	Domains     []string    `json:"domains,omitempty"`
	CertPath    string      `json:"cert_path,omitempty"`
	KeyPath     string      `json:"key_path,omitempty"`
	ACMEKeyPath string      `json:"acme_key_path,omitempty"`
	Provider    string      `json:"provider,omitempty"`
	Options     ProviderOpt `json:"options,omitempty"`
}

func (*AutocertConfig) GetProvider

func (cfg *AutocertConfig) GetProvider() (*Provider, gperr.Error)

func (*AutocertConfig) Validate

func (cfg *AutocertConfig) Validate() gperr.Error

Validate implements the utils.CustomValidator interface.

type CertExpiries

type CertExpiries map[string]time.Time

type CertState

type CertState int
const (
	CertStateValid CertState = iota
	CertStateExpired
	CertStateMismatch
)

type DummyConfig

type DummyConfig struct{}

func NewDummyDefaultConfig

func NewDummyDefaultConfig() *DummyConfig

type DummyProvider

type DummyProvider struct{}

func NewDummyDNSProviderConfig

func NewDummyDNSProviderConfig(*DummyConfig) (*DummyProvider, error)

func (DummyProvider) CleanUp

func (DummyProvider) CleanUp(domain, token, keyAuth string) error

func (DummyProvider) Present

func (DummyProvider) Present(domain, token, keyAuth string) error

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

func (*Provider) GetCert

func (p *Provider) GetCert(_ *tls.ClientHelloInfo) (*tls.Certificate, error)

func (*Provider) GetCertPath

func (p *Provider) GetCertPath() string

func (*Provider) GetExpiries

func (p *Provider) GetExpiries() CertExpiries

func (*Provider) GetKeyPath

func (p *Provider) GetKeyPath() string

func (*Provider) GetName

func (p *Provider) GetName() string

func (*Provider) LoadCert

func (p *Provider) LoadCert() error

func (*Provider) ObtainCert

func (p *Provider) ObtainCert() error

func (*Provider) ScheduleRenewal

func (p *Provider) ScheduleRenewal(parent task.Parent)

func (*Provider) Setup

func (p *Provider) Setup() (err error)

func (*Provider) ShouldRenewOn

func (p *Provider) ShouldRenewOn() time.Time

ShouldRenewOn returns the time at which the certificate should be renewed.

type ProviderGenerator

type ProviderGenerator func(ProviderOpt) (challenge.Provider, gperr.Error)

type ProviderOpt

type ProviderOpt map[string]any

type User

type User struct {
	Email        string
	Registration *registration.Resource
	// contains filtered or unexported fields
}

func (*User) GetEmail

func (u *User) GetEmail() string

func (*User) GetPrivateKey

func (u *User) GetPrivateKey() crypto.PrivateKey

func (*User) GetRegistration

func (u *User) GetRegistration() *registration.Resource

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL