fix(webserver, ssl): email is required for generating a certificate

This commit is contained in:
Mahdi Dibaiee
2017-02-22 13:25:17 +03:30
parent 9311e349cb
commit 4b48fd0f2a
3 changed files with 11 additions and 3 deletions

View File

@ -16,7 +16,7 @@ module System.Serverman.Actions.Nginx (nginx) where
import Data.List
nginx :: ServerParams -> IO ()
nginx params@(ServerParams { ssl, serverService, domain, directory, serverType }) =
nginx params@(ServerParams { ssl, serverService, domain, directory, serverType, email }) =
do
-- Turn SSL off at first, because we have not yet received a certificate
let content = show (params { ssl = False, port = "80" })
@ -64,7 +64,7 @@ module System.Serverman.Actions.Nginx (nginx) where
putStrLn $ "restarted " ++ show serverService
createCert path cmd = do
result <- execute cmd ["certonly", "--webroot", "--webroot-path", directory, "-d", domain] "" False
result <- execute cmd ["certonly", "--webroot", "--webroot-path", directory, "-d", domain, "--email", email] "" False
case result of
Left _ -> if cmd == "letsencrypt" then createCert path "certbot" else return ()
Right stdout -> do

View File

@ -9,6 +9,7 @@ module System.Serverman.Actions.WebServer (ServerParams(..), ServerType(..)) whe
, domain :: String
, port :: String
, forward :: String
, email :: String
, ssl :: Bool
, serverType :: ServerType
, serverService :: Service