summaryrefslogtreecommitdiff
path: root/modules/caddytls
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2019-06-14 11:58:28 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2019-06-14 11:58:28 -0600
commit5137859e47678aae81e178ca7d164f9e2b4e3121 (patch)
treef0e5cb9b9a4ad5dc03b53127fcea2a536bd6ee27 /modules/caddytls
parentb8e7453fef3dac6036403bc384eec96becff5114 (diff)
Rename caddy2 -> caddy
Removes the version from the package name
Diffstat (limited to 'modules/caddytls')
-rw-r--r--modules/caddytls/acmemanager.go16
-rw-r--r--modules/caddytls/connpolicy.go6
-rw-r--r--modules/caddytls/fileloader.go4
-rw-r--r--modules/caddytls/folderloader.go4
-rw-r--r--modules/caddytls/matchers.go4
-rw-r--r--modules/caddytls/sessiontickets.go8
-rw-r--r--modules/caddytls/standardstek/stek.go6
-rw-r--r--modules/caddytls/tls.go10
8 files changed, 29 insertions, 29 deletions
diff --git a/modules/caddytls/acmemanager.go b/modules/caddytls/acmemanager.go
index 9cbf349..50f8648 100644
--- a/modules/caddytls/acmemanager.go
+++ b/modules/caddytls/acmemanager.go
@@ -7,13 +7,13 @@ import (
"github.com/go-acme/lego/certcrypto"
- "github.com/caddyserver/caddy2"
+ "github.com/caddyserver/caddy"
"github.com/go-acme/lego/challenge"
"github.com/mholt/certmagic"
)
func init() {
- caddy2.RegisterModule(caddy2.Module{
+ caddy.RegisterModule(caddy.Module{
Name: "tls.management.acme",
New: func() interface{} { return new(ACMEManagerMaker) },
})
@@ -30,9 +30,9 @@ func init() {
type ACMEManagerMaker struct {
CA string `json:"ca,omitempty"`
Email string `json:"email,omitempty"`
- RenewAhead caddy2.Duration `json:"renew_ahead,omitempty"`
+ RenewAhead caddy.Duration `json:"renew_ahead,omitempty"`
KeyType string `json:"key_type,omitempty"`
- ACMETimeout caddy2.Duration `json:"acme_timeout,omitempty"`
+ ACMETimeout caddy.Duration `json:"acme_timeout,omitempty"`
MustStaple bool `json:"must_staple,omitempty"`
Challenges ChallengesConfig `json:"challenges"`
OnDemand *OnDemandConfig `json:"on_demand,omitempty"`
@@ -49,7 +49,7 @@ func (m *ACMEManagerMaker) newManager(interactive bool) (certmagic.Manager, erro
}
// Provision sets up m.
-func (m *ACMEManagerMaker) Provision(ctx caddy2.Context) error {
+func (m *ACMEManagerMaker) Provision(ctx caddy.Context) error {
// DNS providers
if m.Challenges.DNS != nil {
val, err := ctx.LoadModuleInline("provider", "tls.dns", m.Challenges.DNSRaw)
@@ -66,7 +66,7 @@ func (m *ACMEManagerMaker) Provision(ctx caddy2.Context) error {
if err != nil {
return fmt.Errorf("loading TLS storage module: %s", err)
}
- cmStorage, err := val.(caddy2.StorageConverter).CertMagicStorage()
+ cmStorage, err := val.(caddy.StorageConverter).CertMagicStorage()
if err != nil {
return fmt.Errorf("creating TLS storage configuration: %v", err)
}
@@ -89,7 +89,7 @@ func (m *ACMEManagerMaker) SetDefaults() {
m.Email = certmagic.Default.Email
}
if m.RenewAhead == 0 {
- m.RenewAhead = caddy2.Duration(certmagic.Default.RenewDurationBefore)
+ m.RenewAhead = caddy.Duration(certmagic.Default.RenewDurationBefore)
}
if m.keyType == "" {
m.keyType = certmagic.Default.KeyType
@@ -102,7 +102,7 @@ func (m *ACMEManagerMaker) SetDefaults() {
// makeCertMagicConfig converts m into a certmagic.Config, because
// this is a special case where the default manager is the certmagic
// Config and not a separate manager.
-func (m *ACMEManagerMaker) makeCertMagicConfig(ctx caddy2.Context) certmagic.Config {
+func (m *ACMEManagerMaker) makeCertMagicConfig(ctx caddy.Context) certmagic.Config {
storage := m.storage
if storage == nil {
storage = ctx.Storage()
diff --git a/modules/caddytls/connpolicy.go b/modules/caddytls/connpolicy.go
index c1ca41d..54cad7c 100644
--- a/modules/caddytls/connpolicy.go
+++ b/modules/caddytls/connpolicy.go
@@ -7,7 +7,7 @@ import (
"fmt"
"strings"
- "github.com/caddyserver/caddy2"
+ "github.com/caddyserver/caddy"
"github.com/go-acme/lego/challenge/tlsalpn01"
"github.com/mholt/certmagic"
)
@@ -20,7 +20,7 @@ type ConnectionPolicies []*ConnectionPolicy
// TLSConfig converts the group of policies to a standard-lib-compatible
// TLS configuration which selects the first matching policy based on
// the ClientHello.
-func (cp ConnectionPolicies) TLSConfig(ctx caddy2.Context) (*tls.Config, error) {
+func (cp ConnectionPolicies) TLSConfig(ctx caddy.Context) (*tls.Config, error) {
// set up each of the connection policies
for i, pol := range cp {
// matchers
@@ -110,7 +110,7 @@ type ConnectionPolicy struct {
stdTLSConfig *tls.Config
}
-func (p *ConnectionPolicy) buildStandardTLSConfig(ctx caddy2.Context) error {
+func (p *ConnectionPolicy) buildStandardTLSConfig(ctx caddy.Context) error {
tlsAppIface, err := ctx.App("tls")
if err != nil {
return fmt.Errorf("getting tls app: %v", err)
diff --git a/modules/caddytls/fileloader.go b/modules/caddytls/fileloader.go
index c633f17..63592f9 100644
--- a/modules/caddytls/fileloader.go
+++ b/modules/caddytls/fileloader.go
@@ -5,11 +5,11 @@ import (
"fmt"
"io/ioutil"
- "github.com/caddyserver/caddy2"
+ "github.com/caddyserver/caddy"
)
func init() {
- caddy2.RegisterModule(caddy2.Module{
+ caddy.RegisterModule(caddy.Module{
Name: "tls.certificates.load_files",
New: func() interface{} { return fileLoader{} },
})
diff --git a/modules/caddytls/folderloader.go b/modules/caddytls/folderloader.go
index 0ce53b7..bcc22d8 100644
--- a/modules/caddytls/folderloader.go
+++ b/modules/caddytls/folderloader.go
@@ -10,11 +10,11 @@ import (
"path/filepath"
"strings"
- "github.com/caddyserver/caddy2"
+ "github.com/caddyserver/caddy"
)
func init() {
- caddy2.RegisterModule(caddy2.Module{
+ caddy.RegisterModule(caddy.Module{
Name: "tls.certificates.load_folders",
New: func() interface{} { return folderLoader{} },
})
diff --git a/modules/caddytls/matchers.go b/modules/caddytls/matchers.go
index 712472f..a0d26bb 100644
--- a/modules/caddytls/matchers.go
+++ b/modules/caddytls/matchers.go
@@ -3,14 +3,14 @@ package caddytls
import (
"crypto/tls"
- "github.com/caddyserver/caddy2"
+ "github.com/caddyserver/caddy"
)
// MatchServerName matches based on SNI.
type MatchServerName []string
func init() {
- caddy2.RegisterModule(caddy2.Module{
+ caddy.RegisterModule(caddy.Module{
Name: "tls.handshake_match.sni",
New: func() interface{} { return MatchServerName{} },
})
diff --git a/modules/caddytls/sessiontickets.go b/modules/caddytls/sessiontickets.go
index 1d7d9b1..246b396 100644
--- a/modules/caddytls/sessiontickets.go
+++ b/modules/caddytls/sessiontickets.go
@@ -9,13 +9,13 @@ import (
"sync"
"time"
- "github.com/caddyserver/caddy2"
+ "github.com/caddyserver/caddy"
)
// SessionTicketService configures and manages TLS session tickets.
type SessionTicketService struct {
KeySource json.RawMessage `json:"key_source,omitempty"`
- RotationInterval caddy2.Duration `json:"rotation_interval,omitempty"`
+ RotationInterval caddy.Duration `json:"rotation_interval,omitempty"`
MaxKeys int `json:"max_keys,omitempty"`
DisableRotation bool `json:"disable_rotation,omitempty"`
Disabled bool `json:"disabled,omitempty"`
@@ -27,13 +27,13 @@ type SessionTicketService struct {
mu *sync.Mutex
}
-func (s *SessionTicketService) provision(ctx caddy2.Context) error {
+func (s *SessionTicketService) provision(ctx caddy.Context) error {
s.configs = make(map[*tls.Config]struct{})
s.mu = new(sync.Mutex)
// establish sane defaults
if s.RotationInterval == 0 {
- s.RotationInterval = caddy2.Duration(defaultSTEKRotationInterval)
+ s.RotationInterval = caddy.Duration(defaultSTEKRotationInterval)
}
if s.MaxKeys <= 0 {
s.MaxKeys = defaultMaxSTEKs
diff --git a/modules/caddytls/standardstek/stek.go b/modules/caddytls/standardstek/stek.go
index 939d021..4ccb7f5 100644
--- a/modules/caddytls/standardstek/stek.go
+++ b/modules/caddytls/standardstek/stek.go
@@ -5,12 +5,12 @@ import (
"sync"
"time"
- "github.com/caddyserver/caddy2"
- "github.com/caddyserver/caddy2/modules/caddytls"
+ "github.com/caddyserver/caddy"
+ "github.com/caddyserver/caddy/modules/caddytls"
)
func init() {
- caddy2.RegisterModule(caddy2.Module{
+ caddy.RegisterModule(caddy.Module{
Name: "tls.stek.standard",
New: func() interface{} { return new(standardSTEKProvider) },
})
diff --git a/modules/caddytls/tls.go b/modules/caddytls/tls.go
index 22749ae..0614d24 100644
--- a/modules/caddytls/tls.go
+++ b/modules/caddytls/tls.go
@@ -6,13 +6,13 @@ import (
"fmt"
"net/http"
- "github.com/caddyserver/caddy2"
+ "github.com/caddyserver/caddy"
"github.com/go-acme/lego/challenge"
"github.com/mholt/certmagic"
)
func init() {
- caddy2.RegisterModule(caddy2.Module{
+ caddy.RegisterModule(caddy.Module{
Name: "tls",
New: func() interface{} { return new(TLS) },
})
@@ -26,11 +26,11 @@ type TLS struct {
certificateLoaders []CertificateLoader
certCache *certmagic.Cache
- ctx caddy2.Context
+ ctx caddy.Context
}
// Provision sets up the configuration for the TLS app.
-func (t *TLS) Provision(ctx caddy2.Context) error {
+func (t *TLS) Provision(ctx caddy.Context) error {
t.ctx = ctx
// set up the certificate cache
@@ -189,7 +189,7 @@ type AutomationPolicy struct {
Management managerMaker `json:"-"`
}
-func (ap AutomationPolicy) makeCertMagicConfig(ctx caddy2.Context) certmagic.Config {
+func (ap AutomationPolicy) makeCertMagicConfig(ctx caddy.Context) certmagic.Config {
// default manager (ACME) is a special case because of how CertMagic is designed
// TODO: refactor certmagic so that ACME manager is not a special case by extracting
// its config fields out of the certmagic.Config struct, or something...