From ba29f9d41d7951bde07dc2e0d6a1471c40bb7145 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Thu, 19 Sep 2019 12:42:36 -0600 Subject: httpcaddyfile: Global storage configuration (closes #2758) --- storage.go | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'storage.go') diff --git a/storage.go b/storage.go index f695a49..b325b7b 100644 --- a/storage.go +++ b/storage.go @@ -22,10 +22,6 @@ import ( "github.com/mholt/certmagic" ) -func init() { - RegisterModule(fileStorage{}) -} - // StorageConverter is a type that can convert itself // to a valid, usable certmagic.Storage value. (The // value might be short-lived.) This interface allows @@ -35,23 +31,6 @@ type StorageConverter interface { CertMagicStorage() (certmagic.Storage, error) } -// fileStorage is a certmagic.Storage wrapper for certmagic.FileStorage. -type fileStorage struct { - Root string `json:"root"` -} - -// CaddyModule returns the Caddy module information. -func (fileStorage) CaddyModule() ModuleInfo { - return ModuleInfo{ - Name: "caddy.storage.file_system", - New: func() Module { return new(fileStorage) }, - } -} - -func (s fileStorage) CertMagicStorage() (certmagic.Storage, error) { - return &certmagic.FileStorage{Path: s.Root}, nil -} - // homeDir returns the best guess of the current user's home // directory from environment variables. If unknown, "." (the // current directory) is returned instead. @@ -80,6 +59,3 @@ func dataDir() string { } return filepath.Join(baseDir, "caddy") } - -// Interface guard -var _ StorageConverter = fileStorage{} -- cgit v1.2.3