From 605b301429c36a3a9ff9f921f69196c429e70224 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 11 Feb 2018 17:49:18 -0400 Subject: add missing period --- src/Propellor/Property/Atomic.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Propellor/Property') diff --git a/src/Propellor/Property/Atomic.hs b/src/Propellor/Property/Atomic.hs index 5db17474..8519048b 100644 --- a/src/Propellor/Property/Atomic.hs +++ b/src/Propellor/Property/Atomic.hs @@ -144,7 +144,7 @@ checkDirLink d rp = liftIO $ do -- Using atomicDirSync in the above example lets git only download -- the changes once, rather than the same changes being downloaded a second -- time to update the other copy of the directory the next time propellor --- runs +-- runs. -- -- Suppose that a web server program is run from the git repository, -- and needs to be restarted after the pull. That restart should be done -- cgit v1.3-2-g0d8e From c5785263996a88dbceee664805714ed5ed16c302 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 16 Feb 2018 18:16:21 -0700 Subject: Systemd.machined should install systemd-container on Debian stretch Signed-off-by: Sean Whitton --- src/Propellor/Property/Systemd.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Propellor/Property') diff --git a/src/Propellor/Property/Systemd.hs b/src/Propellor/Property/Systemd.hs index 51d1313c..8fa236d2 100644 --- a/src/Propellor/Property/Systemd.hs +++ b/src/Propellor/Property/Systemd.hs @@ -205,8 +205,8 @@ machined = withOS "machined installed" $ \w o -> case o of -- Split into separate debian package since systemd 225. (Just (System (Debian _ suite) _)) - | not (isStable suite) -> ensureProperty w $ - Apt.installed ["systemd-container"] + | not (isStable suite) || suite == (Stable "stretch") -> + ensureProperty w $ Apt.installed ["systemd-container"] _ -> noChange -- | Defines a container with a given machine name, -- cgit v1.3-2-g0d8e From 6749014553b13ad148cde450baefb241a98ed771 Mon Sep 17 00:00:00 2001 From: Félix Sipma Date: Fri, 23 Feb 2018 14:11:15 +0100 Subject: add Propellor.Property.Dhparams --- propellor.cabal | 1 + src/Propellor/Property/Dhparams.hs | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 src/Propellor/Property/Dhparams.hs (limited to 'src/Propellor/Property') diff --git a/propellor.cabal b/propellor.cabal index d9157eb1..b2ecb3d8 100644 --- a/propellor.cabal +++ b/propellor.cabal @@ -103,6 +103,7 @@ Library Propellor.Property.Cron Propellor.Property.DebianMirror Propellor.Property.Debootstrap + Propellor.Property.Dhparams Propellor.Property.DiskImage Propellor.Property.DiskImage.PartSpec Propellor.Property.Dns diff --git a/src/Propellor/Property/Dhparams.hs b/src/Propellor/Property/Dhparams.hs new file mode 100644 index 00000000..2c30cb87 --- /dev/null +++ b/src/Propellor/Property/Dhparams.hs @@ -0,0 +1,26 @@ +-- | 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 }) -- cgit v1.3-2-g0d8e 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 --- propellor.cabal | 2 +- src/Propellor/Property/Dhparams.hs | 26 -------------------------- src/Propellor/Property/Openssl.hs | 26 ++++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 27 deletions(-) delete mode 100644 src/Propellor/Property/Dhparams.hs create mode 100644 src/Propellor/Property/Openssl.hs (limited to 'src/Propellor/Property') diff --git a/propellor.cabal b/propellor.cabal index b2ecb3d8..b22abcba 100644 --- a/propellor.cabal +++ b/propellor.cabal @@ -103,7 +103,6 @@ Library Propellor.Property.Cron Propellor.Property.DebianMirror Propellor.Property.Debootstrap - Propellor.Property.Dhparams Propellor.Property.DiskImage Propellor.Property.DiskImage.PartSpec Propellor.Property.Dns @@ -141,6 +140,7 @@ Library Propellor.Property.Nginx Propellor.Property.Obnam Propellor.Property.OpenId + Propellor.Property.Openssl Propellor.Property.OS Propellor.Property.Pacman Propellor.Property.Parted 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.3-2-g0d8e From 788ad7bcff61147dbdde484d8d56ff6aead82659 Mon Sep 17 00:00:00 2001 From: Félix Sipma Date: Fri, 23 Feb 2018 16:33:53 +0100 Subject: add installed property to Openssl --- src/Propellor/Property/Openssl.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Propellor/Property') diff --git a/src/Propellor/Property/Openssl.hs b/src/Propellor/Property/Openssl.hs index eb373e49..1967301c 100644 --- a/src/Propellor/Property/Openssl.hs +++ b/src/Propellor/Property/Openssl.hs @@ -9,6 +9,9 @@ import Utility.FileMode import Utility.SafeCommand +installed :: Property DebianLike +installed = Apt.installed ["openssl"] + dhparamsLength :: Int dhparamsLength = 2048 @@ -18,7 +21,7 @@ dhparams = "/etc/ssl/private/dhparams.pem" safeDhparams :: Property DebianLike safeDhparams = propertyList "safe dhparams" $ props & File.dirExists (takeDirectory file) - & Apt.installed ["openssl"] + & installed & check (not <$> doesFileExist file) (createDhparams file length') createDhparams :: FilePath -> Int -> Property UnixLike -- cgit v1.3-2-g0d8e From c16bc5a806d0020f608a35185127430b65253981 Mon Sep 17 00:00:00 2001 From: Félix Sipma Date: Sat, 24 Feb 2018 21:31:03 +0100 Subject: Openssl: fix typo --- src/Propellor/Property/Openssl.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Propellor/Property') diff --git a/src/Propellor/Property/Openssl.hs b/src/Propellor/Property/Openssl.hs index 1967301c..a91b8195 100644 --- a/src/Propellor/Property/Openssl.hs +++ b/src/Propellor/Property/Openssl.hs @@ -20,9 +20,9 @@ dhparams = "/etc/ssl/private/dhparams.pem" safeDhparams :: Property DebianLike safeDhparams = propertyList "safe dhparams" $ props - & File.dirExists (takeDirectory file) + & File.dirExists (takeDirectory dhparams) & installed - & check (not <$> doesFileExist file) (createDhparams file length') + & check (not <$> doesFileExist dhparams) (createDhparams dhparams dhparamsLength) createDhparams :: FilePath -> Int -> Property UnixLike createDhparams f l = property ("generate new dhparams: " ++ f) $ liftIO $ withUmask 0o0177 $ withFile f WriteMode $ \h -> -- cgit v1.3-2-g0d8e