Documentation
¶
Index ¶
- Constants
- Variables
- func DefaultConfigDir() string
- func RenewCertByCertbot(ctx context.Context, customCmd string, domains []string, email string, ...) error
- func RenewCertByLego(ctx context.Context, customCmd string, domains []string, email string, ...) error
- type Config
- func (c *Config) CopyFrom(m *dbschema.NgingVhostServer)
- func (c *Config) FixEngineConfigFile(deleteMode ...bool) (bool, error)
- func (c *Config) GetCertPathFormat(ctx echo.Context) engine.CertPathFormat
- func (c *Config) GetVhostConfigDirAbs() (string, error)
- func (c *Config) GetVhostConfigLocalDirAbs() (string, error)
- func (c *Config) Init() error
- func (c *Config) OnVhostConfigSaving(id uint, formData *form.Values) error
- func (c *Config) Quit(ctx context.Context) error
- func (c *Config) Reload(ctx context.Context) error
- func (c *Config) RemoveCertFile(id uint) error
- func (c *Config) RemoveVhostConfig(id uint) error
- func (c *Config) RenewCert(ctx echo.Context, id uint, domains []string, email string, isObtain bool) error
- func (c *Config) Reopen(ctx context.Context) error
- func (c *Config) Start(ctx context.Context) error
- func (c *Config) Stop(ctx context.Context) error
- func (c *Config) TestConfig(ctx context.Context) error
Constants ¶
View Source
const Name = `nginx`
Variables ¶
View Source
var CertbotCertDirs = map[string]string{
`cert`: `/etc/letsencrypt/live/{domain}/fullchain.pem`,
`key`: `/etc/letsencrypt/live/{domain}/privkey.pem`,
`trust`: `/etc/letsencrypt/live/{domain}/chain.pem`,
}
View Source
var LegoCertDirs = map[string]string{
`cert`: `{workDir}/.lego/certificates/{domain}.crt`,
`key`: `{workDir}/.lego/certificates/{domain}.key`,
`trust`: ``,
}
Functions ¶
func DefaultConfigDir ¶ added in v1.4.7
func DefaultConfigDir() string
func RenewCertByCertbot ¶ added in v1.4.10
func RenewCertByCertbot(ctx context.Context, customCmd string, domains []string, email string, certDir string, isObtain bool) error
http://coscms.com/.well-known/acme-challenge/Ito***l4-Fh7O5FpaAA*************LI3vTPo 申请: certbot certonly --webroot -d example.com --email info@example.com -w /var/www/_letsencrypt -n --agree-tos --force-renewal 更新 certbot renew 更新所有 certbot renew --cert-name example.com --force-renewal
func RenewCertByLego ¶ added in v1.4.10
func RenewCertByLego(ctx context.Context, customCmd string, domains []string, email string, certDir string, isObtain bool) error
申请: lego --accept-tos --email you@example.com --http --http.webroot /path/to/webroot --domains example.com run https://go-acme.github.io/lego/usage/cli/obtain-a-certificate/ 更新: lego --email="you@example.com" --domains="example.com" --http renew https://go-acme.github.io/lego/usage/cli/renew-a-certificate/
Types ¶
type Config ¶
type Config struct {
Version string
CertPathFormat engine.CertPathFormat
*engine.CommonConfig
}
func (*Config) CopyFrom ¶ added in v1.4.7
func (c *Config) CopyFrom(m *dbschema.NgingVhostServer)
func (*Config) FixEngineConfigFile ¶ added in v1.4.7
func (*Config) GetCertPathFormat ¶ added in v1.4.7
func (c *Config) GetCertPathFormat(ctx echo.Context) engine.CertPathFormat
func (*Config) GetVhostConfigDirAbs ¶ added in v1.4.7
func (*Config) GetVhostConfigLocalDirAbs ¶ added in v1.4.7
func (*Config) OnVhostConfigSaving ¶ added in v1.4.7
func (*Config) RemoveCertFile ¶ added in v1.4.7
func (*Config) RemoveVhostConfig ¶ added in v1.4.7
Click to show internal directories.
Click to hide internal directories.