certs

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultLegoYAML    = "/var/lib/lego/.lego.yaml"
	DefaultEnvFile     = "/var/lib/lego/.env"
	DefaultLegoBin     = "lego"
	DefaultLegoStorage = "/var/lib/lego/storage"
	DefaultKeyType     = "EC256"
)

Lab/production layout used when Destinations → Certificates paths are blank. Matches the dns container bind-mount (dev/data/lego → /var/lib/lego).

Variables

This section is empty.

Functions

func ApplyConfigDefaults

func ApplyConfigDefaults(cfg *Config)

func ApplySettingsDefaults

func ApplySettingsDefaults(s *models.Settings)

func BuildEnv

func BuildEnv(challenges []Challenge) string

func BuildLegoYAML

func BuildLegoYAML(cfg *Config, envFile string) ([]byte, error)

func Enabled

func Enabled(db *gorm.DB) bool

func WriteFiles

func WriteFiles(cfg *Config) (yamlPath, envPath string, err error)

Types

type Account

type Account struct {
	Name                  string `json:"name"`
	Email                 string `json:"email"`
	Server                string `json:"server"`
	KeyType               string `json:"key_type"`
	AcceptsTermsOfService bool   `json:"accepts_terms_of_service"`
	EABKID                string `json:"eab_kid"`
	EABHMACKey            string `json:"eab_hmac_key"`
}

type Cert

type Cert struct {
	Name             string   `json:"name"`
	Account          string   `json:"account"`
	Challenge        string   `json:"challenge"`
	KeyType          string   `json:"key_type"`
	EnableCommonName *bool    `json:"enable_common_name"`
	Host             string   `json:"host"`
	Domains          []string `json:"domains"`
}

type Challenge

type Challenge struct {
	Name                string   `json:"name"`
	Kind                string   `json:"kind"`
	Provider            string   `json:"provider"`
	DNSTimeout          int      `json:"dns_timeout"`
	Resolvers           []string `json:"resolvers"`
	DisableAuthNS       bool     `json:"disable_authoritative_nameservers"`
	DisableRecursiveNS  bool     `json:"disable_recursive_nameservers"`
	PropagationWait     string   `json:"propagation_wait"`
	RFC2136Nameserver   string   `json:"rfc2136_nameserver"`
	RFC2136TSIGAlgo     string   `json:"rfc2136_tsig_algorithm"`
	RFC2136TSIGKey      string   `json:"rfc2136_tsig_key"`
	RFC2136TSIGSecret   string   `json:"rfc2136_tsig_secret"`
	RFC2136TSIGFile     string   `json:"rfc2136_tsig_file"`
	RFC2136TTL          int      `json:"rfc2136_ttl"`
	RFC2136PropTimeout  string   `json:"rfc2136_propagation_timeout"`
	RFC2136PollInterval string   `json:"rfc2136_polling_interval"`
	ExtraEnv            string   `json:"extra_env"`
}

type Client

type Client struct {
	Config *util.ConfigAgentRoot
	Certs  *Config
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config *util.ConfigAgentRoot) (*Client, error)

func (*Client) Sync

func (c *Client) Sync(reporter jobevent.Reporter) error

type Config

type Config struct {
	util.CommonConfig
	LegoYaml                string      `json:"lego_yaml"`
	EnvFile                 string      `json:"env_file"`
	LegoBin                 string      `json:"lego_bin"`
	LegoStorage             string      `json:"lego_storage"`
	DefaultKeyType          string      `json:"default_key_type"`
	DefaultEnableCommonName bool        `json:"default_enable_common_name"`
	Accounts                []Account   `json:"accounts"`
	Challenges              []Challenge `json:"challenges"`
	Certificates            []Cert      `json:"certificates"`
}

Config is what factum2-certs fetches from the primary and writes as .lego.yaml plus dotenv, then runs lego.

func FetchRemoteConfig

func FetchRemoteConfig(factumConfig *util.ConfigFactum) (*Config, error)

Jump to

Keyboard shortcuts

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