mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-08 11:58:49 +03:00
Replace auto-HTTPS info message and move a method to proper file
This commit is contained in:
parent
d2be213e10
commit
2e84fe4504
3 changed files with 13 additions and 5 deletions
|
@ -1,6 +1,7 @@
|
||||||
package httpserver
|
package httpserver
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
@ -9,6 +10,10 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func activateHTTPS(cctx caddy.Context) error {
|
func activateHTTPS(cctx caddy.Context) error {
|
||||||
|
if !caddy.Quiet {
|
||||||
|
fmt.Print("Activating privacy features...")
|
||||||
|
}
|
||||||
|
|
||||||
ctx := cctx.(*httpContext)
|
ctx := cctx.(*httpContext)
|
||||||
|
|
||||||
// pre-screen each config and earmark the ones that qualify for managed TLS
|
// pre-screen each config and earmark the ones that qualify for managed TLS
|
||||||
|
@ -39,6 +44,9 @@ func activateHTTPS(cctx caddy.Context) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !caddy.Quiet {
|
||||||
|
fmt.Println(" done.")
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -225,11 +225,6 @@ func groupSiteConfigsByListenAddr(configs []*SiteConfig) (map[string][]*SiteConf
|
||||||
return groups, nil
|
return groups, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddMiddleware adds a middleware to a site's middleware stack.
|
|
||||||
func (sc *SiteConfig) AddMiddleware(m Middleware) {
|
|
||||||
sc.middleware = append(sc.middleware, m)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Address represents a site address. It contains
|
// Address represents a site address. It contains
|
||||||
// the original input value, and the component
|
// the original input value, and the component
|
||||||
// parts of an address. The component parts may be
|
// parts of an address. The component parts may be
|
||||||
|
|
|
@ -32,6 +32,11 @@ type SiteConfig struct {
|
||||||
HiddenFiles []string
|
HiddenFiles []string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AddMiddleware adds a middleware to a site's middleware stack.
|
||||||
|
func (s *SiteConfig) AddMiddleware(m Middleware) {
|
||||||
|
s.middleware = append(s.middleware, m)
|
||||||
|
}
|
||||||
|
|
||||||
// TLSConfig returns s.TLS.
|
// TLSConfig returns s.TLS.
|
||||||
func (s SiteConfig) TLSConfig() *caddytls.Config {
|
func (s SiteConfig) TLSConfig() *caddytls.Config {
|
||||||
return s.TLS
|
return s.TLS
|
||||||
|
|
Loading…
Reference in a new issue