summaryrefslogtreecommitdiff
path: root/acme-certify.hs
diff options
context:
space:
mode:
Diffstat (limited to 'acme-certify.hs')
-rw-r--r--acme-certify.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/acme-certify.hs b/acme-certify.hs
index 8bad7ac..049ba5a 100644
--- a/acme-certify.hs
+++ b/acme-certify.hs
@@ -16,7 +16,7 @@
16module Main where 16module Main where
17 17
18import BasePrelude 18import BasePrelude
19import Control.Lens hiding ((&)) 19import Control.Lens hiding ((&), argument)
20import Control.Monad.IO.Class 20import Control.Monad.IO.Class
21import Control.Monad.Trans.Resource 21import Control.Monad.Trans.Resource
22import Data.Aeson.Lens 22import Data.Aeson.Lens
@@ -89,7 +89,8 @@ data CertifyOpts = CertifyOpts {
89} 89}
90 90
91data UpdateOpts = UpdateOpts { 91data UpdateOpts = UpdateOpts {
92 updateConfigFile :: Maybe FilePath 92 updateConfigFile :: Maybe FilePath,
93 updateHosts :: [String]
93} 94}
94 95
95instance Show HttpProvisioner where 96instance Show HttpProvisioner where
@@ -111,6 +112,7 @@ updateOpts = fmap Update $
111 (long "config" <> 112 (long "config" <>
112 metavar "FILENAME" <> 113 metavar "FILENAME" <>
113 help "location of YAML configuration file")) 114 help "location of YAML configuration file"))
115 <*> many (argument str (metavar "HOSTS"))
114 116
115certifyOpts :: Parser Command 117certifyOpts :: Parser Command
116certifyOpts = fmap Certify $ 118certifyOpts = fmap Certify $
@@ -187,7 +189,9 @@ runUpdate UpdateOpts { .. } = do
187 189
188 issuerCert <- readX509 letsEncryptX1CrossSigned 190 issuerCert <- readX509 letsEncryptX1CrossSigned
189 191
190 forM_ certReqDomains $ \(host, domain, domains) -> when (host == "fifty") $ do 192 let wantUpdate h = null updateHosts || isJust (find (== h) updateHosts)
193
194 forM_ certReqDomains $ \(host, domain, domains) -> when (wantUpdate host) $ do
191 putStrLn host 195 putStrLn host
192 let Just spec = dereference (map (chooseProvisioner host) domains) <&> certSpec globalCertificateDir keys host domain 196 let Just spec = dereference (map (chooseProvisioner host) domains) <&> certSpec globalCertificateDir keys host domain
193 print spec 197 print spec