client

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Owner        string
	GlobalConfig Config
)

Functions

func CheckCertificate

func CheckCertificate(logger log.Logger, GlobalConfigPath string, acmeClient *restclient.Client)

func CleanupCertificateFiles

func CleanupCertificateFiles(logger log.Logger, interval time.Duration, GlobalConfigPath string, acmeClient *restclient.Client)

CleanupCertificateFiles periodically checks and deletes local certificate files not found on the server It also considers certificates in the local config file to avoid deleting keys for pending certificates

func PullAndCheckCertificateFromRing

func PullAndCheckCertificateFromRing(logger log.Logger, GlobalConfigPath string, acmeClient *restclient.Client)

func WatchCertificateChange

func WatchCertificateChange(logger log.Logger, interval time.Duration, configPath string, acmeClient *restclient.Client)

func WatchCertificateEventChange

func WatchCertificateEventChange(logger log.Logger, configPath string, acmeClient *restclient.Client)

func WatchCertificateFromRing

func WatchCertificateFromRing(logger log.Logger, interval time.Duration, configPath string, acmeClient *restclient.Client)

Types

type CertBackup

type CertBackup struct {
	Cert     string `json:"cert" example:"-----BEGIN CERTIFICATE-----\n..."`
	Key      string `json:"key" example:"-----BEGIN PRIVATE KEY-----\n..."`
	CAIssuer string `json:"ca_issuer,omitempty" example:"-----BEGIN CERTIFICATE-----\n..."`
}

func MapInterfaceToCertBackup

func MapInterfaceToCertBackup(data map[string]interface{}) CertBackup

type CertConfig

type CertConfig struct {
	Domain        string `yaml:"domain"`
	Issuer        string `yaml:"issuer"`
	Bundle        bool   `yaml:"bundle,omitempty"`
	San           string `yaml:"san,omitempty"`
	Days          int32  `yaml:"days,omitempty"`
	RenewalDays   string `yaml:"renewal_days,omitempty"`
	DNSChallenge  string `yaml:"dns_challenge,omitempty"`
	HTTPChallenge string `yaml:"http_challenge,omitempty"`
	KeyType       string `yaml:"key_type,omitempty"`
	Labels        string `yaml:"labels,omitempty"`
	Profile       string `yaml:"profile,omitempty"`
}

func (CertConfig) ToModelsCertificate

func (cc CertConfig) ToModelsCertificate() models.Certificate

Convert to models.Certificate

type CertificateCollector

type CertificateCollector struct{}

func NewCertificateCollector

func NewCertificateCollector() *CertificateCollector

func (*CertificateCollector) Collect

func (c *CertificateCollector) Collect(ch chan<- prometheus.Metric)

func (*CertificateCollector) Describe

func (c *CertificateCollector) Describe(_ chan<- *prometheus.Desc)

type Common

type Common struct {
	CertDays          int         `yaml:"cert_days"`
	CertDaysRenewal   string      `yaml:"cert_days_renewal"`
	CertBackup        bool        `yaml:"certificate_backup"`
	CertDeploy        bool        `yaml:"certificate_deploy"`
	CertDir           string      `yaml:"certificate_dir"`
	CertDirPerm       fs.FileMode `yaml:"certificate_dir_perm"`
	CertFilePerm      fs.FileMode `yaml:"certificate_file_perm"`
	CertKeyFilePerm   fs.FileMode `yaml:"certificate_keyfile_perm"`
	CertFileExt       string      `yaml:"certificate_file_ext"`
	CertKeyFileExt    string      `yaml:"certificate_keyfile_ext"`
	CertCAFileExt     string      `yaml:"certificate_ca_file_ext"`
	CertKeyFileNoGen  bool        `yaml:"certificate_keyfile_no_generate"`
	CertTimeout       int         `yaml:"certificate_timeout"`
	CmdEnabled        bool        `yaml:"cmd_enabled"`
	PreCmdRun         string      `yaml:"pre_cmd_run"`
	PreCmdTimeout     int         `yaml:"pre_cmd_timeout"`
	PostCmdRun        string      `yaml:"post_cmd_run"`
	PostCmdTimeout    int         `yaml:"post_cmd_timeout"`
	RevokeOnUpdate    bool        `yaml:"revoke_on_update"`
	RevokeOnDelete    bool        `yaml:"revoke_on_delete"`
	DelayBeforeDelete string      `yaml:"delay_before_delete"`
}

Common represents common config.

type Config

type Config struct {
	Common      Common       `yaml:"common"`
	Certificate []CertConfig `yaml:"certificate"`
	Storage     cfg.Storage  `yaml:"storage"`
}

Config represents certificate config.

func (*Config) UnmarshalYAML

func (s *Config) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

func (*Config) ValidateConfigPath added in v0.6.8

func (s *Config) ValidateConfigPath(configPath string) error

ValidateConfigPath checks that the certificate directory is not the same as the config file directory.

type MapDiff

type MapDiff struct {
	Create []models.Certificate `json:"create"`
	Update []models.Certificate `json:"update"`
	Delete []models.Certificate `json:"delete"`
}

Jump to

Keyboard shortcuts

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