acme

package
v0.0.0-...-28ab817 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CHALLENGE_TYPE_TLS  = "challenge-tls"
	CHALLENGE_TYPE_HTTP = "challenge-http"
	CHALLENGE_TYPE_DNS  = "challenge-dns"
)

Variables

This section is empty.

Functions

func Renew

func Renew(domains []string, challengeType string) error

func Run

func Run(domainName string, challengeType string) error

func RunPlugins

func RunPlugins(ctx context.Context) error

func SetupChallenges

func SetupChallenges(client *lego.Client, challengeType string) error

Types

type Account

type Account struct {
	Email        string                 `json:"email"`
	Registration *registration.Resource `json:"registration"`
	// contains filtered or unexported fields
}

Account represents a users local saved credentials.

func (*Account) GetEmail

func (a *Account) GetEmail() string

GetEmail returns the email address for the account.

func (*Account) GetPrivateKey

func (a *Account) GetPrivateKey() crypto.PrivateKey

GetPrivateKey returns the private RSA account key.

func (*Account) GetRegistration

func (a *Account) GetRegistration() *registration.Resource

GetRegistration returns the server registration.

type AccountsStorage

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

AccountsStorage A storage for account data.

rootPath:

./.lego/accounts/
     │      └── root accounts directory
     └── "path" option

rootUserPath:

./.lego/accounts/localhost_14000/example@chargeover.com/
     │      │             │             └── userID ("email" option)
     │      │             └── CA server ("server" option)
     │      └── root accounts directory
     └── "path" option

keysPath:

./.lego/accounts/localhost_14000/example@chargeover.com/keys/
     │      │             │             │           └── root keys directory
     │      │             │             └── userID ("email" option)
     │      │             └── CA server ("server" option)
     │      └── root accounts directory
     └── "path" option

accountFilePath:

./.lego/accounts/localhost_14000/example@chargeover.com/account.json
     │      │             │             │             └── account file
     │      │             │             └── userID ("email" option)
     │      │             └── CA server ("server" option)
     │      └── root accounts directory
     └── "path" option

func NewAccountsStorage

func NewAccountsStorage() (*AccountsStorage, error)

NewAccountsStorage Creates a new AccountsStorage.

func (*AccountsStorage) ExistsAccountFilePath

func (s *AccountsStorage) ExistsAccountFilePath() (bool, error)

func (*AccountsStorage) GetPrivateKey

func (s *AccountsStorage) GetPrivateKey(keyType certcrypto.KeyType) (crypto.PrivateKey, error)

func (*AccountsStorage) GetRootPath

func (s *AccountsStorage) GetRootPath() string

func (*AccountsStorage) GetRootUserPath

func (s *AccountsStorage) GetRootUserPath() string

func (*AccountsStorage) GetUserID

func (s *AccountsStorage) GetUserID() string

func (*AccountsStorage) LoadAccount

func (s *AccountsStorage) LoadAccount(privateKey crypto.PrivateKey) *Account

func (*AccountsStorage) Save

func (s *AccountsStorage) Save(account *Account) error

type CertificatesStorage

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

CertificatesStorage a certificates storage.

rootPath:

./.lego/certificates/
     │      └── root certificates directory
     └── "path" option

archivePath:

./.lego/archives/
     │      └── archived certificates directory
     └── "path" option

func NewCertificatesStorage

func NewCertificatesStorage() *CertificatesStorage

NewCertificatesStorage create a new certificates storage.

func (*CertificatesStorage) CheckCrtList

func (s *CertificatesStorage) CheckCrtList(certFileName string, crtList *os.File) (int, error)

CheckCrtList will check to see if the cert list file contains our given file or not. It will return an (int greater than 0 if found) or (0 on an error or if it wasn't found)

func (*CertificatesStorage) CreateArchiveFolder

func (s *CertificatesStorage) CreateArchiveFolder()

func (*CertificatesStorage) CreateRootFolder

func (s *CertificatesStorage) CreateRootFolder() error

func (*CertificatesStorage) ExistsFile

func (s *CertificatesStorage) ExistsFile(domain, extension string) bool

func (*CertificatesStorage) GetCrtListPath

func (s *CertificatesStorage) GetCrtListPath() string

func (*CertificatesStorage) GetFileName

func (s *CertificatesStorage) GetFileName(domain, extension string) string

func (*CertificatesStorage) GetRootPath

func (s *CertificatesStorage) GetRootPath() string

func (*CertificatesStorage) MoveToArchive

func (s *CertificatesStorage) MoveToArchive(domain string) error

func (*CertificatesStorage) ReadCertificate

func (s *CertificatesStorage) ReadCertificate(domain, extension string) ([]*x509.Certificate, error)

func (*CertificatesStorage) ReadFile

func (s *CertificatesStorage) ReadFile(domain, extension string) ([]byte, error)

func (*CertificatesStorage) ReadResource

func (s *CertificatesStorage) ReadResource(domain string) certificate.Resource

func (*CertificatesStorage) SaveResource

func (s *CertificatesStorage) SaveResource(certRes *certificate.Resource) error

func (*CertificatesStorage) WriteCertificateFiles

func (s *CertificatesStorage) WriteCertificateFiles(domain string, certRes *certificate.Resource) error

func (*CertificatesStorage) WriteCrtList

func (s *CertificatesStorage) WriteCrtList(domain string) error

WriteCrtList will write a newly issued cert to the crt-list.txt file to be used by reverse proxies such as HAProxy Note this will also check to see if the file already exists, if it does, it won't write anything to prevent duplication

func (*CertificatesStorage) WriteFile

func (s *CertificatesStorage) WriteFile(domain, extension string, data []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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