From fad7824a13580f505549cc746589c94542bec9cb Mon Sep 17 00:00:00 2001 From: Félix Sipma Date: Fri, 23 Feb 2018 16:33:00 +0100 Subject: rename Dhparams to Openssl --- src/Propellor/Property/Dhparams.hs | 26 -------------------------- src/Propellor/Property/Openssl.hs | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 26 deletions(-) delete mode 100644 src/Propellor/Property/Dhparams.hs create mode 100644 src/Propellor/Property/Openssl.hs (limited to 'src') diff --git a/src/Propellor/Property/Dhparams.hs b/src/Propellor/Property/Dhparams.hs deleted file mode 100644 index 2c30cb87..00000000 --- a/src/Propellor/Property/Dhparams.hs +++ /dev/null @@ -1,26 +0,0 @@ --- | Maintainer: Félix Sipma - -module Propellor.Property.Dhparams where - -import Propellor.Base -import qualified Propellor.Property.Apt as Apt -import qualified Propellor.Property.File as File -import Utility.FileMode -import Utility.SafeCommand - - -length' :: Int -length' = 2048 - -file :: FilePath -file = "/etc/ssl/private/dhparams.pem" - -safeDhparams :: Property DebianLike -safeDhparams = propertyList "safe dhparams" $ props - & File.dirExists (takeDirectory file) - & Apt.installed ["openssl"] - & check (not <$> doesFileExist file) (createDhparams file length') - -createDhparams :: FilePath -> Int -> Property UnixLike -createDhparams f l = property ("generate new dhparams: " ++ f) $ liftIO $ withUmask 0o0177 $ withFile f WriteMode $ \h -> - cmdResult <$> boolSystem' "openssl" [Param "dhparam", Param (show l)] (\p -> p { std_out = UseHandle h }) diff --git a/src/Propellor/Property/Openssl.hs b/src/Propellor/Property/Openssl.hs new file mode 100644 index 00000000..eb373e49 --- /dev/null +++ b/src/Propellor/Property/Openssl.hs @@ -0,0 +1,26 @@ +-- | Maintainer: Félix Sipma + +module Propellor.Property.Openssl where + +import Propellor.Base +import qualified Propellor.Property.Apt as Apt +import qualified Propellor.Property.File as File +import Utility.FileMode +import Utility.SafeCommand + + +dhparamsLength :: Int +dhparamsLength = 2048 + +dhparams :: FilePath +dhparams = "/etc/ssl/private/dhparams.pem" + +safeDhparams :: Property DebianLike +safeDhparams = propertyList "safe dhparams" $ props + & File.dirExists (takeDirectory file) + & Apt.installed ["openssl"] + & check (not <$> doesFileExist file) (createDhparams file length') + +createDhparams :: FilePath -> Int -> Property UnixLike +createDhparams f l = property ("generate new dhparams: " ++ f) $ liftIO $ withUmask 0o0177 $ withFile f WriteMode $ \h -> + cmdResult <$> boolSystem' "openssl" [Param "dhparam", Param (show l)] (\p -> p { std_out = UseHandle h }) -- cgit v1.2.3