From 6991fdd75285e4d2173d92251780bec02fd91660 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Mar 2016 23:50:11 -0400 Subject: fix to build with ghc 7.6.3 --- src/Propellor/Property/FreeBSD/Pkg.hs | 2 +- src/Propellor/Property/FreeBSD/Poudriere.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Propellor/Property/FreeBSD/Pkg.hs b/src/Propellor/Property/FreeBSD/Pkg.hs index 913710f7..6bbd2570 100644 --- a/src/Propellor/Property/FreeBSD/Pkg.hs +++ b/src/Propellor/Property/FreeBSD/Pkg.hs @@ -2,7 +2,7 @@ -- -- FreeBSD pkgng properties -{-# Language ScopedTypeVariables, GeneralizedNewtypeDeriving #-} +{-# Language ScopedTypeVariables, GeneralizedNewtypeDeriving, DeriveDataTypeable #-} module Propellor.Property.FreeBSD.Pkg where diff --git a/src/Propellor/Property/FreeBSD/Poudriere.hs b/src/Propellor/Property/FreeBSD/Poudriere.hs index 7ed7f59e..5467c668 100644 --- a/src/Propellor/Property/FreeBSD/Poudriere.hs +++ b/src/Propellor/Property/FreeBSD/Poudriere.hs @@ -2,7 +2,7 @@ -- -- FreeBSD Poudriere properties -{-# Language GeneralizedNewtypeDeriving #-} +{-# Language GeneralizedNewtypeDeriving, DeriveDataTypeable #-} module Propellor.Property.FreeBSD.Poudriere where -- cgit v1.3-2-g0d8e From 67054800d4dccdb6634b723652257b3a6d1538cf Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Mar 2016 23:54:43 -0400 Subject: when run w/o parameters as root, update from git and build Got lost in recent changes and broke the cron job. --- src/Propellor/CmdLine.hs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs index 1761a11e..ee057d05 100644 --- a/src/Propellor/CmdLine.hs +++ b/src/Propellor/CmdLine.hs @@ -122,11 +122,10 @@ defaultMain hostlist = withConcurrentOutput $ do go cr cmdline@(Spin hs mrelay) = buildFirst cr cmdline $ do unless (isJust mrelay) commitSpin forM_ hs $ \hn -> withhost hn $ spin mrelay hn - go cr (Run hn) = fetchFirst $ - ifM ((==) 0 <$> getRealUserID) - ( runhost hn - , go cr (Spin [hn] Nothing) - ) + go cr cmdline@(Run hn) = ifM ((==) 0 <$> getRealUserID) + ( updateFirst cr cmdline $ runhost hn + , fetchFirst $ go cr (Spin [hn] Nothing) + ) go cr cmdline@(SimpleRun hn) = forceConsole >> fetchFirst (buildFirst cr cmdline (runhost hn)) -- When continuing after a rebuild, don't want to rebuild again. -- cgit v1.3-2-g0d8e From f045116b618e255c583376447be635c245d63909 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 9 Mar 2016 01:29:37 -0400 Subject: Speed up propellor's build of itself, by asking cabal to only build the propellor-config binary and not all the libraries. This is a super speedup! --- debian/changelog | 2 ++ src/Propellor/Bootstrap.hs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/debian/changelog b/debian/changelog index 2dc562bf..a8fb5ecc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -24,6 +24,8 @@ propellor (2.17.0) UNRELEASED; urgency=medium * Locale.available: Run locale-gen, instead of dpkg-reconfigure locales, which modified the locale.gen file and sometimes caused the property to need to make changes every time. + * Speed up propellor's build of itself, by asking cabal to only build + the propellor-config binary and not all the libraries. -- Joey Hess Mon, 29 Feb 2016 17:58:08 -0400 diff --git a/src/Propellor/Bootstrap.hs b/src/Propellor/Bootstrap.hs index 11e59e6f..69eee66c 100644 --- a/src/Propellor/Bootstrap.hs +++ b/src/Propellor/Bootstrap.hs @@ -34,7 +34,7 @@ checkBinaryCommand = "if test -x ./propellor && ! ./propellor --check; then " ++ buildCommand :: ShellCommand buildCommand = intercalate " && " [ "cabal configure" - , "cabal build" + , "cabal build propellor-config" , "ln -sf dist/build/propellor-config/propellor-config propellor" ] @@ -141,7 +141,7 @@ build :: IO Bool build = catchBoolIO $ do make "dist/setup-config" ["propellor.cabal"] $ cabal ["configure"] - unlessM (cabal ["build"]) $ do + unlessM (cabal ["build", "propellor-config"]) $ do void $ cabal ["configure"] unlessM (cabal ["build"]) $ error "cabal build failed" -- cgit v1.3-2-g0d8e From ae5208110ea48e747112e47478d430ea93cd4e15 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 18 Mar 2016 23:05:09 -0400 Subject: Tor.named: Fix bug that sometimes caused the property to fail the first time, though retrying succeeded. May have only been a problem on debian stable, the /var/lib/tor/keys/ was not created by installing the package. --- debian/changelog | 2 ++ src/Propellor/Property/Tor.hs | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/debian/changelog b/debian/changelog index a8fb5ecc..b3f19cbb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -26,6 +26,8 @@ propellor (2.17.0) UNRELEASED; urgency=medium need to make changes every time. * Speed up propellor's build of itself, by asking cabal to only build the propellor-config binary and not all the libraries. + * Tor.named: Fix bug that sometimes caused the property to fail the first + time, though retrying succeeded. -- Joey Hess Mon, 29 Feb 2016 17:58:08 -0400 diff --git a/src/Propellor/Property/Tor.hs b/src/Propellor/Property/Tor.hs index e5fcdaa4..f7cb6c89 100644 --- a/src/Propellor/Property/Tor.hs +++ b/src/Propellor/Property/Tor.hs @@ -54,10 +54,20 @@ named n = configured [("Nickname", n')] torPrivKey :: Context -> Property HasInfo torPrivKey context = f `File.hasPrivContent` context `onChange` File.ownerGroup f user (userGroup user) - -- install tor first, so the directory exists with right perms - `requires` Apt.installed ["tor"] + `requires` torPrivKeyDirExists where - f = "/var/lib/tor/keys/secret_id_key" + f = torPrivKeyDir "secret_id_key" + +torPrivKeyDirExists :: Property NoInfo +torPrivKeyDirExists = File.dirExists torPrivKeyDir + `onChange` setperms + `requires` installed + where + setperms = File.ownerGroup torPrivKeyDir user (userGroup user) + `before` File.mode torPrivKeyDir 0O2700 + +torPrivKeyDir :: FilePath +torPrivKeyDir = "/var/lib/tor/keys" -- | A tor server (bridge, relay, or exit) -- Don't use if you just want to run tor for personal use. -- cgit v1.3-2-g0d8e From 2563624a77b4058d6b96ce0f099b2bee476fe359 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 18 Mar 2016 23:07:47 -0400 Subject: propellor spin --- src/Propellor/Property/Tor.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Propellor/Property/Tor.hs b/src/Propellor/Property/Tor.hs index f7cb6c89..0c040f95 100644 --- a/src/Propellor/Property/Tor.hs +++ b/src/Propellor/Property/Tor.hs @@ -73,9 +73,13 @@ torPrivKeyDir = "/var/lib/tor/keys" -- Don't use if you just want to run tor for personal use. server :: Property NoInfo server = configured [("SocksPort", "0")] - `requires` Apt.installed ["tor", "ntp"] + `requires` installed + `requires` Apt.installed ["ntp"] `describe` "tor server" +installed :: Property NoInfo +installed = Apt.installed ["tor"] + -- | Specifies configuration settings. Any lines in the config file -- that set other values for the specified settings will be removed, -- while other settings are left as-is. Tor is restarted when -- cgit v1.3-2-g0d8e